blob: 5adc081955d989471a0c52d6f187bb2ebfe9e91f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
\usepackage{titlesec}
\providecommand{\DUdocumentsubtitle}[1]{%
\color{black}
\CaviarDreamsFont\selectfont
\Large
\raggedleft
#1
%\end{flushright}
%\switchcolumn[1]* % Synchronise the column at this position
}
\makeatletter
\def\@maketitle{%
\switchcolumn[1]%
\vspace*{1cm}
\raggedright
\fontsize{1.2cm}{2cm}\BeatrixFont\selectfont \@title
}
\makeatother
% Liste des couleurs utilisées pour les titres.
% La définition colorsDim doit correspondre au nombre de couleurs présentes, et
% est utilisée pour cycler quand on atteind la dernière couleur.
\def\colorsDim{7}
\colorlet{title[0]}{orange}
\colorlet{title[1]}{purple}
\colorlet{title[2]}{green!60!black}
\colorlet{title[3]}{blue!50!black}
\colorlet{title[4]}{teal!50!black}
\colorlet{title[5]}{cyan!50!black}
\colorlet{title[6]}{brown!50!black}
\newcounter{mySection}
% Nécessaire pour que le compteur soit persistent avec le package paracol.
\globalcounter{mySection}
% Calcul d'un modulo.
\def\truncdiv#1#2{((#1-(#2-1)/2)/#2)}
\def\moduloop#1#2{(#1-\truncdiv{#1}{#2}*#2)}
\def\modulo#1#2{\number\numexpr\moduloop{#1}{#2}\relax}
% Création d'une section colorée.
% La commande attend deux paramètres, la couleur, et le texte à afficher,
% le texte correspond à celui de la section et est fourni par titlesec en
% paramètre de manière implicite.
\newcommand{\colorsection}[3]{%
\centering
\colorbox{#1}{%
\parbox{#2}{%
\centering\textcolor{white}{#3}}%
}
}
% Titre de niveau 1
\titleformat{\section}[block]
{\CaviarDreamsFont\selectfont\Large}
{\thesection}
{0em}
{\centering}
% Titre de niveau 2
\titleformat{\subsection}
{\large}
{\thesubsection}
{}
{}
% Titre de niveau 3
\titleformat{\subsubsection}
{\bfseries\normalsize}
{\thesubsubsection}
{2em}
{}
{}
\newcommand{\DUtitletitle}[1]{%
\stepcounter{mySection}\colorsection{title[\modulo{\the\value{mySection}}{\colorsDim}]}{\linewidth}{#1}
}
|