How to perform simple arithmetic with page number?
There are a few options.
If you want to globally change the page number, you can use \addtocounter
or \setcounter
, as recommended by Thorsten Donig.
If you want to use the result in a length or counter, as in \setcounter
, \addtocounter
, \setlength
, or \addtolength
, you can use the calc
package. For example, one less than the page number is \setcounter{pagelessone}{\thepage-1}
, where pagelessone
is some counter you've already defined.
If you want to do something more complicated, you can use the eTeX primitives \dimexpr
and \numexpr
. For example, one less than the page number is \numexpr\thepage-1\relax
. For more information, see section 3.5 of the eTeX documentation.