With org-mode 8.2.10 on Emacs 24.5.1, the following will produce a ditaa figure in the exported PDF (LaTeX):
#+BEGIN_SRC ditaa :file foo.png :cmdline -E -s 4 -S
+---------+
| testing |
+---------+
#+END_SRC
#+CAPTION: ditaa caption
#+LABEL: fig:ditaa
#+attr_latex: :width 1in
#+RESULTS:
[[file:foo.png]]
If I try to do the same thing but using tikz to generate a figure, it does not work. The following example (copied from the org-mode documentation) simply produces a PDF containing the string "[[file:fsa.pdf]]".
#+begin_src latex :file fsa.pdf :packages '(("" "tikz")) :border 1em
% Define block styles
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]
\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node distance=2.8cm, semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}
#+end_src
#+CAPTION: tikz caption
#+LABEL: fig:tikz
#+RESULTS:
[[file:fsa.pdf]]
How do I generate a floating tikz figure without manually using \begin{figure}...\end{figure}
?
#+BEGIN/END_LaTeX
marks (eg typeC-c C-c
inside the src block.)