在我的家庭中,父亲 (h1) 和母亲 (w1) 离婚后,父亲与 w2 再婚。到目前为止一切顺利。但在族谱树中,我还想添加 w2 的前任丈夫 (w2-h2)。我该怎么做?我尝试使用union
,您可以在下面的文件中看到我的尝试,但我将其注释掉,因为它在编译时会出错。
\documentclass{article}
\usepackage[all]{genealogytree}
\begin{document}
% h=husband
% w=wife
% w2-h1=2nd wife's 1st husband
% c=child
\begin{genealogypicture}
child{
g[male]{h1}
p[female]{w1}
union{
p[female]{w2}
% union{
% p[male]{w2-h2}
% }
c{h1-w2's c}
}
c{w1-h1's c}
}
\end{genealogypicture}
\end{document}
答案1
这是对更新后问题的回答。我学到了很多从这个帖子。
\documentclass{article}
\usepackage[all]{genealogytree}
\begin{document}
\begin{tikzpicture}
% Tree for the common husband with descendents
% h=husband
% w=wife
% w2-h1=2nd wife's 1st husband
% c=child
\genealogytree{
child{
g[male]{h1}
p[female]{w1}
union{
p[female,id=wife2]{w2}
c{h1-w2's c}
}
c{w1-h1's c}
}
}
\genealogytree[set position=wife at wife2]{
child{
g[female,id=wife]{w2}
p[male]{w2-h2}
}
}
\end{tikzpicture}
\end{document}
回答我对问题第一版的解释:这或多或少是从手册第 67 页复制而来的。
\documentclass{article}
\usepackage[all]{genealogytree}
\begin{document}
\begin{genealogypicture}
child{
p[female]{w1}
g[male]{h1}
c{w1-h1's c}
union{
p[female]{w2}
c{w2-h1's c}
}
}
\end{genealogypicture}
\end{document}
当然,你也可以按如下方式重新排列:
\documentclass{article}
\usepackage[all]{genealogytree}
\begin{document}
\begin{genealogypicture}
child{
g[male]{h1}
union{
p[female]{w1}
c{w1-h1's c}
}
p[female]{w2}
c{w2-h1's c}
}
\end{genealogypicture}
\end{document}
它甚至在极端情况下也能发挥作用。
\documentclass{article}
\usepackage{pdflscape}
\usepackage[all]{genealogytree}
\begin{document}
\begin{landscape}
\begin{genealogypicture}
child{
g[male]{Henry VIII}
union{
p[female]{Catherine of Aragon}
c{Mary I}
}
union{
p[female]{Anne Boleyn}
c{Elizabeth I}
}
union{
p[female]{Jane Seymour}
c{Edward VI}
}
union{
p[female]{Anne of Cleves}
}
union{
p[female]{Catherine Howard}
}
p[female]{Catherine Parr}
}
\end{genealogypicture}
\end{landscape}
\end{document}