# Placing a PDF bookmark to the index page?

Using \usepackage{hyperref}and the \pdfbookmark[0]{...}{...} command you can place a PDF bookmark just before the index page generated with \printindex (Sometimes it will point to the empty page before the index.) How can one place a bookmark exactly to the Index title?

After reading the answers so far, I have to refine the question a bit it seems.

I have now noticed two things that escaped me at first:

• The index is always placed on an odd page. (May be common knowlegde but wasn't for me :-)
• If the even page before the index has text on it, then the bookmark placed before \printindex will point to the index page. If there is an empty (even) page inserted, then the bookmark will point to this empty page instead of the index page.

I also should have provided the construct that places the index in our custom document class:

\AtEndDocument{
\pdfbookmark[0]{\indexname}{bookmarkForTheIndex}
\printindex
}

Note that I found something talking about AtEndDocument and the index, but I fear I do not quite understand it ... http://www.tug.org/TUGboat/Articles/tb19-1/tb58works.pdf

-

\printindex starts a theindex environment, which by default calls \twocolumn, which - and this causes your problem - starts a new page. The following should do the trick:

\cleardoublepage
\pdfbookmark[0]{\indexname}{idx}
\printindex

-
Although I haven't tested it on a MWE, this doesn't work for me. The bookmarks in the toc and the pdf bookmarks both hyperlink to the first entry in the index, not at the \indexname header as it should. Somehow there's some magic tucked within your idxlayout package. I'll have to disassemble it someday. In any event, it works for me. I guess I owe you a good Aussie "thanks mate!" –  Geoffrey Jones Sep 8 '10 at 16:40
Yes, I was afraid that my hack wouldn't get the exact vertical positioning right. But at least the bookmark points to the correct page. –  lockstep Sep 8 '10 at 16:46
Inserting \cleardoublepage (In addition to our AtEndDocument) does indeed do the trick! Now the bookmark will always be placed correctly to the index page, regardless if there's an empty page before. –  Martin Sep 9 '10 at 7:18