emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Bug] Errors when evaluating LaTeX source block with new SVG headers patch
@ 2014-09-22 10:05 Tobias Getzner
  0 siblings, 0 replies; only message in thread
From: Tobias Getzner @ 2014-09-22 10:05 UTC (permalink / raw)
  To: emacs-orgmode

Evaluating LaTeX source blocks had an issue where header options would be 
ignored when exporting to SVG; this appears to have been addressed in 
246df88. I have patched this commit into my 8.2.7c installation. While 
the headers now seem to work, I’ve noticed that LaTeX still doesn’t like 
the generated temporary files when SVG-output is selected. Below is an 
example which fails to work when SVG output is chosen, but which will 
work when PNG is used.

#+HEADERS: :headers '("\\usepackage{tikz}" "\\usetikzlibrary
{shapes,arrows,positioning}")
#+BEGIN_src latex :file test.svg :imagemagick
\begin{tikzpicture}
  \node {quux quux quux};
\end{tikzpicture}
#+END_SRC

The generated temporary LaTeX file is shown below.

\documentclass[preview]{standalone}
\def\pgfsysdriver{pgfsys-tex4ht.def}
\usepackage[usenames]{color}
\usepackage{tikz}
\usepackage{color}
\usepackage{listings}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\begin{document}\begin{tikzpicture}
\node {quux};
\end{tikzpicture}\end{document}

By default, LaTeX will choke on this with a lot of undefined command 
errors. I have no clue about PGF, but I’ve noticed that if I insert 
«\usepackage{pgf}» before the «\def\pgfsysdriver» line, this will resolve 
those errors. Should this be done in ob-latex too?

After these errors are resolved, though, LaTeX will still complain about 
an option clash for the color package. At first I thought this might be 
because the colors package is imported twice. But apparently PGF will 
also import colors, so that both the «\usepackage{pgf}» and the «\def
\pgfsysdriver» had to come after «\usepackage[usenames]{color}».

Best regards,
T.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-22 10:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 10:05 [Bug] Errors when evaluating LaTeX source block with new SVG headers patch Tobias Getzner

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