emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] babel noob question: how to have babel create png using tikz?


From: Julius Dittmar
Subject: [O] babel noob question: how to have babel create png using tikz?
Date: Sun, 14 Oct 2018 14:00:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Hi folks,

somehow I do not manage to get babel to create a png image using tikz
package. It does create an image, but that image looks exactly as if the
tikz package were not loaded during the generating latex run and all of
latex's error messages were ignored.

Here's what I do:

- emacs -q mini.org
  (that's GNU Emacs 26.1, Org mode version 9.1.9, same result with
current master, mini.org see below)
- Go to first source block, C-c C-c.
- Go to second source block, C-c C-c.
- Have a look at the generated test.png
  It displays the text "[red!50!black] (a) {A}; (b) [right of=a] {B};
[->] (a) -- (b);"

Where's my mistake?

Thanks in advance,

Julius Dittmar

mini.org:
----------------------------

#+begin_src elisp :exports none :eval never-export
(org-babel-do-load-languages 'org-babel-load-languages '((latex . t)))
#+end_src


#+header: :file test.png :fit yes
#+header: :results (if (and (boundp 'backend) (eq backend 'latex))
"latex" "file")
#+begin_src latex :exports results :file test.png :headers
'("\\usepackage{tikz}")
  \begin{tikzpicture}
    \node[red!50!black] (a) {A};
    \node (b) [right of=a] {B};
    \draw[->] (a) -- (b);
  \end{tikzpicture}
#+end_src

--------------------------------------

PS: except for omitting the ImageMagic call I took this example from
https://org-babel.readthedocs.io/en/latest/eval/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]