From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Ypo <ypuntot@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: First steps exporting to tex
Date: Sat, 03 Apr 2021 14:10:30 +0200 [thread overview]
Message-ID: <87sg47bmbt.fsf@posteo.net> (raw)
In-Reply-To: <d9457845-3010-f1f1-b8c9-7ee4edc95842@gmail.com> (Ypo's message of "Sat, 3 Apr 2021 11:31:27 +0200")
Hi Ypo,
I think that, as a starting point, the concepts that belong to Org and
those that belong to LaTeX should be separated.
Ypo writes:
> [...]
> 2 template.tex -> this could be added to the SETUPFILE:
> #+LATEX_HEADER: \input{template.tex}. But it seems to have no effect
> on the PDF output. BTW, I can't use emacs HOME path (~/) in the
> input header, like \input{~//export//template.tex}.
The keyword #+LaTeX_Header pass literal LaTeX commands in a single line
to thepreamble. The LaTeX \input{...} command should follow the path of
the file you want include, but I see that you are indicating the path
with a double //. The correct way is \input{~/export/template.tex}
> 3 Another friend told me that .sty templates were the best way.
A *.sty file is what is known in LaTeX jargon as a "package", and it
would come to be the equivalent of what is a *.el file in Emacs,
/mutatis mutandis/. In a sty file you can put whatever you want, but a
different syntax must be used and these files are subject to a series of
good practices. Therefore, a sty file is more indicated to introduce
'heavy' code that you want reuse in other documents (defined commands
and macros, etc.). In short, what comes to be a package ;-) At the user
level, and unless you want to write your own package (see:
https://www.overleaf.com/learn/latex/Writing_your_own_package), it is
almost never necessary.
> 4 I see some people that create customized LaTeX classes and add the
> desired class to the orgmode buffer.
Great care must be taken here. One thing is a LaTeX class, which is
something laborious and complex to write, and another thing what Org
understands for a LaTeX class :-) Classen and the class concept are a
essential component for LaTeX, as a class is the first thing you must
declare in a preamble with the command \documentclass{}. There are the
standard classes (article, book and others) and other ones, more
specialized. A class changes globally the behavior of the document and
all LaTeX commands as \section, \subsection and many more, and add its
own commands.
A 'LaTeX class' for Org is a light translation of the above. It is
actually "what type of LaTeX document you want to get".
You can easily define your own LaTeX 'classes' for Org documents. For
example: I have an 'empty class', to be able to add the entire preamble,
without Org charging me anything before the \begin{document}
(add-to-list 'org-latex-classes
'("empty"
"[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
And I have in my ~/.emacs:
(setq org-latex-default-class "empty")
(setq org-latex-default-packages-alist nil)
(setq org-latex-packages-alist nil)
(setq org-latex-hyperref-template nil)
My advice, as has already been commented here, is that you get familiar
with LaTeX for a while, and then see how you can fit LaTeX in your Org
workflow, if that's more productive for you.
Best regards,
Juan Manuel
next prev parent reply other threads:[~2021-04-03 12:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-03 9:31 First steps exporting to tex Ypo
2021-04-03 10:15 ` Martin Steffen
2021-04-04 11:04 ` Ypo
2021-04-04 11:36 ` Juan Manuel Macías
2021-04-05 5:05 ` Tim Cross
2021-04-03 10:43 ` Dr. Arne Babenhauserheide
2021-04-03 12:10 ` Juan Manuel Macías [this message]
2021-04-03 13:31 ` Tim Cross
2021-04-03 16:55 ` Diego Zamboni
2021-04-03 17:07 ` William Denton
2021-04-03 17:49 ` Juan Manuel Macías
2021-04-03 18:36 ` Jean Louis
2021-04-03 20:46 ` Juan Manuel Macías
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg47bmbt.fsf@posteo.net \
--to=maciaschain@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=ypuntot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.