37

In a latex-beamer document i added the following TOC-Definition:

\AtBeginSubsection[]
{
   \begin{frame}
        \frametitle{Inhalts\"ubersicht}
        \tableofcontents[currentsection,currentsubsection]
   \end{frame}
}

Which produces a tree like this:

Section1
  SubSection1
Section1
  SubSection2
Section1
  SubSection3
Section2
  SubSection1
Section2
  SubSection2

Instead i would like it to look like this:

Section1
  SubSection1
  SubSection2
  SubSection3
Section2
  SubSection1
  SubSection2

How can i modify the TOC-Tree to make it look like i want?

Solved - MWE:

\tableofcontents[ 
    currentsubsection, 
    hideothersubsections, 
    sectionstyle=show/hide, 
    subsectionstyle=show/shaded, 
    ] 
3
  • 1
    Can you please add to your question a minimal working example (MWE) illustrating the problem? I ask you for this MWE because I did some tests and couln't reproduce the behaviour mentioned; in fact, what I got in my examples was exactly the desired output. Sep 16, 2011 at 13:08
  • For those who wondering : this magic is explained in Beamer's manual, "10.5 Adding a Table of Contents", p. 98 (version 3.36).
    – Clément
    Jan 30, 2017 at 1:56

3 Answers 3

29
\tableofcontents[ 
currentsubsection, 
hideothersubsections, 
sectionstyle=show/hide, 
subsectionstyle=show/shaded, 
] 

does what i want!

0
11

You can use in your preamble

\AtBeginSection[]
{
  \begin{frame}
  \frametitle{Contents}
  \tiny{\tableofcontents[currentsection]}
  \end{frame}
}

Which produces something like that before every section

3
  • 4
    Nice theme, which one is it?
    – ppr
    Jun 26, 2014 at 13:53
  • @ppr looks like a theme used at a specific institution, given the name in the right bottom: el.wikipedia.org/wiki/… Dec 21, 2016 at 15:43
  • 1
    @Thanos, all the subsections are highlighted at the same time, is there a way to highlight only one of the subsection?
    – sunxd
    Nov 5, 2019 at 16:51
9

You can use the following code:

\AtBeginSection[]
{
\begin{frame}<beamer>{Table of Contents}
\tableofcontents[currentsection,currentsubsection, 
    hideothersubsections, 
    sectionstyle=show/shaded,
]
\end{frame}
}
0

You must log in to answer this question.

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