I can't understand how to dimension minipages or columns in a beamer frame.
Creating a single column with width \textwidth
or \linewidth
(or 2 columns with width 0.5 \textwidth
or 0.5\linewidth
) causes horizontal overful as you can see in the picture where frame boundaries have been highlighted
MWE:
\documentclass{beamer}
\usepackage{showframe}
\usepackage{lipsum}
\usepackage{ragged2e}
\begin{document}
\begin{frame}
\justifying
\lipsum[75]
\fbox{
\begin{minipage}[t]{1\textwidth}
mp1
\end{minipage}}
\fbox{
\begin{minipage}[t]{1\linewidth}
mp2
\end{minipage}}
\begin{columns}
\fbox{
\begin{column}{1\textwidth}
c1
\end{column}}
\end{columns}
\begin{columns}
\fbox{
\begin{column}{0.5\textwidth}
c1
\end{column}}
\fbox{
\begin{column}{0.5\textwidth}
c2
\end{column}}
\end{columns}
\fbox{
\begin{minipage}[t]{0.5\textwidth}
mp1
\end{minipage}}
\fbox{
\begin{minipage}[t]{0.5\linewidth}
mp2
\end{minipage}}
\end{frame} %
\end{document}
Best Answer
The good news is: it seems, as if you did set up your
column
s and yourminipage
s correct.The bad new is: you didn't take care of suppressing unwanted white spaces and you forgot that the fbox always adds a small gap between the box and its frame.
To prevent the unwanted white spaces, you should use the comment character (
%
) frequently (at the important places, especially line ends!).To prevent the gap between the box and its frame, just set the dimen
\fboxsep
to be0pt
. This works rather well, but in case, you put a fbox next to another fbox, you'll have to take the linewidth of the frames into account. I added an example at the end of my MWE, to show the effect and how to prevent it.In case of the
column
s: Placing the\fbox
at the correct place in the code seems to be important. You have to frame thecolumn
-environment, not a singlecolumns
.Here is my enhanced MWE of yours:
This is the result: