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.

How can I let the following code look good ?

\begin{align*}
&\text{Als} &&a,b \in H\\ 
&\Rightarrow   &&a,b\in H_1 \land a,b \in H_2 &&\text{Definitie van doorsnede}\\
&\Rightarrow  &&ab^{-1}\in H_1 \land ab^{-1}\in H_2 &&\text{Group axioma's}\\
&\Rightarrow  &&ab^{-1}\in H  &&\text{Definitie van intersectie}\\
&\Rightarrow  &&H\leq G &&\text{Ondergroep test}
\end{align*} 

No there is just way too much whitespace. Is there a way to control the amount of whitespace ?

Hm.. in codecogs it does look good. So this is how I would want it to look:

Image

share|improve this question

1 Answer 1

up vote 3 down vote accepted

the desired result can be produced by alignat* -- but then you have to manage the spacing yourself:

\begin{alignat*}{4}
&\text{Als}\quad  &&a,b \in H\\ 
&\Rightarrow {} &&a,b \in H_1 \land a,b \in H_2 &&\text{Definitie van doorsnede}\\
&\Rightarrow {} &&ab^{-1} \in H_1 \land ab^{-1}\in H_2 \quad &&\text{Group axioma's}\\
&\Rightarrow {} &&ab^{-1} \in H  &&\text{Definitie van intersectie}\\
&\Rightarrow {} &&H \leq G &&\text{Ondergroep test}
\end{alignat*} 

edit: a look at the amsmath documentation would be salutary -- texdoc amsldoc on a tex live system.

the (required) argument after \begin{alignat} was introduced to make it possible to determine (for ease of macro programming, it appears) the width of a particular single column so that it can be treated in a special manner if necessary. the value is equal to the number of &s in the line with the most, minus one. an alternate method of calculating the value is given in the user's guide cited above.

share|improve this answer
    
aaah thanks, looks great! why {4} after alignat ? –  Kasper Apr 1 '13 at 12:30

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.