I am adding entries to bookmarks and I want one entry to point to a specific page. However, I don't want to provide it's number, because it may change depending on contents modification before that page. The command to add an entry using the bookmark package is:


where X is the page number. How can I determine at compile time the current page number to replace X with it? I've tried using \thepage in X's place but it didn't work. In the package documentation I found out there are named actions to PrevPage, NextPage, FirstPage and LastPage but there is no CurrentPage. How to fix this?


4 Answers 4


Set a target on the page:


\bookmark[dest=mypage]{go to my page!}

page 1\newpage page 2 \newpage my page \hypertarget{mypage}{}
\newpage next page

  • @Ulrike Thanks!!! They should add one example of use of hypertarget in the documentation!
    – Weslei
    Commented Feb 24, 2011 at 17:46
  • 1
    There is an example. And in my version line 23 says \hypertarget{fig}{}. Commented Feb 24, 2011 at 17:55
  • @Ulrike Sorry, I didn't figure it out when I read that example...
    – Weslei
    Commented Feb 24, 2011 at 17:57
  • 2
    Wouldn't this jump directly to the position of the hypertarget and not to the page in general, i.e. make a difference in the zoom level, etc.? Commented Feb 24, 2011 at 18:43
  • @Martin Yes, but as every bookmark node jumps direct to the section title and not to the beggining of the page, I thought it was reasonable to let this way here too.
    – Weslei
    Commented Feb 24, 2011 at 18:46

Here a solution how to add bookmarks to the current page using absolute page numbers provided by the zref package(s).

I actually needed this now for my thesis myself. There I want a PDF bookmark on e.g. the bibliography page (really the page, not the headline etc.).




\pagebookmark[<options>]{<page label>}{<bookmark text>}


My bibLaTeX bibliography is printed and bookmarked using the following code:


The \clearpage ensures that the correct page is bookmarked.

  • 1
    If the page counter is never reset you can also use \bookmark[page=\value{page}]{...} direct after a \clearpage where page should have the correct value. This worked for me well for the frontmatter, but not after page got reset for the mainmatter. Also \bookmark[page=\numexpr\value{abspage}+1\relax] (zref-abspage package) works well after a \clearpage but the above solution is much more secure. Commented Jun 16, 2011 at 11:35

With the pageslts package, it is possible to say


even if \pagenumbering{roman}\addtocounter{page}{42} was used.


You can get page numbers using refcount package.

  • 1
    This won't work for the mentioned case in the question. If the page number is in roman it will return the roman page number, and what is needed for the bookmark is the real page number of the document, for instance, it should use the number 3 even if the third page of the document is in frontmatter using roman page numbering - iii or similar.
    – Weslei
    Commented Feb 24, 2011 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .