# Conflict between hyperref and bm

Are there any ways to address the incompatibility below:

\documentclass{report}

\usepackage{hyperref}
\usepackage{bm}

\begin{document}
\section{Boundary conditions $\bm{H_F}$}
This is a test!
\end{document}


I get from TL 2016 and 2017:

! TeX capacity exceeded, sorry [input stack size=5000].


I have seen a few reports of conflicts between hyperref and bm, but they are always in the presence of {etoolbox} and they have been for the most reported as solved some time ago.

etoolbox conflict with bm package

Package incompatibilites: etoolbox, hyperref, and bm, standalone?

The problem is with bookmarks:

\documentclass{report}

\usepackage{bm}
\usepackage{hyperref}

\begin{document}

\section{Boundary conditions \texorpdfstring{$\bm{H_F}$}{H\_F}}

This is a test!

\end{document}


You could also disable \bm in bookmarks, but you'll get a bunch of warnings.

\documentclass{report}

\usepackage{bm}
\usepackage{hyperref}

\pdfstringdefDisableCommands{\let\bm=\relax}

\begin{document}

\section{Boundary conditions $\bm{H_F}$}

This is a test!

\end{document}

• Is this something correctable on {hyperref} or that is kept there intentionally that way? I am just trying to understand the reasons ... – Paulo Ney Mar 31 '18 at 1:54
• @PauloNey There’s no typesetting in the bookmarks; hyperref does its best, but it can’t deal with everything. – egreg Mar 31 '18 at 8:58