How to create a moderator part of the figure (arrows pointing other arrows, spacing, all X arrowheads on left of Y)?
Thanking you.
How to create a moderator part of the figure (arrows pointing other arrows, spacing, all X arrowheads on left of Y)?
Thanking you.
Welcome! I'd recommend forest for that.
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
for tree={grow=180,
edge={semithick,stealth-},math content,l sep=10em,draw}
[y,minimum width=1.2cm,minimum height=0.8cm
[x_1,edge label={coordinate[pos=0.8](a)}]
[x_2]
[x_3]
[x_4]
[x_5]
[x_6,edge label={coordinate[pos=0.2](b)}]
]
\path (a) -- (b) coordinate[midway] (c);
\node[draw] at ([yshift=1em]current bounding box.north-|c) (m) {Moderator};
\draw[semithick,-stealth] (m) -- (a);
\draw[semithick,-stealth] (m) -- (b);
\end{forest}
\end{document}
And here is a possible way to add one normal text to the tree.
\documentclass{article}
\usepackage[edges]{forest}
\usepackage{amsmath}
\begin{document}
\begin{forest}
for tree={grow=180,
edge={semithick,stealth-},math content,l sep=10em,draw,
where n children=0{anchor=east}{},child anchor=east}
[y,minimum width=1.2cm,minimum height=0.8cm
[\text{Gym instructor},edge label={coordinate[pos=0.8](a)}]
[x_2]
[x_3]
[x_4]
[x_5]
[x_6,edge label={coordinate[pos=0.2](b)}]
]
\path (a) -- (b) coordinate[midway] (c);
\node[draw] at ([yshift=1em]current bounding box.north-|c) (m) {Moderator};
\draw[semithick,-stealth] (m) -- (a);
\draw[semithick,-stealth] (m) -- (b);
\end{forest}
\end{document}
If the tree has predominantly nonmath content, remove math content from the for tree options, and add $ signs where appropriate.
math contentfrom thefor treeoptions. This option wraps the content of all nodes in$...$. You will then have to add$signs where appropriate, in particular wherever the content contains a_. – Nov 13 '19 at 02:05amsmathand replace[x_1,edge label={coordinate[pos=0.8](a)}]by[\text{Gym instructor},edge label={coordinate[pos=0.8](a)}]. And you may addwhere n children=0{anchor=east}{},child anchor=eastto the `for tree. I added this option to the answer. – Nov 13 '19 at 02:11