将几棵树与基线对齐

将几棵树与基线对齐

我想让以下树与基线对齐。有一个问题可能是由于某些树中的“g”造成的。我该如何让这些树对齐?我试过了\strut,但不知何故没有奏效。

\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}

答案1

只需向叶节点添加零文本深度:

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

输出

相关内容