16

I'm working with the Marburg theme with beamer, and I would like to customize its Sidebar so that the title & author of the presentation does not show up, and I want the sections in the Sidebar to be numbered.

Desired output:

before_and_after

Example:

\documentclass{beamer}
\usetheme{Marburg}


\title{Some title}
\author{author}
\institute{my workplace}
\date{\today}

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section[Outline]{}
\frame{\tableofcontents}

\section{Introdution}

\begin{frame}
\frametitle{Basics}
\begin{itemize}
\item A
\pause
\item B
\pause
\item C
\end{itemize}
\end{frame}

\subsection{More basics}

\begin{frame}
\frametitle{something goes here}
more stuff
\end{frame}

\section{My work}

\begin{frame}
my stuff...
\end{frame}

\end{document}

Thanks!

1
  • 3
    I found out that I can use \title[]{Some title} and \author[]{author} into tricking LaTex to think that the short title/author is the empty string as represented by []. Now what about the numbered sidebar items? Mar 6, 2012 at 1:03

2 Answers 2

14

The following code contains the necessary redefinitions:

\documentclass{beamer}
\usetheme{Marburg}

\makeatletter
  \setbeamertemplate{sidebar \beamer@sidebarside}
  {
    \beamer@tempdim=\beamer@sidebarwidth%
    \advance\beamer@tempdim by -6pt%
    \vskip4em%
    \insertverticalnavigation{\beamer@sidebarwidth}%
    \vfill
    \ifx\beamer@sidebarside\beamer@lefttext%
    \else%
      \usebeamercolor{normal text}%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt%
    \fi%
  }%

  \ifx\beamer@sidebarside\beamer@lefttext%
    \defbeamertemplate*{sidebar right}{sidebar theme}
    {%
      \vfill%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt}
  \fi

\setbeamertemplate{section in sidebar}%{sidebar theme}
{%
  \vbox{%
    \vskip1ex%
    \beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionheadnumber
~\insertsectionhead}%
  }%
}
\setbeamertemplate{section in sidebar shaded}%{sidebar theme}
{%
  \vbox{%
    \vskip1ex%
    \beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionheadnumber
~\insertsectionhead}%
  }%
}
\makeatother

\title{Some title}
\author{author}
\institute{my workplace}
\date{\today}

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section[Outline]{First Section}
\frame{\tableofcontents}

\section{Introduction}

\begin{frame}
\frametitle{Basics}
\begin{itemize}
\item A
\pause
\item B
\pause
\item C
\end{itemize}
\end{frame}

\subsection{More basics}

\begin{frame}
\frametitle{something goes here}
more stuff
\end{frame}

\section{My work}

\begin{frame}
my stuff...
\end{frame}

\end{document}

An image of the first slide:

enter image description here

4
  • By the way, the code \usetheme[hideothersubsections]{Marburg} can also be used so that the sidebar shows subsections only for the section the slide is currently in. Mar 6, 2012 at 2:40
  • @GonzaloMedina Thanks for your example code. I saw that the numbers aren't aligned left like in a toc. Can you pls add an example where the numbers are aligned like in a toc? I uploaded an example by beamer founder where it becomes clearer: abload.de/img/sidebar_beamer_ttbguj8.jpg Thanks!
    – user49121
    Aug 18, 2015 at 18:24
  • 1
    @TimS. Feel free to open a follow-up question. Aug 18, 2015 at 18:27
  • @GonzaloMedina I've posted a question here: tex.stackexchange.com/questions/262022/…
    – user49121
    Aug 18, 2015 at 18:44
5

To summarize:

(i) use \title[]{Some title} and \author[]{author} into tricking LaTeX to think that the short title/author is the empty string as represented by [].

(ii) use Gonzalo Medina's excellent solution to print out the numbered items.

2
  • 2
    My solution also takes care of the author/title issue: you can still use a non-empty optional argument and no information will be added to the sidebar. Mar 6, 2012 at 2:21
  • @Gonzalo Medina Absolutely. It's really a neat, all-in-one-place solution. I just want to point out that if someone else needs only to omit the author/title in the sidebar, there is a simple way using the blank brackets []. Thank you. Mar 6, 2012 at 3:12

You must log in to answer this question.

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