4

I'm creating a presentation using beamer and I've detected a slight size inconsistency of a block located in a second column or minipage.

I want to align two blocks with the same amount of bullets and lines using columns or minipage (actually both produce the same result), but the title bar of right block is bigger than the left one. This causes the blocks to be slightly misaligned.

The theme I want to use is marburg, with the rose theme color.

Here I provide a picture showing the phenomenon and the MWE code.

Blocks misaligned

\documentclass[serif]{beamer}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{mathpazo}
\linespread{1.05} 
\setbeamertemplate{navigation symbols}{}
 \usetheme[hideallsubsections,left,width=2cm]{Marburg}

\usecolortheme{rose}
 \setbeamercolor{titlelike}{bg=structure,fg=white}

\begin{document}
\section{Lorem Ipsum}

\begin{frame}
\begin{minipage}{0.45\textwidth}
    \begin{block}{\hfill Razones}

    \begin{itemize}
    \item Reducción del torque resistente. 
    \item Daños en la fuente original
    \end{itemize}
    \end{block}

\end{minipage}
\hfil
\begin{minipage}{0.45\textwidth}
    \begin{exampleblock}{\hfill Expectativa}
     \begin{itemize}
    \item Reducción de canales de alimentación.
    \item Tensión de alimentación estable.
    \end{itemize}
    \end{exampleblock}

\end{minipage}
\end{frame}

\end{document}

Any suggestions? Thanks in advance,

Charlie

2 Answers 2

8

Add a \strut and the [t] option to the minipage:

enter image description here

or you can add a \vphatom{p} to the first block to get slightly tighter spacing:

enter image description here

Notes:

  • The cause of this is that the second block has a p which goes below the baseline, and hence adding the \vphatom{p} to the first block does the trick.
  • The reaason why the blocks are of different heights is also for the same reason: The last line on the left has a g and the one on the right has no content with descenders. This also can be fixed by adding a \strut to both of the last lines, or a \vphantom{g} to the last line on the left block.

Code: \strut

\documentclass[serif]{beamer}

%\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{mathpazo}
\linespread{1.05} 
\setbeamertemplate{navigation symbols}{}
 \usetheme[hideallsubsections,left,width=2cm]{Marburg}

\usecolortheme{rose}
 \setbeamercolor{titlelike}{bg=structure,fg=white}

\begin{document}
\section{Lorem Ipsum}

\begin{frame}
\begin{minipage}[t]{0.45\textwidth}
    \begin{block}{\hfill Razones\strut}

    \begin{itemize}
    \item Reducción del torque resistente. 
    \item Daños en la fuente original\strut
    \end{itemize}
    \end{block}

\end{minipage}
\hfil
\begin{minipage}[t]{0.45\textwidth}
    \begin{exampleblock}{\hfill Expectativa\strut}
     \begin{itemize}
    \item Reducción de canales de alimentación.
    \item Tensión de alimentación estable.\strut
    \end{itemize}
    \end{exampleblock}

\end{minipage}
\end{frame}

\end{document}

Code: \vphantom{p}:

\documentclass[serif]{beamer}

%\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{mathpazo}
\linespread{1.05} 
\setbeamertemplate{navigation symbols}{}
 \usetheme[hideallsubsections,left,width=2cm]{Marburg}

\usecolortheme{rose}
 \setbeamercolor{titlelike}{bg=structure,fg=white}

\begin{document}
\section{Lorem Ipsum}

\begin{frame}
\begin{minipage}[t]{0.45\textwidth}
    \begin{block}{\hfill Razones\vphantom{p}}

    \begin{itemize}
    \item Reducción del torque resistente. 
    \item Daños en la fuente original
    \end{itemize}
    \end{block}

\end{minipage}
\hfil
\begin{minipage}[t]{0.45\textwidth}
    \begin{exampleblock}{\hfill Expectativa}
     \begin{itemize}
    \item Reducción de canales de alimentación.
    \item Tensión de alimentación estable.\vphantom{g}
    \end{itemize}
    \end{exampleblock}

\end{minipage}
\end{frame}

\end{document}
2
  • Now the title bar size matches the block at the left, but the block at the right is still bigger than the left one, even though they have the same amount of bullets and lines per bullets. Is there a way to solve this?
    – Charlie
    Commented May 9, 2014 at 3:28
  • 1
    @Charlie: Have updated solution for that. It is the same problem as there was with the header. Commented May 9, 2014 at 4:02
4

The word Razones has zero depth, the world Expectativa has a positive one. You can correct their behaviour, adding \strut, as it is shown.

\documentclass[serif]{beamer}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[spanish]{babel}
\usepackage{mathpazo}
\linespread{1.05} 
\setbeamertemplate{navigation symbols}{}
 \usetheme[hideallsubsections,left,width=2cm]{Marburg}

\usecolortheme{rose}
 \setbeamercolor{titlelike}{bg=structure,fg=white}

\begin{document}
\section{Lorem Ipsum}

\begin{frame}
\begin{minipage}{0.45\textwidth}
%    \begin{block}{\hfill Razones}
  \begin{block}{\hfill\strut Razones}

    \begin{itemize}
    \item Reducción del torque resistente. 
    \item Daños en la fuente original
    \end{itemize}
    \end{block}

\end{minipage}
\hfil
\begin{minipage}{0.45\textwidth}
    \begin{exampleblock}{\hfill Expectativa}
     \begin{itemize}
    \item Reducción de canales de alimentación.
    \item Tensión de alimentación estable.
    \end{itemize}
    \end{exampleblock}

\end{minipage}
\end{frame}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .