If you load nccmath
after mathtools
and use \shortintertext
, you will get an error message "Package amsmath Error: Invalid use of \shortintertext
". If you load nccmath
before mathtools
, the error message disappears.
Is there any overlap between the two packages functionalities? Do they overlap when it comes to modifying the internal commands of the standard LaTeX?
\documentclass[]{book}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{nccmath}
\begin{document}
\begin{align}
(A + B \thinspace C) \thinspace x + C \thinspace y &= 0,
\\
\shortintertext{Short Intertext}
E \thinspace x + (F + G) \thinspace y &= 23.
\end{align}
\end{document}
Best Answer
The
\intertext
and\shortintertext
commands are only valid in certain contexts;nccmath
modifies the meaning of\intertext@
(which is the internal command defined byamsmath
and used also bymathtools
) and eventually this conflicts with the redefinitions done bymathtools
.Solution: load
nccmath
beforemathtools
. This will remove the redefinition of\intertext
done bynccmath
, but it's not needed because you can use\shortintertext
with similar features.I removed all the
\thinspace
commands which are not needed and wrong anyhow: for a thin space in math mode you should use\,
. But, really, it is not needed in those places.