Browse Source

Use colored blocks.

Define a custom inner theme to draw colored blocks with a top
border.
master
Damien Goutte-Gattat 10 months ago
parent
commit
875e7c2767
3 changed files with 56 additions and 5 deletions
  1. +1
    -1
      Makefile
  2. +51
    -4
      beamer-cpldn.dtx
  3. +4
    -0
      sample.tex

+ 1
- 1
Makefile View File

@ -1,6 +1,6 @@
DESTDIR = dist
STYFILES = beamerthemecpldn.sty beamerouterthemecpldn.sty beamercolorthemecpldn.sty
STYFILES = beamerthemecpldn.sty beamerouterthemecpldn.sty beamerinnerthemecpldn.sty beamercolorthemecpldn.sty
all: $(STYFILES) beamer-cpldn.pdf


+ 51
- 4
beamer-cpldn.dtx View File

@ -38,6 +38,7 @@ has been generated for details.
\generate{
\file{beamerthemecpldn.sty}{\from{beamer-cpldn.dtx}{theme}}
\file{beamerouterthemecpldn.sty}{\from{beamer-cpldn.dtx}{outertheme}}
\file{beamerinnerthemecpldn.sty}{\from{beamer-cpldn.dtx}{innertheme}}
\file{beamercolorthemecpldn.sty}{\from{beamer-cpldn.dtx}{colortheme}}
}
@ -130,12 +131,11 @@ has been generated for details.
\mode<presentation>
% \end{macrocode}
%
% We specify the different themes to use. We use our own outer theme and
% color theme, and the standard |rectangles| inner theme from the
% Beamer distribution.
% We specify the different themes to use. We use our own outer, inner,
% and color themes.
% \begin{macrocode}
\useoutertheme{cpldn}
\useinnertheme{rectangles}
\useinnertheme{cpldn}
\usecolortheme{cpldn}
\setbeamercovered{transparent}
\setbeamertemplate{navigation symbols}{}
@ -205,6 +205,50 @@ has been generated for details.
% \fi
%
%
% \subsection{The inner theme}
% \iffalse
%<*innertheme>
% \fi
%
% \begin{macrocode}
\mode<presentation>
% \end{macrocode}
%
% Our inner theme is based on the standard |rectangles| theme from the
% Beamer distribution.
% \begin{macrocode}
\useinnertheme{rectangles}
% \end{macrocode}
%
% We redefine the |begin block| template to draw a border on the top of
% the block.
% \begin{macrocode}
\defbeamertemplate*{block begin}{cpldn}
{
\par\vskip-1.4ex%
\begin{beamercolorbox}[colsep*=.75ex,ht=.2ex]{block top border}\end{beamercolorbox}
\ifx\insertblocktitle\@empty\else%
\nointerlineskip%
\begin{beamercolorbox}[colsep*=.75ex]{block title}
\usebeamerfont*{block title}\insertblocktitle%
\end{beamercolorbox}%
\fi%
{\parskip0pt\par}%
\nointerlineskip%
\usebeamerfont{block body}%
\begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\defbeamertemplate*{block end}{cpldn}
{\end{beamercolorbox}\vskip\smallskipamount}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</innertheme>
% \fi
%
%
% \subsection{The color theme}
% \iffalse
%<*colortheme>
@ -235,6 +279,9 @@ has been generated for details.
\setbeamercolor*{title in head/foot}{fg=cpldndarkblue,bg=cpldnpalepink}
\setbeamercolor*{date in head/foot}{fg=cpldndarkblue,bg=cpldnpalepink}
\setbeamercolor*{frametitle}{fg=cpldndarkblue,bg=cpldnpink}
\setbeamercolor*{block title}{fg=cpldndarkblue,bg=cpldnpink}
\setbeamercolor*{block body}{fg=black,bg=cpldnpalepink}
\setbeamercolor*{block top border}{bg=cpldnmagenta}
\mode<all>
% \end{macrocode}
%


+ 4
- 0
sample.tex View File

@ -50,6 +50,10 @@
Phasellus eu tellus sit amet tortor gravida placerat.
\end{block}
\begin{block}{}
A title-less block.
\end{block}
\end{frame}
\section{The Second Section}


Loading…
Cancel
Save