Can anyone help me to get this graphics in LaTeX with tools like TikZ, pstricks etc.?
Asked
Active
Viewed 580 times
3
current_user
- 5,235
Stephan
- 33
-
4Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – BambOo Aug 04 '18 at 09:28
-
1Have a look at https://tex.stackexchange.com/questions/359105/qtree-and-tikz-qtree – BambOo Aug 04 '18 at 09:29
-
2You could actually just include the graphic in the case you just “want that in LaTeX“ … – current_user Aug 04 '18 at 11:31
3 Answers
7
\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}
The output:
EDIT: remove every node/.style={anchor=west} for a better result.
current_user
- 5,235
6
Just for fun: a forest alternative.
\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}
EDIT: Left-aligned leftmost items and added headers.
\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}
-
1(+1) But it would be better to use a named dimension for the width of 'handed to' as you're calculating it using pgfmath for every one of the left hand nodes, which is extremely inefficient. You could also say
delay={tempdima/.max={>OOw2{max x}{min x}{#1-#2}}{fake=root,leaves}, for nodewalk={fake=r,leaves}{text width/.register=tempdima}}. If you wanted to. Using parent and child anchors which are sensitive to direction of growth makes tree specifications more flexible. Usingl sep'ands sep'is faster thanl sepands sep. You can also avoid naming nodes and/or use thetikzkey. – cfr Aug 05 '18 at 01:05 -
@cfr Thanks once more! Of course I was suspecting there is such a solution but lazy as I am I did not read the manual. (It is much easier to just wait till you show up ;-) (Just kidding ;-) But how would one avoid naming the nodes, after all I want to draw additional lines? – Aug 05 '18 at 01:10
-
@cfr Thanks again, just to let you know I could not make
delay={tempdima/.max={>OOw2{max x}{min x}{#1-#2}}{fake=root,leaves}, for nodewalk={fake=r,leaves}{text width/.register=tempdima}}work. There was some obvious issue: the underscores inmax_xandmin_xgot swallowed. But even when I fixed that I get the error! Package forest Error: Comparison ("<" or ">") of generic type arguments "0.0pt-0.0pt" and "0.0pt-0.0pt" makes no sense.Could you perhaps tell me where that might come from? – Aug 06 '18 at 03:01 -
-
Please see answer below. Note that the lack of underscores is not the error. They were never there and were never meant to be there or needed. I forgot
+di.e. I neededOOw2+dand not justOOw2. And also to delay it for longer, I think. – cfr Aug 08 '18 at 23:28 -
@cfr Thanks. Already upvoted. ;-) Could you perhaps have a look at this question. Way too tough for me. – Aug 08 '18 at 23:33
1
This answer is a modification of marmot's very nice solution, which automates adding extra edges and tries to avoid so much hard-coding of things which might change.
% 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}
cfr
- 198,882




