Spacing of \multline inside align (i.e. \multlined)
I can offer a quick fix for your \!
problem, but I don't know if it has unwanted side effects. For some reason that I don't know, the definition of multlined
contains
\MH_if_boolean:nF {outer_mult}{\null\,}
in its internal macro \MT_mult_internal:n
. It appears that this \,
is the culprit! So to avoid the \,
, you can set the boolean outer_mult
"true". At least in your example, this has the desired effect that you don't need \!
any more. Maybe the package maintainers can explain the role of outer_mult
and its associated \,
.
\documentclass{article}
\usepackage{amsmath,mathtools}
\MHInternalSyntaxOn
\MH_set_boolean_T:n {outer_mult}
\MHInternalSyntaxOff
\begin{document}
\begin{align*}
& \left[k(k+\hbar),[k(k+\hbar),z]\right] \\
& \qquad = 2[k(k+\hbar),m_yx-m_xy+i\hbar z] \\
& \qquad = 2m_y[k(k+\hbar),x]-2m_x[k(k+\hbar),y]+2i\hbar[k(k+\hbar),z] \\
& \qquad = 4m_y(ym_z-m_yz)-4m_x(m_xz-xm_z)+2\left\{k(k+\hbar)z-zk(k+\hbar)\right\} \\
& \qquad = \begin{multlined}[t][10.5cm]
4(m_xx+m_yy+m_zz)-4(m_x^2+m_y^2+m_z^2)z+{} \\
+2\left\{k(k+\hbar)z-zk(k+\hbar)\right\} .
\end{multlined}
\end{align*}
\end{document}
Looking into the mathtools documentation I found shortly after multlined
the command \MoveEqLeft
. It seems to help a lot in your case. You could do
\documentclass{minimal}
\usepackage{amsmath,mathtools}
\begin{document}
\begin{align*}
\MoveEqLeft \left[k(k+\hbar),[k(k+\hbar),z]\right] \\
& = 2[k(k+\hbar),m_yx-m_xy+i\hbar z] \\
& = 2m_y[k(k+\hbar),x]-2m_x[k(k+\hbar),y]+2i\hbar[k(k+\hbar),z] \\
& = 4m_y(ym_z-m_yz)-4m_x(m_xz-xm_z)+2\left\{k(k+\hbar)z-zk(k+\hbar)\right\} \\
& = \begin{multlined}[t][10.5cm]
4(m_xx+m_yy+m_zz)-4(m_x^2+m_y^2+m_z^2)z+{} \\
+2\left\{k(k+\hbar)z-zk(k+\hbar)\right\} .
\end{multlined}
\end{align*}
\end{document}
Unfortunately, as far as I can see, there seems to be no better solution with standard means like amsmath
and mathtools
. Of course if you would allow left alignment on the last line (of course with some more indentation), you could omit the nested environments altogether.