像这个问题,我正在尝试用genealogytree
来自外部源的数据填充,这要感谢该datatool
包。但我不知道如何告诉 genealogytree 如何正确识别这些数据。我可能误解了的设置和使用pgfkeys
。
主要问题是无法在选项中\gtrDBsex
执行正确的性别。如果我将其替换为包含特定性别的 ,则会执行 。/.style
box
\def
/.style
注意\gtrPrintName
并\gtrPrintSex
正确显示其数据。
我哪里错了?任何帮助都非常感谢。
我的 MWE:
\documentclass{standalone}
\usepackage{tikz}
\usepackage[all]{genealogytree}
%-------------------------------------%
% \def\boy{male}% this one will execute male/.style
\def\someone#1#2{
\def\nom{#1} % use of control sequences like in the datatool pkg
\def\sexe{#2}
\gtrset{database/name={\nom}}%
\gtrset{database/sex=\sexe}% \gtrif(fe)male doesn't work, but /.style neither.
% \gtrset{database/sex=male}% even forcing male, /.style doesn't work, considered neuter.
\gtrPrintName{} \gtrPrintSex{}\\ gender(\gtrDBsex) = \gtrifmale{male}{\gtriffemale{female}{neuter}}%
}
%-------------------------------------%
\begin{document}
\begin{tikzpicture}
\genealogytree[
processing=fit, node size=2.5cm, level size=2cm,
tcbset={%
male/.style={colback=blue!20!white,sharp corners},
female/.style={colback=red!20!white,arc=8pt},%
neuter/.style={colback=yellow!20!white,arc=8pt}%
},
box={\gtrDBsex}% not recognized?
%box={\boy}% this one executes male/.style
]{%
parent{
g{\someone{Gaston}{male}}
p{\someone{Franck}{male}}
p{\someone{Lucie}{female}}
}
}
\end{tikzpicture}
\end{document}
另一个问题是测试\gtrifmale
无法\gtriffemale
识别性别。但xstring
包可以识别。