答案1
纯tikz
:
\documentclass[border=3mm,tikz,preview]{standalone}
\begin{document}
\begin{tikzpicture}[
box/.style = {draw, text width=24mm, align=center},
every label/.append style = {align=center},
sibling distance=28mm]
\node[box] {root node with two line text}
child {node[box,label=left:{bla bla\\(1,1) and (12,12)}] {bla bla}
child {node[box] {bla bla\\ bla bla\\ bla}
edge from parent node[left] {map}
}
}
child {node[box] {bla bla}
child {node[box] {bla bla\\ bla bla\\ bla}}
};
\end{tikzpicture}
\end{document}
带forest
包装:
\documentclass[border=3mm,preview]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={draw,
text width = 24mm, text centered,
% style of tree (edges, distances, direction)
grow = south,
s sep = 4mm,
}
[root node with two line text
[bla bla, label={[align=center]left:{bla bla\\(1,1) and (12,12)}},
[bla bla\\ bla bla\\ bla\\ bla,
edge label={node[midway,left,font=\scriptsize] {map}}]
]
[bla bla
[bla bla\\ bla bla\\ bla]
]
]
\end{forest}
\end{document}
结果与以前类似。