# Multline, split

I want to split this long equation into three or four (to fit on A4 paper) maintaining an alignment with equal sign. I have tried \split and \multline codes, but still it won't work. Maybe because of \left[ and \right] that enclosed the whole equation?

$$R_i=\Delta_x\Delta_y\left[ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}} + \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}} + \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} + \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} - \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \right]$$


After remembering that $$ should never be used in LaTeX, see Why is $...$ preferable to$$ ... $$?, here are two variants with split that allows for a more balanced output: \documentclass{article} \usepackage{amsmath} \begin{document} $$\begin{split} R_i=\Delta_x\Delta_y \biggl[ & \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}} + \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\ &+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} + \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \\ &- \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} - \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}} \\ &- \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \biggr] \end{split}$$ $$\begin{split} R_i=\Delta_x\Delta_y \biggl[ & \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}} + \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\ {}+{}& \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} + \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \\ {}-{}& \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} - \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}} \\ {}-{}& \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \biggr] \end{split}$$ \end{document}  • codes of equations (1) and 82) are the same :(. Probably the second should start with R_i=\Delta_x\Delta_y & \biggl[ Commented Nov 19, 2016 at 22:04 • @Zarko No, they aren't the same, look closely Commented Nov 19, 2016 at 22:26 • Now I notice that the difference are after the first row, Clever solution! Sorry for the noise. Commented Nov 19, 2016 at 22:54 An exemplary solution. You will choose your places of split. \documentclass{article} \usepackage{amsmath} \begin{document} %$$
\begin{align*}
R_i&=
\Delta_x\Delta_y
%\left[
\biggl[
\Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+  \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
+\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} \\
+\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
-\Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} \\
-  \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\biggr]
%\right]
\end{align*}
%

\end{document}


Indeed, you're not allowed to have unmatched \left and \right statements on separate lines.

Here's a solution that (a) uses \biggl[ and \biggr] to create the large "fences" and (b) uses a split environment (the three linebreaks) nested inside an equation environment. Per @egreg's suggestion, the line breaks are chosen to exploit a bit of symmetry present in the expressions. (If you don't like the gap between \biggl[ and the first \Delta_1\Delta_2 term, just omit the term \phantom{{}+{}}.)

\documentclass{article}
\usepackage{amsmath} % for "split" environment
\begin{document}
$$\begin{split} R_i=\Delta_x\Delta_y\biggl[ &\phantom{{}+{}}\Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}} + \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\ &+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} +\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \\ &- \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} - \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}} \\ &-\Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} - \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}\biggr] \end{split}$$
\end{document}

• I'd exploit the symmetry: four terms have two Deltas, other four have three, so I'd go for a four line alignment. Commented Nov 19, 2016 at 21:44
– RBSM
Commented Nov 19, 2016 at 21:46
• @egreg - Many thanks for this suggestion, which I've now implemented.
– Mico
Commented Nov 19, 2016 at 21:49
• @Mico Er, not what I was thinking to Commented Nov 19, 2016 at 21:59

I propose another layout, (only 3 lines) using the alignedat environment. Additionally, a simplified typing of partial derivatives with the esdiff package:

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{esdiff}

\begin{document}

\begin{alignedat}{2} R_i=\Delta_x\Delta_y \biggl[ & & \Delta_{1}\Delta_{2}\diffp{\Delta_{21}}{{w_i}} + \Delta_{1}\Delta_{2}\diffp{\Delta_{22}}{{w_i}} + \Delta_{2}\Delta_{1}\diffp{\Delta_{11}}{{w_i}} + \Delta_{2}\Delta_{1}\frac{∂{\Delta_{12}}}{∂{w_i}} & \\ & & - \Delta_{10}\Delta_{20}\Delta_{21}\diffp{\Delta_{11}}{{w_i}} - \Delta_{20}\Delta_{20}\Delta_{11}\diffp{\Delta_{21}}{{w_i}} & \\ & & - \Delta_{10}\Delta_{20}\Delta_{12}\diffp{\Delta_{22}}{{w_i}} - \Delta_{10}\Delta_{20}\Delta_{22}\diffp{\Delta_{12}}{{w_i}} & \biggr] \end{alignedat}

\end{document}