4

Hello TeX/LaTeX/Beamer colleagues,

There is a prob I could not solve. I'm preparing a 2 hours class, so my toc is really heavy. 5 Sections, some of them with several subsections.

I already have the following outline at the beginning:

OUTLINE

1 Section One

2 Section Two . . . 5 Section Five.

However, running the presentation, at the beginning of each section and subsection appears the dense toc. All sections + all subsections.... frightful!

What I want is, starting either a section or a subsection, to project a clean viewgraph containing ONLY the current section, highlighting the current subsection and shading the others (subsections of the current section...)

Is possible to do that?

In advance I thank you very much!

Best

Physics is love!

  • Dividing the document in parts using \part{} solves your problem? If you want you can set up the section counter to not be reseted when changing the parts. – Sigur Feb 8 '14 at 13:53
4

beamer offers you this possibility out of the box, using the sectionstyle, subsectionstyle keys for the \tableofcontents.

If you want, at the beginning of each each section, to have a table of contents showing only the current section with its subsections, all you need is

  currentsection,
  sectionstyle=show/hide,
  subsectionstyle=show/show/hide

so, the following lines

\AtBeginSection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
  currentsection,
  sectionstyle=show/hide,
  subsectionstyle=show/show/hide
]
\end{frame}
}

will do exactly what you need. A complete example:

\documentclass{beamer}

\AtBeginSection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
  currentsection,
  sectionstyle=show/hide,
  subsectionstyle=show/show/hide
]
\end{frame}
}

\begin{document}

\section{Test Section One}
\begin{frame} test\end{frame}
\subsection{Test Subsection One One}
\begin{frame} test\end{frame}
\subsection{Test Subsection One Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection One Three}
\begin{frame} test\end{frame}

\section{Test Section Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two One}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two Three}
\begin{frame} test\end{frame}

\section{Test Section Three}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three One}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three Three}
\begin{frame} test\end{frame}

\end{document}

The ToC for the first section:

enter image description here

The ToC for the second section:

enter image description here

The ToC for the third section:

enter image description here

If what you want is to have, at the beginning of each subsection, a ToC showing the current section and subsection and all other subsections for the current section shaded, then the specification would change to

currentsection,
sectionstyle=show/hide,
subsectionstyle=show/shaded/hide

And the ToC will be produced using

\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
  currentsection,
  sectionstyle=show/hide,
  subsectionstyle=show/shaded/hide
]
\end{frame}
}

A complete example:

\documentclass{beamer}

\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
  currentsection,
  sectionstyle=show/hide,
  subsectionstyle=show/shaded/hide
]
\end{frame}
}

\begin{document}

\section{Test Section One}
\begin{frame} test\end{frame}
\subsection{Test Subsection One One}
\begin{frame} test\end{frame}
\subsection{Test Subsection One Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection One Three}
\begin{frame} test\end{frame}

\section{Test Section Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two One}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Two Three}
\begin{frame} test\end{frame}

\section{Test Section Three}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three One}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three Two}
\begin{frame} test\end{frame}
\subsection{Test Subsection Three Three}
\begin{frame} test\end{frame}

\end{document}

An image of the ToC for the second subsection of the first section:

enter image description here

An image of the ToC for the third subsection of the third section:

enter image description here

2

I think this should solve the problem.Have a look at this:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip0.5em}{}{}
\makeatother

\title[Short Title]{My very long title that doesn't fix into the footer}
\author{Me}
\date{\today}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\usetheme{CambridgeUS}

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

\begin{document}

\maketitle
\clearpage

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


\section{Intro}
\begin{frame}
\frametitle{Welcome}
...
\end{frame}

\section{Topic 1}
\begin{frame}
\frametitle{Topic 1}
...
\end{frame}

\section{Topic 2}
\begin{frame}
\frametitle{Topic 2}
...
\end{frame}

\subsection{Red}
\begin{frame}
\frametitle{Red}
...
\end{frame}

\subsection{Green}
\begin{frame}
\frametitle{Green}
...
\end{frame}

\subsection{Blue}
\begin{frame}
\frametitle{Blue}
...
\end{frame}

\section{Topic 3}
\begin{frame}
\frametitle{Topic 3}
...
\end{frame}

\section{Topic 4}
\begin{frame}
\frametitle{Topic 4}
...
\end{frame}

\section{Topic 5}
\begin{frame}
\frametitle{Topic 5}
...
\end{frame}

\section{Topic 6}
\begin{frame}
\frametitle{Topic 6}
...
\end{frame}

\section{Topic 7}
\begin{frame}
\frametitle{Topic 7}
...
\end{frame}

\section{Topic 8}
\begin{frame}
\frametitle{Topic 8}
...
\end{frame}

\section{The end}
\begin{frame}
\frametitle{The end}
End of file :-)
\end{frame}

\end{document}

enter image description here enter image description here

These are sample images of the part of the presentation slides.I hope this is what is required....

1

If you split you document in parts, the contents also will be like.

So, redefining the \section you don't need to insert parts by hand.

\let\oldsection\section
\renewcommand{\section}[1]{\part{}\oldsection{#1}}

Using

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

the result will be like this (note Topic 2):

enter image description here

Full code (copied from @subham soni):

\documentclass{beamer}

\let\oldsection\section
\renewcommand{\section}[1]{\part{}\oldsection{#1}}

\title[Short Title]{My very long title that doesn't fix into the footer}
\author{Me}
\date{\today}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]
\usetheme{CambridgeUS}

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

\begin{document}

\begin{frame}
\maketitle
\end{frame}

\section{Intro}
\begin{frame}
\frametitle{Welcome}
...
\end{frame}

\section{Topic 1}
\begin{frame}
\frametitle{Topic 1}
...
\end{frame}

\section{Topic 2}
\begin{frame}
\frametitle{Topic 2}
...
\end{frame}

\subsection{Red}
\begin{frame}
\frametitle{Red}
...
\end{frame}

\subsection{Green}
\begin{frame}
\frametitle{Green}
...
\end{frame}

\subsection{Blue}
\begin{frame}
\frametitle{Blue}
...
\end{frame}

\section{Topic 3}
\begin{frame}
\frametitle{Topic 3}
...
\end{frame}

\section{Topic 4}
\begin{frame}
\frametitle{Topic 4}
...
\end{frame}

\section{Topic 5}
\begin{frame}
\frametitle{Topic 5}
...
\end{frame}

\section{Topic 6}
\begin{frame}
\frametitle{Topic 6}
...
\end{frame}

\section{Topic 7}
\begin{frame}
\frametitle{Topic 7}
...
\end{frame}

\section{Topic 8}
\begin{frame}
\frametitle{Topic 8}
...
\end{frame}

\section{The end}
\begin{frame}
\frametitle{The end}
End of file :-)
\end{frame}

\end{document}

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.