9

The following

\AtBeginSection[]
{
\begin{frame}<beamer>
  \frametitle{Outline}
  \tableofcontents[currentsection]
\end{frame}
}

inserts the table of contents at the beginning of each section, such that the current section is rendered normally and the others are shaded. I would like to have a similar effect but instead of shading the other sections, I'd like to alert the current one. Since, according to the manual, the allowed styles are show, shaded, and hide, I don't know how to accomplish this. Is there a canonical way to obtain this behavior?

1 Answer 1

9

You can set the section in toc and section in toc shaded colors appropriately:

\documentclass{beamer}


\AtBeginSection[]
{
\setbeamercolor{section in toc}{fg=alerted text.fg}
\setbeamercolor{section in toc shaded}{fg=structure}
\begin{frame}<beamer>
  \frametitle{Outline}
  \tableofcontents[currentsection]
\end{frame}
}

\begin{document}

\section{Test section one}
\begin{frame} test \end{frame}
\section{Test section two}
\begin{frame} test \end{frame}
\section{Test section three}
\begin{frame} test \end{frame}
\section{Test section four}
\begin{frame} test \end{frame}

\end{document}

enter image description here

If "other" sections should not be shaded, you can add

A complete example:

\documentclass{beamer}


\AtBeginSection[]
{
\setbeamercolor{section in toc}{fg=alerted text.fg}
\setbeamercolor{section in toc shaded}{bg=structure!20,fg=structure}
\setbeamertemplate{section in toc shaded}[default][100]
\begin{frame}<beamer>
  \frametitle{Outline}
  \tableofcontents[currentsection]
\end{frame}
}

\begin{document}

\section{Test section one}
\begin{frame} test \end{frame}
\section{Test section two}
\begin{frame} test \end{frame}
\section{Test section three}
\begin{frame} test \end{frame}
\section{Test section four}
\begin{frame} test \end{frame}

\end{document}

enter image description here

3
  • This is very helpful, however, now if I have somewhere \tableofcontents (without any option), then all entries are alerted. Is there a way out of the loop?
    – Dror
    Apr 16, 2014 at 18:36
  • 1
    @Dror sure; please see my updated answer. Apr 16, 2014 at 18:39
  • @GonzaloMedina Why did you define the colors and templates in the \AtBeginSection command and not outside of this command? I think it won't be overridden outside this scope, or does it?
    – TobiBS
    Sep 9, 2020 at 14:21

You must log in to answer this question.

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