我正在尝试创建一个 Beamer 主题,该主题在每张幻灯片的最顶部和最底部都有一些彩色框。到目前为止,我已经复制了默认主题并beamercolorbox
为其添加了一个空框。虽然这有效,但我在边框线和后续标题框之间得到了一条白线。这条线从哪里来的?我该如何摆脱它?
\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}
答案1
\end{beamercolorbox}% <-- INSERTED THIS
\nointerlineskip% <-- INSERT THIS AS WELL
\begin{beamercolorbox}[sep=0.3cm,1,wd=\the\@tempdima]{frametitle}