4

I have a problem when trying to align multiple equations within the align environment if some (or all) of them are split into multiple lines with the split environment. For instance in the example below, I want all of the equal signs to align vertically, but it doesn't work because of the isc(t) in front of the second equal sign. If I remove that, the equal signs do align. I don't understand why it doesn't align, is there any way to fix this? I've added the code for the example below.

example of misalignment

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    \begin{align}
        i_3(t)&=\frac{V_3}{\omega_3L_3}e^{-\frac{R_3}{2L_3}t}\sin{\omega_3t}\\
        \begin{split}
        i_{sc}(t)&=i_1(t)+i_2(t)+i_3(t)\\
        &=\frac{V_1}{\omega_1L_1}e^{-\frac{R_1}{2L_1}t}\sin{\omega_1t}+\frac{V_2}{\omega_2L_2}e^{-\frac{R_2}{2L_2}t}\sin{\omega_2t}\\
        &\qquad+\frac{V_3}{\omega_3L_3}e^{-\frac{R_3}{2L_3}t}\sin{\omega_3t}\\
        \end{split}
    \end{align}
\end{document}
1
  • @barbarabeeton no:-) Commented Mar 20, 2023 at 16:36

1 Answer 1

7

{split} is "aware" of the outer {align}'s alignment points, but you are ending the last line with \\ which causes this issue. Just remove it and be happy.

As a personal preference I would use {aligned} for the last two lines, such that you don't have to introduce a manual \qquad there, but that's mostly a matter of taste. Note also that \sin{\omega_3t} isn't doing what you might think: \sin does not take an argument, so I would write it as \sin(\omega_3t).

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
    i_3(t)&=\frac{V_3}{\omega_3L_3}e^{-\frac{R_3}{2L_3}t}\sin(\omega_3t)\\
    \begin{split}
    i_{sc}(t)&=i_1(t)+i_2(t)+i_3(t)\\
    &= \begin{aligned}[t]
        &\frac{V_1}{\omega_1L_1}e^{-\frac{R_1}{2L_1}t}\sin(\omega_1t)+\frac{V_2}{\omega_2L_2}e^{-\frac{R_2}{2L_2}t}\sin(\omega_2t)\\
        &+\frac{V_3}{\omega_3L_3}e^{-\frac{R_3}{2L_3}t}\sin(\omega_3t)
       \end{aligned}
    \end{split}
\end{align}
\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .