rapport-stage/rapstage.cls

241 lines
5.4 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}
\ProcessOptions
\ifoption@code
% Intégration code
\RequirePackage{minted}
\usemintedstyle{emacs}
\fi
\ifoption@f
% Mode féminin
\renewcommand{\@student}{Étudiante}
\fi
\ifoption@n
% Mode neutre
\renewcommand{\@student}{Étudiant·e}
\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-23 19:17:47 +02:00
\RequirePackage[a4paper,top=3.51cm,bottom=3.3cm,left=5cm,right=5cm]{geometry}
2024-02-07 11:42:42 +01:00
% Style de bibliographie
\addto{\extrasfrench}{\renewcommand\refname{Bibliographie}}
\bibliographystyle{unsrt}
% Auteur
2024-07-23 18:00:43 +02:00
\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
}
2024-07-23 18:00:43 +02:00
\newcommand{\me@starred}[2]{
\gdef\@mef{#1} % first name
\gdef\@mel{#2} % last name
\gdef\@mail{} % mail
}
\newcommand{\me}{\@ifstar{\me@starred}{\me@unstarred}}
2024-02-07 11:42:42 +01:00
\newcommand{\@mef}{Alice}
\newcommand{\@mel}{Dubois}
\newcommand{\@mail}{mailto:alice.dubois@example.com}
% Titre
\renewcommand{\title}[1]{\gdef\@title{#1}}
\renewcommand{\@title}{TITRE DU RAPPORT}
% Date
2024-07-11 12:11:59 +02:00
\newcount\lastyear
\lastyear=\year
\advance\lastyear by -1
2024-02-07 11:42:42 +01:00
\renewcommand{\date}[1]{\gdef\@date{#1}}
2024-07-11 12:11:59 +02:00
\renewcommand{\@date}{\the\lastyear{}/\the\year{}}
2024-02-07 11:42:42 +01:00
% Tuteur pédagogique
2024-07-23 18:00:43 +02:00
\newcommand{\tuteurpedago@unstarred}[2]{
2024-02-07 11:42:42 +01:00
\gdef\@tpn{#1} % nom
\gdef\@tpm{mailto:#2} % mail
}
2024-07-23 18:00:43 +02:00
\newcommand{\tuteurpedago@starred}[1]{
\gdef\@tpn{#1} % nom
\gdef\@tpm{} % mail
}
\newcommand{\tuteurpedago}{
\@ifstar{\tuteurpedago@starred}{\tuteurpedago@unstarred}}
2024-07-23 18:22:44 +02:00
\newcommand{\@tpn}{John \textsc{Doe}}
2024-02-07 11:42:42 +01:00
\newcommand{\@tpm}{mailto:john.doe@example.com}
% Tuteur entreprise
2024-07-23 18:00:43 +02:00
\newcommand{\tuteurentreprise@unstarred}[2]{
2024-02-07 11:42:42 +01:00
\gdef\@ten{#1} % nom
\gdef\@tem{mailto:#2} % mail
}
2024-07-23 18:00:43 +02:00
\newcommand{\tuteurentreprise@starred}[1]{
\gdef\@ten{#1} % nom
\gdef\@tem{} % mail
}
\newcommand{\tuteurentreprise}{
\@ifstar{\tuteurentreprise@starred}{\tuteurentreprise@unstarred}}
2024-07-23 18:22:44 +02:00
\newcommand{\@ten}{Bob \textsc{Dupont}}
2024-02-07 11:42:42 +01:00
\newcommand{\@tem}{mailto:bob.dupont@example.com}
% Directeurice université
\newcommand{\directeur}[1]{\gdef\@directeur{#1}}
\newcommand{\@directeur}{Carole \textsc{Delporte}}
% Sous-titre
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
\newcommand{\@subtitle}{Rapport de Stage de Master 2}
% Fichier de la bibliographie
\newcommand{\bibliofile}[1]{\gdef\@refile{#1}}
% 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}}
2024-02-07 11:42:42 +01:00
\renewcommand{\headrulewidth}{0pt}
% 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}
\addto\captionsfrench{\renewcommand{\figurename}{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
2024-02-07 11:42:42 +01:00
\renewcommand{\maketitle}{
\begin{titlepage}
\begin{center}
2024-07-23 19:17:47 +02:00
\includegraphics[alt={Logo},height=3cm]{images/logo.png}
2024-02-07 11:42:42 +01:00
{
\setmainfont{Arial}
2024-07-23 19:17:47 +02:00
\Large
Université Paris Cité\\
2024-02-07 11:42:42 +01:00
}
2024-07-23 19:17:47 +02:00
\vspace{12mm}
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\large
2024-02-07 11:42:42 +01:00
\textsc{Faculté de Sciences}\\
UFR d'Informatique\\
Directrice : \@directeur\\
2024-07-23 19:17:47 +02:00
\vspace{13mm}
\Large
2024-02-07 11:42:42 +01:00
\textsc{\@subtitle}\\
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
\begin{tabular}{ll}
\itshape
Tuteur pédagogique : & \itshape\href{\@tpm}{\@tpn} \\
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\itshape
Tuteur en entreprise : & \itshape\href{\@tem}{\@ten} \\
\end{tabular}
2024-02-07 11:42:42 +01:00
2024-07-23 19:17:47 +02:00
\vspace{2cm}
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-23 19:24:52 +02:00
\newgeometry{right=2cm,left=4cm,top=35mm,bottom=46mm}
2024-02-07 11:42:42 +01:00
}
% Permet d'ajouter la bibliographie
2024-02-07 11:42:42 +01:00
\newcommand{\reference}{
\newpage
\addcontentsline{toc}{section}{\refname}
\bibliography{\@refile}
2024-07-23 20:04:03 +02:00
\newpage
\pagestyle{empty}
2024-02-07 11:42:42 +01:00
}
% Souligne mieux les mots
\newcommand{\ul}[1]{\underline{\smash{#1}}}
% Ne déborde pas sur la marge
\AtBeginDocument{
\sloppy
}