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 am using some independant align environments directly one after the other one and it produces some nasty space between them. Is there any workaround to shrink the size of the space a little bit?

Example: Example

My code looks like this:

\newcounter{eqn}[section]
\newcommand{\eqn}{\refstepcounter{eqn}\tag{\thesection.\arabic{eqn}}}
\newcommand{\xeqn}[1]{\begin{align}\eqn #1\end{align}}
...
\xeqn{foo}
\xeqn{bar}
\xeqn{random}
share|improve this question
    
Please post you code so we can comment on it. You are probably leaving a blank line in between the align environments. –  Peter Grill Sep 13 '11 at 16:14
add comment

2 Answers

up vote 5 down vote accepted

Use the gather environment:

\begin{gather}
\text{$x>y$ genau dann, wenn $x-y\in P$,}\\
\text{$x\ge y$ genau dann, wenn $x>y$ oder $x=y$,}\\
\text{$x<y$ genau dann, wenn $y-x\in P$,}\\
\text{$x\ge y$ genau dann, wenn $x<y$ oder $x=y$,}
\end{gather}

Never use two consecutive math environments.

share|improve this answer
    
Works, but i have "problems" with the tags/numering as i use a very weird method... can you explain me how to adjust the gather code for my needs and my posted code? - EDIT Inserted \eqn before every line and it works! Thanks! –  Christian Ivicevic Sep 13 '11 at 16:23
    
Don't use \eqn, but rather follow barbara's suggestions. –  egreg Sep 13 '11 at 17:56
add comment

@egreg's recommendations to use the gather environment, and never to use two consecutive math environments, are seconded.

if all (numbered) equations are to be numbered the same way as these, there's a much simpler method: put the command

\numberwithin{equation}{section}

in your preamble and forget about \tag and the definitions for \eqn and \xeqn which would no longer be needed. read the manual for amsmath on this topic -- texdoc amsmath if you have a tex live installation, or follow this link.

share|improve this answer
add comment

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.