I want to make a tree which has bulleted lists centered below the child nodes, like so:
I've searched on TeX SE and found questions which describe putting labels below nodes, but it doesn't quite work out for multiline text or lists. This is my MWE (it generates the pdf in TexStudio even though I get some residual errors):
\documentclass[11pt, letterpaper,twoside, fleqn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{forest}
\begin{document}
\begin{figure}
\begin{center}
\begin{forest}
for tree={
myleaf/.style={label=below:{\strut#1}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$\bullet$ Subsequent question?\\
$\bullet$ Subsequent longer\\
question?}
]
[No,rectangle,rounded corners,draw]
]
\node[above=30pt,align=center,anchor=center] {Tree Title};
\end{forest}
\end{center}
\label{fig_tree1}
\end{figure}
\end{document}
I'm very new to Latex trees and I've been using forest so far, but I'm not opposed to a TikZ solution.
On an unrelated note, I would eventually also like to place two trees side-by-side in a single figure (as shown below, but with the "subsequent question" text slightly bigger). I could use some guidance on that too.
Best Answer
You need to say
align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)You could also use
itemize
if you specify thetext width
. This also addresses your second question, too.As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.