SPB Git
16.3 KB · 277 lines latex
1% =============================================================================2% traite-qc.sty — Style éditorial du traité3% « Évaluation immobilière résidentielle et multirésidentielle au Québec »4% Moteur : LuaLaTeX. Format : 7 x 10 po. Polices : Libertinus Serif / Source Sans 35% / Libertinus Math / Source Code Pro (toutes distribuées avec TeX Live, licences6% OFL — aucune police n'est redistribuée dans ce dépôt).7%8% Le document maître définit AVANT \usepackage{traite-qc} :9%   \def\BUILDVARIANT{uqo|independant}  \def\BUILDMEDIA{print|numerique}10%   \newif\ifLogoAutorise (false par défaut : emplacement réservé, pas de logo)11% =============================================================================12\ProvidesPackage{traite-qc}[2026/10/31 Style du traité d'évaluation immobilière QC]1314\providecommand{\BUILDVARIANT}{uqo}15\providecommand{\BUILDMEDIA}{print}16\providecommand{\PALETTE}{uqo}1718% --- Langue et polices --------------------------------------------------------19\RequirePackage{fontspec}20\RequirePackage[french]{babel}21\RequirePackage{amsmath,amssymb,amsthm,mathtools}22\RequirePackage{unicode-math}23\setmainfont{Libertinus Serif}[Numbers={OldStyle,Proportional}, Ligatures=TeX]24\setsansfont{Source Sans 3}[Scale=MatchLowercase, Numbers={Lining}]25\setmonofont{Source Code Pro}[Scale=MatchLowercase]26\setmathfont{Libertinus Math}27\newfontfamily\liningfont{Libertinus Serif}[Numbers={Lining,Proportional}]28\newfontfamily\tabfont{Libertinus Serif}[Numbers={Lining,Monospaced}]29\RequirePackage{microtype}30\RequirePackage{csquotes}31\frenchsetup{ItemLabels=\textendash, ThinColonSpace=true, AutoSpacePunctuation=true, StandardLists=true}3233% --- Mise en page -------------------------------------------------------------34\RequirePackage[fontsize=10.5pt]{fontsize}35\RequirePackage[paperwidth=7in, paperheight=10in,36  inner=22mm, outer=20mm, top=24mm, bottom=24mm,37  headheight=14pt, headsep=8mm, footskip=12mm, marginparwidth=14mm]{geometry}38\setlength{\parskip}{0pt plus 1pt}39\setlength{\parindent}{1.2em}40\RequirePackage{emptypage}4142% --- Couleurs -----------------------------------------------------------------43\RequirePackage[table]{xcolor}44\input{../styles/palette-\PALETTE.tex}45% Palette des figures (identique à styles/palette.json)46\definecolor{serieA}{HTML}{2a78d6}47\definecolor{serieB}{HTML}{eb6834}48\definecolor{serieC}{HTML}{1baf7a}49\definecolor{serieD}{HTML}{eda100}50\definecolor{serieE}{HTML}{6250d6}51\definecolor{serieF}{HTML}{e34948}5253% --- Utilitaires --------------------------------------------------------------54\RequirePackage{graphicx}55\graphicspath{{../assets/figures/}{../assets/logo/}}56\RequirePackage{booktabs,array,tabularx,multirow,longtable,threeparttable,makecell}57\RequirePackage{enumitem}58\setlist{nosep, leftmargin=*, labelindent=0pt}59\setlist[itemize,1]{label=\textendash}60\RequirePackage{etoolbox,calc,xparse,xspace}61\RequirePackage{tikz,pgfplots}62\pgfplotsset{compat=1.18}63\usetikzlibrary{shapes,arrows.meta,positioning,calc,decorations.pathreplacing,fit,backgrounds,matrix}64\RequirePackage[most]{tcolorbox}65\RequirePackage{caption,subcaption}66\addto\captionsfrench{\renewcommand{\tablename}{Tableau}\renewcommand{\figurename}{Figure}\renewcommand{\chaptername}{Chapitre}\renewcommand{\partname}{Partie}\renewcommand{\appendixname}{Annexe}\renewcommand{\listtablename}{Liste des tableaux}\renewcommand{\listfigurename}{Liste des figures}}67\captionsetup{font={sf,small}, labelfont={bf,color=brandPrimary}, labelsep=period, justification=justified, singlelinecheck=false, skip=6pt}68\captionsetup[table]{position=above, skip=4pt}69\RequirePackage{listings}70\RequirePackage{fancyhdr}71\RequirePackage{titlesec}72\RequirePackage{imakeidx}73\RequirePackage{siunitx}7475% --- siunitx (conventions québécoises) ---------------------------------------76\sisetup{locale=FR, group-separator={\,}, group-minimum-digits=4,77  output-decimal-marker={,}, per-mode=symbol, separate-uncertainty=true,78  table-number-alignment=right, detect-all, mode=match, reset-text-family=false}79\DeclareSIUnit{\dollar}{\$}80\DeclareSIUnit{\pied}{pi}81\DeclareSIUnit{\piedcarre}{pi\ensuremath{^2}}82\DeclareSIUnit{\logement}{log.}83\DeclareSIUnit{\an}{an}84\DeclareSIUnit{\mois}{mois}85\DeclareSIUnit{\pb}{pb}86\NewDocumentCommand{\dollars}{m}{\qty{#1}{\dollar}}87\NewDocumentCommand{\pct}{m}{\qty{#1}{\percent}}88\NewDocumentCommand{\parmsq}{m}{\qty{#1}{\dollar\per\metre\squared}}89\NewDocumentCommand{\parpisq}{m}{\qty{#1}{\dollar\per\piedcarre}}90\NewDocumentCommand{\msq}{m}{\qty{#1}{\metre\squared}}91\NewDocumentCommand{\pisq}{m}{\qty{#1}{\piedcarre}}9293% --- Bibliographie ------------------------------------------------------------94\RequirePackage[backend=biber, style=authoryear, sorting=nyt, maxbibnames=8,95  maxcitenames=2, uniquename=false, uniquelist=false, giveninits=true, url=true,96  doi=true, isbn=false, date=year, urldate=long, hyperref=true, backref=false]{biblatex}97\addbibresource{../references/library.bib}98\DefineBibliographyStrings{french}{99  urlseen = {consulté le},100  bibliography = {Bibliographie},101  references = {Références},102}103\renewcommand*{\bibfont}{\small}104\setlength{\bibitemsep}{0.4\baselineskip}105106% --- Hyperliens et renvois ----------------------------------------------------107\ifdefstring{\BUILDMEDIA}{numerique}{%108  \RequirePackage[colorlinks=true, linkcolor=brandPrimary, citecolor=brandGreen,109    urlcolor=brandPrimary, pdfusetitle, bookmarksnumbered, pdfdisplaydoctitle]{hyperref}%110}{%111  \RequirePackage[hidelinks, pdfusetitle, bookmarksnumbered]{hyperref}%112}113\RequirePackage[french, capitalise, noabbrev, nameinlink]{cleveref}114\crefname{equation}{équation}{équations}115\Crefname{equation}{Équation}{Équations}116\crefname{figure}{figure}{figures}117\Crefname{figure}{Figure}{Figures}118\crefname{table}{tableau}{tableaux}119\Crefname{table}{Tableau}{Tableaux}120\crefname{chapter}{chapitre}{chapitres}121\Crefname{chapter}{Chapitre}{Chapitres}122\crefname{section}{section}{sections}123\Crefname{section}{Section}{Sections}124\crefname{part}{partie}{parties}125\Crefname{part}{Partie}{Parties}126\crefname{appendix}{annexe}{annexes}127\Crefname{appendix}{Annexe}{Annexes}128\crefname{exercice}{exercice}{exercices}129\Crefname{exercice}{Exercice}{Exercices}130\crefname{exemple}{exemple}{exemples}131\Crefname{exemple}{Exemple}{Exemples}132\crefname{definition}{définition}{définitions}133\Crefname{definition}{Définition}{Définitions}134\crefname{theoreme}{théorème}{théorèmes}135\Crefname{theoreme}{Théorème}{Théorèmes}136\crefname{proposition}{proposition}{propositions}137\Crefname{proposition}{Proposition}{Propositions}138\crefname{encadre}{encadré}{encadrés}139\Crefname{encadre}{Encadré}{Encadrés}140141% --- Numérotation -------------------------------------------------------------142\numberwithin{equation}{chapter}143\numberwithin{figure}{chapter}144\numberwithin{table}{chapter}145146% --- Index --------------------------------------------------------------------147\makeindex[intoc, title=Index, columns=2, options={-s ../styles/traite.ist}]148\NewDocumentCommand{\motcle}{m}{\textbf{\textcolor{brandDark}{#1}}\index{#1}}149\NewDocumentCommand{\terme}{m m}{\textbf{#1}\index{#1}\index{#2@\emph{#2} (angl.)|see{#1}}}150151% --- Titres -------------------------------------------------------------------152\titleformat{\part}[display]153  {\sffamily\bfseries\color{brandPrimary}\centering}154  {\Large\MakeUppercase{\partname~\thepart}}{1em}{\Huge}155\titleformat{\chapter}[display]156  {\sffamily\color{brandDark}}157  {\begin{tikzpicture}[remember picture, overlay]158     \fill[brandPrimary] (current page.north west) rectangle ([yshift=-52mm]current page.north east);159     \node[anchor=north east, text=white, font=\sffamily\fontsize{72}{72}\selectfont\bfseries, inner sep=0pt]160       at ([xshift=-20mm, yshift=-12mm]current page.north east) {\thechapter};161     \node[anchor=north west, text=brandSecondary, font=\sffamily\small\bfseries, inner sep=0pt]162       at ([xshift=22mm, yshift=-14mm]current page.north west) {\MakeUppercase{\chaptername~\thechapter}};163   \end{tikzpicture}\vspace*{20mm}}164  {0pt}{\Huge\bfseries\raggedright}[\vspace{8pt}{\color{brandSecondary}\rule{\textwidth}{1.2pt}}\vspace{6pt}]165\titlespacing*{\chapter}{0pt}{0pt}{22pt}166\titleformat{\section}{\sffamily\Large\bfseries\color{brandPrimary}}{\thesection}{0.8em}{}167\titleformat{\subsection}{\sffamily\large\bfseries\color{brandDark}}{\thesubsection}{0.8em}{}168\titleformat{\subsubsection}{\sffamily\normalsize\bfseries\color{brandDark}}{\thesubsubsection}{0.8em}{}169\titleformat{\paragraph}[runin]{\sffamily\bfseries}{}{0pt}{}[.]170\titlespacing*{\section}{0pt}{3.2ex plus 1ex minus .2ex}{1.6ex plus .2ex}171\titlespacing*{\subsection}{0pt}{2.6ex plus 1ex minus .2ex}{1.2ex plus .2ex}172\setcounter{secnumdepth}{2}173\setcounter{tocdepth}{1}174175% --- En-têtes -----------------------------------------------------------------176\pagestyle{fancy}177\fancyhf{}178\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}179\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}180\fancyhead[LE]{\sffamily\small\liningfont\thepage\quad\textcolor{brandGray}{\nouppercase{\leftmark}}}181\fancyhead[RO]{\sffamily\small\textcolor{brandGray}{\nouppercase{\rightmark}}\quad\liningfont\thepage}182\renewcommand{\headrulewidth}{0pt}183\fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\sffamily\small\liningfont\thepage}\renewcommand{\headrulewidth}{0pt}}184185% --- Environnements théoriques (tcolorbox) -----------------------------------186\tcbset{traitebase/.style={enhanced, breakable, boxrule=0pt, arc=0pt, outer arc=0pt,187  left=8pt, right=8pt, top=6pt, bottom=6pt, before skip=10pt plus 2pt, after skip=10pt plus 2pt,188  fonttitle=\sffamily\bfseries, coltitle=white, titlerule=0pt, toptitle=3pt, bottomtitle=3pt}}189\newtcbtheorem[number within=chapter, crefname={définition}{définitions}, Crefname={Définition}{Définitions}]{definition}{Définition}190  {traitebase, colback=brandLight, colbacktitle=brandPrimary, borderline west={2.5pt}{0pt}{brandPrimary}}{def}191\newtcbtheorem[number within=chapter, crefname={théorème}{théorèmes}, Crefname={Théorème}{Théorèmes}]{theoreme}{Théorème}192  {traitebase, colback=white, colbacktitle=brandDark, borderline west={2.5pt}{0pt}{brandDark}}{thm}193\newtcbtheorem[use counter from=theoreme, crefname={proposition}{propositions}, Crefname={Proposition}{Propositions}]{proposition}{Proposition}194  {traitebase, colback=white, colbacktitle=brandDark, borderline west={2.5pt}{0pt}{brandDark}}{prop}195\newtcbtheorem[use counter from=theoreme, crefname={lemme}{lemmes}, Crefname={Lemme}{Lemmes}]{lemme}{Lemme}196  {traitebase, colback=white, colbacktitle=brandGray, borderline west={2.5pt}{0pt}{brandGray}}{lem}197\newtcbtheorem[number within=chapter, crefname={exemple}{exemples}, Crefname={Exemple}{Exemples}]{exemple}{Exemple}198  {traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt, colbacktitle=brandGrayLight, coltitle=brandDark}{ex}199\newtcbtheorem[number within=chapter, crefname={encadré}{encadrés}, Crefname={Encadré}{Encadrés}]{encadre}{Encadré}200  {traitebase, colback=brandLight, colbacktitle=brandSecondary, coltitle=brandDark, borderline west={2.5pt}{0pt}{brandSecondary}}{enc}201\renewcommand{\proofname}{Démonstration}202\renewenvironment{proof}[1][\proofname]{\par\noindent\textit{#1.}\ \ignorespaces}{\hfill$\square$\par\medskip}203204% Encadrés non numérotés205\newtcolorbox{attention}[1][Attention]{traitebase, colback=red!4!white, colbacktitle=brandRed, title={#1}, borderline west={2.5pt}{0pt}{brandRed}}206\newtcolorbox{quebec}[1][Au Québec]{traitebase, colback=blue!3!white, colbacktitle=brandPrimary, title={#1}, borderline west={2.5pt}{0pt}{brandPrimary}}207\newtcolorbox{erreurs}[1][Erreurs fréquentes]{traitebase, colback=orange!5!white, colbacktitle=brandAmber, title={#1}, borderline west={2.5pt}{0pt}{brandAmber}}208\newtcolorbox{limites}[1][Limites et mises en garde]{traitebase, colback=gray!5!white, colbacktitle=brandGray, title={#1}, borderline west={2.5pt}{0pt}{brandGray}}209\newtcolorbox{synthetique}[1][Données synthétiques]{traitebase, colback=yellow!8!white, colbacktitle=brandAmber, title={#1}, borderline west={2.5pt}{0pt}{brandAmber}}210\newtcolorbox{objectifs}{traitebase, colback=brandLight, colbacktitle=brandPrimary, title=Objectifs pédagogiques, borderline west={2.5pt}{0pt}{brandPrimary}}211\newtcolorbox{synthese}{traitebase, colback=brandLight, colbacktitle=brandDark, title=À retenir, borderline west={2.5pt}{0pt}{brandDark}}212\newtcolorbox{formule}[1][]{traitebase, colback=white, colframe=brandPrimary, boxrule=0.8pt, title={#1}, colbacktitle=brandPrimary}213\newtcolorbox{pratique}[1][En pratique]{traitebase, colback=green!4!white, colbacktitle=brandGreen, title={#1}, borderline west={2.5pt}{0pt}{brandGreen}}214\newtcolorbox{sources}[1][Sources et vérification]{traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt, title={#1}, colbacktitle=brandGrayLight, coltitle=brandDark, fontupper=\small}215216% --- Exercices et solutions ---------------------------------------------------217\newcounter{exercice}[chapter]218\renewcommand{\theexercice}{\thechapter.\arabic{exercice}}219\NewDocumentCommand{\niveau}{m}{\textcolor{brandSecondary}{\ifnum#1>0 $\bigstar$\fi\ifnum#1>1 $\bigstar$\fi\ifnum#1>2 $\bigstar$\fi}}220% \begin{exercice}[niveau]{titre}{label} ... \end{exercice}221\NewDocumentEnvironment{exercice}{O{1} m m}222  {\refstepcounter{exercice}\label{#3}\par\medskip\noindent223   \begin{tcolorbox}[traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt,224     colbacktitle=white, coltitle=brandDark, title={Exercice~\theexercice\ \textemdash\ #2\hfill\niveau{#1}}]}225  {\end{tcolorbox}}226% Solutions (fichiers solutions/chNN.tex, inclus dans l'annexe des corrigés)227\NewDocumentEnvironment{solution}{m m}228  {\par\medskip\noindent\begin{tcolorbox}[traitebase, colback=brandLight, colbacktitle=brandGray,229     title={Solution de l'exercice~\ref{#1} \textemdash\ #2}]}230  {\end{tcolorbox}}231232% --- Figures, tableaux, sources ----------------------------------------------233\NewDocumentCommand{\figsource}{m}{\par\vspace{-2pt}{\footnotesize\sffamily\color{brandGray}Source : #1\par}}234\NewDocumentCommand{\tabsource}{m}{\par\vspace{2pt}{\footnotesize\sffamily\color{brandGray}Source : #1\par}}235\NewDocumentCommand{\synth}{m}{\textsc{[données synthétiques]}\,#1}236\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}237\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}238\newcolumntype{Y}{>{\raggedright\arraybackslash}X}239\renewcommand{\arraystretch}{1.15}240\AtBeginEnvironment{tabular}{\tabfont\small\sffamily}241\AtBeginEnvironment{tabularx}{\tabfont\small\sffamily}242\AtBeginEnvironment{longtable}{\tabfont\small\sffamily}243244% --- Code ----------------------------------------------------------------------245\lstdefinestyle{traitecode}{basicstyle=\ttfamily\footnotesize, keywordstyle=\color{brandPrimary}\bfseries,246  commentstyle=\color{brandGray}\itshape, stringstyle=\color{brandGreen}, numbers=none, frame=none,247  backgroundcolor=\color{brandLight}, xleftmargin=6pt, framexleftmargin=6pt, breaklines=true, showstringspaces=false,248  literate={é}{{\'e}}1 {è}{{\`e}}1 {à}{{\`a}}1 {ù}{{\`u}}1 {ê}{{\^e}}1 {â}{{\^a}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 {ç}{{\c c}}1 {É}{{\'E}}1 {À}{{\`A}}1 {€}{{\euro}}1}249\lstset{style=traitecode, language=Python}250251% --- Notation mathématique ----------------------------------------------------252\NewDocumentCommand{\E}{}{\operatorname{E}}253\NewDocumentCommand{\Var}{}{\operatorname{Var}}254\NewDocumentCommand{\Cov}{}{\operatorname{Cov}}255\NewDocumentCommand{\NOI}{}{\mathit{RNE}}256\NewDocumentCommand{\VAN}{}{\mathit{VAN}}257\NewDocumentCommand{\TRI}{}{\mathit{TRI}}258\NewDocumentCommand{\DSCR}{}{\mathit{RCD}}259\NewDocumentCommand{\LTV}{}{\mathit{RPV}}260\NewDocumentCommand{\argmin}{}{\operatorname*{arg\,min}}261\NewDocumentCommand{\argmax}{}{\operatorname*{arg\,max}}262\NewDocumentCommand{\ind}{}{\mathbb{1}}263\NewDocumentCommand{\abs}{m}{\left\lvert #1 \right\rvert}264\NewDocumentCommand{\norm}{m}{\left\lVert #1 \right\rVert}265\NewDocumentCommand{\dd}{}{\mathrm{d}}266\NewDocumentCommand{\T}{}{^{\mathsf{T}}}267268% --- Marqueur de chapitre en production (doit disparaître des livrables) -----269\NewDocumentCommand{\stubchapter}{}{\begin{attention}[Chapitre en production]Ce chapitre n'est pas encore rédigé. Marqueur \texttt{stubchapter} à retirer.\end{attention}}270271% --- Page titre ----------------------------------------------------------------272\NewDocumentCommand{\logoslot}{}{%273  \ifLogoAutorise\includegraphics[height=16mm]{logo-institution}\else274  \begin{tikzpicture}\draw[brandGrayLight, dashed, line width=0.6pt] (0,0) rectangle (48mm,16mm);275  \node[text=brandGray, font=\sffamily\scriptsize, align=center] at (24mm,8mm) {Emplacement réservé au logo\\(autorisation écrite requise)};\end{tikzpicture}\fi}276\endinput277
Files · 2eb2bf4e67f754808bae5090a9e53eab37149ddb
Menu

Theme