From 4017cb1242bd78e5a35a085852ed9a196ffa7507 Mon Sep 17 00:00:00 2001
From: "jakob.stendahl" <jakob.stendahl@infomedia.dk>
Date: Mon, 1 May 2023 19:49:58 +0200
Subject: Add option for clipping ribbon image

---
 UiO_profile_fp.sty | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'UiO_profile_fp.sty')

diff --git a/UiO_profile_fp.sty b/UiO_profile_fp.sty
index 7134cc0..ee60680 100644
--- a/UiO_profile_fp.sty
+++ b/UiO_profile_fp.sty
@@ -72,6 +72,7 @@
 \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}{image-trim}{\edef\uiopfp@imagetrim{trim={#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}}
@@ -90,6 +91,7 @@
 \def \uiopfp@fac {\csname uiopfp@fac@\uiopfp@lang \endcsname}
 \def \uiopfp@font {helvetica}
 \def \uiopfp@info {}
+\edef \uiopfp@imagetrim {trim={0 0 0 0}}
 \providecommand{\uiopfp@program}{}
 \def \uiopfp@supervisor {}
 \def \uiopfp@supervisors {}
@@ -156,7 +158,7 @@
       % "Ribbon" bakgrunn
       \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}
+            \begingroup\edef\x{\endgroup\noexpand\includegraphics[width=\paperwidth,height=.25\paperheight,\uiopfp@imagetrim,clip]{\uiopfp@image}}\x
         \fi
       };
 
-- 
cgit v1.2.3

