rapport-stage/rapstage.cls

238 lines
5.2 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
\usepackage[style=english]{csquotes}
\MakeOuterQuote{"}
% Format des pages
2024-02-07 11:42:42 +01:00
\RequirePackage[a4paper]{geometry}
% Style de bibliographie
\addto{\extrasfrench}{\renewcommand\refname{Bibliographie}}
\bibliographystyle{unsrt}
% TODO : Autoriser des commandes sans mail
% 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}
\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}
\titlelabel{\thetitle.\quad}
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{}
\cfoot{\thepage/\totalpages}
\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
\usepackage[font=it,labelsep=colon]{caption}
\addto\captionsfrench{\renewcommand{\figurename}{Illustration}}
2024-02-07 11:42:42 +01:00
\renewcommand{\maketitle}{
\begin{titlepage}
\begin{center}
2024-05-03 01:32:39 +02:00
\includegraphics[alt={Logo},height=3.5cm]{images/logo.png}
2024-02-07 11:42:42 +01:00
{
\setmainfont{Arial}
\LARGE
Université Paris Cité\\
2024-02-07 11:42:42 +01:00
}
\vspace{1cm}
\Large
\textsc{Faculté de Sciences}\\
\vspace{3mm}
UFR d'Informatique\\
Directrice : \@directeur\\
\vspace{15mm}
\textsc{\@subtitle}\\
\LARGE
\textsc{\textbf{\underline{\@title}}}
\vspace{25mm}
\Large
\begin{tabular}{ll}
2024-02-07 12:14:27 +01:00
\itshape
Tuteur pédagogique : & \itshape\href{\@tpm}{\@tpn} \\
\itshape
Tuteur en entreprise : & \itshape\href{\@tem}{\@ten} \\
2024-02-07 11:42:42 +01:00
\end{tabular}
\vspace{1cm}
\hfill
2024-02-07 12:14:27 +01:00
\textit{\@student : \href{\@mail}{\@mef~\textsc{\@mel}}}
2024-02-07 11:42:42 +01:00
\vfill
\textsc{Année universitaire \@date}
\end{center}
\end{titlepage}
% Nouvelle page vierge
\setcounter{page}{3}
\shipout\null
\newgeometry{
left=4cm,
right=2cm,
2024-02-07 16:01:42 +01:00
top=3.51cm,
bottom=3.51cm,
2024-02-07 11:42:42 +01:00
}
}
% Permet d'ajouter la bibliographie
2024-02-07 11:42:42 +01:00
\newcommand{\reference}{
\newpage
\pagestyle{empty}
\addcontentsline{toc}{section}{\refname}
\bibliography{\@refile}
}
% Souligne mieux les mots
\newcommand{\ul}[1]{\underline{\smash{#1}}}
% Ne déborde pas sur la marge
\AtBeginDocument{
\sloppy
}