LaTeX forum ⇒ Graphics, Figures & TablesMaking family tree presentation slide Topic is solved

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

Making family tree presentation slide

Postby anta40 » Sat Jan 25, 2014 11:38 am

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:
  1. \documentclass{beamer}
  2. \usepackage{tikz}
  3. \usepackage{verbatim}
  4. \usepackage[active,tightpage]{preview}
  5. \PreviewEnvironment{tikzpicture}
  6. \setlength\PreviewBorder{15pt}%
  7. \usetheme{default}
  8. \usetikzlibrary{trees}
  9. \begin{document}
  10.  
  11.  
  12. \begin{frame}{Hello}
  13.  
  14. This is our family tree
  15.  
  16. \begin{tikzpicture}[
  17. man/.style={rectangle,draw,fill=blue!20},
  18. woman/.style={rectangle,draw,fill=red!20,rounded corners=.8ex},
  19. grandchild/.style={grow=down,xshift=1em,anchor=west,
  20. edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},
  21. first/.style={level distance=6ex},
  22. second/.style={level distance=12ex},
  23. third/.style={level distance=18ex},
  24. level 1/.style={sibling distance=5em}]
  25. % Parents
  26. \coordinate
  27. child[grow=left] {node[man,anchor=east]{Jim}}
  28. child[grow=right] {node[woman,anchor=west]{Jane}}
  29. child[grow=down,level distance=0ex]
  30. [edge from parent fork down]
  31. % Children and grandchildren
  32. child{node[man] {Alfred}
  33. child[grandchild,first] {node[man]{Joe}}
  34. child[grandchild,second] {node[woman]{Heather}}
  35. child[grandchild,third] {node[woman] {Barbara}}}
  36. child{node[woman] {Berta}
  37. child[grandchild,first] {node[man]{Howard}}}
  38. child {node[man] {Charles}}
  39. child {node[woman]{Doris}
  40. child[grandchild,first] {node[man]{Nick}}
  41. child[grandchild,second] {node[woman]{Liz}}};
  42. \end{tikzpicture}
  43.  
  44. \end{frame}
  45.  
  46. \begin{frame}{Hello 2}
  47.  
  48. This is our family tree
  49.  
  50. \begin{tikzpicture}[
  51. man/.style={rectangle,draw,fill=blue!20},
  52. woman/.style={rectangle,draw,fill=red!20,rounded corners=.8ex},
  53. grandchild/.style={grow=down,xshift=1em,anchor=west,
  54. edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}},
  55. first/.style={level distance=6ex},
  56. second/.style={level distance=12ex},
  57. third/.style={level distance=18ex},
  58. level 1/.style={sibling distance=5em}]
  59. % Parents
  60. \coordinate
  61. child[grow=left] {node[man,anchor=east]{Jim}}
  62. child[grow=right] {node[woman,anchor=west]{Jane}}
  63. child[grow=down,level distance=0ex]
  64. [edge from parent fork down]
  65. % Children and grandchildren
  66. child{node[man] {Alfred}
  67. child[grandchild,first] {node[man]{Joe}}
  68. child[grandchild,second] {node[woman]{Heather}}
  69. child[grandchild,third] {node[woman] {Barbara}}}
  70. child{node[woman] {Berta}
  71. child[grandchild,first] {node[man]{Howard}}}
  72. child {node[man] {Charles}}
  73. child {node[woman]{Doris}
  74. child[grandchild,first] {node[man]{Nick}}
  75. child[grandchild,second] {node[woman]{Liz}}};
  76. \end{tikzpicture}
  77.  
  78. \end{frame}
  79. \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 3347 times

Tags:

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

Postby esdd » Sat Jan 25, 2014 9:27 pm

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

  1. \usepackage[active,tightpage]{preview}
  2. \PreviewEnvironment{tikzpicture}
  3. \setlength\PreviewBorder{15pt}

Regards
Elke

User avatar
anta40
Posts: 38
Joined: Thu Sep 11, 2008 2:36 pm

Postby anta40 » Fri Jan 31, 2014 5:25 am

Ah that works. Thank you


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests