I want to use the block environment together with the column environment in a beamer document.
The margin/spacing is getting wrong/ugly in this combination. I want that the blocks are exactly as wide as a normal text would occupy (so that the
text margins are still correct).
\documentclass{beamer}
\setbeamersize{text margin left=5mm}
\setbeamersize{text margin right=5mm}
\setbeamercolor{block title}{fg=white,bg=red}
\setbeamercolor{block body}{fg=black,bg=gray}
\setbeamercolor{background canvas}{bg=yellow}
\begin{document}
% Frame 1 -----------------------
\begin{frame}
\frametitle{No Column Environment}
\begin{block}{Block Title}
Block Text.
\end{block}
\end{frame}
% Frame 2 -----------------------
\begin{frame}
\frametitle{Column Environment -- Only Left Block Environment}
\begin{columns}
\column{.50\textwidth}
\begin{block}{Block Title}
Block Text.
\end{block}
\column{.50\textwidth}
\color{blue}\vrule width\textwidth height\textwidth
\end{columns}
\end{frame}
% Frame 3 -----------------------
\begin{frame}
\frametitle{Column Environment -- Left and Right Block Environment}
\begin{columns}
\column{.50\textwidth}
\begin{block}{Block Title}
Block Text.
\end{block}
\column{.50\textwidth}
\begin{block}{Block Title}
Block Text.
\end{block}
\end{columns}
\end{frame}
% Frame 4 -----------------------
\begin{frame}
\frametitle{Column Environment Only}
\begin{columns}
\column{.50\textwidth}
\color{blue}\vrule width\textwidth height\textwidth
\column{.50\textwidth}
\color{blue}\vrule width\textwidth height\textwidth
\end{columns}
\end{frame}
\end{document}
The reason for the yellow background is, so that it is clear where the page has its borders.
Trying the idea from samcarter in one of the comments leads to.
\begin{frame}
\begin{columns}[onlytextwidth]
\begin{column}{.45\textwidth}
\begin{block}{Block Title} Block Text.
\end{block}%
\end{column} \hfill%
\begin{column}{.45\textwidth}
\begin{block}{Block Title} Block Text.
\end{block}
\end{column}
\end{columns}
\begin{block}{Block Title}
Block Text.
\end{block}
\end{frame}
Bug?! I Opened an Issue on GitHub
- I opened an issue on github: https://github.com/josephwright/beamer/issues/381
- Update [2020-02-17]: The issue was closed on 22 Aug 2017 :).



.47\textwidthso that there is a gap. Maybe the manual will help you figure out the correct (not ad hock dreamt up) values . . . – DG' Mar 02 '17 at 20:26onlyextwidthis an old problem of the rectangular blocks, does not happen with rounded blocks. I think we already had this questions somewhere... I'm going to search – samcarter_is_at_topanswers.xyz Mar 02 '17 at 20:34\setbeamertemplate{blocks}[rounded][shadow=false]) it doesn't jump. – DG' Mar 02 '17 at 20:45