4

I want to add an integer to the page number, but \thepage seems to be a string and \value{page} doesn't show up on the page.

\cfoot{\ifnum\value{page}<2\vspace{9pt}\value{page}+1\else\thepage+1\fi}

  • That worked perfectly, thanks! If you put it as an answer I can accept it. – jpd527 Jun 6 '17 at 14:54
4

Use

\cfoot{%
  \ifnum\value{page}<2\vspace{9pt}\the\numexpr\value{pa‌​ge}+1%
  \else\the\numex‌​pr\value{page}+1%
  \fi
}

The primitive \numexpr is used to perform calculations on numbers without changing counter or count register contents directly. In order to evaluate the expression as typesetting, the mighty \the as prefix is necessary.

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.