Skip to content
Snippets Groups Projects
beamerx.sty 10.5 KiB
Newer Older
w2ak's avatar
w2ak committed
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerx}[2016/02/14 v1.0.0beta, standard scientific slideshows layout for Ecole polytechnique (Palaiseau,France).]

%=======================================================================
% Declaration des options
%=======================================================================
\ProcessOptions*
%=======================================================================
% Package requis
%=======================================================================
\RequirePackage{calc}
\RequirePackage{ifthen} % pour utiliser des booleens
% \RequirePackage{ifpdf} % mode de compilation
% \RequirePackage[pagestyles]{titlesec}
\RequirePackage{graphicx}
neze's avatar
neze committed
\RequirePackage{geometry}
w2ak's avatar
w2ak committed
\RequirePackage{xcolor}
% \RequirePackage{lmodern}
% \RequirePackage{multicol}
% \RequirePackage{amsmath}
% \RequirePackage{amssymb}
% \RequirePackage{mathrsfs}
% \RequirePackage{eso-pic}
% \RequirePackage{transparent}
\RequirePackage{xargs}
\RequirePackage{tikz}
% \RequirePackage{stmaryrd}
neze's avatar
neze committed
%\RequirePackage[hideothersubsections]{beamerthemeBerkeley}
w2ak's avatar
w2ak committed

%=======================================================================
% Definition des couleurs
%=======================================================================
neze's avatar
neze committed
\definecolor{bleu303}{RGB}{0,62,92}
\colorlet{darkbleu303}{black!20!bleu303}
\colorlet{lightbleu303}{white!20!bleu303}
\colorlet{ultralightbleu303}{white!80!bleu303}
\definecolor{rouge485}{RGB}{213,43,30}
\colorlet{darkrouge485}{black!20!rouge485}
\colorlet{lightrouge485}{white!20!rouge485}
\colorlet{ultralightrouge485}{white!80!rouge485}
\definecolor{vert575}{RGB}{107,126,81}
\colorlet{darkvert575}{black!20!vert575}
\colorlet{lightvert575}{white!20!vert575}
\colorlet{ultralightvert575}{white!80!vert575}
w2ak's avatar
w2ak committed

%=======================================================================
% Definition du theme beamer
%=======================================================================
%---------- Parametres generaux
neze's avatar
neze committed
\setbeamercovered{transparent=40}
w2ak's avatar
w2ak committed

\usefonttheme{professionalfonts}
\usefonttheme[stillsansseriflarge,stillsansserifsmall]{serif}
neze's avatar
neze committed
\setbeamertemplate{navigation symbols}{}
w2ak's avatar
w2ak committed

neze's avatar
neze committed
\setbeamersize{text margin left=3mm}
\setbeamersize{text margin right=3mm}

neze's avatar
neze committed
% \usecolortheme[named=bleu303]{structure}
w2ak's avatar
w2ak committed

neze's avatar
neze committed
\setbeamertemplate{footline}{%
neze's avatar
neze committed
  \hspace*{1mm}%
  \raisebox{1mm}{%
    \textbf{ÉCOLE POLYTECHNIQUE}-- \insertshorttitle%
  }%
  \hspace*{\fill}
  \raisebox{1mm}{%
    \insertframenumber%
  }%
  \hspace*{1mm}%
w2ak's avatar
w2ak committed
}
neze's avatar
neze committed
\setbeamertemplate{logo}{LOGO}
\setbeamertemplate{frametitle}{%
  \sffamily\Large\color{bleu303}\insertframetitle\\
  \sffamily\large\color{lightbleu303}\insertframesubtitle%
}
\setbeamertemplate{frametitle continuation}{this is the next part of the title}
w2ak's avatar
w2ak committed

%=======================================================================
% Commandes de mise en page utilisateur
%=======================================================================
%---------- Informations sur le document
\def\polytitresave{}
\def\polysoustitresave{}
\def\polyauteursave{}
w2ak's avatar
w2ak committed
\def\polydatesave{\today}
w2ak's avatar
w2ak committed
\def\polylogotitresave{}
\def\polylogopersosave{}

