TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With the following MWE, I have 2 columns:

\documentclass[12pt, a4paper]{scrartcl}
4   &= 4 && \text{yes}\\
0   &= 0 && \text{no}\\
1+1 &= 2 && \text{maybe}

But I would like to control the hspace between the 2 columns, possibly, with only one command call for the whole align, rather than one for each line.

share|improve this question
You could use an array environment instead and then {rl@{\quad}l} for the column specificator. – Martin Scharrer Jan 5 '12 at 10:47
Have you seen this Question stackoverflow.com/questions/4361275/… ? it at least is able to reduce the space between the first 3 columns (your equations) and the second column, where you put the text. – Ronny Jan 5 '12 at 10:49
@Ronny The question is also on TeX.SX: tex.stackexchange.com/questions/6572/… – egreg Jan 5 '12 at 11:56
up vote 10 down vote accepted

You can use the alignat environment, that gives full control over the alignment:

4   &= 4\qquad && \text{yes}\\
0   &= 0\qquad && \text{no}\\
1+1 &= 2\qquad && \text{maybe}

enter image description here

Actually only the widest entry in the second column needs the padding, but it's easier to specify it on each one.

The "2" refers to the number of "left hand side-right hand side" groups you need.

A more general solution is to define a new environment:


4   &= 4 & 1+3+5 &= 9\\
0   &= 0 & 2+1   &= 3\\
1+1 &= 2 & 1     &= 1

You have both royalign and royalign*; you can check that the spacing is exactly what you specify in the argument.

share|improve this answer
yes, this solution is good for the situation "one column of equations + one column of text". But for two column of equations, this is not optimal, since one has to put a hspace which depends on the largest entry of the right hand side terms of the left hand side column. I would prefer to say " i want 1 cm between the 2 columns of equations", independently of their content. Am i clear ? – nicolas roy Jan 5 '12 at 17:30
by the way, i don't see any influence of the parameter "2"... – nicolas roy Jan 5 '12 at 17:35
@nicolasroy See edit. – egreg Jan 5 '12 at 18:10
My apologize for being so late in answering. Thanks for the solution, it works very well. Could you just tell me, why you use \NewEnviron ? What does it bring in contrast to \newenvironment{royalign}{\royalignsep@ ... \begin{align}}{\end{align}} – nicolas roy Jan 9 '12 at 20:32
@nicolasroy It's the usual problem about align, where TeX has to "see" the precise sequence of tokens \end{align} in order to decide when the environment ends, since it has to collect the contents and measure it. Actually, \NewEnviron is inspired by amsmath's method: it collects the environments contents and, in this case, it passes it to align. – egreg Jan 9 '12 at 20:35

use the old xalignat environment if it could be left aligned

\documentclass[12pt, a4paper]{scrartcl}
4   &= 4 && \text{yes}\\
0   &= 0 && \text{no}\\
1+1 &= 2 && \text{maybe}
share|improve this answer

Your Answer


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.