emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Include lengthy LaTeX in export preamble
@ 2014-07-28  1:00 Jacob Gerlach
  2014-07-28  2:08 ` Ken Mankoff
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Gerlach @ 2014-07-28  1:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include lengthy LaTeX in export preamble
  2014-07-28  1:00 Include lengthy LaTeX in export preamble Jacob Gerlach
@ 2014-07-28  2:08 ` Ken Mankoff
  2014-07-28  2:19   ` Jacob Gerlach
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Mankoff @ 2014-07-28  2:08 UTC (permalink / raw)
  To: Jacob Gerlach; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Include lengthy LaTeX in export preamble
  2014-07-28  2:08 ` Ken Mankoff
@ 2014-07-28  2:19   ` Jacob Gerlach
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Gerlach @ 2014-07-28  2:19 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: emacs-orgmode

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-28  2:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28  1:00 Include lengthy LaTeX in export preamble Jacob Gerlach
2014-07-28  2:08 ` Ken Mankoff
2014-07-28  2:19   ` Jacob Gerlach

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).