# Integer operations on cross references [duplicate]

I would like to perform integer operations on a cross reference.

\documentclass{article}
\usepackage{etoolbox}

\begin{document}

hello \label{here}

\ifnumequal{\pageref{here}}{1}{You are on the 1st page}{...}

\end{document}


I get Missing number, treated as zero, even on a second pass (when the reference is not ?? anymore).

NB: In this MWE, one could obviously use \thepage. But this is not an option in the real document.

## marked as duplicate by egreg, Werner, mafp, Heiko Oberdiek, lockstepJun 14 '13 at 15:05

• Do \usepackage{refcount} and use \getpagerefnumber instead of \pageref. – egreg Jun 14 '13 at 13:58
• egreg, a thousand thanks! I had tried without success many things, not knowing about the refcount package... (I wish I could accept your answer). – BertS Jun 14 '13 at 14:14