-
Notifications
You must be signed in to change notification settings - Fork 0
/
ifikompendium.tex
161 lines (124 loc) · 4.41 KB
/
ifikompendium.tex
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
%% Standard headers:
\DeclareOption{american}{\def \IfiF@lang {eng}}
\DeclareOption{english}{\def \IfiF@lang {eng}}
\DeclareOption{UKenglish}{\def \IfiF@lang {eng}}
\DeclareOption{USenglish}{\def \IfiF@lang {eng}}
\DeclareOption{norsk}{\def \IfiF@lang {bm}}
\DeclareOption{nynorsk}{\def \IfiF@lang {nn}}
\ExecuteOptions{norsk}
\ProcessOptions \relax
%% Initial code:
\RequirePackage[T1]{fontenc}
\RequirePackage{eso-pic,graphicx,keyval,xifthen}
\IfFileExists{type1cm.sty}{\RequirePackage{type1cm}}{}
\IfFileExists{type1ec.sty}{\RequirePackage{type1ec}}{}
%% The main command:
\newcommand{\ififorside}[1][]{\begin{titlepage}
\def \and {, }
\setkeys{IfiF@keys}{#1}
\AddToShipoutPictureBG*{\IfiF@print@background}
\ifthenelse{\equal{}{\IfiF@dept}}
{}
{\AddToShipoutPictureFG*{\IfiF@print@dept}}
\AddToShipoutPictureFG*{\IfiF@print@title}
\null
\end{titlepage}
\if@twoside \IfiF@blankpage \fi}
%% The options:
\define@key{IfiF@keys}{dept}{\def \IfiF@dept {#1}}
\define@key{IfiF@keys}{fac}{\def \IfiF@fac {#1}}
\define@key{IfiF@keys}{isbn}{\def \IfiF@isbn {#1}}
\define@key{IfiF@keys}{issn}{\def \IfiF@issn {#1}}
\define@key{IfiF@keys}{n}{\def \IfiF@rrnum {#1}}
\def \IfiF@dept {}
\def \IfiF@fac {}
\def \IfiF@isbn {}
\def \IfiF@issn {0806-3036}
\def \IfiF@rrnum {0}
%% Additional commands:
\newcommand{\subtitle}[1]{\def \IfiF@subtitle{#1}}
\subtitle{}
%% Include the title page background:
\newcommand{\IfiF@print@background}{{%
\setlength{\unitlength}{1bp}%
\ifthenelse{\equal{}{\IfiF@dept}}
{\put(-21,-21){\includegraphics{ifi-\IfiF@background-forside-\IfiF@lang}}}
{\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics{uio-\IfiF@background-forside}%
\vfill}}}}}
%% Include the name of the university and department (if needed):
\newcommand{\IfiF@print@dept}{{%
\setlength{\unitlength}{1cm}%
\put(3.9,22.6){\makebox[10cm][l]{\rm
\fontfamily{\IfiF@font}\fontseries{b}%
\fontsize{24}{0pt}\selectfont
\IfiF@dept}}
\put(3.9,21.9){\makebox[10cm][l]{\rm % Should have been Questor
\fontfamily{pnc}\fontsize{17}{0pt}\selectfont % but New Cent Schb looks
\IfiF@fac}}}} % quite like it.
%% Include the title, subtitle, author and date:
\newcommand{\IfiF@print@title}{{%
\setlength{\unitlength}{1cm}%
\put(3.5,14.6){\vbox to 6.1cm {\hsize=15.5cm
\raggedright
%
\ifthenelse{\isundefined{\fveLaTeX}}{}
{ % Redefinition of standard \LaTeX command because font package
% 'bera' mangles it!
\DeclareRobustCommand{\ifik@LaTeX}{L\kern-.36em%
{\sbox\z@ T%
\vbox to\ht\z@{\hbox{\check@mathfonts
\fontsize\sf@size\z@
\math@fontsfalse\selectfont
A}%
\vss}%
}%
\kern-.15em%
\TeX}%
\let \LaTeX = \ifik@LaTeX
}
%
\fontfamily{\IfiF@font}
\fontsize{32}{35pt}\selectfont
\@title
\vskip 0pt plus 1fill
\fontsize{17}{20pt}\selectfont
\ifthenelse{\cnttest{\IfiF@rrnum}={0}}{\IfiF@subtitle}{Research Report \IfiF@rrnum}
\vskip 0pt plus 2fill\relax
\@author\\[0.5ex] \IfiF@kind}}%
\ifthenelse{\equal{\IfiF@isbn}{}}
{}
{\put(3.5,11.2){\vbox to 2.8cm {\hsize=15.5cm
\raggedright
\vfill
\fontfamily{\IfiF@font}
\fontsize{17}{20pt}\selectfont
\begin{tabular}{@{}ll}
ISBN& \IfiF@isbn\\[0.5ex]
ISSN& \IfiF@issn\\
\end{tabular}
\vfill}}}}}
%% Find the best font:
\newcommand{\IfiF@font}{phv} % Helvetica is always available, but use
\IfFileExists{t1ua1.fd}{\renewcommand{\IfiF@font}{ua1}}{} % Arial if possible.
%% Determine the term (as in "Spring 2012"):
\newcounter{IfiF@cur@year} \setcounter{IfiF@cur@year}{\the\year}
\newcounter{IfiF@cur@month} \setcounter{IfiF@cur@month}{\the\month}
\ifthenelse{\theIfiF@cur@month<7}
{\newcommand{\IfiF@term@eng}{Spring}%
\newcommand{\IfiF@term@bm}{v\aa ren}%
\newcommand{\IfiF@term@nn}{v\aa ren}}
{\newcommand{\IfiF@term@eng}{Autumn}%
\newcommand{\IfiF@term@bm}{h\o sten}%
\newcommand{\IfiF@term@nn}{hausten}}
\newcommand{\IfiF@term}{\csname IfiF@term@\IfiF@lang\endcsname}
\newcommand{\IfiF@year}{\arabic{IfiF@cur@year}}
%% Other utilities:
\newcommand{\IfiF@blankpage}{%
\thispagestyle{empty}
\null
\newpage}
\endinput