5

I first learnt to use LaTeX using the equation environment, and liked to set out my .tex document with spacing around equations. Now that I use the align environment, putting this additional space before an align will make a large space in my document (compared to a barely noticeable space), which I do not like. Is there a way to edit aligns so that they have behave similarly to equations in this respect?

For example:

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}

    text text text text text text text text text text text text 
    \begin{equation*}
        a+b=c
    \end{equation*}

    text text text text text text text text text text text text 
    \begin{align*}
        a+b=c
    \end{align*}

    text text text text text text text text text text text text 

    \begin{equation*}
        a+b=c
    \end{equation*}

    text text text text text text text text text text text text 

    \begin{align*}
        a+b=c
    \end{align*}

    text text text text text text text text text text text text 


\end{document}
2
  • Are you interested in an automated way to always remove any vertical space prior/after an align environment?
    – Werner
    Aug 30, 2014 at 2:42
  • The same is true of equation you should never leave a blank line before an equation environment, it makes a blank line that looks like extra vertical space but is actually a line box and will not be discarded even at the top of a page. Aug 30, 2014 at 7:33

1 Answer 1

6

You should not leave empty lines before and after environments like equation align etc to keep the spacing consistent. If you want your code to be more readable, you may put a % instead of blank line. For example see the following and compare your out put with this:

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}

    text text text text text text text text text text text text
    \begin{equation*}
        a+b=c
    \end{equation*}
     %
    text text text text text text text text text text text text
    \begin{align*}
        a+b=c
    \end{align*}
    %
    text text text text text text text text text text text text
    %
    \begin{equation*}
        a+b=c
    \end{equation*}
    %
    text text text text text text text text text text text text
    %
    \begin{align*}
        a+b=c
    \end{align*}
    %
    text text text text text text text text text text text text


\end{document}

enter image description here

These environments add \abovedisplayskip above and belowdisplayskip below (there is also \abovedisplayshortskip...) If you leave empty spaces, these spaces will be added to the \parskip and you are bound to get inconsistent spacing.

Don't add blank lines before and after

You must log in to answer this question.

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