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}
  • Are you interested in an automated way to always remove any vertical space prior/after an align environment? – Werner Aug 30 '14 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. – David Carlisle Aug 30 '14 at 7:33
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.