emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Emacs-orgmode@gnu.org
Subject: Problems producing TikZ PNGs from LaTeX src blocks
Date: Fri, 28 Sep 2018 11:39:12 +0200	[thread overview]
Message-ID: <87efdenepr.fsf@christianmoe.com> (raw)

[-- 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 --]

             reply	other threads:[~2018-09-28  9:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28  9:39 Christian Moe [this message]
2018-09-28 10:27 ` Problems producing TikZ PNGs from LaTeX src blocks 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efdenepr.fsf@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=Emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).