Page LayoutWrong Page Number in Bookmarks

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
skwateur
Posts: 14
Joined: Thu Jun 21, 2012 9:24 pm

Wrong Page Number in Bookmarks

Post by skwateur »

Hi everyone,

I'm having an issue with my bookmark. I have been trying to solve the whole afternoon but it still doesn't work.

The problem is that I have the wrong page number in my bookmark. the page number in the footer and header are right.

here is the page numbers I got : i, ii, ii, v, v, vi, vii,
and what I want is : i, ii, iii, iv, v, vi, vii

hope you can help me :)

thanks a lot

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

skwateur
Posts: 14
Joined: Thu Jun 21, 2012 9:24 pm

Wrong Page Number in Bookmarks

Post by skwateur »

solved, finally !

for those who might be interested :

Code: Select all

\providecommand\phantomsection{}

\phantomsection
\addcontentsline
did the work.
:)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Wrong Page Number in Bookmarks

Post by localghost »

It would be much more helpful if you post a complete solution reduced to only relevant code. These code snippets are not very useful.


Best regards and welcome to the board
Thorsten
skwateur
Posts: 14
Joined: Thu Jun 21, 2012 9:24 pm

Re: Wrong Page Number in Bookmarks

Post by skwateur »

Sure. I'll do it tomorrow ! Need to sleep now lol
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Wrong Page Number in Bookmarks

Post by Stefan Kottwitz »

I'm curious. ;)

\clearpage (if meaningful) and \phantomsection (for setting an anchor) can be good before using \addcontentsline. I assume you call

Code: Select all

\providecommand\phantomsection{}
to ensure that \phantomsection is also defined if you don't use hyperref (which defines it). As you use hyperref to get bookmarks, for sure, you actually don't need it.

Stefan
LaTeX.org admin
Post Reply