-
Notifications
You must be signed in to change notification settings - Fork 0
/
theseinalco.sty
290 lines (273 loc) · 9.16 KB
/
theseinalco.sty
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
%% theseinalco.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{theseinalco}[2020-05-03 v. 0.6 style de thèse pour l'INALCO]
\@ifclassloaded{scrbook}%
{%
\KOMAoptions{%
chapterprefix=true,%imprime le mot chapitre dans les titres de chapitre
appendixprefix=true,%imprime le mot annexe dans les titres d'annexe
}
% Apparence des titres de chapitre
\renewcommand*{\chapterformat}{%
\chapapp~\thechapter%
\par\nobreak\vspace{-\parskip}\vspace{-\baselineskip}\vspace{10pt}%
\rule{\textwidth}{.5pt}%
\nobreak\vspace{-\parskip}\vspace{-\baselineskip}\vspace{15pt}%
}
\addtokomafont{chapterentry}{\rmfamily\normalsize}
\RedeclareSectionCommands[
tocraggedpagenumber,%
toclinefill=\hspace{.5em}%
]{chapter}
}%
{%
% \PackageWarning{theseinalco.sty}{theseinalco.sty can only be used with the scrbook document class}
}%
%%% Marges et interligne
\KOMAoptions{%
paper=a4,%papier format a4
DIV=10,%calcul des marges
BCOR=8mm,%correction pour la reliure
titlepage=firstiscover,%la page de titre est la couverture et les marges y sont ajustées
twoside%recto-verso
}
\raggedbottom% pas d'espace extensible entre les paragraphes
\RequirePackage{scrhack}
\RequirePackage{tocbasic}
\KOMAoption{setspace}{true}
\RequirePackage{setspace}
%%% Divisions hiérarchiques
\KOMAoptions{%
headings=big,%titres de divisions hiérarchiquer de grande taille
numbers=noendperiod,%pas de points à la fin des numéros de divisions
}
\setcounter{secnumdepth}{\subsubsectionnumdepth}% les sous-sous-sections sont numérotées
% Apparence des titres de partie
\renewcommand*{\partformat}{%
\partname~\thepart%
\par\nobreak\vspace{-\parskip}\vspace{-\baselineskip}\vspace{10pt}%
\rule{\textwidth}{.5pt}%
\nobreak\vspace{-\parskip}\vspace{-\baselineskip}\vspace{15pt}%
}
% Mise en forme des titres de divisions
\renewcommand*{\subsectionformat}{\upshape\thesubsection\autodot\enskip}
\renewcommand*{\subsubsectionformat}{\upshape\thesubsubsection\autodot\enskip}
\addtokomafont{disposition}{\rmfamily\setstretch{1}}
\addtokomafont{subsection}{\itshape}
%%% Tables des contenus
\addtokomafont{partentry}{\rmfamily\normalsize}
\renewcommand\addparttocentry[2]{%
\addtocentrydefault{part}{}{\textsc{\uppercase{#1: #2}}}%
}
\RedeclareSectionCommands[
tocraggedpagenumber,%
toclinefill=\hspace{.5em}%
]{part,section,subsection,subsubsection,paragraph,subparagraph}
\AfterTOCHead{\singlespacing}
\KOMAoptions{bibliography=totoc}% bibliographie dans la table des matières
\DeclareTOCStyleEntry[linefill=\hspace{.5em}, raggedpagenumber]{tocline}{figure}
\DeclareTOCStyleEntry[linefill=\hspace{.5em}, raggedpagenumber]{tocline}{table}
%%% En-têtes et pieds de pages
\addtokomafont{pagehead}{\small}
%%%%%%%%%%%%%%% Style des listes %%%%%%%%%%%%%%%
\RequirePackage{enumitem}
\setlist{nosep}
\setlist[description]{font=\rmfamily}
% %%%%%%%%%%%%%%% Nouveaux champs de métadonnées %%%%%%%%%%%%%%%
\RequirePackage{datatool}% pour mettre en en forme la liste des membres du jury
\newcommand{\universite}[1]{\def\@universite{#1}}\universite{}
\newcommand{\couniversite}[1]{\def\@couniversite{#1}}\couniversite{}
\newcommand{\ecoledoctorale}[1]{\def\@ecoledoctorale{#1}}\ecoledoctorale{}
\newcommand{\coecoledoctorale}[1]{\def\@coecoledoctorale{#1}}\coecoledoctorale{}
\newcommand{\unite}[1]{\def\@unite{#1}}\unite{}
\newcommand{\counite}[1]{\def\@counite{#1}}\counite{}
\newcommand{\diplome}[1]{\def\@diplome{#1}}\diplome{}
\newcommand{\grade}[1]{\def\@grade{#1}}\grade{}
\newcommand{\discipline}[1]{\def\@discipline{#1}}\discipline{}
\newcommand{\direction}[1]{\def\@direction{#1}}\direction{}
\newcommand{\preauthor}[1]{\def\@preauthor{#1}}\preauthor{}
\newcommand{\logo}[1]{\def\@logo{#1}}\logo{}
\renewcommand{\dtlheaderformat}[1]{}
\DTLnewdb{ldirection}
\newcommand*{\directeur}[4]{%
\DTLnewrow{ldirection}%
\DTLnewdbentry{ldirection}{civilite}{#1}%
\DTLnewdbentry{ldirection}{prenom}{#2}%
\DTLnewdbentry{ldirection}{nom}{#3}%
\DTLnewdbentry{ldirection}{affiliation}{#4}%
}
\DTLnewdb{lrapporteur}
\newcommand*{\rapporteur}[4]{%
\DTLnewrow{lrapporteur}%
\DTLnewdbentry{lrapporteur}{civilite}{#1}%
\DTLnewdbentry{lrapporteur}{prenom}{#2}%
\DTLnewdbentry{lrapporteur}{nom}{#3}%
\DTLnewdbentry{lrapporteur}{affiliation}{#4}%
}
\DTLnewdb{ljury}
\newcommand*{\jury}[4]{%
\DTLnewrow{ljury}%
\DTLnewdbentry{ljury}{civilite}{#1}%
\DTLnewdbentry{ljury}{prenom}{#2}%
\DTLnewdbentry{ljury}{nom}{#3}%
\DTLnewdbentry{ljury}{affiliation}{#4}%
}
%%% Page de titre
\RequirePackage{graphicx}
\RequirePackage{tabulary}
\renewcommand{\coverpageleftmargin}{2cm}
\renewcommand{\coverpagetopmargin}{2cm}
\renewcommand{\coverpagebottommargin}{2cm}
\AtBeginDocument{\renewcommand{\maketitle}{%
\begin{titlepage}
\setstretch{1}%
\topmargin=\dimexpr \coverpagetopmargin-1in\relax
\oddsidemargin=\dimexpr \coverpageleftmargin-1in\relax
\evensidemargin=\dimexpr \coverpageleftmargin-1in\relax
\textwidth=\dimexpr
\paperwidth-\coverpageleftmargin-\coverpagerightmargin\relax
\textheight=\dimexpr
\paperheight-\coverpagetopmargin-\coverpagebottommargin\relax
\headheight=0pt
\headsep=0pt
\footskip=\baselineskip
\@colht=\textheight
\@colroom=\textheight
\vsize=\textheight
\columnwidth=\textwidth
\hsize=\columnwidth
\linewidth=\hsize
\begin{center}
\ifdefempty{\@logo}{\relax}{\@logo\par\bigskip\bigskip}
\if\@universite\@empty\relax
\else\resizebox{\linewidth}{!}{\scshape\MakeLowercase\@universite}
\fi
\if\@ecoledoctorale\@empty\relax
\else \par\smallskip\@ecoledoctorale
\fi
\if\@unite\@empty\relax
\else\par\smallskip\@unite
\fi
\end{center}
\vfill
\begin{center}
\ifx\@diplome\@empty\relax
\else
\LARGE\textsc{\MakeLowercase\@diplome}
\par
\fi
\ifx\@couniversite\@empty\relax
\else
\bigskip\par\normalsize en co-tutelle avec\par
\Large{\scshape\MakeLowercase\@couniversite}
\fi
\ifx\@coecoledoctorale\@empty\relax
\else
\par\large\@coecoledoctorale
\fi
\ifx\@counite\@empty\relax
\else
\par\normalsize\@counite
\fi
\ifx\@preauthor\@empty\relax
\else\par\bigskip\normalsize\@preauthor\par\medskip
\fi
\ifx\@author\@empty\relax
\else\huge\@author\par\bigskip\bigskip
\fi
\normalsize
\ifx\@date\@empty\relax
\else\par\@date\par
\fi
\ifx\@grade\@empty\relax
\else\par\@grade\par
\fi
\ifx\@discipline\@empty\relax
\else\medskip\@discipline\par
\fi
\end{center}
\vfill\vfill
\begin{center}
\ifx\@title\@empty\relax
\else\Huge\@title
\fi
\ifx\@subtitle\@empty\relax
\else
\bigskip
\par\LARGE\@subtitle
\fi
\end{center}
\vfill\vfill\vfill\vfill\vfill
\begin{flushleft}
\begin{tabulary}{\linewidth}{@{}lL@{}}
\DTLifdbempty{ldirection}{\relax}{
\multicolumn{1}{@{}l@{}}{\textit{\@direction}} \\[3pt]
\DTLforeach{ldirection}{%
\civi=civilite,\prenom=prenom,\nom=nom,\affil=affiliation}{%
\civi\ \prenom\ \nom & \affil \\
}\\
}
\DTLifdbempty{lrapporteur}{\\[-1em]}{
\multicolumn{1}{@{}l@{}}{\textit{Rapporteurs:}} \\[3pt]
\DTLforeach{lrapporteur}{%
\civi=civilite,\prenom=prenom,\nom=nom,\affil=affiliation}{%
\civi\ \prenom\ \nom & \affil \\
}\\
}
\DTLifdbempty{ljury}{\relax}{
\hline\\
\multicolumn{1}{@{}l@{}}{\textit{Membres du jury:}} \\[3pt]
\DTLforeach{ljury}{%
\civi=civilite,\prenom=prenom,\nom=nom,\affil=affiliation}{%
\civi\ \prenom\ \nom & \affil \\
}
}
\end{tabulary}
\end{flushleft}
\end{titlepage}
\cleardoublepage\pagenumbering{arabic}
}
}
%%% 4e de couverture
\newenvironment{verso}{%
\cleardoubleevenemptypage
\setstretch{1}%
\KOMAoptions{twoside = false,BCOR=0mm}
\renewcommand{\coverpageleftmargin}{3cm}
\begin{titlepage}
\topmargin=\dimexpr \coverpagetopmargin-1in\relax
\oddsidemargin=\dimexpr \coverpageleftmargin-1in\relax
\evensidemargin=\dimexpr \coverpageleftmargin-1in\relax
\textwidth=\dimexpr
\paperwidth-\coverpageleftmargin-\coverpagerightmargin\relax
\textheight=\dimexpr
\paperheight-\coverpagetopmargin-\coverpagebottommargin\relax
\headheight=0pt
\headsep=0pt
\footskip=\baselineskip
\@colht=\textheight
\@colroom=\textheight
\vsize=\textheight
\columnwidth=\textwidth
\hsize=\columnwidth
\linewidth=\hsize
\begin{center}
\ifdefempty{\@logo}{\relax}{\@logo\par\bigskip\bigskip}
\if\@author\@empty\relax\else\par\large\@author\bigskip\fi
\if\@title\@empty\relax\else\par\Large\@title\medskip\fi
\if\@subtitle\@empty\relax\else\par\large\@subtitle\fi
\end{center}
\bigskip\bigskip
}{%
\end{titlepage}%
}
%%% Pour le français
\RequirePackage{ifxetex}
\ifxetex
\AtEndPreamble{\ifthenelse{\equal{\xpg@main@language}{french}}{%
\RequirePackage{impnattypo}% charge l'extension des règles de l'Imprimerie nationale
\setlist[itemize,1]{label=\textendash}% réglage des listes à la française
\setlist[itemize,2]{label=\textperiodcentered}%
}{}}
\else\relax
\fi