-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkihalftime.cls
206 lines (184 loc) · 6.23 KB
/
kihalftime.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
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
% Variables to set
\newcommand{\halftimedate}{Date}
\newcommand{\halftimelocation}{Location}
\newcommand{\studentname}{Name Surname} % Name of student
\newcommand{\studentpostfix}{Postfix} % Education or any other postfix of student
\newcommand{\department}{Department} % Department name
\newcommand{\university}{Karolinska Institutet} % University name
\newcommand{\phdtitle}{PhD project title} % Title of PhD project
\newcommand{\supervisor}{Name Surname}
\newcommand{\supervisortitle}{Prof. MD PhD}
\def\cosupervisors{
{Name Surname, Prof. MD PhD},
{Name2 Surname2, Prof. MD PhD}
}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{kihalftime}[2024/09/11 Half-time report class]
\LoadClass{article}
\RequirePackage{microtype} % For better typography
\RequirePackage{titlesec} % For section formatting
\RequirePackage{geometry} % For document size
\RequirePackage{fancyhdr} % For headers and footers
\RequirePackage{xcolor} % For colors
\RequirePackage{graphicx} % For images
\RequirePackage{subcaption} % For subfigures
\RequirePackage{amsmath} % For math equations longer than one line
\RequirePackage{fontspec} % For custom fonts
\RequirePackage{lastpage} % For page numbering
\RequirePackage{tocloft} % For custom TOC
\RequirePackage{tikz}
\RequirePackage{etoolbox} % For \foreach
\RequirePackage{newclude} % For \include*
\RequirePackage{enumitem} % For custom itemize
\RequirePackage{ifplatform} % For platform specific commands
\RequirePackage{nameref} % For referencing section names
\RequirePackage{booktabs} % For tables with better rules and spacing
\RequirePackage{siunitx} % For SI units and number formatting
\RequirePackage{acro} % For acronyms
\RequirePackage{multirow} % For multirow in tables
\RequirePackage{hyperref} % For hyperlinks
\RequirePackage{cleveref} % For clever references to figures, tables, etc.
% document size
\geometry{
a4paper,
% total={170mm,257mm},
left=40mm,
top=30mm,
right=32mm,
bottom=20mm,
headsep=13mm,
}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
% \setmainfont{Arial}
\setmainfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Courier New}
% Font size
\newcommand{\headersize}{\fontsize{10}{11}\selectfont}
\newcommand{\tocsize}{\fontsize{11}{12}\selectfont}
\newcommand{\titlesize}{\fontsize{20}{22}\selectfont}
\newcommand{\normaltitlessize}{\fontsize{16}{25}\selectfont}
\newcommand{\mediumtitlessize}{\fontsize{14}{25}\selectfont}
\newcommand{\smalltitlessize}{\fontsize{12}{13}\selectfont}
\newcommand{\largesectionsize}{\fontsize{20}{22}\selectfont}
\newcommand{\sectionsize}{\fontsize{16}{18}\selectfont}
\newcommand{\subsectionsize}{\fontsize{14}{15}\selectfont}
\newcommand{\subsubsectionsize}{\fontsize{12}{13}\selectfont}
\newcommand{\tocsectionsize}{\fontsize{12}{13}\selectfont}
\renewcommand{\normalsize}{\fontsize{12}{13}\selectfont}
% Title page
\renewcommand\maketitle{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\let\newpage\relax%
% \null\vfil
\null\vspace{3cm}
\vskip 60\p@
\begin{flushleft}%
{\titlesize\sffamily\selectfont \textbf{\@title} \par}%
\vskip 3em%
{\normaltitlessize\sffamily\selectfont \textit{Doctoral student:} \par}
{\normaltitlessize\sffamily\selectfont \studentname, \studentpostfix \par}
{\mediumtitlessize\sffamily\selectfont \department, \university \par}
\vskip 3em%
{\normaltitlessize\sffamily\selectfont \textit{Title of doctoral project:} \par}
{\normaltitlessize\sffamily\selectfont \phdtitle \par}
\vskip 7em%
{\smalltitlessize\sffamily\selectfont \textit{Principle supervisor:} \supervisor, \supervisortitle \par}
\foreach \x in \cosupervisors
{
{\smalltitlessize\sffamily\selectfont \textit{Co-supervisor:} \x \par}
}
\vskip 2em%
{\smalltitlessize Date of half-time review: \halftimedate \par}
{\smalltitlessize Location: \halftimelocation \par}
\end{flushleft}\par
\@thanks
\vfil\null
\end{titlepage}%
\setcounter{footnote}{0}%
\setcounter{page}{-1}
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
% Title formatting
\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
% TOC upper case
\AtBeginDocument{%
\let\mtcontentsname\contentsname
\renewcommand\contentsname{\sectionsize\normalfont\sffamily\MakeUppercase\mtcontentsname}
}
\renewcommand{\cftsecfont}{\sffamily}
\renewcommand{\cftsecfont}{\tocsize\sffamily\tocsectionsize} %
% Header and footer
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{
\sffamily
\color{gray}
\headersize
Half-time report, \studentname
}
\fancyhead[R]{
\sffamily
\color{gray}
\headersize
\thepage \space (\pageref{LastPage})
}
% Sections
\newcommand*{\mysection}[1]{%
\section*{#1}%
\addcontentsline{toc}{section}{#1}
}
\renewcommand\section{%
\@startsection{section}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\sffamily\sectionsize\bfseries}% 11pt
}
\renewcommand\subsection{%
\@startsection{subsection}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\sffamily\subsectionsize\bfseries}% 11pt
}
\renewcommand\subsubsection{%
\@startsection{subsubsection}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\sffamily\subsubsectionsize\bfseries}% 11pt
}
\newcommand\mylargesection{%
\@startsection{section}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\sffamily\largesectionsize\bfseries}% 11pt
}
% Abbreviations itemize
\newlist{abbreviations}{itemize}{1}
\setlist[abbreviations,1]{leftmargin=0pt, label={}, itemsep=1pt}
\newlist{outcomes}{itemize}{1}
\setlist[outcomes,1]{leftmargin=1.4cm, label=\textbullet, itemsep=1pt}
\setlist[outcomes,2]{label=\textopenbullet, itemsep=1pt}
\setlist[outcomes,3]{label=$\blacktriangleright$, itemsep=1pt}
\setlist[outcomes,4]{label=$\smalltriangleright$, itemsep=1pt}
\endinput