T-F-S / genealogytree

pedigree and genealogy tree diagrams
LaTeX Project Public License v1.3c
47 stars 7 forks source link

symbol nodes with database data #20

Closed jojomi closed 6 years ago

jojomi commented 6 years ago

I got a big family tree, but I want to distribute it showing only the gender of the people involved. So I would like to use my database data with the symbol nodes template.

I have trimmed the data down to only the gender (because otherwise I am swamped with errors because of unknown database keys), but now I am left with neuters only in the rendering. What would be the right approach for this?

mwe.pdf

TeX source:

\documentclass[10pt,paper=a4,ngerman]{scrartcl}

\usepackage[ngerman]{babel}

\usepackage[all]{genealogytree}

\begin{document}

\section*{Test for T-F-S}

\begin{tikzpicture}
        \genealogytree[
         timeflow=right, processing=database, template=symbol nodes
        ]{%
        sandclock {
  child {
    g[%
]{
      sex = male,
}
    union {
    p[%
]{
      sex = female,
}
c[%
]{
      sex = female,
}
}
}
}
}
        \end{tikzpicture}

    Thank you for your wonderful piece of Free Software!

\end{document}
T-F-S commented 6 years ago

The template symbol nodes defines a special content which is of no use here, because you need something of type database.

The following private template my symbol nodes is a mixture from symbol nodes with some code for a database:

\documentclass[10pt,paper=a4,ngerman]{scrartcl}

\usepackage[ngerman]{babel}

\usepackage[all]{genealogytree}

\gtrset{
  template/my symbol nodes/.style={
    processing=database,
    database format=symbol,
    level distance=5mm,
    level size=5mm,
    node size=5mm,
    box clear,
    box={capture=minipage,enhanced,size=fbox,boxsep=0mm,boxrule=0.25mm,
      halign=center,valign=center,fontupper=\fontsize{4.7mm}{4.7mm}\selectfont,
      temp@late/symopt/\gtrDBsex},
    edges={anchoring=center,background={white,line width=0.6mm},foreground={green!25!black,line width=0.3mm}},
  },
}

\begin{document}

\section*{Test for T-F-S}

\begin{tikzpicture}
        \genealogytree[
         timeflow=right, processing=database, template=my symbol nodes
        ]{%
        sandclock {
  child {
    g[%
]{
      sex = male,
}
    union {
    p[%
]{
      sex = female,
}
c[%
]{
      sex = female,
}
}
}
}
}
        \end{tikzpicture}

    Thank you for your wonderful piece of Free Software!

\end{document}
jojomi commented 6 years ago

Thank you very much, that solves my initial problem nicely and I can even use full database entries wíth it.

One thing that happens to me though with your code is that the edge is connected slightly off-center. I see that on both types of gender nodes (I thought it might be because of different size, but that does not seem to be the cause?) and in different cases in a larger tree. Is there anything I can do?

mwe.pdf bildschirmfoto vom 2018-10-03 14-22-23

T-F-S commented 6 years ago

I guess that you used a lot of superflous union constructs. A union is only needed, if a person as childs with more than one partner.

I tried to recreate a part of your tree:

\documentclass[10pt,paper=a4,ngerman]{scrartcl}

\usepackage[ngerman]{babel}

\usepackage[all]{genealogytree}

\gtrset{
  template/my symbol nodes/.style={
    processing=database,
    database format=symbol,
    level distance=5mm,
    level size=5mm,
    node size=5mm,
    box clear,
    box={capture=minipage,enhanced,size=fbox,boxsep=0mm,boxrule=0.25mm,
      halign=center,valign=center,fontupper=\fontsize{4.7mm}{4.7mm}\selectfont,
      temp@late/symopt/\gtrDBsex},
    edges={anchoring=center,background={white,line width=0.6mm},foreground={green!25!black,line width=0.3mm}},
  },
}

\begin{document}

\noindent Superfluous union:\\
\begin{tikzpicture}
\genealogytree[
  timeflow=right, template=my symbol nodes
]{%
  sandclock {
    child {
      g{sex=male}
      union {
        p{sex=female}
        c{sex=female}
      }
    }
  }
}
\end{tikzpicture}

\noindent Without union:\\
\begin{tikzpicture}
\genealogytree[
  timeflow=right, template=my symbol nodes
]{%
  sandclock {
    child {
      g{sex=male}% <- proband
      p{sex=female}
      c{sex=female}
    }
  }
}
\end{tikzpicture}

\noindent Needed union:\\
\begin{tikzpicture}
\genealogytree[
  timeflow=right, template=my symbol nodes
]{%
  sandclock {
    child {
      p{sex=female}
      g{sex=male}% <- proband
      c{sex=female}
      union{
        p{sex=female}
        c{sex=male}
      }
    }
  }
}
\end{tikzpicture}

\noindent Larger Tree:\\
\begin{tikzpicture}
\genealogytree[
  timeflow=down, template=my symbol nodes
]{%
  sandclock {
    child {
      g{sex=male}% <- proband
      p{sex=female}
      child{
        g{sex=male}
        child{
          g{sex=male}
          child{
            g{sex=male}
          }
        }
        child{
          g{sex=male}
          child{
            g{sex=female}
          }
          child{
            g{sex=female}
          }
        }
        child{
          g{sex=female}
          child{
            g{sex=male}
          }
          child{
            g{sex=male}
          }
        }
        child{
          g{sex=male}
          child{
            g{sex=male}
          }
        }
      }
    }
  }
}
\end{tikzpicture}
\end{document}

symbolnodes2

jojomi commented 6 years ago

Thank you once again!

I fixed my output in https://github.com/jojomi/generations and now the tree is perfect.