1

I have started writing a beamer, and up until now everything was going fine (I only had 1 section with no subsection). Of course, I got to the point where I wanted to add another section, but with several subsections inside it.

I have declared

\AtBeginSection{
    \begin{frame}
        \frametitle{Summary}
        \tableofcontents[currentsection, hideothersubsections, pausesubsections]
    \end{frame}
}

before I started the \begin{document} directive.

So I only had 1 generated slide for the first section, before I added the other section. Which is what I expected to have.

Things got messed up somehow when I added the second section, and the few subsections inside it (3 at the moment). For some reason, it now generates the first section slide 3 times... The other section is correctly paused at each subsection, but it's annoying that the first section "pauses" 3 times too...

Here is a preview of the complete code:

\documentclass[11pt]{beamer}

\AtBeginSection{
\begin{frame}
    \frametitle{Summary}
    \tableofcontents[currentsection, hideothersubsections, pausesubsections]
\end{frame}
}


\begin{document}
\section{Section 1}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\section{Work Environment}

\subsection{The team}
\begin{frame}
\end{frame}

\subsection{Learning stuff}

\begin{frame}
\end{frame}

\subsection{Tools to work with}

\begin{frame}
\end{frame}
\end{document}

I have tried to flush auxiliary files and re-compiling several times, making sure everything is correctly written etc... to no avail yet.

Any hindsights of what is going on ?

4
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it).
    – Astrinus
    Jun 3, 2015 at 9:54
  • Hi @Astrinus, thanks for the comment. I updated my question. Regards,
    – Skwiggs
    Jun 3, 2015 at 14:14
  • @Astrinus: Updated the question :) I do not know how (where?) to set that draft option :/
    – Skwiggs
    Jun 3, 2015 at 15:14
  • Follow @Werner advice and read the links he has provided ;-) The draft option is related to graphicx.
    – Astrinus
    Jun 3, 2015 at 15:22

1 Answer 1

1

Workaround: only use pausesubsections for sections with > 0 subsections:

\documentclass[11pt]{beamer}

\usepackage{totcount}
\regtotcounter{section}

\usepackage{xcntperchap}
\RegisterCounters{section}{subsection}

\newcounter{totalsubsection}
\setcounter{totalsubsection}{0}

\preto\frame{\setcounter{totalsubsection}{\ObtainTrackedValueExp[\value{section}]{section}{subsection}}}


\AtBeginSection{
\begin{frame}
    \frametitle{Summary}
        \ifnum\value{totalsubsection}>0%
            \tableofcontents[currentsection, hideothersubsections, pausesubsections]
        \else%
            \tableofcontents[currentsection, hideothersubsections]
        \fi%
\end{frame}
}


\begin{document}
\section{Section 1}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\begin{frame}
\end{frame}

\section{Work Environment}

\subsection{The team}
\begin{frame}
\end{frame}

\subsection{Learning stuff}

\begin{frame}
\end{frame}

\subsection{Tools to work with}

\begin{frame}
\end{frame}
\end{document}
1
  • Thanks for your answer, however as I was unable to find a solution early I went on and wrote the presentation with other editors. Don't have the original file left so can't really test your solution. I'll make sure to select it however if it worked for other people.
    – Skwiggs
    Feb 13, 2017 at 17:28

You must log in to answer this question.

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