Take the 2-minute tour ×
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.

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}
share|improve this question
1  
Quick hack: put \raisebox{0pt}[\height][0pt]{...} around klugen and kluge. See tex.stackexchange.com/questions/21608/…. –  Jeroen Zuiddam Mar 1 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 9 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 at 16:49

1 Answer 1

Just add a zero text depth to the leaf nodes:

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

output

share|improve this answer

Your Answer

 
discard

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.