How can I centre a tree, moving it to the middle of the page, whilst keeping \ex.
in its normal position?
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{linguex}
\begin{document}
\ex. \begin{tikzpicture}
\Tree [.VP [.V saw ] [.DP [.N Kim ] ] ]
\end{tikzpicture}
\end{document}
Best Answer
The basic problem here has more to do with how to center a
linguex
example than how to center the tree, so it is actually asking essentially the same thing as gb4e center example text, but forlinguex
instead ofgb4e
. The solutions end up being the same:\hfil
before and after thetikzpicture
environment, as suggested by Harish Kumar's comment on the question linked above.\hspace*{\fill}
before and after thetikzpicture
environment, as suggested by egreg's comment to this answer.\hfill
before and after thetikzpicture
environment, as suggested by Peter Grill's answer to the question linked above. You just have to make sure there is something with zero width at the end of the example (I used\hspace{0pt}
below, but you could use\null
as Peter Grill did); otherwise, the tree will be right-aligned instead of centered.These yield the following output: