4

I would like to break the following two equations. I would like for them to have the colons aligned together, but besides that they should have their own, unique alignment points. Please see the picture for a reference regarding alignment of the colons.

Here is a MWE illustrating the problem:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{2}
a + a + a + a + a + a \quad &: \quad \alpha + \alpha + \alpha + \alpha + \alpha =&& +1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2\\
        &                && -3 + 4-3 + 4-3 + 4-3 + 4-3 + 4-3 \\
a \quad &: \quad \beta  =&& +4+4+4+4+4+4+4+4+4+4+4+4+4+4+4 \\
        &                && +4+4+4+4+4+4+
\end{alignat*}
\end{document}

enter image description here

  • I'm afraid your screenshot doesn't correspond to the LaTeX code you've posted. Moreover, the screenshot doesn't make clear what you want to change. Please clarify. – Mico Jun 30 '14 at 15:36
  • @Mico Bernard's answer is just what I am looking for. Sorry for not being clearer – BillyJean Jun 30 '14 at 15:55
3

A solution using two aligned environments within an align, to have a partial alignment of the two groups of equations. I think aligning inside the groups a little further looks better:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[upright]{fourier}
\usepackage[showframe, nomarginpar]{geometry}

\usepackage{mathtools}

\begin{document}

\begin{align*}
a + a + a + a + a + a \quad & : \quad \begin{aligned}[t]
\alpha + \alpha + \alpha + \alpha + \alpha = +1 & + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2\\
         & -3 + 4-3 + 4-3 + 4-3 + 4-3 + 4-3 \\
\end{aligned}\\[1ex]
a \quad & : \quad \begin{aligned}[t]
\beta = +4+4+4 & +4+4+4+4+4+4+4+4+4 \\&+4+4+4 +4+4+4+4+4+4+{}
\end{aligned}
\end{align*}

\end{document} 

enter image description here

Depending on the context, the aligned environments could as well be multilined environments

| improve this answer | |
  • Thanks, just what I was looking for. Sorry for my poor question. – BillyJean Jun 30 '14 at 15:55
  • 3
    You're welcome. It's not always easy to explain what one wants. – Bernard Jun 30 '14 at 16:06
5

You could have two separate alignat* environments inside a gather* environment:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
\begin{alignat*}{2}
a + a + a + a + a + a \quad &: \quad \alpha + \alpha + \alpha + \alpha + \alpha =&& +1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2\\
        &                && -3 + 4-3 + 4-3 + 4-3 + 4-3 + 4-3 
\end{alignat*}\\
\begin{alignat*}{2}
a \quad &: \quad \beta  =&& +4+4+4+4+4+4+4+4+4+4+4+4+4+4+4 \\
        &                && +4+4+4+4+4+4
\end{alignat*}
\end{gather*}
\end{document}
| improve this answer | |
  • But this way the left part (the colons) are not aligned – BillyJean Jun 30 '14 at 14:26
  • @BillyJean - I had understood your request as stating that the first and second lines should be aligned, as should be the third and fourth lines, but that lines 1&2 should not share any alignment points with lines 3&4. If this understanding is incorrect, please indicate what you want instead. – Mico Jun 30 '14 at 14:30
  • 1
    I don't understand whether there's to be 1 or 4 α's? – Bernard Jun 30 '14 at 15:16

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.