# Marriage of second cousins in genealogy tree

I want to model the marriage of second cousins in the genealogytree package. The following MWE illustrates the case. The code for the left tree is analogous.

\documentclass{article}
\usepackage[all]{genealogytree}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{yfonts}
\usepackage{suetterl}
\usepackage{txfonts}
\usepackage{pgfornament}
\usepackage{tikz}
\usepackage{calligra}
\usepackage{pagecolor}
\usepackage[pages=some]{background}

\begin{document}
\begin{tikzpicture}
\genealogytree[id suffix=@a, timeflow = down,
child distance in parent graph=1mm,
child distance in child graph=1mm
]{

child{

g[male]{A'}
p[female]{B'}
child{
g[male]{C'}
p[female]{D'}
child{
g[male]{E'}
}
}
}
}
\end{tikzpicture}

\end{document}


I want to join the two families at both ends, indicated with the bright lines. Joining two genealogy trees at one end, i.e. including ancestors of husband/wife is easily done with the set id option. For example, the trees going up from the intersection of E and E' to the separate trees of E and E' are easily modeled with the set id option. But how do I join the trees again at the top, i.e. such that A and A' share the same parents but are part of different genealogytree{ ...} commands?

EDIT:

After the answer of Schroedinger's cat, I want to rephrase the question. I do not want drawn lines but instead I want to add a tree within the options of genealogytree to incorporate the relationship described above. Let me spill it out as detailed as possible what is given and what I intend. I see three separate genealogy trees here:

1) I have a set of parents, 0M and 0F, which are not shown in the figure and have ancestors as well. 0M and 0F have a child A which has a grandchild E. I want to model this as tree 1.

2) E has children, grandchildren etc. on its own. This I call tree 2. The ancestors of E, i.e. 0M and 0F and their ancestors, are added to tree 2 by 'set position id' options in genealogy tree.

The difficulty now arises with the third three.

3) The other son of 0M and 0F, A', also has a grandchild E'. The tree of A' shall be called tree 3. His grandchild now marries E of tree 1 which is his second cousin. The problem I want to solve is how I position tree 3 both at 0M and 0F of tree 1 in the upper part and tree 2 in the lower part. How do I do that?

This is basically a repetition of @cfr's answer of your previous question. Give the nodes ids, and use them. What is new here is the use of scopes and the calc library.

\documentclass{article}
\usepackage[all]{genealogytree}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}
\begin{scope}[xshift=-7cm]
\genealogytree[id suffix=@a', timeflow = down,
child distance in parent graph=1mm,
child distance in child graph=1mm
]{

child{

g[male,id=A]{A'}
p[female]{B'}
child{
g[male]{C'}
p[female]{D'}
child{
g[male,id=E]{E'}
}
}
}
}
\end{scope}
%
\genealogytree[id suffix=@a, timeflow = down,
child distance in parent graph=1mm,
child distance in child graph=1mm
]{

child{

g[male,id=A]{A}
p[female]{B}
child{
g[male]{C}
p[female]{D}
child{
g[male,id=E]{E}
}
}
}
}
%
\begin{scope}[thick]
\draw (A@a'.north) -- ($(A@a'.north)!0.8!(A@a.north west)+(0,1.5)$) --
([xshift=1mm]A@a.north west);
\draw (E@a') -- ($(E@a'.south)!0.6!(E@a.south)+(0,-1.5)$) -- (E@a);
\end{scope}
\end{tikzpicture}

\end{document}


Please note that as of now the figure is a bit too wide for the basic article class, but I am assuming that you will, like most of us, make the pages a bit wider with the geometry package.

• Thank you. By now I suppose I posed the question in a misleading way as I do not want drawn lines. I will update the question to better reflect the purpose I intend. – Taufi Dec 14 '19 at 8:48
• I edited the question. Is it clear now what I mean? – Taufi Dec 16 '19 at 22:58