2

I have a \pageref pointing to a label for a \part (\label{part:publications}), but the number, that pageref spits out is off-by-one.

If I have the following:

Page: \pageref{part:publications}
...
\part{Publications}
\label{part:publications}

I get e.g. Page: 23, but if I do:

Page: \pageref{part:publications}
...
\label{part:publications}
\part{Publications}

I get Page: 25.

What I really want is Page: 24, which is the page number, that the \part is on.

How do I achieve this?

  • 3
    An MWE would help us investigate this in more detail. Does \part{Publications\label{part:publications}} work? (I'm not even sure that is a good idea, I have seen it used with \caption, where it seems to be OK.) – moewe Jun 6 '18 at 9:38
  • I didn't even think about putting the \label inside the \part! That works wonderfully. I believe it might be because the text from \part is on a separate page altogether. Thanks a million. – Mads Ohm Larsen Jun 6 '18 at 9:44
4

A simple solution is to move the \label command into the argument of \part. Since \part clears the pages around it the page number comes in too late otherwise

\part{Publications\label{part:publications}}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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