TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use this code to check for existing column style (see also this question)

But it fails as soon as I load the package boolexpr. Is this incompatible with etoolbox?


\expandafter\let\csname columntype@p\endcsname\@empty
  \ifboolexpr{ bool{\isColumntypeDefined{#1}} }{#2}{#3}%


\IfColumntypeDefined{p}{p column defined}{p not defined}%
share|improve this question
Since both define \ifboolexpr, I guess they don't go well together. :( – egreg Jan 20 '12 at 21:11
That's because both define similar commands. Why do you need boolexpr? – Werner Jan 20 '12 at 21:11
@Werner: for a switch structure as linked in the comment of the first answer. – Matthias Pospiech Jan 20 '12 at 21:59
@MatthiasPospiech: If you use the load order \RequirePackage{boolexpr}\let\ifboolexpr\relax\RequirePackage{etoolbox}, can you still use the switch structure? I don't have an example to test. – Werner Jan 20 '12 at 22:06
up vote 5 down vote accepted

I answer this question also in relation to the commands. First of all both packages define the command \ifboolexpr. The package boolexpr overwrite the existings definition by his own. This can be seen by the warning message defined in line 78 of boolexpr.sty

\PackageWarning{boolexpr}{\string\ifboolexpr\space has been defined
                          by etoolbox (I suppose) - Overwritting}

So your test which works with etoolbox fails because at the point of executing the definition of the package boolexpr will be used. The package boolexpr isn't such stable as etoolbox.

I recommend the using of etoolbox instead of boolexpr.

share|improve this answer
I use boolexp only because it provides a nice switch syntax (see tex.stackexchange.com/questions/29133/…) which etoolbox does not provide. – Matthias Pospiech Jan 20 '12 at 21:47
@MatthiasPospiech: For such things I use xifinlist provided by etoolbox. (similar to ifstreq) – Marco Daniel Jan 21 '12 at 9:37
@MatthiasPospiech I've added an answer to that question; it uses expl3 and is independent of boolexpr and etoolbox. – egreg Jan 21 '12 at 16:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.