From 6e74fa6d96eddafe155a3f2ab10054317d4301bd Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 10 Sep 2019 21:45:41 +0000
Subject: tuda-ci (10sep19)

git-svn-id: svn://tug.org/texlive/trunk@52075 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls | 98 +++++++++++++++++++------
 1 file changed, 74 insertions(+), 24 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls')

diff --git a/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls b/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls
index ae21ac783dc..2cbc051fe51 100644
--- a/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls
+++ b/Master/texmf-dist/tex/latex/tuda-ci/tudapub.cls
@@ -1,4 +1,4 @@
-%% This is file `tudapub.cls' version 1.01 (2019/08/05),
+%% This is file `tudapub.cls' version 1.10 (2019/09/09),
 %% it is part of
 %% TUDa-CI -- Corporate Design for TU Darmstadt
 %% ----------------------------------------------------------------------------
@@ -26,8 +26,8 @@
 %%
 %% ============================================================================
 %%
-\def\fileversion{1.01}
-\def\filedate{2019/08/05}
+\def\fileversion{1.10}
+\def\filedate{2019/09/09}
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
 \ProvidesExplClass{tudapub}
@@ -58,6 +58,9 @@
 	The~KOMA-Script~option~titlepage~is~forced~to~"firstiscover".
 }
 
