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

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
  \end{beamercolorbox}% <-- INSERTED THIS
\nointerlineskip% <-- INSERT THIS AS WELL
  \begin{beamercolorbox}[sep=0.3cm,1,wd=\the\@tempdima]{frametitle}
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.