使用 Tikz 和树形图的直对角线规则

使用 Tikz 和树形图的直对角线规则

我的代码如下:

\documentclass[10pt]{book}
\usepackage[T1]{fontenc}
\usepackage{newtxmath,newtxtext}
\usepackage{linguex}%
\usepackage{tikz}%
\usetikzlibrary{decorations.text,calc,arrows.meta}%
\usepackage{tikz-qtree}%

\usepackage{adjustbox}
%\usepackage{showframe}
\begin{document}

\ex.
\Tree [.CauseP [.DP \edge[roof]; {`the zog'} ] [ [.{\scshape
cause} ] [ [.{\scshape past} ] [.vP \edge[roof]; {`dissolved the
house'} ]]] ]

Throughout this monograph, I will
focus on the reusable linguistic ingredients of the system and how
they are efficiently deployed in the recursive combinatorics in
building propositions. Reusability (and by extension polysemy)
will be a seen as a design feature of the system rather than a
bug. As a methodological principle, then, I will be guided by the
fact of polysemous items and seek analytic unities to underlie
them.

\ex. \textit{Achievements and accomplishments with result states}\\
%\begin{tikzpicture}[baseline=(current bounding box.north)]
\begin{adjustbox}{max width=0.91\textwidth}
\Tree [.InitP [.{\textsc{initiator}} ] [ [.Init ] [.ProcP
[.{\textsc{undergoer}} ] [ [.Proc ] [.ResP
[.{\textsc{resultee}} ] [ [.Res ] [.XP \edge[roof];
{\sc ground/final state} ] ] ] ] ] ] ]
%\end{tikzpicture}
\end{adjustbox}

\end{document}

输出如下:

在此处输入图片描述

这是否可以使对角线变得像下图中标记的那样直?

在此处输入图片描述

所有树木的对角线都应为直线。请提出建议...

答案1

如果可以选择,Forest 可以做到这一点 - 某种程度上。然而,Forest 的树木在默认情况下往往比较笨拙,至少在一系列相关情况下是如此。

下面是一个使用的示例nice empty nodes

<code>漂亮的空节点</code>

\documentclass[border=10pt]{standalone}
\usepackage[linguistics]{forest}
\begin{document}
\begin{forest}
  scshape/.style={font=\scshape},
  nice empty nodes,
  for tree={
    calign angle=50,
  }
  [CauseP
    [DP[`the zog', roof]]
    [[cause, scshape]
      [[past, scshape][vP[`dissolved the house', roof]]
      ]
    ]
  ]
\end{forest}
\end{document}

相关内容