2

With genealogytree package, birth is displayed first, then baptism, then defunction date and finally the comment. For example:

Example

I would like to write the comment inmediately before the defunction. Is this possible? Many thanks!

Edit: I've taken the image from the genealogytree package. The code to generate the image would be something like this:

g{male,name={Charles \surn{Smith}},birth={1722}{London},baptism={1722}{London},comment={Copper smith, soldier. Invented the square wheel},death={1764}{}}

I would like the comment to come before the death in the displayed image.

3
  • 2
    Welcome to TeX StackExchange! What code are you using to make the comment? Including your code can help others to more quickly find a way to change the comment to your liking
    – gz839918
    Jan 6 at 15:10
  • @gz839918, done! Thanks for your help.
    – moqui
    Jan 6 at 15:35
  • @moqui, kindly use this checklist to add the missing parts to your code: tex.meta.stackexchange.com/questions/228/… . Thank you
    – MS-SPO
    Jan 6 at 15:44

1 Answer 1

6

I'm not an expert on genealogytree, but based on the official documentation, you can use \gtrDeclareDatabaseFormat to create new database formats. Here's one for you called myAwesomeFormat:

An example of a genealogy tree for two siblings, Charles Smith and Jane Smith. Charles is on the left of the tree and his name appears in a box with a blue border. Under his name are a comment "copper smith, soldier. Invented the square wheel," followed by his year and location of birth, baptism, and death. Jane Smith on the right with an identically formatted box but with a red border. Under Jane's name is the comment "possibly a time traveler," followed by her year and location of birth, baptism, and death. Jane was born in 1724 in Southampton and died in 2023 in Manchester.

\documentclass{standalone}

\usepackage{genealogytree}

\gtrDeclareDatabaseFormat{myAwesomeFormat}{%
  }{
  \gtrPrintName
  \begin{gtrinfolist}
    \gtrifcommentdefined{\gtrlistseparator\gtrPrintComment}{}%
  \end{gtrinfolist}
  \begin{gtreventlist}
    \gtrifdatedefined{birth}{\gtrlistseparator\gtrPrintEvent{birth}}{}
    \gtrifdatedefined{baptism}{\gtrlistseparator\gtrPrintEvent{baptism}}{}
    \gtrifdatedefined{death}{\gtrlistseparator\gtrPrintEvent{death}}{
      \gtrifdatedefined{burial}{\gtrlistseparator\gtrPrintEvent{burial}}{}
    }
  \end{gtreventlist}
  \begin{gtrinfolist}
    \gtrifprofessiondefined{\gtrlistseparator\gtrPrintProfession}{}
  \end{gtrinfolist}
  \gtrifdatedefined{marriage}{\tcbline\begin{gtreventlist}
  \gtrlistseparator\gtrPrintEvent{marriage}\end{gtreventlist}}{}
}

\begin{document}

\begin{genealogypicture}[
  processing = database,
  database format = myAwesomeFormat,
  node size = 4cm,
  level size = 3.2cm,
  list separators hang,
  place text={\newline}{},
  box={
    fit basedim = 9pt,
    boxsep = 2pt,
    segmentation style = solid,
    halign = left,
    before upper = \parskip1pt,
    \gtrDBsex
  }
]
sandclock{
  child{
    g{
      male,
      name={Charles \surn{Smith}},
      birth={1722}{London},
      baptism={1722}{London},
      comment={Copper smith, soldier. Invented the square wheel},
      death={1764}{}{London}
    }
  }
  child{
    g{
      female,
      name={Jane \surn{Smith}},
      birth={1724}{Southampton},
      baptism={1724}{Southampton},
      comment={Possibly a time traveler},
      death={2023}{}{Manchester}
    }
  }
}
\end{genealogypicture}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .