2

So I am using hyperref to generate pdf bookmarks but one of my section names uses greek letters, which disappears in the pdf bookmark. So I want to override that bookmark (and only that bookmark).

MWE

\documentclass[12pt]{article}
\usepackage[bookmarksnumbered]{hyperref}

\begin{document}
\tableofcontents
\section{Theorem of $\alpha$ something}
\end{document}

I want the section title to still appear as greek letter in the toc and body, but redefine the bookmark to Theorem of alpha something. Using

\currentpdfbookmark{\thesection\ Theorem of alpha something}{}

simply creates another bookmark, not replace the existing one

3

Greek letters can also be used in bookmarks:

  • Unicode encoding is needed, because the 8-bit PDFDocEncoding does not contain all letter and symbols. This can be achieved by option unicode or pdfencoding=auto.

  • Option psdextra redefines lots of math symbol commands to work within bookmarks.

Example:

\documentclass[12pt]{article}
\usepackage[
  bookmarksnumbered,
  pdfencoding=auto,
  psdextra,
]{hyperref}

\begin{document}
\tableofcontents
\section{Theorem of $\alpha$ something}
\end{document}

An alternative is the use of \texorpdfstring. The first argument is the normal text, the second the replacement for the bookmarks:

\section{Theorem of \texorpdfstring{$\alpha$}{\textalpha}}

This gets also rid of the warnings about the dollars, which enable and disable math mode – bookmarks do not know about TeX's math mode.

  • Thanks, that is quick. And I totally dodged the XY problem. – TwiNight Apr 30 '16 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.