From 4f980bd11c3d5f865ea85424818c08dc00d2f6eb Mon Sep 17 00:00:00 2001
From: Jan Wille <jan.wille@siemens.com>
Date: Thu, 10 Aug 2023 10:32:45 +0200
Subject: [PATCH] enable alignment for `\declarationAuthorship`

---
 CHANGELOG.md        | 1 +
 HsH-classes.dtx     | 6 ++++--
 README.md           | 5 ++---
 src/HsH-article.cls | 6 ++++--
 src/HsH-report.cls  | 6 ++++--
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf42c00..a0c6836 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
 ### Changed
 
 - the margins are now set using relative values, which makes them adapt to different paper sizes
+- add alignment parameter to `\declarationAuthorship`, it is still by default aligned to the bottom of the page, but can now be pushed to the top using `\declarationAuthorship[t]`
 
 ## Fixed
 
diff --git a/HsH-classes.dtx b/HsH-classes.dtx
index d0bc09d..73ded92 100644
--- a/HsH-classes.dtx
+++ b/HsH-classes.dtx
@@ -378,12 +378,13 @@
     properly acknowledged at their point of use.
   }
 \fi
-\newcommand\declarationAuthorship{
+\newcommand{\declarationAuthorship}[1][b]{
+  \let\@param#1
   \renewcommand{\thanks}{\sbox0}
   \foreach \x [count=\i] in \@author{\ifnum\i>1\global\@oneAuthorfalse\fi}
 %
   \thispagestyle{plain}
-  \vspace*{\fill}
+  \if\@param b\vspace*{\fill}\fi
   {\rule{\textwidth}{0.1pt}}
   \vskip 3em
   {\centering\huge\textbf{\dATitlename}\par}
@@ -399,6 +400,7 @@
       \end{tabular}
     }
   \par}
+  \if\@param t\vspace*{\fill}\fi
 }
 %
 %% reconfig Titlepage -----------------------------------------------------------------------------
diff --git a/README.md b/README.md
index 43dfc10..648d98b 100644
--- a/README.md
+++ b/README.md
@@ -177,9 +177,8 @@ You can use the following macros to define the different information presented o
 - `\keywords` will not be printed on the title-page, but rather on the end of the abstract, if you define some. They will also be but into the PDFs
   metadata.
 
-### `\declarationAuthorship`
-This macro will typeset a declaration of authorship, which is needed for most academic works. It will be produced at the bottom of the current page,
-separated by a horizontal line. <br>
+### `\declarationAuthorship[align]`
+This macro will typeset a declaration of authorship, which is needed for most academic works. You can choose to have it on the bottom (`b`) or top (`t`) of the page, with bottom beeing the default. <br>
 The macro is defined in German and English and will automatically match your document language.
 
 ### `\abs`
diff --git a/src/HsH-article.cls b/src/HsH-article.cls
index 8838ab8..9374487 100644
--- a/src/HsH-article.cls
+++ b/src/HsH-article.cls
@@ -273,11 +273,12 @@
     properly acknowledged at their point of use.
   }
 \fi
-\newcommand\declarationAuthorship{
+\newcommand{\declarationAuthorship}[1][b]{
+  \let\@param#1
   \renewcommand{\thanks}{\sbox0}
   \foreach \x [count=\i] in \@author{\ifnum\i>1\global\@oneAuthorfalse\fi}
   \thispagestyle{plain}
-  \vspace*{\fill}
+  \if\@param b\vspace*{\fill}\fi
   {\rule{\textwidth}{0.1pt}}
   \vskip 3em
   {\centering\huge\textbf{\dATitlename}\par}
@@ -292,6 +293,7 @@
       \end{tabular}
     }
   \par}
+  \if\@param t\vspace*{\fill}\fi
 }
 %% reconfig Titlepage -----------------------------------------------------------------------------
 \newtoks\@tabtoks
diff --git a/src/HsH-report.cls b/src/HsH-report.cls
index 9cb90d9..2838794 100644
--- a/src/HsH-report.cls
+++ b/src/HsH-report.cls
@@ -289,11 +289,12 @@
     properly acknowledged at their point of use.
   }
 \fi
-\newcommand\declarationAuthorship{
+\newcommand{\declarationAuthorship}[1][b]{
+  \let\@param#1
   \renewcommand{\thanks}{\sbox0}
   \foreach \x [count=\i] in \@author{\ifnum\i>1\global\@oneAuthorfalse\fi}
   \thispagestyle{plain}
-  \vspace*{\fill}
+  \if\@param b\vspace*{\fill}\fi
   {\rule{\textwidth}{0.1pt}}
   \vskip 3em
   {\centering\huge\textbf{\dATitlename}\par}
@@ -308,6 +309,7 @@
       \end{tabular}
     }
   \par}
+  \if\@param t\vspace*{\fill}\fi
 }
 %% reconfig Titlepage -----------------------------------------------------------------------------
 \newtoks\@tabtoks
-- 
GitLab