2

Forgive me if this is answered elsewhere, but my searches are failing me.

I am using section headings in beamer and want to include bold math variables in the heading. This throws an error that I have not been able to fix. A minimal example follows. I am using a relatively fresh install of TeXShop (v. 4.44) on macOS.

\documentclass{beamer}  
\usetheme{default}

\usepackage{bm}

\begin{document}

\begin{frame}
\tableofcontents
\end{frame}

\section{Test $\bm{v}$} % Does not work
%\section{Test}  % Works

\begin{frame}
Test
\end{frame}

\end{document}

The error I get:

./mwe.tex:12: Forbidden control sequence found while scanning use of \PD1\v.

It is successful if I use \vec{} or \textbf{} instead of \bm{}. Any assistance would be greatly appreciated.

Stefan Pinnow
  • 29,535
brandon
  • 21
  • 2
    Seems to be a hyperref issue, try \texorpdfstring{$\bm{v}$}{v} you might want to open an issue on the beamer bug tracker (I think it is hyperref related but probably best to start with beamer) – daleif Dec 18 '19 at 09:43
  • @daleif it fails with article too (if you load hyperref). So I think one can let beamer of the hook. – Ulrike Fischer Dec 18 '19 at 10:23
  • See https://tex.stackexchange.com/a/424084/2388 – Ulrike Fischer Dec 18 '19 at 10:24
  • @UlrikeFischer but with a completely different message. Article (bm loadded before hyperref) gives TeX capacity exceeded, sorry, and the MWE Runaway argument? ! Forbidden control sequence found while scanning use of \PD1\v – daleif Dec 18 '19 at 10:47
  • 1
    @daleif yes, but the source of the problem is the same. – Ulrike Fischer Dec 18 '19 at 10:57

1 Answers1

1

Based on @Ulrike comments:

\documentclass{beamer}
\usepackage{bm}

\begin{document}
\section{Boundary conditions \texorpdfstring{$\bm{v}$}{v}}
\begin{frame}
\tableofcontents
\end{frame}
\end{document}

enter image description here

Zarko
  • 296,517