7

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?

7

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

  • 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 '14 at 18:36
  • 1
    @Dror sure; please see my updated answer. – Gonzalo Medina Apr 16 '14 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.