%---------- Mise en page
neze's avatar
neze committed
\newcommand{\MakeUppercaseWithNewline}[1]{%
  \begingroup
  \let\SavedOrgNewline\\%
  \DeclareRobustCommand{\\}{\SavedOrgNewline}%
  \MakeUppercase{#1}%
  \endgroup
}

neze's avatar
neze committed
\let\oldtitle=\title%
\renewcommandx\title[3][1={},3={}]{%
w2ak's avatar
w2ak committed
    % use: \title[sous-titre]{titre}[titre court]
    \renewcommand\polytitresave{#2}
    \renewcommand\polysoustitresave{#1}
neze's avatar
neze committed
    \ifthenelse{\equal{#3}{}}{%
      \oldtitle{#2}%
    }{%
      \oldtitle[#3]{#2}%
    }
w2ak's avatar
w2ak committed
    \subtitle{#1}
}

neze's avatar
neze committed
\let\oldauthor=\author%
\renewcommandx\author[2][1={}]{%
w2ak's avatar
w2ak committed
    % use: \author[auteur court]{auteur}
    \renewcommand\polyauteursave{#2}
    \oldauthor{\rmfamily\bfseries #1}
}

% \let\olddate=\date
neze's avatar
neze committed
\renewcommand\date[1]{%
w2ak's avatar
w2ak committed
    \renewcommand\polydatesave{#1}
}

neze's avatar
neze committed
\let\oldlogo=\logo%
\renewcommand\logo[1]{%
    \renewcommand\polylogopersosave{%
w2ak's avatar
w2ak committed
        \includegraphics[width=30mm,height=14mm,keepaspectratio]{#1}
    }
}
w2ak's avatar
w2ak committed

w2ak's avatar
w2ak committed
\oldlogo{%
    \hspace*{\paperwidth}%
    \hspace*{-16mm}%
    \makebox[\paperwidth]{%
        \makebox[16mm]{%
w2ak's avatar
w2ak committed
            \includegraphics[height=14mm]{beamerxwhitelogo}%
w2ak's avatar
w2ak committed
        }%
        \hfill%
        \makebox[32mm][r]{%
            \polylogopersosave{}%
        }%
        \hspace*{1mm}%
    }%
}

%=======================================================================
% Diapos conforme charte graphique
%=======================================================================
%--- Maketitle % TODO : clean
neze's avatar
neze committed
\AtBeginDocument{%
neze's avatar
neze committed
  \renewcommand\maketitle{%
    \setlength{\unitlength}{0.00625\paperwidth}%
    \setbeamertemplate{background canvas}{%
      \color{white}%
      \begin{picture}(160,90)%
        \put(80,45){%
          \makebox(0,0)[c]{%
            \includegraphics[width=\paperwidth,keepaspectratio]{beamerxbackground}%
          }%
        }%
        \put(15,45){%
          \makebox(0,0)[c]{%
            \color{white}\includegraphics[height=0.25\paperheight,keepaspectratio]{beamerxlogo}%
          }%
        }%
        \put(1,1){%
          \makebox(0,0)[lb]{%
            \begin{minipage}{0.5\paperwidth}\noindent%
              \sffamily\footnotesize\polyauteursave%
            \end{minipage}%
          }%
        }%
        \put(159,1){%
          \makebox(0,0)[rb]{%
            \begin{minipage}{0.5\paperwidth}\noindent\flushright%
              \sffamily\footnotesize\polydatesave%
            \end{minipage}%
          }%
        }%
        \put(159,46){%
          \makebox(0,0)[rb]{%
            \begin{minipage}{0.75\paperwidth}\noindent\flushright%
              \Large\setlength{\baselineskip}{0.7\baselineskip}%
neze's avatar
neze committed
              \sffamily\bfseries\MakeUppercaseWithNewline{\polytitresave}%
neze's avatar
neze committed
            \end{minipage}%
          }%
        }%
        \put(159,47){%
          \makebox(0,0)[rt]{%
            \begin{minipage}{0.75\paperwidth}\noindent\flushright%
              \setlength{\baselineskip}{0.7\baselineskip}%
              \sffamily\polysoustitresave%
            \end{minipage}%
          }%
        }%
      \end{picture}%
w2ak's avatar
w2ak committed
    }
neze's avatar
neze committed
    \begin{frame}[plain,c]
    \end{frame}
w2ak's avatar
w2ak committed
    \setbeamertemplate{background canvas}{}
neze's avatar
neze committed
  }
w2ak's avatar
w2ak committed
}
neze's avatar
neze committed

%--- XSection
% Prototype :
% \xsection{color_choice}
%          [short_title]
%          {title}
%          [picture]
\newcommandx{\xsection}[4][{2={},4=welcome}]{%
  \ifthenelse{\equal{#2}{}}{%
    \section{#3}%
  }{%
    \section[#2]{#3}%
  }%
  \ifthenelse{\equal{#1}{bleu}}{%
    \xsectionframe{lightbleu303}{white}{#4}{\arabic{section}}{#3}%
  }{%
  }
}

%- XSectionFrame
% Prototype :
% \xsectionframe{bg_color}
%               {fg_color}
%               {picture}
%               {number}
%               {title}
\newcommand{\xsectionframe}[5]{%
neze's avatar
neze committed
  \setbeamertemplate{background canvas}{%
    \setlength{\unitlength}{0.00625\paperwidth}%
    \begin{picture}(160,90)%
      \put(80,0){%
        \makebox(0,0)[cb]{%
          \includegraphics[width=\paperwidth,keepaspectratio]{#3}%
        }%
neze's avatar
neze committed
      }%
      \put(0,60){%
        \color{#1}\rule{\paperwidth}{\paperheight/3}%
neze's avatar
neze committed
      }%
      \put(80,75){%
neze's avatar
neze committed
        \makebox(0,0)[cb]{%
          \begin{minipage}{140\unitlength}\centering%
            \Huge\sffamily\color{#2}#4%
neze's avatar
neze committed
          \end{minipage}%
        }%
      }%
      \put(80,70){%
neze's avatar
neze committed
        \makebox(0,0)[ct]{%
          \begin{minipage}{140\unitlength}\centering%
neze's avatar
neze committed
            \Large\sffamily\color{#2}\MakeUppercaseWithNewline{#5}%
neze's avatar
neze committed
          \end{minipage}%
        }%
      }%
    \end{picture}%
  }
  \begin{frame}[plain,c]
  \end{frame}
  \setbeamertemplate{background canvas}{}
}

%--- XSubSection
% Prototype :
% \xsubsection{color_choice}
%             [short_title]
%             {title}
%             {subtitle}
%             [picture]
\newcommandx{\xsubsection}[5][{2={},5=pei}]{%
  \ifthenelse{\equal{#2}{}}{%
    \section{#3}%
  }{%
    \section[#2]{#3}%
  }%
  \ifthenelse{\equal{#1}{bleu}}{%
    \xsubsectionframe{lightbleu303}{darkbleu303}{white}{#5}{#3}{#4}%
neze's avatar
neze committed
  }{%
  }
}
neze's avatar
neze committed

%- XSubSectionFrame
% Prototype :
% \xsubsectionframe{bg_color}
%                  {bg_altcolor}
%                  {fg_color}
%                  {picture}
%                  {title}
%                  {subtitle}
\newcommand{\xsubsectionframe}[6]{%
neze's avatar
neze committed
  \setbeamertemplate{background canvas}{%
    \setlength{\unitlength}{0.00625\paperwidth}%
    \begin{picture}(160,90)%
      \put(80,90){%
        \makebox(0,0)[ct]{%
          \includegraphics[width=\paperwidth,keepaspectratio]{#4}%
        }%
neze's avatar
neze committed
      }%
      \put(0,0){%
        \color{#1}\rule{\paperwidth}{0.5\paperheight}%
neze's avatar
neze committed
      }%
      \put(80,22.5){%
neze's avatar
neze committed
        \makebox(0,0)[c]{%
neze's avatar
neze committed
          \color{#3}\includegraphics[height=\paperheight/22,keepaspectratio]{beamerxx}%
        }%
      }%
      \put(160,22.5){%
        \makebox(0,0)[c]{%
          \color{#2}\includegraphics[height=3\paperheight/7,keepaspectratio]{beamerxarmes}%
        }%
      }%
neze's avatar
neze committed
      \put(80,28){%
        \makebox(0,0)[cb]{%
          \begin{minipage}{120\unitlength}\centering%
neze's avatar
neze committed
            \large\rmfamily\bfseries\color{#3}\MakeUppercaseWithNewline{#5}%
neze's avatar
neze committed
          \end{minipage}%
        }%
      }%
      \put(80,18){%
        \makebox(0,0)[ct]{%
          \begin{minipage}{120\unitlength}\centering%
            \large\rmfamily\color{#3}#6%
          \end{minipage}%
neze's avatar
neze committed
        }%
      }%
    \end{picture}%
  }
  \begin{frame}[plain,c]
  \end{frame}
  \setbeamertemplate{background canvas}{}
}

neze's avatar
neze committed
%--- XFrame
% Prototype:
% \begin{xframe}
%       {title}
%       {subtitle}
neze's avatar
neze committed
\newenvironment{xframe}[2]{%
  \setbeamertemplate{background canvas}{%
    \setlength{\unitlength}{0.00625\paperwidth}%
    \begin{picture}(160,90)%
neze's avatar
neze committed
      \put(158,88){%
neze's avatar
neze committed
        \makebox(0,0)[rt]{%
          \color{lightbleu303}\includegraphics[height=\paperheight/7,keepaspectratio]{beamerxarmes}%
        }%
      }%
    \end{picture}%
  }%
  \begin{frame}{#1}{#2}%
}{%
  \end{frame}%
}

%--- XPic
% Prototype:
% \begin{xpic}
%       [size adjustment]
%       {picture}
\newenvironment{xpic}[2][hw]{%
  \setbeamertemplate{background canvas}{%
    \setlength{\unitlength}{0.00625\paperwidth}%
    \begin{picture}(160,90)%
      \put(80,45){%
        \makebox(0,0)[c]{%
          \ifthenelse{\equal{#1}{hw}}{%
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#2}%
          }{\ifthenelse{\equal{#1}{wh}}{%
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{#2}%
          }{\ifthenelse{\equal{#1}{h}}{%
            \includegraphics[height=\paperheight]{#2}%
          }{%
            \includegraphics[width=\paperwidth]{#2}%
          }}}%
        }%
      }%
    \end{picture}
  }%
  \begin{frame}[plain,b]\centering%
}{%
    \vspace*{5mm}
  \end{frame}%
}
w2ak's avatar
w2ak committed
\endinput