0

I'd like to use the genealogytree package to display the relationships of several people, but having looked at its documentation I'm unsure how to go about this. Here is an example of the relationships I'd like to show in pure TikZ:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{genealogytree}
\begin{document}
    \begin{tikzpicture}
        \node (X) at (0,2) {X};
        \node (RelXY) at (1,2) {\gtrsymPartnership};
        \node (Y) at (2,2) {Y};
        \node (MarrYZ) at (3,2) {\gtrsymMarried};
        \node (Z) at (4,2) {Z};
        \node (A) at (0,0) {A};
        \node (B) at (2,0) {B};
        \node (C) at (4,0) {C};
        \node (MarrCD) at (5,0) {\gtrsymMarried};
        \node (D) at (6,0) {D};
        \node (E) at (8,0) {E};
        \node (MarrEF) at (9,0) {$\smash{\stackrel{1}{\gtrsymMarried}}\vphantom{\gtrsymMarried}$};
        \node (F) at (10,0) {F};
        \node (MarrFG) at (11,0) {$\smash{\stackrel{2}{\gtrsymMarried}}\vphantom{\gtrsymMarried}$};
        \node (G) at (12,0) {G};
        \node (H) at (2,-2) {H};
        \node (I) at (4,-2) {I};
        \node (J) at (6,-2) {J};
        \node (MarrJK) at (7,-2) {\gtrsymMarried};
        \node (K) at (8,-2) {K};
        \node (L) at (10,-2) {L};
        \node (M) at (12,-2) {M};
        \draw (MarrFG.south) -- ($(0,-1)!(MarrFG.south)!(10,-1)$) -- ($(0,-1)!(M.north)!(10,-1)$) -- (M.north);
        \draw (MarrEF.south) -- ($(0,-1)!(MarrEF.south)!(10,-1)$) -- ($(0,-1)!(L.north)!(10,-1)$) -- (L.north);
        \draw (MarrEF.south) -- ($(0,-1)!(MarrEF.south)!(10,-1)$) -- ($(0,-1)!(K.north)!(10,-1)$) -- (K.north);
        \draw (E.north) -- ($(0,1)!(E.north)!(10,1)$) -- ($(0,1)!(D.north)!(10,1)$) -- (D.north);
        \draw (C.north) -- ($(0,1)!(C.north)!(10,1)$) -- ($(0,1)!(B.north)!(10,1)$) -- (B.north);
        \draw (MarrYZ.south) -- ($(0,1)!(MarrYZ.south)!(10,1)$);
        \draw (RelXY.south) -- ($(0,1)!(RelXY.south)!(10,1)$) -- ($(0,1)!(A.north)!(10,1)$) -- (A.north);
        \draw (H.north) -- ($(0,-1)!(H.north)!(10,-1)$) -- ($(0,-1)!(MarrCD.south)!(10,-1)$) -- (MarrCD.south);
        \draw (I.north) -- ($(0,-1)!(I.north)!(10,-1)$);    
    \end{tikzpicture}
\end{document}

Thisproduces

enter image description here

which is OK as a demonstration but not really great-looking, not to mention unnecessarily difficult to change and update, so I'd like to use a package like genealogytree instead.

The trouble I'm having relates to the fact that genealogytree seems to be designed, primarily, for displaying the ancestors, descendants or both of a single person. The relationships shown above do not fit that bill.

So, my questions are:

  1. Is there a way to do this using genealogytree (which I would like to use both because its syntax is more intuitive than pure TikZ, and because it has nice-looking templates)?
  2. Are there alternatives that would be more suitable?

I'm not too hung up on the exact layout of the relationship diagram, BTW.

6
  • Without knowing genealogytree or any other similar packages or libraries, I'd put the people in a well-defined \matrix[matrix of nodes] with a few styles that define the connections. Even tikzcd might be a good tool to draw this somewhat simple diagram. And at some point, you need to think about people who had three partners or partners in another row. Commented Sep 6, 2022 at 10:30
  • Thanks for the tip. tikz-cd would at least do away with manual node placement, but I'd really like something that looks more visually appealing, like genealogytree's template=database traditional or so. Further relationships in my particular diagram aren't a concern right now, but of course the ease with which future updates can be done is another reason to look for a suitable genealogy-related package.
    – chsk
    Commented Sep 6, 2022 at 11:16
  • Now that I have taken a look at genealogytree it looks like it is suited for trees that aren't centered around one person. Just the cover alone is an example for that and the Introduction talks about that a bit more. Commented Sep 6, 2022 at 13:15
  • Don't understand why you avoid skimming through the manual at ctan.org/pkg/genealogytree ? Yes, it's big, and it starts with a tutorial. When you switch on the thumbnails you have a quick overview about the various visual changes you can introduce. E.g. ch. 9 is about genealogy symbols, for further fine tuning. And, as it's tikz-based, you still can do your tikz-tricks, wherever needed.
    – MS-SPO
    Commented Sep 6, 2022 at 14:15
  • @MS-SPO I did skim the manual (where did I say I didn't?). Specifically, section 4 led me to believe that child and parent subgraphs can only contain more of the same, while sandclock subgraphs can only contain child and parent subgraphs (unions nonwithstanding in either case). Perhaps I didn't skim enough and misunderstood.
    – chsk
    Commented Sep 6, 2022 at 16:03

1 Answer 1

1

You can represent a complex tree by adjusting the relative positions of several trees and linking the families.

The code below still needs some adjustments of the edges (around nodes Y and F) but it does represent the tree accurately.

\documentclass{standalone}
\usepackage{genealogytree}
\begin{document}
    \begin{tikzpicture}
        \genealogytree[
            label options={fill=white,node font=\footnotesize}
        ]{
            child[family label={\gtrsymMarried}]{
                union[family label={\gtrsymPartnership}]{
                    p{X}
                    c{A}
                }
                g{Y}
                p{Z}
                c{B}
                c[id=C_node]{C}
            }
        }
    
        \genealogytree[
            adjust node= D_node right of C_node distance 0.4cm,
            add parent= C_node to fam_D_node,
            label options={fill=white,node font=\footnotesize}
        ]{
            child{
                g[disconnect, phantom]{parent}
                child[id=fam_D_node, family label={\gtrsymMarried}]{
                    g[id=D_node]{D}
                    c{H}
                    c{I}
                }
                child[edges up by= 1 of 6, family label={\gtrsymMarried~1}]{
                    g[id=E_node]{E}
                    p[id=F_node_1]{F}
                    child[family label={\gtrsymMarried}]{
                        p{J}
                        g{K}
                    }
                    c{L}
                }
            }
        }
        
        \genealogytree[
            set position= F_node_2 at F_node_1,
            label options={fill=white,node font=\footnotesize}
        ]{
            child[id=fam_F_node, edges down by= 1 of 6, family label={\gtrsymMarried~2}]{
                g[id=F_node_2]{F}
                p{G}
                c[disconnect, phantom]{shift child}
                c{M}
            }
        }
    \end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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