latex-homework/cours/cours_devoir.cls

165 lines
2.7 KiB
OpenEdge ABL
Raw Normal View History

%%%
%%%
%%% Classe : cours_devoir.cls
%%% Version : 1.0
2018-10-04 20:32:37 +00:00
%%% Date : 03/10/18
%%% Auteur : Jeff LANCE
%%%
%%%
\NeedsTeXFormat{LaTeX2e}
2018-10-04 20:32:37 +00:00
\ProvidesClass{cours_devoir}[2018/10/03 Devoirs, V1.0]
2018-10-04 20:32:37 +00:00
%
%
% INIT
%
%
\LoadClassWithOptions{scrartcl}
%\LoadClass[a4paper, 12pt, DIV=24]{scrartcl}
2018-10-04 20:32:37 +00:00
%
%
% PACKAGES
%
%
% Others
\RequirePackage{xkeyval}
2018-10-04 20:32:37 +00:00
% Own packages. Those contains some global settings and definitions.
\RequirePackage{commun}
2018-10-04 20:32:37 +00:00
\RequirePackage{couleurs}
\RequirePackage{shortcuts}
2018-10-04 20:32:37 +00:00
% Output
\RequirePackage{comment}
2018-10-04 20:32:37 +00:00
% Layout
\RequirePackage{geometry}
2018-10-04 20:32:37 +00:00
\RequirePackage[footsepline, plainfootsepline]{scrlayer-scrpage}
\RequirePackage{titling}
\RequirePackage{titlesec}
2018-10-04 20:32:37 +00:00
\RequirePackage{pageslts}
\RequirePackage{enumitem}
2018-10-04 20:32:37 +00:00
\RequirePackage[]{hyperref}
2018-10-04 20:32:37 +00:00
\makeatletter
2018-10-04 20:32:37 +00:00
%
%
% OPTIONS
%
%
2018-10-04 20:32:37 +00:00
\DeclareOptionX{type}[ds]{%
\def\type{#1}%
}
2018-10-04 20:32:37 +00:00
\ExecuteOptions{a4paper, DIV=24}
\ExecuteOptionsX{type}
\ProcessOptionsX
2018-10-04 20:32:37 +00:00
%
%
% FIXES
%
%
2018-10-04 20:32:37 +00:00
% Fix error from KOMA-Script scrartcl class.
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
2018-10-04 20:32:37 +00:00
%
%
% SETTINGS
%
%
2018-10-04 20:32:37 +00:00
% metapost
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi
2018-10-04 20:32:37 +00:00
% tkz
\usetkzobj{all} % on charge tous les objets
2018-10-04 20:32:37 +00:00
% sizing of the page
\geometry{a4paper, includeheadfoot, hmargin=.7cm, vmargin=.5cm, head=14.5pt}
% title, header and footer
\ihead[]{}
\chead[]{}
\ohead[]{}
\ifoot[]{}
\cfoot[]{}
\ofoot[]{}
% KOMA-Script version (preferred)
\ifthenelse{ \equal{\type}{ds} }{
\cohead[\textbf{MATHÉMATIQUES}\\\textbf{Devoir surveillé}]{\textbf{MATHÉMATIQUES}\\\textbf{Devoir surveillé}}
\lohead[NOM :\\Prénom :]{NOM :\\Prénom :}
\rohead[Le \@date]{Le \@date}
\cehead[]{}
\lehead[]{}
\rehead[]{}
}{
\ifthenelse{ \equal{\type}{dm} }{
\cohead[\textbf{MATHÉMATIQUES}\\\textbf{Devoir maison}]{\textbf{MATHÉMATIQUES}\\\textbf{Devoir maison}}
\lohead[NOM :\\Prénom :]{NOM :\\Prénom :}
\rohead[Le \@date]{Le \@date}
\cehead[]{}
\lehead[]{}
\rehead[]{}
}{
}
}
2018-10-04 20:32:37 +00:00
\cofoot*{}
\pagestyle{scrheadings}
\setkomafont{pagehead}{\normalfont}
\setkomafont{pagefoot}{\normalfont}
2018-10-04 20:32:37 +00:00
% paths
\graphicspath{{images/}}
%
%
2018-10-04 20:32:37 +00:00
% MACROS
%
%
2018-10-04 20:32:37 +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-10-04 20:32:37 +00:00
\newlist{questionsl}{enumerate*}{1}
\setlist*[questionsl]{label=\textbf{\alph*)}}
2018-10-04 20:32:37 +00:00
\setlist[enumerate, 1]{label=\textbf{\arabic*.}, leftmargin=*, labelsep=.5em}
\setlist[enumerate, 2]{label=\textbf{\alph*)}}
2018-10-04 20:32:37 +00:00
\setlist[description]{font=\sffamily\bfseries}
2018-10-04 20:32:37 +00:00
%
\NewDocumentCommand \turnpage{ }{
\rofoot[\textit{Tourner la page, svp} \faHandORight]{\textit{Tourner la page, svp} \faHandORight}
}
\makeatother