Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

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

1 Answer 1

up vote 8 down vote accepted

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

share|improve this answer
    
@jotagah A block like the second one would be printed incorrectly. –  egreg Apr 21 at 12:37
    
We can also to use \addtobeamertemplate{block begin}{\vspace*{-\baselineskip}\setlength\belowdisplayshortskip{0pt}} ? –  jotagah Apr 21 at 13:01
    
Egreg, l understand now the picture. –  jotagah Apr 21 at 13:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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