The commath
package use the TeX command \ifinner
to select between inline math mode and display math mode. Because of this, it fail to work properly with some display math environments.
In the breq
n package, we find:
The test
\ifinner
is unreliable for distinguishing whether we are in a displayed formula or an inline formula: (…) So we provide a more reliable test. But it might have been provided already by the amsmath package.
The more reliable test should be \if@display
but only replace \ifinner
with \if@display
in commath.sty
not work. Any suggestion?
Best Answer
Let's see how
commath
should define its macros.I have omitted the
\...ref
macros that are better managed withcleveref
.As you see, it's only a collection of dubiously useful macros.
Main errors in
commath
: the definitions of\dif
and\Dif
are plainly wrong. The usage of\ifinner
is completely wrong; what the author intends to do by\ifinner
with\tfrac
and\dfrac
is already done (better) by the standard\frac
macro.The "delimiters" macros are wrong in that they use by default
\left
and\right
, which is disputable; I've left them as in the original, but defining them in terms of a generic macro.