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've been trying to customize the footline in a beamer template but when I added a fourth box, the spacing went wacko.

Here's my template:

\DeclareOptionBeamer{compress}{\beamer@compresstrue}
\ProcessOptionsBeamer

\mode<presentation>

\useoutertheme[subsection=false]{miniframes}

% Define colors
\definecolor{beamer@blendedblue}{RGB}{26,89,142}
\definecolor{beamer@darkblue}{RGB}{17,59,94}

% Title block
\setbeamercolor*{title}{use=structure,fg=white,bg=beamer@darkblue}
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true,shadow=true]

% Bottom infolines
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
% Name and institution
\begin{beamercolorbox}[wd=0.3\paperwidth,ht=2.3ex,dp=1.25ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
% Short title
\begin{beamercolorbox}[wd=0.4\paperwidth,ht=2.3ex,dp=1.25ex,center]{author in head/foot}%
\usebeamerfont{anthor in head/foot}\insertshorttitle
\end{beamercolorbox}%
% Date
\begin{beamercolorbox}[wd=0.2\paperwidth,ht=2.3ex,dp=1.25ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshortdate{}
\end{beamercolorbox}
% Frame counter

\begin{beamercolorbox}[wd=0.1\paperwidth,ht=2.3ex,dp=1.25ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertframenumber{}\hspace*{1pt}/\hspace*{1pt}\inserttotalframenumber
\end{beamercolorbox}}%
\vskip0pt%
}

% Set themes
\useinnertheme{circles}
\usecolortheme{whale}
\usecolortheme{orchid}

% Set colors
\setbeamercolor{structure}{fg=beamer@blendedblue}
\setbeamercolor{titlelike}{parent=structure}
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{title}{fg=white}
\setbeamercolor{item}{fg=beamer@blendedblue}

\mode
<all>

And my MWE is:

\documentclass[compress]{beamer}

\usetheme{Bread} % Custom theme (listed above)

\title[Uncertainty in Life]{Uncertainty in Life}
\author[Mr. Smith]{John Smith}
\institute[UN]{University of Nowhere}
\date{November 28, 2012}

\begin{document}
\begin{frame}
\end{frame}
\end{document}

As you can tell from the example, there is a slight space between the first and second box, and a large space between the third and fourth box.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You forgot to add a % at the end of \end{beamercolorbox} on the third box, just on the line above the % Frame counter comment line.

Remember that newline characters count as a space, so adding a comment right at the end of the line sometimes fixes spacing issues as in this case. Also, take into account that blank lines instruct the TeX engine to start a new paragraph.

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