14

I want to reduce the white space (above and below) when I insert an equation environment in a beamer block.

\documentclass{beamer}
\usetheme{Antibes}
\usepackage{amsmath}

\begin{document}

\begin{frame}

\begin{block}{Separation of variables}
\setlength\abovedisplayskip{0pt}
\begin{equation}
1 + 2 = 3
\end{equation}
\end{block}

\end{frame}

\end{document}

enter image description here

I searched the web of course but the solutions I found do not seem to work (like \setlength\abovedisplayskip{0pt}).

What I found and should have worked:

  • Do you mean the whitespace around the equation nside the block, or the whitespace around the whole block? – Johannes_B Apr 21 '14 at 11:16
  • I updated the picture :) – Dr. Manuel Kuehner Apr 21 '14 at 11:41
  • Thanks Steven. egreg's answer explained the paragraph problem. I was just wondering why the abovedisplayskip parameter had no effect. – Dr. Manuel Kuehner Apr 21 '14 at 12:30
18

A displayed equation should never be at the top of anything. The problem is that a paragraph is started and then the equation is typeset.

\documentclass{beamer}
\usetheme{Antibes}
\usepackage{amsmath}

\begin{document}

\begin{frame}

\begin{block}{Separation of variables}
\vspace*{-\baselineskip}\setlength\belowdisplayshortskip{0pt}
\begin{equation}
1 + 2 = 3
\end{equation}
\end{block}

\begin{block}{Separation of variables}
Some text
\end{block}

\end{frame}

\end{document}

enter image description here

  • @jotagah A block like the second one would be printed incorrectly. – egreg Apr 21 '14 at 12:37
  • We can also to use \addtobeamertemplate{block begin}{\vspace*{-\baselineskip}\setlength\belowdisplayshortskip{0pt}} ? – jotagah Apr 21 '14 at 13:01
  • Egreg, l understand now the picture. – jotagah Apr 21 '14 at 13:08
  • 1
    @TroyWoo \vspace* inserts a vertical space that's not removed at page breaks. In this case probably \vspace would be good as well. – egreg May 28 '15 at 9:42
  • 1
    @TroyWoo There are many possible roads; a well written LaTeX guide is a good starting point. Look at dickimaw-books.com/latexresources.html – egreg May 28 '15 at 10:30

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.