是否可以将关键映射添加到家谱树?

是否可以将关键映射添加到家谱树?

我正在使用 genealogytree 包,我可以在下面的图中添加突出显示的框吗:

在此处输入图片描述

这是我的代码:

    \documentclass{article}
\usepackage[templates]{genealogytree}
\begin{document}
\begin{genealogypicture}[template=formal graph,timeflow=left,
add parent=a5 to AB_fam,
add parent=b6 to BC_fam,
]
child{
g[male]{X} p[female]{Y}
child{ g[male]{a_1}
child{ g[female]{a_2}
child{ g[female]{a_3}
child{ g[male]{a_4}
child{ g[female,id=a5]{a_5}
}}}}}
child{ g[male]{b_1}
child{ g[male]{b_2}
child{ g[male]{b_3}
child{ g[male]{b_4}
child[id=AB_fam]{ g[male]{b_5}
child{ g[female,id=b6,tikz={xshift=-6.5mm,yshift=5.5mm}]{b_6}
}}}}
child{ g[male]{c_1}
child{ g[female]{c_2}
child{ g[male]{c_3}
child{ g[female]{c_4}
child[id=BC_fam,pivot shift=-8.25mm]{ g[male]{c_5}
child{ g[male]{Z}
}}}}}}
}}
}
\end{genealogypicture}
\end{document}

答案1

您可以使用after tree键添加其他 TikZ 元素。

在此处输入图片描述

\documentclass{article}
\usepackage[templates]{genealogytree}
\usetikzlibrary{positioning}
\begin{document}
\begin{genealogypicture}[
  template=formal graph,timeflow=left,
  add parent=a5 to AB_fam,
  add parent=b6 to BC_fam,
  after tree={
   \node [draw,red] (a) at (current bounding box.south east) {Type 1};
   \node [draw,blue,left=2mm of a] (b) {Type 2};
  }
]
child{
g[male]{X} p[female]{Y}
child{ g[male]{a_1}
child{ g[female]{a_2}
child{ g[female]{a_3}
child{ g[male]{a_4}
child{ g[female,id=a5]{a_5}
}}}}}
child{ g[male]{b_1}
child{ g[male]{b_2}
child{ g[male]{b_3}
child{ g[male]{b_4}
child[id=AB_fam]{ g[male]{b_5}
child{ g[female,id=b6,tikz={xshift=-6.5mm,yshift=5.5mm}]{b_6}
}}}}
child{ g[male]{c_1}
child{ g[female]{c_2}
child{ g[male]{c_3}
child{ g[female]{c_4}
child[id=BC_fam,pivot shift=-8.25mm]{ g[male]{c_5}
child{ g[male]{Z}
}}}}}}
}}
}
\end{genealogypicture}
\end{document}

相关内容