rapport-stage/rapstage.cls

260 lines
5.8 KiB
OpenEdge ABL
Raw Normal View History

2024-02-07 11:42:42 +01:00
\ProvidesClass{rapstage}[2024/02/06 Rapport de stage de Paris Cité]
\LoadClass[12pt]{article}
% Options
\newif\ifoption@code
\DeclareOption{code}{\option@codetrue}
\newif\ifoption@f
\DeclareOption{f}{\option@ftrue}
\newif\ifoption@n
\DeclareOption{n}{\option@ntrue}
\newcommand\@student{Étudiant}
2024-02-07 11:42:42 +01:00
\ProcessOptions
\ifoption@code
% Intégration code
\RequirePackage{minted}
\usemintedstyle{emacs}
\fi
\ifoption@f
% Mode féminin
\renewcommand\@student{Étudiante}
2024-02-07 11:42:42 +01:00
\fi
\ifoption@n
% Mode neutre
\renewcommand\@student{Étudiant·e}
2024-02-07 11:42:42 +01:00
\fi
% Encodage
\RequirePackage[T1]{fontenc}
% Polices
2024-05-03 01:32:30 +02:00
\RequirePackage[nopatch=footnote]{microtype}
2024-02-07 11:42:42 +01:00
\RequirePackage{mathptmx} % Times New Roman
\RequirePackage{fontspec} % Arial
\setmainfont{Times New Roman}
2024-07-11 12:01:36 +02:00
% Langage
\RequirePackage[french]{babel}
2024-02-07 11:42:42 +01:00
\frenchsetup{SmallCapsFigTabCaptions=false}
2024-07-11 12:01:36 +02:00
% Guillemets
2024-07-23 19:38:00 +02:00
\RequirePackage[style=english]{csquotes}
2024-07-11 12:01:36 +02:00
\MakeOuterQuote{"}
% Format des pages
2024-07-24 12:37:32 +02:00
\RequirePackage[a4paper,top=35mm,bottom=33mm,left=5cm,right=5cm]{geometry}
2024-02-07 11:42:42 +01:00
% Style de bibliographie
\newcommand\@bib{Bibliographie}
\renewcommand\frenchrefname{\hspace{4em}\@bib}
2024-02-07 11:42:42 +01:00
\bibliographystyle{unsrt}
% Auteur
\newcommand\me@unstarred[3]{
2024-02-07 11:42:42 +01:00
\gdef\@mef{#1} % first name
\gdef\@mel{#2} % last name
\gdef\@mail{mailto:#3} % mail
}
\newcommand\me@starred[2]{
2024-07-23 18:00:43 +02:00
\gdef\@mef{#1} % first name
\gdef\@mel{#2} % last name
\gdef\@mail{} % mail
}
\newcommand\me{\@ifstar{\me@starred}{\me@unstarred}}
\newcommand\@mef{Alice}
\newcommand\@mel{Dubois}
\newcommand\@mail{mailto:alice.dubois@example.com}
2024-02-07 11:42:42 +01:00
% Titre
\renewcommand\title[1]{\gdef\@title{#1}}
\renewcommand\@title{TITRE DU RAPPORT}
2024-02-07 11:42:42 +01:00
% Date
2024-07-11 12:11:59 +02:00
\newcount\lastyear
\lastyear=\year
\advance\lastyear by -1
\renewcommand\date[1]{\gdef\@date{#1}}
\renewcommand\@date{\the\lastyear{}/\the\year{}}
2024-02-07 11:42:42 +01:00
% Tuteur pédagogique
\newcommand\tuteurpedago@unstarred[2]{
2024-02-07 11:42:42 +01:00
\gdef\@tpn{#1} % nom
\gdef\@tpm{mailto:#2} % mail
}
\newcommand\tuteurpedago@starred[1]{
2024-07-23 18:00:43 +02:00
\gdef\@tpn{#1} % nom
\gdef\@tpm{} % mail
}
\newcommand\tuteurpedago{
2024-07-23 18:00:43 +02:00
\@ifstar{\tuteurpedago@starred}{\tuteurpedago@unstarred}}
\newcommand\@tpn{John \textsc{Doe}}
\newcommand\@tpm{mailto:john.doe@example.com}
2024-02-07 11:42:42 +01:00
% Tuteur entreprise
\newcommand\tuteurentreprise@unstarred[2]{
2024-02-07 11:42:42 +01:00
\gdef\@ten{#1} % nom
\gdef\@tem{mailto:#2} % mail
}
\newcommand\tuteurentreprise@starred[1]{
2024-07-23 18:00:43 +02:00
\gdef\@ten{#1} % nom
\gdef\@tem{} % mail
}
\newcommand\tuteurentreprise{
2024-07-23 18:00:43 +02:00
\@ifstar{\tuteurentreprise@starred}{\tuteurentreprise@unstarred}}
\newcommand\@ten{Bob \textsc{Dupont}}
\newcommand\@tem{mailto:bob.dupont@example.com}
2024-02-07 11:42:42 +01:00
% Directeurice université
\newcommand\directeur[1]{\gdef\@directeur{#1}}
\newcommand\@directeur{Carole \textsc{Delporte}}
2024-02-07 11:42:42 +01:00
% Sous-titre
\newcommand\subtitle[1]{\gdef\@subtitle{#1}}
\newcommand\@subtitle{Rapport de Stage de Master 2}
2024-02-07 11:42:42 +01:00
% Fichier de la bibliographie
\newcommand\bibliofile[1]{\gdef\@refile{#1}}
2024-02-07 11:42:42 +01:00
% Mise en page
2024-05-03 01:36:51 +02:00
\RequirePackage{titlesec}
2024-07-23 19:31:33 +02:00
\titleformat*{\section}{\fontspec{Arial}\Large\bfseries}
\titleformat*{\subsection}{\fontspec{Arial}\large\bfseries\itshape}
2024-02-07 11:42:42 +01:00
2024-02-07 16:01:42 +01:00
% Point après numéro dans le titre
\RequirePackage{titlesec}
2024-07-23 20:20:02 +02:00
\titlelabel{\thetitle.\hspace{0.8em}}
2024-02-07 16:01:42 +01:00
2024-02-07 11:42:42 +01:00
% Interligne
\RequirePackage{setspace}
\setstretch{1.15}
% Page current/max
\RequirePackage[page]{totalcount}
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
2024-07-23 20:34:50 +02:00
\cfoot{\makebox[\textwidth][c]{\thepage/\totalpages}}
\renewcommand\headrulewidth{0pt}
2024-02-07 11:42:42 +01:00
% Liens cliquable et métadonnées
\RequirePackage{hyperref}
\AtBeginDocument{
\hypersetup{
pdfauthor={\@mef~\@mel},
pdftitle={\@title},
pdfkeywords={rapport, stage},
2024-02-09 00:11:40 +01:00
pdfsubject={Rapport de stage pour l'Université Paris Cité},
2024-02-09 00:08:37 +01:00
pdfcreator={LaTeX with rapstage class and hyperref package},
2024-02-07 11:42:42 +01:00
hidelinks,
}
}
% Images
\RequirePackage{graphicx,float}
% Figures
2024-07-23 19:38:00 +02:00
\RequirePackage[font=it,labelsep=colon]{caption}
\renewcommand\frenchfigurename{Illustration}
2024-02-07 11:42:42 +01:00
2024-07-23 20:01:36 +02:00
% Listes
2024-07-23 20:14:40 +02:00
\AtBeginDocument{\def\labelitemi{\scriptsize$\bullet$}
\def\labelitemii{\scriptsize$\bullet$}
\def\labelitemiii{\scriptsize$\bullet$}
\def\labelitemiv{\scriptsize$\bullet$}}
2024-07-23 20:01:36 +02:00
\renewcommand\maketitle{
2024-02-07 11:42:42 +01:00
\begin{titlepage}
\begin{center}
2024-07-24 12:37:32 +02:00
\includegraphics[alt={Logo},height=27mm]{images/logo.png}
2024-02-07 11:42:42 +01:00
{
2024-07-24 12:37:32 +02:00
\vspace{4mm}
2024-02-07 11:42:42 +01:00
\setmainfont{Arial}
2024-07-23 19:17:47 +02:00
\Large
2024-07-24 12:37:32 +02:00
Université Paris Cité \\
2024-02-07 11:42:42 +01:00
}
2024-07-24 12:37:32 +02:00
\vspace{11mm}
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\large
2024-07-24 12:37:32 +02:00
\textsc{Faculté de Sciences} \\
2024-02-07 11:42:42 +01:00
2024-07-24 12:37:32 +02:00
\vspace{1mm}
UFR d'Informatique \\
\vspace{-2mm}
Directrice : \@directeur \\
\vspace{14mm}
2024-07-23 19:17:47 +02:00
\Large
2024-07-24 12:37:32 +02:00
\textsc{\@subtitle} \\
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\vspace{3mm}
2024-02-07 11:42:42 +01:00
\LARGE
\textsc{\textbf{\underline{\@title}}}
2024-07-23 19:17:47 +02:00
\end{center}
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\vfill
2024-02-07 12:14:27 +01:00
2024-07-23 19:17:47 +02:00
\large
\noindent
2024-07-24 12:37:32 +02:00
{
\setstretch{0.9}
\begin{tabular}{ll}
\itshape
Tuteur pédagogique : & \itshape\href{\@tpm}{\@tpn} \\
2024-02-07 11:42:42 +01:00
2024-07-24 12:37:32 +02:00
\itshape
Tuteur en entreprise : & \itshape\href{\@tem}{\@ten} \\
\end{tabular}
}
2024-02-07 11:42:42 +01:00
2024-07-24 12:37:32 +02:00
\vspace{19mm}
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\hfill
\textit{\@student : \href{\@mail}{\@mef~\textsc{\@mel}}}
\vspace{17mm}
\Large
\centering\textsc{Année universitaire \@date}
2024-02-07 11:42:42 +01:00
\end{titlepage}
% Nouvelle page vierge
\setcounter{page}{3}
\shipout\null
2024-07-24 12:37:32 +02:00
\newgeometry{right=2cm,left=4cm,bottom=46mm}
2024-02-07 11:42:42 +01:00
}
% Permet d'ajouter la bibliographie
2024-07-24 12:54:22 +02:00
\RequirePackage{etoolbox}
\newcommand\@reference{
2024-02-07 11:42:42 +01:00
\newpage
\addcontentsline{toc}{section}{\@bib}
2024-02-07 11:42:42 +01:00
\bibliography{\@refile}
2024-07-23 20:04:03 +02:00
\newpage
\pagestyle{empty}
2024-02-07 11:42:42 +01:00
}
\newcommand\reference@unstarred{\@reference}
\newcommand\reference@starred[1]{
2024-07-24 12:54:22 +02:00
\patchcmd{\thebibliography}{\list}{#1 \\ \list}{}{}
\@reference
}
\newcommand\reference{\@ifstar{\reference@starred}{\reference@unstarred}}
2024-07-24 13:07:21 +02:00
% Annexe
\renewcommand\frenchappendixname{\hspace{4em}Annexe}
2024-07-24 13:07:21 +02:00
% Souligne mieux les mots
\newcommand\ul[1]{\underline{\smash{#1}}}
% Ne déborde pas sur la marge
\AtBeginDocument{
\sloppy
}