2

I'm using a customized template for Beamer. Among other things, I have completely rewritten the headline template. However, when I use a frame without title, the vertical alignment is not the same as in other slides with title. Surprisingly it works good regardless of if the title has one or two lines... It is hard to explain, but very easy to see in the example below. Note the wrong vertical alignment in the third slide. The interesting part is in line 68. Any idea what's going on here?

\PassOptionsToPackage{draft}{graphicx}
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{amsfonts}
\usepackage{cmbright}
\usepackage[T1]{fontenc}
\usepackage{etoolbox}
\usepackage{gnuplot-lua-tikz}
\usepackage{environ}
\usepackage{ulem}
\usepackage{textpos}

\makeatletter
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip0.5em}{}{}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%TWO COLOURS OF THE TEMPLATE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{azul}{rgb}{0.603,0.733,0.833}
\definecolor{verde}{rgb}{0.647,0.663,0.2.7}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING COLOURS IN SEVERAL ELEMENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{headline}{fg=black}
\setbeamercolor{footline}{fg=black}
\setbeamercolor{block body}{bg=azul}
\setbeamercolor{block title}{bg=verde,fg=black}
\setbeamercolor{item}{fg=verde}
\setbeamercolor{alerted text}{fg=Red}
\setbeamercolor{section in toc}{fg=azul}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING ASPECT OF DIVERSE FRAME ELEMENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\useoutertheme[]{default}

\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{subsection in toc}[square]
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{navigation symbols}{}
\setbeamercovered{invisible}
\setbeamertemplate{sections in toc}[ball]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING THE FOOTLINE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{
  \hspace{.6cm}
  \vspace{.2cm}
  \tikz \fill [azul] (0,0) rectangle (11.4, 2pt);

  \parbox[c][0.8cm][t]{\textwidth}{\hspace{3em} \scriptsize\bf 17 November 2014 $\rangle$ J.J. G\'omez-Navarro $\rangle$ edit the footline in the preamble}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%THIS THEME DISCARDS THE TITLE IN THE SLIDES, AND USES HEADLINE INSTEAD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{frametitle}{}
\providecommand\insertframetitle{}
\setbeamertemplate{headline}{

  \hspace{1cm}
  \parbox[c][1.2cm][c]{.65\textwidth}{\raggedright{}\bf\Large\insertframetitle}

  \begin{textblock*}{100mm}(.8\textwidth,-1.0cm)
    \includegraphics[width=2.0cm]{logo.pdf}
  \end{textblock*}

  \vspace*{0.1cm}

  \hspace*{0.6cm}
  \tikz \fill [azul] (0,0) rectangle (9.0, 2pt);
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PRESENTATION  STARTS HERE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}


\begin{frame}{title}

  frame with title

\end{frame}



\begin{frame}{Very very long title with so much text it does not fit in one lines }

  frame frame frame

\end{frame}

\begin{frame}{ }

  frame frame frame

\end{frame}

\end{document}
1
  • That is not very minimal. Try eliminating code until the problem disappears. Then add the last thing back to check it is the cause. If the solution isn't then apparent, edit your question with the minimal code needed to reproduce the problem. Also, it wouldn't hurt to say which line is line 68 if you think that's the problem!
    – cfr
    Dec 23, 2014 at 3:44

1 Answer 1

1

If you remove the {}, which indicates an empty title, in the third frame, you will see the same vertical alignment problem. This indicates to me that one needs to provide an input. In this case, {} or \empty or \phantom{text} will do the trick.

\begin{frame}{{}} or \begin{frame}{\empty} or \begin{frame}{\phantom{a}}

enter image description here enter image description here

Code

\PassOptionsToPackage{draft}{graphicx}
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{amsfonts}
\usepackage{cmbright}
\usepackage[T1]{fontenc}
\usepackage{etoolbox}
\usepackage{gnuplot-lua-tikz}
\usepackage{environ}
\usepackage{ulem}
\usepackage{textpos}

\makeatletter
\patchcmd{\beamer@sectionintoc}{\vskip1.5em}{\vskip0.5em}{}{}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%TWO COLOURS OF THE TEMPLATE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{azul}{rgb}{0.603,0.733,0.833}
\definecolor{verde}{rgb}{0.647,0.663,0.2.7}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING COLOURS IN SEVERAL ELEMENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{headline}{fg=black}
\setbeamercolor{footline}{fg=black}
\setbeamercolor{block body}{bg=azul}
\setbeamercolor{block title}{bg=verde,fg=black}
\setbeamercolor{item}{fg=verde}
\setbeamercolor{alerted text}{fg=Red}
\setbeamercolor{section in toc}{fg=azul}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING ASPECT OF DIVERSE FRAME ELEMENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\useoutertheme[]{default}

\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{subsection in toc}[square]
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{navigation symbols}{}
\setbeamercovered{invisible}
\setbeamertemplate{sections in toc}[ball]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%SETTING THE FOOTLINE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{footline}{
  \hspace{.6cm}
  \vspace{.2cm}
  \tikz \fill [azul] (0,0) rectangle (11.4, 2pt);

  \parbox[c][0.8cm][t]{\textwidth}{\hspace{3em} \scriptsize\bf 17 November 2014 $\rangle$ J.J. G\'omez-Navarro $\rangle$ edit the footline in the preamble}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%THIS THEME DISCARDS THE TITLE IN THE SLIDES, AND USES HEADLINE INSTEAD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{frametitle}{}
\providecommand\insertframetitle{}
\setbeamertemplate{headline}{

  \hspace{1cm}
  \parbox[c][1.2cm][c]{.65\textwidth}{\raggedright{}\bf\Large\insertframetitle}

  \begin{textblock*}{100mm}(.8\textwidth,-1.0cm)
    \includegraphics[width=2.0cm]{logo.pdf}
  \end{textblock*}

  \vspace*{0.1cm}

  \hspace*{0.6cm}
  \tikz \fill [azul] (0,0) rectangle (9.0, 2pt);
}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PRESENTATION  STARTS HERE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}


\begin{frame}{title}

  frame with title

\end{frame}



\begin{frame}{Very very long title with so much text it does not fit in one lines }

  frame frame frame

\end{frame}

\begin{frame}{ }

  frame frame frame

\end{frame}

\end{document}

You must log in to answer this question.

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