CTAN Comprehensive TeX Archive Network

CTAN Update: boolexpr

Date: August 13, 2009 12:31:15 PM CEST
On Wed, 12 Aug 2009 Florent Chervet submitted an update to the boolexpr package. The \boolexpr macro evaluates boolean expressions in a purely expandable way. Location on CTAN: /macros/latex/contrib/boolexpr/ Summary description: Purely expandable boolean expressions and switch License type: lppl Announcement text:
Adding new syntax : \switch \case{ bool expr } ... \case{ bool expr} ... \otherwise ... \endswitch remains purely expandable (may be used inside \csname ... \endcsname)
This package is located at http://mirror.ctan.org/macros/latex/contrib/boolexpr/ . More information is at http://tug.ctan.org/info/?id=boolexpr (if the package is new it may take a day for that information to appear). We are supported by the TeX Users Group http://www.tug.org . Please join a users group; see http://www.tug.org/usergroups.html . _______________________________________________ Thanks for the upload. For the CTAN Team Rainer Schöpf

boolexpr – A boolean expression evaluator and a switch command

The \boolexpr macro evaluates boolean expressions in a purely expandable way.

\boolexpr{ A \OR B \AND C } expands to 0 if the logical expression is TRUE. A, B, C may be: numeric expressions such as: x=y, x<>y, x>y or x<y; – boolean switches: \iftrue 0\else 1\fi;
– conditionals: \ifcsname whatsit\endcsname 0\else 1\fi;
– another \boolexpr: \boolexpr{ D \OR E \AND F }:

\boolexpr may be used with \ifcase:
  \ifcase\boolexpr{ A \OR B \AND C }
    What to do if true
  \else
    What to do if false
  \fi

The \switch command (which is also expandable) has the form:
\switch
\case{<boolean expression>} ...
\case{<boolean expression>} ...
... \otherwise ...
\endswitch

Packageboolexpr
Version3.14
Copyright2009 Florent Chervet
MaintainerFlorent Chervet

Announcements

more

Guest Book Sitemap Contact Contact Author