From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: preview latex fragment with latex_header Date: Thu, 07 Mar 2013 00:25:43 +0100 Message-ID: <87zjygdsaw.fsf@med.uni-goettingen.de> References: <87hakofg7g.fsf@med.uni-goettingen.de> <871ubsdu2w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDNii-0001LY-PO for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 18:26:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDNig-00069Z-5U for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 18:26:00 -0500 Received: from plane.gmane.org ([80.91.229.3]:44537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDNif-00069O-N3 for emacs-orgmode@gnu.org; Wed, 06 Mar 2013 18:25:58 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UDNiy-0007rh-4A for emacs-orgmode@gnu.org; Thu, 07 Mar 2013 00:26:16 +0100 Received: from vpn-2097.gwdg.de ([134.76.2.97]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Mar 2013 00:26:16 +0100 Received: from andreas.leha by vpn-2097.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Mar 2013 00:26:16 +0100 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Andreas Leha 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