3

When I try to add the marriage date to one of the basic examples in the user guide, I get a horizontal line that overlaps the photo:problem

Here my code:

\documentclass{article}

\usepackage{genealogytree}
\usepackage{tcolorbox}

\begin{document}

\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=left,before upper=\parskip1pt,
        \gtrDBsex,drop fuzzy shadow,
        if image defined={add to width=25mm,right=25mm,
            underlay={\begin{tcbclipinterior}\path[fill overzoom DBimage]
                ([xshift=-24mm]interior.south east) rectangle (interior.north east);
            \end{tcbclipinterior}},
        }{},
    },
]
sandclock
{
child{
    g[id=GauxCarl1777]{
        male,
        name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
        birth={1777-04-30}{Braunschweig (Niedersachsen)},
        marriage={1800-01-01}{},  %<== my modification to the guide's example
        death={1855-02-23}{G\"ottingen (Niedersachsen)},
        profession={Mathematiker, Astronom, Geod\"at und Physiker},
        image={Carl_Friedrich_Gauss.jpg},
    }
    p[id=GauxCarl1777]{
        female,
        name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
        birth={1777-04-30}{Braunschweig (Niedersachsen)},
        marriage={1800-01-01}{},  %<== my modification to the guide's example
        death={1855-02-23}{G\"ottingen (Niedersachsen)},
        profession={Mathematiker, Astronom, Geod\"at und Physiker},
        image={Carl_Friedrich_Gauss.jpg},
    }

}
}
\end{genealogypicture}




\end{document}

Does someone know how to prevent this?

1 Answer 1

3

There are various possible solutions for this. The simplest is to change to a database format that does not draw a line, such as medium. In this case the marriage is printed in between the birth and the death.

MWE:

\documentclass{article}

\usepackage{genealogytree}
\usepackage{tcolorbox}
\begin{document}

\begin{genealogypicture}[
    processing=database,
    database format=medium,
    box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
        halign=left,before upper=\parskip1pt,
        \gtrDBsex,drop fuzzy shadow,
        if image defined={add to width=25mm,right=25mm,
            underlay={\begin{tcbclipinterior}\path[fill overzoom image=\gtrDBimage]
            ([xshift=-24mm]interior.south east) rectangle (interior.north east);
            \end{tcbclipinterior}},
        }{},
    },
]
sandclock{
    child{
        g[id=GauxCarl1777]{
            male,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
            birth={1777-04-30}{Braunschweig (Niedersachsen)},
            marriage={1800-01-01}{},
            death={1855-02-23}{G\"ottingen (Niedersachsen)},
            profession={Mathematiker, Astronom, Geod\"at und Physiker},
            image={Carl_Friedrich_Gauss.jpg},
        }
    }
    child{
        g[id=GauxCarl1777]{
            female,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
            birth={1777-04-30}{Braunschweig (Niedersachsen)},
            marriage={1800-01-01}{},
            death={1855-02-23}{G\"ottingen (Niedersachsen)},
            profession={Mathematiker, Astronom, Geod\"at und Physiker},
        }
    }
}
\end{genealogypicture}
\end{document}

Result:

enter image description here

A second possibility is to change the definition of medium marriage below to remove the line. The definitions are listed in the file gtrcore.node.code.tex, and they can be redefined by adding modified code to your own document after loading genealogytree.

MWE:

\documentclass{article}
\usepackage{genealogytree}
\usepackage{tcolorbox}
\makeatletter
\gtrDeclareDatabaseFormat{medium marriage below}{}{%
  \gtrPrintName%
  \begin{gtreventlist}%
    \gtr@list@event@birth%
    \gtr@list@event@floruit%
    \gtr@list@event@death%
  \end{gtreventlist}%
  \gtr@print@infolist%
  \gtr@ifmarriagedefined{%
  \begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
  % was: \gtr@ifmarriagedefined{\tcbline\begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
}
\makeatother

\begin{document}

\begin{genealogypicture}[
    processing=database,
    database format=medium marriage below,
    box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
        halign=left,before upper=\parskip1pt,
        \gtrDBsex,drop fuzzy shadow,
        if image defined={add to width=25mm,right=25mm,
            underlay={\begin{tcbclipinterior}\path[fill overzoom image=\gtrDBimage]
            ([xshift=-24mm]interior.south east) rectangle (interior.north east);
            \end{tcbclipinterior}},
        }{},
    },
]
sandclock{
    child{
        g[id=GauxCarl1777]{
            male,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
            birth={1777-04-30}{Braunschweig (Niedersachsen)},
            marriage={1800-01-01}{},
            death={1855-02-23}{G\"ottingen (Niedersachsen)},
            profession={Mathematiker, Astronom, Geod\"at und Physiker},
            image={Carl_Friedrich_Gauss.jpg},
        }
    }
    child{
        g[id=GauxCarl1777]{
            female,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
            birth={1777-04-30}{Braunschweig (Niedersachsen)},
            marriage={1800-01-01}{},
            death={1855-02-23}{G\"ottingen (Niedersachsen)},
            profession={Mathematiker, Astronom, Geod\"at und Physiker},
        }
    }
}
\end{genealogypicture}
\end{document}

Result:

enter image description here

To extend this solution a bit you can test if there is an image and only print the line for nodes without an image, and for example a bit of vertical space otherwise.

MWE, only the relevant part of the redefinition shown:

\gtr@ifmarriagedefined{%
  \ifdefvoid{\gtrDBimage}{\tcbline}{\vspace{2mm}}%
  \begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%

Result:

enter image description here

Or add the \tcbline in both cases, both make the line 24mm shorter in case there is an image:

\gtr@ifmarriagedefined{%
  \ifdefvoid{\gtrDBimage}{\tcbline}{%
  \tcbline@ {\kvtcb@leftupper +\@totalleftmargin +24mm}}%
  \begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%

Result:

enter image description here

You must log in to answer this question.

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