# How to decrease the vertical spacing between formula and text in beamer?

Too much spacing between formula and text in beamer. When I insert the command \vspace{-0.5cm} before the formula, the spacing decreases. But the command \vspace{-0.5cm} after the formula has no effect on the spacing between the formula and the text after it. How to solve it?

• How are you inserting the formula? Use simple text \begin{equation}\end{equation} followed by text. Or replace equation by other math environments. Don't leave blank lines between the text before and the math. Neither after, unless you want a new paragraph. – Sigur Dec 25 '14 at 13:21
• @Sigur My code is :\vspace{-0.5cm}[\int_a^b f(x)\,dx= f(\xi)(b-a).] \vspace{-0.5cm} but it dosen't work well. – longtemps Dec 25 '14 at 13:34
• I suggest you to use text above $\int_a^b f(x)\,dx= f(\xi)(b-a).$ Text after... – Sigur Dec 25 '14 at 13:37
• @Sigur Too much spacing between the formula and text in this case. – longtemps Dec 25 '14 at 13:39
• did you try \setlength\abovedisplayskip{0pt}? – JuanPi Jan 11 '16 at 0:53

You can influence the spacing with \abovedisplayshortskip and \belowdisplayshortskip. However the default spacing above the equations is already pretty tight, I would not decrease it further.

\documentclass{beamer}

\title{Title}

\begin{document}
\begin{frame}
text above
$\int_a^b f(x)\,dx= f(\xi)(b-a).$
Text after
\end{frame}

\begin{frame}
\setlength{\abovedisplayshortskip}{-1pt}
\setlength{\belowdisplayshortskip}{0pt}
text above
$\int_a^b f(x)\,dx= f(\xi)(b-a).$
Text after
\end{frame}
\end{document}
• Not sure if I should ask a new question, so for now let me try commenting this. Same problem as in the question, solved using this answer. But, even if I define \setlength{\belowdisplayshortskip}{0pt} globally, it will only affect some equations, but others left as before. Any idea what could be happening? – Edu Aug 27 '18 at 16:48
• @Edu Maybe try to change belowdisplayskip as well? If this is not helping a new questions including a MWE would be good. – user36296 Aug 27 '18 at 16:52