Keep math in LaTeX headings and readable PDF bookmarks
A LaTeX section title can travel through two different paths. TeX typesets the title on the page. Hyperref also uses it for an outline label in the PDF. A math command in a section title can render as expected on the page while a symbol disappears from the outline.
Give a range in the PDF outline a clear label
Input
\section{Estimates when $\lambda\geq 1$}Output
\section{Estimates when \texorpdfstring{$\lambda\geq 1$}{lambda at least 1}}The two arguments have different jobs. TeX still receives the original math in the first argument. Hyperref uses the second argument as plain text for the PDF bookmark. Change a suggested label to match how readers talk about the expression.
Check the result
- Compile the updated source with hyperref loaded, as you normally do for the project. Rerun the compiler until the outline and table of contents have updated.
- Open the PDF outline and check the new label. Check the same heading on the page to verify that its mathematical notation is still there.
- Use words or a simple symbol that your PDF readers can display. The same label may be shown in different fonts by different PDF readers.
- If your heading supplies a short title in square brackets, review that short title in the generated PDF. Hyperref normally uses it for the bookmark.
Common problems
A custom macro needs a label
TeX macros can carry meanings defined elsewhere in your project. The tool leaves their proposed labels blank for you to fill in. It does not expand project macros.
Use Unicode bookmarks for symbols
The TEX export writes non-ASCII bookmark characters using hyperref's unichar command. Older projects with PDFDocEncoding selected can switch to hyperref's unicode option or choose a label made of ASCII words.
Inspect the source file that owns the heading
This tool scans the supplied file. It does not follow input or include commands. Apply the same process separately to chapter files if needed.
Manual bookmarks may need a separate edit
Unnumbered headings, custom section commands and explicit PDF bookmark commands are outside this scan. Existing texorpdfstring arguments are left as written.
Using LaTeX Bookmark Math
Open the TEX source
Use the file that contains your section commands.
Review the math found in titles
Accept the suggested symbol or type the label that makes sense for your readers.
Recompile with hyperref
Use the updated TEX file and inspect the bookmark pane of the generated PDF.
Offline use
Open the tool once online and let it finish loading. Use the install option in your browser or Add to Home Screen on iPhone. Reopen the tool to process a new input offline.