From f914c275329785103a123c35a5d1e5db321c7adf Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Wed, 13 Dec 2023 03:03:57 +0000
Subject: CTAN sync 202312130303

---
 macros/latex/contrib/tuda-ci/tex/tudapub.cls | 32 +++++++++++++++++-----------
 1 file changed, 20 insertions(+), 12 deletions(-)

(limited to 'macros/latex/contrib/tuda-ci/tex/tudapub.cls')

diff --git a/macros/latex/contrib/tuda-ci/tex/tudapub.cls b/macros/latex/contrib/tuda-ci/tex/tudapub.cls
index 55cd2ed8f4..16f659174f 100644
--- a/macros/latex/contrib/tuda-ci/tex/tudapub.cls
+++ b/macros/latex/contrib/tuda-ci/tex/tudapub.cls
@@ -1,4 +1,4 @@
-%% This is file `tudapub.cls' version 3.34 (2023/07/12),
+%% This is file `tudapub.cls' version 3.35 (2023-12-11),
 %% it is part of
 %% TUDa-CI -- Corporate Design for TU Darmstadt
 %% ----------------------------------------------------------------------------
@@ -26,14 +26,12 @@
 %%
 %% ============================================================================
 %%
-\def\fileversion{3.34}
-\def\filedate{2023/07/12}
+\def\fileversion{3.35}
+\def\filedate{2023-12-11}
 \NeedsTeXFormat{LaTeX2e}
-\RequirePackage{expl3}
+
 \ProvidesExplClass{tudapub}
 	{\filedate}{\fileversion}{Publications using TU Darmstadt's Corporate Design (TUDa-CI)}
-
-\RequirePackage{l3keys2e}
 \RequirePackage{URspecialopts}
 
 \Define@specialopt@Module[ptxcd/pub]
@@ -195,7 +193,7 @@
 
 \Module@Process@SpecialOptions[ptxcd/pub]
 
-\ProcessKeysOptions{ptxcd/pub}
+\ProcessKeyOptions[ptxcd/pub]
 
 
 %Option adjustments required for valid PDF/A
@@ -363,6 +361,11 @@
 %Has to be loaded here due to headwidth options
 \usepackage[draft=false]{scrlayer-scrpage}
 
+\AddToHook{begindocument}[tudapub:BCOR-titlepage]{
+	\bool_if:NT  \g_ptxcd_BCOR_titlepage_bool
+		{\xdef\coverpageleftmargin{\the\dimexpr\coverpageleftmargin+\the\ta@bcor}}
+}
+
 \bool_if:NTF  \g_ptxcd_geometry_bool {
 	\RequirePackage{geometry}
 	\geometry{
@@ -383,7 +386,7 @@
 	\savegeometry{TUDa-marginpar}
 
 	\bool_if:NTF \g_ptxcd_custommargins_bool {
-		\AtBeginDocument{
+		\AddToHook{begindocument}[tudapub:custommargins]{
 			\savegeometry{TUDa-default}
 			\bool_if:NTF  \g_ptxcd_marginpar_bool {
 				\dim_gset:Nn \g_ptxcd_headwidth_dim {\textwidth+\marginparwidth+\marginparsep}
@@ -398,17 +401,22 @@
 		}  {
 			\tl_const:Nn \c_ptxcd_default_geometry_tl {TUDa-nomarginpar}
 		}
-		\AtBeginDocument{
+		\AddToHook{begindocument}[tudapub:custommargins-geometry]{
 			\loadgeometry{\c_ptxcd_default_geometry_tl}
-			\bool_if:NT \g_ptxcd_BCOR_titlepage_bool {\xdef\coverpageleftmargin{\the\dimexpr\coverpageleftmargin+\the\ta@bcor}}
 		}
 	}
 
-	\dim_gset:Nn \g_ptxcd_headwidth_dim 			  {\paperwidth-\g_ptxcd_innerMargin_dim-\g_ptxcd_outerMargin_dim-\Gm@bindingoffset}
+	\dim_gset:Nn \g_ptxcd_headwidth_dim {\paperwidth-\g_ptxcd_innerMargin_dim-\g_ptxcd_outerMargin_dim-\Gm@bindingoffset}
 
 	\cs_set:Nn \ptxcd_disable_marginpar: {\loadgeometry{TUDa-nomarginpar}}
 	\cs_set:Nn \ptxcd_restore_typearea: {\loadgeometry{\c_ptxcd_default_geometry_tl}}
 
+	\AddToHook{cmd/Gm@changelayout/after}[tudapub-restore-headwidth]{
+		\bool_if:NTF \g_ptxcd_marginpar_bool
+			{\KOMAoptions{headwidth=textwithmarginpar,footwidth=textwithmarginpar}}
+			{\KOMAoptions{headwidth=text,footwidth=text}}
+	}
+
 }{
 	\let\ptxcd_disable_marginpar:\relax
 	\def\ptxcd_restore_typearea:{
@@ -450,7 +458,7 @@
 \bool_if:NT \g_ptxcd_headline_bool {\KOMAoptions{headsepline=.5\c_ptxcd_smallrule_dim}}
 
 %Adjust headheight
-\AtBeginDocument{
+\AddToHook{begindocument}[tudapub:adjust-headheight]{
 \bool_if:NTF \g_ptxcd_marginpar_bool
 	{
 		\KOMAoptions {
-- 
cgit v1.2.3

