# latex typesetting multiline alignment with flalign

I'm trying to align the second line equation below the integral in the first line. How do I go about doing that? I have used \right. commands to be able to move onto the next lines. I didn't have to use the \vphantom{} command to keep the parenthesis the same size as discussed in vphantom

 \documentclass{article}
\usepackage{xfrac}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{flalign*}
=-\frac{Is'n}{2\pi}\mathbf{\hat{z}}\left[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}}     {k}}\left(z-z'\right)  \left(\left(x'+s\right) \int_0^{\frac{\pi}{2}}\frac{d\alpha}          {\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right.\right.  \\
\qquad \left.\left.-2x\int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1-     h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right)\right]_{z'=-\sfrac{L}     {2}}^{z'=+\sfrac{L}{2}}
\end{flalign*}\\
\end{document}


It doesn't allow to to use the & to align due to the parenthesis. Thanks

• do you mean you want to align the integral signs? Apr 17 '14 at 9:19
• Just to help anyone else - I just spent a few mins looking at this before seeing the comment below the code about & not working because of parentheses... doh! Apr 17 '14 at 9:39
• if you select the size of the unmatched parentheses using, for example, \bigr) or \Bigr), then there is no need for \left. and the & can be used. but i'm sure this has been answered in other questions already. Apr 17 '14 at 12:29
• I could have sworn I added a comment; @barbarabeeton is totally right, I've reinserted my answer and fixed it. Apr 17 '14 at 13:00

I learned a lot today, never had to play with parentheses of different sizes before. As @barbarabeeton says, you can use alignat if you explicitly specify the sizes of the unmatched parentheses.

\documentclass{article}
\usepackage{xfrac}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{flalign*}
=-\frac{Is'n}{2\pi}\mathbf{\hat{z}}\left[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}}     {k}}\left(z-z'\right)  \left(\left(x'+s\right) \int_0^{\frac{\pi}{2}}\frac{d\alpha}          {\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right.\right.  \\
\qquad \left.\left.-2x\int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1-     h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right)\right]_{z'=-\sfrac{L}     {2}}^{z'=+\sfrac{L}{2}}
\end{flalign*}\\

Simple example to show what I added
\begin{alignat}{1}
= a & b \notag \\
& c
\end{alignat}

Your equation in alignat
\begin{alignat*}{1}
= -\frac{Is'n}{2\pi}\mathbf{\hat{z}}\Biggl[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}}     {k}}\left(z-z'\right)  \Biggl(\left(x'+s\right) &  \int_0^{\frac{\pi}{2}}\frac{d\alpha}{\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}} \notag \\
-2x & \int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\Biggr)\Biggr]_{z'=-\sfrac{L}     {2}}^{z'=+\sfrac{L}{2}}
\end{alignat*}

\end{document}


This is what the output of the above looks like

• can you add an image of the output? i think it would help others to visualize the situation. Apr 17 '14 at 13:40
• @barbarabeeton yes will try to do that Apr 17 '14 at 13:41