2

enter image description here

\documentclass{beamer}

\usetheme{Warsaw}               % thème
\usecolortheme{wolverine}       % variante de couleur

% Enlève les icônes de navigation
\beamertemplatenavigationsymbolsempty

\setbeamersize{text margin left=0cm}
\setbeamersize{text margin right=0cm}

\begin{document}

\begin{frame}{Title}

\hfill\colorbox{blue!15!white}{%
\rule[-7cm]{0pt}{0pt}
\begin{minipage}{4cm}
\begin{itemize}
\item One.
\item Two.
\item Three.
\end{itemize}
\end{minipage}
}


\end{frame}

\end{document}
2
  • Do you mean that you want to have the box the full height between your title and footer?
    – Matt
    Jun 24, 2015 at 18:04
  • Yes it is correct.
    – Tarass
    Jun 24, 2015 at 18:10

1 Answer 1

5
+50

I had to read up on pgf in order to do this the right way.

The best way, in my opinion, is to include all of the coloring within the header style, which is what I have now done. This creates custom versions of the frametitle style, and the shadow shaders, in order to make the box appear to be under the shadow just below the title bar.

\documentclass{beamer}

\usetheme{Warsaw}               % thème
\usecolortheme{wolverine}       % variante de couleur

% Enlève les icônes de navigation
\beamertemplatenavigationsymbolsempty

\setbeamersize{text margin left=0cm}
\setbeamersize{text margin right=0cm}

\makeatletter
% Custom shader that covers only part of the width of the page
\pgfdeclareverticalshading{beamer@whitetopshade}{\dimexpr \paperwidth - 4cm}{%
    color(0pt)=(bg);
    color(4pt)=(black!50!bg)}

% Custom shader covering the remaining part of the page
\pgfdeclareverticalshading{beamer@bluetopshade}{4cm}{%
    color(0pt)=(blue!15!white);
    color(4pt)=(black!50!bg)}

% Custom frametitle template that uses the previous two shaders
\defbeamertemplate*{frametitle}{mytitleshadow}
{%
  \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
          \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@whitetopshade}\pgfuseshading{beamer@bluetopshade}%
    \begin{pgfinterruptboundingbox}%
    \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{-4cm}{-\dimexpr\textheight-\headheight}}%
    \color{blue!15!white}%
    \pgfusepath{fill}%
    \end{pgfinterruptboundingbox}%
    \hskip-\Gm@rmargin}%
    \vskip-2pt
}
\makeatother


\begin{document}
\setbeamertemplate{frametitle}[myshadowtheme]
\begin{frame}{Title}

\begin{columns}[onlytextwidth]

\column{\dimexpr\textwidth-4cm}
\begin{itemize}
\item stuff on the left
\item more stuff on the left
\end{itemize}

\column{4cm}
\begin{itemize}
\item one
\item two
\item three
\end{itemize}

\end{columns}

\end{frame}

\setbeamertemplate{frametitle}[shadow theme]
\begin{frame}{Second test frame}
Back to normal
\end{frame}
\end{document}

This gives you:

enter image description here

Which I think looks better.

I hardcoded a bunch of 4cm in here, which should probably be made into a macro, or options for the style (I think thats possible) so it is more easily changed depending on how wide you want the colorbox to be.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .