Debian Codegraph @

texmf-dist/source/latex/gsemthesis/gsemthesis.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (©) 2014-2015 by Emmanuel Rousseaux <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, version 1.3c
8 % of this license.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 %
14 % \fi
15 %
16 % \iffalse
17 %<*driver>
18 \ProvidesFile{gsemthesis.dtx}
19 %</driver>
20 %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
21 %<class>\ProvidesClass{gsemthesis}
22 %<*class>
23 [2015/02/09 v0.9.4 .dtx gsemthesis file]
24 %</class>
25 %
26 %<*driver>
27 \documentclass{ltxdoc}
28 \usepackage[utf8]{inputenc}
29 \RequirePackage[top=2.5cm, bottom=2.5cm, left=4.5cm, right=3.5cm]{geometry}
30 \RequirePackage{xcolor}
31 \definecolor{erblue}{HTML}{126199}
32 \RequirePackage{hyperref}
33 \hypersetup{colorlinks=true, linkcolor=black, filecolor=erblue, citecolor=erblue, urlcolor=erblue}
34 \RequirePackage{url}
35 \RequirePackage{float}
36 \newenvironment{itemize*}%
37 {\vspace{-2mm}\begin{itemize}%
38 \setlength{\itemsep}{0pt}%
39 \setlength{\parskip}{0pt}%
40 }%
41 {\end{itemize}\vspace{-2mm}%
42 }
43 \EnableCrossrefs
44 \CodelineIndex
45 \RecordChanges
46 \begin{document}
47 \DocInput{gsemthesis.dtx}
48 \end{document}
49 %</driver>
50 % \fi
51 %
52 % \CheckSum{0}
53 %
54 % \CharacterTable
55 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
56 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
57 % Digits \0\1\2\3\4\5\6\7\8\9
58 % Exclamation \! Double quote \" Hash (number) \#
59 % Dollar \$ Percent \% Ampersand \&
60 % Acute accent \' Left paren \( Right paren \)
61 % Asterisk \* Plus \+ Comma \,
62 % Minus \- Point \. Solidus \/
63 % Colon \: Semicolon \; Less than \<
64 % Equals \= Greater than \> Question mark \?
65 % Commercial at \@ Left bracket \[ Backslash \\
66 % Right bracket \] Circumflex \^ Underscore \_
67 % Grave accent \` Left brace \{ Vertical bar \|
68 % Right brace \} Tilde \~}
69 %
70 %
71 % \changes{v0.1.0}{2014/02/19}{First draft}
72 % \changes{v0.9.0}{2014/12/05}{Added French abstract, minor fixes}
73 % \changes{v0.9.1}{2014/12/06}{French option, draft option, update frontmatter, update backmatter, page numbering at the top of the page, refined cover page}
74 % \changes{v0.9.2}{2015/01/09}{rewriting of the cover page, improve bibliography management, and a lot of minor fixes}
75 % \changes{v0.9.3}{2015/01/16}{tested requirements on Debian and Windows, added the minimal working example, first complete version of the user manual}
76 % \changes{v0.9.4}{2015/02/09}{fixed RO-LE headers, custombib, graphicx and hyperref in final mode, utf-8, French T1, and a lot of minor fixes}
77 %
78 % \GetFileInfo{gsemthesis.dtx}
79 %
80 % \DoNotIndex{\newcommand,\newenvironment}
81 %
82 %
83 % \title{The \textsf{gsemthesis} class\thanks{This document
84 % corresponds to \textsf{gsemthesis}~\fileversion, dated \filedate.}}
85 % \author{Emmanuel Rousseaux \\ \url{[email protected]}}
86 %
87 % \maketitle
88 %
89 % \begin{abstract}
90 % This article introduces the |gsemthesis| class for \LaTeX. The |gsemthesis| class is a PhD thesis template for the Geneva School of Economics and Management (GSEM), University of Geneva, Switzerland. The class provides utilities to easily set up the cover page, the front matter pages, the pages headers, etc. with respect to the official guidelines of the GSEM Faculty for writing PhD dissertations.
91 % This class is released under the LaTeX Project Public License version 1.3c.
92 % \end{abstract}
93 %
94 % \newpage
95 %
96 % \tableofcontents
97 %
98 % \vfill
99 %
100 % \section{Introduction}
101 %
102 % PhD thesis published within the Geneva School of Economics and Management have to follows some guidelines, especially for the cover page. The |gsemthesis| class is a \LaTeX{} template providing utilities to easily set up these guidelines in your thesis. In addition the class loads several usefull packages generally used when writing a thesis.
103 % We recommend the user to have a look to the class definition in Section \ref{sec:classdef} to be aware of the list of packages that the class already includes. The Section \ref{sec:usage} details how to start with the |gsemthesis| class and how to configure your thesis. The Section \ref{sec:example} provides a minimal working example you can copy/paste for starting your dissertation. The user interested in customizing the class can read the Section \ref{sec:implementation} which details the full implementation of the class with usefull comments.
104 %
105 % \medskip
106 %
107 % This class was successfully tested with TeX Live 2013/Debian, TeX Live 2014/CentOS;Windows7 and MiKTeX-2.9.5105/Windows7.
108 %
109 % \medskip
110 %
111 % This class has been written by Emmanuel \textsc{Rousseaux} with contributions from William \textsc{Aeberhard} and Tuan \textsc{Nguyen}.
112 %
113 % \medskip
114 %
115 % The development version is hosted on GitHub\footnote{\url{https://github.com/emmanuelrousseaux/gsemthesis}}. If you are interested in contributing to this class or if you want to beta test latest versions, please visit the repository.
116 %
117 % \section{Usage}
118 % \label{sec:usage}
119 %
120 % This Section introduces the use of the |gsemthesis| class. All macros and environments the class provides are described. We assume the user is already familiar with \LaTeX.
121 %
122 % \subsection{Requirements}
123 %
124 % The class requires a recent version of either TeX Live ($\ge$ 2014 recommended, $\ge$ 2013 minimal) or MiKTeX ($\ge$ 2.9.5x minimal). As the class preload some common packages (see Section \ref{sec:implementation} for the detailed list), we suggest to use install your \LaTeX{} distribution in full mode to make things working out-of-the-box.
125 %
126 % \medskip
127 %
128 % \noindent The class uses biblatex/biber for managing the bibliography. Please refer to the Section \ref{sec:bibliography} for configuring your editor to use it.
129 %
130 % \subsection{Getting started}
131 %
132 % To use the class start your document with the command |\documentclass{gsemthesis}|. A minimal document is:
133 % \begin{verbatim}
134 % \documentclass{gsemthesis}
135 % \begin{document}
136 % \printcoverpage
137 % \newpage
138 % Here is it, I started my PhD!
139 % \end{document}
140 % \end{verbatim}
141 %
142 % \noindent The Section \ref{sec:example} provides a minimal working example you can copy/paste for starting your dissertation. Commands available for configuring your thesis are explained in the following sections.
143 %
144 % \subsection{Configuring your editor to store files in UTF-8}
145 %
146 % The class assumes that all your |.tex| and |.bib| files are encoded in UTF-8. The UTF-8 encoding is a dominant character encoding available on all recent systems and used by default by a lot of editors. As a consequence, it limits encoding problems when sharing files from different systems (Windows, MacOS, Unix/Linux, web sites, etc.). If some of your source files are stored with a different encoding, you may experience rendering problems with accentued/foreign characters. These characters can occur, for instance, in author names of the bibliography. For making sure you won't experience rendering problems, consider (1) storing your files in UTF-8 and (2) set UTF-8 as the default encoding of your editor.
147 % Any recent text editor is able to convert files to UTF-8. TeXstudio and TeXmaker seem to used UTF-8 by default. Rstudio seems to use the system default encoding. To change this setting go to \emph{File $>$ Save with encoding}. On NotePad++ go to \emph{Encoding $>$ Convert to UTF-8}.
148 %
149 % \subsection{Writing the dissertation in French}
150 %
151 % The GSEM accepts English and French for PhD thesis dissertations. Default language is English. If you write your dissertation in French, you have to you the |fr| class option as follows:
152 % \begin{verbatim}
153 % \documentclass[fr]{gsemthesis}
154 % \end{verbatim}
155 %
156 % \subsection{Configuring and printing the cover page}
157 %
158 % \DescribeMacro{\printcoverpage}
159 % The class provides the GSEM PhD thesis cover page ready to be printed. You can ask to print it by calling |\printcoverpage| just after the |\begin{document}|. Before printing the cover page you first need to configure it with your thesis details: title, author, supervisors, committee, etc.
160 %
161 % \DescribeMacro{\title}
162 % \DescribeMacro{\date}
163 % The class uses the classical |\title{|\emph{text}|}| and |\date{|\emph{text}|}| commands of the |book| class to set the title and the date.
164 % \DescribeMacro{\authorFirstname}
165 % \DescribeMacro{\authorLastname}
166 % Instead of using the |\author{|\emph{text}|}| command we provide the two commands |\authorFirstname{|\emph{text}|}| and |\authorLastname{|\emph{text}|}| to separately handle the firstname and the lastname.
167 % \DescribeMacro{\thesisField}
168 % You specify the PhD you are enrolled in with the |\thesisField{|\emph{text}|}|, among others: Economics, Management, Statistics, Information Systems. Please contact the scientific committee of your PhD to obtain the applicable title.
169 % \DescribeMacro{\thesisCommitteeA-F}
170 % You can specify information about members of your thesis committee with the six |\thesisCommitteeA-F{|\emph{title}|}{|\emph{firstname}|}{|\emph{lastname}|}{|\emph{role}|}| commands. With the \emph{role} field you specify the role played by this member in the committee and his/her affiliation. Generally you specify the role ``Chair'' in |\thesisCommitteeA|, the role ``adviser'' for your adviser/co-advisers, and leave the field empty for the other members.
171 % \DescribeMacro{\thesisNumber}
172 % When your manuscript has been accepted by your jury, the Faculty attributes a unique thesis number which has to be printed on the cover page. The |\thesisNumber{|\emph{text}|}| allows to supply it.
173 %
174 % \subsection{Configuring and printing the front matter pages}
175 %
176 % After the cover page the thesis has to provide in a the following order (1) the acknowledgements, (2,3) an abstract in both English and French (the order depending on the main language of your dissertation: if your dissertation is written in English you will start with the English abstract; if your dissertation is written in Frenchyou will start with the French abstract), (4) the table of contents, and (5) an optional dedication. These elements are usually called the front matter.
177 % \DescribeMacro{\printfrontmatter}
178 % These pages will be printed by calling the |\printfrontmatter| command. The best place for this command is just after the |\printcoverpage| command.
179 % \DescribeMacro{\acknowledgements}
180 % \DescribeMacro{\abstractEN}
181 % \DescribeMacro{\abstractFR}
182 % \DescribeMacro{\dedication}
183 % To fill these pages use the commands |\acknowledgements{|\emph{text}|}|, |\abstractEN{|\emph{text}|}|, |\abstractFR{|\emph{text}|}|, and |\dedication{|\emph{text}|}|. We suggest you use these commands in the preambule of the document, just after the commands used to set the cover page.
184 %
185 % \subsection{Introduction and conclusion}
186 %
187 % Generally we don't want to number the introduction and the conclusion, but we want they appear in the table of contents. This leads to a specific handling of the creation of these chapter, especially to have correct page headers.
188 % \DescribeMacro{\startintroduction}
189 % \DescribeMacro{\startconclusion}
190 % Therefore, instead of using |\chapter{introduction}| (respectively |\chapter{conclusion}|) to start a such chapter we provide the function |\startintroduction| (respectively |\startconclusion|) to easily start the chapter with a correct handling of the table of contents and page headers.
191 %
192 % \subsection{Bibliography}
193 % \label{sec:bibliography}
194 %
195 % To produce the bibliography, the |gsemthesis| class uses the package |biblatex| with |biber| in backend instead of the package |bibtex|. The package |biblatex| is installed by default with any recent version of TeX Live\footnote{On Ubuntu/Debian, you may have to install it manually: sudo apt-get install texlive-bibtex-extra biber} (full installation) and MiKTeX, but you must first configure your TeX Editor to use it.
196 %
197 % \subsubsection{Configure TeXstudio to run biber}
198 %
199 % In the TeXstudio preferences (click on Options $\rightarrow$ Configure TeXstudio), choose the `Build' tab and modify the `Default Bibliography' to `Biber'.
200 %
201 % \medskip
202 %
203 % \noindent Run `Build \& View' from the `Tools' menu (or press the two green arrows icon), which will create a PDF but with the bibliography not completed.
204 %
205 % \medskip
206 %
207 % \noindent Run `Bibliography' from the `Tools' menu.
208 %
209 % \medskip
210 %
211 % \noindent Run `Build \& View' again to create a PDF with the bibliography.
212 %
213 % \subsubsection{Configure Texmaker to run biber}
214 %
215 % In the Texmaker preferences (click on Options $\rightarrow$ Configure Texmaker), choose the `Commands' tab and replace |bibtex %| by |biber %| in the field |Bib(la)tex|. On Windows, you may also browse to the |biber.exe| using the folder icon on the side.
216 %
217 % \medskip
218 %
219 % \noindent Choose the `Quick Build' tab and select the second option |PdfLaTeX + Bib(la)tex +| |PdfLaTex (x2) + View Pdf|
220 %
221 % \medskip
222 %
223 % \noindent Now your `Quick Build' button will create a PDF with the bibliography.
224 %
225 % \subsubsection{Configure Rstudio/knitr to run biber}
226 %
227 % In Rstudio/knitr you have to include the following chunk in your |.Rnw| document:
228 %
229 % \begin{verbatim}
230 % <<tex-setup, include=FALSE, cache=FALSE, echo=FALSE>>=
231 % Sys.setenv(
232 % TEXINPUTS=getwd(),
233 % BIBINPUTS=getwd(),
234 % BSTINPUTS=getwd()
235 % )
236 % @
237 % \end{verbatim}
238 %
239 % \subsubsection{Basic commands}
240 %
241 % To add a bibliography into your document, you have to define your bib file in the preamble of your tex file: |\addbibresource{literature-review-topic1.bib}| Then, at the end of your document, the command |\printbibliography| will create the biblography.
242 %
243 % \subsubsection{Using you own bibliography management configuration}
244 %
245 % If you prefer not to use the bibliography management configuration we implemented in this class, you can disabled it and writing you own. Disabling the \emph{gsemthesis} bibliography management configuration is easily done with the |custombib| class option:
246 % \begin{verbatim}
247 % \documentclass[custombib]{gsemthesis}
248 % \end{verbatim}
249 % When using this option you will have to provide the package you want to use for managing your bibliography (|natbib|, |chapterbib|, etc.). As the option disables all settings you will also need to load the package |biblatex| if you want to use it.
250 %
251 % \subsection{\emph{Draft} mode}
252 %
253 % When sharing draft versions of your dissertation you may prefer to hide some items of the cover page (thesis committee, thesis number, etc.) and some Sections (acknowledgments, the dedications. etc.) that probably have not been defined yet. For this purpose you can use the |draft| option:
254 % \begin{verbatim}
255 % \documentclass[draft]{gsemthesis}
256 % \end{verbatim}
257 % \noindent\emph{Note:} this draft mode extends the classical \LaTeX draft mode and then all packages supporting a draft mode will also switch to the draft mode\footnote{Common packages supporting a draft mode are: |changes| (final disables markup of changes, and list of changes), |graphics| (draw frames instead of including images), |graphicx| (draw frames instead of including images), |hyperref| (disable all linking features), |listings| (don't include external files), |listofsymbols| (final suppresses printing of macro names and unused symbols), |mfpic| (assume every latex run to be the first one), |microtype| (disable all features), |pdfcomment| (final suppresses the comments), |pdfpages| (don't include external file but print a frame box), |pgf| (similar to graphics/x: all images will be replaced by empty rectangles), |showkeys| (draft shows the labels, the default option), |thumbs| (thumbs' width=2pt, thumbs' text=black, thumbs' color=grey), |varioref| (turn warnings in error messages). \emph{Source:} \url{http://tex.stackexchange.com/questions/49277/what-does-the-draft-mode-change/49278}}. For convenience purposes we forced packages |graphicx| and |hyperref| to be in \emph{final} mode even when draft mode is on.
258 %
259 % \subsection{Miscellaneous}
260 %
261 % The class also provides some optional functions that can turn out to be usefull when writing your thesis.
262 % \DescribeEnv{itemize*}
263 % The default |itemize| environment set important spaces between each items, the previous paragraph and the next paragraph. The |itemize*| environment reduces these spaces to allow a more compact (and nicer) presentation of a list item.
264 % \emph{Forthcoming}. To add: section in redaction, todonotes
265 %
266 % \newpage
267 % \section{Minimal working example}
268 % \label{sec:example}
269 % \begin{verbatim}
270 % \documentclass{gsemthesis}
271 %
272 % \title{An innovative approach to deal with a very important issue}
273 % \date{\today}
274 % \authorFirstname{Firstname}
275 % \authorLastname{Lastname}
276 % \thesisField{Econometrics}
277 %
278 % \thesisCommitteeA{Prof.}{Mike}{Moore}{Adviser, University of Geneva}
279 % \thesisCommitteeB{Prof.}{Mike}{Moore}{Chair, University of Honolulu}
280 % \thesisCommitteeC{Prof.}{Mike}{Moore}{University of Omsk}
281 % \thesisCommitteeD{Dr.}{Mike}{Moore}{Eidgenössische Technische Hochschule Zürich}
282 % \thesisNumber{480}
283 %
284 % \acknowledgements{Your acknowledgements}
285 %
286 % \abstractEN{English version of the abstract}
287 %
288 % \abstractFR{French version of the abstract}
289 %
290 % \dedication{To my family.}
291 %
292 % \addbibresource{literature-review-topic1.bib}
293 % \addbibresource{literature-review-topic2.bib}
294 %
295 % \begin{document}
296 %
297 % \printcoverpage
298 %
299 % \printfrontmatter
300 %
301 % % INTRODUCTION
302 % \startintroduction
303 %
304 % Write your introduction here.
305 %
306 % % CHAPTER
307 % \chapter{A first chapter}
308 % \label{ch:chapterone}
309 %
310 % My chapter 1.
311 %
312 % % CONCLUSION
313 % \startconclusion
314 %
315 % The conclusion.
316 %
317 % % BACKMATTER
318 % \listoftables
319 % \listoffigures
320 %
321 % % Bibliography (at the end)
322 % \newpage
323 % \printbibliography
324 %
325 % \end{document}
326 % \end{verbatim}
327 %
328 % \section{Implementation}
329 % \label{sec:implementation}
330 %
331 % In this Section the full code of the |gsemthesis| is discussed. The reader interested in customizing the class will find useful comments to understand the design of the class.
332 %
333 % \subsection{Document properties}
334 % \label{sec:classdef}
335 %
336 % The class is derived from the standard |book| class as follows:
337 % \begin{macrocode}
338 \LoadClass[a4paper,12pt,twoside]{book}
339 % \end{macrocode}%
340 % We set the document encoding to UTF-8
341 % \begin{macrocode}
342 \usepackage[utf8]{inputenc}
343 % \end{macrocode}%
344 % We use the |lmodern| vectorial fonts to render the document.
345 % \begin{macrocode}
346 \usepackage{lmodern}
347 % \end{macrocode}
348 % We use the |etoolbox| package for defining class options (fr, draft)
349 % \begin{macrocode}
350 \usepackage{etoolbox}
351 % \end{macrocode}%
352 % We add the option \emph{fr}
353 % \begin{macrocode}
354 \newtoggle{fr}
355 \DeclareOption{fr}{\toggletrue{fr}}
356 % \end{macrocode}%
357 % We add the option \emph{draft}
358 % \begin{macrocode}
359 \newtoggle{draft}
360 \DeclareOption{draft}{\toggletrue{draft}}
361 % \end{macrocode}%
362 % We add the option \emph{custombib}
363 % \begin{macrocode}
364 \newtoggle{custombib}
365 \DeclareOption{custombib}{\toggletrue{custombib}}
366 % \end{macrocode}%
367 % The recommended page format is A4. The B5 page format is given in option.
368 % \begin{macrocode}
369 \DeclareOption{b5paper}{
370 \PassOptionsToClass{\CurrentOption}{book}
371 }
372 % \end{macrocode}%
373 % \begin{macrocode}
374 \ProcessOptions
375 % \end{macrocode}%
376 % We use the |geometry| package to set margin properties
377 % \begin{macrocode}
378 \RequirePackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2.5cm]{geometry}
379 % \end{macrocode}
380 % We use the || package to handle some specific text spacing (title)
381 % \begin{macrocode}
382 \usepackage{setspace}
383 % \end{macrocode}
384 %
385 % \subsection{Colors}
386 % We define some nice colors that will be later used for links (url, email, citations, etc.). The |gsemblue| color is the official color (to date 2014.02.20) of the GSEM Faculty.
387 % \begin{macrocode}
388 \usepackage{xcolor}
389 \definecolor{erblue}{HTML}{126199}
390 \definecolor{erorange}{HTML}{FF7F00}
391 \definecolor{gsemblue}{HTML}{465F7F}
392 % \end{macrocode}
393 % \subsection{Graphics}
394 % We add some practical packages to handle several image files (.png, .pdf), handle placement of graphics, and handle subfigures
395 % \begin{macrocode}
396 \usepackage[final]{graphicx}
397 \usepackage{float}
398 \usepackage{subfigure}
399 % \end{macrocode}
400 % \subsection{Link management}
401 % We use the |hyperref| package to manage internal links and set colors for each link type.
402 % \begin{macrocode}
403 \RequirePackage{hyperref}
404 % \hypersetup{%
405 % colorlinks=true,%
406 % linkcolor=black,%
407 % filecolor=gsemblue,%
408 % citecolor=gsemblue,%
409 % urlcolor=gsemblue%
410 % }%
411 \hypersetup{
412 colorlinks=true,
413 linkcolor=black,
414 filecolor=erblue,
415 citecolor=erblue,
416 urlcolor=erblue,
417 final
418 }
419 % \end{macrocode}
420 % We use the |url| package for a complete support of external links and define a nice font style.
421 % \begin{macrocode}
422 \RequirePackage{url}
423 \urlstyle{sf}
424 % \end{macrocode}
425 % \subsection{Maths}
426 % We add standard packages from the American Mathematical Society to handle mathematical symbols, environment (equations, etc.) and the Computer Modern font use by default to render math.
427 % \begin{macrocode}
428 \usepackage{amssymb,amsmath,amsfonts}
429 % \end{macrocode}
430 % \subsection{Page headers management}
431 % We use the |fancyhdr| package for a fine tuning of headers and footers of the different page type (cover page, chapters, unumbered chapters, etc.).
432 % \begin{macrocode}
433 \usepackage{fancyhdr}
434 % \end{macrocode}
435 % The capital letters given in option of |\fancyhead| or |\fancyfoot| commands respectively stands for:
436 % \begin{itemize*}
437 % \item E: Even page
438 % \item O: Odd page
439 % \item L: Left field
440 % \item C: Center field
441 % \item R: Right field
442 % \item H: Header
443 % \item F: Footer
444 % \end{itemize*}
445 % We set the |fancy| page style (default page style) as follows:
446 % \begin{macrocode}
447 \pagestyle{fancy}
448 \fancyhf{}
449 \fancyhead[LE]{\thepage}
450 \fancyhead[RE]{\nouppercase{\leftmark}}
451 \fancyhead[LO]{\nouppercase{\rightmark}}
452 \fancyhead[RO]{\thepage}
453 \fancyfoot[LE,RO]{}
454 % \end{macrocode}
455 % We reset the |plain| style
456 % \begin{macrocode}
457 \fancypagestyle{plain}{
458 \fancyhf{}
459 \renewcommand{\headrulewidth}{0pt}
460 \fancyfoot[LE,RO]{}
461 }
462 % \end{macrocode}
463 % We define a style for the cover page (actually not used)
464 % \begin{macrocode}
465 \fancypagestyle{cover}{
466 \fancyhf{}
467 \renewcommand{\headrulewidth}{0.5pt}
468 \renewcommand{\footrulewidth}{0.5pt}
469 }
470 % \end{macrocode}
471 % We define a style for unumbered chapters (starred chapters)
472 % \begin{macrocode}
473 \fancypagestyle{unnumberedchapter}{
474 \fancyhf{}
475 \renewcommand{\headrulewidth}{0pt}
476 \renewcommand{\footrulewidth}{0pt}
477 \fancyhead[LE]{\thepage}
478 \fancyhead[RE]{}
479 \fancyhead[LO]{}
480 \fancyhead[RO]{\thepage}
481 \fancyfoot[LE,RO]{}
482 }
483 % \end{macrocode}
484 % When a new chapter starts on a odd number, we add a blank page to force it to start to a even number. We define an empty style for this blank page
485 % \begin{macrocode}
486 \fancypagestyle{empty}{
487 \fancyhf{}
488 \renewcommand{\headrulewidth}{0pt}
489 \fancyfoot[LE,RO]{}
490 }
491 % \end{macrocode}
492 % Then we apply the empty style to odd page before a new chapter
493 % \begin{macrocode}
494 \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
495 \hbox{}
496 \thispagestyle{empty}
497 \newpage
498 \if@twocolumn\hbox{}\newpage\fi\fi\fi}
499 \clearpage{\pagestyle{empty}\cleardoublepage}
500 % \end{macrocode}
501 % We define the default language of the document.
502 % \begin{macrocode}
503 \iftoggle{fr}{
504 \usepackage[francais]{babel}
505 \usepackage[T1]{fontenc}
506 }{
507 \usepackage[english]{babel}
508 }
509 % \end{macrocode}
510 % This package provides the commands |\og| and |\fg| for correctly handling French quotes.
511 % \begin{macrocode}
512 \usepackage{csquotes}
513 % \end{macrocode}
514 % We define the date format for the cover page (non-draft mode).
515 % \begin{macrocode}
516 \usepackage{datetime}
517 \newdateformat{monthyeardate}{\monthname[\THEMONTH] \THEYEAR}
518 % \end{macrocode}
519 %
520 % \subsection{Bibliography management}
521 % We use biblatex/biber to process the bibliography with the following settings: (1) citations with more than two authors will always be writen as ``First author et al.'', (2) this ``et al.'' rule is applied even if it leads to ambiguities between long list of authors with the same first author.
522 % \begin{macrocode}
523 \iftoggle{custombib}{}{
524 \usepackage[backend=biber,natbib=true,style=authoryear-comp,sorting=nymdt,%
525 maxbibnames=99,mincitenames=1,maxcitenames=2,uniquelist=false]{biblatex}
526 }
527 % \end{macrocode}
528 % We use the style authoryear to print authors and the year when citing a document in the text. We define a customized sorting style to sort the list of references (printed at the end of the document) according to this (ordered) attributes: name, year, month, day, and title.
529 % We define the following sorting scheme:
530 % \begin{macrocode}
531 \iftoggle{custombib}{}{
532 \DeclareSortingScheme{nymdt}{
533 \sort{
534 \field{presort}
535 }
536 \sort[final]{
537 \field{sortkey}
538 }
539 \sort{
540 \name{sortname}
541 \name{author}
542 \name{editor}
543 \name{translator}
544 \field{sorttitle}
545 \field{title}
546 }
547 \sort{
548 \field{sortyear}
549 \field{year}
550 }
551 \sort{
552 \field[padside=left,padwidth=2,padchar=0]{month}
553 \literal{00}
554 }
555 \sort{
556 \field[padside=left,padwidth=2,padchar=0]{day}
557 \literal{00}
558 }
559 \sort{
560 \field{sorttitle}
561 }
562 \sort{
563 \field[padside=left,padwidth=4,padchar=0]{volume}
564 \literal{0000}
565 }
566 }
567 }
568 % \end{macrocode}
569 % \subsection{Cover page}
570 % \subsubsection{System-level functions}
571 % The following commands define labels for the different parts of the cover page
572 % \begin{macrocode}
573 \def\theFaculty{Geneva School of Economics and Management}
574
575 \def\thesisLocationLabel{
576 ~ \\[0.4em]%
577 \iftoggle{fr}{
578 Une thèse soumise à la\\[0.2em]
579 \theFaculty\\[0.2em]
580 Université de Genève, Suisse,\\[0.2em]
581 pour l'obtention du\\[0.2em]
582 }{
583 A thesis submitted to the\\[0.2em]
584 \theFaculty, \\[0.2em]
585 University of Geneva, Switzerland,\\[0.2em]
586 in fulfillment of the requirements for the degree of\\[0.2em]
587 }
588 }
589
590 \iftoggle{fr}{
591 \def\thesisByLabel{par}
592 }{
593 \def\thesisByLabel{by}
594 }
595 \iftoggle{fr}{
596 \def\thesisFieldLabel{Doctorat en}
597 }{
598 \def\thesisFieldLabel{PhD in}
599 }
600 \iftoggle{fr}{
601 \def\thesisCommitteeLabel{Membres du jury:}
602 }{
603 \def\thesisCommitteeLabel{Members of the thesis committee:}
604 }
605 \iftoggle{fr}{
606 \def\thesisNumberLabel{Thèse no.}
607 }{
608 \def\thesisNumberLabel{Thesis No.}
609 }
610
611 % \end{macrocode}
612 %
613 %
614 % \subsubsection{User-level functions}
615 %
616 % Set up of the cover page and assimilated functions.
617 %
618 % \begin{macro}{\authorFirstname}
619 % Set up the |\theauthorFirstname| variable.
620 % \begin{macrocode}
621 \def\theauthorFirstname{}
622 \newcommand{\authorFirstname}[1]{\def\theauthorFirstname{#1}}
623 % \end{macrocode}
624 % \end{macro}
625 %
626 % \begin{macro}{\authorLastname}
627 % Set up the |\theauthorLastname| variable.
628 % \begin{macrocode}
629 \def\theauthorLastname{}
630 \newcommand{\authorLastname}[1]{\def\theauthorLastname{\textsc{#1}}}
631 % \end{macrocode}
632 % \end{macro}
633 %
634 % \begin{macro}{\thesisField}
635 % Set up the |\thethesisField| variable.
636 % \begin{macrocode}
637 \def\thethesisField{}
638 \newcommand{\thesisField}[1]{\def\thethesisField{#1}}
639 % \end{macrocode}
640 % \end{macro}
641 %
642 % \begin{macro}{\thesisCommitteeA}
643 % Set up the |\thethesisCommitteeA| variable.
644 % \begin{macrocode}
645 \def\thethesisCommitteeA{}
646 \newcommand{\thesisCommitteeA}[4]{%
647 \ifx&#3&%
648 \def\thethesisCommitteeA{}%
649 \else
650 \def\thethesisCommitteeA{#1~#2~\textsc{#3},~#4}%
651 \fi
652 }
653 % \end{macrocode}
654 % \end{macro}
655 %
656 % \begin{macro}{\thesisCommitteeB}
657 % Set up the |\thethesisCommitteeB| variable.
658 % \begin{macrocode}
659 \def\thethesisCommitteeB{}
660 \newcommand{\thesisCommitteeB}[4]{%
661 \ifx&#3&%
662 \def\thethesisCommitteeB{}%
663 \else
664 \def\thethesisCommitteeB{#1~#2~\textsc{#3},~#4}%
665 \fi
666 }
667 % \end{macrocode}
668 % \end{macro}
669 %
670 % \begin{macro}{\thesisCommitteeC}
671 % Set up the |\thethesisCommitteeC| variable.
672 % \begin{macrocode}
673 \def\thethesisCommitteeC{}
674 \newcommand{\thesisCommitteeC}[4]{%
675 \ifx&#3&%
676 \def\thethesisCommitteeC{}%
677 \else
678 \def\thethesisCommitteeC{#1~#2~\textsc{#3},~#4}%
679 \fi
680 }
681 % \end{macrocode}
682 % \end{macro}
683 %
684 % \begin{macro}{\thesisCommitteeD}
685 % Set up the |\thethesisCommitteeD| variable.
686 % \begin{macrocode}
687 \def\thethesisCommitteeD{}
688 \newcommand{\thesisCommitteeD}[4]{%
689 \ifx&#3&%
690 \def\thethesisCommitteeD{}%
691 \else
692 \def\thethesisCommitteeD{#1~#2~\textsc{#3},~#4}%
693 \fi
694 }
695 % \end{macrocode}
696 % \end{macro}
697 %
698 % \begin{macro}{\thesisCommitteeE}
699 % Set up the |\thethesisCommitteeE| variable.
700 % \begin{macrocode}
701 \def\thethesisCommitteeE{}
702 \newcommand{\thesisCommitteeE}[4]{%
703 \ifx&#3&%
704 \def\thethesisCommitteeE{}%
705 \else
706 \def\thethesisCommitteeE{#1~#2~\textsc{#3},~#4}%
707 \fi
708 }
709 % \end{macrocode}
710 % \end{macro}
711 %
712 % \begin{macro}{\thesisCommitteeF}
713 % Set up the |\thethesisCommitteeF| variable.
714 % \begin{macrocode}
715 \def\thethesisCommitteeF{}
716 \newcommand{\thesisCommitteeF}[4]{%
717 \ifx&#3&%
718 \def\thethesisCommitteeF{}%
719 \else
720 \def\thethesisCommitteeF{#1~#2~\textsc{#3},~#4}%
721 \fi
722 }
723 % \end{macrocode}
724 % \end{macro}
725 %
726 % \begin{macro}{\thesisNumber}
727 % Set up the |\thethesisNumber| variable.
728 % \begin{macrocode}
729 \def\thethesisNumber{}
730 \newcommand{\thesisNumber}[1]{\def\thethesisNumber{#1}}
731 % \end{macrocode}
732 % \end{macro}
733 % The cover page is created with the following code
734 % \begin{macro}{\printcoverpage}
735 % Print the cover page of the thesis.
736 % \begin{macrocode}
737 \newcommand{\printcoverpage}{%
738 \thispagestyle{empty}
739 \begin{center}
740 \rule{\linewidth}{0.4pt}
741
742 \vspace*{1.2cm}
743
744 {\huge
745 {\scshape
746 \begin{spacing}{0.8}
747 \@title
748 \end{spacing}
749 }
750 }
751
752 \vspace*{1.2cm}
753
754 \thesisByLabel
755
756 \vspace*{0.4cm}
757
758 {\large \theauthorFirstname~\theauthorLastname}
759
760 \vspace*{0.8cm}
761
762 \thesisLocationLabel
763 \thesisFieldLabel{~}\thethesisField
764
765 \vfill
766
767 \iftoggle{draft}{
768 \iftoggle{fr}{
769 \emph{Ébauche}
770 }{
771 \emph{Draft}
772 }
773 }
774
775 \iftoggle{draft}{~}{
776 \vspace*{0.8cm}
777
778 \thesisCommitteeLabel
779 }
780
781 \vspace*{0.2em}
782
783 \iftoggle{draft}{~}{\thethesisCommitteeA}
784
785 \vspace*{0.2em}
786
787 \iftoggle{draft}{~}{\thethesisCommitteeB}
788
789 \vspace*{0.2em}
790
791 \iftoggle{draft}{~}{\thethesisCommitteeC}
792
793 \vspace*{0.2em}
794
795 \iftoggle{draft}{~}{\thethesisCommitteeD}
796
797 \vspace*{0.2em}
798
799 \iftoggle{draft}{~}{\thethesisCommitteeE}
800
801 \vspace*{0.2em}
802
803 \iftoggle{draft}{~}{\thethesisCommitteeF}
804
805 \vspace*{1.4cm}
806
807 \iftoggle{draft}{~}{\thesisNumberLabel{~}\thethesisNumber}
808
809 \vspace*{0.1cm}
810
811 \iftoggle{draft}{\@date}{\monthyeardate\today}
812
813 \vspace*{0.1cm}
814
815 \rule{\linewidth}{0.4pt}
816 \end{center}
817 }
818 % \end{macrocode}
819 % \end{macro}
820 %
821 % \subsection{Front matter}
822 %
823 % \begin{macro}{\acknowledgements}
824 % Set up the |\theacknowledgements| variable.
825 % \begin{macrocode}
826 \def\theacknowledgements{}
827 \newcommand{\acknowledgements}[1]{\def\theacknowledgements{#1}}
828 % \end{macrocode}
829 % \end{macro}
830 %
831 % \begin{macro}{\abstractEN}
832 % Set up the |\theabstractEN| variable.
833 % \begin{macrocode}
834 \def\theabstractEN{}
835 \newcommand{\abstractEN}[1]{\def\theabstractEN{#1}}
836 % \end{macrocode}
837 % \end{macro}
838 %
839 % \begin{macro}{\abstractFR}
840 % Set up the |\theabstractFR| variable.
841 % \begin{macrocode}
842 \def\theabstractFR{}
843 \newcommand{\abstractFR}[1]{\def\theabstractFR{#1}}
844 % \end{macrocode}
845 % \end{macro}
846 %
847 % \begin{macro}{\dedication}
848 % Set up the |\thededication| variable.
849 % \begin{macrocode}
850 \def\thededication{}
851 \newcommand{\dedication}[1]{\def\thededication{#1}}
852 % \end{macrocode}
853 % \end{macro}
854 %
855 % \begin{macro}{\printfrontmatter}
856 % The front matter pages are created with the following code
857 % \begin{macrocode}
858 \newcommand{\printfrontmatter}{%
859
860 \iftoggle{draft}{~}{
861 \frontmatter
862
863 \iftoggle{fr}{
864 \chapter*{Remerciements}
865 \addcontentsline{toc}{chapter}{Remerciements}
866 }{
867 \chapter*{Acknowledgements}
868 \addcontentsline{toc}{chapter}{Acknowledgements}
869 }
870 \label{ch:acknowledgements}
871 \thispagestyle{plain}
872 \theacknowledgements
873
874 \newpage
875
876 \iftoggle{fr}{
877 \chapter*{Résumé}
878 \addcontentsline{toc}{chapter}{Résumé}
879 \label{ch:abstractFR}
880 \thispagestyle{plain}
881 \theabstractFR
882
883 \newpage
884
885 \chapter*{Abstract}
886 \addcontentsline{toc}{chapter}{Abstract}
887 \label{ch:abstractEN}
888 \thispagestyle{plain}
889 \theabstractEN
890 }{
891 \chapter*{Abstract}
892 \addcontentsline{toc}{chapter}{Abstract}
893 \label{ch:abstractEN}
894 \thispagestyle{plain}
895 \theabstractEN
896
897 \newpage
898
899 \chapter*{Résumé}
900 \addcontentsline{toc}{chapter}{Résumé}
901 \label{ch:abstractFR}
902 \thispagestyle{plain}
903 \theabstractFR
904 }
905 }
906
907 \tableofcontents
908
909 \iftoggle{draft}{~}{
910 \cleardoublepage
911
912 \thispagestyle{plain}
913
914 \vspace*{4cm}
915 {\em
916 \raggedleft\thededication\par
917 }
918
919 \newpage
920 }
921
922 \mainmatter
923 }%
924 % \end{macrocode}
925 % \end{macro}
926 %
927 % \subsection{Introduction and conclusion starter}
928 %
929 % \begin{macro}{\startintroduction}
930 % The front matter pages are created with the following code
931 % \begin{macrocode}
932 \newcommand{\startintroduction}{%
933 \chapter*{Introduction}
934 \addcontentsline{toc}{chapter}{Introduction}
935 \label{ch:introduction}
936 \markboth{}{Introduction}
937 }
938 % \end{macrocode}
939 % \end{macro}
940 %
941 % \begin{macro}{\startconclusion}
942 % The front matter pages are created with the following code
943 % \begin{macrocode}
944 \newcommand{\startconclusion}{%
945 \chapter*{Conclusion}
946 \addcontentsline{toc}{chapter}{Conclusion}
947 \label{ch:conclusion}
948 \markboth{}{Conclusion}
949 }
950 % \end{macrocode}
951 % \end{macro}
952 %
953 % \subsection{Miscellaneous}
954 % \begin{environment}{itemize*}
955 % A narrowed version of the |itemize| environment.
956 % implementation here.
957 % \begin{macrocode}
958 \newenvironment{itemize*}%
959 {\vspace{-2mm}\begin{itemize}%
960 \setlength{\itemsep}{0pt}%
961 \setlength{\parskip}{0pt}%
962 }%
963 {\end{itemize}\vspace{-2mm}%
964 }
965 % \end{macrocode}
966 % \end{environment}
967 %
968 % \Finale
969 \endinput