2

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? – FionaSmith 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! – FionaSmith 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. – barbara beeton 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. – FionaSmith Apr 17 '14 at 13:00
2

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}


Your equation:     
 \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

enter image description here

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

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.