During the preamble with the doc. The mathtools deal masses the amsmath bundle and therefore there is not any ought to usepackage amsmath inside the preamble if mathtools is applied. $$ is TeX primitive syntax, which, as others have commented is tough to redefine (in vintage TeX there is absolutely https://www.xaphyr.com/latexcatsuits