0

I want list all sections without part separation in the main table of contents. I did not find relevant threads, similar one How to collect all parts in Beamer? Code where the main Table of Contents is only about the first \part{} in Fig. 1, while wanted output - all sections without part separation

\documentclass{beamer}
\usetheme{Berkeley} 
\logo{\includegraphics[width=1cm]{example-image}}
% https://tex.stackexchange.com/a/346486/13173
\newenvironment{slide}[1]
{\begin{frame}[environment=slide,allowframebreaks]
\frametitle{\insertsection-#1}
}
{\end{frame}}
% fragile only if code
% allowframebreaks not by default 

\begin{document} 
\title{Sensory system. Primary sensory modalities. Cortical modalities. Kinds of sensory disturbances. Spinal cord disorders. Spinal cord transverse and partial lesion. Cauda equina damage.}
\author{Leo}

% TODO Print TOC of all parts here

\begin{frame}{Contents}
\tableofcontents
\end{frame}

% https://tex.stackexchange.com/a/115891/13173
\AtBeginSection[]{\begin{frame}{Outline}
\tableofcontents[hideothersubsections, pausesections]
\end{frame}}

\AtBeginSection[]{\begin{frame}{Outline}
\tableofcontents[hideothersubsections]
\end{frame}}

% not complete answer here https://tex.stackexchange.com/q/353064/13173

\section{Cortical modalities 1}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 2}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 3}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\part{}
\begin{frame}{Contents}
\tableofcontents
\end{frame}

\section{Cortical modalities 4}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 5}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\end{document}

Fig. 1 Output

enter image description here

Expected output: table of contents of sections 1-5 in a list without separating them by parts

  • Not Part 1 a b c, Part 2 d e
  • Wanted: a b c d e

OS: Debian 8.7
TeXLive: 2016

  • 2
    The OS information is rather irrelevant here! There's no need to specify it in each question – user31729 Jun 3 '17 at 14:04
2

As said in previous answers to your questions, don't use \usepackage{hyperref} in a beamer document.

Loop over the different parts:

\documentclass{beamer}

\usepackage{pgffor}

\usepackage{totcount}
\regtotcounter{part}

\begin{document} 

\begin{frame}
\tableofcontents
\foreach\x in {1,...,\totvalue{part}}{%
    \vskip-0.4cm
    \tableofcontents[part=\x]%
}%
\end{frame}


\section{Cortical modalities 1}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 2}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 3}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\part{}
\section{Cortical modalities 4}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 5}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\part{}
\section{Cortical modalities 6}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 7}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\end{document}

(the value \vskip-0.4cm is guessed by eye, maybe it needs some more fine tuning)

  • 1
    @LéoLéopoldHertz준영 Beamer already loads hyperref. Loading it again is a) useless and b) poses the risk to cause an option clash. – user36296 Jun 3 '17 at 14:12
  • 1
    @LéoLéopoldHertz준영 To get the total number of part, you can use the totcount package. – user36296 Jun 3 '17 at 14:12
  • @LéoLéopoldHertz준영 See for example tex.stackexchange.com/questions/308343/… how the total number of sections is determined. You can do the same for parts. – user36296 Jun 3 '17 at 14:14
  • @LéoLéopoldHertz준영 I don't understand what you mean by "But to which variable do you save the count?". But please see my edited answer. – user36296 Jun 3 '17 at 14:22

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.