Skip to main content
Share Your Experience: Take the 2024 Developer Survey
19 votes
Accepted

Table of Contents links to wrong pages + Wrong header name

You have to use \phantomsection before \addcontentsline: \documentclass[12pt]{book} %%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Additional packages %% %%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{a4wide}% really ...
esdd's user avatar
  • 85.9k
15 votes
Accepted

Umlauts in PDF bookmarks printed wrong by hyperref

Solution Use \usepackage[pdfencoding=auto]{hyperref} in your preamble. MWE \documentclass{scrreprt} \usepackage{fontspec} \usepackage[pdfencoding=auto]{hyperref} \begin{document} \chapter{Test Ü}...
Andreas Schneider's user avatar
15 votes
Accepted

What TeXBook version has built-in bookmarks?

That is not CTAN and the pdf copy is illegal. As Knuth says on his webpage The source file texbook.tex for The TeXbook has been available for many years, and it begins with the following lines: ...
Caz Sandison's user avatar
12 votes
Accepted

Pdfbookmark for abstract and table of contents (toc)

The last argument of \pdfbookmark becomes the main part of the intern anchor name for the bookmark. The two invocations of \pdfbookmark use both toc with the same level. Therefore the document has two ...
Heiko Oberdiek's user avatar
11 votes
Accepted

How do I create bookmarks with pdfLaTeX?

By default, bookmarks replicate the table of contents. So if your ToC shows content up to \section, so will the bookmarks. The default level up to which content is shown in the ToC is 2 - equivalent ...
Werner's user avatar
  • 605k
11 votes
Accepted

Get math to show up in PDF bookmarks

The math engine and different fonts are not possible in bookmarks. They are plain simple strings, but at least, they can be given in Unicode. The latter can be enabled by option unicode (or ...
Heiko Oberdiek's user avatar
10 votes

Hyperref package (token not allowed in a PDF string)

\uppercase is a non-expandable command. Therefore, it must be called/executed to do its job, in TeX speech, the place is the stomach. Bookmarks, however, are generated in an expandable context, TeX's ...
Heiko Oberdiek's user avatar
10 votes
Accepted

Understanding `\pdfbookmark`

\pdfbookmark it is a hyperref command. The definition in hyperref.sty is a dummy, the real definitions are in the various backend files, e.g. hpdftex.def (for pdflatex) contains \renewcommand\...
Ulrike Fischer's user avatar
9 votes
Accepted

How to properly add \section*{} to PDF bookmarks?

The last mandatory argument of \pdfbookmark must be a unique name. It is used for the internally created anchor: \documentclass{article} \usepackage[hidelinks,bookmarks=true]{hyperref} \usepackage[...
Heiko Oberdiek's user avatar
7 votes

Prevent PDF bookmark entry

You can globally turn off bookmarks with \usepackage[bookmarks=false]{hyperref} in the preamble. To turn it off temporarily, see: How to temporarily disable PDF bookmarking ? Code from there: \...
nox's user avatar
  • 4,170
7 votes

Reusing TOC vs bookmarks

You can set bookmarksdepth individually, then it will work: \documentclass{memoir} \usepackage[utf8]{inputenc} \usepackage[ bookmarks=true, bookmarksnumbered, colorlinks, bookmarksdepth=10 %<------...
Ulrike Fischer's user avatar
6 votes
Accepted

Make chapter appear in table of contents

Here, I use standard features of the tocloft package. Note, however, that page 10 of the tocloft documentation indicates that \cftpartaftersnum DOES NOT WORK for the standard document classes. Thus, ...
Steven B. Segletes's user avatar
6 votes
Accepted

How to create child PDF bookmarks in index for each index letter

Example file: \RequirePackage{filecontents} % File \jobname.mst is overwritten, if package filecontents is loaded! \begin{filecontents*}{\jobname.mst} headings_flag 1 heading_prefix "\\IndexHeading{" ...
Heiko Oberdiek's user avatar
6 votes
Accepted

Reference (\cite) in the title of a subsection and in pdf bookmark (hyperref) using bibtex instead of biblatex

There are a couple of issues here. The first is solved in the linked post by Ulrike Fischer but using biblatex by patching the \bibitem commands to produce a \label that can be referenced. This can ...
Andrew Swann's user avatar
6 votes
Accepted

How to remove Font Awesome symbol code from bookmarks?

hyperref provides the \pdfstringdefDisableCommands, which is a hook to execute commands before hyperref tries to translate TeX code into pdf strings. The argument of \pdfstringdefDisableCommands is ...
Phelype Oleinik's user avatar
6 votes

siunitx redefines macros in pdf bookmarks

\documentclass{article} \usepackage{hyperref} \usepackage{siunitx} \AtBeginDocument {\pdfstringdefDisableCommands{\def\as{foo}}} \begin{document} \def\as{foo} \section{\as} \end{document}
Ulrike Fischer's user avatar
6 votes
Accepted

Why does adding \cprotect\section{} cause bookmarks in PDF to get corrupted? Lots of hyperref removing `\@ifnextchar' messages

I think that using \cprotect in the current context constitutes a pretty severe abuse of the macro. Moreover, as you've discovered, it doesn't work properly since the bookmarks for the pdf viewer ...
Mico's user avatar
  • 511k
6 votes

Why does adding \cprotect\section{} cause bookmarks in PDF to get corrupted? Lots of hyperref removing `\@ifnextchar' messages

The issue doesn't depend on the particular fonts, but on unicode-math. Using \cprotect is not the solution: you have nothing verbatim in the titles. You can incrementally collect the “problematic” ...
egreg's user avatar
  • 1.1m
6 votes
Accepted

Group chapter bookmarks into separate added bookmark

With a current hyperref you can do this (inputenc is no longer needed in a current latex, utf8 is the default since a few years anyway): \documentclass{book} \usepackage[hidelinks, bookmarksopen=false]...
Ulrike Fischer's user avatar
5 votes
Accepted

hyperref/bookmark package: suppress/override a single bookmark

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 ...
Heiko Oberdiek's user avatar
5 votes

References in bookmarks

According to "Tame the BeaST - The B to X of BibTEX" page 4 footnote 3: In order to cleanly insert the bibliography in your table of contents, use the tocbibind.sty package. Other methods ...
XMJ's user avatar
  • 51
5 votes
Accepted

Can bookmarks be indexed pointing to particular pages inserted using `\includepdf`?

You are right, there's no addtoindex option in pdfpages. And actually I'm quite astonished that there isn't. Probably because no one ever asked for this feature. Anyway,it's possible to use the ...
Andreas Matthias's user avatar
5 votes
Accepted

Reference (\cite) in pdf bookmark

Assuming that you are printing the bibliography you can add labels and then use \ref in the chapter titles: \documentclass{scrreprt} \usepackage{hyperref} \usepackage{bookmark} \usepackage[style=...
Ulrike Fischer's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible