What is the rationale behind defining operators like \coloneq in mathtools.sty using \AtBeginDocument?
\AtBeginDocument{
...
\providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
...
}
What would break if these commands were defined at the end of mathtools.sty? What are the benefits of this detour?
I just noticed that in the document
\documentclass{article}
\usepackage{mathtools}
\let\defeq\coloneqq
\begin{document}
$a\defeq b$
\end{document}
\defeq stays undefined because of this and that one has to use
\AtBeginDocument{\let\defeq\coloneqq}
instead.
mathtoolswill install its own version of\coloneqthen. Putting it in\AtBeginDocumentis 'safer', unless other packages loaded aftermathtoolshooks again into\AtBeginDocument, of course – Jan 19 '17 at 18:47