1

I have this example, why the color gradiant effect is removed

\documentclass{beamer} 
\usefonttheme{serif}
\usepackage{lipsum}
\usetheme{Warsaw}

\begin{document}

\begin{frame}{frame title}
lipsum[2]
\end{frame}

\setbeamertemplate{frametitle}[default][right]

\begin{frame}{frame title}
\lipsum[2]
\end{frame}

\setbeamertemplate{frametitle}[default][center]

\begin{frame}{frame title}
\lipsum[2]
\end{frame}

\end{document}

enter image description here

enter image description here

enter image description here

1

The warsaw theme does not use the default frametitle, but the one from the shadow outer theme. By using \setbeamertemplate{frametitle}[default][...] you explicitly replace this frametitle with the one from the default theme, which does not have the colour gradient.

If you want to change something in the warsaw frametitle, e.g. have it right aligned, you can redefine the template:

\documentclass{beamer} 
\usefonttheme{serif}
\usepackage{lipsum}
\usetheme{Warsaw}

\makeatletter
\setbeamertemplate{frametitle}
{%
  \nointerlineskip%
  \vskip-2pt%
  \hbox{\leavevmode
    \advance\beamer@leftmargin by -12bp%
    \advance\beamer@rightmargin by -12bp%
    \beamer@tempdim=\textwidth%
    \advance\beamer@tempdim by \beamer@leftmargin%
    \advance\beamer@tempdim by \beamer@rightmargin%
    \hskip-\Gm@lmargin\hbox{%
      \setbox\beamer@tempbox=\hbox{\begin{minipage}[b]{\paperwidth}%
          \vbox{}\vskip-.75ex%
          \leftskip0.3cm%
          \rightskip0.3cm plus1fil\leavevmode
          \hfill% <---- added to make it right aligned
          \insertframetitle%
          \ifx\insertframesubtitle\@empty%
            \strut\par%
          \else
            \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
          \fi%
          \nointerlineskip
          \vbox{}%
          \end{minipage}}%
      \beamer@tempdim=\ht\beamer@tempbox%
      \advance\beamer@tempdim by 2pt%
      \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}
        \usebeamercolor{frametitle right}
        \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
        \pgfusepath{clip}
        \pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}
      \end{pgfpicture}
      \hskip-\paperwidth%
      \box\beamer@tempbox%
    }%
    \hskip-\Gm@rmargin%
  }%
  \nointerlineskip
    \vskip-0.2pt
    \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{beamer@topshade}\hskip-\Gm@rmargin}
    \vskip-2pt
}
\makeatother

\begin{document}

\begin{frame}{frame title}
lipsum[2]
\end{frame}

\end{document}

enter image description here

| improve this answer | |

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.