# Question about vertical spaces used by $…$ and align* and how to reduce these

When using $...$ I noticed sometimes the vertical space used is larger than in other cases that also uses $...$. I do not understand why this is the case. Here is an example

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
The solution found in (1) now becomes%
$f\left( x\right) e^{bx}=F\left( x\right)$
Then (1) becomes%
$u\left( t,x\right) =e^{-at}e^{bx}f\left( x-ct\right)$
QED.
\end{document}


which gives

The first equation uses more space above and below than the second equation.

Question: Is it possible to make $..$ use smaller vertical space above and below the equation, just like in case B?

Also, when using align, the spaces in both cases now becomes the same.

Question: Can one reduce this vertical space as well to be as in case B above?

Here is MWE for align

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
The solution found in (1) now becomes%
\begin{align*}
f\left(  x\right)  e^{bx}&=F\left(  x\right)
\end{align*}
Then (1) becomes%
\begin{align*}
u\left(  t,x\right)  =e^{-at}e^{bx}f\left(  x-ct\right)
\end{align*}
QED.
\end{document}


Here screen shot side by side showing the difference:

ps. I know about savetrees package, but it had some side effects I did not like so I do not want to use it for this purpose.

Using Tl 2019

• (i) change \abovedisplayskip, (ii) use only amsmath environments which not consider \abovedisplayshortskip . See tex.stackexchange.com/questions/385774/… – Zarko Sep 6 '19 at 6:16
• equation has a build in space saving feature that align does not (reason why I always instruct users to typeset one-liners with equation(*). – daleif Sep 6 '19 at 9:12

You have two solutions to use every now and then \abovedisplayshortskip in the place of \abovedisplayskip: the \useshortskip command from nccmath just before entering the amsmath environment, or \SwapAboveDisplaySkip from mathtools after entering the environment. Note however that if the line above is too long, the result can be ugly.

Demo:

\documentclass[12pt]{article}
\usepackage{mathtools, nccmath}

\begin{document}

The solution found in (1) now becomes%
$f\left( x\right) e^{bx}=F\left( x\right)$
Then (1) becomes\
$u\left( t,x\right) =e^{-at}e^{bx}f\left( x-ct\right)$
QED.
\newpage

The solution found in (1) now becomes%
\begin{align*}
f\left( x\right) e^{bx}&=F\left( x\right)
\end{align*}
Then (1) becomes\useshortskip%
\begin{align*}\SwapAboveDisplaySkip
u\left( t,x\right) =e^{-at}e^{bx}f\left( x-ct\right)
\end{align*}
QED. \bigskip

Then (1) becomes the following equation:\useshortskip%
\begin{align*}
u\left( t,x\right) =e^{-at}e^{bx}f\left( x-ct\right)
\end{align*}
QED.

\end{document}