I'm getting error messages in overleaf such as "Missing } inserted.", "Extra }, or forgotten \endgroup.", "Misplaced alignment tab character &.", "Misplaced alignment tab character &.", "Misplaced \omit.", "Misplaced \cr.", "Misplaced \noalign.", "Missing $ inserted." and "Missing \cr inserted."
It compiling when I use equation instead of align but doesnt otherwise. My code also compiles if I remove \bm{\varphi} and just write \varphi. It doesnt miss a { or } and no alignment is missplaced. I cant understand why it wouldn't compile and I really would like to use align instead of equation since it is much better looking. My code is as follows
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{bm,mathtools}
\usepackage{amsthm}
\usepackage{chemist}
\newcommand{\rd}[1] {\ensuremath{\mathrm{d}#1}} %creates operator ds that makes it more clear that \frac{d}{dt} is an math operator
\newcommand{\ham}{\mathcal{H}} %hamiltonian
\begin{document}
\begin{align*}
\frac{\rd }{\rd t} \left( \left( \frac{\partial \bm{\varphi}_{t}}{\partial
\bm{y}_{0}} \right)^{T} J \left( \frac{\partial \bm{\varphi}_{t}}{\partial
\bm{y}_{0}} \right) \right)
&= \left(\frac{\rd}{\rd t} \frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right)^T J \left(\frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right) + \left(\frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}} \right)^T J \left(\frac{\rd}{\rd t} \frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right)\\
&=\left(\frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right)^T \nabla^2 \ham(\bm{\varphi}_t(\bm{y}_0)) J^T J \left(\frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right) + \left(\frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}} \right)^T \nabla^2 \ham(\bm{\varphi}_t(\bm{y}_0)) \left( \frac{\partial \bm{\varphi}_{t} } {\partial \bm{y}_{0}}\right)\\
&=0
\end{align*}
\end{document}
It seems that the code work if I put it into another blank overleaf document but doesn't work in my original document for some reason. So to be clear if you copy this it will work but my code is approximately 2000 lines of code so might be something else or some smaller error that stack up?
bm
andmathtools
? It compiles fine for me (but I have to guess the meaning of\rd
as\mathrm{d}
). Please consider adding a minimum working example (MWE), i.e. from\documentclass{article}
to\end{document}
and can be tested to show the problem.amsmath
andbm
packages. As Teddy mentions, please always post full but minimal examples, not sniplets like this. Then we can see which class and packages you're loading and whether you're missing any.\ham
is not defined. BTW you can address a comment to a person if you use @name. You can send be a link to your overleaf project to daleif at math.au.dk, then I can copy it and have a look.