[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] Problems producing TikZ PNGs from LaTeX src blocks
From: |
Christian Moe |
Subject: |
[O] Problems producing TikZ PNGs from LaTeX src blocks |
Date: |
Fri, 28 Sep 2018 11:39:12 +0200 |
User-agent: |
mu4e 0.9.19; emacs 24.5.1 |
Hi,
I am trying to generate a PNG file with a TikZ picture from a LaTeX src
block, looking at instructions here:
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html
I try this:
#+header: :file "tikzpic.png" :fit yes :results raw file :exports results
:headers '("\\usepackage{tikz}")
#+begin_src latex
\begin{tikzpicture}
\draw [fill=green] (0,4) -- (3,0) -- (-3,0) -- cycle;
\end{tikzpicture}
#+end_src
Expected result: A tikzpic.png image of a green triangle.
Actual result: A tikzpic.png image (attached) that only shows the line
of TikZ code. It seems that the :headers argument isn't working.
If I add a #+LATEX_HEADER: \usepackage{tikz} line to my document, I can
export latex blocks as well as latex src blocks as drawings within an
exported PDF. But exporting the image as a PNG file continues to fail
(in this case, for some reason, the above src block results in an empty
image, no longer showing either the code or the intended picture).
What might I be missing?
Yours,
Christian
tikzpic.png
Description: PNG image
- [O] Problems producing TikZ PNGs from LaTeX src blocks,
Christian Moe <=