Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Can hyperref make anchors with arbitrary name? After \currentpdfbookmark{\contentsname}{toc} \tableofcontents I got PDF that can be linked like http://some.where/filename.pdf#nameddest=toc.1. However, ".1" feels unnecessary.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

To cite the hyperref manual: "As name for the internal anchor name is used (in conjunction with level)." So the .1 is the level of the bookmark. Reading through the source of hyperref and bookmark this behaviour is hard coded.

In principle you could get rid of the level in the label with

\makeatletter
\renewcommand\pdfbookmark[3][0]{%
  \Hy@writebookmark{}{#2}{#3}{#1}{toc}%
  \hyper@anchorstart{#3}\hyper@anchorend
}
\makeatother

but I doubt this is a good idea.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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