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 try to make a comment on the right (or left) of one line of proof. But the align* environment automatically move the whole equations to the left to leave space for the comment. But I still want the equations to be in the center (the comment is short enough that it won't be conflicting the equations). How could I achieve this?

To be more specific, I used the code

 \begin{align*}
 equation0 &= equation1
           &= equation2
           &= equation3 && \text{make a comment here}
           &= equation4
\end{align*}

I just want to put \text{make a comment here} on the right without affecting the original alignment of the equations.

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. BTW: Good first question! –  Kurt Apr 14 '13 at 0:46
add comment

1 Answer

up vote 13 down vote accepted

Omit the && and use \rlap{\text{make a comment here}}, which causes the comment to have no width "to the right", meaning it starts at the same place but doesn't actually take up any space in the alignment. For a comment on the left, use \llap instead of \rlap, which causes leftward space to be ignored.

In response to the question in the comment: in align* or equation* specifically (or any other unnumbered environment) you can hijack the "equation label" to contain a comment by using \tag*{\text{make a comment here}} rather than \rlap. This will place the comment on the left if amsmath was loaded with the leqno option. In a numbered equation, it is not a good idea to put something flush right.

share|improve this answer
    
It works perfectly! Thank you! –  user69818 Apr 14 '13 at 1:19
    
By the way, do you know how to make the "\rlap{\text{make a comment here}}" thing to the rightmost? It seems that \hfill or \raggedright does not work. –  user69818 Apr 14 '13 at 3:01
    
Added to the answer. –  Ryan Reich Apr 14 '13 at 3:05
    
Thanks for the answer. But before today I always used amsart and \tag to make comments on equations (by default of amsart, \tag appears on the left). But this time the comment is a bit longer that makes the equations move to the right. –  user69818 Apr 14 '13 at 3:12
2  
Instead of \rlap{...} I would recommend \makebox[0pt][l]{...} that's slightly less efficient but also less surprising in other contexts (try starting a paragraph with \rlap). –  egreg Apr 14 '13 at 8:37
show 5 more comments

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.