Überarbeitungsverlauf[Zurück]
Klicke auf Einblenden/Ausblenden von Überarbeitungen 5

08 Sep '15, 11:03

saputello's gravatar image

saputello
11.1k174365

Die Lösung, die @tom75 angegeben hat, lässt sich durch ein gezieltes `\unexpanded` so erweitern, dass `\texorpdfstring` `\operatorname` im Argument von `\section` (ggf. zusammen mit `\texorpdfstring`) wieder funktioniert: \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}}} {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}} {}{} \patchcmd{\beamer@subsection} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#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} Der Vorteil dabei ist, dass dann auch komplexere Dinge wie `\texorpdfstring{$\sqrt{e}$-Funktion}{Wurzel-e-Funktion}` verwendet werden können. Ein ähnliches Ergebnis kann man auch mit `\protected@edef` statt `\edef` erzielen. \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} Bei dieser Lösung muss man ggf. einzelne zerbrechliche Anweisungen selbst mit `\protect` schützen. Im gezeigten Beispiel ist ein explizites `\protect` jedoch nicht erforderlich, da viele Mathe-Befehle wie auch `\operatorname` oder `\sqrt` so definiert sind, dass sie quasi das `\protect` selbst mitbringen.
Klicke auf Einblenden/Ausblenden von Überarbeitungen 4

08 Sep '15, 10:32

saputello's gravatar image

saputello
11.1k174365

Die Lösung, die @tom75 angegeben hat, lässt sich durch ein gezieltes `\unexpanded` so erweitern, dass `\texorpdfstring` im Argument von `\section` wieder funktioniert: \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}}} {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}} {}{} \patchcmd{\beamer@subsection} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#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} Der Vorteil dabei ist, dass dann auch komplexere Dinge wie `\texorpdfstring{$\sqrt{e}$-Funktion}{Wurzel-e-Funktion}` verwendet werden können. Ein ähnliches Ergebnis kann man auch mit `\protected@edef` statt `\edef` erzielen. \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} Bei dieser Lösung muss man ggf. einzelne zerbrechliche Anweisungen selbst mit `\protect` schützen. Im gezeigten Beispiel ist ein explizites `\protect` jedoch nicht erforderlich. erforderlich, da viele Mathe-Befehle wie auch `\operatorname` oder `\sqrt` so definiert sind, dass sie quasi das `\protect` selbst mitbringen.
Klicke auf Einblenden/Ausblenden von Überarbeitungen 3

08 Sep '15, 10:24

saputello's gravatar image

saputello
11.1k174365

Klicke auf Einblenden/Ausblenden von Überarbeitungen 2

08 Sep '15, 09:37

saputello's gravatar image

saputello
11.1k174365

Klicke auf Einblenden/Ausblenden von Überarbeitungen 1

08 Sep '15, 09:33

saputello's gravatar image

saputello
11.1k174365