Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have been using the Frankfurt theme in Beamer recently. It includes navigational section titles at the top of the slide and when subsections are included, it adds circles below section titles. Each circle represents a slide. The circle representing the active slide is filled and the circles representing the active subsection are shown in bold.

My question is:

  • Is it possible to include navigational circles in a Beamer presentation to represent each slide while having sections, but not subsections?

My motivation:

  • I think this would be useful to highlight to readers the number of slides per section and it would also be a useful navigational tool.
share|improve this question
add comment

3 Answers

up vote 12 down vote accepted

You don't need to declare a subsection, raising it's counter by \setcounter{subsection}{1} or \stepcounter{subsection} would be sufficient.

But as the section counter resets the subsection counter, I would do it in the preamble together with removing it from the reset:

\usepackage{remreset}% tiny package containing just the \@removefromreset command
\makeatletter
\@removefromreset{subsection}{section}
\makeatother
\setcounter{subsection}{1}

This way that counter will stay at the value 1 and the circles are shown without any \subsection.

A minimal working example demonstrating the solution:

\documentclass{beamer}
\usetheme{Frankfurt}
\usepackage{remreset}
\makeatletter
\@removefromreset{subsection}{section}
\makeatother
\setcounter{subsection}{1}
\begin{document}
\section{Test}
\frame{one}
\frame{two}
\frame{three}
\end{document}

Output:

alt text

If you uncomment the command \setcounter{subsection}{1} and compile twice, you could see the original problem of missing circles.

share|improve this answer
    
Thanks for this more permanent solution –  Jeromy Anglim Aug 20 '10 at 12:14
add comment

Here's a solution that doesn't mess around with the subsection numbering, but just patches beamer so that "subsections numbered 0" show their slide entries. Frames immediately below \sections without \subsections get treated as subsection 0 and highlighted in a different group to any actual later \subsections. Therefore, subsections are not needed to get frames to show corresponding the navigation circles, but it doesn't prevent (or rather, obfuscate) subsection use.

Beamer's \slideentry has a test that checks if the current subsection number exceeds zero before it agrees to show the navigation circle; I have just patched that test by replacing it with something that's always true (but still in the if conditional form so it shouldn't break anything).

\usepackage{etoolbox}
\makeatletter
\patchcmd{\slideentry}{\ifnum#2>0}{\ifnum2>0}{}{\@error{unable to patch}}% replace the subsection number test with a test that always returns true
\makeatother

Note that it may also be necessary to do the same for \fakeslideentry (if using multiple parts?). If not using the compress option, it may also be necessary to \advance\beamer@ypos by1\relax before the \fi in the \ifbeamer@compress else clause. However, the above alone "works" in the following example:

\documentclass{beamer}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\slideentry}{\ifnum#2>0}{\ifnum2>0}{}{\@error{unable to patch}}% replace the subsection number test with a test that always returns true
\makeatother

\usetheme{Frankfurt}

% to illustrate the subsection numbering
\setbeamertemplate{subsection in toc}[subsections numbered]

\begin{document}
\frame{\tableofcontents}
\section{Test I}
\frame{one}
\frame{two}
\subsection{A}
\frame{three}
\frame{four}
\subsection{B}
\frame{five}
\section{Test II}
\frame{six}
\subsection{C}
\frame{seven}
\section{Test III}
\frame{eight}
\end{document}

(I realise that this may no longer be useful to the original poster, but it might help someone. This is what I wanted to do but found only this question and its original answers.)

share|improve this answer
1  
See also issue 218 in the beamer issue tracker: miniframes and smoothbars don't show progress markers without subsections –  cyberSingularity Jan 20 '13 at 9:20
add comment

Really? I thought the circles would always be shown, even without declared subsections. That's what the example in the documentation appears to show, and it's the way I seem to remember that theme behaving when I used it in the past. (It was a while ago, perhaps I'm misremembering, and my LaTeX is broken so I can't test)

Anyway, as a quick fix, I suppose you could just declare one nameless subsection per section.

\section{Axxqzropy}
\subsection{}

Maybe define a command for it,

\newcommand*{\ssection}[1]{\section{#1}\subsection{}}

although this is admittedly a hack, not an ideal solution.

share|improve this answer
    
thanks, the subsection hack worked in terms of showing the circles. But it also had the side effect of removing the PDF sidebar navigation. –  Jeromy Anglim Aug 20 '10 at 12:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.