# Beamer - how to remove space between headline and frame title

I am trying to remove the space between the headline and frame title as shown in the image below.

The relevant part of my code is:

\documentclass[t]{beamer}
\useinnertheme{rectangles}
\usecolortheme{whale}

\usepackage{natbib, amsmath, bm, tikz, mathrsfs, tabularx, booktabs, csvsimple, siunitx, graphicx}
\usetikzlibrary{positioning, fit, arrows.meta, shapes, calc}

\leavevmode%
\end{beamercolorbox}%
\end{beamercolorbox}%
}

\setbeamertemplate{frametitle}{
\begin{beamercolorbox}[wd=\paperwidth, ht=2.5ex, dp=1ex, leftskip=10pt]{section in head/foot}{\insertframetitle}
\end{beamercolorbox}%
}

\setbeamertemplate{footline}{
\end{beamercolorbox}%
}

% get rid of nav bar

\title{Using Pricing Data and News Headlines to Predict the Direction of Stock Returns}
\author{Jack Dry}
\date{}

\begin{document}

\begin{frame}[plain]
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}{Outline}
\tableofcontents[currentsection]
\end{frame}

\end{document}


If anyone could help me, I'd be very grateful!

• Perhaps cheat and add something like \vskip-2pt at the end of headline – daleif Apr 3 at 10:59

If you look into the default definition of frametitles in beamer themes, you will see \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}% which will remove the space between lines if the frametitle has a background colour.

\documentclass[t]{beamer}
\useinnertheme{rectangles}
\usecolortheme{whale}

\usepackage{natbib, amsmath, bm, tikz, mathrsfs, tabularx, booktabs, csvsimple, siunitx
%graphicx
}
\usetikzlibrary{positioning, fit, arrows.meta, shapes, calc}

\leavevmode%
\begin{beamercolorbox}[wd=.15\paperwidth, ht=2.5ex, dp=1ex, leftskip=10pt]{palette primary}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.85\paperwidth, ht=2.5ex, dp=1ex, leftskip=10pt]{subsection in head/foot}%
\end{beamercolorbox}%
}

\setbeamertemplate{frametitle}{%
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\begin{beamercolorbox}[wd=\paperwidth, ht=2.5ex, dp=1ex, leftskip=10pt]{section in head/foot}%
\insertframetitle%
\end{beamercolorbox}%
}

\setbeamertemplate{footline}{
\end{beamercolorbox}%
}

% get rid of nav bar

\title{Using Pricing Data and News Headlines to Predict the Direction of Stock Returns}
\author{Jack Dry}
\date{}

\begin{document}

\begin{frame}[plain]
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}{Outline}
\tableofcontents[currentsection]
\end{frame}

\end{document}

• I know, I'm trying to design a theme right now. There are many things in beamer that are not that easy to understand, or is even not documented. So looking in the sources is easier than trying to read the manual – daleif Apr 3 at 11:12
• @daleif Things are also much easier to find in the sources than in the documentation. – user36296 Apr 3 at 11:14
• grep + the emacs client feature is a life saver. – daleif Apr 3 at 11:16