5

I started a Family tree using the genealogytree package. The tree starts from the bottom (from me) and goes up. However, my (maternal) grand-grand-father and my (maternal) grand-grand-mother share the same (paternal) grand-grand-father, who is my 5th grand-father, which means there is a cycle.

When I try to draw the Family tree it looks like this:

Family Tree

The person in the top is the same, but appears twice. is there any way how I can merge both entries into one entry so the person appears only once?

This is the code I used to generate the family tree:

\documentclass[]{standalone}
\usepackage[all]{genealogytree}
\begin{document}
\begin{genealogypicture}
[template=database portrait]
parent[]{
g[id=Said1990]{
    male,
    name = {\pref{Sa\"{i}d} \surn{Maanan}},
    birth= {1990}{},
}
c[id=Ahmed1992]{
    male,
    name = {\pref{Ahmed} \surn{Maanan}},
    birth= {1992}{},
}
parent{
    g[id=Fatima1962]{
        female,
        name = {\pref{Fatima} \surn{Dasser}},
        birth= {1962}{},
    }

    parent{
        g[id=Kelt1938]{
            female,
            name = {\pref{Keltoum} \surn{Akheshkhush}},
            birth= {1938}{},
        }
        parent{
            g[id=Zah]{
                female,
                name = {\pref{Zahra} \surn{A\"{i}t Lmoudden}},
                birth= {}{},
            }
            parent{
                g[id=Fad]{
                    female,
                    name = {\pref{Fadma} \surn{A\"{i}t Oulidi}},
                    birth= {}{},
                }
                parent{
                    g[id=Bihi]{
                        male,
                        name = {\pref{Bihi} \surn{A\"{i}t Oulidi}},
                        birth= {}{},
                    }
                }
            }
            parent{
                g[id=SiH]{
                    male,
                    name = {\pref{Si Hmed} \surn{A\"{i}t Lmoudden}},
                    birth= {}{},
                }
                parent{
                    g[id=Mhen]{
                        male,
                        name = {\pref{Mhend} \surn{A\"{i}t Lmoudden}},
                        birth={}{},
                    }
                    parent{
                        g[id=abdellah]{
                            male,
                            name = {\pref{Abdellah} \surn{A\"{i}t Lmoudden}},
                            birth= {}{},
                        }
                    }
                }
            }
        }
        parent{
            g[id=Brah]{
                male,
                name = {\pref{Brahim} \surn{Akheshkhush}},
                birth= {}{},
            }
            parent{
                g[id=Mhe]{
                    male,
                    name = {\pref{Mhend} \surn{A\"{i}t Lmoudden}},
                    birth= {}{},
                }
                parent{
                    g[id=ali]{
                        male,
                        name = {\pref{Ali} \surn{A\"{i}t Lmoudden}},
                        birth= {}{},
                    }
                    parent{
                        g[id=abdellah]{
                            male,
                            name = {\pref{Abdellah} \surn{A\"{i}t Lmoudden}},
                            birth= {}{},
                        }
                    }
                }
            }
            parent{
                g[id=ija]{
                    female,
                    name = {\pref{Ijja} \surn{N'A\"{i}t Tamr}},
                    birth= {}{},
                }
            }
        }
    }
    parent{
        g[id=Hmed1914]{
            male,
            name = {\pref{Ahmed} \surn{Dasser}},
            birth= {1914}{},
        }
    }
}
parent{
    g[id=Mohamed1947]{
        male,
        name = {\pref{Mohammed} \surn{Maanan}},
        birth={1947}{},
    }
 }
 }
 \end{genealogypicture}
 \end{document}
3
  • 2
    Ah, that's what you mean by cycle. It sounded biologically impossible.
    – JPi
    Oct 8, 2017 at 2:33
  • @JPi I mean cycle as in graph theory; a path of nodes wherein a node is reachable from itself. Oct 8, 2017 at 3:46
  • I understood...
    – JPi
    Oct 8, 2017 at 4:04

1 Answer 1

4

I have removed one abdellah parent, shifted the other, and drawn manually an extra edge between the unique abdellah and the Mhen child (maybe there's a better method but I don't know it).

\documentclass[]{standalone}
\usepackage[all]{genealogytree}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
    \begin{genealogypicture}[template=database portrait,
        after tree={\draw[thick](abdellah.south) -- ++(0,-8.5pt) -| (Mhen.north);}
        ]
        parent[]{
            g[id=Said1990]{
                male,
                name = {\pref{Sa\"{i}d} \surn{Maanan}},
                birth= {1990}{},
            }
            c[id=Ahmed1992]{
                male,
                name = {\pref{Ahmed} \surn{Maanan}},
                birth= {1992}{},
            }
            parent{
                g[id=Fatima1962]{
                    female,
                    name = {\pref{Fatima} \surn{Dasser}},
                    birth= {1962}{},
                }

                parent{
                    g[id=Kelt1938]{
                        female,
                        name = {\pref{Keltoum} \surn{Akheshkhush}},
                        birth= {1938}{},
                    }
                    parent{
                        g[id=Zah]{
                            female,
                            name = {\pref{Zahra} \surn{A\"{i}t Lmoudden}},
                            birth= {}{},
                        }
                        parent{
                            g[id=Fad]{
                                female,
                                name = {\pref{Fadma} \surn{A\"{i}t Oulidi}},
                                birth= {}{},
                            }
                            parent{
                                g[id=Bihi]{
                                    male,
                                    name = {\pref{Bihi} \surn{A\"{i}t Oulidi}},
                                    birth= {}{},
                                }
                            }
                        }
                        parent{
                            g[id=SiH]{
                                male,
                                name = {\pref{Si Hmed} \surn{A\"{i}t Lmoudden}},
                                birth= {}{},
                            }
                            parent{
                                g[id=Mhen,
                                family={extra edges={abdellah}{Mhen}{foreground={black},
                                        no background}}
                                ]{
                                    male,
                                    name = {\pref{Mhend} \surn{A\"{i}t Lmoudden}},
                                    birth={}{},
                                }
                            }
                        }
                    }
                    parent{
                        g[id=Brah]{
                            male,
                            name = {\pref{Brahim} \surn{Akheshkhush}},
                            birth= {}{},
                        }
                        parent{
                            g[id=Mhe]{
                                male,
                                name = {\pref{Mhend} \surn{A\"{i}t Lmoudden}},
                                birth= {}{},
                            }
                            parent{
                                g[id=ali]{
                                    male,
                                    name = {\pref{Ali} \surn{A\"{i}t Lmoudden}},
                                    birth= {}{},
                                }
                                parent{
                                    g[id=abdellah,
                                        tikz={xshift=-3.2em},
                                        ]{
                                        male,
                                        name = {\pref{Abdellah} \surn{A\"{i}t Lmoudden}},
                                        birth= {}{},
                                    }
                                }
                            }
                        }
                        parent{
                            g[id=ija]{
                                female,
                                name = {\pref{Ijja} \surn{N'A\"{i}t Tamr}},
                                birth= {}{},
                            }
                        }
                    }
                }
                parent{
                    g[id=Hmed1914]{
                        male,
                        name = {\pref{Ahmed} \surn{Dasser}},
                        birth= {1914}{},
                    }
                }
            }
            parent{
                g[id=Mohamed1947]{
                    male,
                    name = {\pref{Mohammed} \surn{Maanan}},
                    birth={1947}{},
                }
            }
        }
    \end{genealogypicture}
\end{document}

enter image description here

2
  • Thank you for the answer, but it looks a bit manipulated, it might cause me difficulties in case I want to expand the tree further. Oct 9, 2017 at 7:50
  • @Maanan Sorry but I don't know if there's a better way to do it...
    – CarLaTeX
    Oct 9, 2017 at 8:09

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.