T-F-S / genealogytree

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

Entering secondary families in database mode processing #48

Open scottb5612 opened 1 month ago

scottb5612 commented 1 month ago

I've been using a "secondary family" definition in my non-database trees, but not sure how to get it to work in database mode

The technique comes from here

https://tex.stackexchange.com/questions/110170/family-tree-with-multiple-marriage-ties

An example showing the graph input with non-db processing is as follows,

 child[]{
      g[]{  female, name = {A}, marriage = {1976-07-04}{} }
      p[]{ male, name = {B}, marriage = {1986-07-04}{} }
      union[secondary family]{
        p[secondary husband]{ male,  name = {C}    }
      }
  }

Here is the corresponding def'n with DB processing;

  child[]{
      g[]{   female,  name = {A}, marriage = {1976-07-04}{} }
      p[]{  male, name = {B}, marriage = {1986-07-04}{}  }
      union[secondary family]{
        p[secondary husband]{male,  name = {C} }
      }

I get the error

I do not know the key '/gtr/secondary husband' and I am going to ignore it. Perhaps you misspelled it.

I'm not really sure if this usage is compatible with how DB processing parses the tokens, which is whyI ask Scott

PS The following definitions are required inside
\genealogytree[ ... ]

Definitions secondary wife/.style={box={colback=red!30!yellow!30,colframe=red!50,arc=2mm}},

secondary husband/.style={box={colback=red!30!yellow!30,colframe=blue!50,arc=2mm}},

secondary family/.style={family edges={foreground={black,line width=0.25mm,dashed}}}

T-F-S commented 1 month ago

Without working example code, it is difficult to say what went wrong.

However, there is no reason why the "secondary family" styles should not work with database processing. I inserted the code in an example from the documentation:

\documentclass{article}
\usepackage{lmodern,incgraph}
\usepackage[all]{genealogytree}
\begin{document}

\begin{inctext}[border=5mm]
\begin{genealogypicture}[
  processing=database,
  database format=medium marriage below,
  node size=2.4cm,
  level size=3.5cm,
  level distance=6mm,
  list separators hang,
  name font=\bfseries,
  surn code={\textcolor{red!50!black}{#1}},
  place text={\newline}{},
  date format=d/mon/yyyy,
  tcbset={male/.style={colframe=blue,colback=blue!5},
  female/.style={colframe=red,colback=red!5}},
  box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
    halign=flush left,before upper=\parskip1pt,
    \gtrDBsex,drop fuzzy shadow,
  },
  secondary wife/.style={box={colback=red!30!yellow!30,colframe=red!50,arc=2mm}},
  secondary husband/.style={box={colback=red!30!yellow!30,colframe=blue!50,arc=2mm}},
  secondary family/.style={family edges={foreground={black,line width=0.25mm,dashed}}}
]
  child[id=GauaOsth1805]{
    p[id=OsthJoha1780]{
      female,
      name={\pref{Johanna} Elisabeth Rosina \surn{Osthoff}},
      birth={1780-05-08}{Braunschweig (Niedersachsen)},
      marriage={1805-10-09}{Braunschweig (Niedersachsen)},
      death={1809-10-11}{G\"ottingen (Niedersachsen)},
      comment={Wei\ss{}gerberstochter},
    }
    g[id=GauxCarl1777]{
      male,
      name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
      birth={1777-04-30}{Braunschweig (Niedersachsen)},
      death={1855-02-23}{G\"ottingen (Niedersachsen)},
      profession={Mathematiker, Astronom, Geod\"at und Physiker},
      image={Carl_Friedrich_Gauss.jpg},
    }
    c[id=GauxCarl1806]{
      male,
      name={\pref{Carl} Joseph \surn{Gau\ss{}}},
      birth={1806-08-21}{Braunschweig (Niedersachsen)},
      death={1873-07-04}{Hannover (Niedersachsen)},
    }
    c[id=GauxWilh1808]{
      female,
      name={\pref{Wilhelmina} \surn{Gau\ss{}}},
      birth={1808-02-29}{G\"ottingen (Niedersachsen)},
      death={1840-08-12}{T\"ubingen (Baden-W\"urttemberg)},
    }
    c[id=GauxLudw1809]{
      male,
      name={\pref{Ludwig} \surn{Gau\ss{}}},
      birth={1809-09-10}{G\"ottingen (Niedersachsen)},
      death={1810-03-01}{G\"ottingen (Niedersachsen)},
    }
    union[id=GauaWald1810,secondary family]{
      p[id=WaldFrie1788,secondary wife]{
        female,
        name={\pref{Friederica} Wilhelmine \surn{Waldeck}},
        birth={1788-04-15}{G\"ottingen (Niedersachsen)},
        marriage={1810-08-14}{G\"ottingen (Niedersachsen)},
        death={1831-09-12}{G\"ottingen (Niedersachsen)},
        comment={Rechtswissenschaftlerstochter},
      }
      c[id=GauxEuge1811]{
        male,
        name={\pref{Eugen} Peter Samuel Marius \surn{Gau\ss{}}},
        birth={1811-07-29}{G\"ottingen (Niedersachsen)},
        death={1896-07-04}{Columbia (Missouri)},
        profession={Rechtswissenschaftler, Kaufmann},
      }
      c[id=GauxWilh1813]{
        male,
        name={\pref{Wilhelm} August Carl Matthias \surn{Gau\ss{}}},
        birth={1813-10-23}{G\"ottingen (Niedersachsen)},
        death={1879-08-23}{St. Louis (Missouri)},
      }
      c[id=GauxTher1816]{
        female,
        name={Henriette Wilhelmine Karoline \pref{Therese} \surn{Gau\ss{}}},
        birth={1816-06-09}{G\"ottingen (Niedersachsen)},
        death={1864-02-11}{Dresden (Sachsen)},
      }
    }
  }
\end{genealogypicture}
\end{inctext}

\end{document}

Here, Wilhelmine Waldeck was marked secondary wife and the union as secondary family.

grafik

scottb5612 commented 1 month ago

Hi, that helped me work this out. Many thanks

On Mon, Jun 3, 2024 at 11:54 AM Thomas F. Sturm @.***> wrote:

Without working example code it is difficult to say what went wrong.

However, there is no reason why the "secondary family" styles should not work with database processing. I inserted the code in an example from the documentation:

\documentclass{article}\usepackage{lmodern,incgraph}\usepackage[all]{genealogytree}\begin{document} \begin{inctext}[border=5mm]\begin{genealogypicture}[ processing=database, database format=medium marriage below, node size=2.4cm, level size=3.5cm, level distance=6mm, list separators hang, name font=\bfseries, surn code={\textcolor{red!50!black}{#1}}, place text={\newline}{}, date format=d/mon/yyyy, tcbset={male/.style={colframe=blue,colback=blue!5}, female/.style={colframe=red,colback=red!5}}, box={fit basedim=7pt,boxsep=2pt,segmentation style=solid, halign=flush left,before upper=\parskip1pt, \gtrDBsex,drop fuzzy shadow, }, secondary wife/.style={box={colback=red!30!yellow!30,colframe=red!50,arc=2mm}}, secondary husband/.style={box={colback=red!30!yellow!30,colframe=blue!50,arc=2mm}}, secondary family/.style={family edges={foreground={black,line width=0.25mm,dashed}}} ] child[id=GauaOsth1805]{ p[id=OsthJoha1780]{ female, name={\pref{Johanna} Elisabeth Rosina \surn{Osthoff}}, birth={1780-05-08}{Braunschweig (Niedersachsen)}, marriage={1805-10-09}{Braunschweig (Niedersachsen)}, death={1809-10-11}{G\"ottingen (Niedersachsen)}, comment={Wei\ss{}gerberstochter}, } g[id=GauxCarl1777]{ male, name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}}, birth={1777-04-30}{Braunschweig (Niedersachsen)}, death={1855-02-23}{G\"ottingen (Niedersachsen)}, profession={Mathematiker, Astronom, Geod\"at und Physiker}, image={Carl_Friedrich_Gauss.jpg}, } c[id=GauxCarl1806]{ male, name={\pref{Carl} Joseph \surn{Gau\ss{}}}, birth={1806-08-21}{Braunschweig (Niedersachsen)}, death={1873-07-04}{Hannover (Niedersachsen)}, } c[id=GauxWilh1808]{ female, name={\pref{Wilhelmina} \surn{Gau\ss{}}}, birth={1808-02-29}{G\"ottingen (Niedersachsen)}, death={1840-08-12}{T\"ubingen (Baden-W\"urttemberg)}, } c[id=GauxLudw1809]{ male, name={\pref{Ludwig} \surn{Gau\ss{}}}, birth={1809-09-10}{G\"ottingen (Niedersachsen)}, death={1810-03-01}{G\"ottingen (Niedersachsen)}, } union[id=GauaWald1810,secondary family]{ p[id=WaldFrie1788,secondary wife]{ female, name={\pref{Friederica} Wilhelmine \surn{Waldeck}}, birth={1788-04-15}{G\"ottingen (Niedersachsen)}, marriage={1810-08-14}{G\"ottingen (Niedersachsen)}, death={1831-09-12}{G\"ottingen (Niedersachsen)}, comment={Rechtswissenschaftlerstochter}, } c[id=GauxEuge1811]{ male, name={\pref{Eugen} Peter Samuel Marius \surn{Gau\ss{}}}, birth={1811-07-29}{G\"ottingen (Niedersachsen)}, death={1896-07-04}{Columbia (Missouri)}, profession={Rechtswissenschaftler, Kaufmann}, } c[id=GauxWilh1813]{ male, name={\pref{Wilhelm} August Carl Matthias \surn{Gau\ss{}}}, birth={1813-10-23}{G\"ottingen (Niedersachsen)}, death={1879-08-23}{St. Louis (Missouri)}, } c[id=GauxTher1816]{ female, name={Henriette Wilhelmine Karoline \pref{Therese} \surn{Gau\ss{}}}, birth={1816-06-09}{G\"ottingen (Niedersachsen)}, death={1864-02-11}{Dresden (Sachsen)}, } } }\end{genealogypicture}\end{inctext} \end{document}

Here, Wilhelmine Waldeck was marked secondary wife and the union as secondary family.

grafik.png (view on web) https://github.com/T-F-S/genealogytree/assets/7982989/0b3b551a-c358-41cb-be50-e81fa1c69cbf

— Reply to this email directly, view it on GitHub https://github.com/T-F-S/genealogytree/issues/48#issuecomment-2144773931, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACP6BHOSXSN5TLHGPMXAYB3ZFQ4OBAVCNFSM6AAAAABIVC5RIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUG43TGOJTGE . You are receiving this because you authored the thread.Message ID: @.***>