2023-04-30 00:17:48 +02:00
|
|
|
\NeedsTeXFormat{LaTeX2e}
|
|
|
|
|
2023-06-01 09:40:09 +02:00
|
|
|
\ProvidesPackage{projektor}[2023/04/29 Beamer template]
|
2023-04-30 00:17:48 +02:00
|
|
|
|
|
|
|
% Options
|
|
|
|
\newif\ifoption@code
|
|
|
|
\DeclareOption{code}{\option@codetrue}
|
|
|
|
\newif\ifoption@fr
|
|
|
|
\DeclareOption{fr}{\option@frtrue}
|
2023-05-29 18:44:13 +02:00
|
|
|
\newif\ifoption@dark
|
|
|
|
\DeclareOption{dark}{\option@darktrue}
|
2023-04-30 00:17:48 +02:00
|
|
|
|
|
|
|
\ProcessOptions
|
|
|
|
\ifoption@code
|
|
|
|
% Intégration code
|
|
|
|
\RequirePackage{minted}
|
|
|
|
\usemintedstyle{emacs}
|
|
|
|
\fi
|
|
|
|
\ifoption@fr
|
|
|
|
% Langue
|
|
|
|
\RequirePackage[french]{babel}
|
|
|
|
\fi
|
|
|
|
|
|
|
|
% Metropolis + barre de progression + numéro de page
|
|
|
|
\usetheme[
|
|
|
|
progressbar=frametitle,
|
2023-06-01 09:40:09 +02:00
|
|
|
numbering=fraction,
|
|
|
|
block=fill
|
2023-04-30 00:17:48 +02:00
|
|
|
]{metropolis}
|
|
|
|
|
2023-05-29 18:44:13 +02:00
|
|
|
|
|
|
|
\ifoption@dark
|
|
|
|
% Dark theme
|
|
|
|
\setbeamercolor{normal text}{fg=white,bg=black!90}
|
2023-05-29 19:11:48 +02:00
|
|
|
\setbeamercolor{alerted text}{fg=orange!65!white}
|
|
|
|
\setbeamercolor{progress bar}{bg=alerted text.fg!20!black!90}
|
|
|
|
\setbeamercolor{frametitle}{bg=black!92}
|
2023-05-29 18:44:13 +02:00
|
|
|
\setbeamercolor*{palette primary}{use=structure,fg=structure.fg}
|
2023-05-29 19:35:39 +02:00
|
|
|
\else
|
2023-05-29 19:42:56 +02:00
|
|
|
% Augmente l'épaisseur de la barre de progression sur les diapos
|
2023-05-29 19:35:39 +02:00
|
|
|
\setlength{\metropolis@progressinheadfoot@linewidth}{0.8pt}
|
2023-05-29 18:44:13 +02:00
|
|
|
\fi
|
|
|
|
|
2023-06-01 19:51:12 +02:00
|
|
|
% Métadonnées
|
|
|
|
\hypersetup{
|
|
|
|
pdfsubject={Présentation},
|
|
|
|
pdfkeywords={presentation},
|
|
|
|
pdfcreator={LaTeX with Beamer class and projektor template}
|
|
|
|
}
|
|
|
|
|
2023-06-01 09:53:15 +02:00
|
|
|
% Resolve issue with overfull vbox
|
|
|
|
\def\titlepage{\usebeamertemplate{title page}}
|
|
|
|
|
2023-05-29 19:42:56 +02:00
|
|
|
% Bas de page
|
2023-04-30 00:17:48 +02:00
|
|
|
\setbeamertemplate{frame footer}{
|
|
|
|
\insertsection \hfill\hspace{-4em} \insertshorttitle
|
|
|
|
}
|
|
|
|
\setbeamerfont{page number in head/foot}{size=\tiny}
|
|
|
|
\setbeamercolor{footline}{fg=gray}
|
|
|
|
|
|
|
|
% Enumerate au lieu d'itemize
|
|
|
|
\setbeamertemplate{section in toc}[sections numbered]
|
|
|
|
|
|
|
|
% Police
|
|
|
|
\RequirePackage{lmodern}
|
|
|
|
|
|
|
|
% Inverse titre court/titre long dans le plan
|
|
|
|
\RequirePackage{etoolbox}
|
|
|
|
\makeatletter
|
|
|
|
\patchcmd{\beamer@section}{{#2}{\the\c@page}}{{#1}{\the\c@page}}{}{}
|
|
|
|
\patchcmd{\beamer@section}{{\the\c@section}{\secname}}{{\the\c@section}{#1}}{}{}
|
|
|
|
\makeatother
|
|
|
|
|
2023-05-29 19:42:56 +02:00
|
|
|
% Liste sur plusieurs colonnes
|
|
|
|
\RequirePackage{multicol}
|
|
|
|
|
|
|
|
% Pas de préfix pour les figures
|
|
|
|
\RequirePackage[figurename=]{caption}
|
2023-06-01 19:33:44 +02:00
|
|
|
|
|
|
|
% Support des sous-titres
|
|
|
|
\makeatletter
|
|
|
|
\newcommand\startsubtitle{
|
|
|
|
\renewcommand{\metropolis@frametitlestrut@start}{
|
|
|
|
\rule{0pt}{1ex +
|
|
|
|
\totalheightof{
|
|
|
|
\ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
\renewcommand{\metropolis@frametitlestrut@end}{
|
|
|
|
\rule[-3ex]{0pt}{\metropolis@frametitle@padding}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
\newcommand\stopsubtitle{
|
|
|
|
\renewcommand{\metropolis@frametitlestrut@start}{
|
|
|
|
\rule{0pt}{\metropolis@frametitle@padding +
|
|
|
|
\totalheightof{
|
|
|
|
\ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
\renewcommand{\metropolis@frametitlestrut@end}{
|
|
|
|
\rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
\makeatother
|
|
|
|
|
|
|
|
\setbeamercolor{framesubtitle}{fg=white}
|
|
|
|
\setbeamerfont{framesubtitle}{series=\mdseries}
|
|
|
|
\addtobeamertemplate{frametitle}{
|
|
|
|
\ifx\insertframesubtitle\empty\else
|
|
|
|
\startsubtitle
|
|
|
|
\fi
|
|
|
|
}{
|
|
|
|
\ifx\insertframesubtitle\empty\else
|
|
|
|
\vspace{-4ex}
|
|
|
|
\usebeamerfont{framesubtitle}
|
|
|
|
\usebeamercolor[fg]{framesubtitle}
|
|
|
|
\insertframesubtitle
|
|
|
|
\stopsubtitle
|
|
|
|
\fi
|
|
|
|
}
|