emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problems producing TikZ PNGs from LaTeX src blocks
@ 2018-09-28  9:39 Christian Moe
  2018-09-28 10:27 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Moe @ 2018-09-28  9:39 UTC (permalink / raw)
  To: Emacs-orgmode

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


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


[-- Attachment #2: tikzpic.png --]
[-- Type: image/png, Size: 891 bytes --]

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

end of thread, other threads:[~2018-09-30 19:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-28  9:39 Problems producing TikZ PNGs from LaTeX src blocks Christian Moe
2018-09-28 10:27 ` Eric S Fraga
2018-09-29 21:07   ` [patch] Problems producing TikZ PNGs from LaTeX src blocks (was: Problems producing TikZ PNGs from LaTeX src blocks) Benjamin Motz
2018-09-30 19:43     ` Christian Moe
     [not found]   ` <87mus18z8t.fsf@christianmoe.com>
2018-09-30 18:47     ` Fwd: Re: Problems producing TikZ PNGs from LaTeX src blocks Christian Moe
     [not found]     ` <87sh1tsmm0.fsf@delle7240.chemeng.ucl.ac.uk>
2018-09-30 18:56       ` Christian Moe

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