From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: Embedding diagrams in Org Date: Thu, 19 Feb 2015 09:49:01 +0100 Message-ID: <86pp96jngi.fsf@example.com> References: <87bnkr8kkg.fsf@wmi.amu.edu.pl> <87d2579uah.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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