(eplain.info)\ifinteger and \isinteger


Next: \futurenonspacelet Prev: \ifempty Up: Expansion
Enter node , (file) or (file)node

7.6.8 '\ifinteger' and '\isinteger'
-----------------------------------

'\ifinteger{ARG} T \else F \fi' expands the T text if ARG is an integer,
and the F text otherwise. This macro can detect positive and negative
integers.

   Since '\ifinteger' is not a primitive conditional, it cannot be used
in places where TeX might skip tokens "at high speed", e.g., within
another conditional--TeX can't match up the '\if''s and '\fi''s. For
such situations Eplain provides '\isinteger', which can be used as
follows:

     \if\isinteger{ARG} T \else F \fi

   Although '\ifinteger' and '\isinteger' work well with regular input,
they are not bullet-proof. For example, the following code

     \ifinteger{12_ab}integer\else not integer\fi

will expand to 'ab_integer' (and thus would not even compile outside
math mode).

   These macros come from TeX Frequently Asked Question
(<http://www.tex.ac.uk/cgi-bin/texfaq2html>).


automatically generated by info2www version 1.2.2.9