Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / ruby-beamer

My template for beamer slides with ruby code examples

Clone this repository (size: 534.4 KB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/ruby-beamer
hg clone ssh://hg@bitbucket.org/nolith/ruby-beamer

ruby-beamer / rubytheme.sty

\ProvidesPackage{beamerthemeruby}[2004/09/25 ver 1.00]
\NeedsTeXFormat{LaTeX2e}[1995/12/01]

% Copyright 2003 by Till Tantau <tantau@cs.tu-berlin.de>.
%
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt.

\newcounter{pagecount}
\addtocounter{pagecount}{1}
\newcounter{bst@temp}

{\usecolortheme[rgb={0.7,0.2,0.2}]{structure}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section{A counter that contains the number of pages}
% \DescribeMacro{\bs@savelastpage}
% Write number of pages into aux file
% We need two runs for this to work
%    \begin{MacroCode}
\newcommand{\bs@savelastpage}{%
  \immediate\write\@auxout{%
    \string\message{bstransp: Loading lastpage from aux file}%
    \string\setcounter{pagecount}{\thepage}}}
%    \end{MacroCode}
%
% At the end of the document start the save procedure
% and utter a message.
%    \begin{MacroCode}
\AtEndDocument{%
  \message{bstransp: Saving set lastpage into aux file}%
  \bs@savelastpage}
%    \end{MacroCode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\mode<presentation>

\RequirePackage{fp}               % FLoating point calc
\edef\midpoint{0.5}%

%\beamerboxesdeclarecolorscheme{title}{structure!75!black}{structure!75!black}

\usetitlepagetemplate{%
 \vbox{}
  \vfill
  \begin{centering}
    \begin{beamerboxesrounded}[shadow=false,scheme=title]{}
      \begin{centering}\Large\color{black}\inserttitle\par%
      %\begin{centering}\Large\color{white}\inserttitle\par%
        \normalsize\ifx\insertsubtitle\@empty\else\vskip0.25em\insertsubtitle\par\fi
        \hskip -\paperwidth
        \vskip -\paperheight
      \end{centering}
    \end{beamerboxesrounded}
    \vskip1em\par
    \inserttitlegraphic
    {\color{white}\smaller[2]\vskip-2em\insertinstitute}\par
    \vskip1em\par
    \normalsize\insertauthor\par
  \end{centering}
  \vfill
}
 
\useframetitletemplate{%
  \nointerlineskip\vskip-2pt%{\tiny\vskip.35em}\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-0.9ex%
          \leftskip0.3cm%
          \rightskip0.3cm plus1fil\leavevmode
          \Large\color{white}\hskip0.2em\insertframetitle%
          \ifx\insertframesubtitle\@empty%
            \strut\par%
          \else%
            \par{\footnotesize{\insertframesubtitle}\strut\par}%
          \fi%
          \nointerlineskip%
          \vbox{}%
          \end{minipage}}%
      \color{structure!75!black}%
      \beamer@tempdim=\ht\beamer@tempbox%
      \advance\beamer@tempdim by 2pt%
      \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}
        \pgfrect[clip]{\pgforigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}
        \pgfbox[left,base]{\pgfuseshading{frametitleshade}}
      \end{pgfpicture}
      %\vrule width\paperwidth height \beamer@tempdim%
      \hskip-\paperwidth%
      \advance\beamer@tempdim by -2pt%
      %{\hskip-2.2pt\raisebox{0.65pt}{\includegraphics[width=0.37cm]{images/ruby-pear-red}}\hskip 2.2pt}\hskip -0.37cm%
      \box\beamer@tempbox%
    }%
    \hskip-\Gm@rmargin%
  }%
  \nointerlineskip%
  \vskip-0.2pt%
  \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{topshade}\hskip-\Gm@rmargin}%
  \vskip-2pt%
  \vskip-1em%
}

\beamertemplatetriangleitem
\beamertemplatesolidbuttons

\usesectionheadtemplate{}{}

\usesubsectionheadtemplate{}{}

% Entries in table of contents
%\beamertemplatenumberedballsectiontoc

\pgfdeclareverticalshading{topshade}{\paperwidth}{%
  color(0pt)=(bg);
  color(4pt)=(black!50!bg)}

