add tag
I have been working on a document which has math in section titles. For example:
\section{$a + b = c$}
If I compile the document using the *hyperref* package, I get warnings that look like this:
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `math shift' on input line 1310.

I have learned from [this Stack Exchange answer]( that the way to get around these warnings is to use the `\texorpdfstring{}{}` command (which is part of the *hyperref* package):
\section{\texorpdfstring{$a + b = c$}{sometext}}
Although this command works, I am confused what the function of the second argument is. The [hyperref documentation]( says it is a "PDFstring", but I still don't understand.

**What is the second argument to \texorpdfstring and how can I use it?**
Top Answer
Joseph Wright
The first argument is used by TeX for typesetting, the second is used in the PDF for e.g. TOC entries. In particular, the second argument needs to expand to 'text', which is normally handled by it simply _being_ text.

For example, with my `siunitx` package, one might want to pus some units into a heading and have them appear in the TOC

\section{Speed in \texorpdfstring{\unit{\metre\per\second}}{m/s}}

(`siunitx` does that internally to avoid warnings, but done 'by hand' you get control of what the 'PDF String' version is.)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.