From: John Kitchin <jkitchin@andrew.cmu.edu>
To: "Maik Schünemann" <maikschuenemann@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Documentclass for latex preview images
Date: Sun, 07 Aug 2016 16:38:14 -0400 [thread overview]
Message-ID: <m260rcz555.fsf@Johns-MacBook-Air.local> (raw)
In-Reply-To: <CAGXfcpwO9547woqm7dBpA+=pc8ofMHZoPfah3zH2fyX2Vvhuhg@mail.gmail.com>
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: \newcommand\ifcounter[3]{\@ifundefined{c@#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
prev parent reply other threads:[~2016-08-07 20:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 13:22 Documentclass for latex preview images Maik Schünemann
2016-08-07 20:38 ` John Kitchin [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m260rcz555.fsf@Johns-MacBook-Air.local \
--to=jkitchin@andrew.cmu.edu \
--cc=emacs-orgmode@gnu.org \
--cc=maikschuenemann@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.