4

There is an extra space between the section and the align* parts of the page. This does not occur if the equation is simply enclosed in \[...\].

\documentclass{article}

\usepackage[fleqn]{amsmath}

\setlength{\mathindent}{0cm}

\begin{document}
\section{Test}
\[
  a^2 + b^2 = c^2
\]
\section{Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
\end{document}

Which yields: pdf

I could just raise up the align* environment using a negative \vspace, but I was wondering if there is a more proper way.

EDIT:

Having defined:

\newcommand{\A}[1]{{\setlength{\abovedisplayskip}{0pt}\begin{align*}#1%
  \end{align*}}}

I replaced the necessary \begin{align*}...\end{align*} with \A{...} and now I am getting this (this is my actual document): larger bottom space

What could be causing this larger bottom space?

2
  • 2
    align (and align*) has \abovedisplayskip space above, which is an elastical length, being about 10pt ;-) This is true for equation etc. as well. You could say \abovedisplayskip=0pt, of course, in a group preferably
    – user31729
    Feb 4, 2016 at 22:47
  • I can't reproduce the problem, but just in case, you could use the \useshortskip command fromm nccmath, just before the align environment.
    – Bernard
    Feb 4, 2016 at 23:01

1 Answer 1

6

align and align* use a vertical skip amount of about 10pt above the environment. This can be set to 0pt, but this should be done within a group, i.e. use

{%
\abovedisplayskip=0pt%
 \begin{align*}
  ...
 \end{align*}
}%

Please note, that there's \belowdisplayskip as well, having the analogous meaning for the space below the environment. Reducing just one of the skip register values may lead to a non-eye-appealing look of the output.

Setting both to 0pt is not recommended.

\documentclass{article}

\usepackage[fleqn]{amsmath}

\setlength{\mathindent}{0cm}

\begin{document}
\section{Test}
\[
  a^2 + b^2 = c^2
\]
\section{Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
Some other text

\section{Another Test}
{%
  \abovedisplayskip=0pt
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
}%
Some other text


\section{Another Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
Some other text


\end{document}
6
  • I'll create a custom command to handle that. Thanks! Feb 4, 2016 at 22:57
  • This is creating some extra bottom space for me. Is there a fix for that? Feb 4, 2016 at 23:58
  • @cabellicar123: I don't see extra bottom space
    – user31729
    Feb 5, 2016 at 0:00
  • See edit. I'm not quire sure what is causing it as it doesn't seem to appear in your example. Feb 5, 2016 at 0:14
  • @cabellicar123: I don't think wrapping align* in a extra command is a good idea, but are you sure that this extra space isn't the sum of the \belowdisplayskip and some skip above the next section title?
    – user31729
    Feb 5, 2016 at 0:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .