2

My presentation has subsubsections, and I'd like to add the subsection name to the navigation bar so that it would read something like

Introduction: Uncertain Optimization

as opposed to just

Introduction

in the below example. How might I do this? Thanks!

enter image description here


MWE:

\documentclass[9pt, notes]{beamer}
\usetheme{Frankfurt} % nice bullets at top
\usepackage{amsmath,amssymb,amsthm,minted,float,multicol,mathtools,dsfont,hyperref,rotating,cleveref,bm,tikz,algorithm,algpseudocode,xcolor,vwcol}

% -------------------------------------------
% modifications
% -------------------------------------------
\setbeamertemplate{footline}[frame number]{} % gets rid of bottom navigation bars
\usecolortheme{rose} % lighten the headers
% \definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
% \setbeamercolor{alerted text}{fg=UBCblue}

% -------------------------------------------
% setup
% -------------------------------------------
\title{A Title}
\subtitle{some subtitle}
\author{Some One}%\inst{1}}
\institute{Some Where \\ Department }
\date{May 27, 2018}
\subject{MWE}

% ToC command
\AtBeginSubsection[]
{
  \begin{frame}<beamer>{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

% ===========================================
% content
% ===========================================
\begin{document}
\begin{frame}[plain]
  \titlepage
\end{frame}

% ===========================================
\section{Introduction}
% ===========================================

% -------------------------------------------
\subsection{Motivation}
% -------------------------------------------
\begin{frame}
  p1
\end{frame}

% -------------------------------------------
\subsubsection{Point 1}
% -------------------------------------------
\begin{frame}
  p2
\end{frame}
\begin{frame}
  p3
\end{frame}

\end{document}
  • 1
    Which code do you have so far? Please show an MWE! – Mensch May 27 '18 at 16:41
  • I just am using \usetheme{Frankfurt}. I don't know how to access the header – rrrrr May 27 '18 at 16:43
  • 1
    Please make a minimal working example (MWE) so that we have something to start with. – user36296 May 27 '18 at 18:29
1

The following code adds the subsection title to the section entry. You'll have to make sure that there are no frames outside subsections.

Some other comments:

  • float and multicol don't make much sense with beamer

  • you also don't need hyperref and xcolor, as beamer already provides this functionality


\documentclass[9pt, notes]{beamer}
\usetheme{Frankfurt} % nice bullets at top
\usepackage{amsmath,amssymb,amsthm,
%minted,
%float,
%multicol,
mathtools,dsfont,
%hyperref,
rotating,cleveref,bm,tikz,algorithm,algpseudocode,
%xcolor,
vwcol}

% -------------------------------------------
% modifications
% -------------------------------------------
\setbeamertemplate{footline}[frame number]{} % gets rid of bottom navigation bars
\usecolortheme{rose} % lighten the headers
% \definecolor{UBCblue}{rgb}{0.04706, 0.13725, 0.26667}
% \setbeamercolor{alerted text}{fg=UBCblue}

% -------------------------------------------
% setup
% -------------------------------------------
\title{A Title}
\subtitle{some subtitle}
\author{Some One}%\inst{1}}
\institute{Some Where \\ Department }
\date{May 27, 2018}
\subject{MWE}

% ToC command
\AtBeginSubsection[]
{
  \begin{frame}<beamer>{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


\makeatletter
\def\sectionentry#1#2#3#4#5{% section number, section title, page
  \beamer@xpos=0\relax%
  \beamer@ypos=1\relax%
  \beamer@ypos@offset=0\relax%
  \ifnum#5=\c@part%
  \beamer@section@set@min@width%
  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
  \setbox\beamer@sectionbox=
  \hbox{\def\insertsectionhead{#2}%
    \def\insertsectionheadnumber{#1}%
    \def\insertpartheadnumber{#5}%
    {%
      \usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
      \ifnum\c@section=#1%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
        :~\insertsubsectionhead%
      \else%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
      \fi}%
  }%
  \ht\beamer@sectionbox=1.875ex%
  \dp\beamer@sectionbox=0.75ex%
  \fi\ignorespaces} 
\makeatother


% ===========================================
% content
% ===========================================
\begin{document}
\begin{frame}[plain]
  \titlepage
\end{frame}

% ===========================================
\section{Introduction}
% ===========================================

% -------------------------------------------
\subsection{Motivation}
% -------------------------------------------
\begin{frame}
  p1
\end{frame}

% -------------------------------------------
\subsection{Something else}
% -------------------------------------------
\begin{frame}
  p1
\end{frame}


% -------------------------------------------
\subsubsection{Point 1}
% -------------------------------------------
\begin{frame}
  p2
\end{frame}
\begin{frame}
  p3
\end{frame}

\end{document}

enter image description here


For ancient beamer versions (version 3.36) try the following definition instead:

\makeatletter
\def\sectionentry#1#2#3#4#5{% section number, section title, page
  \ifnum#5=\c@part%
  \beamer@section@set@min@width
  \box\beamer@sectionbox\hskip1.875ex plus 1fill%
  \beamer@xpos=0\relax%
  \beamer@ypos=1\relax%
  \setbox\beamer@sectionbox=
  \hbox{\def\insertsectionhead{#2}%
    \def\insertsectionheadnumber{#1}%
    \def\insertpartheadnumber{#5}%
    {%
      \usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
      \ifnum\c@section=#1%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
        :~\insertsubsectionhead%
      \else%
        \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
      \fi}%
  }%
  \ht\beamer@sectionbox=1.875ex%
  \dp\beamer@sectionbox=0.75ex%
  \fi\ignorespaces}  
\makeatother
  • Thanks! I'm getting a compile error: Undefined control sequence. \sectionentry ...pos =1\relax \beamer@ypos@offset =0\relax \ifnum #5=\c@part... l.73 \begin{document} right at the \begin{document}. Any advice on troubleshooting? – rrrrr May 27 '18 at 19:28
  • @rrrrr with the exact same code from my answer or in your real document? – user36296 May 27 '18 at 19:31
  • Your code which I just copy/pasted into Overleaf. Here's the link – rrrrr May 27 '18 at 19:32
  • @rrrrr Which version of beamer do you use? – user36296 May 27 '18 at 19:34
  • 1
    @rrrrr Wow, this is really old, not surprising it throws errors – user36296 May 27 '18 at 19:40

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.