Hi all, attached is a small patch that makes it possible to 'evaluate' latex source blocks to tikz files. When the :file header argument has a value ending in '.tikz' the content of the body of the source block will be copied into the resulting tikz file. This makes handling of tikz figures with captions easier. Here is a use-case: --8<---------------cut here---------------start------------->8--- #+latex_header: \usepackage{tikz} * Test #+name: picturecontents #+begin_src latex :noweb yes :exports none \node[red!50!black] (a) {A}; \node (b) [right of=a] {B}; \draw[->] (a) -- (b); #+end_src #+name: flowdiagram #+header: :exports results #+header: :imagemagick (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "no" "yes") #+header: :fit (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "no" "yes") #+header: :results raw :file (if (and (boundp 'backend) (eq (org-export-backend-name backend) (intern "latex"))) "flowdiagram.tikz" "flowdiagram.png") #+header: :headers "\\usepackage{tikz}" #+header: :noweb yes #+begin_src latex \begin{tikzpicture} <> \end{tikzpicture} #+end_src #+caption: Testing figure caption for figure going to multiple destinations #+results: flowdiagram [[file:flowdiagram.png]] --8<---------------cut here---------------end--------------->8--- This example works well besides some weird scaling/placement issue. Regards, Andreas