I have an error in my overleaf document but it is still compilable. I am not sure why im getting the error because I simply use the align function inside the equation function.
[Tex/LaTex] Error – “Align used inside equation”, and unexpected \end{equation} after \begin{document}
equations
Best Answer
The environments
align
,alignat
,flalign
(and the corresponding starred variants) are top-level math environments and cannot be nested in other displayed equations (with a notable exception: you can usealign
& Co. withingather
). Therefore you should either remove the "external"equation
environment or use the "internal" formaligned
, orsplit
:Equations (4) and (5) look the same, but the solution with
aligned
supports more alignment points. The cases (3) and (6) give the same output here but will in general differ in the vertical spacing between the formula and the surrounding text, sincealign
never uses\abovedisplayshortskip
. (For this reason I generally preferaligned
with theb
option, though that might be debatable.)