From ffa69c1549d9c350b1f2a40102cc13cd8e4b87d7 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Tue, 10 May 2016 14:22:19 +0200 Subject: [PATCH] - Define 2 new commands "partie" and "sspartie" to auto make (sub)section. - Use of mdframed package to make framed title for (ss)partie commands. --- commun/commun.sty | 1 + cours/cours_beamer.cls | 97 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/commun/commun.sty b/commun/commun.sty index 22ddeb6..cc2d464 100644 --- a/commun/commun.sty +++ b/commun/commun.sty @@ -20,6 +20,7 @@ \RequirePackage{eurosym} \RequirePackage{bbding} \RequirePackage{xcolor} +\RequirePackage[framemethod=tikz]{mdframed} % maths \RequirePackage{amsmath} diff --git a/cours/cours_beamer.cls b/cours/cours_beamer.cls index 26db7cc..fc451f7 100644 --- a/cours/cours_beamer.cls +++ b/cours/cours_beamer.cls @@ -1,19 +1,19 @@ %%% %%% %%% Classe : cours_beamer.cls -%%% Version : 1.0 +%%% Version : 1.5 %%% Date : 08/12/14 %%% Auteur : Jeff LANCE %%% %%% \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{cours_beamer}[2014/12/08 Slides de cours, v1.0] +\ProvidesClass{cours_beamer}[2014/12/08 Slides de cours, v1.5] %-- classe de base % inutile de passer l'option [utf8] puisque chargee dans commun.sty -\LoadClass{beamer} +\LoadClassWithOptions{beamer} %-- % @@ -35,15 +35,53 @@ \useinnertheme{circles} \useoutertheme{default} \usefonttheme{serif} + +% enumerate \setbeamerfont{enumerate item}{family=\rmfamily} \setbeamertemplate{enumerate item}{\textbf{\insertenumlabel.}} +% itemize +\setbeamertemplate{itemize item}[triangle] +\setbeamertemplate{itemize subitem}[circle] + \setbeamertemplate{navigation symbols}{% \insertframenavigationsymbol \insertsectionnavigationsymbol } -% \setbeamertemplate{headline}{} % pour supprimer l'entête +% mdframed +\pgfdeclarehorizontalshading{partiebkg}{100bp}{ + color(0bp)=(white!40);color(100bp)=(black!0) +} +% +\pgfdeclarehorizontalshading{sspartiebkg}{100bp}{ + color(0bp)=(white!40);color(100bp)=(black!0) +} +\mdfdefinestyle{partie}{ + outerlinewidth=1em, outerlinecolor=white,% + % leftmargin=-1em, rightmargin=-1em,% + middlelinewidth=1.2pt, linecolor=red,roundcorner=5pt,% + apptotikzsetting={ + \tikzset{ + mdfbackground/.append style={ + shading=partiebkg + } + } + } +} +% +\mdfdefinestyle{sspartie}{ + outerlinewidth=1em, outerlinecolor=white,% + % leftmargin=-1em, rightmargin=-1em,% + middlelinewidth=1.2pt, linecolor=blue,roundcorner=0pt,% + apptotikzsetting={ + \tikzset{ + mdfbackground/.append style={ + shading=partiebkg + } + } + } +} %-- % @@ -60,13 +98,14 @@ \institute{#4} } + % debut - fin \newcommand{\debut}{% \begin{frame} \titlepage \end{frame} } - +% \newcommand{\fin}{% \section{Sommaire} \begin{frame} @@ -75,12 +114,43 @@ \end{frame} } + +% (sous)partie +\newcounter{partiecounter} +\NewDocumentCommand \partie { G{Partie} } {% + \def\cType{\Roman} + \stepcounter{partiecounter} + \section{#1} + \begin{frame} + \begin{center} + \begin{mdframed}[style=partie] + \centering \textcolor{red}{\textbf{ \cType{partiecounter}. #1}} + \end{mdframed} + \end{center} + \end{frame} +} +% +\newcounter{sspartiecounter} +\NewDocumentCommand \sspartie { G{Sous-Partie} } {% + \def\cType{\arabic} + \stepcounter{sspartiecounter} + \subsection{#1} + \begin{frame} + \begin{center} + \begin{mdframed}[style=sspartie] + \centering \textcolor{blue}{\textbf{ \cType{sspartiecounter}) #1}} + \end{mdframed} + \end{center} + \end{frame} +} + + % blocks -\newenvironment<>{déf}[1][]{%begin - \setbeamercolor{block title}{fg=crimson,bg=pink!95!white}% - \begin{block}{Définition}{#1} -}{%end - \end{block} +\NewDocumentEnvironment{déf}{ G{Définition} }{%begin + \setbeamercolor{block title}{fg=crimson,bg=pink!95!white} + \begin{block} {#1} + }{%end +\end{block} } % \NewDocumentEnvironment{thm}{ G{Théorème} }{%begin @@ -110,12 +180,6 @@ }{%end \end{block} } -% \newenvironment<>{exp}[1][]{%begin -% \setbeamercolor{block title}{fg=white,bg=green!75!black}% -% \begin{block} #1 -% }{%end -% \end{block} -% } % \newcounter{exercicecounter} \NewDocumentEnvironment{exo} { O{0} G{Exercice} }{%begin @@ -156,7 +220,6 @@ } - %--%