Trying to make conditional expressions that inspect the total page count of the document (see this question), I've found this solution using ifthen
package:
\documentclass{article}
\usepackage{lipsum}
\usepackage{ifthen}
\usepackage{lastpage}
\begin{document}
\ifthenelse{\pageref{LastPage}>1}{\pagestyle{plain}}{\pagestyle{empty}}
\lipsum[2-3]
\end{document}
I would like to try to use etoolbox
instead of ifthen
because it looks like now it is a more commonly used package. My following attempt does not work:
\documentclass{article}
\usepackage{lipsum}
\usepackage{etoolbox}
\usepackage{lastpage}
\begin{document}
\ifnumcomp{\pageref{LastPage}}{>}{1}{\pagestyle{plain}}{\pagestyle{empty}}
\lipsum[2-13]
\end{document}
So, how can i do this with etoolbox
\pageref{LastPage}
in a conditional from etoolbox.\pageref
as a number and to do number comparision -- neither with ifthen or with etoolbox. It could also contain text or formatting instruction or be a roman number.\ifdefstrequal{\pageref{a}}{\pageref{b}}{yes}{no}
. When I really want to be on the safe side I use the zref package to get real numbers to compare.