Hi, Eric S Fraga <e.fr...@ucl.ac.uk> writes: > On Wednesday, 18 Feb 2015 at 13:34, Marcin Borkowski wrote: >> Hello all, >> >> I need to embed some diagrams (graphs of functions, for instance, or >> trees) in an Org file. Any suggestions on how to do it? In case of >> ditaa, I can use a source block and the "results" line, and see the >> image with C-c C-x C-v. Can I do a similar thing with Asymptote? How >> hard/time-consuming would it be to add support e.g. for tikz or other >> such tools? > > Support for tikz is there implicitly in that there is support for > LaTeX. I use tikz all the time. > > Simple example attached. > > I do believe others have used asymptote in the past. > > HTH, > eric
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. Best, Andreas --8<---------------cut here---------------start------------->8--- #+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")) #+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]] --8<---------------cut here---------------end--------------->8---