emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* preview latex fragment with latex_header
@ 2013-03-06 20:04 Andreas Leha
  2013-03-06 22:47 ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Leha @ 2013-03-06 20:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

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?

Thanks in advance!

Regards,
Andreas

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

* Re: preview latex fragment with latex_header
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-03-06 22:47 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

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.


Regards,

-- 
Nicolas Goaziou

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

* Re: preview latex fragment with latex_header
  2013-03-06 22:47 ` Nicolas Goaziou
@ 2013-03-06 23:25   ` Andreas Leha
  2013-03-07  6:14     ` Achim Gratz
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Leha @ 2013-03-06 23:25 UTC (permalink / raw)
  To: emacs-orgmode

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

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

* Re: preview latex fragment with latex_header
  2013-03-06 23:25   ` Andreas Leha
@ 2013-03-07  6:14     ` Achim Gratz
  2013-03-07  7:14       ` Andreas Leha
  0 siblings, 1 reply; 10+ messages in thread
From: Achim Gratz @ 2013-03-07  6:14 UTC (permalink / raw)
  To: emacs-orgmode

Andreas Leha writes:
> 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.

Classes can have arguments and the argument would be the subtitle to
set, so I don't understand that objection.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

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

* Re: preview latex fragment with latex_header
  2013-03-07  6:14     ` Achim Gratz
@ 2013-03-07  7:14       ` Andreas Leha
  2013-03-07  8:04         ` Nicolas Goaziou
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Leha @ 2013-03-07  7:14 UTC (permalink / raw)
  To: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Andreas Leha writes:
>> 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.
>
> Classes can have arguments and the argument would be the subtitle to
> set, so I don't understand that objection.
>

Right.  That holds for properly designed LaTeX classes.  But I was talking
about one of my LaTeX classes....

Here, the macro was just so much cheaper, so again no pressure to
improve my LaTeX class ;-)

Regards,
Andreas

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

* Re: preview latex fragment with latex_header
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Nicolas Goaziou @ 2013-03-07  8:04 UTC (permalink / raw)
  To: Andreas Leha; +Cc: emacs-orgmode

Hello,

Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:

> Achim Gratz <Stromeko@nexgo.de> writes:
>
>> Andreas Leha writes:
>>> 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.
>>
>> Classes can have arguments and the argument would be the subtitle to
>> set, so I don't understand that objection.
>>
>
> Right.  That holds for properly designed LaTeX classes.  But I was talking
> about one of my LaTeX classes....
>
> Here, the macro was just so much cheaper, so again no pressure to
> improve my LaTeX class ;-)

I introduced LATEX_HEADER_EXTRA keyword, which will do the same as
LATEX_HEADER but will not be used to preview latex snippets.  Note that
lines included in LATEX_HEADER_EXTRA will always appear after those
defined by LATEX_HEADER keywords in the output.


Regards,

-- 
Nicolas Goaziou

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

* Re: preview latex fragment with latex_header
  2013-03-07  8:04         ` Nicolas Goaziou
@ 2013-03-07  8:47           ` Andreas Leha
  2013-04-15 21:01           ` Bastien
  1 sibling, 0 replies; 10+ messages in thread
From: Andreas Leha @ 2013-03-07  8:47 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Achim Gratz <Stromeko@nexgo.de> writes:
>>
>>> Andreas Leha writes:
>>>> 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.
>>>
>>> Classes can have arguments and the argument would be the subtitle to
>>> set, so I don't understand that objection.
>>>
>>
>> Right.  That holds for properly designed LaTeX classes.  But I was talking
>> about one of my LaTeX classes....
>>
>> Here, the macro was just so much cheaper, so again no pressure to
>> improve my LaTeX class ;-)
>
> I introduced LATEX_HEADER_EXTRA keyword, which will do the same as
> LATEX_HEADER but will not be used to preview latex snippets.  Note that
> lines included in LATEX_HEADER_EXTRA will always appear after those
> defined by LATEX_HEADER keywords in the output.
>

Thank you very much for this convenient keyword!  Much appreciated.
Haven't tested yet, but will use this a lot, I guess.

(I will definitely *not* improve my LaTeX class now ;-)

Regards,
Andreas

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

* Re: preview latex fragment with latex_header
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2013-04-15 21:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Andreas Leha, emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> I introduced LATEX_HEADER_EXTRA keyword, which will do the same as
> LATEX_HEADER but will not be used to preview latex snippets.

We need to document this in the manual.  Can you add a note?

Also, the docstring of `org-latex-classes' uses [EXTRA] and
[NO-EXTRA], but this does not refer to #+LATEX_HEADER_EXTRA
so perhaps we should make it more explicit here.

Thanks,

-- 
 Bastien

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

* Re: preview latex fragment with latex_header
  2013-04-15 21:01           ` Bastien
@ 2013-04-15 21:26             ` Nicolas Goaziou
  2013-04-15 21:42               ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Goaziou @ 2013-04-15 21:26 UTC (permalink / raw)
  To: Bastien; +Cc: Andreas Leha, emacs-orgmode

Hello,

Bastien <bzg@gnu.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> I introduced LATEX_HEADER_EXTRA keyword, which will do the same as
>> LATEX_HEADER but will not be used to preview latex snippets.
>
> We need to document this in the manual.  Can you add a note?

Done.

> Also, the docstring of `org-latex-classes' uses [EXTRA] and
> [NO-EXTRA], but this does not refer to #+LATEX_HEADER_EXTRA
> so perhaps we should make it more explicit here.

It does, a few lines above and a few lines below. Done anyway.


Regards,

-- 
Nicolas Goaziou

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

* Re: preview latex fragment with latex_header
  2013-04-15 21:26             ` Nicolas Goaziou
@ 2013-04-15 21:42               ` Bastien
  0 siblings, 0 replies; 10+ messages in thread
From: Bastien @ 2013-04-15 21:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Andreas Leha, emacs-orgmode

Thanks!

-- 
 Bastien

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

end of thread, other threads:[~2013-04-15 21:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).