I'm trying to add a line in the header to be "Page X of Y", but only if there are multiple pages. My main problem is how to format the if statement. So far I have
\ifx \pageref{LastPage} 1
\relax
\else
\fancyhead[R]{Page \thepage\ of \pageref{LastPage}}
\fi
I think it's the first line that is problematic, as the rest seems to work.