From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: preview latex fragment with latex_header
Date: Thu, 07 Mar 2013 00:25:43 +0100 [thread overview]
Message-ID: <87zjygdsaw.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 871ubsdu2w.fsf@gmail.com
Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> 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
next prev parent reply other threads:[~2013-03-06 23:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 20:04 preview latex fragment with latex_header Andreas Leha
2013-03-06 22:47 ` Nicolas Goaziou
2013-03-06 23:25 ` Andreas Leha [this message]
2013-03-07 6:14 ` Achim Gratz
2013-03-07 7:14 ` Andreas Leha
2013-03-07 8:04 ` Nicolas Goaziou
2013-03-07 8:47 ` Andreas Leha
2013-04-15 21:01 ` Bastien
2013-04-15 21:26 ` Nicolas Goaziou
2013-04-15 21:42 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zjygdsaw.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).