0

This question discusses how to change the colour of a frame in beamer. You must add a setting outside the frame using {...}. This solution doesn't work for the table of contents. MWE below:

\documentclass{beamer}     
\usetheme{default}

\AtBeginSection[]{
    % with this one both are yellow
    \setbeamercolor{background canvas}{bg=yellow} 
    \begin{frame}
    % with this one both are white
    %\setbeamercolor{background canvas}{bg=yellow} 
    \frametitle{Table of Contents}
    \vfill
    \tableofcontents[currentsection]
    \vfill
\end{frame}
}

\begin{document}

\section{This should be yellow}

\begin{frame}

This should be white

\end{frame}

\end{document}

How can I achieve what is needed? This doesn't help either.

One solution I found is adding the table of content slide manually, using:

{
    \setbeamercolor{background canvas}{bg=yellow} 
    \frame{\tableofcontents[currentsection]}
}

But if I have a many sections, is there a way to automate the above to all ToC frames?

3

Your original code will work if you add an extra pair of {}:

\documentclass{beamer}     
\AtBeginSection{
    {
    \setbeamercolor{background canvas}{bg=yellow} 
    \begin{frame}
    \frametitle{Table of Contents}
    \vfill
    \tableofcontents[currentsection]
    \vfill
    \end{frame}
    }
}

\begin{document}

\section{This should be yellow}

\begin{frame}    
This should be white
\end{frame}

\end{document}

enter image description here

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.