árbol genealógico: el matrimonio pone una línea horizontal en la foto

árbol genealógico: el matrimonio pone una línea horizontal en la foto

Cuando intento agregar la fecha de matrimonio a uno de los ejemplos básicos de la guía del usuario, aparece una línea horizontal que se superpone a la foto:problema

Aquí mi código:

\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}

¿Alguien sabe cómo prevenir esto?

Respuesta1

Hay varias soluciones posibles para esto. La más sencilla es cambiar a un formato de base de datos que no dibuje una línea, como medium. En este caso el matrimonio se imprime entre el nacimiento y la muerte.

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}

Resultado:

ingrese la descripción de la imagen aquí

Una segunda posibilidad es cambiar la definición de medium marriage belowpara eliminar la línea. Las definiciones se enumeran en el archivo gtrcore.node.code.texy se pueden redefinir agregando código modificado a su propio documento después de cargarlo 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}

Resultado:

ingrese la descripción de la imagen aquí

Para ampliar un poco esta solución, puede probar si hay una imagen y solo imprimir la línea para los nodos sin imagen y, en caso contrario, por ejemplo, un poco de espacio vertical.

MWE, sólo se muestra la parte relevante de la redefinición:

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

Resultado:

ingrese la descripción de la imagen aquí

O agregue \tcblineen ambos casos, ambos hacen la línea 24 mm más corta en caso de que haya una imagen:

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

Resultado:

ingrese la descripción de la imagen aquí

información relacionada