12

I'm using mhchem for chemical formulas. In the body of the text it is fine, but it is given me nasty outputs for the titles on the index of my pdf reader. I have tried different ones and the result comes to be the same. Instead of \ce{IrO2} it appears 3222378.

Has someone encountered a similar problem?

Mensch
  • 65,388
ziulfer
  • 333
  • It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. – Peter Grill Oct 11 '12 at 18:02

1 Answers1

13

The problem is that bookmarks can't handle things like math, colors, or font changes. You can use \texorpdfstring; the first argument will be used in the document and the second one will be used in the bookmarks:

\documentclass{article}
\usepackage{mhchem}
\usepackage{hyperref}

\begin{document}

\section{\texorpdfstring{\ce{IrO2}}{Ir02}}

\end{document}
Gonzalo Medina
  • 505,128