我怎样才能将 < 改为 [ ?? 我想要带有 1 2 3 4 的图片

我怎样才能将 < 改为 [ ?? 我想要带有 1 2 3 4 的图片

我想要这个风格

我不想要这种风格

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-qtree}

\begin{document}

\begin{tikzpicture}
\tikzset{grow'=right,level distance=32pt}
\tikzset{execute at begin node=\strut}
\tikzset{every tree node/.style={anchor=base west}}
\Tree [.S [.NP [.Det the ] [.N cat ] ]
[.VP [.V sat ]
[.PP [.P on ]
[.NP [.Det the ] [.N mat ] ] ] ] ]
\end{tikzpicture}

\end{document} 

答案1

将以下内容添加到您的代码中:

\tikzset{edge from parent/.style=
{draw,
edge from parent path={(\tikzparentnode.east)
-- +(8pt,0)
|- (\tikzchildnode)}}}

梅威瑟:

\documentclass{article}

\usepackage{tikz}
\usepackage{tikz-qtree}
\tikzset{edge from parent/.style=
{draw,
edge from parent path={(\tikzparentnode.east)
-- +(8pt,0)
|- (\tikzchildnode)}}}
\begin{document}

\begin{tikzpicture}
\tikzset{grow'=right,level distance=32pt}
\tikzset{execute at begin node=\strut}
\tikzset{every tree node/.style={anchor=base west}}
\Tree [.S [.NP [.Det the ] [.N cat ] ]
[.VP [.V sat ]
[.PP [.P on ]
[.NP [.Det the ] [.N mat ] ] ] ] ]
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容