emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Documentclass for latex preview images


From: John Kitchin
Subject: Re: [O] Documentclass for latex preview images
Date: Sun, 07 Aug 2016 16:38:14 -0400
User-agent: mu4e 0.9.16; emacs 25.1.50.1

See the variable org-format-latex-header.


Maik Schünemann writes:

> Hi,
>
> Is there an option to set the documentclass that is used in temporary files
> to create latex preview images?
>
> I am writing math texts with org mode and am using amsthm for theorems etc
> and let them be counted by chapter:
>
> #+LATEX_HEADER: \usepackage{amsthm}
> #+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
> #+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
> #+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]
>
> After I put these lines in my .org file, latex preview images stopped
> working although latex export still did. The problem is that in the
> temporary files used to generate the preview images, the documentclass
> article is used which doesn't define the counter chapter.
>
> I managed to resolve this issue for me by checking for presence of the
> counter.
> #+LATEX_HEADER: \makeatletter
> #+LATEX_HEADER: address@hidden@#1}{#3}{#2}}
> #+LATEX_HEADER: \makeatother
> #+LATEX_HEADER: \ifcounter{chapter}{
> #+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
> #+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
> #+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]
> #+LATEX_HEADER: }{}
>
>
> Is there a downside to using the same document class as the org file
> specifies for export to create the preview images?
>
> Thanks,
> Maik


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

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