Like in this question, I'm trying to fill a genealogytree with datas from an external source, thanks to the datatool package. But I can't figure how to tell genealogytree how to correctly recognize these datas. I probably misunderstands the setting and the use of pgfkeys.
The main problem is that \gtrDBsex does not execute the right gender /.style in the box options. If I replace it with a \def containing a specific gender, the /.style is executed.
Notice that \gtrPrintName and \gtrPrintSex correctly display their datas.
Where am I wrong? Any help would be kind.
My 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}
An alternate problem is that the tests \gtrifmale and \gtriffemale don't recognize the gender. The xstring package does.

genealogytree, but from looking at its manual, it seems to me the way you are trying to use it doesn't conform to the doc, esp. what you use\gtrsetfor and how you try to declare the sex to gtr. To go from CSV format togenealogytree, it seems to me a possible approach would be to first generate an intermediate file likeexample.database.graphin thegenealogytreemanual, then input it as shown e.g. on p. 154 of the manual. To go from CSV to this graph format, many possibilities: for instance, Python if you know it; otherwise,datatoolcan probably do too. – frougon May 04 '19 at 23:00datatoolcode for the MWE, but the result is the same. I'm diving into thepgfkeysdocumentation, perhaps the datas are stored in a scope that I don't see? – Loïc May 05 '19 at 09:29\gtrset{database/name={\nom}}and\gtrset{database/sex=\sexe}commands are manually doing part of the setup thatinputing a proper.graphfile would have done. But only part of it; maybe it is already too late to apply themaleorfemalestyle to the graph nodes at this point. But these are just impressions/assumptions: I have only browsed through thegenealogytreemanual and tried your example. – frougon May 05 '19 at 09:37