emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Embedding diagrams in Org


From: Marcin Borkowski
Subject: Re: [O] Embedding diagrams in Org
Date: Sat, 21 Mar 2015 12:23:14 +0100

On 2015-02-18, at 20:37, Andreas Leha <address@hidden> wrote:

> I also use tikz in my org files.  I just include a slightly more
> involved version of Eric's example to show some of the beauty of org.

OK, so I'm trying to understand it.  (One of the reasons is that it
doesn't work for me; somehow I couldn't get the svg export for inclusion
in HTML.  OTOH, conversion using pdf2svg does work for me (in LaTeX
files), so I want to learn how to utilize it for Org-mode.)

> This includes a caption for the diagram, and different output formats
> for different export routes.
>
> Best,
> Andreas
>
> --8<---------------cut here---------------start------------->8---
> #+LATEX_HEADER: \usepackage{tikz}
>
> * tikz example
>
> #+name: tikz_example
> #+header: :packages '(("" "tikz"))

What does the above line do exactly?

> #+header: :file (by-backend (latex "example_diagram.tikz") (html 
> "example_diagram.svg") (t "example_diagram.png"))

The manual says that after :file I can have a string or a list of two
strings.  Does the above mean that it is in fact macroexpanded?  Do
I get it correctly that the (t "example_diagram.png") refers to manual
evaluation and not the evaluation during the export?

> #+header: :imagemagick yes :iminoptions -density 600 :imoutoptions -geometry 
> 800
> #+header: :results file raw
> #+header: :fit yes
> #+begin_src latex
>   \begin{tikzpicture}
>     \node[red!50!black] (a) {A};
>     \node (b) [right of=a] {B};
>     \draw[->] (a) -- (b);
>   \end{tikzpicture}
> #+end_src

And, last but not least: how exactly the magic of tikz -> svg is
supposed to work here?  Do I get it correctly that in you example,
Imagemagick handles both png and svg?  What if I want to use pdf2svg
instead?

> #+caption: A tikz example diagram with a caption
> #+results: tikz_example
> [[file:example_diagram.png]]
> --8<---------------cut here---------------end--------------->8---

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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