From 86725cfe30eb0d967cebf4a35535ec101f242548 Mon Sep 17 00:00:00 2001
From: "jakob.stendahl" <jakob.stendahl@infomedia.dk>
Date: Sat, 15 Apr 2023 12:14:09 +0200
Subject: Add ability to use image on banner portion of fp

---
 UiO_profile_fp.sty | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'UiO_profile_fp.sty')

diff --git a/UiO_profile_fp.sty b/UiO_profile_fp.sty
index 7532ddc..7134cc0 100644
--- a/UiO_profile_fp.sty
+++ b/UiO_profile_fp.sty
@@ -57,6 +57,7 @@
 \RequirePackage{tikz}
 \RequirePackage[export]{adjustbox}
 \RequirePackage{color, eso-pic, graphicx, xifthen, keyval}
+\usetikzlibrary{fit,calc}
 
 %% The options:
 
@@ -88,7 +89,6 @@
 \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 {}
@@ -154,7 +154,11 @@
       };
 
       % "Ribbon" bakgrunn
-      \node (names) [shape=rectangle, fill={uiopfp@\uiopfp@color}, minimum height=.25\paperheight, minimum width=\paperwidth, anchor=north west] at (current page.north west) {};
+      \node (names) [shape=rectangle, fill={uiopfp@\uiopfp@color}, minimum height=.25\paperheight, minimum width=\paperwidth, anchor=north west,inner sep=0pt] at (current page.north west) {
+        \ifdefined\uiopfp@image
+            \includegraphics[width=\paperwidth,height=.25\paperheight,trim=0 0 0 200,clip]{\uiopfp@image}
+        \fi
+      };
 
       % Navnetrekk
       \node[inner sep=0pt, anchor=north west] (uioname) at ([shift={(10mm,-10mm)}]names.north west) {
@@ -186,7 +190,7 @@
 
       % Forfatter
       \node[anchor=north west] (author) at ([shift={(0,-5mm)}]\ifdefined\uiopfp@subtitle subtitle\else title\fi.south west) {
-        \uiopfp@author
+        {\uiopfp@author}
       };
 
       % Studieprogram
-- 
cgit v1.2.3

