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
?
\documentclass[]{scrbook}
\RequirePackage{etoolbox}
\makeatletter
\expandafter\let\csname columntype@p\endcsname\@empty
\newcommand\CheckIfColumntypeDefined[1]{%
\providebool{tpl@coltype@#1}
\ifcsdef{NC@find@\string#1}%
{\setbool{tpl@coltype@#1}{true}}%
{\ifcsdef{columntype@\string#1}
{\setbool{tpl@coltype@#1}{true}}%
{\setbool{tpl@coltype@#1}{false}}%
}%
}
\newcommand\isColumntypeDefined[1]{tpl@coltype@#1}
\newcommand\IfColumntypeDefined[3]{%
\CheckIfColumntypeDefined{#1}
\ifboolexpr{ bool{\isColumntypeDefined{#1}} }{#2}{#3}%
}
\makeatother
\RequirePackage{boolexpr}
\begin{document}
\IfColumntypeDefined{p}{p column defined}{p not defined}%
\end{document}
\ifboolexpr
, I guess they don't go well together. :(boolexpr
?\RequirePackage{boolexpr}\let\ifboolexpr\relax\RequirePackage{etoolbox}
, can you still use the switch structure? I don't have an example to test.