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