Yaroslav Drachov <[email protected]> writes:

>> Could you provide a specific example you are having trouble with?
>
> Of course, sorry for not providing it in the first place. Even this
> simplified version of the last example from ob-latex documentation
> doesn't work
>
> #+LATEX_HEADER: \usepackage{tikz}
>
> * Tikz test
> Here's a tree, exported to both html and pdf.
>
> #+header: :file tree.svg
> #+header: :imagemagick
> #+header: :results raw
> #+begin_src latex
>   \usetikzlibrary{trees}
>   \begin{tikzpicture}
>     \node [circle, draw, fill=red!20] at (0,0) {1}
>     child { node [circle, draw, fill=blue!30] {2}
>       child { node [circle, draw, fill=green!30] {3} }
>       child { node [circle, draw, fill=yellow!30] {4} }};
>   \end{tikzpicture}
> #+end_src

Confirmed.

> The cure for it is setting
> (setq org-babel-latex-preamble (lambda (_)
>     "\\documentclass[preview]{standalone}"))
>
> and adding =#+header: :headers '("\\usepackage{tikz}")=
> to the block headers so it looks like
> ...
> The latter block execution produces correct output. The former one's
> relevant part of *Org PDF LaTeX Output* log is
> ! Undefined control sequence.
> \pgfsys@beginpicture ...ys@svg@boxmodefalse \EndP 
>                                                   \HtmlParOff \pgfkeys
>                                                   {/pgf...
> So it obviously doesn't like this part of =org-babel-latex-preamble=
> \\def\\pgfsysdriver{pgfsys-tex4ht.def}
> designed specifically for html export and used for some reason in
> imagemagick's one (as well as svg without imagemagick header)

Probably we should remove it. Or maybe use dvisvgm, not inkscape.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to