From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: Re: Include lengthy LaTeX in export preamble Date: Sun, 27 Jul 2014 22:19:23 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158b5be307fb004ff378dcd Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBaX8-0005ba-SR for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:19:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBaX7-0003Vn-Ee for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:19:26 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:43273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBaX7-0003Vd-6L for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 22:19:25 -0400 Received: by mail-la0-f42.google.com with SMTP id pv20so4994687lab.15 for ; Sun, 27 Jul 2014 19:19:24 -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: Ken Mankoff Cc: emacs-orgmode@gnu.org --089e0158b5be307fb004ff378dcd Content-Type: text/plain; charset=UTF-8 On Sun, Jul 27, 2014 at 10:08 PM, Ken Mankoff 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 --089e0158b5be307fb004ff378dcd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On S= un, 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
| =C2=A0 (org-babel-goto-named-src-block "preamble")
| =C2=A0 (org-babel-tangle)
| #+end_src
|
| #+name: preamble
| #+begin_src latex :tangle preamble.tex
| =C2=A0 % 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-form= at-latex-header, I would at least take a look and try to come up with a pat= ch.

Thanks,
Jake
--089e0158b5be307fb004ff378dcd--