2

Normally at a genealogytree node I have to say
p[]{name=Jane, birth={2-2-1888}{somewhere}}

How can I create a key, like persdata=JaneID which expands to name=Jane, birth={2-2-1888}{somewhere}, so that I only have to say:
p[]{persdata=JaneID}

enter image description here

A not working or correct 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}
  • have you tried using a .style instead? (I have no idea whether this works, I never used genealogytree and didn't take a single look, this is just a guess) – Skillmon likes topanswers.xyz Aug 5 at 10:14
  • Yes, I tried a style (which would be way easier), but I get the meaning, that he wants a style "[here]", not "{here}"... – cis Aug 5 at 11:11
1

This answer provides a new /gtr/database key persdata that accepts predefined choices like JaneID. When persdata=JaneID is used, the corresponding key-value list stored in that style is retrieved.

\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}

enter image description here

| improve this answer | |
  • Wow, very good! Helps me a lot. – cis Aug 5 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.