Graphics, Figures & TablesMaking family tree presentation slide

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
anta40
Posts: 38
Joined: Thu Sep 11, 2008 2:36 pm

Making family tree presentation slide

Post by anta40 »

I was asked to make presentation slides that depicted our family tree.
And then I decided to try beamer for that purpose.

Based on these 2 examples, I made my first attempt:
http://www.texample.net/media/tikz/exam ... y-tree.tex
http://www.math.umbc.edu/~rouben/beamer ... node_sec_3

So this is my 2-page slides:

Code: Select all

\documentclass{beamer}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{15pt}%
\usetheme{default}
\usetikzlibrary{trees}
\begin{document}


\begin{frame}{Hello}

This is our family tree

\begin{tikzpicture}[
  man/.style={rectangle,draw,fill=blue!20},
  woman/.style={rectangle,draw,fill=red!20,rounded corners=.8ex},
  grandchild/.style={grow=down,xshift=1em,anchor=west,
    edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},
  first/.style={level distance=6ex},
  second/.style={level distance=12ex},
  third/.style={level distance=18ex},
  level 1/.style={sibling distance=5em}]
    % Parents
    \coordinate
      child[grow=left] {node[man,anchor=east]{Jim}}
      child[grow=right] {node[woman,anchor=west]{Jane}}
      child[grow=down,level distance=0ex]
    [edge from parent fork down]
    % Children and grandchildren
    child{node[man] {Alfred}
      child[grandchild,first] {node[man]{Joe}}
      child[grandchild,second] {node[woman]{Heather}}
      child[grandchild,third] {node[woman] {Barbara}}}
    child{node[woman] {Berta}
      child[grandchild,first] {node[man]{Howard}}}
    child {node[man] {Charles}}
    child {node[woman]{Doris}
      child[grandchild,first] {node[man]{Nick}}
      child[grandchild,second] {node[woman]{Liz}}};
\end{tikzpicture}

\end{frame}

\begin{frame}{Hello 2}

This is our family tree

\begin{tikzpicture}[
  man/.style={rectangle,draw,fill=blue!20},
  woman/.style={rectangle,draw,fill=red!20,rounded corners=.8ex},
  grandchild/.style={grow=down,xshift=1em,anchor=west,
    edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},
  first/.style={level distance=6ex},
  second/.style={level distance=12ex},
  third/.style={level distance=18ex},
  level 1/.style={sibling distance=5em}]
    % Parents
    \coordinate
      child[grow=left] {node[man,anchor=east]{Jim}}
      child[grow=right] {node[woman,anchor=west]{Jane}}
      child[grow=down,level distance=0ex]
    [edge from parent fork down]
    % Children and grandchildren
    child{node[man] {Alfred}
      child[grandchild,first] {node[man]{Joe}}
      child[grandchild,second] {node[woman]{Heather}}
      child[grandchild,third] {node[woman] {Barbara}}}
    child{node[woman] {Berta}
      child[grandchild,first] {node[man]{Howard}}}
    child {node[man] {Charles}}
    child {node[woman]{Doris}
      child[grandchild,first] {node[man]{Nick}}
      child[grandchild,second] {node[woman]{Liz}}};
\end{tikzpicture}

\end{frame}
\end{document}
The result is exactly like what I expected, except that "Hello", "Hello 2", and "This is our family tree" are not visible. How to fix this?

Screenshot is attached.
Attachments
familytree.jpg
familytree.jpg (115.27 KiB) Viewed 5492 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Making family tree presentation slide

Post by esdd »

These three lines are only for a preview of the tikz drawings. You can delete them.

Code: Select all

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{15pt}
Regards
Elke
User avatar
anta40
Posts: 38
Joined: Thu Sep 11, 2008 2:36 pm

Re: Making family tree presentation slide

Post by anta40 »

Ah that works. Thank you
Post Reply