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: Sebastien Vauban
Subject: Re: [O] Embedding diagrams in Org
Date: Thu, 19 Feb 2015 09:49:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

Hello Andreas,

Andreas Leha 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.
>
> This includes a caption for the diagram, and different output formats
> for different export routes.
>
> #+LATEX_HEADER: \usepackage{tikz}
>
> * tikz example
>
> #+name: tikz_example
> #+header: :packages '(("" "tikz"))
> #+header: :file (by-backend (latex "example_diagram.tikz") (html 
> "example_diagram.svg") (t "example_diagram.png"))

Where is the `by-backend' function defined?

> #+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
>
> #+caption: A tikz example diagram with a caption
> #+results: tikz_example
> [[file:example_diagram.png]]

What'd be nice is that you could say (in a *file* property) that the
extension for LaTeX always has to be .tikz, for HTML .svg and .png in
all the other cases.

Then, you could simply give the base name of the figure where
appropriate, in a "DRY" configuration.

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

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