guide-preparation-vacances/structure.tex

308 lines
9.1 KiB
TeX
Raw Normal View History

2021-07-02 20:04:55 +00:00
\usepackage[utf8]{inputenc}
\usepackage[defaultmono]{droidsansmono}
\usepackage[defaultsans]{droidsans}
\usepackage[default]{droidserif}
2021-07-02 20:04:55 +00:00
\usepackage[T1]{fontenc}
\usepackage[french]{babel} % Césure en français
\usepackage{graphicx}
\graphicspath{{Images/}}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{xcolor}
\usepackage[chapter]{minted}
2021-07-02 20:04:55 +00:00
\definecolor{turquoisefonce}{RGB}{3, 152, 158}
\definecolor{vertdeau}{RGB}{0, 194, 203}
\definecolor{turquoisevif}{RGB}{92, 225, 230}
\definecolor{black}{RGB}{0, 0, 0}
% options
\setlist{nolistsep}
\usepackage{geometry}
\geometry{
2021-07-04 05:34:03 +00:00
paper=a5paper,
top=10mm,
bottom=10mm,
left=15mm,
right=15mm,
2021-07-04 05:34:03 +00:00
headheight=8pt,
footskip=10mm,
2021-07-04 05:34:03 +00:00
headsep=8pt,
2021-07-02 20:04:55 +00:00
}
\usepackage{avant}
\usepackage{mathptmx}
\usepackage{microtype}
\usepackage[style=reading,citestyle=reading,sorting=nyt]{biblatex}
\addbibresource{guide-preparation-vacances.bib}
\defbibheading{bibempty}{}
\usepackage{calc}
\usepackage{makeidx}
\makeindex
\usepackage{titletoc} % Required for manipulating the table of contents
\contentsmargin{0cm} % Removes the default margin
% styles de titres
\titlecontents{part}
[0cm]
2021-07-04 05:34:03 +00:00
{\addvspace{5pt}\bfseries}
2021-07-02 20:04:55 +00:00
{}
{}
{}
\titlecontents{chapter}
[1cm]
2021-07-04 05:34:03 +00:00
{\addvspace{2pt}\large\sffamily\bfseries}
{\color{turquoisefonce!80}\contentslabel[\Large\thecontentslabel]{1cm}\color{turquoisefonce}}
{}
{}
2021-07-02 20:04:55 +00:00
\titlecontents{section}
[1cm]
2021-07-04 05:34:03 +00:00
{\addvspace{1pt}\sffamily\bfseries}
2021-07-02 20:04:55 +00:00
{\contentslabel[\thecontentslabel]{1cm}}
{}
{\hfill\color{black}\thecontentspage}
\titlecontents{subsection}
[1cm]
2021-07-04 05:34:03 +00:00
{\addvspace{1pt}\sffamily\small}
2021-07-02 20:04:55 +00:00
{\contentslabel[\thecontentslabel]{1cm}}
{}
{\ \titlerule*[.5pc]{.}\;\thecontentspage}
\titlecontents{figure}
[1cm]
2021-07-04 05:34:03 +00:00
{\addvspace{1pt}\sffamily\small}
2021-07-02 20:04:55 +00:00
{\thecontentslabel\hspace*{1em}}
{}
{\ \titlerule*[.5pc]{.}\;\thecontentspage}
\titlecontents{table}
[1]
2021-07-04 05:34:03 +00:00
{\addvspace{1pt}\sffamily\small}
2021-07-02 20:04:55 +00:00
{\thecontentslabel\hspace*{1em}}
{}
{\ \titlerule*[.5pc]{.}\;\thecontentspage}
% styles de titres sur page de partie
\titlecontents{lchapter}
[0em]
2021-07-04 05:34:03 +00:00
{\addvspace{10pt}\large\sffamily\bfseries}
2021-07-02 20:04:55 +00:00
{\color{turquoisefonce}\contentslabel[\Large\thecontentslabel]{1cm}\color{turquoisefonce}}
{}
{\color{turquoisefonce}\normalsize\sffamily\bfseries\;\titlerule*[.5pc]{.}\;\thecontentspage}
\titlecontents{lsection}
[0em]
{\sffamily\small}
2021-07-04 05:34:03 +00:00
{\contentslabel[\thecontentslabel]{0.5cm}}
2021-07-02 20:04:55 +00:00
{}
{}
\titlecontents{lsubsection}
[1em] % Left indentation
2021-07-02 20:04:55 +00:00
{\sffamily\footnotesize} % Spacing and font options for subsections
{\contentslabel[\thecontentslabel]{1cm}}
2021-07-02 20:04:55 +00:00
{}
{}
% entête et pied de page
\usepackage{fancyhdr}
\pagestyle{fancy}
\newcommand*\parttitle{}
\let\origpart\part
\renewcommand*{\part}[2][]{%
\ifx\\#1\\
\origpart{#2}%
\renewcommand*\parttitle{#2}%
\else
\origpart[#1]{#2}%
\renewcommand*\parttitle{#1}%
\fi
}
\renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}}
\fancyhf{}
\setlength{\headheight}{15pt}
2021-07-02 20:04:55 +00:00
\fancyhead[LE,RO]{\sffamily\normalsize\thepage}
\fancyhead[LO]{\rightmark}
\fancyhead[RE]{\leftmark}
%\fancyfoot[C]{\thepart. \parttitle}
\renewcommand{\headrulewidth}{0.5pt}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}
\makeatletter
\renewcommand{\cleardoublepage}{
\clearpage\ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\thispagestyle{empty}
\newpage
\fi}
\makeatletter
\renewcommand{\@seccntformat}[1]{\llap{\textcolor{turquoisefonce}{\csname the#1\endcsname}\hspace{1em}}}
\renewcommand{\section}{\@startsection{section}{1}{\z@}
{-4ex \@plus -1ex \@minus -.4ex}
{1ex \@plus.2ex }
{\normalfont\large\sffamily\bfseries}}
\renewcommand{\subsection}{\@startsection {subsection}{2}{\z@}
{-3ex \@plus -0.1ex \@minus -.4ex}
{0.5ex \@plus.2ex }
{\normalfont\sffamily\bfseries}}
\renewcommand{\subsubsection}{\@startsection {subsubsection}{3}{\z@}
{-2ex \@plus -0.1ex \@minus -.2ex}
{.2ex \@plus.2ex }
{\normalfont\small\sffamily\bfseries}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}
{-2ex \@plus-.2ex \@minus .2ex}
{.1ex}
{\normalfont\small\sffamily\bfseries}}
\newcommand{\@mypartnumtocformat}[2]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{turquoisefonce!20}{\strut\parbox[c][.7cm]{\ecart}{\color{turquoisefonce!70}\Large\sffamily\bfseries\centering#1}}\hskip\esp\colorbox{turquoisefonce!40}{\strut\parbox[c][.7cm]{\linewidth-\ecart-\esp}{\Large\sffamily\centering#2}}%
}
\newcommand{\@myparttocformat}[1]{%
\setlength\fboxsep{0pt}%
\noindent\colorbox{turquoisefonce!40}{\strut\parbox[c][.7cm]{\linewidth}{\Large\sffamily\centering#1}}%
}
\newlength\esp
\setlength\esp{4pt}
\newlength\ecart
\setlength\ecart{1cm-\esp}
2021-07-02 20:04:55 +00:00
\newcommand{\thepartimage}{}%
\newcommand{\partimage}[1]{\renewcommand{\thepartimage}{#1}}%
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax%
\refstepcounter{part}%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@mypartnumtocformat{\thepart}{#1}}{\partname~\thepart\ ---\ #1}}
\else%
\addcontentsline{toc}{part}{\texorpdfstring{\protect\@myparttocformat{#1}}{#1}}%
\fi%
\startcontents%
\markboth{}{}%
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[turquoisefonce!10](0cm,0cm) rectangle (\paperwidth,-\paperheight);
2021-07-04 05:34:03 +00:00
\node[anchor=south east] at (\paperwidth-1cm,-\paperheight+1cm){\parbox[t][][t]{11cm}{
2021-07-02 20:04:55 +00:00
\printcontents{l}{0}{\setcounter{tocdepth}{1}}
}};
2021-07-04 05:34:03 +00:00
\node[anchor=north east] at (\paperwidth-1cm,-1cm){\parbox[t][][t]{9cm}{\strut\raggedleft\color{turquoisefonce!60!white}\fontsize{30}{30}\sffamily\bfseries\thepart.#2}};
2021-07-02 20:04:55 +00:00
\end{tikzpicture}};
\end{tikzpicture}}%
\@endpart}
\def\@spart#1{%
\startcontents%
\phantomsection
{\thispagestyle{empty}%
\begin{tikzpicture}[remember picture,overlay]%
\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]%
\fill[turquoisefonce!10](0cm,0cm) rectangle (\paperwidth,-\paperheight);
2021-07-04 05:34:03 +00:00
\node[anchor=north east] at (\paperwidth-1.5cm,-3.25cm){\parbox[t][][t]{9cm}{\strut\raggedleft\color{turquoisefonce!60!white}\fontsize{30}{30}\sffamily\bfseries#1}};
2021-07-02 20:04:55 +00:00
\end{tikzpicture}};
\end{tikzpicture}}
\addcontentsline{toc}{part}{\texorpdfstring{%
\setlength\fboxsep{0pt}%
\noindent\protect\colorbox{turquoisefonce!40}{\strut\protect\parbox[c][.7cm]{\linewidth}{\Large\sffamily\protect\centering #1\quad\mbox{}}}}{#1}}%
\@endpart}
\def\@endpart{\vfil\newpage
\if@twoside
\if@openright
\null
\thispagestyle{empty}%
\newpage
\fi
\fi
\if@tempswa
\twocolumn
\fi}
\newif\ifusechapterimage
\usechapterimagetrue
\newcommand{\thechapterimage}{}%
\newcommand{\chapterimage}[1]{\ifusechapterimage\renewcommand{\thechapterimage}{#1}\fi}%
\newcommand{\autodot}{.}
\def\@makechapterhead#1{%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
\draw[anchor=west] (\Gm@lmargin-1cm,-1.75cm) node [line width=2pt,rounded corners=10pt,draw=turquoisefonce,fill=white,fill opacity=0.6,inner sep=15pt]{\strut\makebox[15cm]{}};
\draw[anchor=west] (\Gm@lmargin-.5cm,-1.85cm) node {\Large\sffamily\bfseries\color{black}\thechapter\autodot~#1\strut};
2021-07-02 20:04:55 +00:00
\end{tikzpicture}};
\end{tikzpicture}
\else
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
2021-07-04 05:34:03 +00:00
\draw[anchor=west] (\Gm@lmargin,-2.25cm) node [line width=2pt,rounded corners=10pt,draw=turquoisefonce,fill=white,fill opacity=0.6,inner sep=15pt]{\strut\makebox[11cm]{}};
\draw[anchor=west] (\Gm@lmargin+.5cm,-2.35cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
2021-07-02 20:04:55 +00:00
\end{tikzpicture}};
\end{tikzpicture}
2021-07-04 05:34:03 +00:00
\fi\fi\par\vspace*{175\p@}}}
2021-07-02 20:04:55 +00:00
%-------------------------------------------
\def\@makeschapterhead#1{%
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.north west)
{\begin{tikzpicture}[remember picture,overlay]
2021-07-04 05:34:03 +00:00
%\node[anchor=north west,inner sep=0pt] at (0,0) {\ifusechapterimage\includegraphics[width=\paperwidth]{\thechapterimage}\fi};
\draw[anchor=west] (\Gm@lmargin,-2.25cm) node [line width=2pt,rounded corners=10pt,draw=turquoisefonce,fill=white,fill opacity=0.6,inner sep=15pt]{\strut\makebox[11cm]{}};
\draw[anchor=west] (\Gm@lmargin+.5cm,-2.35cm) node {\huge\sffamily\bfseries\color{black}#1\strut};
2021-07-02 20:04:55 +00:00
\end{tikzpicture}};
\end{tikzpicture}
2021-07-04 05:34:03 +00:00
\par\vspace*{135\p@}}
2021-07-02 20:04:55 +00:00
\makeatother
\usepackage{hyperref}
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={turquoisefonce!50!black},
citecolor={turquoisevif!50!black},
urlcolor={turquoisevif!80!black}
}
\usepackage{bookmark}
\bookmarksetup{
open,
numbered,
addtohook={%
\ifnum\bookmarkget{level}=0 % chapter
\bookmarksetup{bold}%
\fi
\ifnum\bookmarkget{level}=-1 % part
\bookmarksetup{color=turquoisefonce,bold}%
\fi
}
}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\newcommand{\passthrough}[1]{\lstset{mathescape=false}#1\lstset{mathescape=true}}