I get some error while using the "aligned" environment and the "mathtools" package together. See the code below.
\documentclass{article}\usepackage{amssymb,amsmath}\usepackage{mathtools}\begin{document}\begin{equation*}\begin{aligned}&A=B\\&C=D'.\end{aligned}\end{equation*} \end{document}I am working on overleaf, and it produces an error message saying
"Missing control sequence inserted.Missing } inserted." in line 7,
and saying
"Extra }, or forgotten $." in line 8.
If I change the "D'" into "D" there is no error. If I remove the "mathtools" package there is no error. If I delete the first line "&A=B" there is no error. If I start a new line at "&A=B" there is no error.
I have no idea why this is the case, maybe it is because of overleaf? But on my local TexShop (latest version) the same thing happens.
(Of course the error is easily fixed by starting a new line at "&A=B" without changing the content, but I just want to know why.)