TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a diagram that I created with qtree, but would like to add a caption to it. How can this be done?

share|improve this question
Welcome to TeX.sx! how about putting it in a figure and using \caption? – cmhughes Mar 8 '13 at 20:04
This seems to always give Figure 1. <my caption>, and places the diagram in the center of the next page, rather than inline with the text. Is there any alternative to this? – Rich Ashworth Mar 8 '13 at 20:05
Should the desired caption have a particular formatting? I mean do you want to number the diagram and have a label for it as in Diagram 1: tree showing....? – Gonzalo Medina Mar 8 '13 at 20:08
Please post a minimal working example (MWE) that shows what you want to achieve. – hpesoj626 Mar 8 '13 at 20:08
@GonzaloMedina - yes, exactly – Rich Ashworth Mar 8 '13 at 20:10
up vote 2 down vote accepted

One option would be to use the newfloat package to define a new floating object, so then you can use the standard \caption command:




\Tree [.S This [.VP [.V is ] \qroof{a simple tree}.NP ] ]\par
\caption{the caption for this diagram}


enter image description here

The package offers some other customization possibilities and it cooperates with the caption package.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.