Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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 at 15:36
    
@Mico Bernard's answer is just what I am looking for. Sorry for not being clearer –  BillyJean Jun 30 at 15:55
add comment

2 Answers 2

up vote 2 down vote accepted

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

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

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}
share|improve this answer
    
But this way the left part (the colons) are not aligned –  BillyJean Jun 30 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 at 14:30
    
please see updated answer, thanks –  BillyJean Jun 30 at 14:37
1  
I don't understand whether there's to be 1 or 4 α's? –  Bernard Jun 30 at 15:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.