6

I want to have the following trees aligned to the baseline. There is a problem which is probably due to the "g" in some of the trees. How do I get these trees aligned? I tried \strut, but this somehow did not work.

\documentclass{article}

\usepackage{tikz-qtree}
\tikzset{every roof node/.append style={inner sep=0.1pt,text height=2ex,text depth=0.3ex}}



\begin{document}



\begin{figure}[htbp]
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=2\baselineskip}}
\Tree[.NP
       [.Det die ]
       [.N Frauen ] ]
\end{tikzpicture}
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=2\baselineskip}}
\tikzset{frontier/.style={distance from root=6\baselineskip}}
\Tree[.NP
       [.Det die ]
       [.N 
         [.Adj klugen ]
         [.N Frauen ] ] ]
\end{tikzpicture}
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=2\baselineskip}}
\tikzset{frontier/.style={distance from root=6\baselineskip}}
\Tree[.NP
       [.Det die ]
       [.N 
         [.Adj klugen ] ] ]
\end{tikzpicture}
\begin{tikzpicture}
\tikzset{level 1+/.style={level distance=2\baselineskip}}
\tikzset{frontier/.style={distance from root=6\baselineskip}}
\Tree[.NP
       [.N 
         [.Adj kluge ]
         [.N Frauen ] ] ]
\end{tikzpicture}

\caption{\label{abb-np2}Verschiedene Nominalstrukturen ohne leere Elemente}
\end{figure}

\end{document}
David Carlisle
  • 757,742
Stefan Müller
  • 6,901
  • 3
  • 29
  • 61
  • 1
    Quick hack: put \raisebox{0pt}[\height][0pt]{...} around klugen and kluge. See http://tex.stackexchange.com/questions/21608/center-text-in-tikz-according-to-the-text-baseline-not-the-object-itself. – Jeroen Zuiddam Mar 01 '14 at 12:50
  • 2
    @jason-zentz please don't tag questions just because of the subject matter of the text, otherwise we will need hundreds of new tags. The question is about tree alignment in TeX, the meaning of the tree is not relevant. – David Carlisle Dec 09 '14 at 16:00
  • Did your comment concern the linguistics tag? I did not invent the tag. Somebody else added it to one of my earlier posts or I saw it somewhere and then started to use it myself. Sorry if this was inappropriate. – Stefan Müller Dec 10 '14 at 16:49

1 Answers1

9

Just add a zero text depth to the leaf nodes:

\tikzset{every leaf node/.append style={text depth=0pt}}

output

Alan Munn
  • 218,180