% ============================================================================= % traite-qc.sty — Style éditorial du traité % « Évaluation immobilière résidentielle et multirésidentielle au Québec » % Moteur : LuaLaTeX. Format : 7 x 10 po. Polices : Libertinus Serif / Source Sans 3 % / Libertinus Math / Source Code Pro (toutes distribuées avec TeX Live, licences % OFL — aucune police n'est redistribuée dans ce dépôt). % % Le document maître définit AVANT \usepackage{traite-qc} : % \def\BUILDVARIANT{uqo|independant} \def\BUILDMEDIA{print|numerique} % \newif\ifLogoAutorise (false par défaut : emplacement réservé, pas de logo) % ============================================================================= \ProvidesPackage{traite-qc}[2026/10/31 Style du traité d'évaluation immobilière QC] \providecommand{\BUILDVARIANT}{uqo} \providecommand{\BUILDMEDIA}{print} \providecommand{\PALETTE}{uqo} % --- Langue et polices -------------------------------------------------------- \RequirePackage{fontspec} \RequirePackage[french]{babel} \RequirePackage{amsmath,amssymb,amsthm,mathtools} \RequirePackage{unicode-math} \setmainfont{Libertinus Serif}[Numbers={OldStyle,Proportional}, Ligatures=TeX] \setsansfont{Source Sans 3}[Scale=MatchLowercase, Numbers={Lining}] \setmonofont{Source Code Pro}[Scale=MatchLowercase] \setmathfont{Libertinus Math} \newfontfamily\liningfont{Libertinus Serif}[Numbers={Lining,Proportional}] \newfontfamily\tabfont{Libertinus Serif}[Numbers={Lining,Monospaced}] \RequirePackage{microtype} \RequirePackage{csquotes} \frenchsetup{ItemLabels=\textendash, ThinColonSpace=true, AutoSpacePunctuation=true, StandardLists=true} % --- Mise en page ------------------------------------------------------------- \RequirePackage[fontsize=10.5pt]{fontsize} \RequirePackage[paperwidth=7in, paperheight=10in, inner=22mm, outer=20mm, top=24mm, bottom=24mm, headheight=14pt, headsep=8mm, footskip=12mm, marginparwidth=14mm]{geometry} \setlength{\parskip}{0pt plus 1pt} \setlength{\parindent}{1.2em} \RequirePackage{emptypage} % --- Couleurs ----------------------------------------------------------------- \RequirePackage[table]{xcolor} \input{../styles/palette-\PALETTE.tex} % Palette des figures (identique à styles/palette.json) \definecolor{serieA}{HTML}{2a78d6} \definecolor{serieB}{HTML}{eb6834} \definecolor{serieC}{HTML}{1baf7a} \definecolor{serieD}{HTML}{eda100} \definecolor{serieE}{HTML}{6250d6} \definecolor{serieF}{HTML}{e34948} % --- Utilitaires -------------------------------------------------------------- \RequirePackage{graphicx} \graphicspath{{../assets/figures/}{../assets/logo/}} \RequirePackage{booktabs,array,tabularx,multirow,longtable,threeparttable,makecell} \RequirePackage{enumitem} \setlist{nosep, leftmargin=*, labelindent=0pt} \setlist[itemize,1]{label=\textendash} \RequirePackage{etoolbox,calc,xparse,xspace} \RequirePackage{tikz,pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{shapes,arrows.meta,positioning,calc,decorations.pathreplacing,fit,backgrounds,matrix} \RequirePackage[most]{tcolorbox} \RequirePackage{caption,subcaption} \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}} \captionsetup{font={sf,small}, labelfont={bf,color=brandPrimary}, labelsep=period, justification=justified, singlelinecheck=false, skip=6pt} \captionsetup[table]{position=above, skip=4pt} \RequirePackage{listings} \RequirePackage{fancyhdr} \RequirePackage{titlesec} \RequirePackage{imakeidx} \RequirePackage{siunitx} % --- siunitx (conventions québécoises) --------------------------------------- \sisetup{locale=FR, group-separator={\,}, group-minimum-digits=4, output-decimal-marker={,}, per-mode=symbol, separate-uncertainty=true, table-number-alignment=right, detect-all, mode=match, reset-text-family=false} \DeclareSIUnit{\dollar}{\$} \DeclareSIUnit{\pied}{pi} \DeclareSIUnit{\piedcarre}{pi\ensuremath{^2}} \DeclareSIUnit{\logement}{log.} \DeclareSIUnit{\an}{an} \DeclareSIUnit{\mois}{mois} \DeclareSIUnit{\pb}{pb} \NewDocumentCommand{\dollars}{m}{\qty{#1}{\dollar}} \NewDocumentCommand{\pct}{m}{\qty{#1}{\percent}} \NewDocumentCommand{\parmsq}{m}{\qty{#1}{\dollar\per\metre\squared}} \NewDocumentCommand{\parpisq}{m}{\qty{#1}{\dollar\per\piedcarre}} \NewDocumentCommand{\msq}{m}{\qty{#1}{\metre\squared}} \NewDocumentCommand{\pisq}{m}{\qty{#1}{\piedcarre}} % --- Bibliographie ------------------------------------------------------------ \RequirePackage[backend=biber, style=authoryear, sorting=nyt, maxbibnames=8, maxcitenames=2, uniquename=false, uniquelist=false, giveninits=true, url=true, doi=true, isbn=false, date=year, urldate=long, hyperref=true, backref=false]{biblatex} \addbibresource{../references/library.bib} \DefineBibliographyStrings{french}{ urlseen = {consulté le}, bibliography = {Bibliographie}, references = {Références}, } \renewcommand*{\bibfont}{\small} \setlength{\bibitemsep}{0.4\baselineskip} % --- Hyperliens et renvois ---------------------------------------------------- \ifdefstring{\BUILDMEDIA}{numerique}{% \RequirePackage[colorlinks=true, linkcolor=brandPrimary, citecolor=brandGreen, urlcolor=brandPrimary, pdfusetitle, bookmarksnumbered, pdfdisplaydoctitle]{hyperref}% }{% \RequirePackage[hidelinks, pdfusetitle, bookmarksnumbered]{hyperref}% } \RequirePackage[french, capitalise, noabbrev, nameinlink]{cleveref} \crefname{equation}{l'équation}{les équations} \Crefname{equation}{L'équation}{Les équations} \crefname{figure}{la figure}{les figures} \Crefname{figure}{La figure}{Les figures} \crefname{table}{le tableau}{les tableaux} \Crefname{table}{Le tableau}{Les tableaux} \crefname{chapter}{le chapitre}{les chapitres} \Crefname{chapter}{Le chapitre}{Les chapitres} \crefname{section}{la section}{les sections} \Crefname{section}{La section}{Les sections} \crefname{part}{la partie}{les parties} \Crefname{part}{La partie}{Les parties} \crefname{appendix}{l'annexe}{les annexes} \Crefname{appendix}{L'annexe}{Les annexes} \crefname{exercice}{l'exercice}{les exercices} \Crefname{exercice}{L'exercice}{Les exercices} \crefname{exemple}{l'exemple}{les exemples} \Crefname{exemple}{L'exemple}{Les exemples} \crefname{definition}{la définition}{les définitions} \Crefname{definition}{La définition}{Les définitions} \crefname{theoreme}{le théorème}{les théorèmes} \Crefname{theoreme}{Le théorème}{Les théorèmes} \crefname{proposition}{la proposition}{les propositions} \Crefname{proposition}{La proposition}{Les propositions} \crefname{encadre}{l'encadré}{les encadrés} \Crefname{encadre}{L'encadré}{Les encadrés} % --- Numérotation ------------------------------------------------------------- \numberwithin{equation}{chapter} \numberwithin{figure}{chapter} \numberwithin{table}{chapter} % --- Index -------------------------------------------------------------------- \makeindex[intoc, title=Index, columns=2, options={-s ../styles/traite.ist}] \NewDocumentCommand{\motcle}{m}{\textbf{\textcolor{brandDark}{#1}}\index{#1}} \NewDocumentCommand{\terme}{m m}{\textbf{#1}\index{#1}\index{#2@\emph{#2} (angl.)|see{#1}}} % --- Titres ------------------------------------------------------------------- \titleformat{\part}[display] {\sffamily\bfseries\color{brandPrimary}\centering} {\Large\MakeUppercase{\partname~\thepart}}{1em}{\Huge} \titleformat{\chapter}[display] {\sffamily\color{brandDark}} {\begin{tikzpicture}[remember picture, overlay] \fill[brandPrimary] (current page.north west) rectangle ([yshift=-52mm]current page.north east); \node[anchor=north east, text=white, font=\sffamily\fontsize{72}{72}\selectfont\bfseries, inner sep=0pt] at ([xshift=-20mm, yshift=-12mm]current page.north east) {\thechapter}; \node[anchor=north west, text=brandSecondary, font=\sffamily\small\bfseries, inner sep=0pt] at ([xshift=22mm, yshift=-14mm]current page.north west) {\MakeUppercase{\chaptername~\thechapter}}; \end{tikzpicture}\vspace*{20mm}} {0pt}{\Huge\bfseries\raggedright}[\vspace{8pt}{\color{brandSecondary}\rule{\textwidth}{1.2pt}}\vspace{6pt}] \titlespacing*{\chapter}{0pt}{0pt}{22pt} \titleformat{\section}{\sffamily\Large\bfseries\color{brandPrimary}}{\thesection}{0.8em}{} \titleformat{\subsection}{\sffamily\large\bfseries\color{brandDark}}{\thesubsection}{0.8em}{} \titleformat{\subsubsection}{\sffamily\normalsize\bfseries\color{brandDark}}{\thesubsubsection}{0.8em}{} \titleformat{\paragraph}[runin]{\sffamily\bfseries}{}{0pt}{}[.] \titlespacing*{\section}{0pt}{3.2ex plus 1ex minus .2ex}{1.6ex plus .2ex} \titlespacing*{\subsection}{0pt}{2.6ex plus 1ex minus .2ex}{1.2ex plus .2ex} \setcounter{secnumdepth}{2} \setcounter{tocdepth}{1} % --- En-têtes ----------------------------------------------------------------- \pagestyle{fancy} \fancyhf{} \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhead[LE]{\sffamily\small\liningfont\thepage\quad\textcolor{brandGray}{\nouppercase{\leftmark}}} \fancyhead[RO]{\sffamily\small\textcolor{brandGray}{\nouppercase{\rightmark}}\quad\liningfont\thepage} \renewcommand{\headrulewidth}{0pt} \fancypagestyle{plain}{\fancyhf{}\fancyfoot[C]{\sffamily\small\liningfont\thepage}\renewcommand{\headrulewidth}{0pt}} % --- Environnements théoriques (tcolorbox) ----------------------------------- \tcbset{traitebase/.style={enhanced, breakable, boxrule=0pt, arc=0pt, outer arc=0pt, left=8pt, right=8pt, top=6pt, bottom=6pt, before skip=10pt plus 2pt, after skip=10pt plus 2pt, fonttitle=\sffamily\bfseries, coltitle=white, titlerule=0pt, toptitle=3pt, bottomtitle=3pt}} \newtcbtheorem[number within=chapter, crefname={la définition}{les définitions}, Crefname={La définition}{Les définitions}]{definition}{Définition} {traitebase, colback=brandLight, colbacktitle=brandPrimary, borderline west={2.5pt}{0pt}{brandPrimary}}{def} \newtcbtheorem[number within=chapter, crefname={le théorème}{les théorèmes}, Crefname={Le théorème}{Les théorèmes}]{theoreme}{Théorème} {traitebase, colback=white, colbacktitle=brandDark, borderline west={2.5pt}{0pt}{brandDark}}{thm} \newtcbtheorem[use counter from=theoreme, crefname={la proposition}{les propositions}, Crefname={La proposition}{Les propositions}]{proposition}{Proposition} {traitebase, colback=white, colbacktitle=brandDark, borderline west={2.5pt}{0pt}{brandDark}}{prop} \newtcbtheorem[use counter from=theoreme, crefname={le lemme}{les lemmes}, Crefname={Le lemme}{Les lemmes}]{lemme}{Lemme} {traitebase, colback=white, colbacktitle=brandGray, borderline west={2.5pt}{0pt}{brandGray}}{lem} \newtcbtheorem[number within=chapter, crefname={l'exemple}{les exemples}, Crefname={L'exemple}{Les exemples}]{exemple}{Exemple} {traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt, colbacktitle=brandGrayLight, coltitle=brandDark}{ex} \newtcbtheorem[number within=chapter, crefname={l'encadré}{les encadrés}, Crefname={L'encadré}{Les encadrés}]{encadre}{Encadré} {traitebase, colback=brandLight, colbacktitle=brandSecondary, coltitle=brandDark, borderline west={2.5pt}{0pt}{brandSecondary}}{enc} \renewcommand{\proofname}{Démonstration} \renewenvironment{proof}[1][\proofname]{\par\noindent\textit{#1.}\ \ignorespaces}{\hfill$\square$\par\medskip} % Encadrés non numérotés \newtcolorbox{attention}[1][Attention]{traitebase, colback=red!4!white, colbacktitle=brandRed, title=#1, borderline west={2.5pt}{0pt}{brandRed}} \newtcolorbox{quebec}[1][Au Québec]{traitebase, colback=blue!3!white, colbacktitle=brandPrimary, title=#1, borderline west={2.5pt}{0pt}{brandPrimary}} \newtcolorbox{erreurs}[1][Erreurs fréquentes]{traitebase, colback=orange!5!white, colbacktitle=brandAmber, title=#1, borderline west={2.5pt}{0pt}{brandAmber}} \newtcolorbox{limites}[1][Limites et mises en garde]{traitebase, colback=gray!5!white, colbacktitle=brandGray, title=#1, borderline west={2.5pt}{0pt}{brandGray}} \newtcolorbox{synthetique}[1][Données synthétiques]{traitebase, colback=yellow!8!white, colbacktitle=brandAmber, title=#1, borderline west={2.5pt}{0pt}{brandAmber}} \newtcolorbox{objectifs}{traitebase, colback=brandLight, colbacktitle=brandPrimary, title=Objectifs pédagogiques, borderline west={2.5pt}{0pt}{brandPrimary}} \newtcolorbox{synthese}{traitebase, colback=brandLight, colbacktitle=brandDark, title=À retenir, borderline west={2.5pt}{0pt}{brandDark}} \newtcolorbox{formule}[1][]{traitebase, colback=white, colframe=brandPrimary, boxrule=0.8pt, title=#1, colbacktitle=brandPrimary} \newtcolorbox{pratique}[1][En pratique]{traitebase, colback=green!4!white, colbacktitle=brandGreen, title=#1, borderline west={2.5pt}{0pt}{brandGreen}} \newtcolorbox{sources}[1][Sources et vérification]{traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt, title=#1, colbacktitle=brandGrayLight, coltitle=brandDark, fontupper=\small} % --- Exercices et solutions --------------------------------------------------- \newcounter{exercice}[chapter] \renewcommand{\theexercice}{\thechapter.\arabic{exercice}} \NewDocumentCommand{\niveau}{m}{\textcolor{brandSecondary}{\ifnum#1>0 $\bigstar$\fi\ifnum#1>1 $\bigstar$\fi\ifnum#1>2 $\bigstar$\fi}} % \begin{exercice}[niveau]{titre}{label} ... \end{exercice} \NewDocumentEnvironment{exercice}{O{1} m m} {\refstepcounter{exercice}\label{#3}\par\medskip\noindent \begin{tcolorbox}[traitebase, colback=white, colframe=brandGrayLight, boxrule=0.6pt, colbacktitle=white, coltitle=brandDark, title={Exercice~\theexercice\ \textemdash\ #2\hfill\niveau{#1}}]} {\end{tcolorbox}} % Solutions (fichiers solutions/chNN.tex, inclus dans l'annexe des corrigés) \NewDocumentEnvironment{solution}{m m} {\par\medskip\noindent\begin{tcolorbox}[traitebase, colback=brandLight, colbacktitle=brandGray, title={Solution de l'exercice~\ref{#1} \textemdash\ #2}]} {\end{tcolorbox}} % --- Figures, tableaux, sources ---------------------------------------------- \NewDocumentCommand{\figsource}{m}{\par\vspace{-2pt}{\footnotesize\sffamily\color{brandGray}Source : #1\par}} \NewDocumentCommand{\tabsource}{m}{\par\vspace{2pt}{\footnotesize\sffamily\color{brandGray}Source : #1\par}} \NewDocumentCommand{\synth}{m}{\textsc{[données synthétiques]}\,#1} \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \newcolumntype{Y}{>{\raggedright\arraybackslash}X} \renewcommand{\arraystretch}{1.15} \AtBeginEnvironment{tabular}{\tabfont\small\sffamily} \AtBeginEnvironment{tabularx}{\tabfont\small\sffamily} \AtBeginEnvironment{longtable}{\tabfont\small\sffamily} % --- Code ---------------------------------------------------------------------- \lstdefinestyle{traitecode}{basicstyle=\ttfamily\footnotesize, keywordstyle=\color{brandPrimary}\bfseries, commentstyle=\color{brandGray}\itshape, stringstyle=\color{brandGreen}, numbers=none, frame=none, backgroundcolor=\color{brandLight}, xleftmargin=6pt, framexleftmargin=6pt, breaklines=true, showstringspaces=false, 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} \lstset{style=traitecode, language=Python} % --- Notation mathématique ---------------------------------------------------- \NewDocumentCommand{\E}{}{\operatorname{E}} \NewDocumentCommand{\Var}{}{\operatorname{Var}} \NewDocumentCommand{\Cov}{}{\operatorname{Cov}} \NewDocumentCommand{\NOI}{}{\mathit{RNE}} \NewDocumentCommand{\VAN}{}{\mathit{VAN}} \NewDocumentCommand{\TRI}{}{\mathit{TRI}} \NewDocumentCommand{\DSCR}{}{\mathit{RCD}} \NewDocumentCommand{\LTV}{}{\mathit{RPV}} \NewDocumentCommand{\argmin}{}{\operatorname*{arg\,min}} \NewDocumentCommand{\argmax}{}{\operatorname*{arg\,max}} \NewDocumentCommand{\ind}{}{\mathbb{1}} \NewDocumentCommand{\abs}{m}{\left\lvert #1 \right\rvert} \NewDocumentCommand{\norm}{m}{\left\lVert #1 \right\rVert} \NewDocumentCommand{\dd}{}{\mathrm{d}} \NewDocumentCommand{\T}{}{^{\mathsf{T}}} % --- Marqueur de chapitre en production (doit disparaître des livrables) ----- \NewDocumentCommand{\stubchapter}{}{\begin{attention}[Chapitre en production]Ce chapitre n'est pas encore rédigé. Marqueur \texttt{stubchapter} à retirer.\end{attention}} % --- Page titre ---------------------------------------------------------------- \NewDocumentCommand{\logoslot}{}{% \ifLogoAutorise\includegraphics[height=16mm]{logo-institution}\else \begin{tikzpicture}\draw[brandGrayLight, dashed, line width=0.6pt] (0,0) rectangle (48mm,16mm); \node[text=brandGray, font=\sffamily\scriptsize, align=center] at (24mm,8mm) {Emplacement réservé au logo\\(autorisation écrite requise)};\end{tikzpicture}\fi} \endinput