emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First steps exporting to tex


From: Martin Steffen
Subject: Re: First steps exporting to tex
Date: Sat, 03 Apr 2021 12:15:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

>>>>> "Ypo" == Ypo  <ypuntot@gmail.com> writes:

    Ypo> Good morning

    Ypo> After reading your interesting advices, I've decided to start
    Ypo> my path through LaTeX. I have been some hours trying to start,
    Ypo> with little result, but I hope that once established a
    Ypo> *workflow* the results will come and the new invested time will
    Ypo> be directed just to get better and better results.

    Ypo> My doubts:

    Ypo>  a. As first step for my workflow, it seems convenient to use a
    Ypo> "template" with the LaTeX preambles. So maybe the many existing







    Ypo> LaTeX templates can be used quickly with orgmode. I found
    Ypo> several options and opinions. Which one is the best way?

I say my advice as a "LaTeX-first" person (i.e., I was familiar with
LaTeX before org was around. When I discovered org, which I found
useful in many ways, so I tried to familiarize myself also to find out
how I could make it useful in tandem with latex.

So, for me, stuff that works well in LaTeX, I did not port for myself to
org, things where org helps me to make better use of latex, I tried to
figure out.

For you, being familiar with org, but not (yet) with latex, you may
follow different patterns.

For the "preamble" of a latex document, the general setup that comes
_before_ \begin{document} and before any output is generated, I use
native latex using  instructions like

#+latex_header: \input{switches}
#+latex_header: \input{preamble}
#+latex_header: \input{style/style-common}
#+latex_header: \input{macros}

I often separate the preamble from macros. preamble.tex is (for me) the
file which contains loading of packages and classes (usepackage  etc,
and corresponding adapations or settings for that package). macros.tex is
things I define using \newcommand (or \def or \newenvironment or
similar)


As far controlling input is concerned, I also rely on latex-specific
setting (outside org, also outside emacs), things like environment
settings like $TEXINPUT, a path-specification, where one can control
where LaTeX finds (additional) stylefiles, outside of the standard
``load-path''.

Thus, I often try to avoid to use hardcoded things, like

>>> \input{~//export//template.tex}

I would use \input{template} (".tex" is not needed) and I make sure, the
templatex.tex file is included in the $TEXINPUTS-path. Typically, the
current directory "./"  should be included by default (and stuff from
the latex-installation is also routinely found)

BTW: also when working with pics (with includegraphs), there is a
variable (inside latex) that controls where to find figures. So, what I
typically would to is things like

\usepackage{graphicx}
\graphicspath{{./figures/}}   

That specifies that the pics for \includegrapic are found in a direcory
figures, and then I would use

\includegraphics[width=4cm]{jpgfigure}

not jpgfigure.jpg; \includegraphics can figure it out, if it's a PDF or
a jpg; it would also chose ps, if you don't use pdflatex, but latex (I
still prefer the xdvi-viewer as faster and more fluent to navigate, I
never like any PDF viewer when doing latex, only at the end, I generate
the PDF).


One can of course ``inline'' all that inside org (like doing a
\newcommand inside ``org'', it's just I prefer to keep all the stuff in
one (or more) latex files; for those parts I rely on latex (since org
does not bring much additional value to the table for the premable
stuff, at least for me)

Martin









    Ypo> 1 #+SETUPFILE: template.setup -> doesn't seem the ideal way,
    Ypo> because the template.setup file must be modified adding
    Ypo> #+latex_class to each of the lines.  2 template.tex -> this
    Ypo> could be added to the SETUPFILE: #+LATEX_HEADER:
    Ypo> \input{template.tex}. But it seems to have no effect on the PDF
    Ypo> output. BTW, I can't use emacs HOME path (~/) in the input
    Ypo> header, like \input{~//export//template.tex}. This is my
    Ypo> template.tex file content: \usepackage{fancyhdr}
    Ypo> \thispagestyle{fancy}
    Ypo> \lhead{\includegraphics[width=4cm]{jpg.jpg}} \rhead{Student
    Ypo> Name: Name\\ Student ID: 1234\\ Course: IDB 601 (Fall 2020)} 3
    Ypo> Another friend told me that .sty templates were the best way.
    Ypo> 4 I see some people that create customized LaTeX classes and
    Ypo> add the desired class to the orgmode buffer.  5 Also we can see
    Ypo> this intricate transformation of a LaTeX template into
    Ypo> orgmode. How to Migrate LaTeX Template into org-mode 6 ...

    Ypo>  b. I think that in a good integration, every character shown
    Ypo> on orgmode should be exported into the PDF output. For example
    Ypo> "CENTRE LINE SYMBOL": ℄ How can this integration be done?

    Ypo>  I have more doubts, but I will keep reading and trying to
    Ypo> solve them

    Ypo>  Best regards




reply via email to

[Prev in Thread] Current Thread [Next in Thread]