I am asking a question that has appeared many times on TeX StackExchange but none of the answers seem to work for my use case.
I am trying to introduce line breaks, programmatically, into really long equations that will typically happen between either \left \right pairs or in \sqrt. And I am using Mathjax to render (using Jupyter Notebook), meaning I only have a subset of Latex implemented and am not able to use packages such as breqn.
Here is my example code:
\begin{aligned}
\sqrt{a + b + c + d + e + f + g} &=
\sqrt{243324234.00000 + 234324.00000000000 +\\
2342348987987897987.00000000000 + 32234234.00000000000000 +\\
20909.0000000000000000 + 12321.000000} &= 42
\end{aligned}
(I am not actually using numbers with that many decimal places, I just needed to fill space up for my example; I am using many long numbers similar to this, though).
Now, the weird part is that it renders on-screen, just fine. But when I go to compile it into PDF using xelatex (via nbconvert), I get the following errors:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex .\notebook.tex -quiet" command:
notebook.tex:421:
notebook.tex:421: Missing $ inserted
notebook.tex:422: Missing } inserted
notebook.tex:424: Missing { inserted
notebook.tex:425: Missing
Here is what else I have tried:
\sqrt too long for one line - However, I do not have access to the \multlined environment within Mathjax.
Long \sqrt in two lines - \split{} creates an unbreakable box which flows off of the page, both on-screen and when compiled.
This is programmatically created Latex output. I have tried putting each equation into either its own \align environment (if it was a "small" equation) or \multline environment (if it is a "large" equation), which kind of works but this is not good Latex practice and it prevents any kind of actual alignment and spacing adjustment between equations. My preference is not to do this.
So, given these parameters, is it possible to programmatically introduce semi-arbitrary line breaks into equations in an AMS math environment that will compile?
Thank you so much for any advice or help.
