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'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

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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}
share|improve this answer
    
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 May 9 at 3:28
1  
@Charlie: Have updated solution for that. It is the same problem as there was with the header. –  Peter Grill May 9 at 4:02
    
Problem solved! Thanks :) –  Charlie May 9 at 4:11

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}
share|improve this answer

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.