横向树

横向树

有人能帮我用 Ti 之类的工具在 LaTeX 中得到这个图形吗Zpstricks等等?

在此处输入图片描述

答案1

\documentclass[border=5pt,tikz]{standalone}
\usetikzlibrary{matrix,calc,arrows}
\begin{document}
    \begin{tikzpicture}[>=triangle 60,every node/.style={anchor=west}]
        \matrix (m) [matrix of nodes, row sep=0em, column sep=3em]
            { Giver\\
              Runner \\
              Killer \\
              Speaker \\
              Dancer \\
              Thinker \\
              Believer \\
              Knower \\
              Presumer \\
              Hearer \\
              Smeller \\
              Feeler \\
              Taster \\
              Liker \\
              Lover \\
              Hater \\
              Given to \\
              Sent to \\
              Handed to \\
              Seen \\
              Heard \\
              Liked \\
              Located \\
              Moved \\
              Given \\
              Broken \\
              Destroyed \\
              Killed \\};
                  \draw (m-1-1.east) --+ (4,-1) node[right] (agent) {Agent}-- (m-5-1.east);
                  \draw (m-6-1.east) --+ (2,-.75) node[right] (cognizer) {Cognizer} -- (m-9-1.east);
                  \draw (m-10-1.east) --+ (2,-.75) node[right] (perceiver) {Perceiver} -- (m-13-1.east);
                  \draw (m-14-1.east) --+ (2,-.5) node[right] (emoter) {Emoter} -- (m-16-1.east);
                      \draw (m-17-1.east) --+ (4,-.5) node[right] (recipient) {Recipient} -- (m-19-1.east);
                      \draw (m-20-1.east) --+ (4,-.5) node[right] (stimulus) {Stimulus} -- (m-22-1.east);
                      \draw (m-23-1.east) --+ (4,-.5) node[right] (theme) {Theme} -- (m-25-1.east);
                       \draw (m-26-1.east) --+ (4,-.5) node[right] (patient) {Patient} -- (m-28-1.east);
                   \draw (cognizer.east) --+ (2,-1.91) node[right] (experiencer) {Experiencer} -- (emoter.east);
                       \draw (perceiver.east) -- ($(cognizer.east)+(2,-1.91)$);
                   \draw (agent.east) -- (11,3) node[right] (actor) {Actor}-- (experiencer.east);
                       \draw (experiencer.east) --+ (3,-5.5) node[right] (undergoer) {Undergoer} -- (patient.east);
                           \draw (recipient.east) -- ($(experiencer.east)+(3,-5.5)$);
                           \draw (stimulus.east) -- ($(experiencer.east)+(3,-5.5)$);
                           \draw (theme.east) -- ($(experiencer.east)+(3,-5.5)$);
                           \draw (recipient.east) -- (11,3);
                       \draw (actor.east) --+ (2,-3.6) node[right] {Subject} -- (undergoer.east);
                   \draw[thick,->] (m-28-1.south east) -- ([yshift=-2.31cm]undergoer.south west) node[align=center,text width=11cm,midway,below] {Increasing generalization, increasing neutralization of semantic contrasts};
                       \node[xshift=.25cm,text width=2.5cm,above=.5cm] at (m-1-1.north east) {\bf Verb-specific semantic roles};
                       \node[xshift=5cm,text width=2.5cm,above=.5cm] at (m-1-1.north east) {\bf Thematic relations};
                       \node[xshift=10cm,text width=2.5cm,above=.5cm] at (m-1-1.north east) {\bf Semantic macroroles};
                       \node[xshift=15cm,text width=2.5cm,above=.5cm] at (m-1-1.north east) {\bf Grammatical relations};
        \end{tikzpicture}
\end{document}

输出:

截屏

编辑:删除every node/.style={anchor=west}以获得更好的结果。

答案2

只是为了好玩:森林的替代品。

\documentclass[border=5pt]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
      grow=west,
      parent anchor=west,
      child anchor=east,
      s sep=1pt,
      l sep=1.3cm
     },
     where n children=0{tier=Left}{},
[Subject
 [Actor,name=Actor
  [Agent
   [Giver]
   [Runner]
   [Killer]
   [Speaker]
   [Dancer]
   ]
  [Experiencer,name=Experiencer
   [Cognizer
    [Thinker]
    [Believer]
    [Knower]
    [Presumer]
   ]
   [Perceiver
    [Hearer]
    [Smeller]
    [Taster]
    [Feeler]
   ]
   [Emoter
    [Liker]
    [Lover]
    [Hater]
   ]]
 ]
 [Undergoer,name=Undergoer
  [Recipient,name=Recipient
   [Given To]
   [Sent To]
   [Handed To]
  ]
  [Stimulus
   [Seen]
   [Heared To]
   [Liked To]
  ]
  [Theme
   [Located]
   [Moved]
   [Given]
  ]
  [Patient
   [Broken]
   [Destroyed]
   [Killed,name=Killed]
  ]
 ]
]    
\draw (Actor.west) -- (Recipient.east);
\draw (Undergoer.west) -- (Experiencer.east);
\draw[-latex] ([yshift=-2mm]Killed.south east) -- ++ (10cm,0) 
 node[midway,below,align=center]{Increasing generalization, increasing
 neutralization\\ of semantic contrasts};
\end{forest}
\end{document}

在此处输入图片描述

编辑:左对齐最左边的项目和添加的标题。

\documentclass[border=5pt]{standalone}
\usepackage{forest}
\usetikzlibrary{positioning}
\begin{document}
\begin{forest}
for tree={
      grow=west,
      parent anchor=west,
      child anchor=east,
      s sep=1pt,
      l sep=1.3cm
     },
     where n children=0{tier=Left,text width=width("Handed To")}{},
[Subject,name=Subject
 [Actor,name=Actor
  [Agent,name=Agent
   [Giver,name=Giver]
   [Runner]
   [Killer]
   [Speaker]
   [Dancer]
   ]
  [Experiencer,name=Experiencer
   [Cognizer
    [Thinker]
    [Believer]
    [Knower]
    [Presumer]
   ]
   [Perceiver
    [Hearer]
    [Smeller]
    [Taster]
    [Feeler]
   ]
   [Emoter
    [Liker]
    [Lover]
    [Hater]
   ]]
 ]
 [Undergoer,name=Undergoer
  [Recipient,name=Recipient
   [Given To]
   [Sent To]
   [Handed To]
  ]
  [Stimulus
   [Seen]
   [Heared To]
   [Liked To]
  ]
  [Theme
   [Located]
   [Moved]
   [Given]
  ]
  [Patient
   [Broken]
   [Destroyed]
   [Killed,name=Killed]
  ]
 ]
]    
\draw (Actor.west) -- (Recipient.east);
\draw (Undergoer.west) -- (Experiencer.east);
\draw[-latex] ([yshift=-2mm]Killed.south east) -- ++ (10cm,0) 
 node[midway,below,align=center]{Increasing generalization, increasing
 neutralization\\ of semantic contrasts};
\node[anchor=west,above=6mm of Giver,align=left,font=\bfseries] (Verb)  {Verb-specific\\ semantic roles};
\node[anchor=east,align=right,font=\bfseries] at (Verb.west -| Agent.west)  {Thematic relations};
\node[anchor=center,align=center,font=\bfseries] at (Verb.west -| Actor.center) 
{Semantic\\ macroroles};
\node[anchor=center,align=left,font=\bfseries] at (Verb.west -| Subject.center) 
{Grammatical\\ relations};
\end{forest}
\end{document}

在此处输入图片描述

答案3

这个答案是对marmot 的解决方案非常好,它可以自动添加额外的边并尽量避免对可能发生变化的事物进行过多的硬编码。

% addaswyd o ateb marmot: https://tex.stackexchange.com/a/444593/
\documentclass[border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{positioning,arrows.meta}
\forestset{
  declare keylist={extra forest edges}{},
  declare boolean={draw extra edges}{0},
  align middle child/.style={
    before typesetting nodes={
      if={
        > Ow+P {n children}{isodd(##1)}
      }{
        calign child/.process={
          Ow+n {n children}{(##1+1)/2}
        },
        calign=child edge,
      }{},
    },
  },
  align middle children/.style={
    for tree={align middle child},
  },
  join from/.style={
    if draw extra edges={}{draw extra forest edges},
    before typesetting nodes={temptoksa/.option=#1.name, extra forest edges/.register=temptoksa},
  },
  join to/.style={
    before typesetting nodes={temptoksa/.option=name, if={>O{#1.draw extra edges}}{}{#1.draw extra forest edges}, #1.extra forest edges/.register=temptoksa},
  },
  draw extra forest edges/.style={
    draw extra edges,
    before drawing tree={
     tikz+/.process={OOw2{edge}{extra forest edges}{\foreach \i in {##2} \path [##1] ({\i}.parent anchor) -- (.child anchor);}},
    },
  },
}
\begin{document}
\begin{forest}
  for tree={
    grow=180,
    parent anchor=children,
    child anchor=parent,
    s sep'=1pt,
    l sep'=13mm,
    font=\sffamily,
  },
  before typesetting nodes={
    tempdima/.max={>Ow+P{content}{width("#1")}}{fake=r,leaves},
    for nodewalk={fake=r,leaves}{text width/.register=tempdima, tier=terminus},
  },
  align middle children,
  [Subject 
  [Actor, join to=!rl1
    [Agent
    [Giver]
    [Runner]
    [Killer]
    [Speaker]
    [Dancer]
    ]
    [Experiencer, join from=!rl
    [Cognizer
      [Thinker]
      [Believer]
      [Knower]
      [Presumer]
    ]
    [Perceiver
      [Hearer]
      [Smeller]
      [Taster]
      [Feeler]
    ]
    [Emoter
      [Liker]
      [Lover]
      [Hater]
    ]]
  ]
  [Undergoer
    [Recipient
    [Given To]
    [Sent To]
    [Handed To]
    ]
    [Stimulus
    [Seen]
    [Heared To]
    [Liked To]
    ]
    [Theme
    [Located]
    [Moved]
    [Given]
    ]
    [Patient
    [Broken]
    [Destroyed]
    [Killed]
    ]
  ]
  ]   
  \begin{scope}[font=\bfseries\sffamily, align=center, anchor=mid]
    \foreach \i/\j in {n/north,s/south,w/west,e/east,nw/north west,ne/north east,sw/south west,se/south east} \coordinate (\i) at (current bounding box.\j);
    \foreach \i/\j [count=\n] in {L/Verb-specific\\semantic roles,r/Grammatical\\relations,r1/Semantic\\macroroles} \node (n\n) [above=of n -| !\i.center] {\j};
    \path (n1.mid -| !r11.center) -- (n1.mid -| !r121.center) node [midway] {Thematic relations};
  \end{scope}
  \draw [-Latex, thick] (!L.parent |- s) -- (!r.children |- s) node [midway, font=\sffamily, below, align=center] {Increasing generalization, increasing neutralization\\of semantic contrasts};
\end{forest}
\end{document}

尝试使用更少的硬编码来实现更灵活/自动化的解决方案

相关内容