I asked this question here in Mathematica.SE but they encouraged to ask also on this site.
How can make this writing process easier from Mathematica to LaTeX? Please, note that I have a lot of variables and I want to make them visible to the reader, I am not much interested how but not over the page so have to break the equations and perhaps other formatting, possible to get it directly from Mathematica?
Mathematica Code
AA = -a*g/(A*(2*g*h)^(1/2));
aa = (F1 + F2)^2/(2*a^2*g);
BB = 2/A;
Du = F1 + F2 - 1.2;
Dx = h - aa;
Px = AA*Dx - BB*Du // Simplify;
{AA, aa, BB, Du, Dx, Px} // TeXForm (*perhaps wrong way here? I want to show the above lines fast and accessible to the reader*)
Out
\left\{-\frac{a g}{\sqrt{2} A \sqrt{g h}},\frac{(\text{F1}+\text{F2})^2}{2 a^2
g},\frac{2}{A},\text{F1}+\text{F2}-1.2,h-\frac{(\text{F1}+\text{F2})^2}{2 a^2 g},-\frac{\frac{\sqrt{2} a g
\left(h-\frac{(\text{F1}+\text{F2})^2}{2 a^2 g}\right)}{\sqrt{g h}}+4. (\text{F1}+\text{F2}-1.2)}{2 A}\right\}
My by-hand edited thing, time-consuming (too long, have to break it somehow)
\begin{equation}
\begin{split}
{A',a',B',\Delta u, \Delta x, \partial x} := \left\{
-\frac{a g}{\sqrt{2} A \sqrt{g h}}, \\
\frac{(\text{F1}+\text{F2})^2}{2 a^2 g}, \\
\frac{2}{A}, \\
\text{F1}+\text{F2}-1.2, \\
h-\frac{(\text{F1}+\text{F2})^2}{2 a^2 g}, \\
-\frac{\frac{\sqrt{2} a g \left(h-\frac{(\text{F1}+\text{F2})^2}{2 a^2 g}\right)}{\sqrt{g h}}+4. (\text{F1}+\text{F2}-1.2)}{2 A} \\
\right.
\end{split}
\end{equation}
Perhaps related
Best Answer
This is a (typographically) response to OP's own answer.
(Sorry, still no Mathematica-automation answer. This seems to be a job for either Mathematica itself or a Preprocessor.)
Notes:
-
. To LaTeX, these are two separate words (matrix
and-case
) and breaks hyphenation.align
environment produces separate equation numbers, not only one for four/five lines.split
environment is used for the last lines in the first block because these really belong to on equation. (If you don't like the position of the equation number, you could drop thesplit
environment and just use\notag
in one of the lines.)F1
andF2
.Your Mathematica output set them in the current text font (could be italics). Without the knowledge what they stand for, I would recommend using either
F_1
or\mathrm{F}1
.Code
Output