preambule_inrae.tex 6.57 KiB
%*******************************************************************************
% @file rapport_inrae/preambule_inrae.tex
% Préambule pour modèle de rapport INRAE
% @author David Dorchies (INRAE Montpellier)
% @date Avril 2017
%*******************************************************************************
% Beau tableau
\usepackage{booktabs}
% Quotations
% @see https://fr.sharelatex.com/learn/Typesetting_quotations
% @usage the environment displayquote prints a display quotation and the command \textquote an in-line quotation
\usepackage{csquotes} 
% displayquote in italic 
\renewcommand{\mkbegdispquote}[2]{\itshape}
% Gestion de la bibliographie avec biblatex
\input{rapport/preambule_biblatex}
% Extra space for numbered titles in table of contents 
% http://tex.stackexchange.com/a/13691/124910
\usepackage{tocstyle}
% Ajout de la gestion des couleurs
% The \usepackage is obvious, but the initialization of additional commands like usenames allows you to use names of the default colors, the same 16 base colors as used in HTML. The dvipsnames allows you access to more colors, another 64, and svgnames allows access to about 150 colors. The initialization of "table" allows colors to be added to tables by placing the color command just before the table. https://en.wikibooks.org/wiki/LaTeX/Colors
% @see http://mirrors.ircam.fr/pub/CTAN/macros/latex/contrib/xcolor/xcolor.pdf
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{textcomp} % Unicode degree symbol °
% Ecrire les siècles
\def\siecle#1{\textsc{\romannumeral #1}\textsuperscript{e}~siècle}
% Supprime les liens moches et permet le retour à la ligne du ToC
\PassOptionsToPackage{hyphens}{url}\usepackage[hidelinks,breaklinks]{hyperref} 
% Définition des marges
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
% Table's definition
% http://www.xm1math.net/doculatex/tableaux.html
\usepackage{array,multirow,makecell}
%How to create fixed width table columns with text raggedright/centered/raggedleft?
% @see https://tex.stackexchange.com/a/12712
% @example \begin{tabular}{| c | L{3cm} | C{3cm} | R{3cm} |}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% Avoir la possibilité de ne pas avoir de césure sur un bloc de texte (pour le titre en page de garde) http://tex.stackexchange.com/a/5003
% @example \nohyphens{(text block)}
\usepackage{hyphenat}
% pour fixer l'emplacement des figures
% \begin{figure}[H]
% Voir http://tex.stackexchange.com/a/8633
\usepackage{float} 
%subfigures http://tex.stackexchange.com/a/37597
\usepackage{subcaption} 
% Liens colorés http://tex.stackexchange.com/a/12408
\usepackage{url}
\hypersetup{
7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
colorlinks, linkcolor={blue!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black} } % Forcer les figures à apparaître dans la section en cours % http://tex.stackexchange.com/a/32605 \usepackage[section]{placeins} % How to reset chapter and section counter with \part http://tex.stackexchange.com/q/54383 \makeatletter \@addtoreset{chapter}{part} \makeatother % Redéfinition de \cleardoublepage pour créer une page vide % \cleardoublepage permet de générer une page vide % si le chapitre ne commence pas sur la page de droite \makeatletter \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else \hbox{} \vspace*{\fill} \vspace{\fill} \thispagestyle{empty} \newpage \if@twocolumn\hbox{}\newpage\fi\fi\fi} \makeatother % Définition des entêtes et pieds de page \usepackage{fancyhdr} \pagestyle{fancy} % Fancyhdr does not apply same header/footer on chapter and non-chapter pages % http://tex.stackexchange.com/a/117334 \usepackage{etoolbox} \patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{} % Page de N à M % @example \cfoot{\thepage\ sur \pageref{LastPage}} % @see https://fr.wikibooks.org/wiki/LaTeX/Mise_en_page \usepackage{lastpage} % Style de page du rapport \fancypagestyle{rapport}{ \input{rapport/headfoot_content} } % Définition de la police du document http://stackoverflow.com/q/877597 \usepackage{times} \renewcommand{\familydefault}{\sfdefault} \urlstyle{same} %http://tex.stackexchange.com/questions/261434/changing-url-font % Quatrième de couverture % @see http://latex-community.org/forum/viewtopic.php?t=26188#p92083 \newcommand*\cleartobackcover{ \clearpage \ifodd\value{page}\hbox{}\vspace*{\fill}\thispagestyle{empty}\newpage\fi } % Todo notes % @usage The todonotes package makes three commands available to the user: \todo[]{}, \missingfigure{} and \listoftodos. \usepackage{todonotes} % Ajustement des bulles todo mises dans la marge \setlength{\marginparwidth}{1.6cm} %\let\marginpar\oldmarginpar % Definition des couleurs \RequirePackage{rapport_inrae/inraecolors} % Pourquoi les couleurs chargées depuis "inraecolors" ne sont-elles pas disponibles pour \hypersetup ci-dessous ? \definecolor{titreColor}{HTML}{008C8E} % irsteaDark
141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
\definecolor{linkColor}{HTML}{423089} % irsteaBlue \hypersetup{ colorlinks, linkcolor={linkColor}, citecolor={linkColor}, urlcolor={linkColor} } % Definition des titres \usepackage{titlesec} \titleformat{\chapter} [block] {\color{titreColor}\normalfont\Large\bfseries\sffamily} {\thechapter}{0.5em}{} \titleformat{\section} [block] {\color{titreColor}\normalfont\Large\bfseries\sffamily\raggedright} {\thesection}{0.5em}{} \titleformat{\subsection} [block] {\color{titreColor}\normalfont\bfseries\sffamily\itshape\raggedright} {\thesubsection}{0.5em}{} \titleformat{\subsubsection} [block] {\color{titreColor}\normalfont\sffamily\itshape\raggedright} {\thesubsubsection}{0.5em}{} \setcounter{secnumdepth}{3} % for numbering subsubsection http://tex.stackexchange.com/a/42163 % Définition du format des paragraphes \setlength{\parskip}{0.5em} % Format des titres utilisés dans le préambule du rapport (Auteurs, résumé...) \newcommand{\titrepreambule}[1]{ \vspace{2\baselineskip} {\sffamily\Large\color{titreColor}\scshape{#1}} \vspace{\baselineskip}} % Replace hyphen by bullet in list \usepackage{enumitem} \setlist[itemize]{label=\raisebox{0.25ex}{$\bullet$}} % Acronymes \usepackage[printonlyused,withpage]{acronym} % List of figures and tables as sections in a report https://texblog.org/2014/03/25/table-of-contents-list-of-figures-and-tables-as-sections-in-a-report/ \makeatletter \renewcommand\listoftables{% \section{\listtablename}% \@starttoc{lot}% } \renewcommand\listoffigures{% \section{\listfigurename}% \@starttoc{lof}% } \makeatother