[-- Attachment #1: Type: text/plain, Size: 508 bytes --] I have a lengthy command customization that I want to include in LaTeX export. Since it must appear in the preamble, #+BEGIN_LATEX ... #+END_LATEX didn't work. I had to prepend #+LATEX_HEADER: to each line in order to achieve my result. I found C-h v org-format-latex-header RET: "The document header used for processing LaTeX fragments..." But it seems that when the docstring says "fragments," it is not referring to exporting. Are there any customizations to do the same during export? Thanks, Jake [-- Attachment #2: Type: text/html, Size: 785 bytes --]
Hi Jacob, #+LATEX_HEADER: does work on export (when else would it work?) I think I recall a space between the ":" and the LaTeX command is needed. Do you have one? For more ideas on how to have lengthy custom headers, see thread here: https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg00734.html and links therein. There are three general approaches: 1) Make a custom class file and include that, either in your init file or in the Org file. 2) From Aaron Ecay, put your header in a #+BEGIN_SRC latex section, and then run a bit of lisp to export that section, and then include the exported file in a #+LATEX_HEADER: \include{preamble}. This is the approach I use. ,---- | #+begin_src emacs-lisp | (org-babel-goto-named-src-block "preamble") | (org-babel-tangle) | #+end_src | | #+name: preamble | #+begin_src latex :tangle preamble.tex | % code goes here | #+end_src `---- 3) Implement a patch or pester developers to create a third simpler solution. Good luck, -k. * On 2014-07-27 at 21:00, Jacob Gerlach wrote: > I have a lengthy command customization that I want to include in LaTeX > export. Since it must appear in the preamble, > #+BEGIN_LATEX > ... > #+END_LATEX > > didn't work. I had to prepend > #+LATEX_HEADER: > to each line in order to achieve my result. > > I found C-h v org-format-latex-header RET: > > "The document header used for processing LaTeX fragments..." > > But it seems that when the docstring says "fragments," it is not referring > to exporting. > > Are there any customizations to do the same during export? > > Thanks, > Jake
[-- Attachment #1: Type: text/plain, Size: 926 bytes --] On Sun, Jul 27, 2014 at 10:08 PM, Ken Mankoff <mankoff@gmail.com> wrote: > Hi Jacob, > > #+LATEX_HEADER: does work on export (when else would it work?) > > Agreed. If I said otherwise it was a mistake. 2) From Aaron Ecay, put your header in a #+BEGIN_SRC latex section, and > then run a bit of lisp to export that section, and then include the > exported file in a #+LATEX_HEADER: \include{preamble}. This is the > approach I use. > > ,---- > | #+begin_src emacs-lisp > | (org-babel-goto-named-src-block "preamble") > | (org-babel-tangle) > | #+end_src > | > | #+name: preamble > | #+begin_src latex :tangle preamble.tex > | % code goes here > | #+end_src > `---- > This looks handy. Thanks! My elisp ability is minimal, but if someone can point me towards where I would look to try to create an export analogue to org-format-latex-header, I would at least take a look and try to come up with a patch. Thanks, Jake [-- Attachment #2: Type: text/html, Size: 1957 bytes --]