-
Notifications
You must be signed in to change notification settings - Fork 4
/
msca-pf.cls
275 lines (220 loc) · 6.06 KB
/
msca-pf.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
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
% <<< preamble
\def\mscaversion{3.1}
\def\fileversion{v\mscaversion}
\def\filedate{2024/05/30}
\def\clsname{msca-pf}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{\clsname}[\filedate\ \fileversion\ MSCA Proposal]
% >>>
% <<< declare options
% draft features
\newif\if@draftproposal \@draftproposalfalse
\DeclareOption{draftproposal}{\@draftproposaltrue}
% grid
\newif\if@layoutgrid \@layoutgridfalse
\DeclareOption{layoutgrid}{\@layoutgridtrue}
% additional options passed to `scrartcl` class
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\PassOptionsToClass{DIV=14,11pt}{scrartcl}
% >>>
% <<< process options
\ProcessOptions
\LoadClass{scrartcl}
% force serif fonts
\addtokomafont{disposition}{\rmfamily}
% additional options
\KOMAoptions{
paper=A4,
parskip=half*,
}
% tighted sections a bit for more space
\RedeclareSectionCommand[beforeskip=0.5em, afterskip=0.5em]{section}
\RedeclareSectionCommand[beforeskip=0.5em, afterskip=0.5em]{subsection}
\RedeclareSectionCommand[beforeskip=0.25em, afterskip=0.25em]{subsubsection}
\if@draftproposal
\newcount\timehh\newcount\timemm
\timehh=\time \divide\timehh by 60
\timemm=\time \count255=\timehh \multiply\count255 by -60
\advance\timemm by \count255
\def\draftheader{\textit{Draft of \today}\vspace{-1.75em}}
\else
\def\draftheader{\empty}
\fi
% >>>
% <<< required packages
% NOTE: load packages after the class was loaded since they may depend on it
\RequirePackage{iftex}
\RequirePackage{xparse}
\RequirePackage[hypertexnames=false,breaklinks=true]{hyperref}
% required font is Times New Roman (or Nimbus Roman on Linux)
\ifpdftex
\RequirePackage[T1]{fontenc}
\RequirePackage{mathptmx}
\else
\RequirePackage{fontspec}
\IfFontExistsTF{Times New Roman}{
\setmainfont[Ligatures=Rare]{Times New Roman}}{
\IfFontExistsTF{Nimbus Roman}{
\setmainfont{Nimbus Roman}
}{\PackageWarning{msca-pf}{No Times New Roman font could be found}}}
\fi
% build fancy table required for organization description
\RequirePackage{array}
\RequirePackage[table]{xcolor}
\RequirePackage{longtable}
% customize page numbering
\RequirePackage{lastpage}
% customize headers and footers
\RequirePackage{scrlayer-scrpage}
% indent first paragraph in a section
\RequirePackage{indentfirst}
% enable this to better check sizing
\if@layoutgrid
\RequirePackage[
grid, gridBG,
gridunit=mm,
gridcolor=gray!70,
subgridcolor=gray!70,
texcoord]{eso-pic}
\fi
\AtBeginDocument{
% customize PDF bookmarks a bit
\RequirePackage{bookmark}
\bookmarksetup{numbered}
\if@draftproposal
\linenumbers
\fi
}
% make links a bit less intrusive
\hypersetup{
colorlinks=true,
urlcolor=blue,
citecolor=black,
linkcolor=black
}
% <<< other
\definecolor{MSCATagGray}{RGB}{180, 180, 180}
\NewDocumentCommand \mscatag { m } {\textcolor{MSCATagGray}{\small \#@#1@\#}}
\NewDocumentCommand \mscatagend { m } {\noindent \textcolor{MSCATagGray}{\small \#§#1§\#}}
% >>>
% >>>
% <<< main matter
% add line numbers if in draft mode
\if@draftproposal
\RequirePackage[mathlines]{lineno}
\RequirePackage{xcolor}
\RenewDocumentCommand \linenumberfont {} {
\normalfont\footnotesize\textcolor{black!50}
}
\fi
% >>>
% <<< page header/footer styles
\NewDocumentCommand \mscaidentifier { m } {\def\@mscaidentifier{#1}}
\NewDocumentCommand \mscaproject { m } {\def\@mscaproject{#1}}
\def\@mscaidentifier{HORIZON-MSCA-2024-PF-01}
\def\@mscaproject{MSCA Postdoctoral Fellowships 2024}
\pagestyle{plain}
\clearpairofpagestyles
\def\callihead{\textnormal{\scriptsize Call: \@mscaidentifier: \@mscaproject}}
\def\callohead{\textnormal{\scriptsize \textcolor{MSCATagGray}{
EU Grants: Application form (HE MSCA PF) V\mscaversion \\
\draftheader
}
}}
\def\pagefooter{\textnormal{Part B -- Page \thepage\, of\, \pageref{LastPage}}}
\cfoot[\pagefooter]{\pagefooter}
\ihead[\callihead]{\callihead}
\ohead[\callohead]{\callohead}
% >>>
% <<< title
\def\@maketitle{
\begin{center}
\normalfont \normalsize
\vspace{0.3cm}
{\huge \bfseries \@title \par}
\vspace{-0.2cm}
\end{center}
}
\makeatother
% >>>
% <<< table
\NewDocumentCommand \ra {} {\raggedright\arraybackslash}
\newenvironment{msctable}[2][\footnotesize]{
\vspace{-20pt}
\begin{center}
#1 % Set the right size (and font maybe)
\begin{tabular}{#2}
}{%
\end{tabular}
\end{center}
\vspace{-10pt}
}
\newenvironment{msclongtable}[2][\footnotesize]{
\vspace{-20pt}
\begin{center}
#1 % Set the right size (and font maybe)
\begin{longtable}{#2}
}{%
\end{longtable}
\end{center}
\vspace{-40pt}
}
\newenvironment{mscaorgoverview}[1][\footnotesize]{
\begin{msctable}{
|>{\ra}p{0.165\linewidth}
|>{\ra}p{0.075\linewidth}
|>{\ra}p{0.15\linewidth}
|>{\ra}p{0.155\linewidth}
|>{\ra}p{0.155\linewidth}
|>{\ra}p{0.155\linewidth}
|>{\ra}p{0.15\linewidth}|}
\hline
\rowcolor{gray!40}
\textbf{Organisation Role} &
\textbf{PIC} &
\textbf{Legal Entity Short Name} &
\textbf{Academic Organisation (Y/N)} &
\textbf{Country} &
\textbf{Name of Supervisor} \\
\hline
}{
\hline
\end{msctable}
}
\newenvironment{mscaorgcapacity}{
% NOTE: This can contain a lot of text, so we make it long by default
\begin{msclongtable}[\small]{
|>{\ra}p{0.3\linewidth}
|>{\ra}p{0.66\linewidth}|}
\hline
}{
\hline
\end{msclongtable}
}
% >>>
% <<< cv
\newenvironment{cvitem}{
\noindent \begin{tabular}{@{}>{\ra}p{0.15\linewidth}>{\ra}p{0.8\linewidth}}
}{
\end{tabular}
\vspace{-3pt}
}
% NOTE: \cventry{dates}{name}{details}{location}
\NewDocumentCommand \cventry { m m m m } {\raggedleft \textbf{#1} & \textbf{#2}, \emph{#3}, #4. \\}
% NOTE: \cvdetail{name}{details}
\NewDocumentCommand \cvdetail { m m } {& \textbf{#1}: #2. \\}
% NOTE: \cvpub{date}{authors}{title}{journal etc}
\NewDocumentCommand \cvpub { m m m m } {\raggedleft \textbf{#1} & #2, \emph{#3}, #4. \\}
\NewDocumentCommand \cvpubitem { m m m m } {%
\begin{cvitem}
\cvpub{#1}{#2}{#3}{#4}
\end{cvitem}
}
\NewDocumentCommand \cventryitem { m m m m } {%
\begin{cvitem}
\cventry{#1}{#2}{#3}{#4}
\end{cvitem}
}
% >>>
\recalctypearea
\endinput