-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathUSN-MSc.cls
127 lines (113 loc) · 3.63 KB
/
USN-MSc.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% USN-MSc.cls %%
%% LaTeX-class for writing theses %%
%% %%
%% (c) Dietmar Winkler (me.dwe.no) %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ---Identification----
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{USN-MSc}[2019/12/09 Template class MSc reports and theses]
% --- definitions of options ---
% project option:
\newif\if@project
\@projectfalse
\DeclareOption{project}{\@projecttrue}
% All other options are passed on to the book class
\DeclareOption*{%
\typeout{Option \CurrentOption\space is passed to package USN-base!}
\PassOptionsToClass{\CurrentOption}{USN-base}
}%
% --- execution of options ---
\ProcessOptions* %% process the options in calling order
% --- load other classes
\LoadClass{USN-base} %% we reuse the USN-base class
% --- useful commands
\newcommand{\mysubject}{%
\if@project%
FM4017 Project \the\year%
\else%
FMH606 Master's Thesis \the\year%
\fi%
}
\newcommand{\USNtitlepage}[5]{%
% #1 optional figure
% #2 Project partner
% #3 summary
\subject{%
\if@project\mysubject\else\mysubject\\\mysubtitle\fi}
\title{\mytitle}
\subtitle{\vfill #1}
\author{\myauthor}
\date{} %% no date on title page
% --- pdf document settings ---
\hypersetup{%
pdftitle = {\mytitle},%
pdfsubject = {\mysubject},%
pdfauthor = {\myauthor}
}%
\pdfbookmark[0]{\@title}{title} %% set the correct PDF bookmark
\maketitle%
%
\cleardoubleemptypage %% fillpage without page number
%
%% --- summary page ---
\if@summary%
{
\thispagestyle{summary}
\setlength{\footheight}{52pt}
\label{Summary}\pdfbookmark[1]{Summary}{Summary}
\USNtitlehead%
\par\bigskip
\if@project%
{
\begin{tabular}{rl}
\textbf{Course:} & \mysubject \\
\textbf{Title:} & \begin{minipage}[t]{0.8\textwidth}
\textit{\mytitle}\end{minipage} \\
\textbf{Pages:} & \textit{\pageref{LastPage}} \\
\textbf{Keywords:} & \begin{minipage}[t]{0.8\textwidth}
\textit{\mykeywords}\end{minipage}
\end{tabular}
\begin{tabular}{rl}
\textbf{Project group:} & \textit{\myauthor} \\
\textbf{Group participants:} & \begin{minipage}[t]{0.5\textwidth}
\textit{\myparticipants}\end{minipage} \\
\textbf{Supervisor:} & \textit{\supervisor} \\
\textbf{External partner:} & \begin{minipage}[t]{0.7\textwidth}
\textit{#2}\end{minipage}
\end{tabular}
}
\else
{
\begin{tabular}{rl}
\textbf{Course:} & \mysubject \\
\textbf{Title:} & \begin{minipage}[t]{0.8\textwidth}
\textit{\mytitle}\end{minipage} \\
\textbf{Pages:} & \textit{\pageref{LastPage}} \\
\textbf{Keywords:} & \begin{minipage}[t]{0.8\textwidth}
\textit{\mykeywords}\end{minipage}
\end{tabular}
\begin{tabular}{rl}
\textbf{Student:} & \textit{\myauthor} \\
\textbf{Supervisor:} & \textit{\supervisor} \\
\textbf{External partner:} & \begin{minipage}[t]{0.7\textwidth}
\textit{#2}\end{minipage}
\end{tabular}
}
\fi
~\\
% \begin{tabular}{lp{20em}}
% \textbf{Approved for archiving: } & \hrulefill\\
% & (\supervisor)
% \end{tabular}
\begin{framed}
\textbf{Summary:}\\
{\small #3}
\end{framed}
%
\cleardoubleemptypage %% fillpage without page number
}
\else
{}
\fi % end if@summary
}