emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] preview latex fragment with latex_header


From: Andreas Leha
Subject: Re: [O] preview latex fragment with latex_header
Date: Thu, 07 Mar 2013 00:25:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Andreas Leha <address@hidden> writes:
>
>> I have a beamer presentation in org-mode that contains a line like
>> #+LaTeX_HEADER: \subtitle{foo}
>>
>> This prevents me from using 'org-preview-latex-fragment' as that one --
>> naturally, as it uses the article class -- fails with
>> 'Failed to create dvi file from /tmp/orgtex49760oq.tex'
>> due to
>>
>> ,----
>> | ERROR: Undefined control sequence.
>> | 
>> | --- TeX said ---
>> | l.38 \subtitle
>> `----
>>
>> What's the remedy here?
>
> Interesting. I put back use of #+latex_header keywords for latex
> snippets recently, but that is a double-edged sword. Overall, I'm not
> sure which is the right behaviour here. Is there one, anyway?
>
> To solve your problem, you can include your problematic header in a new
> latex class instead of relying on latex_header. Another solution is to
> put that latex_header line in an include file, or to generate it as
> a macro.

Thanks for the quick answer and for these hints.

In this particular situation (the \subtitle will always be document
specific) the latex class is not possible here -- I won't create latex
classes per document.

An include file just for a subtitle seems overkill.  So I went with the
macro.  If there were multiple offending lines, I'd probably use the
include file.

Anyway, just for reference, this is the macro:
#+begin_src org
#+MACRO: subtitle #+latex_header: \subtitle{$1}
{{{subtitle(foo)}}}
#+end_src

Downside is, that \ and , within the subtitle will have to be escaped.

Regards,
Andreas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]