aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2023-03-06 11:21:18 +0000
committerjakobst1n <jakob.stendahl@outlook.com>2023-03-06 11:21:18 +0000
commitc5bad3cc2220594c5dd438b535bd89102bfb6feb (patch)
tree2cd4c53b47896f8344ca49e6b6031e9f214aeb46
parent5d14b64751980c2d0deb202b8908505350a043ba (diff)
downloadUiO_profile-c5bad3cc2220594c5dd438b535bd89102bfb6feb.tar.gz
UiO_profile-c5bad3cc2220594c5dd438b535bd89102bfb6feb.zip
Split fp into it's own package, so we can pass all options to baseclass
-rw-r--r--UiO_profile.cls122
-rw-r--r--UiO_profile_fp.sty218
-rw-r--r--profiles/03_uio_navnetrekk_bm.png (renamed from profiles/03_uio_navnetrekk_no_pos.png)bin70617 -> 70617 bytes
-rw-r--r--profiles/03_uio_navnetrekk_eng.png (renamed from profiles/03_uio_navnetrekk_eng_pos.png)bin64251 -> 64251 bytes
-rw-r--r--profiles/03_uio_navnetrekk_nn.pngbin0 -> 70617 bytes
5 files changed, 221 insertions, 119 deletions
diff --git a/UiO_profile.cls b/UiO_profile.cls
index 33fcad0..ca9dc67 100644
--- a/UiO_profile.cls
+++ b/UiO_profile.cls
@@ -45,10 +45,8 @@
\colorlet{UiOFrontpageBackground}{UiOLightGreen}
}
-\newif\iflangno
-\DeclareOption{no}{\langnotrue}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\uiom@base}}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\uiop@base}}
\ExecuteOptions{font=cmr}
@@ -117,119 +115,5 @@
\providecommand{\preface}{\chapter*{}\markboth{}{}}
\providecommand{\endpreface}{}
-% Titlepage
-\RequirePackage{tikz}
-\RequirePackage[export]{adjustbox}
-\newcommand{\subtitle}[1]{
- \def\@subtitle{#1}
-}
-\newcommand{\deliverableversion}[1]{
- \def\@deliverableversion{#1}
-}
-\newcommand{\programname}[1]{
- \def\@programname{#1}
-}
-\newcommand{\studypoints}[1]{
- \def\@studypoints{#1}
-}
-\newcommand{\branch}[2]{
- \def\@institute{#1}
- \def\@faculty{#2}
-}
-\newcommand{\uiotitlepage}{
- \thispagestyle{empty}
- \begin{titlepage}
- \begin{tikzpicture}[remember picture,overlay]
- % Bakgrunn
- \node (back names) [shape=rectangle, fill=UiOFrontpageBackground, minimum height=\paperheight, minimum width=\paperwidth, anchor=south west] at (current page.south west) {};
-
- % Segl
- \node[inner sep=0pt, anchor=south east] (uioname) at ([shift={(-10mm,10mm)}]back names.south east) {
- \includegraphics[width=23.7mm,right]{UiO_profile/profiles/03_uio_segl_pos.png}
- };
-
- % Dato
- \node[anchor=south west] (uioname) at ([shift={(10mm,10mm)}]back names.south west) {
- \ifdefined\thedate
- \thedate
- \else
- \fi
- };
-
- % "Ribbon" bakgrunn
- \node (names) [shape=rectangle, fill=UiOFrontpagePrimary, minimum height=.25\paperheight, minimum width=\paperwidth, anchor=north west] at (current page.north west) {};
-
- % Navnetrekk
- \node[inner sep=0pt, anchor=north west] (uioname) at ([shift={(10mm,-10mm)}]names.north west) {
- \iflangno
- \includegraphics[width=63mm]{UiO_profile/profiles/03_uio_navnetrekk_no_pos.png}
- \else
- \includegraphics[width=63mm]{UiO_profile/profiles/03_uio_navnetrekk_eng_pos.png}
- \fi
- };
-
- % Chip 1
- \node[anchor=north west, fill=black, text=white, inner sep=5pt] (chip1) at ([shift={(10mm,15mm)}]names.south west) {
- \ifdefined\@deliverableversion
- \@deliverableversion
- \else
- \fi
- };
-
- % Tittel
- \node[anchor=north west] (title) at ([shift={(10mm,-10mm)}]names.south west) {
- \ifdefined\thetitle
- {\sf\Huge\thetitle}
- \else
- \fi
- };
-
- % Undertittel
- \node[anchor=north west] (subtitle) at ([shift={(0,\ifdefined\thetitle -5mm\else 0\fi)}]title.south west) {
- \ifdefined\@subtitle
- \@subtitle
- \else
- \fi
- };
-
- % Forfatter
- \node[anchor=north west] (author) at ([shift={(0,-5mm)}]\ifdefined\@subtitle subtitle\else title\fi.south west) {
- \theauthor
- };
-
- % Studieprogram
- \node[anchor=north west] (program) at ([shift={(0,-5mm)}]\ifdefined\theauthor author\else subtitle\fi.south west) {
- \ifdefined\@programname
- \@programname
- \else
- \fi
- };
-
- % Studiepoeng
- \node[anchor=north west] (points) at ([shift={(0,0)}]program.south west) {
- \ifdefined\@studypoints
- \@studypoints\ \iflangno Studiepoeng\else Study points\fi
- \else
- \fi
- };
-
- % Institutt
- \node[anchor=north west] (institute) at ([shift={(0,-5mm)}]\ifdefined\@studypoints points\else program\fi.south west) {
- \ifdefined\@institute
- \@institute
- \else
- \fi
- };
-
- % Fakultet
- \node[anchor=north west] (faculty) at ([shift={(0,0)}]institute.south west) {
- \ifdefined\@faculty
- \@faculty
- \else
- \fi
- };
-
- \end{tikzpicture}
- \newpage
- \end{titlepage}
-}
+\endinput
+
diff --git a/UiO_profile_fp.sty b/UiO_profile_fp.sty
new file mode 100644
index 0000000..d08ac60
--- /dev/null
+++ b/UiO_profile_fp.sty
@@ -0,0 +1,218 @@
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+
+\ProvidesClass{UiO_profile/UiO_profile_fp}[2023/01/01 UiO profile frontpage]
+
+\DeclareOption{american}{\def \uiopfp@lang {eng}}
+\DeclareOption{english}{\def \uiopfp@lang {eng}}
+\DeclareOption{UKenglish}{\def \uiopfp@lang {eng}}
+\DeclareOption{USenglish}{\def \uiopfp@lang {eng}}
+\DeclareOption{norsk}{\def \uiopfp@lang {bm}}
+\DeclareOption{nynorsk}{\def \uiopfp@lang {nn}}
+
+\newcommand{\uiopfp@fac@eng}{Faculty of Mathematics and Natural Sciences}
+\newcommand{\uiopfp@fac@bm}{Det matematisk-naturvitenskapelige fakultet}
+\newcommand{\uiopfp@fac@nn}{Det matematisk-naturvitenskaplege fakultet}
+
+\newcommand{\uiopfp@dept@eng}{Department of Informatics}
+\newcommand{\uiopfp@dept@bm}{Institutt for informatikk}
+\newcommand{\uiopfp@dept@nn}{Institutt for informatikk}
+
+\newcommand{\uiopfp@thesis@eng}{Master's thesis}
+\newcommand{\uiopfp@thesis@bm}{Masteroppgave}
+\newcommand{\uiopfp@thesis@nn}{Masteroppg\aa ve}
+
+\newcommand{\uiopfp@bachelor@eng}{Bachelor's thesis}
+\newcommand{\uiopfp@bachelor@bm}{Bacheloroppgave}
+\newcommand{\uiopfp@bachelor@nn}{Bacheloroppg\aa ve}
+
+\newcommand{\uiopfp@spname@eng}{ECTS study points}
+\newcommand{\uiopfp@spname@bm}{studiepoeng}
+\newcommand{\uiopfp@spname@nn}{studiepoeng}
+
+\newcommand{\uiopfp@supervisor@eng}{Supervisor}
+\newcommand{\uiopfp@supervisors@eng}{Supervisors}
+\newcommand{\uiopfp@supervisor@bm}{Veileder}
+\newcommand{\uiopfp@supervisors@bm}{Veiledere}
+\newcommand{\uiopfp@supervisor@nn}{Rettleiar}
+\newcommand{\uiopfp@supervisors@nn}{Rettleiarar}
+
+\newcommand{\uiopfp@std@size}{14}
+\newcommand{\uiopfp@big@size}{20}
+\newcommand{\uiopfp@head@size}{32}
+
+\ExecuteOptions{norsk}
+\ProcessOptions \relax
+
+\RequirePackage{tikz}
+\RequirePackage[export]{adjustbox}
+\RequirePackage{color, eso-pic, graphicx, xifthen, keyval}
+
+%% The options:
+
+\newboolean{uiopfp@compact}
+
+\define@key{uiopfp@keys}{author}{\def \uiopfp@author {#1}}
+\define@key{uiopfp@keys}{binding}[24]{\def \uiopfp@bind {#1}}
+\define@key{uiopfp@keys}{color}{\def \uiopfp@color {#1}}
+\define@key{uiopfp@keys}{colour}{\def \uiopfp@color {#1}}
+\define@key{uiopfp@keys}{date}{\def \uiopfp@date {#1}}
+\define@key{uiopfp@keys}{dept}{\def \uiopfp@dept {#1}}
+\define@key{uiopfp@keys}{fac}{\def \uiopfp@fac {#1}}
+\define@key{uiopfp@keys}{font}{\def \uiopfp@font {#1}}
+\define@key{uiopfp@keys}{image}{\def \uiopfp@image {#1}}
+\define@key{uiopfp@keys}{info}{\def \uiopfp@info {#1}}
+\define@key{uiopfp@keys}{kind}{\def \uiopfp@firstchip {#1}}
+\define@key{uiopfp@keys}{program}{\def \uiopfp@programname{#1}}
+\define@key{uiopfp@keys}{sp}{\def \uiopfp@sp{#1}}
+\define@key{uiopfp@keys}{subtitle}{\def \uiopfp@subtitle {#1}}
+\define@key{uiopfp@keys}{supervisor}{\def \uiopfp@supervisor {#1}}
+\define@key{uiopfp@keys}{supervisors}{\def \uiopfp@supervisors {#1}}
+\define@key{uiopfp@keys}{title}{\def \uiopfp@title {#1}}
+
+% Default values:
+\def \uiopfp@author {\@author}
+\def \uiopfp@bind {0}
+\def \uiopfp@color {blue}
+\providecommand{\uiopfp@date}{\uiopfp@term~\uiopfp@year}
+\def \uiopfp@dept {\csname uiopfp@dept@\uiopfp@lang \endcsname}
+\def \uiopfp@fac {\csname uiopfp@fac@\uiopfp@lang \endcsname}
+\def \uiopfp@font {helvetica}
+\def \uiopfp@image {}
+\def \uiopfp@info {}
+\providecommand{\uiopfp@program}{}
+\def \uiopfp@supervisor {}
+\def \uiopfp@supervisors {}
+\def \uiopfp@title {\@title}
+
+\AtEndOfPackage{\ifthenelse{\equal{\uiopfp@font}{helvetica}}
+ {\RequirePackage[scaled]{helvet}}
+ {}}
+
+
+%% Determine the term (as in "Spring 2022"):
+\newcounter{uiopfp@cur@year} \setcounter{uiopfp@cur@year}{\the\year}
+\newcounter{uiopfp@cur@month} \setcounter{uiopfp@cur@month}{\the\month}
+
+\ifthenelse{\theuiopfp@cur@month<7}
+ {\newcommand{\uiopfp@term@eng}{Spring}%
+ \newcommand{\uiopfp@term@bm}{V\aa ren}%
+ \newcommand{\uiopfp@term@nn}{V\aa ren}}
+ {\newcommand{\uiopfp@term@eng}{Autumn}%
+ \newcommand{\uiopfp@term@bm}{H\o sten}%
+ \newcommand{\uiopfp@term@nn}{Hausten}}
+\newcommand{\uiopfp@term}{\csname uiopfp@term@\uiopfp@lang\endcsname}
+\newcommand{\uiopfp@year}{\arabic{uiopfp@cur@year}}
+
+\newcounter{uiopfp@bind@w}
+\newcommand{\uiofp}[1][]{{%
+ \parindent = 0pt \parskip = 0pt \relax
+ \@ifundefined{hypersetup}{}{\hypersetup{pageanchor=false}}
+ \setkeys{uiopfp@keys}{#1}
+ \setcounter{uiopfp@bind@w}{28} \addtocounter{uiopfp@bind@w}{\uiopfp@bind}
+ \fontfamily{phv}
+ \ifthenelse{\equal{\uiopfp@font}{arial}}{\fontfamily{ua1}}{}
+ \ifthenelse{\equal{\uiopfp@font}{verdana}}{\fontfamily{jvn}}{}
+ \fontencoding{T1}\fontsize{\uiopfp@std@size}{18pt}%
+ \fontseries{m}\fontshape{n}\selectfont
+
+ \uiopfp@page
+ %\if@twoside \uiopfp@blankpage \fi
+ \setcounter{page}{1}
+ \@ifundefined{hypersetup}{}{\hypersetup{pageanchor=true}}
+}}
+
+
+\newcommand{\uiopfp@page}{
+ \thispagestyle{empty}
+ \begin{titlepage}
+ \begin{tikzpicture}[remember picture,overlay]
+ % Bakgrunn
+ \node (back names) [shape=rectangle, fill=UiOFrontpageBackground, minimum height=\paperheight, minimum width=\paperwidth, anchor=south west] at (current page.south west) {};
+
+ % Segl
+ \node[inner sep=0pt, anchor=south east] (uioname) at ([shift={(-10mm,10mm)}]back names.south east) {
+ \includegraphics[width=23.7mm,right]{UiO_profile/profiles/03_uio_segl_pos.png}
+ };
+
+ % Dato
+ \node[anchor=south west] (uioname) at ([shift={(10mm,10mm)}]back names.south west) {
+ \ifdefined\uiopfp@date
+ \uiopfp@date
+ \else
+ \fi
+ };
+
+ % "Ribbon" bakgrunn
+ \node (names) [shape=rectangle, fill=UiOFrontpagePrimary, minimum height=.25\paperheight, minimum width=\paperwidth, anchor=north west] at (current page.north west) {};
+
+ % Navnetrekk
+ \node[inner sep=0pt, anchor=north west] (uioname) at ([shift={(10mm,-10mm)}]names.north west) {
+ \includegraphics[width=63mm]{UiO_profile/profiles/03_uio_navnetrekk_\uiopfp@lang.png}
+ };
+
+ % Chip 1
+ \ifdefined\uiopfp@firstchip
+ \node[anchor=north west, fill=black, text=white, inner sep=5pt] (chip1) at ([shift={(10mm,15mm)}]names.south west) {
+ \uiopfp@firstchip
+ };
+ \fi
+
+ % Tittel
+ \node[anchor=north west] (title) at ([shift={(10mm,-10mm)}]names.south west) {
+ \ifdefined\uiopfp@title
+ {\sf\Huge\uiopfp@title}
+ \else
+ \fi
+ };
+
+ % Undertittel
+ \node[anchor=north west] (subtitle) at ([shift={(0,\ifdefined\uiopfp@title -5mm\else 0\fi)}]title.south west) {
+ \ifdefined\uiopfp@subtitle
+ \uiopfp@subtitle
+ \else
+ \fi
+ };
+
+ % Forfatter
+ \node[anchor=north west] (author) at ([shift={(0,-5mm)}]\ifdefined\uiopfp@subtitle subtitle\else title\fi.south west) {
+ \uiopfp@author
+ };
+
+ % Studieprogram
+ \node[anchor=north west] (program) at ([shift={(0,-5mm)}]\ifdefined\uiopfp@author author\else subtitle\fi.south west) {
+ \ifdefined\uiopfp@programname
+ \uiopfp@programname
+ \else
+ \fi
+ };
+
+ % Studiepoeng
+ \node[anchor=north west] (points) at ([shift={(0,0)}]program.south west) {
+ \ifdefined\uiopfp@sp
+ {\uiopfp@sp~\csname uiopfp@spname@\uiopfp@lang\endcsname\par}
+ \else
+ \fi
+ };
+
+ % Institutt
+ \node[anchor=north west] (institute) at ([shift={(0,-5mm)}]\ifdefined\uiopfp@sp points\else program\fi.south west) {
+ \ifdefined\uiopfp@dept
+ \uiopfp@dept
+ \else
+ \fi
+ };
+
+ % Fakultet
+ \node[anchor=north west] (faculty) at ([shift={(0,0)}]institute.south west) {
+ \ifdefined\uiopfp@fac
+ \uiopfp@fac
+ \else
+ \fi
+ };
+
+ \end{tikzpicture}
+ \newpage
+ \end{titlepage}
+}
+
+\endinput
diff --git a/profiles/03_uio_navnetrekk_no_pos.png b/profiles/03_uio_navnetrekk_bm.png
index b113f52..b113f52 100644
--- a/profiles/03_uio_navnetrekk_no_pos.png
+++ b/profiles/03_uio_navnetrekk_bm.png
Binary files differ
diff --git a/profiles/03_uio_navnetrekk_eng_pos.png b/profiles/03_uio_navnetrekk_eng.png
index 00249b4..00249b4 100644
--- a/profiles/03_uio_navnetrekk_eng_pos.png
+++ b/profiles/03_uio_navnetrekk_eng.png
Binary files differ
diff --git a/profiles/03_uio_navnetrekk_nn.png b/profiles/03_uio_navnetrekk_nn.png
new file mode 100644
index 0000000..b113f52
--- /dev/null
+++ b/profiles/03_uio_navnetrekk_nn.png
Binary files differ