11

I have a following code to align a system of equations:

\begin{aligned}
&  \|\partial_{j_1} \cdots \partial_{j_m} f (a)- \partial_{j_1} \cdots \partial_{j_m} f (x) \|\\
={}&  \| \partial^m f (a) \left  [e_{j_1}, \ldots, e_{j_m}\right ] - \partial^m f (x) \left  [e_{j_1}, \ldots, e_{j_m}\right ]\| \\
={}&  \left \| \big ( \partial^m f (a) - \partial^m f (x) \big) \left  [e_{j_1}, \ldots, e_{j_m}\right ] \right \| \\
\le{}&  \| \partial^m f (a) - \partial^m f (x)\| \cdot \| e_{j_1} \| \cdots \| e_{j_m} \| \\
={}&  \| \partial^m f (a) - \partial^m f (x)\|
\end{aligned}

with the result

enter image description here

Could you please explain why the norm symbols || (the third one) are not aligned in this situation? Thank you so much!

  • 2
    simpler than using a package you could just remove the unneeded \left \right that is adding the space. (Please always post a complete document to make it easier for people to run the code, it is harder to debug a fragment) – David Carlisle Nov 23 '19 at 8:39
18

I think there are two issues with your code

  • \left and \right can insert whitespace. Don't use it here; or, load the mleftright package and use \mleft and \mright instead of \left and \right.

  • An unusual (to put it mildly) usage of the & alignment points.

Once these issues are fixed, the result is what one would expect it to be. To improve code legibility, I would also define a macro called \norm, using the \DeclarePairedDelimiter macro of the mathtools package. (The mathtools package is a superset of the amsmath package.)

enter image description here

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

\begin{document}
$\begin{aligned}
&\mathrel{\phantom{=}} 
     \norm{ \partial_{j_1} \dotsb \partial_{j_m} f(a) - 
            \partial_{j_1} \dotsb \partial_{j_m} f(x) } \\
&=   \norm{ \partial^m f(a) [e_{j_1}, \dots, e_{j_m} ] - 
            \partial^m f(x) [e_{j_1}, \dots, e_{j_m} ] } \\
&=   \norm[\big]{ 
            \bigl( \partial^m f(a) - \partial^m f(x) \bigr) 
                 [ e_{j_1}, \dots, e_{j_m} ] } \\
&\le \norm{ \partial^m f(a) - \partial^m f(x)} \cdot
     \norm{ e_{j_1}} \dotsb \norm{e_{j_m} } \\
&=   \norm{ \partial^m f(a) - \partial^m f(x)}
\end{aligned}$
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.