SPB Git

Repository Public Research preview

uqo-examen.sty 17.3 KB 406 lines latex

1% =============================================================================2% SP BOUCHER | ACADEMIC RESEARCH3% =============================================================================4% Project      : UQO5% File         : IMM1003-20_Elements_evaluation_immobiliere/04_Examens/Intra_30pct/questionnaire/uqo-examen.sty6% Maintainer   : Simon-Pierre Boucher7% Position     : Professor of Finance8% Institution  : Université du Québec en Outaouais (UQO)9% Website      : https://spboucher.ai10% Research     : research@spboucher.ai11% Copyright    : (c) the author(s) of this work; ownership not asserted here12% License      : None specified (no license file in this repository)13% =============================================================================14% END OF SP BOUCHER SOURCE HEADER15% =============================================================================16% ==============================================================================17% uqo-examen.sty — Style commun pour les examens UQO (IMM1003 / IMM1033)18% Université du Québec en Outaouais — Simon-Pierre Boucher19% Design modernisé : couverture pleine page aux bandes UQO, titres sans-serif,20% bandeaux de questions avec pastilles de points, encadrés et graphiques unifiés.21% Compilation : LuaLaTeX (compatible XeLaTeX)22% ==============================================================================23\NeedsTeXFormat{LaTeX2e}24\ProvidesPackage{uqo-examen}[2026/10/28 Style examens UQO v3]2526% --- Option solutionnaire ---27\newif\ifsolutionnaire28\solutionnairefalse29\DeclareOption{solutionnaire}{\solutionnairetrue}30\ProcessOptions\relax3132% --- Polices et langue (LuaLaTeX / XeLaTeX) ---33\RequirePackage{fontspec}34\RequirePackage[french]{babel}35\frenchsetup{StandardLists=true}36\setmainfont{TeX Gyre Termes}37\setsansfont{TeX Gyre Heros}38\RequirePackage{unicode-math}39\setmathfont{TeX Gyre Termes Math}4041% --- Mise en page ---42\RequirePackage[letterpaper,margin=2.3cm,top=2.7cm,bottom=2.7cm]{geometry}43\setlength{\headheight}{15pt}44\RequirePackage{graphicx}45\RequirePackage{amsmath}46\RequirePackage{booktabs}47\RequirePackage{array}48\RequirePackage{tabularx}49\RequirePackage{multirow}50\RequirePackage{longtable}51\RequirePackage[table]{xcolor}52\RequirePackage{enumitem}53\RequirePackage{fancyhdr}54\RequirePackage{lastpage}55\RequirePackage{tikz}56\usetikzlibrary{calc,positioning}57\RequirePackage{fontawesome5}58\RequirePackage{tcolorbox}59\tcbuselibrary{skins,breakable}60\RequirePackage{needspace}61\RequirePackage{xurl}62\urlstyle{same}63\RequirePackage[font=small, labelfont={sf,bf,color=uqoBleu}, textfont={color=uqoGris}, labelsep=period]{caption}64\RequirePackage{siunitx}65\sisetup{66  locale = FR,67  group-separator = {\,},68  group-minimum-digits = 4,69  output-decimal-marker = {,}70}7172% --- Couleurs UQO ---73\definecolor{uqoBleu}{RGB}{0, 62, 126}74\definecolor{uqoBleuClair}{RGB}{0, 102, 179}75\definecolor{uqoOr}{RGB}{198, 163, 0}76\definecolor{uqoGris}{RGB}{88, 89, 91}77\definecolor{uqoVert}{RGB}{0, 128, 70}78\definecolor{uqoRouge}{RGB}{180, 35, 24}79\definecolor{uqoBgClair}{RGB}{240, 244, 248}8081% --- Métadonnées de l'examen (à définir dans le document) ---82\newcommand{\examCours}{}      \newcommand{\setexamCours}[1]{\renewcommand{\examCours}{#1}}83\newcommand{\examTitreCours}{} \newcommand{\setexamTitreCours}[1]{\renewcommand{\examTitreCours}{#1}}84\newcommand{\examType}{}       \newcommand{\setexamType}[1]{\renewcommand{\examType}{#1}}85\newcommand{\examSession}{}    \newcommand{\setexamSession}[1]{\renewcommand{\examSession}{#1}}86\newcommand{\examDuree}{}      \newcommand{\setexamDuree}[1]{\renewcommand{\examDuree}{#1}}87\newcommand{\examRemise}{}     \newcommand{\setexamRemise}[1]{\renewcommand{\examRemise}{#1}}88\newcommand{\examPonderation}{}\newcommand{\setexamPonderation}[1]{\renewcommand{\examPonderation}{#1}}89\newcommand{\examCouverture}{} \newcommand{\setexamCouverture}[1]{\renewcommand{\examCouverture}{#1}}90% Dates clés (v3) : jour + heure de publication, jour + heure de remise, durée de la fenêtre, mode de remise91\newcommand{\examPublicationJour}{}  \newcommand{\setexamPublicationJour}[1]{\renewcommand{\examPublicationJour}{#1}}92\newcommand{\examPublicationHeure}{} \newcommand{\setexamPublicationHeure}[1]{\renewcommand{\examPublicationHeure}{#1}}93\newcommand{\examPublicationNote}{}  \newcommand{\setexamPublicationNote}[1]{\renewcommand{\examPublicationNote}{#1}}94\newcommand{\examEcheanceJour}{}     \newcommand{\setexamEcheanceJour}[1]{\renewcommand{\examEcheanceJour}{#1}}95\newcommand{\examEcheanceHeure}{}    \newcommand{\setexamEcheanceHeure}[1]{\renewcommand{\examEcheanceHeure}{#1}}96\newcommand{\examEcheanceNote}{}     \newcommand{\setexamEcheanceNote}[1]{\renewcommand{\examEcheanceNote}{#1}}97\newcommand{\examFenetre}{}          \newcommand{\setexamFenetre}[1]{\renewcommand{\examFenetre}{#1}}98\newcommand{\examMatiere}{}          \newcommand{\setexamMatiere}[1]{\renewcommand{\examMatiere}{#1}}99\newcommand{\examRemiseNote}{}       \newcommand{\setexamRemiseNote}[1]{\renewcommand{\examRemiseNote}{#1}}100101% --- En-têtes / pieds de page (filet doré, typographie sans) ---102\pagestyle{fancy}103\fancyhf{}104\renewcommand{\headrulewidth}{1.2pt}105\renewcommand{\headrule}{\hbox to\headwidth{\color{uqoOr}\leaders\hrule height \headrulewidth\hfill}}106\renewcommand{\footrulewidth}{0.4pt}107\renewcommand{\footrule}{\hbox to\headwidth{\color{uqoBgClair!60!uqoGris!30}\leaders\hrule height \footrulewidth\hfill}}108\fancyhead[L]{\small\sffamily\textcolor{uqoBleu}{\textbf{\examCours}}\ifsolutionnaire\else\;{\color{uqoGris}·\;\examTitreCours}\fi}109\fancyhead[R]{\small\sffamily\color{uqoGris}\examType\ifsolutionnaire\ --- \textcolor{uqoVert}{\textbf{SOLUTIONNAIRE}}\fi}110\fancyfoot[C]{\small\sffamily\color{uqoGris}\examSession}111\fancyfoot[L]{\small\sffamily\color{uqoGris}UQO --- Simon-Pierre Boucher}112\fancyfoot[R]{\small\sffamily\color{uqoGris}Page \textcolor{uqoBleu}{\textbf{\thepage}} de \pageref{LastPage}}113114% --- Style global des graphiques (pgfplots) ---115\RequirePackage{pgfplots}116\pgfplotsset{compat=1.18}117\usepgfplotslibrary{dateplot}118\pgfplotsset{every axis/.append style={119  axis line style={uqoGris!55},120  tick style={uqoGris!55},121  ticklabel style={font=\footnotesize\sffamily, /pgf/number format/assume math mode},122  xlabel style={font=\small\sffamily, color=uqoBleu},123  ylabel style={font=\small\sffamily, color=uqoBleu},124  grid=major,125  major grid style={uqoGris!16},126  legend style={font=\footnotesize\sffamily, draw=uqoGris!35, fill=white, rounded corners=2pt},127}}128129% --- Pastille de points ---130\newcommand{\uqopastille}[1]{{\sffamily\bfseries\textcolor{uqoBleu}{(#1 points)}}}131\newcommand{\uqopastilleclair}[1]{{\sffamily\bfseries\textcolor{white}{#1 points}}}132133% ==============================================================================134% PAGE COUVERTURE v3 — bandes UQO, titre, tuiles « dates clés », fiche, identification135% ==============================================================================136\newtcolorbox{uqotuile}[2][uqoBleu]{% [couleur]{libellé}137  enhanced, sharp corners, boxrule=0pt,138  colback=uqoBgClair, colframe=uqoBgClair,139  borderline west={4pt}{0pt}{#1},140  left=11pt, right=8pt, top=6pt, bottom=6pt,141  before skip=0pt, after skip=0pt,142  title={\sffamily\scriptsize\bfseries\color{#1}#2},143  colbacktitle=uqoBgClair, coltitle=#1, toptitle=6pt, bottomtitle=0pt,144  titlerule=0pt145}146\newcommand{\pagetitreexamen}{%147\begingroup148\thispagestyle{empty}%149\begin{tikzpicture}[remember picture, overlay]150  \fill[uqoBleu] (current page.north west) rectangle ([yshift=-4.9cm]current page.north east);151  \fill[uqoOr]   ([yshift=-4.9cm]current page.north west) rectangle ([yshift=-5.1cm]current page.north east);152  \node[fill=white, inner xsep=16pt, inner ysep=10pt]153    at ($(current page.north)+(0,-1.75cm)$) {\includegraphics[width=3.1cm]{assets/uqo-logo.png}};154  \node[anchor=north, text=white, font=\sffamily\bfseries\large]155    at ($(current page.north)+(0,-3.45cm)$) {Université du Québec en Outaouais};156  \node[anchor=north, text=uqoBgClair, font=\sffamily\small]157    at ($(current page.north)+(0,-4.15cm)$) {Département des sciences administratives};158  \fill[uqoBleu] (current page.south west) rectangle ([yshift=1.3cm]current page.south east);159  \fill[uqoOr]   ([yshift=1.3cm]current page.south west) rectangle ([yshift=1.5cm]current page.south east);160  \node[anchor=south, text=white, font=\sffamily\footnotesize]161    at ($(current page.south)+(0,0.5cm)$)162    {UQO --- Département des sciences administratives --- \examSession};163\end{tikzpicture}%164\vspace*{1.6cm}165\begin{center}166{\sffamily\footnotesize\bfseries\color{uqoGris}\MakeUppercase{\examSession\ \ ·\ \ \examPonderation}\par}167\vspace{7pt}168{\fontsize{24}{27}\selectfont\sffamily\bfseries\color{uqoBleu}\examType\par}169\ifsolutionnaire170  \vspace{7pt}171  {\large\sffamily\bfseries\color{uqoVert}SOLUTIONNAIRE --- Réservé à l'enseignant\par}172\fi173\vspace{9pt}174{\color{uqoOr}\rule{4.2cm}{2.4pt}}\par175\vspace{9pt}176{\LARGE\sffamily\bfseries\color{uqoBleu}\examCours\par}177\vspace{2pt}178{\Large\sffamily\color{uqoBleuClair}\examTitreCours\par}179\vspace{6pt}180{\small\itshape\color{uqoGris}\examCouverture\par}181\end{center}182183\vspace{10pt}184% --- Dates clés ---185\noindent\begin{minipage}[t]{0.487\textwidth}186\begin{uqotuile}[uqoBleu]{\faIcon{paper-plane}\; PUBLICATION DU QUESTIONNAIRE}187  {\sffamily\bfseries\color{uqoBleu}\examPublicationJour\par}188  \vspace{2pt}189  {\sffamily\bfseries\color{uqoBleu}\fontsize{21}{24}\selectfont\examPublicationHeure\par}190  \vspace{3pt}191  {\sffamily\footnotesize\color{uqoGris}\examPublicationNote\par}192\end{uqotuile}193\end{minipage}\hfill194\begin{minipage}[t]{0.487\textwidth}195\begin{uqotuile}[uqoRouge]{\faIcon{flag-checkered}\; REMISE AU PLUS TARD}196  {\sffamily\bfseries\color{uqoRouge}\examEcheanceJour\par}197  \vspace{2pt}198  {\sffamily\bfseries\color{uqoRouge}\fontsize{21}{24}\selectfont\examEcheanceHeure\par}199  \vspace{3pt}200  {\sffamily\footnotesize\color{uqoGris}\examEcheanceNote\par}201\end{uqotuile}202\end{minipage}\par203\vspace{3pt}204\begin{center}205\tcbox[on line, enhanced, arc=9pt, boxrule=0pt, colback=uqoOr!22, left=9pt, right=9pt, top=2pt, bottom=2pt, boxsep=1pt]206  {\sffamily\small\bfseries\color{uqoBleu}\faIcon{hourglass-half}\;\;\examFenetre}207\end{center}208209\vspace{3pt}210% --- Fiche ---211{\renewcommand{\arraystretch}{1.35}\sffamily\small212\noindent\begin{tabularx}{\textwidth}{@{}>{\leavevmode\bfseries\color{uqoBleu}}p{3.0cm}>{\leavevmode\raggedright\arraybackslash}X@{}}213\arrayrulecolor{uqoBleu}\specialrule{1pt}{0pt}{2pt}214Professeur & Simon-Pierre Boucher \\215Modalité & \examDuree \\216Matière & \examMatiere \\217Remise & \examRemise \\218Pondération & \examPonderation\ \ ·\ \ 100 points \\219\arrayrulecolor{uqoOr}\specialrule{1pt}{2pt}{0pt}\arrayrulecolor{black}220\end{tabularx}\par}221222\ifsolutionnaire\else223\vspace{8pt}224{\renewcommand{\arraystretch}{1.8}\sffamily\small225\noindent\begin{tabularx}{\textwidth}{@{}>{\leavevmode\bfseries\color{uqoBleu}}p{3.0cm}>{\leavevmode}X>{\leavevmode\bfseries\color{uqoBleu}}p{2.4cm}>{\leavevmode}X@{}}226Nom, prénom & \textcolor{uqoGris!55}{\dotfill} & Groupe & \textcolor{uqoGris!55}{\dotfill} \\227Code permanent & \textcolor{uqoGris!55}{\dotfill} & Signature & \textcolor{uqoGris!55}{\dotfill} \\228\end{tabularx}\par}229\fi230231\if\relax\detokenize\expandafter{\examRemiseNote}\relax\else232\vspace{9pt}233\begin{tcolorbox}[enhanced, sharp corners, boxrule=0pt, colback=uqoBgClair, colframe=uqoBgClair,234    borderline west={4pt}{0pt}{uqoBleuClair}, left=10pt, right=10pt, top=6pt, bottom=6pt,235    before skip=0pt, after skip=0pt]236  {\sffamily\scriptsize\bfseries\color{uqoBleuClair}\faIcon{envelope}\; MODE DE REMISE PRIVILÉGIÉ\par}237  \vspace{2pt}238  {\sffamily\small\color{uqoGris!120}\examRemiseNote\par}239\end{tcolorbox}240\fi241242\vspace{5pt}243\begin{center}244{\footnotesize\sffamily\color{uqoGris}Ce document compte \textbf{\pageref{LastPage}} pages, section \emph{Sources} incluse. Vérifiez qu'il est complet avant de commencer.}245\end{center}246\clearpage247\endgroup248}249250% ==============================================================================251% BOÎTES252% ==============================================================================253\newtcolorbox{consignes}{254  enhanced, breakable, sharp corners,255  colback=uqoBgClair, colframe=uqoBleu, boxrule=0.6pt,256  title={Instructions générales},257  fonttitle=\sffamily\bfseries, coltitle=white, colbacktitle=uqoBleu,258  left=9pt, right=9pt, top=6pt, bottom=6pt,259  toptitle=3pt, bottomtitle=3pt260}261262\newtcolorbox{miseengarde}[1][Important]{263  enhanced, breakable, sharp corners,264  colback=uqoRouge!4, colframe=uqoRouge, boxrule=0.6pt,265  title={#1},266  fonttitle=\sffamily\bfseries, coltitle=white, colbacktitle=uqoRouge,267  left=9pt, right=9pt, top=6pt, bottom=6pt,268  toptitle=3pt, bottomtitle=3pt269}270271\newtcolorbox{donnees}[1][Données]{272  enhanced, breakable, sharp corners,273  colback=white, colframe=uqoBleuClair!70, boxrule=0.5pt,274  title={#1},275  fonttitle=\sffamily\bfseries\small, coltitle=white, colbacktitle=uqoBleuClair,276  left=9pt, right=9pt, top=8pt, bottom=7pt,277  toptitle=4pt, bottomtitle=4pt,278  before skip=8pt, after skip=10pt,279  before upper={\rowcolors{2}{white}{uqoBgClair!75}\renewcommand{\arraystretch}{1.18}}280}281282% Mise en situation : paragraphe à filet doré283\newtcolorbox{situation}{284  enhanced, breakable, sharp corners, boxrule=0pt,285  colback=uqoOr!9, colframe=uqoOr!9,286  borderline west={3pt}{0pt}{uqoOr},287  left=10pt, right=9pt, top=6pt, bottom=6pt,288  before skip=6pt, after skip=8pt289}290291% Fin de l'examen292\newcommand{\finexamen}[1]{%293  \vspace{16pt}294  \begin{tcolorbox}[enhanced, sharp corners, boxrule=0pt, colback=uqoBleu, halign=center,295      left=10pt, right=10pt, top=8pt, bottom=8pt, borderline south={2pt}{-3pt}{uqoOr}]296    {\sffamily\bfseries\color{white}\faIcon{flag-checkered}\;\;Fin de l'examen}\par\vspace{3pt}297    {\small\color{white}#1}298  \end{tcolorbox}299}300301% Boîte solution (solutionnaire seulement)302\newtcolorbox{solution}[1][Solution]{303  enhanced, breakable, sharp corners,304  colback=uqoVert!4, colframe=uqoVert, boxrule=0.6pt,305  title={#1},306  fonttitle=\sffamily\bfseries, coltitle=white, colbacktitle=uqoVert,307  left=9pt, right=9pt, top=6pt, bottom=6pt,308  toptitle=3pt, bottomtitle=3pt309}310311% Notes de correction (solutionnaire seulement)312\newtcolorbox{notescorrection}[1][Notes de correction]{313  enhanced, breakable, sharp corners,314  colback=uqoOr!7, colframe=uqoOr, boxrule=0.6pt,315  title={#1},316  fonttitle=\sffamily\bfseries, coltitle=uqoBleu, colbacktitle=uqoOr!45,317  left=9pt, right=9pt, top=6pt, bottom=6pt,318  toptitle=3pt, bottomtitle=3pt319}320321% ==============================================================================322% SECTIONS ET QUESTIONS323% ==============================================================================324\newcounter{partie}325\newcommand{\partieexamen}[2]{% {Titre}{points ou vide}326  \stepcounter{partie}%327  \needspace{14\baselineskip}%328  \vspace{18pt}%329  \noindent\begin{tcolorbox}[enhanced, sharp corners, colback=uqoBleu, colframe=uqoBleu, boxrule=0pt,330      left=12pt, right=12pt, top=8pt, bottom=8pt,331      borderline south={2.4pt}{-3pt}{uqoOr},332      before skip=0pt, after skip=10pt]333    \begin{minipage}{\dimexpr\linewidth-3cm}334      {\sffamily\scriptsize\bfseries\color{uqoOr}\MakeUppercase{Partie \Alph{partie}}\par}335      \vspace{1pt}336      {\sffamily\bfseries\large\color{white}#1\par}337    \end{minipage}%338    \hfill339    \if\relax\detokenize{#2}\relax\else340      \begin{minipage}{2.8cm}\raggedleft341        {\sffamily\bfseries\color{white}\fontsize{19}{20}\selectfont #2}\\[1pt]342        {\sffamily\scriptsize\color{uqoOr}\MakeUppercase{points}}343      \end{minipage}%344    \fi345  \end{tcolorbox}\par346}347348\newcounter{questionexam}349\newenvironment{questionexam}[2]{% {Titre}{points}350  \refstepcounter{questionexam}%351  \needspace{8\baselineskip}%352  \vspace{12pt}%353  \noindent\begin{tcolorbox}[enhanced, sharp corners, boxrule=0pt,354      colback=uqoBgClair, colframe=uqoBgClair,355      borderline west={4pt}{0pt}{uqoBleu},356      left=10pt, right=76pt, top=5pt, bottom=5pt,357      before skip=0pt, after skip=7pt,358      overlay={\node[anchor=east, font=\sffamily\bfseries\footnotesize, text=white, fill=uqoBleu,359                inner xsep=7pt, inner ysep=4pt, rounded corners=2.5pt]360                at ([xshift=-7pt]frame.east) {#2 points};}]361    {\sffamily\bfseries\large\color{uqoBleu}Question \arabic{questionexam}}%362    {\sffamily\large\color{uqoGris!80}\ \ ·\ \ }%363    {\sffamily\bfseries\large\color{uqoGris!95}#1}364  \end{tcolorbox}\nopagebreak365  \noindent\ignorespaces366}{\par}367368% --- Boîte « formule » : équations mises en évidence, rendu net ---369\newtcolorbox{formule}{370  enhanced, sharp corners,371  colback=white, colframe=uqoBleu, boxrule=0.8pt,372  left=10pt, right=10pt, top=7pt, bottom=7pt,373  before skip=8pt, after skip=8pt,374  halign=center375}376377% --- Espace de réponse (version étudiante : espace vide encadré) ---378\newcommand{\espacereponse}[1]{% hauteur379  \ifsolutionnaire\else380  \par\vspace{4pt}\noindent381  \begin{tikzpicture}382    \draw[uqoGris!60, rounded corners=2pt] (0,0) rectangle (\textwidth-2pt, #1);383  \end{tikzpicture}\par384  \fi385}386387% Lignes de réponse388\newcounter{uqolignes}389\newcommand{\lignesreponse}[1]{% nombre de lignes390  \ifsolutionnaire\else391  \par\vspace{6pt}392  \setcounter{uqolignes}{0}%393  \loop\ifnum\value{uqolignes}<#1394    \noindent\textcolor{uqoGris!55}{\rule{\textwidth}{0.4pt}}\par\vspace{18pt}395    \stepcounter{uqolignes}%396  \repeat397  \fi398}399400% --- Divers ---401\newcommand{\pts}[1]{\tcbox[on line, enhanced, arc=2.5pt, boxrule=0pt, colback=uqoBleu!11,402  left=3pt, right=3pt, top=0pt, bottom=0pt, boxsep=1.2pt]{\sffamily\scriptsize\bfseries\color{uqoBleu}#1~pts}}403\setlength{\parindent}{0pt}404\setlength{\parskip}{5pt}405\renewcommand{\arraystretch}{1.25}406
Files main
Menu

Theme