I have a diagram that I created with qtree, but would like to add a caption to it. How can this be done?
One option would be to use the newfloat
package to define a new floating object, so then you can use the standard \caption
command:
\documentclass{article}
\usepackage{qtree}
\usepackage{newfloat}
\DeclareFloatingEnvironment[fileext=lod]{diagram}
\begin{document}
\begin{diagram}
\centering
\Tree [.S This [.VP [.V is ] \qroof{a simple tree}.NP ] ]\par
\caption{the caption for this diagram}
\end{diagram}
\end{document}
The package offers some other customization possibilities and it cooperates with the caption
package.
figure
and using\caption
? – cmhughes Mar 8 '13 at 20:04Diagram 1: tree showing....
? – Gonzalo Medina Mar 8 '13 at 20:08