1

How to set a TOC in which only appears sections without subsections?

EDIT: And on the beginning of a new section it shows only the content of it without displaying the header?

MWE:

\documentclass{beamer}
\usetheme{CambridgeUS}
\useoutertheme{infolines}
\author{Co.}
\title{Work Culture}
\AtBeginSubsection[]
{
\begin{frame}<beamer>
\frametitle{Outline}
\tableofcontents[
  currentsection
]
\end{frame}
}
\begin{document}
\begin{frame}{Plan}
  \tableofcontents
\end{frame}
\begin{frame}
\titlepage
\end{frame}
\end{document}

Any good suggestion, please?

Thanks a lot!

dgs
  • 1,637
  • \setcounter{tocdepth}{1}? – Werner May 02 '14 at 22:42
  • By the way, your example doesn't contain a \tableofcontents, nor any \sections or \subsections, which isn't helpful. – Werner May 02 '14 at 22:42
  • @Werner, I've updated my post. That've worked, but, what about the second question? – dgs May 02 '14 at 22:45
  • Are you referring to the general ToC or to the partial ToCs produced with \AtBeginSubsection? – Gonzalo Medina May 02 '14 at 22:47
  • @GonzaloMedina, to the partial ToCs. – dgs May 02 '14 at 22:48
  • Another question. What do you mean "it shows only the content of it without displaying the header?" Which header? What is "the content of it"? – Gonzalo Medina May 02 '14 at 22:49
  • @GonzaloMedina, the header of each page contains sections and subsections, like this. So, the partial Toc needs to display the current section and its subsections. – dgs May 02 '14 at 22:51
  • @dgs: Please put some thought into your question rather than making the community guess what you're after. A clear, thought-out minimal working example (MWE) that highlights your current problems would really be beneficial to the community. – Werner May 02 '14 at 22:51
  • @Werner, sorry but I'm trying my best. I'm beginner on this, I can not see clearly notions. – dgs May 02 '14 at 22:52
  • @dgs: That's when images come in handy. Compile some of your code, take a screen grab and draw it full of arrows and pointers to highlight what is going on and what should be going on instead. – Werner May 02 '14 at 22:53
  • Now I am confused. in your question you said "How to set a TOC in which only appears sections without subsections?" and in a comment "the partial Toc needs to display the current section and its subsections." Do you want subsections in the partial ToCs or not? – Gonzalo Medina May 02 '14 at 22:55
  • @GonzaloMedina, The first question is for the general ToC which appears on after of the title page. And the second one is for the partial ToC which appears before each new reached section. – dgs May 02 '14 at 22:57
  • @dgs I provided an answer below. Is it something like that what you need? – Gonzalo Medina May 02 '14 at 23:15

1 Answers1

3

If I understood the question correctly, then the following settings will do what you want.

Using

\tableofcontents[hideallsubsections]

the general ToC shows only the section entries. The settings

\AtBeginSection[]
{
  \begingroup
  \setbeamertemplate{headline}{}
  \addtobeamertemplate{frametitle}{\vskip-1.75ex}{}
  \begin{frame}<beamer>
  \frametitle{Outline}
  \tableofcontents[sectionstyle=show/hide,subsectionstyle=show/show/hide]
  \end{frame}
  \endgroup
}

will make the partial ToCs (at the beginning of each section) show only the current section and its subsection; the headline is locally suppressed for the partial ToCs and the frametitle is shifted vertically so it starts at the top of the frame.

A complete example:

\documentclass{beamer}
\usetheme{CambridgeUS}
\useoutertheme{infolines}
\author{Co.}
\title{Work Culture}
\AtBeginSection[]
{
  \begingroup
  \setbeamertemplate{headline}{}
  \addtobeamertemplate{frametitle}{\vskip-1.75ex}{}
  \begin{frame}<beamer>
  \frametitle{Outline}
  \tableofcontents[sectionstyle=show/hide,subsectionstyle=show/show/hide]
  \end{frame}
  \endgroup
}
\begin{document}

\begin{frame}
\frametitle{General Outline}
\tableofcontents[hideallsubsections]
\end{frame}

\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 general ToC:

enter image description here

An image of one of the partial ToCs (the one at the beginning of the second section):

enter image description here

Gonzalo Medina
  • 505,128