-1

Figures are great for presentation slides. I would like to add a figure to my slides, but wouldn't be nice to import an already designed image. I would like to instead draw from within latex, this way I can easily make changes and/or add text without having to re-insert every time I modify the image.

How do I design a figure like the following in latex? enter image description here

arilwan
  • 389
  • Take a look at the forest package. – leandriis Jan 17 '20 at 17:20
  • 4
    This is a duplicate (for the most part) of an earlier post of yours: Draw tree-like figure (which was also declared a duplicate)... – Werner Jan 17 '20 at 17:55
  • Even if it wasn't a duplicate, searching through "LaTeX create figure" should give several pointers for TikZ and the picture environment. Then you can give it a start, and ask us for help at specific parts. "Please create this figure for me" is not how this site works. – Teepeemm Jan 17 '20 at 21:06

2 Answers2

1

The following might serve as a starting point:

enter image description here

\documentclass{beamer}
\usepackage[edges]{forest}
\begin{document}
\begin{frame}
\frametitle{example diagram}
\begin{forest}
  for tree={
    draw,
    rounded corners,
    node options={align=left,fill=gray!20},
    text width=2.7cm,
  },
  [Approach, 
  [\textbf{location-based} \\ Some text, 
  ]
  [\textbf{inertial based} \\ some text, 
  ]
  [\textbf{Hybrid} \\some text, 
  ]
  ]
\end{forest}
\end{frame}
\end{document}
leandriis
  • 62,593
0
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
forked edges,
for tree={rounded corners,draw,fill=gray!20,font=\sffamily,
    align=left,text width=8em,s sep+=1em}
[\textbf{Approach}
 [{\textbf{location-based}\\[1.2em] blub}]
 [{\textbf{inertia-based}\\[1.2em] blah}]
 [{\textbf{hybrid}\\[1.2em] pft}]
]
\end{forest}
\end{document}

enter image description here

ADDENDUM: Of course the same code works in beamer presentations (up to making some distances a tiny bit smaller).

\documentclass{beamer}
\usepackage[edges]{forest}
\begin{document}
\begin{frame}[t]
\frametitle{A tree}
\centering
\begin{forest}
forked edges,
for tree={rounded corners,draw,fill=gray!20,font=\sffamily,
    align=left,text width=7em,s sep+=0.5em}
[\textbf{Approach}
 [{\textbf{location-based}\\[1.2em] blub}]
 [{\textbf{inertia-based}\\[1.2em] blah}]
 [{\textbf{hybrid}\\[1.2em] pft}]
]
\end{forest}
\end{frame}
\end{document}

enter image description here