\pgfdeclarehorizontalshading{frametitleshade}{\paperheight}{%
  color(0pt)=(structure);
  color(\paperwidth)=(black)}

\newdimen\tempdimen
% Head

% Footline
\newlength{\footrest}
\newlength{\leftfoot}
\newlength{\rightfoot}
\newlength{\minleftfoot}
\newlength{\minrightfoot}
\newlength{\rubywidth}
\newlength{\mingradientfoot}
\setlength{\mingradientfoot}{0.4em}
\setlength{\rubywidth}{0.4cm}
\setlength{\minleftfoot}{2cm}
\setlength{\minrightfoot}{2cm}
\usefoottemplate{%
  \setlength{\footrest}{\paperwidth}%
  \addtolength{\footrest}{-\rubywidth}%
  \addtolength{\footrest}{-\minleftfoot}%
  \addtolength{\footrest}{-\minrightfoot}%
  \addtolength{\footrest}{-2\mingradientfoot}%
  \ifthenelse{\equal{\thepagecount}{1}}{}{%
    \FPeval{\midpoint}{trunc(((thepage-1) / (thepagecount-2)):4)}%
  }%
  \setlength{\leftfoot}{0pt}%
  \setlength{\rightfoot}{\footrest}%
  \addtolength{\leftfoot}{\midpoint\footrest}%
  \addtolength{\rightfoot}{-\leftfoot}%
  \addtolength{\leftfoot}{\mingradientfoot}%
  \addtolength{\rightfoot}{\mingradientfoot}%
  \vbox{\tiny%
    \hbox{%
      \setbox\beamer@linebox=\hbox to\paperwidth{%
        {\hskip 1em\tiny\color{white}\textbf{Alessio Caiazza}\hfill\textbf{Corso di Ruby}\hskip 1em}}%
      \ht\beamer@linebox=2.625ex%
      \dp\beamer@linebox=0pt%
      \setbox\beamer@linebox=\vbox{\box\beamer@linebox\vskip1.125ex}%
      \hskip-\Gm@lmargin%
      \pgfdeclarehorizontalshading{leftfootshade}{\paperheight}{%
        color(0pt)=(structure);%
        color(\leftfoot)=(white)}%
      \pgfdeclarehorizontalshading{rightfootshade}{\paperheight}{%
        color(0pt)=(white);%
        color(\rightfoot)=(structure)}%
      \color{structure}\vrule width \minleftfoot height\ht\beamer@linebox%
      \begin{pgfpicture}{0pt}{0pt}{\leftfoot}{\ht\beamer@linebox}%
        \pgfrect[clip]{\pgforigin}{\pgfpoint{\leftfoot}{\ht\beamer@linebox}}%
        \pgfbox[left,base]{\pgfuseshading{leftfootshade}}%
      \end{pgfpicture}%
      \includegraphics[width=\rubywidth]{images/ruby-pear}% 
      \begin{pgfpicture}{0pt}{0pt}{\rightfoot}{\ht\beamer@linebox}%
        \pgfrect[clip]{\pgforigin}{\pgfpoint{\rightfoot}{\ht\beamer@linebox}}%
        \pgfbox[left,base]{\pgfuseshading{rightfootshade}}%
      \end{pgfpicture}%
      \color{structure}\vrule width \minrightfoot height\ht\beamer@linebox%
      \hskip-\paperwidth%
      \hbox{\box\beamer@linebox\hfill}\hfill\hskip-\Gm@rmargin%
    }%
  }%
}


%\beamertemplateshadowblocks

%\renewcommand{\beamertemplatesetupshadings}{
%  \beamerboxessetupshadows
%  \beamerboxesdeclarecolorscheme{block}{structure!75!black}{black!8!white}
%  \beamerboxesdeclarecolorscheme{alert}{alert!75!bg}{alert!8!white}
%  \beamerboxesdeclarecolorscheme{example}{beamerexample!75!bg}{beamerexample!8!white}
%}

%\beamertemplateheadempty

%\beamertemplatenavigationsymbolsempty

\usebibliographyblocktemplate
  {\color{structure}}
  {\par\color{black}}
  {\par\color{black}}
  {\par\color{structure}}

\mode<all>