Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

latex beamer: prevent showing the TOC at one occasion

Tags:

latex

beamer

Normally I use

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

in my preamble to achieve that before a new sections starts the TOC is shown with the now starting section highlighted.

In the talk I am actually preparing I have one special section for which I do not want this behavior. The transition from the section before should be "silent". All the other sections should start like they do now.

I am sure that must be possible.

like image 964
cknoll Avatar asked May 08 '10 20:05

cknoll


2 Answers

In the beamer manual, the command \AtBeginSection is explained as follows:

\AtBeginSection[special star text]{text}

If you declare the special section with the star command \section*, the section table of content will not appear. This solution is the first that comes to mind but may change the way the section is represented in the document.

Another approach (experimental, I never tested it) would be to use a boolean parameter. If the boolean parameter is set, then the code is not printed. Then you declare your section normally but you set the boolean value around your code.

Here is a code sample that should do the trick :

\RequirePackage{ifthen} % package required

\newboolean{sectiontoc}
\setboolean{sectiontoc}{true} % default to true

\AtBeginSection[]
{
  \ifthenelse{\boolean{sectiontoc}}{
    \begin{frame}<beamer>{Gliederung}
      \tableofcontents[currentsection]
    \end{frame}
  }
}

\newcommand{\toclesssection}[1]{
  \setboolean{sectiontoc}{false}
  \section{#1}
  \setboolean{sectiontoc}{true}
}

Then in the document, just declare your special section as \toclesssection{My section without the toc}.

like image 145
Lohrun Avatar answered Sep 19 '22 15:09

Lohrun


Another approach is to temporarily change the content of \AtBeginSection:

\documentclass{beamer}


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


\begin{document}

\section{section with toc}  
\begin{frame}
    abc
\end{frame} 

\begingroup
    \AtBeginSection[]{}
    \section{section without toc}   
    \begin{frame}
        abc
    \end{frame} 
\endgroup

\section{section with toc}  
\begin{frame}
    abc
\end{frame} 

\end{document}
like image 29
samcarter_is_at_topanswers.xyz Avatar answered Sep 20 '22 15:09

samcarter_is_at_topanswers.xyz