%% The LaTeX package genealogytree - version 2.3.0 (2023/03/09)
%% gtrlib.templates.code.tex: Templates
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2013-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% This work consists of all files listed in README
%%
\gtr@set@library@version{2.3.0}

% Templates

\gtrset{
  template/.is choice,
%
  template/formal graph/.style={
    processing=tcbox*,
    level distance=5mm,
    level size=8mm,
    node size=8mm,
    box clear,
    box={enhanced,size=fbox,boxsep=0.15mm,boxrule=0.5mm,arc=1mm,valign=center,
      before upper={\strut$\displaystyle},after upper={$},
      colback=gtr_Peach_Back,colframe=gtr_Peach_Frame
    }
  },
%
  template/signpost/.style={
    processing=fit,
    level distance=1cm,
    level size=1.5cm,
    node size from=2cm to 4cm,
    box clear,
    box={enhanced,fit basedim=8pt,
      halign=center,valign=center,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      drop fuzzy shadow
    }
  },
%
  template/symbol nodes/.style={
    processing=tcbox*,
    level distance=5mm,
    level size=5mm,
    node size=5mm,
    box clear,
    box={enhanced,size=fbox,boxsep=0mm,boxrule=0.25mm,valign=center,fontupper=\fontsize{4.7mm}{4.7mm}\selectfont},
    content interpreter code={%
      \gtrset{box={temp@late/symopt/##1}}%
      \def\gtrBoxContent{\centering\gtrset{sex@/##1}}%
    },
    edges={anchoring=center,background={white,line width=0.6mm},foreground={green!25!black,line width=0.3mm}},
  },
%
  template/tiny boxes/.style={
    processing=tcbox*,
    level distance=5mm,
    level size=3mm,
    node size=3mm,
    box clear,
    box={enhanced,size=fbox,boxsep=0mm,boxrule=0.15mm,colframe=black,colback=black!10},
    deletion content interpreter,
    edges={perpendicular,anchoring=center,background={white,line width=0.5mm},foreground={black,line width=0.2mm}},
  },
%
  template/tiny circles/.style={
    processing=tcbox*,
    level distance=5mm,
    level size=3mm,
    node size=3mm,
    child distance=2mm,
    parent distance=2mm,
    further distance=2mm,
    box clear,
    box={enhanced,size=fbox,boxsep=0mm,boxrule=0.15mm,circular arc,colframe=black,colback=black!50},
    deletion content interpreter,
    edges={mesh,anchoring=center,background={white,line width=0.5mm},foreground={black,line width=0.2mm}},
  },
%
  template/directory/.style={
    processing=tcbox*,
    content interpreter content={\detokenize{##1}},
    timeflow=right,
    level distance=3mm,
    level size=3cm,
    node size=6mm,
    box clear,
    box={enhanced,
      tcbox width=minimum left,
      size=fbox,
      colframe=black!20,
      colback=yellow!20,
      boxrule=0.3mm,
      valign=center,
      fontupper=\ttfamily,
      before upper=\strut,
      code={\ifdefstring{\gtrnodetype}{g}{\tcbset{after upper={/}}}{}},
    },
    edges={perpendicular,
      foreground={black,line width=0.3mm},
      background={white,line width=0.8mm}
    },
  },
%
  database@malefemale/.style={
    tcbset={male/.style={colframe=gtr_Male_Frame,colback=gtr_Male_Background,arc is angular,drop fuzzy shadow=blue!25!black!30},
            female/.style={colframe=gtr_Female_Frame,colback=gtr_Female_Background,drop fuzzy shadow=red!25!black!30},
            neuter/.style={colframe=gtr_Neuter_Frame,colback=gtr_Neuter_Background,drop fuzzy shadow=black!30}},
  },
%
  database@malefemale@reduced/.style={
    tcbset={male/.style={colframe=gtr_Male_Frame,colback=gtr_Male_Background,arc is angular,
              fuzzy shadow={0.1mm}{-0.1mm}{0mm}{0.012mm}{blue!25!black!30}},
            female/.style={colframe=gtr_Female_Frame,colback=gtr_Female_Background,
              fuzzy shadow={0.1mm}{-0.1mm}{0mm}{0.012mm}{red!25!black!30}},
            neuter/.style={colframe=gtr_Neuter_Frame,colback=gtr_Neuter_Background,
              fuzzy shadow={0.1mm}{-0.1mm}{0mm}{0.012mm}{black!30}}},
  },
%
  database@geometry@reduced/.style={%
    level distance=0.5mm,
    level size=3.5mm,
    node size=2.5mm,
    child distance in parent graph=0.1mm,
    child distance in child graph=0.2mm,
    parent distance in parent graph=0.2mm,
    parent distance in child graph=0.1mm,
    further distance=0.3mm,
  },
%
  database@edges/.style={%
    edges={perpendicular,
      foreground={black,line width=0.3mm},
      background={white,line width=0.8mm}
    }%
  },
%
  database@edges@reduced/.style={%
    edges={perpendicular,
      foreground={black,line width=0.03mm},
      background={white,line width=0.08mm}
    }%
  },
%
  template/database pole/.style={
    processing=database,
    database format=full marriage above,
    level distance=6mm,
    level size=4.5cm,
    node size=2cm,
    name font=\bfseries,
    surn code={##1},
    database@malefemale,
    box clear,
    box={enhanced,boxrule=0.3mm,
      fit basedim=7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,shorten >=1mm,shorten <=1mm},
      \gtrDBsex,
    },
    database@edges
  },
%
  template/database pole reduced/.style={
    processing=database,
    database format=full marriage above,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=4.5mm,
    node size=2mm,
    name font=\bfseries,
    surn code={##1},
    database@malefemale@reduced,
    box clear,
    box={enhanced,
      boxrule=0.03mm,boxsep=0.1pt,arc=0.1mm,fit basedim=0.7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.04pt,shorten >=0.1mm,shorten <=0.1mm},
      \gtrDBsex,
    },
    database@edges@reduced
  },
%
  template/database poleportrait/.style={
    processing=database,
    database format=full marriage above,
    level distance=6mm,
    level size=4.5cm,
    node size=2cm,
    name font=\bfseries,
    surn code={##1},
    database@malefemale,
    box clear,
    box={enhanced,boxrule=0.3mm,
      fit basedim=7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      if image defined={%
        width=45mm,
        right=25mm,
        segmentation style={solid,shorten >=25mm,shorten <=1mm},
        underlay={\begin{tcbclipinterior}%
          \path[preaction={fill=tcbcolframe!10!tcbcolback},fill zoom DBimage]
          ([xshift=-24mm]interior.south east) rectangle (interior.north east);
        \end{tcbclipinterior}},%
      }{%
        segmentation style={solid,shorten >=1mm,shorten <=1mm},
      },
    },
    database@edges
  },
%
  template/database poleportrait reduced/.style={
    processing=database,
    database format=full marriage above,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=4.5mm,
    node size=2mm,
    name font=\bfseries,
    surn code={##1},
    database@malefemale@reduced,
    box clear,
    box={enhanced,
      boxrule=0.03mm,boxsep=0.1pt,arc=0.1mm,fit basedim=0.7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      if image defined={%
        width=4.5mm,
        right=2.5mm,
        segmentation style={solid,line width=0.04pt,shorten >=2.5mm,shorten <=0.1mm},
        underlay={\begin{tcbclipinterior}%
          \path[preaction={fill=tcbcolframe!10!tcbcolback},fill zoom DBimage]
          ([xshift=-2.4mm]interior.south east) rectangle (interior.north east);
        \end{tcbclipinterior}},%
      }{%
        segmentation style={solid,line width=0.04pt,shorten >=0.1mm,shorten <=0.1mm},
      },
    },
    database@edges@reduced
  },
%
  template/database portrait/.style={
    processing=database,
    database format=short no marriage,
    level distance=6mm,
    level size=4cm,
    node size=2cm,
    name font=\bfseries,
    surn code={##1},
    event format=prefix date,
    database@malefemale,
    box clear,
    box={enhanced,boxrule=0.3mm,
      top=25mm+0.2\tcbfitdim,
      fit basedim=7pt,
      halign=flush center,
      valign=center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      underlay={\begin{tcbclipinterior}%
        \gtrifimagedefined{\path[fill overzoom DBimage]
          ([yshift=-25mm]interior.north west) rectangle (interior.north east);}{%
          \path[fill overzoom picture=\gtrDrawSymbolicPortrait]
          ([yshift=-25mm]interior.north west) rectangle (interior.north east);
          }%
      \end{tcbclipinterior}%
      },
    },
    database@edges
  },
%
  template/database portrait reduced/.style={
    processing=database,
    database format=short no marriage,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=4mm,
    node size=2mm,
    name font=\bfseries,
    surn code={##1},
    event format=prefix date,
    database@malefemale@reduced,
    box clear,
    box={enhanced,
      boxrule=0.03mm,boxsep=0.1pt,arc=0.1mm,fit basedim=0.7pt,
      top=2.5mm+0.2\tcbfitdim,
      halign=flush center,
      valign=center,%
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      underlay={\begin{tcbclipinterior}%
        \gtrifimagedefined{\path[fill overzoom DBimage]
          ([yshift=-2.5mm]interior.north west) rectangle (interior.north east);}{%
          \path[fill overzoom picture=\gtrDrawSymbolicPortrait]
          ([yshift=-2.5mm]interior.north west) rectangle (interior.north east);
          }%
      \end{tcbclipinterior}%
      },
    },
    database@edges@reduced
  },
%
  template/database traditional/.style={
    timeflow=down,
    processing=database,
    database format=short no marriage,
    level distance=6mm,
    level size=2cm,
    node size=2cm,
    event format=prefix date,
    name font=\bfseries,
    surn code={##1},
    tcbset={gtrnodealign/.code={%
      \gtrifleafchild{\tcbset{valign=top}}{%
        \gtrifleafparent{\tcbset{valign=bottom}}{\tcbset{valign=center}}%
      }%
    }},
    box clear,
    box={blanker,
      top=1mm,bottom=1mm,
      fit basedim=7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      gtrnodealign
    },
    edges={rounded=1mm,
      foreground={black,line width=0.3mm},
      background={white,line width=0.8mm}
    },
  },
%
  template/database traditional reduced/.style={
    timeflow=down,
    processing=database,
    database format=short no marriage,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=2mm,
    node size=2mm,
    event format=prefix date,
    name font=\bfseries,
    surn code={##1},
    tcbset={gtrnodealign/.code={%
      \gtrifleafchild{\tcbset{valign=top}}{%
        \gtrifleafparent{\tcbset{valign=bottom}}{\tcbset{valign=center}}%
      }%
    }},
    box clear,
    box={blanker,
      top=0.1mm,bottom=0.1mm,
      fit basedim=0.7pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      gtrnodealign
    },
    edges={rounded=0.1mm,
      foreground={black,line width=0.03mm},
      background={white,line width=0.08mm}
    },
  },
%
  template/database sideways/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    level distance=6mm,
    level size=4cm,
    node size from=3mm to 50mm,
    surn code=\textbf{##1},
    pref code=\textbf{##1},
    database@malefemale,
    list separators={\tcbline\hangindent=\tcbfitdim\hangafter=1}%
      {\par\hangindent=\tcbfitdim\hangafter=1}{\par}{\gtrifcommentdefined{\tcbline}{\gtrifprofessiondefined{\tcbline}{}}},
    box clear,
    box={enhanced,boxrule=0.3mm,
      top=1mm,bottom=1mm,left=1mm,right=1mm,middle=0.7mm,boxsep=0pt,
      fit basedim=7pt,
      halign=flush left,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,shorten >=1mm,shorten <=1mm},
      \gtrDBsex,
    },
    database@edges
  },
%
  template/database sideways reduced/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=4mm,
    node size from=0.3mm to 5mm,
    surn code=\textbf{##1},
    pref code=\textbf{##1},
    database@malefemale@reduced,
    list separators={\tcbline\hangindent=\tcbfitdim\hangafter=1}%
      {\par\hangindent=\tcbfitdim\hangafter=1}{\par}{\gtrifcommentdefined{\tcbline}{\gtrifprofessiondefined{\tcbline}{}}},
    box clear,
    box={enhanced,boxrule=0.03mm,
      top=0.1mm,bottom=0.1mm,left=0.1mm,right=0.1mm,middle=0.07mm,boxsep=0pt,arc=0.1mm,
      fit basedim=0.7pt,
      halign=flush left,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.04pt,shorten >=0.1mm,shorten <=0.1mm},
      \gtrDBsex,
    },
    database@edges@reduced
  },
%
  template/database sidewaysportrait/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    level distance=6mm,
    level size=60mm,
    node size from=3mm to 50mm,
    surn code=\textbf{##1},
    pref code=\textbf{##1},
    database@malefemale,
    list separators={\tcbline\hangindent=\tcbfitdim\hangafter=1}%
      {\par\hangindent=\tcbfitdim\hangafter=1}{\par}{\gtrifcommentdefined{\tcbline}{\gtrifprofessiondefined{\tcbline}{}}},
    box clear,
    box={enhanced,boxrule=0.3mm,
      top=1mm,bottom=1mm,left=1mm,right=1mm,middle=0.7mm,boxsep=0pt,
      fit basedim=7pt,
      halign=flush left,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      if image defined={%
        height from=32.5mm to 60mm,
        right=25mm,
        segmentation style={solid,shorten >=25mm,shorten <=1mm},
        underlay={\begin{tcbclipinterior}%
          \path[preaction={fill=tcbcolframe!10!tcbcolback},fill zoom DBimage]
          ([xshift=-24mm]interior.south east) rectangle (interior.north east);
        \end{tcbclipinterior}},%
      }{%
        segmentation style={solid,shorten >=1mm,shorten <=1mm},
      },
    },
    database@edges
  },
%
  template/database sidewaysportrait reduced/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    database@geometry@reduced,
    level distance=0.6mm,
    level size=6mm,
    node size from=0.3mm to 5mm,
    surn code=\textbf{##1},
    pref code=\textbf{##1},
    database@malefemale@reduced,
    list separators={\tcbline\hangindent=\tcbfitdim\hangafter=1}%
      {\par\hangindent=\tcbfitdim\hangafter=1}{\par}{\gtrifcommentdefined{\tcbline}{\gtrifprofessiondefined{\tcbline}{}}},
    box clear,
    box={enhanced,boxrule=0.03mm,
      top=0.1mm,bottom=0.1mm,left=0.1mm,right=0.1mm,middle=0.07mm,boxsep=0pt,arc=0.1mm,
      fit basedim=0.7pt,
      halign=flush left,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      if image defined={%
        height from=3.25mm to 6mm,
        right=2.5mm,
        segmentation style={solid,line width=0.04pt,shorten >=2.5mm,shorten <=0.1mm},
        underlay={\begin{tcbclipinterior}%
          \path[preaction={fill=tcbcolframe!10!tcbcolback},fill zoom DBimage]
          ([xshift=-2.4mm]interior.south east) rectangle (interior.north east);
        \end{tcbclipinterior}},%
      }{%
        segmentation style={solid,line width=0.04pt,shorten >=0.1mm,shorten <=0.1mm},
      },
    },
    database@edges@reduced
  },
%
  template/database relationship/.style={
    timeflow=down,
    processing=database,
    database format=medium no marriage,
    level distance=3mm,
    level size=15mm,
    node size=8cm,
    parent distance=3mm,
    child distance=1cm,
    further distance=1cm,
    name font=\bfseries,
    surn code={##1},
    date format=d.mon.yyyy,
    database@malefemale,
    box clear,
    box={
      boxrule=0.15mm,arc=1mm,boxsep=0mm,
      top=0.5mm,bottom=0.5mm,left=1mm,right=1mm,
      halign=flush center,
      valign=center,
      fit basedim=8pt,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      \gtrDBsex,
      if image defined={%
        code={\tcbdimto\gtr@im@width{0.77778\dimexpr\gtr@level@size-0.3mm\relax}},%
        left=\gtr@im@width+1mm,
        underlay={\begin{tcbclipinterior}%
          \path[fill overzoom DBimage]
          (interior.south west) rectangle ([xshift=\gtr@im@width]interior.north west);
        \end{tcbclipinterior}%
        },
      }{},
    },
    database@edges
  },
%
  ahnentafel@malefemale/.style={
    tcbset={male/.style={colframe=gtr_Male_Frame,colback=gtr_Male_Background,arc is angular},
            female/.style={colframe=gtr_Female_Frame,colback=gtr_Female_Background},
            neuter/.style={colframe=gtr_Neuter_Frame,colback=gtr_Neuter_Background}},
  },
%
  template/ahnentafel 3/.style={%
    timeflow=left,
    processing=database,
    database format=medium,
    level distance=2mm,
    level size=55mm,
    node size=26mm,
    parent distance=0mm,
    further distance=0mm,
    list separators hang,
    ahnentafel@malefemale,
    box={\gtrDBsex,before upper={\parskip=0.1\tcbfitdim},halign=flush left,},
    edges={mesh,anchoring=center,no background,foreground={line width=10mm,green!50!black!50}},
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=42mm,
        node size=50mm,
        node box={fit basedim=10pt}
      }%
      \or\gtrset{% 1
        level size=37mm,
        node size=50mm,
        parent distance=4mm,
        further distance=2mm,
        node box={fit basedim=9pt}
      }%
      \or\gtrset{% 2
        level distance=3mm,
        level size=36mm,
        node size=40mm,
        parent distance=2mm,
        further distance=1mm,
        node box={boxrule=0.4mm,arc=0.8mm,fit basedim=9pt}
      }%
      \else\gtrset{% 3+
        parent distance=1mm,
        further distance=0.5mm,
        node box={boxrule=0.3mm,arc=0.6mm,valign=center,fit basedim=9pt},
        family edges={foreground={line width=8mm,green!50!black!50}},
      }%
      \fi%
    },
  },
%
  template/ahnentafel 4/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    level distance=2mm,
    level size=46mm,
    node size=16mm,
    parent distance=0mm,
    further distance=0mm,
    list separators hang,
    ahnentafel@malefemale,
    box={\gtrDBsex,before upper={\parskip=0.1\tcbfitdim},halign=flush left,},
    edges={mesh,anchoring=center,no background,foreground={line width=10mm,green!50!black!50}},
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=42mm,
        node size=50mm,
        node box={fit basedim=10pt}
      }%
      \or\gtrset{% 1
        level distance=-25mm,
        level size=37mm,
        node size=50mm,
        parent distance=58mm,
        further distance=2mm,
        node box={fit basedim=9pt}
      }%
      \or\gtrset{% 2
        level distance=3mm,
        level size=36mm,
        node size=40mm,
        parent distance=2mm,
        further distance=1mm,
        node box={boxrule=0.4mm,arc=0.8mm,fit basedim=9pt}
      }%
      \or\gtrset{% 3
        level size=38mm,
        node size=26mm,
        parent distance=1mm,
        further distance=0.5mm,
        node box={boxrule=0.3mm,arc=0.6mm,valign=center,fit basedim=8pt},
        family edges={foreground={line width=8mm,green!50!black!50}},
      }%
      \else\gtrset{% 4+
        parent distance=0.25mm,
        further distance=0.25mm,
        node box={boxrule=0.2mm,arc=0.4mm,valign=center,fit basedim=8pt},
        family edges={foreground={line width=7mm,green!50!black!50}},
      }%
      \fi%
    },
  },
%
  template/ahnentafel 5/.style={
    timeflow=left,
    processing=database,
    database format=medium,
    level distance=2mm,
    level size=34mm,
    node size=8.2mm,
    parent distance=0mm,
    further distance=0mm,
    list separators hang,
    ahnentafel@malefemale,
    box={\gtrDBsex,before upper={\parskip=0.1\tcbfitdim},halign=flush left,},
    edges={mesh,anchoring=center,no background,foreground={line width=5mm,green!50!black!50}},
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=40mm,
        node size=50mm,
        node box={fit basedim=10pt},
        family edges={foreground={line width=10mm,green!50!black!50}},
      }%
      \or\gtrset{% 1
        level distance=-25mm,
        level size=35mm,
        node size=50mm,
        parent distance=58mm,
        further distance=2mm,
        node box={fit basedim=9pt},
        family edges={foreground={line width=10mm,green!50!black!50}},
      }%
      \or\gtrset{% 2
        level distance=3mm,
        level size=30mm,
        node size=40mm,
        parent distance=2mm,
        further distance=1mm,
        node box={boxrule=0.4mm,arc=0.8mm,fit basedim=8pt},
        family edges={foreground={line width=10mm,green!50!black!50}},
      }%
      \or\gtrset{% 3
        level size=30mm,
        node size=26mm,
        parent distance=1mm,
        further distance=0.5mm,
        node box={boxrule=0.3mm,arc=0.6mm,fit basedim=7pt},
        family edges={foreground={line width=8mm,green!50!black!50}},
      }%
      \or\gtrset{% 4
        level size=34mm,
        node size=16mm,
        parent distance=0.25mm,
        further distance=0.25mm,
        node={list separators={\par}{, }{.\par}{\par}},
        node box={boxrule=0.2mm,arc=0.4mm,valign=center,fit basedim=7pt},
        family edges={foreground={line width=7mm,green!50!black!50}},
      }%
      \else\gtrset{% 5+
        node={database format=short,list separators={, }{, }{.}{}},
        node box={size=fbox,boxsep=0.5mm,boxrule=0.1mm,arc=0.2mm,
          valign=center,fit basedim=6pt},
        family edges={foreground={line width=5mm,green!50!black!50}},
      }%
      \fi%
    },
  },
%
  template horizontal border/.style = {},
  template vertical border/.style = {},
  template@fixedsize@common/.style = {%
    processing=database,
    database format=full marriage below,
    name font=\bfseries,
    surn code={##1},
    tcbset={%
      male/.style={colframe=gtr_Male_Frame,colback=gtr_Male_Background,arc is angular},
      female/.style={colframe=gtr_Female_Frame,colback=gtr_Female_Background},
      neuter/.style={colframe=gtr_Neuter_Frame,gtr_Neuter_Background}%
    },%
    box clear,
    complemented/.style={%
      box={colframe=gray!50,colback=white},
    },
    empty name text={},
  },
%
  template@fixedsize@common@3/.style = {%
    template@fixedsize@common,
    autofill parents male female* = 3,
    box={enhanced,top=0mm,bottom=0mm,middle=0.15mm,
      boxrule=0.15mm,boxsep=0.25mm,arc=0.5mm,fit basedim=9pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.06mm,shorten >=0.4mm,shorten <=0.4mm},
      \gtrDBsex,
    },
    edges={rounded=3pt,
      foreground={black,line width=0.3mm},
      background={white,line width=0.9mm}
      },
    complemented family/.style={%
      edges={rounded=3pt,
        foreground={gray!50,line width=0.3mm},
        background={white,line width=0.9mm}
        },
    },
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=\gtr@tmpl@height@z,
        node size=\gtr@tmpl@width@z,
      }%
      \or\gtrset{% 1
        level size=\gtr@tmpl@height@i,
        node size=\gtr@tmpl@width@i,
      }%
      \or\gtrset{% 2
        level size=\gtr@tmpl@height@ii,
        node size=\gtr@tmpl@width@ii,
      }%
      \or\gtrset{% 3
        level size=\gtr@tmpl@height@iii,
        node size=\gtr@tmpl@width@iii,
        node box={fit basedim=8pt},
      }%
      \or\gtrset{% 4
        node=ignore,
      }%
      \else\gtrset{% 5+
        ignore,
      }%
      \fi%
    },
  },
%
  template@fixedsize@common@4/.style = {%
    template@fixedsize@common,
    autofill parents male female* = 4,
    box={enhanced,top=0mm,bottom=0mm,middle=0.15mm,
      boxrule=0.15mm,boxsep=0.25mm,arc=0.5mm,fit basedim=6.5pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.06mm,shorten >=0.4mm,shorten <=0.4mm},
      \gtrDBsex,
    },
    edges={rounded=3pt,
      foreground={black,line width=0.3mm},
      background={white,line width=0.9mm}
      },
    complemented family/.style={%
      edges={rounded=3pt,
        foreground={gray!50,line width=0.3mm},
        background={white,line width=0.9mm}
        },
    },
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=\gtr@tmpl@height@z,
        node size=\gtr@tmpl@width@z,
      }%
      \or\gtrset{% 1
        level size=\gtr@tmpl@height@i,
        node size=\gtr@tmpl@width@i,
      }%
      \or\gtrset{% 2
        level size=\gtr@tmpl@height@ii,
        node size=\gtr@tmpl@width@ii,
      }%
      \or\gtrset{% 3
        level size=\gtr@tmpl@height@iii,
        node size=\gtr@tmpl@width@iii,
      }%
      \or\gtrset{% 4
        level size=\gtr@tmpl@height@iv,
        node size=\gtr@tmpl@width@iv,
        node box={fit basedim=6pt},
      }%
      \or\gtrset{% 5
        node=ignore,
      }%
      \else\gtrset{% 6+
        ignore,
      }%
      \fi%
    },
  },
%
  template/display 16:9 3/.style={
    template@fixedsize@common@3,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(312mm-2*(##1))/308mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{70mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{70mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{70mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{38.5mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(171mm-2*(##1))/167mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{36mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{36mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{36mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{59mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=2mm,
    template vertical border=2mm,
    level distance=3mm,
    parent distance in parent graph=1.142857mm,
    further distance=1.142857mm,
  },
%
  template/display 16:10 3/.style={
    template=display 16:9 3,
    template vertical border/.style={template@vertical@border=(##1-10mm)},
    template vertical border=2mm,
  },
%
  template/display 16:9 4/.style={%
    template@fixedsize@common@4,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(308mm-2*(##1))/304mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{30mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iv {\fpeval{19mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(168mm-2*(##1))/164mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{25mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{25mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{25mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{40mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iv {\fpeval{49mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=2mm,
    template vertical border=2mm,
    level distance=3mm,
    parent distance in parent graph=0.8mm,
    further distance=0.8mm,
  },
%
  template/display 16:10 4/.style={
    template=display 16:9 4,
    template vertical border/.style={template@vertical@border=(##1-10mm)},
    template vertical border=2mm,
  },
%
  template/display 16:9 5/.style={%
    template@fixedsize@common,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(304.8mm-2*(##1))/300.8mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{40mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{40mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{40mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{20mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iv {\fpeval{15mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@v  {\fpeval{9.4mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(167.5mm-2*(##1))/163.5mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{15mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{15mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{15mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{30mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iv {\fpeval{40mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@v  {\fpeval{48.5mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=2mm,
    template vertical border=2mm,
    level distance=2.5mm,
    parent distance in parent graph=0.490323mm,
    further distance=0.490323mm,
    autofill parents male female* = 5,
    box={enhanced,top=0mm,bottom=0mm,middle=0.1mm,
      boxrule=0.1mm,boxsep=0.2mm,arc=0.4mm,fit basedim=5pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.05mm,shorten >=0.3mm,shorten <=0.3mm},
      \gtrDBsex,
    },
    edges={rounded=3pt,
      foreground={black,line width=0.2mm},
      background={white,line width=0.6mm}
      },
    complemented family/.style={%
      edges={rounded=3pt,
        foreground={gray!50,line width=0.2mm},
        background={white,line width=0.6mm}
        },
    },
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=\gtr@tmpl@height@z,
        node size=\gtr@tmpl@width@z,
      }%
      \or\gtrset{% 1
        level size=\gtr@tmpl@height@i,
        node size=\gtr@tmpl@width@i,
      }%
      \or\gtrset{% 2
        level size=\gtr@tmpl@height@ii,
        node size=\gtr@tmpl@width@ii,
      }%
      \or\gtrset{% 3
        level size=\gtr@tmpl@height@iii,
        node size=\gtr@tmpl@width@iii,
      }%
      \or\gtrset{% 4
        level size=\gtr@tmpl@height@iv,
        node size=\gtr@tmpl@width@iv,
      }%
      \or\gtrset{% 5
        level size=\gtr@tmpl@height@v,
        node size=\gtr@tmpl@width@v,
        node box={fit basedim=3.5pt},
      }%
      \or\gtrset{% 6
        node=ignore,
      }%
      \else\gtrset{% 7+
        ignore,
      }%
      \fi%
    },
  },
%
  template/display 16:10 5/.style={
    template=display 16:9 5,
    template vertical border/.style={template@vertical@border=(##1-10mm)},
    template vertical border=2mm,
  },
%
  template/a4paper 3/.style={
    template@fixedsize@common@3,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(290mm-2*(##1))/276mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{65mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{65mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{60mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{34.5mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(201mm-2*(##1))/187mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{38mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{38mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{41mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{70mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=7mm,
    template vertical border=7mm,
    level distance=3mm,
    parent distance in parent graph=1mm,
    further distance=1mm,
  },
%
  template/letterpaper 3/.style={
    template=a4paper 3,
    template horizontal border/.style={template@horizontal@border=(##1+8.8mm)},
    template vertical border/.style={template@vertical@border=(##1-2.95mm)},
    template horizontal border=0.25in,
    template vertical border=0.25in,
  },
%
  template/a4paper 4/.style={
    template@fixedsize@common@4,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(286mm-2*(##1))/272mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{48mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{30mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iv {\fpeval{17mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(198mm-2*(##1))/184mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{27mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{27mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{27mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{43mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iv {\fpeval{60mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=7mm,
    template vertical border=7mm,
    level distance=3mm,
    parent distance in parent graph=0.733333mm,
    further distance=0.733333mm,
  },
%
  template/letterpaper 4/.style={
    template=a4paper 4,
    template horizontal border/.style={template@horizontal@border=(##1+8.8mm)},
    template vertical border/.style={template@vertical@border=(##1-2.95mm)},
    template horizontal border=0.25in,
    template vertical border=0.25in,
  },
%
  template/a3paper 5/.style={
    template@fixedsize@common,
    template@horizontal@border/.code={%
      \edef\gtr@tmpl@xscale   {\fpeval{(398mm-2*(##1))/384mm}}%
      \edef\gtr@tmpl@width@z  {\fpeval{50mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@i  {\fpeval{50mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@ii {\fpeval{50mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iii{\fpeval{30mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@iv {\fpeval{20mm*\gtr@tmpl@xscale}pt}%
      \edef\gtr@tmpl@width@v  {\fpeval{12mm*\gtr@tmpl@xscale}pt}%
    },
    template@vertical@border/.code={%
      \edef\gtr@tmpl@yscale    {\fpeval{(282mm-2*(##1))/268mm}}%
      \edef\gtr@tmpl@height@z  {\fpeval{30mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@i  {\fpeval{30mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@ii {\fpeval{30mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iii{\fpeval{50mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@iv {\fpeval{58mm*\gtr@tmpl@yscale}pt}%
      \edef\gtr@tmpl@height@v  {\fpeval{70mm*\gtr@tmpl@yscale}pt}%
    },
    template horizontal border/.style={template@horizontal@border={##1}},
    template vertical border/.style={template@vertical@border={##1}},
    template horizontal border=7mm,
    template vertical border=7mm,
    level distance=3mm,
    parent distance in parent graph=0.709677mm,
    further distance=0.709677mm,
    autofill parents male female* = 5,
    box={enhanced,top=0mm,bottom=0mm,middle=0.15mm,
      boxrule=0.15mm,boxsep=0.25mm,arc=0.5mm,fit basedim=6.5pt,
      halign=flush center,
      fontupper=\sffamily,
      before upper={\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
      segmentation style={solid,line width=0.06mm,shorten >=0.4mm,shorten <=0.4mm},
      \gtrDBsex,
    },
    edges={rounded=3pt,
      foreground={black,line width=0.3mm},
      background={white,line width=0.9mm}
      },
    complemented family/.style={%
      edges={rounded=3pt,
        foreground={gray!50,line width=0.3mm},
        background={white,line width=0.9mm}
        },
    },
    level/.code={%
      \ifcase##1\relax\gtrset{% 0
        level size=\gtr@tmpl@height@z,
        node size=\gtr@tmpl@width@z,
      }%
      \or\gtrset{% 1
        level size=\gtr@tmpl@height@i,
        node size=\gtr@tmpl@width@i,
      }%
      \or\gtrset{% 2
        level size=\gtr@tmpl@height@ii,
        node size=\gtr@tmpl@width@ii,
      }%
      \or\gtrset{% 3
        level size=\gtr@tmpl@height@iii,
        node size=\gtr@tmpl@width@iii,
      }%
      \or\gtrset{% 4
        level size=\gtr@tmpl@height@iv,
        node size=\gtr@tmpl@width@iv,
        node box={fit basedim=6pt},
      }%
      \or\gtrset{% 5
        level size=\gtr@tmpl@height@v,
        node size=\gtr@tmpl@width@v,
        node box={fit basedim=5pt},
      }%
      \or\gtrset{% 6
        node=ignore,
      }%
      \else\gtrset{% 7+
        ignore,
      }%
      \fi%
    },
  },
}


% Auxiliary
\tcbset{
  temp@late/symopt/m/.style={colframe=blue!50!black,colback=blue!8,arc=0.15mm},
  temp@late/symopt/male/.style={colframe=blue!50!black,colback=blue!8,arc=0.15mm},
  temp@late/symopt/f/.style={colframe=red!50!black,colback=red!8,circular arc},
  temp@late/symopt/female/.style={colframe=red!50!black,colback=red!8,circular arc},
  temp@late/symopt/.unknown/.style={colframe=black!75,colback=black!5,arc=1.2mm}
}

\csdef{gtrparent1}{p{male} p{female}}
\csdef{gtrparent2}{parent{g{male} p{male} p{female}} parent{g{female} p{male} p{female}}}
\csdef{gtrparent3}{parent{g{male} insert{gtrparent2}} parent{g{female} insert{gtrparent2}}}
\csdef{gtrparent4}{parent{g{male} insert{gtrparent3}} parent{g{female} insert{gtrparent3}}}
\csdef{gtrparent5}{parent{g{male} insert{gtrparent4}} parent{g{female} insert{gtrparent4}}}
\csdef{gtrparent6}{parent{g{male} insert{gtrparent5}} parent{g{female} insert{gtrparent5}}}
\csdef{gtrparent7}{parent{g{male} insert{gtrparent6}} parent{g{female} insert{gtrparent6}}}

\def\gtrDrawSymbolicPortrait{%
\path[top color=tcbcolframe!25!tcbcolback,bottom color=tcbcolframe!25!tcbcolback,
  middle color=tcbcolback]
  (-1.75,0) rectangle (1.75,4.5);
 \path[fill=tcbcolframe!75!tcbcolback] (0,2.5) circle (1cm);
 \path[fill=tcbcolframe!75!tcbcolback] (1.5,0) arc
   [start angle=0, end angle=180, x radius=15mm, y radius=12mm] -- cycle;
}

% Colors

\definecolor{gtr_Peach_Back}{rgb}{1.000000, 0.917647, 0.788235}
\definecolor{gtr_Peach_Frame}{rgb}{0.611765, 0.160784, 0.015686}

\definecolor{gtr_Yellow_Back}{rgb}{1.000000, 1.000000, 0.862745}
\definecolor{gtr_Yellow_Frame}{rgb}{0.764706, 0.678431, 0.407843}

\definecolor{gtr_Blue_1}{rgb}{0.090196,0.211765,0.364706}
\definecolor{gtr_Blue_2}{rgb}{0.211765,0.372549,0.568627}
\definecolor{gtr_Blue_3}{rgb}{0.309804,0.505882,0.741176}
\definecolor{gtr_Blue_4}{rgb}{0.584314,0.701961,0.843137}
\definecolor{gtr_Blue_5}{rgb}{0.721569,0.800000,0.894118}
\definecolor{gtr_Blue_6}{rgb}{0.858824,0.898039,0.945098}

\definecolor{gtr_Bright_Red}{rgb}{1.000000,0.294118,0.062745}

\colorlet{gtr_Male_Frame}{blue!50!black}
\colorlet{gtr_Male_Background}{blue!50!yellow!5}
\colorlet{gtr_Female_Frame}{red!50!black}
\colorlet{gtr_Female_Background}{red!50!yellow!5}
\colorlet{gtr_Neuter_Frame}{black!75}
\colorlet{gtr_Neuter_Background}{yellow!5}
