0

as new user, I'm not able to add a comment to the original question/solution.

I refer to the solution of Navigation to section/subsection from Beamer headline titles written by Joseph Wright.

If I use his patch together with something like this

\section{\texorpdfstring{$\operatorname{e}$-Funktion}{e-Funktion}}

I get an error message

Argument of \@gobble has an extra }. ...{$\operatorname{e}$-Funktion}{e-Funktion}}

Without the patch, everything seems to work.

MWE:

\documentclass{beamer}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\beamer@section}
  {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
  {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
  {}{}
\patchcmd{\beamer@subsection}
  {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
  {\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
  {}{}
\makeatother
\usetheme{AnnArbor} 
\begin{document}
\section{\texorpdfstring{$\operatorname{e}$-Funktion}{e-Funktion}}
\begin{frame}{$\operatorname{e}$-Funktion}
  $\operatorname{e}$-Funktion
\end{frame}
\subsection{Subsection 1}
\begin{frame}{Subsection 1}
  Subsection 1 Frame 1
\end{frame}
\begin{frame}{Subsection 1}
  Subsection 1 Frame 2
\end{frame}
\end{document}

1 Answer 1

0

A solution to the problem can be found on texwelt, using \protected@edef instead of \edef

\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usetheme{AnnArbor}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\beamer@section}
  {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
  {\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
  {}{}
\patchcmd{\beamer@subsection}
  {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
  {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
  {}{}
\makeatother

\begin{document}

\section{\texorpdfstring{$\operatorname{e}$-Funktion}{e-Funktion}}
\subsection{Unterthema 1}
\begin{frame}
  Frame 1
\end{frame}
\begin{frame}
  Frame 2
\end{frame}
\begin{frame}
  Frame 3
\end{frame}
\begin{frame}
  Frame 4
\end{frame}
\end{document}

You must log in to answer this question.