beamerthemecrans.sty 3.83 KB
Newer Older
Pierre-antoine Comby's avatar
Pierre-antoine Comby committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% BEAMER THEME FOR CRANS %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% place in same folder as your .tex
% \usetheme{ens} in preamble
% also need crans-logo.png

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{ensbeamer}[2019/09/04 Beamer Theme]
\RequirePackage{tikz}
\RequirePackage{xcolor}

\makeatletter
\newif\if@section\@sectionfalse
\DeclareOption{sectiontitle}{
  \@sectiontrue
}

\ProcessOptions\relax

\definecolor{rougecrans}{RGB}{207,14,34} % rougecrans !

\setbeamercolor{structure}{fg=rougecrans}
%\setbeamercolor{sidebar}{fg=rougecrans,bg=white}
\setbeamercolor{sidebar}{bg=white,fg=rougecrans}
%\setbeamercolor{title in sidebar}{fg=white}
%\setbeamercolor{section in sidebar}{fg=white}
 \setbeamercolor{section in sidebar shaded}{fg=rougecrans!40}
 \setbeamercolor{subsection in sidebar}{fg=rougecrans}
 \setbeamercolor{subsection in sidebar shaded}{fg=rougecrans!60}
 \setbeamercolor{frametitle}{fg=rougecrans,bg=white}

\def\swidth{2cm}

%
% -----------------------------
% Title Page

\setbeamerfont{title}{size=\Huge}
\setbeamerfont{author}{size=\large}
\setbeamerfont{institut}{size=\Large}
\setbeamerfont{subtitle}{size=\Large}
\setbeamerfont{date}{size=\Large}
\setbeamertemplate{title page}{%
\begin{tikzpicture}[remember picture,overlay]
\fill[white]
  (current page.north west) rectangle (current page.south east);
\node
  at ([yshift=+.15\textheight]current page.center) (title)
  {\usebeamerfont{title}\textcolor{rougecrans}{\inserttitle}};

\node[below=2em]
  at(title) (subtitle)
  {\usebeamerfont{subtitle}\textcolor{rougecrans}{\insertsubtitle}};

\node
  at ([yshift=-70pt]current page.center) (institute)
  {\usebeamerfont{institute}\textcolor{rougecrans}{\insertinstitute}};

\node
  at ([yshift=-50pt]current page.center) (author)
  {\usebeamerfont{author}\textcolor{rougecrans}{\insertauthor}};

\node [opacity=.15] at (current page.center) {\includegraphics[height=0.9\textheight]{crans-logo} };

\end{tikzpicture}
}



%
% --------------------------------------
% Sidebar

\useoutertheme[height=0pt,width=\swidth, hideothersubsections]{sidebar}

\setbeamertemplate{sidebar left}
{
  {\vspace{0.9em}
\hspace{-0.4em}
    \begin{minipage}{\swidth}
      \centering
      \insertlogo
    \end{minipage}
  \usebeamerfont{title in sidebar}%
    \vskip1em%
    \usebeamercolor[fg]{title in sidebar}%
    \insertshorttitle[width=\swidth,center,respectlinebreaks]\par%
    \vskip.5em%
  }%
  \insertverticalnavigation{\swidth}%
  \vfill
  \hbox to2cm{\hskip0.6cm\usebeamerfont{section in sidebar} \strut\usebeamercolor[fg]{section in    sidebar}\insertframenumber/\inserttotalframenumber\hfill}%
  \vskip3pt%
}%


% --------------------------------------------------------------------------
% Section as frame title
\if@section
\addtobeamertemplate{frametitle}{
   \let\insertframetitle\insertsectionhead}{}
\addtobeamertemplate{frametitle}{
   \let\insertframesubtitle\insertsubsectionhead}{}

\makeatletter
 \CheckCommand*\beamer@checkframetitle{\@ifnextchar\bgroup\beamer@inlineframetitle{}}
  \renewcommand*\beamer@checkframetitle{\global\let\beamer@frametitle\relax\@ifnextchar\bgroup\beamer@inlineframetitle{}}

  \fi

\setbeamertemplate{caption}{\raggedright\insertcaption\par}
\setbeamertemplate{navigation symbols}[horizontal]

% ---------------------------------------------------
% BLOC

\setbeamertemplate{blocks}[rounded][shadow=false]
\setbeamercolor{block body}{fg=black,bg=rougecrans!20}
\setbeamercolor{block title}{fg=black,bg=rougecrans!40}

\setbeamercolor{block body example}{fg=black,bg=gray!40}
\setbeamercolor{block title example}{fg=black,bg=gray}

\setbeamercolor{block body alerted}{fg=black,bg=blue!40}
\setbeamercolor{block title alerted}{fg=black,bg=blue}

\setbeamercolor{subitem}{fg=rougecrans!20}

\makeatother
% LOGO :
\logo{\includegraphics[width=\swidth]{crans-logo.png}}