+\bool_new:N \g_TUDa_geometry_bool
+\bool_new:N \g_TUDa_custommargins_bool
+
 \keys_define:nn {TUDa/pub} {
 	%twoside -> geometry + class
 	class .choice:,
@@ -75,7 +78,19 @@
 	marginpar .tl_gset:N = \g_TUDa_marginpar_tl,
 	marginpar .default:n = auto,
 	marginpar .initial:n = auto,
-	custommargins .bool_gset:N = \g_TUDa_custommargins_bool,
+	custommargins .choice:,
+	custommargins / true .code:n ={
+		\bool_gset_true:N \g_TUDa_custommargins_bool
+		\bool_gset_false:N \g_TUDa_geometry_bool
+	},
+	custommargins / false .code:n ={
+		\bool_gset_false:N \g_TUDa_custommargins_bool
+		\bool_gset_true:N \g_TUDa_geometry_bool
+	},
+	custommargins / geometry .code:n = {
+		\bool_gset_true:N \g_TUDa_custommargins_bool
+		\bool_gset_true:N \g_TUDa_geometry_bool
+	},
 	custommargins .initial:n = false,
 	custommargins .default:n = true,
 	fontsize .code:n = \prop_gput:Nnn \g_TUDa_clsopts_prop {fontsize} {#1},
@@ -310,11 +325,10 @@
 
 %%%%%Anfang Randeinstellungen Geometry
 
-\bool_if:NTF  \g_TUDa_custommargins_bool {
-	\KOMAoptions{headinclude, footinclude}
-	\let\TUDa_disable_marginpar:\relax
-	\let\TUDa_restore_typearea:\relax
-}{
+%Has to be loaded here due to headwidth options
+\usepackage[draft=false]{scrlayer-scrpage}
+
+\bool_if:NTF  \g_TUDa_geometry_bool {
 	\RequirePackage[top=\g_TUDa_topMargin_dim, inner=\g_TUDa_innerMargin_dim, outer=\dim_eval:n {\g_TUDa_outerMargin_dim}, bottom=\g_TUDa_bottomMargin_dim, columnsep= \g_TUDa_columnSep_dim, includehead, includefoot,includemp, nomarginpar, headheight=\g_TUDa_headheight_dim
 	]{geometry}
 
@@ -323,20 +337,45 @@
 	\geometry{includemp, marginpar=\g_TUDa_marginpar_dim, marginparsep=\g_TUDa_columnSep_dim}
 	\KOMAoptions{mpinclude}
 	\savegeometry{TUDa@marginpar}
+
 	\bool_if:NTF  \g_TUDa_marginpar_bool {
 		\loadgeometry{TUDa@marginpar}
-		\tl_const:Nn \c_TUDa_default_geometry_tl {TUDa@marginpar}
 	}  {
 		\loadgeometry{TUDa@nomarginpar}
-		\tl_const:Nn \c_TUDa_default_geometry_tl {TUDa@nomarginpar}
 	}
 
+	\bool_if:NTF \g_TUDa_custommargins_bool {
+		\AtBeginDocument{\savegeometry{TUDa@default}} 
+		\tl_const:Nn \c_TUDa_default_geometry_tl {TUDa@default}
+	}{
+		\bool_if:NTF  \g_TUDa_marginpar_bool {
+			\tl_const:Nn \c_TUDa_default_geometry_tl {TUDa@marginpar}
+		}  {
+			\tl_const:Nn \c_TUDa_default_geometry_tl {TUDa@nomarginpar}
+		}
+	}
 
 	\dim_gset:Nn \g_TUDa_headwidth_dim 			  {\paperwidth-\g_TUDa_innerMargin_dim-\g_TUDa_outerMargin_dim-\Gm@bindingoffset}
 	
 	\cs_set:Nn \TUDa_disable_marginpar: {\loadgeometry{TUDa@nomarginpar}}
 	\cs_set:Nn \TUDa_restore_typearea: {\loadgeometry{\c_TUDa_default_geometry_tl}}
 
+}{
+\bool_if:NTF \g_TUDa_geometry_bool {
+	\RequirePackage[top=\g_TUDa_topMargin_dim, inner=\g_TUDa_innerMargin_dim, outer=\dim_eval:n {\g_TUDa_outerMargin_dim}, bottom=\g_TUDa_bottomMargin_dim, columnsep= \g_TUDa_columnSep_dim, includehead, includefoot,includemp, nomarginpar, headheight=\g_TUDa_headheight_dim
+	]{geometry}
+	
+	
+	\savegeometry{TUDa@nomarginpar}
+	\cs_set:Nn \TUDa_disable_marginpar: {\loadgeometry{TUDa@nomarginpar}}
+}{
+	\KOMAoptions{headinclude, footinclude, headwidth=text,footwidth=text}
+	\let\TUDa_disable_marginpar:\relax
+	\def\TUDa_restore_typearea:{
+		\KOMAoptions{headinclude, footinclude, headwidth=text,footwidth=text}\recalctypearea
+	}
+}
+%maybe enforce marginar?=false in that case 
 }
 
 
@@ -344,15 +383,15 @@
 %%%%%%%%
 %Ende Randeinstellungen klassisch
 
-\usepackage[draft=false]{scrlayer-scrpage}
+
 
 
 \newcommand*{\institution}[1]{
 	\def\TUDa@institution{#1}
 }
 
-\gdef\datename{Datum}
-\gdef\dateseparator{:~}
+\gdef\TUDa@datename{Datum}
+\gdef\TUDa@dateseparator{:~}
 
 
 
@@ -388,12 +427,12 @@
 \newpairofpagestyles[scrheadings]{TUDa.headings}{
 	\KOMAoptions{headsepline, headlines=1.25, footlines=1.25}
 	\setkomafont{pagehead}{}
+	\chead{}
 	\ohead{\headmark}
 }
 
 \newpairofpagestyles{TUDa}{
-	\KOMAoptions{
-		plainfootsepline}
+	\KOMAoptions{plainfootsepline}
 	
 	\bool_if:NTF \g_TUDa_marginpar_bool 
 		{
@@ -420,10 +459,17 @@
 	\fi
 	\ModifyLayer[
 		background,
-		contents={\smash{\TUDa@headline}}
+		mode=picture,
+		contents={
+			\dim_compare:nF {\box_wd:N \TUDa@headline_box=\layerwidth} {
+				\TUDa@makeheadrule*[color=identbarcolor, width=\layerwidth]{TUDa@headline}
+			}
+			\smash{\TUDa@headline}
+		}
 	]{TUDa.head.above.line}	
 	\ModifyLayer[
 		background,
+		mode=picture,
 		contents={\smash{\TUDa@headline}}
 	]{plain.TUDa.head.above.line}
 	\bool_if:NT \g_TUDa_headline_bool {
@@ -744,7 +790,7 @@
 	%paper=a5
 	{6} {
 		\cs_set:Nn \TUDa_title_fontsize: {{22pt}{28pt}}
-		\cs_set:Nn \TUDa_titleinfo_fontsize: {{11pt}{12pt}}
+		\cs_set:Nn \TUDa_titleinfo_fontsize: {{10pt}{11.5pt}}
 		\cs_set:Nn \TUDa_titlethanks_fontsize: {{10pt}{11.5pt}}
 	}
 	%paper=a6
@@ -834,7 +880,6 @@
 contents={\color{identbarcolor}\rule{\layerwidth}{\layerheight}}
 ]{title.TUDa.background}
 
-
 \DeclareNewLayer[
 	mode=picture,
 	align=tl,
@@ -842,12 +887,17 @@ contents={\color{identbarcolor}\rule{\layerwidth}{\layerheight}}
 	voffset=\coverpagetopmargin,
 	width=\paperwidth-\coverpageleftmargin-\coverpagerightmargin,
 	contents={
-		\box_if_exist:NF \TUDa@title_headline_box
-		{\TUDa@makeheadrule[color=identbarcolor, width=\layerwidth]{TUDa@title_headline}}
+%		\box_if_exist:NF \TUDa@title_headline_box
+%		{}
+		\dim_compare:nF {\box_wd:N \TUDa@title_headline_box=\layerwidth} {
+			\TUDa@makeheadrule*[color=identbarcolor, width=\layerwidth]{TUDa@title_headline}
+		}
 		\putUL{\TUDa@title_headline}
 	}
 ]{title.TUDa.rule}
 
+\TUDa@makeheadrule[color=identbarcolor, width=\textwidth]{TUDa@title_headline}
+
 \cs_new:Nn \TUDa_Setup_Title_box: {
 	\hbox_gset:Nn \g_TUDa_title_info_box
 	{
@@ -865,9 +915,9 @@ contents={\color{identbarcolor}\rule{\layerwidth}{\layerheight}}
 \if_bool:N \g_TUDa@pdfa_bool
 
 	\msg_new:nnn {TUDaPub} {prefer-lualatex} {
-	You use pdfa-mode in #1.
-	This can lead to incompatiblities especially with older compiler versions.
-	You should prefer compiling using lualatex.
+	You~use~pdfa-mode~in~#1.\\
+	This~can~lead~to~incompatiblities~especially~with~older~compiler~versions.\\
+	You~should~prefer~using~lualatex.
 	}
 
 
-- 
cgit v1.2.3

