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 was wondering whether it would be possible to remove some unnecessary space after flalign* environment. I tried using \belowdisplayskip, but to no avail.

Below is the sample input.

{\setlength{\abovedisplayskip}{0pt}
\begin{flalign*}
x\mathbf{e}_1 + y\mathbf{e}_2 &= x\mathbf{f}_2 + y(-\mathbf{f}_1 - \mathbf{f}_2) &\\
  &= -y\mathbf{f}_1 + (x-y)\mathbf{f}_2 &\\
  &= w\mathbf{f}_1 + z\mathbf{f}_2  &
\end{flalign*}}
where $w = -y$ and $z = x - y$.

Here's the corresponding output:

enter image description here

share|improve this question
    
Welcome to TeX.SE. Simply adding \setlength{\belowdisplayskip}{0pt} right after \setlength{\abovedisplayskip}{0pt} seems to do it for me. But perhaps there is something else going on, so keep in mind that while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Mar 5 '13 at 18:50
    
Hey, it doesn't work in my case. Anyway, introducing the new environment as shown in the answer works for me. Thanks anyway. –  Markeur Mar 5 '13 at 19:05

1 Answer 1

up vote 4 down vote accepted

You miss setting also \belowdisplayskip. However, as it's clear from the image, a spurious space will be inserted. You're better served with a new environment:

\documentclass{article}
\usepackage{amsmath}

\newenvironment{nospaceflalign*}
 {\setlength{\abovedisplayskip}{0pt}\setlength{\belowdisplayskip}{0pt}%
  \csname flalign*\endcsname}
 {\csname endflalign*\endcsname\ignorespacesafterend}

\begin{document}
Some irrelevant text above
\begin{nospaceflalign*}
x\mathbf{e}_1 + y\mathbf{e}_2 &= x\mathbf{f}_2 + y(-\mathbf{f}_1 - \mathbf{f}_2) &\\
  &= -y\mathbf{f}_1 + (x-y)\mathbf{f}_2 &\\
  &= w\mathbf{f}_1 + z\mathbf{f}_2  &
\end{nospaceflalign*}
where $w = -y$ and $z = x - y$.
\end{document}

Using \csname flalign*\endcsname in this case is necessary because the environment has a * in its name and the \begin{flalign*} form can't be used for technical reasons related to how amsmath processes alignment environments.

With \ignorespacesafterend we solve the spurious space issue. If later you want to modify the rendering, it will be easier to act on the definition, rather than on the document.

enter image description here

share|improve this answer
    
It works for me. Thanks very much for the solution. –  Markeur Mar 5 '13 at 19:05

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.