From d5c670288f65277fa677aee94ccfc1534f7370b6 Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@posteo.net>
Date: Mon, 23 Jan 2023 22:12:14 +0100
Subject: [PATCH] add widePic

---
 layout.sty | 59 +++++++++++-------------------------------------------
 1 file changed, 12 insertions(+), 47 deletions(-)

diff --git a/layout.sty b/layout.sty
index 1d25c472..b7cee63c 100644
--- a/layout.sty
+++ b/layout.sty
@@ -41,7 +41,7 @@
 \RequirePackage{pifont}
 \RequirePackage{colortbl}
 \RequirePackage[poster]{tcolorbox}
-\tcbuselibrary{breakable,raster}
+\tcbuselibrary{breakable,raster,vignette}
 \tcbuselibrary{skins} % used for wiggly-border boxes
 
 %%%%% Add fancy page chapter sides %%%%%
@@ -236,57 +236,22 @@ bookmarks=true]%
   \label{#1}
 }
 
-\newcommand{\toppic}[2]{
-  \begin{figure*}[t!]
-    \IfFileExists{images/#1.svg}{
-      \includesvg[width=\textwidth]{images/#1}
-    }{
-      \includegraphics[width=\textwidth]{images/#1.jpg}
-    }
-    #2
-  \label{#1}
-  \end{figure*}
-}
-
-\newcommand{\toppicBorder}[2]{
-  \begin{figure*}[t!]
-    \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray]
-    \IfFileExists{images/#1.svg}{
-      \includesvg[width=\textwidth]{images/#1}
-    }{
-      \includegraphics[width=\textwidth]{images/#1.jpg}
-    }
-    #2
-    \end{tcolorbox}
-  \label{#1}
-  \end{figure*}
-}
-
-\newcommand{\bottompic}[2]{
-  \begin{figure*}[b!]
-    \IfFileExists{images/#1.svg}{
-      \includesvg[width=\textwidth]{images/#1}
+\newcommand{\widePic}[2][b]{
+  \begin{figure*}[#1!]
+    \IfFileExists{images/#2.svg}{
+      \includesvg[width=\textwidth]{images/#2}
     }{
-      \includegraphics[width=\textwidth]{images/#1.jpg}
+      \tcbincludegraphics[
+      blankest,
+      before upper={\parindent0pt},
+      boxrule=0mm,
+      finish fading vignette={size=0.02\textwidth},
+      ]{images/#2.jpg}
     }
-    #2
-  \label{#1}
+    \label{#2}
   \end{figure*}
 }
 
-\newcommand{\bottompicBorder}[2]{
-  \begin{figure*}[b!]
-    \begin{tcolorbox}[before upper={\parindent0pt},colframe=black,colback=gray]
-    \IfFileExists{images/#1.svg}{
-      \includesvg[width=\textwidth]{images/#1}
-    }{
-      \includegraphics[width=\textwidth]{images/#1.jpg}
-    }
-    #2
-    \label{#1}
-    \end{tcolorbox}
-  \end{figure*}
-}
 
 % sidebling
 % This command automatically adds little decorations to boxes.
-- 
GitLab