2

I think I reached an impasse. I want to do a Table of Contents in Beamer that has the following characteristics:

  1. Section should be numbered. All numbers should be squared or circled (any works) like in the [square] option.
  2. I want the ToC to show at each section change (ie. it must work with AtBeginSection[]). Whenever a new section comes, the corresponding section should be underlined, and the remaining sections should be shaded, and not underlined.

Here is a MWE, focus on slide 2 for the moment:

\documentclass{beamer}

\setbeamertemplate{section in toc}{\Large{\underline{\inserttocsection}}}
\setbeamertemplate{section in toc shaded}{\inserttocsection}

\begin{document}
\begin{frame}
    Slide 1
\end{frame}

\AtBeginSection[]{
\begin{frame}{Both sections should have circles with section numbers!}
    \tableofcontents[currentsection]
\end{frame}
}

\section{This section should be underlined}
\begin{frame}
    Slide 3
\end{frame}

\section{This section should be shaded and NOT underlined}
\begin{frame}
    Slide 5
\end{frame}
\end{document}

enter image description here

But I cannot seem to be able to either get the square or get the second section's title shaded. Any help would be very much appreciated.

1 Answer 1

0
\documentclass{beamer}


\setbeamertemplate{section in toc}{%
    \leavevmode\leftskip=2ex%
  \llap{%
    \usebeamerfont*{section number projected}%
    \usebeamercolor{section number projected}%
    \begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
      \color{bg}
      \pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
      \pgfusepath{fill}
      \pgftext[base]{\color{fg}\inserttocsectionnumber}
    \end{pgfpicture}\kern1.25ex%
  }%
  \underline{\inserttocsection}\par%
}

\setbeamertemplate{section in toc shaded}{%
\begin{colormixin}{20!parent.bg}
    \leavevmode\leftskip=2ex%
  \llap{%
    \usebeamerfont*{section number projected}%
    \usebeamercolor{section number projected}%
    \begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
      \color{bg}
      \pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
      \pgfusepath{fill}
      \pgftext[base]{\color{fg}\inserttocsectionnumber}
    \end{pgfpicture}\kern1.25ex%
  }%
  \inserttocsection\par%
\end{colormixin}\unskip}

\AtBeginSection[]{
\begin{frame}{Both sections should have circles with section numbers!}
    \tableofcontents[currentsection]
\end{frame}
}

\begin{document}
\begin{frame}
    Slide 1
\end{frame}

\section{This section should be underlined}
\begin{frame}
    Slide 3
\end{frame}

\section{This section should be shaded and NOT underlined}
\begin{frame}
    Slide 5
\end{frame}
\end{document}

enter image description here

You must log in to answer this question.

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