projektor/projektor.sty

125 lines
3.1 KiB
Text
Raw Normal View History

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}
\newif\ifoption@dark
\DeclareOption{dark}{\option@darktrue}
\newif\ifoption@sec
\DeclareOption{sec}{\option@sectrue}
\newif\ifoption@subsec
\DeclareOption{subsec}{\option@subsectrue}
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}
2024-04-21 10:35:05 +02:00
\RequirePackage{csquotes}
\MakeOuterQuote{"}
2023-04-30 00:17:48 +02:00
\fi
2024-08-22 19:39:56 +02:00
% Moloch avec barre de progression
2023-04-30 00:17:48 +02:00
\usetheme[
progressbar=frametitle,
2024-08-22 19:39:56 +02:00
block=fill,
]{moloch}
2023-04-30 00:17:48 +02:00
2023-12-05 19:36:48 +01:00
% Renomme la table des matières
2023-12-05 19:03:46 +01:00
\AtBeginDocument{
\renewcommand{\contentsname}{Plan}
}
2023-12-05 19:36:48 +01:00
% Table des matières comme frame de nouvelle partie
\ifoption@sec
2023-12-05 19:22:40 +01:00
\AtBeginSection[]{
\begin{frame}[plain, noframenumbering]{\contentsname}
\tableofcontents[
currentsection,
subsectionstyle=shaded,
]
2023-12-05 19:22:40 +01:00
\end{frame}
}
\fi
2023-12-05 19:36:48 +01:00
% Table des matières comme frame de nouvelle sous-partie
\ifoption@subsec
\AtBeginSubsection[]{
2023-12-05 19:22:40 +01:00
\begin{frame}[plain, noframenumbering]{\contentsname}
\tableofcontents[
currentsubsection,
sectionstyle=show/shaded,
subsectionstyle=show/shaded,
]
2023-12-05 19:22:40 +01:00
\end{frame}
}
\fi
\ifoption@dark
2023-06-02 18:01:58 +02:00
% Thème sombre
\setbeamercolor{normal text}{fg=white,bg=black!90}
\setbeamercolor{alerted text}{fg=orange!65!white}
\setbeamercolor{progress bar}{bg=alerted text.fg!20!black!90}
\setbeamercolor{frametitle}{bg=black!92}
\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
2024-08-22 19:39:56 +02:00
\setlength{\moloch@progressinheadfoot@linewidth}{0.8pt}
\fi
2023-06-02 18:01:58 +02:00
% Point au lieu de carré dans les listes
2023-06-02 17:57:51 +02:00
\setbeamertemplate{itemize items}[circle]
2024-08-22 19:39:56 +02:00
% Numéros de pages
\setbeamertemplate{page number in head/foot}[appendixframenumber]
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-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
2024-08-22 19:39:56 +02:00
\RequirePackage{microtype}
2023-04-30 00:17:48 +02:00
\RequirePackage{lmodern}
% Inverse titre court/titre long dans le plan
\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
2024-08-22 19:39:56 +02:00
% Sous-titres
2023-06-01 19:33:44 +02:00
\setbeamerfont{framesubtitle}{series=\mdseries}
2023-12-13 16:10:28 +01:00
% Souligne mieux les mots
\newcommand{\ul}[1]{\underline{\smash{#1}}}
2024-02-01 14:42:18 +01:00
% Avertissement par rapport à l'appendix
\renewcommand\appendixname{Appendix}