TeX/ifnum

Synopsis
\ifnum   [\else ] \fi

With values: %A TeX primitive counter: \newcount\countA% \countA=5%

%A LaTeX counter: \newcounter{counterB}% \setcounter{counterB}{5}%

Lorem ipsum... \makeatletter% c@ can access the integer value of the counter. To use it, @ must be a letter \ifnum\countA=\c@counterB\relax% Text tells you, that both counters are the same.\newpage \else% No new page here. The counters are not the same. \fi% Lorem ipsum...

Description
The \ifnum command denotes the start of an if-then-else control structure. The forms  and  must expand to integers while  must be one of the characters '=', '<', or '>'. If  expands to a true expression then  is processed; otherwise it is ignored. If the \else section is included and  expands to a false expression, then  is processed; otherwise it is ignored.