CTAN Comprehensive TeX Archive Network

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
    What to do if false

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

Li­censesThe Project Public Li­cense
Copy­right2009 Florent Chervet
Main­tainerFlorent Chervet
Con­tained inTeX Live as bool­expr
MiKTeX as bool­expr
TopicsMacro sup­port

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

Com­mu­nity Com­ments



Here you can see a re­spec­tive di­a­gram in newer browsers.


Guest Book Sitemap Contact Contact Author