3

The Darmstadt theme of LaTeX's beamer class produces color transitions/shadings (?) in the header part, which I find not very nice in certain color combinations. Is there a way to produce clear cuts between the three horizontal areas?

Minimum working sample:

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

Solution (with help from @samcarter): Use the miniframes outertheme. I also edited the pgfdeclareverticalshading for the transition to the main part of the frame.

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

Solution

  • Welcome to TeX.Stackexchange! – user36296 May 30 '18 at 21:52
3

Darmstadt uses the smoothbars outer theme, which is basically the miniframes outer theme plus the colour transitions you want to remove. So instead of removing them, I suggest to use the miniframes outer theme:

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

enter image description here

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.