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.
\begin{align*}
    abcd &= abcd &(abcdefghijk)\\
         &= ab   &(ab)
\end{align*}

After the first ampersand the equal signs are aligned. However, after the second ampersand, the closing parentheses ")" are aligned. I'd like the opening parenthesis "(" to be aligned instead. Is there an optional argument like that for align? Am I using the wrong environment? Should I define a new one instead?

Incidentally, how can I avoid having that much white space in between these two?

enter image description here

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

1. align:

The align environment provides pairs or rl aligned equations. So, in normal usage the first & make the content on the left, be right aligned and the content on the right be left aligned. So, you need to insert an additional & to make the second left aligned:

enter image description here


2. alignat:

If you want to control the spacing between them, I would recommend you use the alignat environment. Similar, to align, it also provides pairs of rl aligned equations, but unlike align the alignat does not insert additional horizontal spacing in between:

enter image description here

In the above, I inserted a \quad space, without which it looks like:

enter image description here

References:


Code:

\documentclass{article}
\usepackage{amsmath}


\begin{document}
\begin{align*}
    abcd &= abcd &&(abcdefghijk)\\
         &= ab   &&(ab)
\end{align*}

\begin{alignat*}{2}
    abcd &= abcd &\quad &(abcdefghijk)\\
         &= ab   &\quad &(ab)
\end{alignat*}

\begin{alignat*}{2}
    abcd &= abcd &&(abcdefghijk)\\
         &= ab   &&(ab)
\end{alignat*}
\end{document}
share|improve this answer
    
Fantastic! And thank you for the reference! –  Gal Nov 11 '12 at 6:41
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.