删除 LaTeX beamer Darmstadt 主题标题中的颜色过渡

删除 LaTeX beamer Darmstadt 主题标题中的颜色过渡

DarmstadtLaTeX 类的主题在beamer标题部分产生颜色过渡/阴影(?),我发现在某些颜色组合中这不是很好。有没有办法在三个水平区域之间产生清晰的切分?

最小工作样本:

\documentclass[xcolor=dvipsnames]{beamer}

\usetheme{Darmstadt}
\definecolor{bblue}{rgb}{0.05, 0.15, 0.25} 

\definecolor{rred}{rgb}{0.6, 0.4, 0.4}
\setbeamercolor{palette primary}{bg=bblue,fg=white}
\setbeamercolor{palette quaternary}{bg=white,fg=bblue}
\setbeamercolor{subsection in head/foot}{bg=rred,fg=white}

\begin{document}
\section{Question}
\subsection{Subquestion}

\begin{frame}{I have a question}
\begin{itemize}
\item I do not like the shade in the header
\item I would like all horizontal bars to appear without color transition
\item What can I do about it?
\item Thank you
\end{itemize}
\end{frame}
\end{document}  

解决方案(在@samcarter 的帮助下):使用miniframes outertheme。我还编辑了pgfdeclareverticalshading过渡到框架主要部分的。

\documentclass[xcolor=dvipsnames]{beamer}

\usetheme{Darmstadt}
\useoutertheme{miniframes}
\setbeamercolor{section in head/foot}{fg=black,bg=white}

\definecolor{bblue}{rgb}{0.05, 0.15, 0.25} 
\definecolor{rred}{rgb}{0.6, 0.4, 0.4}
\setbeamercolor{palette primary}{bg=bblue,fg=white}
\setbeamercolor{palette quaternary}{bg=white,fg=bblue}
\setbeamercolor{subsection in head/foot}{bg=rred,fg=white}

\makeatletter
\AtBeginDocument{
 {
\usebeamerfont*{headline}
\usebeamercolor{normal text}
\usebeamercolor{title in head/foot}
\usebeamercolor{subsection in head/foot}
\usebeamercolor{section in head/foot}
\usebeamercolor{frametitle}

   \pgfdeclareverticalshading{beamer@aboveframetitle}{\the\paperwidth}{%
   color(0ex)=(bblue);%
   color(2ex)=(bblue);%
  color(2ex)=(bblue)%  
  }
 \pgfdeclareverticalshading{beamer@belowframetitle}{\the\paperwidth}{%
  color(2ex)=(rred);%
  color(0ex)=(bblue)%   
  }
}}
\makeatother

\begin{document}
\section{Answer}
\subsection{To the question}

\begin{frame}{That is the solution}
\begin{itemize}
\item Works like this!
\end{itemize}
\end{frame}

\end{document}  

解决方案

答案1

Darmstadt使用smoothbars外部主题,基本上就是miniframes外部主题加上要删除的颜色过渡。因此,我建议不要删除它们,而是使用miniframes外部主题:

\documentclass[xcolor=dvipsnames]{beamer}

\usetheme{Darmstadt}
\useoutertheme{miniframes}
\setbeamercolor{section in head/foot}{fg=black,bg=white}

\definecolor{bblue}{rgb}{0.05, 0.15, 0.25} 

\definecolor{rred}{rgb}{0.6, 0.4, 0.4}
\setbeamercolor{palette primary}{bg=bblue,fg=white}
\setbeamercolor{palette quaternary}{bg=white,fg=bblue}
\setbeamercolor{subsection in head/foot}{bg=rred,fg=white}

\begin{document}
\section{Question}
\subsection{Subquestion}

\begin{frame}{I have a question}
\begin{itemize}
\item I do not like the shade in the header
\item I would like all horizontal bars to appear without color transition
\item What can I do about it?
\item Thank you
\end{itemize}
\end{frame}

\end{document}  

在此处输入图片描述

相关内容