如何获取反映代码中括号中参数顺序的 PDF?
My father
My father's father
My father's mother
My mother
My mother's father
My mother's mother
如果你看到 PDF 图,它就是相反的。我从 排版家谱
\documentclass[tikz,12pt]{standalone}
\usetikzlibrary{calc,positioning,backgrounds,arrows.meta}
\usepackage{forest}
\pagestyle{empty}
\begin{document}
\begin{forest}
for tree={
child anchor=west,
parent anchor=east,
grow=east,
draw,
anchor=west,
edge path={
\noexpand\path[\forestoption{edge}]
(.child anchor) -| +(-5pt,0) -- +(-5pt,0) |-
(!u.parent anchor)\forestoption{edge label};
},
}
[Me
[My Father
[My Father's Father
]
[My Father's Mother
]
]
[My Mother
[My Mother's Father
]
[My Mother's Mother
]
]
]
\end{forest}
\end{document}
\end{document}
答案1
尽管这对于这棵简单的树来说效果很好,但请注意,您最好使用较新的 genealogytree 包来绘制家谱。
\documentclass[12pt]{standalone}
\usepackage[all]{genealogytree}
\pagestyle{empty}
\begin{document}
\begin{genealogypicture}[
timeflow=left,
level size=5cm,
node size=1cm,
box={halign=center, valign=center},
]
parent{
g{Me}
parent{
g{My Father}
p{My Father's Father}
p{My Father's Mother}
}
parent{
g{My Mother}
p{My Mother's Father}
p{My Mother's Mother}
}
}
\end{genealogypicture}
\end{document}