latex-homework/cours/cours_paper.cls

736 lines
20 KiB
OpenEdge ABL
Raw Normal View History

%%%
%%%
2018-09-11 05:52:15 +00:00
%%% Classe : cours_paper.cls
%%% Version : 1.0
%%% Date : 09/11/16
%%% Auteur : Jeff LANCE
%%%
%%%
\NeedsTeXFormat{LaTeX2e}
2018-09-11 05:52:15 +00:00
\ProvidesClass{cours_paper}[2016/11/09 Document de cours en A4 pour
2017-03-19 17:32:05 +00:00
prof ou élève, V1.0]
2018-08-20 14:11:57 +00:00
%
%
% INIT
%
%
2018-09-11 05:52:15 +00:00
\LoadClassWithOptions{scrartcl}
%\LoadClass[a4paper, 12pt, DIV=24]{scrartcl}
2018-08-20 14:11:57 +00:00
%
%
% PACKAGES
%
%
2018-09-03 14:08:40 +00:00
% Others
\RequirePackage{xkeyval}
2018-08-20 14:11:57 +00:00
% Own packages. Those contains some global settings and definitions.
\RequirePackage{commun}
2018-09-03 14:08:40 +00:00
\RequirePackage{couleurs}
\RequirePackage{shortcuts}
2018-09-03 14:08:40 +00:00
% Output
\RequirePackage{comment}
2018-09-03 14:08:40 +00:00
% Layout
\RequirePackage{geometry}
2018-08-20 13:38:13 +00:00
\RequirePackage[footsepline, plainfootsepline]{scrlayer-scrpage}
2018-02-16 14:56:32 +00:00
\RequirePackage{titling}
\RequirePackage{titlesec}
\RequirePackage{pageslts}
2018-02-16 14:56:32 +00:00
\RequirePackage{enumitem}
2018-08-20 13:38:13 +00:00
\RequirePackage[]{hyperref}
2018-08-20 14:11:57 +00:00
\makeatletter
2018-09-03 14:08:40 +00:00
%
%
% OPTIONS
%
%
\DeclareOptionX{type}[cours]{%
\def\type{#1}%
}
2018-09-11 05:52:15 +00:00
\ExecuteOptions{a4paper, DIV=24}
2018-09-03 14:08:40 +00:00
\ExecuteOptionsX{type}
\ProcessOptionsX
2018-08-20 14:11:57 +00:00
%
%
% FIXES
%
%
2018-08-20 14:11:57 +00:00
% Fix error from KOMA-Script scrartcl class.
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
2018-08-20 14:11:57 +00:00
% Fix for mdframed package see :
% http://tex.stackexchange.com/questions/179790/mdframed-how-to-change-the-separator-between-the-label-and-the-title-of-a-non-n#179794
\DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }%
{\ifcsdef{#2}%
{\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}%
{%
\IfNoValueTF {#3}%
{%#3 not given -- number relationship
\IfNoValueTF {#5}%
{%#3+#5 not given
\@definecounter{#2}%
\expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
\newenvironment{#2}[1][]{%
\refstepcounter{#2}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
\def\@temptitle{\mdf@theoremseparator%
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}%
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
\@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
\ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{\mdf@theoremseparator\ ##1}}% <- the problem was here
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
{%#5 given -- reset counter
\@definecounter{#2}\@newctr{#2}[#5]%
\expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
\expandafter\xdef\csname the#2\endcsname{%
\expandafter\noexpand\csname the#5\endcsname \@thmcountersep%
\@thmcounter{#2}}%
\newenvironment{#2}[1][]{%
\refstepcounter{#2}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
\def\@temptitle{\mdf@theoremseparator%
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
\@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
\def\@temptitle{\mdf@theoremseparator%
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}%
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
}%
{%#3 given -- number relationship
\global\@namedef{the#2}{\@nameuse{the#3}}%
\newenvironment{#2}[1][]{%
\refstepcounter{#3}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
\def\@temptitle{\mdf@theoremseparator%
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
\@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
\ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}%
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
}%
}
2018-08-20 14:11:57 +00:00
%
%
% SETTINGS
%
%
% metapost
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi
% tkz
\usetkzobj{all} % on charge tous les objets
% sizing of the page
\geometry{a4paper, includeheadfoot, hmargin=.7cm, vmargin=.5cm, head=14.5pt}
% title, header and footer
% KOMA-Script version (preferred)
\ohead{}
2018-09-11 05:52:15 +00:00
2018-09-03 14:08:40 +00:00
\ifthenelse{ \equal{\type}{activity} }{
\IfNoValueTF{ \subtitle }{
2018-09-11 05:52:15 +00:00
\cohead[\@title]{\@title}
2018-09-03 14:08:40 +00:00
\rohead[Activité]{Activité}
}{
2018-09-11 05:52:15 +00:00
\cohead[\@title]{\@title}
2018-09-03 14:08:40 +00:00
\rohead[Activité]{Activité - \@subtitle}
}
2018-09-11 05:52:15 +00:00
2018-09-03 14:08:40 +00:00
}{
2018-09-11 05:52:15 +00:00
\ifthenelse{ \equal{\type}{exercise} }{
\cohead[\@title]{\@title}
\rohead[Exercices]{Exercices}
}{
\rohead[Cours]{Cours - \@title}
}
2018-09-03 14:08:40 +00:00
}
2018-09-11 05:52:15 +00:00
2018-08-20 14:11:57 +00:00
\cofoot*{\thepage\ /\ \pageref{LastPage}}
\pagestyle{scrheadings}
\setkomafont{pagehead}{\normalfont\bfseries}
\setkomafont{pagefoot}{\normalfont}
%-------------------------------------
% fancyhdr version (need \RequirePackage{fancyhdr} and class article)
%\pagestyle{fancy}
%\fancyhf{}
%\rhead{Cours - \@title}
%\cfoot{\thepage\ /\ \pageref{LastPage}}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{.4pt}
%-------------------------------------
%---------------------------------------------------------------------
% (sub)sections
% \titleformat{\section}[block]{\sffamily\bfseries\Large}{\thesection.}{.5em}{}[]
% \titleformat{\subsection}[block]{\sffamily\bfseries\large\hspace{2em}}{\thesubsection)}{.5em}{}[]
% \renewcommand \thesection{\Roman{section}}
% \renewcommand \thesubsection{\arabic{subsection}}
%---------------------------------------------------------------------
% paths
\graphicspath{{images/}}
2018-09-03 14:08:40 +00:00
%
%
% MDFRAMED
%
%
2017-01-04 20:53:54 +00:00
% global options
\mdfsetup{
frametitlealignment=\raggedright,%
innerbottommargin=2em,%
}
2017-01-04 20:54:32 +00:00
% styles
2016-12-28 01:41:40 +00:00
\tikzset{
symbol/.style={
rectangle, draw=white,
fill=white, scale=1,
overlay
}
}
% default: a standard square frame with thick border
\mdfdefinestyle{default}{%
2017-02-17 15:31:46 +00:00
linecolor=black,linewidth=1pt,%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=.5em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
}
% clear: a no-border frame
\mdfdefinestyle{clear}{%
2017-02-17 15:31:46 +00:00
linecolor=white,linewidth=0pt,%
leftmargin=0,rightmargin=0,%
2017-02-17 17:34:03 +00:00
innertopmargin=.5em,innerbottommargin=.5em,%
2017-02-17 15:31:46 +00:00
innerleftmargin=.5em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
xcolor,%
2016-12-08 22:03:36 +00:00
}
% complete: a square frame with a pencil icon in upper left corner
\mdfdefinestyle{complete}{%
2017-02-17 15:31:46 +00:00
linecolor=black,linewidth=1pt,%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faPencil };
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faPencil };
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faPencil };
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faPencil };
},%
}
% dashed: dashed square frame
\mdfdefinestyle{dotted}{%
2017-02-17 15:31:46 +00:00
linecolor=white,linewidth=1pt,%
tikzsetting={draw=black,dotted,line width=1pt},%
2017-02-17 15:31:46 +00:00
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=.5em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
2018-09-03 14:08:40 +00:00
nobreak=false,%
2017-02-17 15:31:46 +00:00
xcolor,%
}
% quote: frame with no borders but with a beginning quote at upper left and
% an ending quote at lower right
\mdfdefinestyle{quote}{%
2017-02-17 15:31:46 +00:00
linecolor=white,linewidth=1pt,%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2017-02-17 17:34:03 +00:00
node[symbol] { \faQuoteLeft };
2017-02-17 15:31:46 +00:00
\path let \p1=(P), \p2=(O) in ($(\x1,.4)+(0,\y2)$)
node[symbol] { \faQuoteRight };
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2017-02-17 17:34:03 +00:00
node[symbol] { \faQuoteLeft };
2017-02-17 15:31:46 +00:00
\path let \p1=(P), \p2=(O) in ($(\x1,.4)+(0,\y2)$)
node[symbol] { \faQuoteRight };
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2017-02-17 17:34:03 +00:00
node[symbol] { \faQuoteLeft };
2017-02-17 15:31:46 +00:00
\path let \p1=(P), \p2=(O) in ($(\x1,.4)+(0,\y2)$)
node[symbol] { \faQuoteRight };
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2017-02-17 17:34:03 +00:00
node[symbol] { \faQuoteLeft };
2017-02-17 15:31:46 +00:00
\path let \p1=(P), \p2=(O) in ($(\x1,.4)+(0,\y2)$)
node[symbol] { \faQuoteRight };
},%
2016-12-27 15:10:58 +00:00
}
% todo: a shadowed square frame with a file text icon at upper left
2016-12-28 01:08:35 +00:00
\mdfdefinestyle{todo}{%
2017-02-17 15:31:46 +00:00
linecolor=white,linewidth=1pt,%
tikzsetting={draw=black,line width=1pt},%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
% hidealllines=true, topline=true, bottomline=true,%
shadow=true,%
% backgroundcolor=gray!40,% FOR TEST ONLY
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faCogs };
2017-02-17 15:31:46 +00:00
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faCogs };
2017-02-17 15:31:46 +00:00
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faCogs };
2017-02-17 15:31:46 +00:00
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faCogs };
2017-02-17 15:31:46 +00:00
},%
2016-12-28 01:08:35 +00:00
}
2017-05-12 19:22:35 +00:00
% tips: a shadowed square frame with a light bulb icon at upper left
\mdfdefinestyle{tips}{%
linecolor=white,linewidth=1pt,%
tikzsetting={draw=black,line width=1pt},%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
hidealllines=true, leftline=true, % topline=true, bottomline=true,%
% shadow=true,%
% backgroundcolor=gray!40,% FOR TEST ONLY
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faLightbulbO };
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faLightbulbO };
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faLightbulbO };
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faLightbulbO };
},%
}
% method: a shadowed square frame with cogs icon at upper left
\mdfdefinestyle{method}{%
linecolor=white,linewidth=1pt,%
tikzsetting={draw=black,line width=1pt},%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
hidealllines=true, leftline=true, % topline=true, bottomline=true,%
% shadow=true,%
% backgroundcolor=gray!40,% FOR TEST ONLY
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faBookmarkO };
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faBookmarkO };
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faBookmarkO };
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
2018-09-03 14:08:40 +00:00
node[symbol] { \faBookmarkO };
},%
}
% warn: frame with only left border and warning icon at upper left
\mdfdefinestyle{warning}{%
2017-02-17 15:31:46 +00:00
linecolor=black,linewidth=1pt,%
leftmargin=0,rightmargin=0,%
innertopmargin=1em,innerbottommargin=1em,%
innerleftmargin=1em,innerrightmargin=.5em,%
skipabove=0,skipbelow=0,%
frametitlerule=false,%
frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,%
nobreak=true,%
xcolor,%
hidealllines=true, leftline=true,%
firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faExclamationTriangle };
},%
secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faExclamationTriangle };
},%
middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faExclamationTriangle };
},%
singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$)
node[symbol] { \faExclamationTriangle };
},%
2016-12-27 10:05:49 +00:00
}
\mdtheorem[style=complete, theoremseparator={ -}, theoremspace={}, roundcorner=8pt]{déf}{Définition}
\mdtheorem[style=default, theoremseparator={ -}, theoremspace={}, roundcorner=8pt]{défn}{Définition}
\mdtheorem[style=complete, theoremseparator={ -}, theoremspace={}, outerlinewidth=1pt, outerlinecolor=black]{thm}{Théorème}
\mdtheorem[style=default, theoremseparator={ -}, theoremspace={}, outerlinewidth=1pt, outerlinecolor=black]{thmn}{Théorème}
\mdtheorem[style=complete, theoremseparator={ -}, theoremspace={}, outerlinewidth=1pt, outerlinecolor=black]{ppt}{Propriété}
\mdtheorem[style=default, theoremseparator={ -}, theoremspace={}, outerlinewidth=1pt, outerlinecolor=black]{pptn}{Propriété}
2017-03-18 23:38:07 +00:00
\mdtheorem[style=complete, theoremseparator={ -}, theoremspace={}]{pre}{Preuve}
\mdtheorem[style=default, theoremseparator={ -}, theoremspace={}]{pren}{Preuve}
\mdtheorem[style=complete, theoremseparator={ -}, theoremspace={}]{voc}{Vocabulaire}
\mdtheorem[style=default, theoremseparator={ -}, theoremspace={}]{vocn}{Vocabulaire}
\mdtheorem[style=quote, frametitle=none, frametitleaboveskip=0em, frametitlebelowskip=0em]{qte}{}
\mdtheorem[style=warning, theoremseparator={ -}, theoremspace={}]{rmq}{Remarque}
2018-09-03 14:08:40 +00:00
\mdtheorem[style=warning, theoremseparator={}, theoremspace={}]{rmqn}{}
\mdtheorem[style=dotted, theoremseparator={ -}, theoremspace={}]{exe}{Exemple}
2018-09-03 14:08:40 +00:00
\mdtheorem[style=dotted, theoremseparator={}, theoremspace={}]{exen}{}
2017-01-04 20:56:01 +00:00
\mdtheorem[style=todo, theoremseparator={ -}, theoremspace={}]{exo}{Exercice}
\mdtheorem[style=todo, theoremseparator={ -}, theoremspace={}]{app}{Application}
2018-02-16 14:56:32 +00:00
\mdtheorem[style=todo, theoremseparator={}, theoremspace={}]{appn}{}
\mdtheorem[style=method, theoremseparator={ -}, theoremspace={}]{met}{Méthode}
2018-08-20 14:11:57 +00:00
%
%
% MACROS
%
%
% Redirect all standard previously defined environments to their starred version
% as they don't display numbering.
\RenewDocumentEnvironment{déf}{ o } {%begin
\IfNoValueTF {#1} {
\begin{déf*}
}{
\begin{déf*}[#1]
}
}{%end
\end{déf*}
}
2017-04-21 19:57:44 +00:00
\RenewDocumentEnvironment{défn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{défn*}
}{
\begin{défn*}[#1]
}
}{%end
\end{défn*}
}
\RenewDocumentEnvironment{thm}{ o } {%begin
\IfNoValueTF {#1} {
\begin{thm*}
}{
\begin{thm*}[#1]
}
}{%end
\end{thm*}
}
2017-08-21 15:26:22 +00:00
\RenewDocumentEnvironment{thmn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{thmn*}
}{
\begin{thmn*}[#1]
}
}{%end
\end{thmn*}
}
\RenewDocumentEnvironment{ppt}{ o } {%begin
\IfNoValueTF {#1} {
\begin{ppt*}
}{
\begin{ppt*}[#1]
}
}{%end
\end{ppt*}
}
2017-04-21 19:57:44 +00:00
\RenewDocumentEnvironment{pptn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{pptn*}
}{
\begin{pptn*}[#1]
}
}{%end
\end{pptn*}
}
2017-08-21 15:26:22 +00:00
\RenewDocumentEnvironment{pre}{ o } {%begin
\IfNoValueTF {#1} {
\begin{pre*}
}{
\begin{pre*}[#1]
}
}{%end
\end{pre*}
}
\RenewDocumentEnvironment{pren}{ o } {%begin
\IfNoValueTF {#1} {
\begin{pren*}
}{
\begin{pren*}[#1]
}
}{%end
\end{pren*}
}
\RenewDocumentEnvironment{exe}{ o } {%begin
\IfNoValueTF {#1} {
\begin{exe*}
}{
\begin{exe*}[#1]
}
}{%end
\end{exe*}
}
2018-09-03 14:08:40 +00:00
\RenewDocumentEnvironment{exen}{ o } {%begin
\IfNoValueTF {#1} {
\begin{exen*}
}{
\begin{exen*}[#1]
}
}{%end
\end{exen*}
}
\RenewDocumentEnvironment{qte}{ o } {%begin
\IfNoValueTF {#1} {
\begin{qte*}
}{
\begin{qte*}[#1]
}
}{%end
\end{qte*}
}
\RenewDocumentEnvironment{rmq}{ o } {%begin
\IfNoValueTF {#1} {
\begin{rmq*}
}{
\begin{rmq*}[#1]
}
}{%end
\end{rmq*}
}
2018-09-03 14:08:40 +00:00
\RenewDocumentEnvironment{rmqn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{rmqn*}
}{
\begin{rmqn*}[#1]
}
}{%end
\end{rmqn*}
}
\RenewDocumentEnvironment{voc}{ o } {%begin
\IfNoValueTF {#1} {
\begin{voc*}
}{
\begin{voc*}[#1]
}
}{%end
\end{voc*}
}
2017-05-12 19:22:35 +00:00
\RenewDocumentEnvironment{vocn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{vocn*}
}{
\begin{vocn*}[#1]
}
}{%end
\end{vocn*}
}
\RenewDocumentEnvironment{app}{ o } {%begin
\IfNoValueTF {#1} {
\begin{app*}
}{
\begin{app*}[#1]
}
}{%end
\end{app*}
}
2018-02-16 14:56:32 +00:00
\RenewDocumentEnvironment{appn}{ o } {%begin
\IfNoValueTF {#1} {
\begin{appn*}
}{
\begin{appn*}[#1]
}
}{%end
\end{appn*}
}
\RenewDocumentEnvironment{met}{ o } {%begin
\IfNoValueTF {#1} {
\begin{met*}
}{
\begin{met*}[#1]
}
}{%end
\end{met*}
}
2017-05-12 19:22:35 +00:00
% titre
2018-09-11 05:52:15 +00:00
\NewDocumentCommand \titre { G{Titre} G{Sous-titre} }{%
2018-02-16 14:56:32 +00:00
\setlength{\droptitle}{-2cm}
2018-08-20 13:38:13 +00:00
\title{#1}
\subtitle{#2}
2018-08-20 13:38:13 +00:00
\date{}
\maketitle
}
% \partie | \sspartie
2018-08-20 14:11:57 +00:00
% Define a (sub)section title.
\titleformat{\section}[block]{\sffamily\bfseries\Large}{\thesection.}{.5em}{}[]
\titleformat{\subsection}[block]{\sffamily\bfseries\large\hspace{2em}}{\thesubsection)}{.5em}{}[]
\renewcommand \thesection{\Roman{section}}
\renewcommand \thesubsection{\arabic{subsection}}
\newcounter{partiecounter}
\newcounter{sspartiecounter}
\NewDocumentCommand \partie { G{Partie} } {%
\def\cType{\Roman}
\stepcounter{partiecounter}
\setcounter{sspartiecounter}{0}
\section{#1}
}
%
\NewDocumentCommand \sspartie { G{Sous-Partie} } {%
\def\cType{\arabic}
\stepcounter{sspartiecounter}
\subsection{#1}
}
2018-09-03 14:08:40 +00:00
% lists
\newlist{questions}{enumerate}{2}
\setlist[questions]{labelindent=0em, leftmargin=*, labelsep=0.5em}
\setlist[questions, 1]{label=\textbf{\arabic*.}}
\setlist[questions, 2]{label=\textbf{\alph*)}}
2018-09-11 05:52:15 +00:00
\newlist{questinl}{enumerate*}{1}
\setlist*[questinl]{label=\textbf{\alph*)}}
\setlist[enumerate, 1]{label=\textbf{\arabic*.}, leftmargin=*, labelsep=.5em}
\setlist[enumerate, 2]{label=\textbf{\alph*)}}
\setlist[description]{font=\sffamily\bfseries}
% amsthm
\newtheoremstyle{exostyle}
{\topsep}% espace avant
{\topsep}% espace apres
{}% Police utilisee par le style de thm
{}% Indentation (vide = aucune, \parindent = indentation paragraphe)
{\bfseries}% Police du titre de thm
{}% Signe de ponctuation apres le titre du thm
{\newline}% Espace apres le titre du thm (\newline = linebreak)
{\thmname{#1}\thmnumber{ #2}\thmnote{ - \normalfont{\textit{#3}}}} % composants du titre du thm : \thmname = nom, \thmnumber = numéro, \thmnote = sous-titre
\theoremstyle{exostyle}
\newtheorem{exercice}{Exercice}
%
2017-02-17 15:58:54 +00:00
\makeatother