From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Include lengthy LaTeX in export preamble Date: Sun, 27 Jul 2014 22:08:07 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBaPi-0003U2-Vg for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:11:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBaPb-0001St-LF for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:11:46 -0400 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:64170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBaPb-0001RM-Fk for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:11:39 -0400 Received: by mail-qg0-f46.google.com with SMTP id z60so7823435qgd.33 for ; Sun, 27 Jul 2014 19:11:38 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jacob Gerlach Cc: emacs-orgmode@gnu.org 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