From 0ca6814ec2c669f8aafd54d0b13fe36c3ce81410 Mon Sep 17 00:00:00 2001
From: Rolf Niepraschk <Rolf.Niepraschk@ptb.de>
Date: Mon, 25 Apr 2022 12:48:46 +0200
Subject: [PATCH] mehr Kommentare, Vereinfachungen

---
 kalibrierschein.cls | 59 ++++++++++-----------------------------------
 ks-common.clo       | 11 ++++-----
 2 files changed, 18 insertions(+), 52 deletions(-)

diff --git a/kalibrierschein.cls b/kalibrierschein.cls
index e1b076b..e18e521 100644
--- a/kalibrierschein.cls
+++ b/kalibrierschein.cls
@@ -9,7 +9,7 @@
 \newif\ifnoCMC \noCMCfalse
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesClass{kalibrierschein}
-  [2021/06/11 v0.6d documentclass PTB `Kalibrierschein' (RN/PTB)]
+  [2022/04/25 v0.6d documentclass PTB `Kalibrierschein' (RN/PTB)]
 \DeclareOption{BS}{\def\ks@location{Braunschweig}}
 \DeclareOption{BLN}{\def\ks@location{Berlin}}
 \DeclareOption{KK}{\edef\ks@kalType{\CurrentOption}}
@@ -47,7 +47,7 @@ footskip=0bp,
 
 \raggedbottom % ???
 
-%\RequirePackage{showframe}
+%\RequirePackage{showframe}% Zur Orientierung
 
 \RequirePackage[\ks@langs]{babel}
 \RequirePackage[autostyle=true,german=quotes,maxlevel=3]{csquotes}%
@@ -57,11 +57,7 @@ footskip=0bp,
   \defineshorthand{"`}{\openautoquote}
   \defineshorthand{"'}{\closeautoquote}
   %-------------------------------------------------------
-  \RequirePackage{hyphsubst}% Trennregeln austauschen
-  \HyphSubstIfExists{ngerman-x-latest}{%
-    \HyphSubstLet{ngerman}{ngerman-x-latest}}{}
-  %%%\babelprovide[hyphenrules=ngerman-x-latest]{ngerman}
-  % TODO: aktivieren, wenn funktionstüchtig
+  \babelprovide[hyphenrules=ngerman-x-latest]{ngerman}
   %-------------------------------------------------------
 }{%
   \newcommand*\ks@draftName{Draft}%
@@ -72,12 +68,14 @@ footskip=0bp,
 \AtEndOfClass{\shorthandon{"}}
 \MakeAutoQuote{»}{«}
 \AtEndOfClass{%
-  \@ifpackageloaded{inputenc}{}{%
+  \@ifpackageloaded{inputenc}{}{% TODO: Entfernen, da nur noch LuaTeX/XeTeX
     \catcode`\»=\active
     \catcode`\«=\active
   }%
 }
 
+% Anpassen der Schriftbefehle
+
 % nach scrsize11pt.clo
 \def\normalsize{%
   \@setfontsize\normalsize{11.2}{12.85}%
@@ -91,21 +89,6 @@ footskip=0bp,
 \def\huge{\@setfontsize\huge{20.26}{25.3}}
 \def\large{\@setfontsize\large{12.17}{14.2}}
 \def\tiny{\@setfontsize\tiny\@viipt\@viiipt}
-
-\iffalse
-% nach scrsize11pt.clo (dort \small)
-\newcommand*\ks@titelpagefont{%
-  \@setfontsize\small\@ixpt{11}%
-  \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
-  \abovedisplayshortskip \z@ \@plus2\p@
-  \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
-  \def\@listi{\leftmargin\leftmargini
-    \topsep 4\p@ \@plus2\p@ \@minus2\p@
-    \parsep 2\p@ \@plus\p@ \@minus\p@
-    \itemsep \parsep}%
-  \belowdisplayskip \abovedisplayskip
-}
-\fi
 \let\ks@titelpagefont=\normalsize
 
 \RequirePackage{textcomp}% ???
@@ -115,30 +98,16 @@ footskip=0bp,
 \PassOptionsToPackage{final}{graphicx}
 \RequirePackage{eso-pic,graphicx,booktabs}
 \RequirePackage{zref-totpages}
-
-\newif\ifXeOrLua \XeOrLuafalse
-\RequirePackage{ifxetex,ifluatex,ifpdf}
-
-\ifxetex% XeTeX
-  \XeOrLuatrue
-\else
-  \ifluatex% LuaTeX
-    \XeOrLuatrue
-  \else
-    \ifpdf% pdfTeX
-    \else% TeX+dvips
-    \fi
-  \fi
-\fi
-
+\RequirePackage{iftex}
 \RequirePackage{amsmath}
 
-\ifXeOrLua% XeLaTeX oder luaLaTeX
+\iftutex% XeLaTeX oder luaLaTeX
   \input{ks-new-engines.clo}
 \else
-  \input{ks-old-engines.clo}
+  \input{ks-old-engines.clo}% obsolet!
 \fi
 
+% Listenabstände reduzieren
 \RequirePackage[neverdecrease]{paralist}
 \let\itemize\compactitem
 \let\enditemize\endcompactitem
@@ -152,7 +121,7 @@ footskip=0bp,
 \newcommand*\ks@PTB{Physikalisch-Technische Bundesanstalt}
 \newcommand*\ks@BSuB{Braunschweig und Berlin}
 
-\RequirePackage{picture}% noch nötig?
+\RequirePackage{picture}% TODO: noch nötig?
 
 \newdimen\ks@tempdima
 \newdimen\ks@tempdimb
@@ -215,14 +184,12 @@ footskip=0bp,
   \endgroup
 }
 
-%\RequirePackage[manualmark]{scrpage2}
 \RequirePackage[manualmark,draft=false]{scrlayer-scrpage}
 \clearpairofpagestyles
 \lohead{\ks@head}
 \lofoot{\ks@foot}
 
-\definecolor{PTBcolor}{RGB}{0,155,206}
-
+\definecolor{PTBcolor}{RGB}{0,155,206}% TODO: Besser CMYK?
 
 \input{ks-common.clo}% Titelseiten- und Layout-Definition
 \input{\ks@kalType\ks@layout.clo}% Titelseiten- und Layout-Definition
@@ -323,7 +290,7 @@ footskip=0bp,
 
 \newcommand*\printFirstPage{%
   \thispagestyle{empty}%
-  \AddToShipoutPicture*{\ks@printFirstPage}%
+  \AddToShipoutPictureBG*{\ks@printFirstPage}%
   \mbox{}\clearpage
   \global\let\ks@printFirstPage\@empty
   \global\let\printFirstPage\@empty
diff --git a/ks-common.clo b/ks-common.clo
index 2ba7311..2d0a04e 100644
--- a/ks-common.clo
+++ b/ks-common.clo
@@ -1,8 +1,9 @@
 
-\ProvidesFile{ks-common.clo}[2022/02/21 v1.0h class option (RN/PTB)]
+\ProvidesFile{ks-common.clo}[2022/04/25 v1.0h class option (RN/PTB)]
 
 %%% Definitionen, die ab 2019 gültig sind.
 
+% Wird per \AddToShipoutPicture absolut auf der Seite positioniert.
 \newcommand*\ks@printFirstPage{%
   \unitlength=1bp %
   \AtPageLowerLeft{%
@@ -194,10 +195,10 @@
     \vspace{1.6\baselineskip}
   \endgroup
   \fi
-   
-  \itshape
 
-  \begin{otherlanguage}{english}
+  \begin{otherlanguage}{english} 
+  
+  \itshape
 
   \textbf{\Large The Physikalisch-Technische Bundesanstalt} (PTB) in
   Braunschweig and Berlin is the National Metrology Institute and the
@@ -236,7 +237,6 @@
   
   \fi
  
-
   \end{otherlanguage}
 
   \vfill
@@ -264,7 +264,6 @@
   \begin{picture}(0,0)
     \unitlength=1bp %
     \normalfont
-    %%\put(0,-25){\includegraphics[width=304bp]{ks-footline.png}}%
     \put(-1,-55){\normalfont\footnotesize
       \resizebox{303bp}{!}{%
         \textcolor{PTBcolor}{PTB}~|~Physikalisch-Technische 
-- 
GitLab