My presentation consist of multiple sections. Some sections consist of subsection and some not. I want beamer to display the TOC before every subsection and before every section which consists of no other subsection.
Currently, i write in the preamble:
\AtBeginSection[] {
\begin{frame}<beamer>
\frametitle{Inhalt} %
\tableofcontents[currentsection]
\end{frame}
}
\AtBeginSubsection[] {
\begin{frame}<beamer>
\frametitle{Inhalt} %
\tableofcontents[currentsubsection]
\end{frame}
}
As a result, if a section consist of subsecitons beamer displays the TOC twice before the first subsection in a section, one time for the section and one time for the subsection. That is ugly in my opinion. What can i do?
Best Answer
You can very simply use TeX conditionals. The only drawback (or feature) is that for section with subsections, in the first ToC does not "shade" the latter subsections. Basically, we tell LaTeX: At section, make ToC and remember
false
. At subsection, if you seetrue
make ToC, and remembertrue
.