-
Rolf Niepraschk authoredRolf Niepraschk authored
kalibrierschein.cls 11.47 KiB
\setcounter{errorcontextlines}{100}
\newcommand*\ks@location{Berlin}
\newcommand*\ks@kalType{KK}
\newcommand*\ks@layout{-0000}
\newcommand*\ks@langs{ngerman,main=english}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{kalibrierschein}
[2015/12/10 v0.2b Dokumentenklasse (RN/PTB)]
\DeclareOption{BS}{\def\ks@location{Braunschweig}}
\DeclareOption{BLN}{\def\ks@location{Berlin}}
\DeclareOption{KK}{\edef\ks@kalType{\CurrentOption}}
\DeclareOption{IK}{\edef\ks@kalType{\CurrentOption}}
\DeclareOption{2015}{\edef\ks@layout{-\CurrentOption}}
\DeclareOption{german}{\def\ks@langs{english,main=ngerman}}
\DeclareOption{ngerman}{\def\ks@langs{english,main=ngerman}}
\DeclareOption{de}{\def\ks@langs{english,main=ngerman}}
\DeclareOption{english}{\def\ks@langs{ngerman,main=english}}
\DeclareOption{en}{\def\ks@langs{ngerman,main=english}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\PassOptionsToPackage{paper=a4,pagesize,twoside=false,headinclude}{typearea}
% Wegen bug in fontspec v2.4a
%\RequirePackage{fixltx2e}
\LoadClass[%
,fontsize=11pt
,headings=small
,numbers=enddot
,parskip=half
]{scrartcl}
%\RequirePackage{showframe}
\RequirePackage[\ks@langs]{babel}
\RequirePackage{iflang}
\RequirePackage[autostyle=true,german=guillemets,maxlevel=3]{csquotes}%
\IfLanguageName{ngerman}{%
\typeout{ngerman}
\AtEndOfClass{\shorthandon{"}}
\defineshorthand{"`}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}
\AtBeginDocument{\sisetup{locale=DE}}
}{%
\typeout{english}
\AtBeginDocument{\sisetup{locale=UK}}
}
\MakeAutoQuote{»}{«}
\AtEndOfClass{%
\@ifpackageloaded{inputenc}{}{%
\catcode`\»=\active
\catcode`\«=\active
}%
}
\def\huge{\@setfontsize\huge{20.26}{25.3}}
\def\large{\@setfontsize\large{12.17}{14.2}}
\def\tiny{\@setfontsize\tiny\@viipt\@viiipt}
\raggedbottom% ???
\RequirePackage{textcomp}
%%%\RequirePackage[standard-baselineskips]{cmbright}
%%%\RequirePackage[math]{iwona}
%%%\RequirePackage[math]{kurier}
%%%\RequirePackage{lxfonts}
% 1 %\RequirePackage{arevmath}
%\let\celsius=\relax \let\ohm=\relax
%\RequirePackage{gensymb}
%%%\RequirePackage[T1,small]{eulervm}
%%%\RequirePackage{ziffer}
\RequirePackage{tabularx}
\let\ks@TX@endtabularx=\TX@endtabularx
\newcommand*\origTabularx{%
\let\TX@endtabularx=\ks@TX@endtabularx
}
\RequirePackage{ltablex}\keepXColumns{}
\setcounter{LTchunksize}{100}
\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{amsmath}
\ifXeOrLua% XeLaTeX oder luaLaTeX
\typeout{#### XeLaTeX oder luaLaTeX}
%\RequirePackage[no-math]{fontspec}
\RequirePackage{unicode-math}
\setmainfont{texgyreheros}[
Ligatures=TeX,
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic.otf]
\setsansfont{texgyreheros}[
Ligatures=TeX,
Extension=.otf,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic.otf]
\setmathfont{Asana-Math.otf}[math-style=ISO,bold-style=ISO]% damit sind Einheiten kursiv
\setmathfont{texgyreheros-regular.otf}[range=\mathup,Scale=MatchLowercase]
\setmathfont{texgyreheros-italic.otf}[range=\mathit,Scale=MatchLowercase]
\setmathfont{texgyreheros-bold.otf}[range=\mathbfup,Scale=MatchLowercase]
\setmathfont{texgyreheros-bolditalic.otf}[range=\mathbfit,Scale=MatchLowercase]
\setmathfont{texgyreheros-regular.otf}[range=\mathsfup,Scale=MatchLowercase]
\setmathfont{texgyreheros-italic.otf}[range=\mathsfit,Scale=MatchLowercase]
\setmathfont{texgyreheros-bold.otf}[range=\mathbfsfup,Scale=MatchLowercase]
\setmathfont{texgyreheros-bolditalic.otf}[range=\mathbfsfit,Scale=MatchLowercase]
\setmathfont{texgyreheros-regular.otf}[range=\mathpunct]
\setmathfont{Asana-Math.otf}[range=\int]
% (Ulrike): )als letztes immer einen
% richtiger Mathfont, damit diverse Werte korrekt gesetzt werden.
% Wirklich nötig?
\RequirePackage{newunicodechar}
\newunicodechar{^^^^202f}{\,}% 'NARROW NO-BREAK SPACE' (\u202F, 8239)
\newunicodechar{^^^^2009}{\,\hspace{0pt}}% 'THIN SPACE'
\newunicodechar{^^^^00ad}{\-}% 'SOFT HYPHEN'
\newunicodechar{^^^^2207}{{\setmathfont{Asana Math}^^^^2207}}% 'NABLA'
%%% TODO: ^^^^ unschädlich machen für pdflatex
\else
\typeout{#### pdfLaTeX}
\RequirePackage{fix-cm}% ???
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\DeclareUnicodeCharacter{202F}{\,}
\DeclareUnicodeCharacter{2009}{\,\hspace{0pt}}
\DeclareUnicodeCharacter{22C5}{\cdot}
\DeclareUnicodeCharacter{03B8}{\theta}
\RequirePackage[scale=1]{tgheros}
%%%\RequirePackage[scaled=1]{helvet}
\renewcommand*\familydefault{\sfdefault}
%%%\newcommand*\mathfamilydefault{\familydefault}
%%\newcommand*\math@sfdefault{\sfdefault}
\RequirePackage{sfmath}
\fi
%%%\RequirePackage{babel}
%\RequirePackage{gensymb} %% ???
%\let\ks@celsius=\celsius
%\let\celsius=\relax
%\let\ohm=\relax
%\RequirePackage{siunitx}
%\let\celsius=\ks@celsius
\iffalse
\AtBeginDocument{%
\RequirePackage[babel=once,german=guillemets]{csquotes}
\defineshorthand{"`}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}
}
\fi
\RequirePackage[neverdecrease]{paralist}
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\enumerate\compactenum
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=\smallskipamount
\newcommand*\ks@PTB{Physikalisch-Technische Bundesanstalt}
\newcommand*\ks@BSuB{Braunschweig und Berlin}
\RequirePackage{picture}
\RequirePackage[manualmark]{scrpage2}
\let\@tempdimd=\@clnwd
\let\@tempdime=\@clnht
\let\@tempdimf=\@dashdim
\newcommand*\ks@tempa{}
\newcommand*\ks@tempb{}
\newcommand*\ks@tempc{}
\newcommand*\ks@tempd{}
\newcommand*\ks@tempe{}
\newtoks\ks@tab
\newcommand*\ks@colSpec{}
\newcommand*\ks@add[1]{%
\ks@tab\expandafter{\the\ks@tab#1}%
}
\newcommand*\ks@addTabLine[1]{%
\def\@tempc{}%
\@for\@tempa:=#1\do{%
\edef\@tempb{\the\ks@tab\@tempc\@tempa}%
\ks@tab\expandafter{\@tempb}%
\def\@tempc{&}%
}%
}
\newcommand*\ks@getColSpec[2]{%
\let#2=\@empty
\@for\@tempa:=#1\do{%
\edef#2{#2l}%
}%
\ifx\ks@colSpec\@empty
\def#2{l}%
\fi
}
\newcommand*\ks@printDevicesTable[3]{% #1 = width, #2 = 1. offset, #3 = 2. offset
\ks@tab{}%
\ks@getColSpec{\ks@type}{\ks@colSpec}%
\edef\@tempa{\noexpand\begin{tabularx}{#1}[t]{@{}\ks@colSpec @{}}}%
\ks@tab\expandafter{\@tempa}%
\ks@addTabLine{\ks@manufacturer}%
\ks@add{\tabularnewline[#2]}%
\ks@addTabLine{\ks@type}%
\ks@add{\tabularnewline[#3]}%
\ks@addTabLine{\ks@serialNo}%
\ks@add{\end{tabularx}}%
\begingroup
\tabcolsep=1em %
\origTabularx
\the\ks@tab
\endgroup
}
\defpagestyle{headings}%
{% Kopf
%(OLL,OLD)% Linie
{\pagemark\hfill}% Gerade Seiten
{\hfill\pagemark}% Ungerade Seiten
{% Einseitig
\ks@head
}
%(\textwidth,.8pt)% Linie
}%
{% Fuss
%(OLL,OLD)% Linie
{}% Gerade Seiten
{}% Ungerade Seiten
{% Einseitig
\ks@foot
}
%(ULL,ULD)% Linie
}
\newcommand*\ks@foot{}
\input{\ks@kalType\ks@layout.clo}% Titelseiten- und Layout-Definition
\RequirePackage{trimspaces}
\newcommand*\ks@type{%
Typ des Ger\"ates}
\newcommand*\type[1]{\xdef\ks@type{\trim@spaces{#1}}}
\newcommand*\ks@manufacturer{Namen der Hersteller}
\newcommand*\manufacturer[1]{%
\xdef\ks@manufacturer{\trim@spaces{\detokenize{#1}}}%
}
\newcommand*\ks@object{%
Name des Ger\"ates, kurze Charakterisierung}
\newcommand*\object[1]{\xdef\ks@object{\trim@spaces{#1}}}
\newcommand*\ks@applicant{%
Name des Auftraggebers, Stra\ss e, Firmensitz}
\newcommand*\applicant[1]{\long\gdef\ks@applicant{#1}}
\newcommand*\ks@serialNo{XXX,YYY}
\newcommand*\serialNo[1]{%
\xdef\ks@serialNo{\trim@spaces{\detokenize{#1}}}%
}
\newcommand*\ks@refNo{YYY-ZZZZZZZZ}
\newcommand*\refNo[1]{\xdef\ks@refNo{\trim@spaces{#1}}}
\newcommand*\ks@calibMark{YYY-XXXXXXX}
\newcommand*\calibMark[1]{\xdef\ks@calibMark{\trim@spaces{#1}}}
\newcommand*\ks@referenceMark{YYY-XXXXXXX}
\newcommand*\referenceMark[1]{\xdef\ks@referenceMark{\trim@spaces{#1}}}
\newcommand*\ks@calibDate{????-??-??}
\newcommand*\calibDate[1]{\xdef\ks@calibDate{\trim@spaces{#1}}}
\newcommand*\ks@certificateDate{????-??-??}
\newcommand*\certificateDate[1]{\xdef\ks@certificateDate{\trim@spaces{#1}}}
\newcommand*\ks@byOrder{Peter Silie}
\newcommand*\byOrder[1]{\xdef\ks@byOrder{\trim@spaces{#1}}}
\newcommand*\ks@examiner{Ellen Bogen}
\newcommand*\examiner[1]{\xdef\ks@examiner{\trim@spaces{#1}}}
\newcommand*\ks@missingEntries{1}
\newcommand*\missingEntries[1]{\xdef\ks@missingEntries{\trim@spaces{#1}}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\RequirePackage{siunitx-PTB}
\let\ke@orig@SI=\SI
\renewcommand*\SI[2][]{% tolerant gegenüber "?" statt Zahl
\def\ks@tempa{#1}%
\edef\ks@tempb{\trim@spaces{#2}}%
\ks@SI@i
}
\newcommand*\ks@SI@i[2][]{%
\def\ks@tempc{?}%
\ifx\ks@tempb\ks@tempc
\ensuremath{\textbf{??}}\,\si[#1]{#2}%
\else
\edef\ks@tempe{\noexpand\ke@orig@SI[\ks@tempa]{\ks@tempb}[#1]{#2}}%
\ks@tempe
\fi
}
\let\ke@orig@num=\num
\renewcommand*\num[1]{% tolerant gegenüber "?" statt Zahl
\edef\ks@tempb{\trim@spaces{#1}}%
\def\ks@tempc{?}%
\ifx\ks@tempb\ks@tempc
\ensuremath{\textbf{??}}%
\else
\ke@orig@num{#1}%
\fi
}
\newcommand\resultTable[3][]{%
\@tempcnta=#2 %
\@tempcntb=\numexpr(\@tempcnta-1)*2 %
\@tempdimc=\dimexpr (\textwidth - \@tempcntb\tabcolsep) / \@tempcnta %
\@tempcntb=\@tempcnta
\def\@tempa{}%
\loop\ifnum\@tempcnta>\z@
\edef\@tempa{\@tempa S[table-column-width=\the\@tempdimc]}%
\advance\@tempcnta\m@ne
\repeat
\edef\@tempa{\noexpand\begin{longtable}{@{}\@tempa @{}}}%
\expandafter\ks@add\expandafter{\@tempa}%
\ks@add{\\\toprule}%
\ifx\relax#1\relax\else
\ks@add{\multicolumn{\the\@tempcntb}{@{}c@{}}{#1}\\\toprule}%
\fi
\ks@add{#3}%
\ks@add{\bottomrule\end{longtable}}%
}
\newcommand*\printFirstPage{%
\thispagestyle{empty}%
\AddToShipoutPicture*{\ks@printFirstPage}%
\mbox{}\clearpage
\global\let\ks@printFirstPage\@empty
\global\let\printFirstPage\@empty
}
\newcommand*\printLastPage{%
\clearpage
\global\let\ks@foot=\ks@@foot
\ks@lastPage
}
\newcommand*\printResultTable{%
\the\ks@tab
}
\newcommand*\ks@applicant@table{%
\begingroup
\begin{tabular}[t]{@{}l@{}}%
\expandafter\@tfor\expandafter\reserved@b\expandafter
:\expandafter=\ks@applicant\do{%
\ignorespaces\reserved@b\\[.3ex]%
}%
\end{tabular}%
\endgroup
}
\AtBeginDocument{%
\ifnum\number\ks@missingEntries>0 %
\AddToShipoutPictureBG{%
\AtTextCenter{%
\makebox(0,0)[c]{\resizebox{\textwidth}{!}{%
\rotatebox{54.7}{%
\textnormal{\textsf{\textbf{%
\color{lightgray}Fehler:~\ks@missingEntries}}}}}}%
}%
}%
\fi
}
\RequirePackage[
% factor=1500
% ,verbose=true
,final=true
% ,letterspace=100
,babel=true
]{microtype}
\emergencystretch=1em %
\pagestyle{headings}
\renewcommand\section{%
\@startsection{section}% name
{1}% level
{\z@}% indent
{-3ex \@plus -.5ex \@minus -.2ex}% beforeskip (abs.!)
{.6ex \@plus.2ex}% afterskip
{\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak\size@section}%
}
\endinput
%%
%% End of file `kailbrierschein.cls'.
sudo cp $(kpsewhich --var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
sudo fc-cache -fsv
mkluatexfontdb --force --verbose=-1 -vvv