1

I am creating beamer slides using the standard template, as shown below:

\documentclass{beamer}

\mode<presentation>
\usetheme{Frankfurt}
\setbeamertemplate{footline}[frame number]

\begin{document}

\begin{frame}
  \frametitle{My title}

  \begin{itemize}
    \item Bullet point 1
    \begin{itemize}
      \item Sub bullet 1
    \end{itemize}
    \item Bullet point 2
    \begin{itemize}
      \item Sub bullet 2
    \end{itemize}
  \end{itemize}
\end{frame}
\end{document}

Now I want to hide the sub-bullets totally in one set of slides but include them in another set.

||Begin Edit||

I can achieve this using 2 files, the first one with the bullet points as above and a second without as shown below:

\documentclass{beamer}

\mode<presentation>
\usetheme{Frankfurt}
\setbeamertemplate{footline}[frame number]

\begin{document}

\begin{frame}
  \frametitle{My title}

  \begin{itemize}
    \item Bullet point 1
    \begin{itemize}
      \item[]
    \end{itemize}
    \item Bullet point 2
    \begin{itemize}
      \item[]
    \end{itemize}
  \end{itemize}
\end{frame}
\end{document}

My question now is, can I achieve this effect in one file?

||End Edit||

Is there any conditional compilation trick using which I can set a flag at the beginning of the slide to indicate if I want to generate the sub bullets or not?

1
  • I'm a bit confused. Any beamer tutorial will talk about overlays, \only, and \visible, which seems to be exactly what you want, and is a main selling point of beamer.
    – Teepeemm
    Jan 15 '20 at 2:02
1

I guess I figured out myself. I can use the ifthenelse statement. MWE below.

\documentclass{beamer}

\usepackage{ifthen}

\mode<presentation>
\usetheme{Frankfurt}
\setbeamertemplate{footline}[frame number]

\newboolean{mybool}

%% setting mybool to false will compile to display the sub bullets
\setboolean{mybool}{true}

\begin{document}

\begin{frame}
  \frametitle{My title}

  \begin{itemize}
    \item Bullet point 1
    \begin{itemize}
      \ifthenelse{\boolean{mybool}}{
        \item []
        \item []
      }{
        \item Sub bullet 1
        \item Sub bullet 2
      }
    \end{itemize}
    \item Bullet point 2
    \begin{itemize}
      \ifthenelse{\boolean{mybool}}{
        \item []
      }{
      \item Sub bullet 2
      }
    \end{itemize}
  \end{itemize}
\end{frame}


\end{document}

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .