2

Suppose A had child X with B and child Y with C. I know that union works to get this done:

\begin{tikzpicture}
\genealogytree[template=formal graph,
]
{child{
        g[id=a, tikz={xshift=9mm,yshift=0mm}]{A}
        union{
            p[id=b, tikz={xshift=-9mm,yshift=0mm}]{B}
            c[id=x]{X}
        }
        union{
            p[id=c]{C}
            c[id=y]{Y}
        }
    }
}
\end{tikzpicture}

(the shifts are to prevent intersections)

But what if B also had child Z with some D? what I'm doing right now is add parent:

\documentclass[a4paper,landscape]{article}
\usepackage[top=4.5cm, bottom=4.5cm, left=1cm, right=1cm]{geometry}
\usepackage[all]{genealogytree}
\begin{document}
\begin{tikzpicture}
\genealogytree[template=formal graph,
add parent = b to fam_B
]
{child[id=fam_A]{
        g[id=a, tikz={xshift=9mm,yshift=0mm}]{A}
        union{
            p[id=b, tikz={xshift=-9mm,yshift=0mm}]{B}
            c[id=x]{X}
        }
        union{
            p[id=c]{C}
            c[id=y]{Y}
        }
    }
child[id=fam_B, edges up = 1 of 4]{
    g[id=d, tikz={xshift=-15mm,yshift=0mm}] {D}
    c[id=z, tikz={xshift=-9mm,yshift=0mm}] {Z}}
}

\end{tikzpicture}
\end{document}

This produces

enter image description here

which is great except the edges only come out of B at one spot (compare with the two edges coming out of A). I can't seem to find a way to adjust the edge start points, just the central nodes.

Is there a way to do this nicely? I'm hoping for something generalizable to more than two marriages on each side (with copious amounts of shifts).

1

One way is to color each node and highlight wife2 and the progeny with green -- and color wife3 and progeny in blue -- tracing is easier -- off course the edges can also be segregated based on color

enter image description here

\documentclass[a4paper,landscape]{article}
\usepackage[top=4.5cm, bottom=4.5cm, left=1cm, right=1cm]{geometry}
\usepackage[all]{genealogytree}
\begin{document}
    \begin{tikzpicture}
        \genealogytree[template=formal graph,
        % add parent = b to fam_B
        options for node={wife2, childw2}{box={colback=green!20!white}},
        options for node={wife3, childw3}{box={colback=blue!20!white}},
        ]{
        
        child{
                g[male]{Husband}
                p[female]{Wife1}
                    c[female]{childw1}
                    % c[male]{a_4}
                    % c[female]{a_5}
                    union[id=fam_2]{
                                    p[id=wife2,female]{Wife2}
                                        c[id=childw2,female]{childw2}
                                        % c[id=nd3,male]{d_3}
                                        % c[id=nd4,male]{d_4}
                                    }

                    union[id=fam_3]{
                                    p[id=wife3,female]{Wife3}
                                        c[id=childw3,female]{childw3}
                                        % c[id=nd3,male]{d_3}
                                        % c[id=nd4,male]{d_4}
                                    }
                }
}
\end{tikzpicture}
\end{document}

With custom edges

\documentclass[a4paper,landscape]{article}
\usepackage[top=4.5cm, bottom=4.5cm, left=1cm, right=1cm]{geometry}
\usepackage[all]{genealogytree}
\begin{document}
    \begin{tikzpicture}
        \genealogytree[template=formal graph,
        % add parent = b to fam_B
        options for node={wife2, childw2}{box={colback=green!20!white}},
        options for node={wife3, childw3}{box={colback=blue!20!white}},
        ]{
        
        child{
                g[male]{Husband}
                p[female]{Wife1}
                    c[female]{childw1}
                    union[id=fam_2, family={edges={foreground={green!30}}}]{
                                    p[id=wife2,female, ]{Wife2}
                                        c[id=childw2,female]{childw2}
                                    }

                    union[id=fam_3, family={edges={foreground={blue!30,}}}]{
                                    p[id=wife3,female,]{Wife3}
                                        c[id=childw3,female]{childw3}
                                    }
                }
}
\end{tikzpicture}
\end{document}

enter image description here

1
  • Thank you. This does help distinguish children from different marriages, but I am hoping to adjust the edges so that previous marriages of both the husband and the wife will have separate edges.
    – user249884
    Aug 28 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.