An major update of my document class for beamer curses.

This commit is contained in:
Jeff Lance 2018-12-19 13:41:27 +01:00
parent 871a4febe0
commit b0fb047730
3 changed files with 661 additions and 0 deletions

237
jl-beamer/environments.tex Normal file
View File

@ -0,0 +1,237 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ENVIRONMENTS
%
%
%% definition
%%
\RenewDocumentEnvironment{definition}{ s o }{
\setbeamercolor*{block title}{parent=definition}
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Définition}
}{
% if subtitle
\begin{block} {\faPencil \hspace{.125em}\
Définition \hfill{\normalfont\slshape#2}}
}
}{
% if not starred: without logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {Définition}
}{
% if subtitle
\begin{block} {Définition \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% theoreme
%%
\NewDocumentEnvironment{theoreme}{ s o }{
\setbeamercolor*{block title}{parent=theoreme}
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Théorème}
}{
% if subtitle
\begin{block} {\faPencil \hspace{.125em}\
Théorème \hfill{\normalfont\slshape#2}}
}
}{
% if not starred: without logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {Théorème}
}{
% if subtitle
\begin{block} {Théorème \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% propriete
%%
\NewDocumentEnvironment{propriete}{ s o }{
\setbeamercolor*{block title}{parent=propriete}
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Propriété}
}{
% if subtitle
\begin{block} {\faPencil \hspace{.125em}\
Propriété \hfill{\normalfont\slshape#2}}
}
}{
% if not starred: without logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {Propriété}
}{
% if subtitle
\begin{block} {Propriété \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% demonstration
%%
\NewDocumentEnvironment{demonstration}{ s o }{
\setbeamercolor*{block title}{parent=demonstration}
\IfBooleanTF {#1} {
% if starred: with logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faPencil \hspace{.125em}\ Démonstration}
}{
% if subtitle
\begin{block} {\faPencil \hspace{.125em}\
Démonstration \hfill{\normalfont\slshape#2}}
}
}{
% if not starred: without logo
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {Démonstration}
}{
% if subtitle
\begin{block} {Démonstration \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% vocabulaire
%%
\NewDocumentEnvironment{vocabulaire}{ s o }{
\setbeamercolor*{block title}{parent=vocabulaire}
\IfBooleanTF {#1} {
% if starred: without title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {}
}{
% if subtitle
\begin{block} {\normalfont\slshape#2}
}
}{
% if not starred: with title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {Vocabulaire}
}{
% if subtitle
\begin{block} {Vocabulaire \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% remarque
%%
\NewDocumentEnvironment{remarque}{ s o }{
\setbeamercolor*{block title}{parent=remarque}
\IfBooleanTF {#1} {
% if starred: without title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faExclamationTriangle \hspace{.125em}}
}{
% if subtitle
\begin{block} {\faExclamationTriangle \hspace{.125em}\
\hfill{\normalfont\slshape#2}}
}
}{
% if not starred: with title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faExclamationTriangle \hspace{.125em}\ Remarque(s)}
}{
% if subtitle
\begin{block} {\faExclamationTriangle \hspace{.125em}\
Remarque(s) \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% exemple
%%
\NewDocumentEnvironment{exemple}{ s o }{
\setbeamercolor*{block title}{parent=exemple}
\IfBooleanTF {#1} {
% if starred: without title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faEye \hspace{.125em}}
}{
% if subtitle
\begin{block} {\faEye \hspace{.125em}\
\hfill{\normalfont\slshape#2}}
}
}{
% if not starred: with title
\IfNoValueTF {#2} {
% if no subtitle
\begin{block} {\faEye \hspace{.125em}\ Exemple(s)}
}{
% if subtitle
\begin{block} {\faEye \hspace{.125em}\
Exemple(s) \hfill{\normalfont\slshape#2}}
}
}
}{
\end{block}
}
%% application
%%
\NewDocumentEnvironment{application}{ o }{
\setbeamercolor*{block title}{parent=application}
\IfNoValueTF {#1} {
% if no subtitle
\begin{block} {\faCogs \hspace{.125em} Application}
}{
% if subtitle
\begin{block} {\faCogs \hspace{.125em}\ #1}
}
}{
\end{block}
}
%% commentaire
%%
\NewDocumentEnvironment{commentaire}{ s }{
\setbeamercolor*{block title}{parent=commentaire}
\IfBooleanTF {#1} {
% with logo
\begin{block} {\faQuoteLeft \hspace{.125em}}
}{
% without logo
\begin{block} {}
}
}{
\end{block}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

360
jl-beamer/jl-beamer.cls Normal file
View File

@ -0,0 +1,360 @@
%%%
%%%
%%% Classe : cours_beamer.cls
%%% Version : 1.6
%%% Date : 08/12/14
%%% Auteur : Jeff LANCE
%%%
%%% Notes de versions
%%% 25/11/18: version 2.0
%%% renommage de la classe et constitution en package.
%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{jl-beamer}[2014/12/08 Beamer de cours, v2.0]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% INIT
%
%
\LoadClassWithOptions{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% PACKAGES
%
%
%% Own packages.
%%
\RequirePackage{couleurs}
\RequirePackage{commun}
\RequirePackage{shortcuts}
%% Others.
%%
\RequirePackage{media9}
\RequirePackage{xkeyval}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% SETTINGS
%
%
%% Paths.
\graphicspath{{images/}}
\addmediapath{{videos/}}
%% Colors
%% Colors used in block and environments
%% I don't like the default flashy green and the blue so i redefined it
%% \colorlet{green}{green!40!gray}
%% \colorlet{blue}{airforceblue}
%% Colors of blocks like: definition, theorem, property, etc...
%%
\setbeamercolor*{definition}{fg=red,bg=blush!10!white}
\setbeamercolor*{theoreme}{fg=white,bg=red!90!white}
\setbeamercolor*{propriete}{fg=white,bg=brickred!90!white}
\setbeamercolor*{demonstration}{fg=hanblue,bg=airforceblue!10!white}
\setbeamercolor*{vocabulaire}{fg=hanblue,bg=airforceblue!10!white}
\setbeamercolor*{remarque}{fg=blush,bg=blush!10!white}
\setbeamercolor*{methode}{fg=black,bg=amber!75!white}
\setbeamercolor*{exemple}{fg=darkspringgreen,bg=green!10!white}
\setbeamercolor*{exercice}{fg=white,bg=airforceblue!90!white}
\setbeamercolor*{application}{fg=white,bg=airforceblue!90!white}
%% Colors of sections and subsections.
%%
\setbeamercolor*{sectioncolor}{fg=debianred}
\setbeamercolor*{subsectioncolor}{fg=lapislazuli}
\setbeamercolor*{subsubsectioncolor}{fg=coolgrey}
%% Define the possibility to make (dis)appear something in a beamer.
%%
\tikzset{
invisible/.style={opacity=0},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
%% Resume numbering in lists.
%%
\newcounter{saveenumi}
\newcommand{\seti}{\setcounter{saveenumi}{\value{enumi}}}
\newcommand{\conti}{\setcounter{enumi}{\value{saveenumi}}}
\resetcounteronoverlays{saveenumi}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% DEFAULT BEAMER THEME OPTIONS
%
%
%% Theme.
%%
\usetheme{Madrid}
\useinnertheme{circles}
\useoutertheme{default}
\usefonttheme{professionalfonts}
\setbeamertemplate{footline}{}
%% Enumerate env.
%%
\setbeamerfont{enumerate items}{family=\rmfamily}
\setbeamercolor*{enumerate items}{fg=black}
\setbeamertemplate{enumerate items}{\textbf{\insertenumlabel}.}
%% Items.
%%
\setbeamertemplate{itemize item}[circle]
\setbeamercolor*{itemize item}{fg=black}
\setbeamertemplate{itemize subitem}{\textendash}
%% Navigation.
%%
\setbeamertemplate{navigation symbols}{%
\insertframenavigationsymbol
\insertsectionnavigationsymbol
}
%% ToC.
%% Change vertical space between sections.
%%
\patchcmd{\beamer@sectionintoc}
{\vfill}
{\setlength{\itemsep}{10pt}\vskip\itemsep}
{}
{}
%% Change the list symbol.
%%
\defbeamertemplate{subsection in toc}{bullets}{%
\leavevmode
\parbox[t]{1em}{\textbullet\hfill}%
\parbox[t]{\dimexpr\textwidth-1em\relax}{\inserttocsubsection}\par
}
\defbeamertemplate{section in toc}{sections numbered roman}{%
\leavevmode%
{\bfseries
\MakeUppercase{\romannumeral\inserttocsectionnumber}.\ %
\inserttocsection\par
}
}
\defbeamertemplate{subsection in toc}{subsections numbered arabic}{%
\leavevmode\leftskip=1.5em%
{\bfseries
\MakeUppercase{\inserttocsubsectionnumber)}\ %
\inserttocsubsection\par
}
}
\defbeamertemplate{subsubsection in toc}{subsubsections numbered alph}{%
\leavevmode\leftskip=1.5em%
{\bfseries
\circled{\inserttocsubsubsectionnumber)}\ %
\inserttocsubsubsection\par
}
}
\setbeamertemplate{section in toc}[sections numbered roman]
\setbeamercolor{section in toc}{parent=sectioncolor}
\setbeamertemplate{subsection in toc}[subsections numbered arabic]
\setbeamercolor{subsection in toc}{parent=subsectioncolor}
\setbeamertemplate{subsubsection in toc}[subsubsections numbered alph]
\setbeamercolor{subsubsection in toc}{parent=subsubsectioncolor}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% MDFRAMED
%
%
\input{mdframed.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% COMMANDS
%
%
%% titre
%%
\newcommand{\titre}[4]{%
\title{#1}
\subtitle{#2}
\date{#3}
\author{Cours}
\institute{#4}
}
%% debut
%% print start slide.
%%
\newcommand{\debut}{%
\begin{frame}[plain]
\titlepage
\end{frame}
\addtocounter{framenumber}{-1}
}
%% debut
%% print end slide.
%%
\newcommand{\fin}{%
\section*{Plan}
\begin{frame}
\begin{center}{\Large Plan }\end{center}
\tableofcontents
\end{frame}
}
%% partie
%% Define a slide with the section title.
%%
\newcounter{partiecounter}
\NewDocumentCommand \partie { G{Partie} } {%
\usebeamercolor{sectioncolor}
\def\cType{\Roman}
\stepcounter{partiecounter}
\setcounter{sspartiecounter}{0}
\section{#1}
\begin{frame}
\begin{center}
\begin{mdframed}[style=partie]
\centering \textcolor{sectioncolor.fg}{\textbf{ \cType{partiecounter}. #1}}
\end{mdframed}
\end{center}
\end{frame}
}
%% sspartie
%% Define a slide with the subsection title.
%%
\newcounter{sspartiecounter}
\NewDocumentCommand \sspartie { G{Sous-Partie} } {%
\usebeamercolor{subsectioncolor}
\def\cType{\arabic}
\stepcounter{sspartiecounter}
\subsection{#1}
\begin{frame}
\begin{center}
\begin{mdframed}[style=sspartie]
\centering \textcolor{subsectioncolor.fg}{\textbf{ \cType{sspartiecounter}) #1}}
\end{mdframed}
\end{center}
\end{frame}
}
%% ssspartie
%% Define a slide with the subsection title.
%%
\newcounter{ssspartiecounter}
\NewDocumentCommand \ssspartie { G{Sous-Sous-Partie} } {%
\usebeamercolor{subsubsectioncolor}
\def\cType{\alph}
\stepcounter{ssspartiecounter}
% \subsubsection{#1}
\begin{frame}
\begin{center}
\begin{mdframed}[style=ssspartie]
\centering \textcolor{subsubsectioncolor.fg}{
\textbf{ \circled{\cType{ssspartiecounter}} #1}}
\end{mdframed}
\end{center}
\end{frame}
}
%% ftitre
%% Define the frametitle of sections and subsections.
%%
\NewDocumentCommand \ftitre { }{%
\ifnum \value{partiecounter}>0
\frametitle{\textbf{\Roman{partiecounter}. \insertsection}}
\fi
\ifnum \value{sspartiecounter}>0
\framesubtitle{\textbf{\arabic{sspartiecounter}) \insertsubsection}}
\fi
}
%% includemovie
%% Icludes a video in a frame.
%%
\newcommand{\includemovie}[3]{%
\includemedia[%
width=#1,height=#2,%
activate=pagevisible,%
deactivate=pageclose,%
addresource=#3,%
flashvars={%
source=#3 % same path as in addresource!
&autoPlay=false % default: false; if =true, automatically starts playback after activation (see option activation)
&loop=false % if loop=true, media is played in a loop
&controlBarAutoHideTimeout=0 % time span before auto-hide
}%
]{}{VPlayer.swf}%
}
% %% frame
% %% Redefine frame environment to include the ftitre command.
% %%
% \RenewDocumentEnvironment{frame}{ }{
% \begin{frame}
% \ifthenelse{\equal{\framenumber}{\string 0}}
% {}
% {\ftitre}
% }{
% \end{frame}
% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% ENVIRONMENTS
%
%
\input{environments.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother

64
jl-beamer/mdframed.tex Normal file
View File

@ -0,0 +1,64 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
% MDFRAMED
%
%
%% partie (sections) settings.
%%
\pgfdeclarehorizontalshading{partiebkg}{100bp}{
color(0bp)=(white!40);color(100bp)=(black!0)
}
\mdfdefinestyle{partie}{
outerlinewidth=1em, outerlinecolor=white,%
% leftmargin=-1em, rightmargin=-1em,%
middlelinewidth=1.2pt, linecolor=sectioncolor.fg, roundcorner=5pt,%
apptotikzsetting={
\tikzset{
mdfbackground/.append style={
shading=partiebkg
}
}
}
}
%% sspartie (sections) settings.
%%
\pgfdeclarehorizontalshading{sspartiebkg}{100bp}{
color(0bp)=(white!40);color(100bp)=(black!0)
}
\mdfdefinestyle{sspartie}{
outerlinewidth=1em, outerlinecolor=white,%
% leftmargin=-1em, rightmargin=-1em,%
middlelinewidth=1.2pt, linecolor=subsectioncolor.fg, roundcorner=5pt,%
apptotikzsetting={
\tikzset{
mdfbackground/.append style={
shading=partiebkg
}
}
}
}
%% ssspartie (sections) settings.
%%
\pgfdeclarehorizontalshading{ssspartiebkg}{100bp}{
color(0bp)=(white!40);color(100bp)=(black!0)
}
\mdfdefinestyle{ssspartie}{
outerlinewidth=1em, outerlinecolor=white,%
% leftmargin=-1em, rightmargin=-1em,%
middlelinewidth=1.2pt, linecolor=white, roundcorner=5pt,%
apptotikzsetting={
\tikzset{
mdfbackground/.append style={
shading=partiebkg
}
}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%