我想获得以下树的格式forest
仅限优质套餐。也许是文档第 82 页中的示例,或者另一个帖子可以作为一个起点。
这是水平标准树的代码。
\documentclass[12pt,a4paper]{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree = {%
grow' = 0,
l = 2.5cm,
parent anchor=east,
s sep = 1.2cm,
},
[
[A
[B]
[C
[D]
[E]
]
]
[F]
]
\end{forest}
\end{document}
答案1
朴素的tikz
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{tikzpicture}
\draw[line width=2pt] (0,0)node(a){}--(12,0)node[fill=white](B){B};
\node[fill=white]at ($(a)!0.50!(B)$) (A) {A};
\node[fill=white, below=of A, yshift=-4cm] (F){F};
\draw[line width=2pt] ($(a)!0.10!(B)$) |-(F);
\node[fill=white, below=of B, yshift=-1cm] (C){C};
\draw[line width=2pt] ($(a)!0.60!(B)$) |-(C);
\node[fill=white, right=of C, xshift=2cm] (D){D};
\draw[line width=2pt] (C) --(D);
\node[fill=white, below=of D, yshift=-1cm] (E){E};
\draw[line width=2pt] ($(C)!0.20!(D)$) |-(E);
\end{tikzpicture}
\end{document}