2

I would like to align the equal signs in this block of equations. Somehow, the first equal sign is well aligned, but the second is not. Am I missing something obvious?

Thank you very much

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\left\lbrace 
\begin{aligned}
u_0 &=p_0 \\ 
u_1 &=p_0+p_1&=u_0+p_1  \\
u_2 &=p_0+p_1+p_2&=u_1+p_2  \\
\vdots \\
u_{n-1} &=p_0+p_1+\dots + p_{n-1} &= u_{n-2}+p_{n-1}  \\
u_{n} &=p_0+p_1+\dots + p_{n} &= u_{n-1}+p_{n}  \\
\end{aligned}
\right.
\end{equation}
\end{document}
5

Use alignedat. In contrast to aligned you have to specify the number of column pairs there, i.e. \begin{alignedat}{2}. Also ever third column is right aligned so you need to insert an empty column before your second equals as in &&=.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \left\{
    \begin{alignedat}{2}
      u_0 &=p_0 \\ 
      u_1 &=p_0+p_1&&=u_0+p_1  \\
      u_2 &=p_0+p_1+p_2&&=u_1+p_2  \\
      \vdots \\
      u_{n-1} &=p_0+p_1+\dots + p_{n-1} &&= u_{n-2}+p_{n-1}  \\
      u_{n} &=p_0+p_1+\dots + p_{n} &&= u_{n-1}+p_{n}  \\
    \end{alignedat}
  \right.
\end{equation}
\end{document}

enter image description here

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.