From 05171ddb77cff881089ead163f3087709716f306 Mon Sep 17 00:00:00 2001
From: Jan Wille <jan.wille@siemens.com>
Date: Thu, 10 Aug 2023 11:31:39 +0200
Subject: [PATCH] error for missing `HsH-logo` is now thrown by
 `\includeHsHlogohere`

this is more consistent and also catches error for users hwo don't
build use a standard titlepage but still use the logo command.
---
 HsH-classes.dtx        | 14 ++++++++------
 src/HsH-article.cls    | 14 ++++++++------
 src/HsH-report.cls     | 14 ++++++++------
 src/HsH-standalone.cls |  9 ++++++++-
 4 files changed, 32 insertions(+), 19 deletions(-)

diff --git a/HsH-classes.dtx b/HsH-classes.dtx
index 73ded92..a0b79d2 100644
--- a/HsH-classes.dtx
+++ b/HsH-classes.dtx
@@ -27,7 +27,14 @@
 %% commands for HsH-logo
 \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
 \newcommand{\HsHlogoPage}{1}
-\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
+\newcommand{\includeHsHlogohere}[1][5cm]{
+  \IfFileExists{\HsHlogoPath}{}{
+    \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
+			The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
+		}
+	}
+  \includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}
+}
 \newif\if@german%
 %<article|report>\newif\if@todos\@todosfalse%
 
@@ -516,11 +523,6 @@
     \global\@topnum=\z@
 %</article>
     \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
-    \IfFileExists{\HsHlogoPath}{}{
-      \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
-        The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
-      }
-    }
     \vspace*{1cm}
     \begin{minipage}[t]{\textwidth}%
       \ifx\@titlehead\@empty \else
diff --git a/src/HsH-article.cls b/src/HsH-article.cls
index 9374487..857ef3a 100644
--- a/src/HsH-article.cls
+++ b/src/HsH-article.cls
@@ -28,7 +28,14 @@
 %% commands for HsH-logo
 \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
 \newcommand{\HsHlogoPage}{1}
-\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
+\newcommand{\includeHsHlogohere}[1][5cm]{
+  \IfFileExists{\HsHlogoPath}{}{
+    \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
+The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
+}
+}
+  \includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}
+}
 \newif\if@german%
 \newif\if@todos\@todosfalse%
 
@@ -351,11 +358,6 @@
     \fi
     \global\@topnum=\z@
     \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
-    \IfFileExists{\HsHlogoPath}{}{
-      \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
-        The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
-      }
-    }
     \vspace*{1cm}
     \begin{minipage}[t]{\textwidth}%
       \ifx\@titlehead\@empty \else
diff --git a/src/HsH-report.cls b/src/HsH-report.cls
index 2838794..48147d2 100644
--- a/src/HsH-report.cls
+++ b/src/HsH-report.cls
@@ -28,7 +28,14 @@
 %% commands for HsH-logo
 \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
 \newcommand{\HsHlogoPage}{1}
-\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
+\newcommand{\includeHsHlogohere}[1][5cm]{
+  \IfFileExists{\HsHlogoPath}{}{
+    \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
+The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
+}
+}
+  \includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}
+}
 \newif\if@german%
 \newif\if@todos\@todosfalse%
 
@@ -383,11 +390,6 @@
       \next@tdpage
     \fi
     \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
-    \IfFileExists{\HsHlogoPath}{}{
-      \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
-        The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
-      }
-    }
     \vspace*{1cm}
     \begin{minipage}[t]{\textwidth}%
       \ifx\@titlehead\@empty \else
diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls
index b635ccd..72ca438 100644
--- a/src/HsH-standalone.cls
+++ b/src/HsH-standalone.cls
@@ -28,7 +28,14 @@
 %% commands for HsH-logo
 \newcommand{\HsHlogoPath}{HSH-Logo.pdf}
 \newcommand{\HsHlogoPage}{1}
-\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
+\newcommand{\includeHsHlogohere}[1][5cm]{
+  \IfFileExists{\HsHlogoPath}{}{
+    \ClassError{\myClassName}{HsH-Logo.pdf not found!}{
+The HsH Logo is necasary for the titlepage! Try putting it next to your source file or use \HsHlogoPath to define the file location
+}
+}
+  \includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}
+}
 \newif\if@german%
 
 %% document options -------------------------------------------------------------------------------
-- 
GitLab