6

I'm trying to create a beamer theme that has some colored boxes at the very top and bottom of each slide. So far, I have copied the default theme and added an empty beamercolorbox to it. While this works, I get a while line between the border line and the subsequent header box. Where does this line come from and how do I get rid of it?

\documentclass{beamer}

\usetheme{default}

\makeatletter
\setbeamercolor{top/bottom bar}{fg=red,bg=red}
\setbeamercolor{titlelike}{parent=structure,fg=black,bg=green}
\setbeamertemplate{frametitle}
{
  \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
  \@tempdima=\textwidth%
  \advance\@tempdima by\beamer@leftmargin%
  \advance\@tempdima by\beamer@rightmargin%
  \begin{beamercolorbox}[ht=1.26mm,dp=0mm,wd=\the\@tempdima,colsep=0mm]{top/bottom bar}% <-- INSERTED THIS
  \end{beamercolorbox}% <-- INSERTED THIS
  \begin{beamercolorbox}[sep=0.3cm,1,wd=\the\@tempdima]{frametitle}
    \usebeamerfont{frametitle}%
    \vbox{}\vskip-1ex%
    \if@tempswa\else\csname beamer@fte1\endcsname\fi%
    \strut\insertframetitle\strut\par%
    {%
      \ifx\insertframesubtitle\@empty%
      \else%
      {\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle\strut\par}%
      \fi
    }%
    \vskip-1ex%
    \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
  \end{beamercolorbox}%
}
\makeatother

\begin{document}

\begin{frame}
  \frametitle{Foo Bar}
  \begin{itemize}
    \item Foo
    \item Bar
    \item Baz
  \end{itemize}
\end{frame}

\end{document}

result

4
  \end{beamercolorbox}% <-- INSERTED THIS
\nointerlineskip% <-- INSERT THIS AS WELL
  \begin{beamercolorbox}[sep=0.3cm,1,wd=\the\@tempdima]{frametitle}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.