Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I looking for a simple way to typeset a genealogical tree in LaTeX.

In particular, I'm interested in typesetting a so-called "Ahnentafel", that is a tree that shows me, my parents, my grandparents, my great-grandparents etc. In other words, it is a hierarchical tree in which the number of branches doubles at each level.

Is there a package that can help me? Sadly, http://www.ctan.org/topic/genealogy is empty.

I've noted a few posts recommending TikZ for drawing trees. I've never used TikZ, and I'm reluctant to dive into it just for this purpose. But if I must, I must.

EDIT:

Here's an example of what I want to create:

This is a 3-generation Ahnentafel.

This is a 3-generation Ahnentafel

share|improve this question
    
could you provide a sample image in your question? –  cmhughes May 11 at 16:03
    
See e.g. tex.stackexchange.com/questions/23241/… –  Alan Munn May 11 at 16:13
    
@cmhughes, I've done so. –  oz1cz May 11 at 17:16

4 Answers 4

up vote 6 down vote accepted

Here's another option using forest to illustrate some other of its features:

\documentclass{standalone}
\usepackage{tabularx}
\usepackage{forest}
\usetikzlibrary{shapes.geometric}

% comment out the following four lines if the Helvet Neue font are not available:
\usepackage{fontspec}
\newfontfamily\namefont[]{Helvetica Neue Condensed Bold}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Helvetica Neue Light}

\definecolor{color1}{HTML}{FFCB73}
\definecolor{color2}{HTML}{FFA100}

\newcommand\Person[5]{%
  {\namefont #1} \\
  \begin{tabularx}{4.5cm}[t]{@{}r@{\hspace*{2pt}}X@{}}
  b: & #2 \\
  & #3 \\
  d: & #4 \\
  & #5
  \end{tabularx}%
}

\begin{document}

\begin{forest}
delay={
  for tree={
    edge path={
      \noexpand\path[\forestoption{edge}]
        ([xshift=-(6pt-1pt*level)].child anchor) to[out=180,in=0]
        ([xshift=(6pt-1pt*level)]!u.parent anchor)\forestoption{edge label};
    },
    if n=1
      {fill=color1,shape=tape,tape bend bottom=none}
      {if n'=1
        {fill=color2,shape=tape,tape bend top=none}
        {}
      }
  }
},
for tree={
  line width=3pt,
  inner sep=8pt,
  draw=brown,
  minimum size=1cm,
  text width=4.5cm,
  child anchor=west,
  parent anchor=east,
  grow=east,
  l sep=2cm,
  s sep=10pt,
  draw,
  anchor=west,
  edge={line width=(18pt-3pt*level),line cap=rect,color=brown},
}
[\Person{Abraham /LINCOLN/}{12 Feb 1809}{Hardin (Larue), KY}{15 Apr 1865}{Washington, DC},fill=color2
  [\Person{Nancy /HANKS/}{5 Feb 1784}{Campbell Co., Virginia}{5 Oct 1818}{Centryville, Spencer, Ind}
   [\Person{Nancy /SHIPLEY/}{ABT 1745}{Pembroke, Wash, ME}{}{Amelia, Amelia, VA}
     [\Person{Sarah Or Rachel}{ABT 1723}{}{}{}
     ]
     [\Person{Robert /SHIPLEY/}{ABT 1719}{}{}{}
     ]
   ]
   [\Person{Joseph /HANKS/}{ABT 1740}{Pembroke, Wash, ME}{}{Amelia, Amelia, VA}
     [\Person{Sarah /EVANS/}{ABT 1714}{Pembroke, Wash, ME}{}{}
     ]
     [\Person{John /HANKS/}{22 Oct 1709}{Pembroke, Wash, ME}{6 Sep 1742}{Pembroke, Wash, ME}
     ]
   ]
  ]
  [\Person{Thomas /LINCOLN/}{20 Jan 1780}{Rockingham, VA}{17 Jan 1851}{Beechland, Co., KY.}
    [\Person{Bethsheba /HERRING/}{1746}{Rockingham, Co., VA.}{}{}
      []
      []
    ]
    [\Person{Abraham /LINCOLN/}{17 May 1744}{Berks, Co., Penn.}{1786}{Jefferson County, KY}
      [\Person{Rebecca /FLOWERS/}{30 Mar 1720}{Berks, Co., Penn.}{1806}{Berks, Co., Penn}
      ]
      [\Person{John /LINCOLN/}{3 May 1711}{Freehold, Monmouth, N.J.}{1778}{PA}
      ]
    ]
  ]
]
\end{forest}

\end{document}

The result:

enter image description here

In this solution, the edges are curved so as to suggest a tree and the thickness of the branches automatically diminishes as the level increases; also, male and female persons are distinguished by selecting different attributes for their nodes (shape, filling); all this is done at the tree specification.

The Helvet Neue font used in my example can be downloaded from rebba pocket.

share|improve this answer
    
Very, very beautiful, Gonzalo! I'm impressed. –  oz1cz May 12 at 5:53
    
(+1) But it hardly looks much like the target image specified in the question's desiderata! –  cfr Jun 9 at 2:00

You could use forest which I've recently been learning to use for tree diagrams. This code owes pretty much everything to Gonzalo Medina's answer to my question about using forest in this way:

\documentclass[tikz,12pt]{standalone}
\usetikzlibrary{calc,positioning,backgrounds,arrows.meta}
\usepackage{forest}
\pagestyle{empty}

\begin{document}

\begin{forest}
  for tree={
    child anchor=west,
    parent anchor=east,
    grow=east,
    draw,
    anchor=west,
    edge path={
      \noexpand\path[\forestoption{edge}]
        (.child anchor) -| +(-5pt,0) -- +(-5pt,0) |-
        (!u.parent anchor)\forestoption{edge label};
    },
  }
  [Me
    [My Father
      [My Father's Father
      ]
      [My Father's Mother
      ]
    ]
    [My Mother
      [My Mother's Father
      ]
      [My Mother's Mother
      ]
    ]
  ]
\end{forest}

\end{document}

Family Forest

share|improve this answer

I have an "indirect" solution to your problem. There are two free programs that leap into mind that could solve your problem: A) Gramps www.gramps-project.org - a fully blown genealogy program (open source) that can draw various types of an "Ahnentafel" and can also export written reports to Latex. There are program versions for Linux, Mac and Win32. If you are on Linux I would recommend version 3.4.7 B) yEd - a Java-based Editor (closed source but free) that can read and visualize/print also Gedcom files. So if you just have a Gedcom file, try yEd. It has also a Weblaunch facility to try it out.

share|improve this answer

Another indirect solution. Some years ago I used a program called LifeLines http://lifelines.sourceforge.net which reads a GEDCOM (try googling) file and can produce a variety of reports and trees in LaTeX format (and others as well).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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