emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Documentclass for latex preview images
@ 2016-08-05 13:22 Maik Schünemann
  2016-08-07 20:38 ` John Kitchin
  0 siblings, 1 reply; 2+ messages in thread
From: Maik Schünemann @ 2016-08-05 13:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1632 bytes --]

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

end of thread, other threads:[~2016-08-07 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05 13:22 Documentclass for latex preview images Maik Schünemann
2016-08-07 20:38 ` John Kitchin

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