通常在家谱树节点我必须说
p[]{name=Jane, birth={2-2-1888}{somewhere}}
我怎样才能创建一个键,像persdata=JaneID
扩展为的一样name=Jane, birth={2-2-1888}{somewhere}
,这样我只需要说:
p[]{persdata=JaneID}
不工作或不正确的 MWE:
\documentclass[landscape,paper=a5]{scrartcl}
\usepackage[all]{genealogytree}
\begin{document}
% Works not:
\pgfkeys{
persdata/.initial={name=Jane, birth={1-1-1777}{somewhere}},
persdata/.get=\persdata,
persdata/.store in=\persdata,
}
\gtrset{database/save/persdata/.get=\persdata}
\begin{tikzpicture}[]
\genealogytree[template=signpost,
processing=database,
]{
parent{
g{name=first child}
c{name=second child}
c{name=third child}
p[]{persdata=JaneID} % <---------------- Problem here....
p[]{name=works, birth={1-1-1777}{somewhere}}
}
}
\end{tikzpicture}
\end{document}
答案1
此答案提供了一个新的/gtr/database
键persdata
,它接受预定义的选择,例如JaneID
。persdata=JaneID
使用时,将检索以该样式存储的相应键值列表。
\documentclass[landscape,paper=a5]{scrartcl}
\usepackage[all]{genealogytree}
\begin{document}
\gtrset{
database/.cd,
persdata/.is choice,
persdata/JaneID/.style={name=Jane, birth={1-1-1777}{somewhere}}
}
\begin{tikzpicture}[]
\genealogytree[
template=signpost,
processing=database,
]
{
parent{
g{name=first child}
c{name=second child}
c{name=third child}
p[]{persdata=JaneID}
p[]{name=works, birth={1-1-1777}{somewhere}}
}
}
\end{tikzpicture}
\end{document}