Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse

boolexpr – A boolean expression evaluator and a switch command

The \bool­expr macro eval­u­ates boolean ex­pres­sions in a purely ex­pand­able way.

\bool­expr{ A \OR B \AND C } ex­pands to 0 if the log­i­cal ex­pres­sion is TRUE. A, B, C may be: nu­meric ex­pres­sions such as: x=y, x<>y, x>y or x<y; – boolean switches: \iftrue 0\else 1\fi;
– con­di­tion­als: \ifc­sname what­sit\end­c­sname 0\else 1\fi;
– an­other \bool­expr: \bool­expr{ D \OR E \AND F }:

\bool­expr may be used with \if­case:
  \if­case\bool­expr{ A \OR B \AND C }
    What to do if true
  \else
    What to do if false
  \fi

The \switch com­mand (which is also ex­pand­able) has the form:
\switch
\case{<boolean ex­pres­sion>} ...
\case{<boolean ex­pres­sion>} ...
... \oth­er­wise ...
\endswitch

Sources/macros/latex/contrib/boolexpr
Doc­u­men­ta­tion
Ver­sion3.14
Li­censeThe LaTeX Project Public Li­cense
Copy­right2009 Florent Chervet
Main­tainerFlorent Chervet
Con­tained inTeXlive as bool­expr
MikTeX as bool­expr
Topics sup­port for de­vel­op­ment of (La)TeX macros

Down­load the con­tents of this pack­age in one zip archive (161.6k).

Guest Book Sitemap Contact