I'm looking to write an equation (using gather), with some constraints on the right-hand side.

Ideally, I'd like the equations to be horizontally-aligned with one another (i.e. have centers line-up vertically in a given equation grouping), and the constraints following similar behaviour, but at the right-hand-side of the page, inside the right-margin.

edit:The equation alignment should also be consistent with the rest of the document.

The following is an example of (almost) the kind of behaviour I'm looking for, using the \tag command, but note that the length of the first tag has moved the first equation, and that the tags are right-aligned as opposed to centred in some abstract column near the right-hand side. Here's a minimal example:

a^2 + b^2 = ab \tag{$(a \in \{z,y,x,w,v,u\},\ b \neq 0)$}\\
\text{centered fine}\tag{short}

I'm happy to redefine \tag as long as it's not going to affect any of the equation-numbering elsewhere.


If the longest constraint needs to be flushed to the right margin, you could use a tabular* environment with two centered columns; something along these lines (change the lengths according to your needs):




  a^2 + b^2 = ab & (a \in \{z,y,x,w,v,u\},\ b \neq 0) \\
  a + b = c & (a \in \{z,y\},\ b = 0) \\


If the longest constraint doesn't need to be flushed to the right margin, a simple array environment will do the job (change the lengths according to your needs):



  a^2 + b^2 = ab & (a \in \{z,y,x,w,v,u\},\ b \neq 0) \\
  a + b = c & (a \in \{z,y\},\ b = 0) \\

  • Thank you. However, I wanted my equations to look consistent with other equations nearby (horizontal alignment) --- I've edited my question to account for this. – Nick Loughlin Jun 14 '11 at 19:30

As you don't need alignment at relation symbols, but centered alignment, you could use an array environment with c columns.

I considered putting two gathered environments next to each other, however, in contrast to an array, alignment of the baselines would not be guaranteed.


Does this do anything like what you want?



    a^2 + b^2 = ab, & a \in \{z,y,x,w,v,u\},\ b \neq 0 \\
    a + b = 0, & b \neq 0


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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