From 585277c75e3c300bd034260ffa6cf11a28a55dc5 Mon Sep 17 00:00:00 2001
From: Jan Wille <jan.wille@siemens.com>
Date: Fri, 11 Aug 2023 14:19:42 +0200
Subject: [PATCH] use more compact command for abstract

---
 HsH-classes.dtx        | 14 +++++++-------
 src/HsH-article.cls    | 15 +--------------
 src/HsH-report.cls     |  4 ++--
 src/HsH-standalone.cls |  1 +
 4 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/HsH-classes.dtx b/HsH-classes.dtx
index 671e6a8..a06d5b8 100644
--- a/HsH-classes.dtx
+++ b/HsH-classes.dtx
@@ -74,6 +74,8 @@
   \@todostrue
 }
 %</article|report>
+%
+%% defere all other options to the base class
 %<article>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
 %<report>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
 %<standalone>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{standalone}}
@@ -341,24 +343,22 @@
   \makeatother
 }
 %
-%<*article|report>
+%<*report>
 %% nicer abstract ---------------------------------------------------------------------------------
 \renewenvironment{abstract}{
   \quotation
   \setlength\parindent{0pt}
-%<article>  \section*{\abstractname}
-%<article>  \addcontentsline{toc}{section}{\abstractname}
-%<report>  \chapter*{\abstractname}
-%<report>  \addcontentsline{toc}{chapter}{\abstractname}
+  \addchap{\abstractname}
 }{%
   \ifx\@keywords\@empty\else
-%<article>    \vskip 0.5em
-%<report>    \vskip 2em
+    \vskip 2em
     \paragraph{\if@german Schlüsselwörter:\else Keywords:\fi}
     \@keywords
   \fi
   \endquotation
 }
+%</report>
+%<*article|report>
 %% decloration of Authorship ----------------------------------------------------------------------
 \newif\if@oneAuthor \@oneAuthortrue
 \if@german
diff --git a/src/HsH-article.cls b/src/HsH-article.cls
index 29300a3..7e7513e 100644
--- a/src/HsH-article.cls
+++ b/src/HsH-article.cls
@@ -73,6 +73,7 @@
 \DeclareOption{todos}{
   \@todostrue
 }
+%% defere all other options to the base class
 \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
 \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
 \ProcessOptions\relax
@@ -240,20 +241,6 @@
   \providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}}
   \makeatother
 }
-%% nicer abstract ---------------------------------------------------------------------------------
-\renewenvironment{abstract}{
-  \quotation
-  \setlength\parindent{0pt}
-  \section*{\abstractname}
-  \addcontentsline{toc}{section}{\abstractname}
-}{%
-  \ifx\@keywords\@empty\else
-    \vskip 0.5em
-    \paragraph{\if@german Schlüsselwörter:\else Keywords:\fi}
-    \@keywords
-  \fi
-  \endquotation
-}
 %% decloration of Authorship ----------------------------------------------------------------------
 \newif\if@oneAuthor \@oneAuthortrue
 \if@german
diff --git a/src/HsH-report.cls b/src/HsH-report.cls
index 53f8fe3..b2c75de 100644
--- a/src/HsH-report.cls
+++ b/src/HsH-report.cls
@@ -73,6 +73,7 @@
 \DeclareOption{todos}{
   \@todostrue
 }
+%% defere all other options to the base class
 \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
 \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
 \ProcessOptions\relax
@@ -260,8 +261,7 @@
 \renewenvironment{abstract}{
   \quotation
   \setlength\parindent{0pt}
-  \chapter*{\abstractname}
-  \addcontentsline{toc}{chapter}{\abstractname}
+  \addchap{\abstractname}
 }{%
   \ifx\@keywords\@empty\else
     \vskip 2em
diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls
index 0c7464d..b27db0e 100644
--- a/src/HsH-standalone.cls
+++ b/src/HsH-standalone.cls
@@ -69,6 +69,7 @@
 \DeclareOption{roman}{
   \renewcommand{\familydefault}{\rmdefault}
 }
+%% defere all other options to the base class
 \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{standalone}}
 \ExecuteOptions{margin=0.25cm,fontsize=11pt,a4paper,ngerman,sans} % default options
 \ProcessOptions\relax
-- 
GitLab