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.

Possible Duplicate:
Align to center

I want to align some equations to the equal signs, so I wrote this:

\begin{align}
            -3z &= -9\\ 
              z &=  3\\
        -3y-3*3 &=  3\\ 
              y &= -4\\
  2x+8*(-4)+4*3 &=  2\\ 
              x &= 11
\end{align}

However, because one equation is much longer than the others, all the equations appear somewhat at the right of the page.

Screenshot

How can I make the equal signs appear in the middle of the page, while still aligning all the equations to them?

share|improve this question

migrated from stackoverflow.com Sep 2 '12 at 12:12

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Harish Kumar, lockstep, Stephan Lehmke, morbusg, Werner Sep 2 '12 at 13:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  percusse Sep 2 '12 at 12:42

1 Answer 1

One possibility is to make the long expression occupy no space:

\begin{align}
            -3z &= -9\\ 
              z &=  3\\
        -3y-3*3 &=  3\\ 
              y &= -4\\
  \makebox[0pt][r]{$\displaystyle 2x+8*(-4)+4*3$} &=  2\\ 
              x &= 11
\end{align}
share|improve this answer
    
@HarishKumar No, it's more of a simple answer to the original reason "one equation is much longer than the others". Of course one could wrap every expression like this (for instance with a dedicated command), then it would be completely centered. –  Stephan Lehmke Sep 2 '12 at 12:59
    
If the OP really needs complete centering, then probably a patch to \align is required. I'll wait for comments. –  Stephan Lehmke Sep 2 '12 at 13:00
    
@HarishKumar Just noticed. I think Werners answer is much better (and more work). –  Stephan Lehmke Sep 2 '12 at 13:04
    
If you have a patch to align in mind, please add it to the the other question. –  Harish Kumar Sep 2 '12 at 13:13