-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoliMi3i_thesis.cls
156 lines (139 loc) · 5.37 KB
/
PoliMi3i_thesis.cls
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
% A LaTeX template for MSc Thesis submissions to
% Politecnico di Milano (PoliMi) - School of Industrial and Information Engineering
%
% P. F. Antonietti, S. Bonetti, A. Gruttadauria, G. Mescolini, A. Zingaro
%
% Last Revision: October 2021
%
% Copyright 2021 Politecnico di Milano, Italy. Inc. All rights reserved
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{PoliMi3i_thesis}[2021/6/30 PoliMi3i thesis submission class]
\ProcessOptions\relax
%--------------------------------------------------------------------------
% HANDLING THE STYLE OF THE THESIS
%--------------------------------------------------------------------------
\LoadClass[12pt, twoside]{book} % 12 pt font, two-sided book style
\RequirePackage[a4paper,includehead,headheight=0.6cm,inner=3.0cm,outer=2.0cm,top=2.5cm,bottom
=2.5cm,showframe=false]{geometry}
\RequirePackage[bf, font=onehalfspacing]{caption} % caption: FIG in bold, 1.5 line spacing in figure and table captions
\newcommand{\thesisspacing}{\onehalfspacing}
% Define new command: numbered and un-numbered chapter in Polimi style.
\let\latexchapter\chapter
\renewcommand{\chapter}{\@ifstar{\polimichapterstar}{\polimichapter}}
\newcommand{\polimichapter}[1]{
\cleardoublepage % To make sure the previous headers are passed
\phantomsection % To help hyperref link to the right page
\latexchapter{#1}
\renewcommand{\headrulewidth}{0pt} %removing the horizontal line in the header
%\addcontentsline{toc}{chapter}{#1} % Also adds the chapter name to the Contents
\fancyhead[LO, RE]{ \textbf{\textcolor{bluepoli}\thechapter\hsp\textcolor{bluepoli}{| }\hsp \leftmark}}% Header
\fancyhead[LE, RO]{\thepage}
\vspace{-1cm}
}
\newcommand{\polimichapterstar}[1]{
\cleardoublepage % To make sure the previous headers are passed
\phantomsection % To help hyperref link to the right page
\latexchapter*{#1}
\renewcommand{\headrulewidth}{0pt} %removing the horizontal line in the header
\addcontentsline{toc}{chapter}{#1} % Also adds the chapter name to the Contents
\fancyhead[LO, RE]{ \bfseries \textcolor{bluepoli}{| } #1} % Header \textbf{\leftmark} \hspace{1mm}}
\fancyhead[LE, RO]{\thepage}
\vspace{-1cm}
}
% Define new command: start preamble
\newcommand{\startpreamble}{
\pagestyle{fancy} % Change the header style
\fancyhf{}% Clear header and footer
\renewcommand{\chaptermark}[1]{\markboth{##1}{}} % Getting the chapter name right
\rhead{\thepage} % Page number at the right of the header
\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the preamble pages
\thesisspacing % Double or single spacing
}
%------------------------------------------------------------------------
% BUILDING THE TITLE PAGE
%------------------------------------------------------------------------
% Define new command: adding background picture (halo) on bottom left (used for empty pages)
\newcommand\BackgroundPic{
\put(-150,-200){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\transparent{0.4}
\includegraphics[width=0.85\paperwidth]{./raggiera_polimi.eps}
\vfill
}}}
% Define new command: adding background picture (halo) on top right (used for cover page)
\newcommand\BackgroundPicTR{% Adding background picture on top right
\put(200,330){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\transparent{0.4}
\includegraphics[width=0.70\paperwidth]{./raggiera_polimi.eps}
\vfill
}}}
\RequirePackage{xkeyval} % Handling keyword options.
% Define keys for title pages
\newif\if@cosupervisorexist\@cosupervisorexistfalse
\define@key[OIST]{title}{title}{\def\thesistitle{#1}}
\define@key[OIST]{title}{course}{\def\course{#1}}
\define@key[OIST]{title}{name}{\def\name{#1}}
\define@key[OIST]{title}{ID}{\def\ID{#1}}
\define@key[OIST]{title}{advisor}{\def\advisor{#1}}
\define@key[OIST]{title}{coadvisor}{\def\coadvisor{#1}\@cosupervisorexisttrue}
\define@key[OIST]{title}{academicyear}{\def\academicyear{#1}}
\define@key[OIST]{title}{tutor}{\def\tutor{#1}}
\define@key[OIST]{title}{phdcycle}{\def\phdcycle{#1}}
%\define@key[OIST]{title}{cycle}{\def\cycle}
%\define@key[OIST]{title}{chair}{\def\chair{#1}}
\providecommand{\puttitle}{}
\renewcommand{\puttitle}[1]{
\@puttitle{}{#1}
}
\providecommand{\@puttitle}{}
\renewcommand{\@puttitle}[2]{%
\setkeys[OIST]{title}{#2}
\begin{titlepage}
\AddToShipoutPicture*{\BackgroundPicTR}
\vfill
%\begin{minipage}{0.95\textwidth}
\begin{minipage}{0.95\textwidth}
\includegraphics[trim={0 0 0 0},clip, width=0.9\textwidth]{Images/phd_logo.png}
\hfill
\\
\vspace{2.5cm}
\\
{{\color{bluepoli} \singlespacing \huge \bfseries \thesistitle \par}}
\vspace{1.5cm}
%{\color{bluepoli} \bfseries \large{\textsc{Tesi di Laurea Magistrale in\\ \course}}\par}
%\vspace{1.5 cm}
{\color{black} \begin{flushright} \Large {Doctoral Dissertation of:\\} \textbf{\name}\end{flushright}}
\end{minipage}
\\
\vspace*{\fill}
\\
\begin{minipage}{0.85\textwidth}
\large{
Advisor: {\advisor}
\\
Co-advisors: {\coadvisor}
\\
Tutor: {\tutor}
\\
{\phdcycle}
%Cycle: {\cycle}
%\\
%The Chair of the Doctoral Program:{\chair}
%%\\
%{\cycle}
}
\end{minipage}
\end{titlepage}
}
\newcommand\blankpage{%
\null
\AddToShipoutPicture*{\BackgroundPic}
\thispagestyle{empty}%
\addtocounter{page}{-1}%
\newpage
}