<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% Rolf Niepraschk, Rolf.Niepraschk@ptb.de

\setcounter{errorcontextlines}{100}  \listfiles

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ptbletter}[2018/01/10 v0.2d PTB-Brief-Klasse (RN)]

\let\ptb@tempdima=\@ovxx
\let\ptb@tempdimb=\@ovyy
\let\ptb@tempdimc=\@ovdx
\let\ptb@tempdimd=\@clnwd
\let\ptb@tempdime=\@clnht
\let\ptb@tempdimf=\@dashdim

\newif\ifptb@BLN \ptb@BLNtrue
\newif\ifptb@serif \ptb@seriftrue

\newcommand*\ptb@lang{main=ngerman}
\newcommand*\ptb@tempa{}
\newcommand*\ptb@tempb{}

\DeclareOption{german}{\def\ptb@lang{main=ngerman}}
\DeclareOption{ngerman}{\def\ptb@lang{main=ngerman}}
\DeclareOption{de}{\def\ptb@lang{main=ngerman}}
\DeclareOption{english}{\def\ptb@lang{main=english}}
\DeclareOption{en}{\def\ptb@lang{main=english}}
\DeclareOption{BS}{\ptb@BLNfalse}
\DeclareOption{BLN}{\ptb@BLNtrue}
\DeclareOption{sanserif}{\ptb@seriffalse}
\DeclareOption{serif}{\ptb@seriftrue}

\DeclareOption{visualize}{%
  \PassOptionsToClass{\CurrentOption}{scrlttr2}
  \AtEndOfClass{%
    \showfields{head,address,location,refline,foot}%
    %\showfields{refline}%
    \addtokomafont{field}{\color{lightgray}}%
    \setshowstyle{rule}%
    %\setshowstyle{edges}%
    %\setshowstyle{frame}% default
  }
}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrlttr2}}

\ExecuteOptions{pagesize}
\ProcessOptions\relax

\LoadClass[%
,fontsize=11pt
,DINmtext
,backaddress=plain
,refline=nodate
,enlargefirstpage
,pagenumber=no
,parskip=never
]{scrlttr2}

% Texbreite beibehalten, linken Rand anpassen
\oddsidemargin=0.0pt %
\evensidemargin=34.7124pt %
\raggedbottom

\RequirePackage{hyphsubst}% Trennregeln austauschen
\HyphSubstIfExists{ngerman-x-latest}{%
  \HyphSubstLet{ngerman}{ngerman-x-latest}}{}
\HyphSubstIfExists{german-x-latest}{%
  \HyphSubstLet{german}{german-x-latest}}{}

\RequirePackage{ifxetex,ifluatex,url,array,tabularx}
\newif\ifXeOrLua \XeOrLuafalse
\ifxetex\XeOrLuatrue\else\ifluatex\XeOrLuatrue\fi\fi

\RequirePackage[right]{eurosym}

\ifXeOrLua% XeLaTeX oder luaLaTeX
  \input{ptbletter-new-engines.clo}
\else
  \input{ptbletter-old-engines.clo}
\fi

\def\tiny{\@setfontsize\tiny{7}{8.17}}

\ifptb@serif 
  \renewcommand*\familydefault{\rmdefault}
\else
  \renewcommand*\familydefault{\sfdefault}
\fi

\let\texteuro=\officialeuro


%\RequirePackage{etoolbox}
%\preto\@classoptionslist{ngerman,}
% Ohne Sprachangabe "deutsch" verwenden. Bessere Lösung?

\RequirePackage[\ptb@lang]{babel}
\RequirePackage{etoolbox,iflang}
\AtEndPreamble{%
  \IfLanguageName{ngerman}{
    \RequirePackage[babel=once,german=guillemets]{csquotes}
  }{%
    \RequirePackage[babel=once]{csquotes}
    \useshorthands*{"}
  }
  \MakeAutoQuote{»}{«}
  \defineshorthand{"`}{\openautoquote}
  \defineshorthand{"'}{\closeautoquote}
}

%%%\AtEndOfClass{\shorthandon{"}}

\@setplength{toaddrhpos}{72bp}
\@setplength{toaddrvpos}{124bp}
%\@setplength{toaddrwidth}{85mm}

\@setplength{lochpos}{-354bp}% "-" --&gt; vom linken Blattand aus
\@setplength{locvpos}{146bp}%      --&gt; vom oberen Blattand aus
\@setplength{locwidth}{212bp}
\@setplength{locheight}{139bp}

%\@setplength{refaftervskip}{75bp}

%\@setplength{refhpos}{72bp}
\@setplength{refvpos}{304bp}
%\@setplength{refwidth}{40mm}
\@setplength{refaftervskip}{\z@}

\@setplength{firstheadhpos}{72bp}
\@setplength{firstheadvpos}{50bp}
\@setplength{firstheadwidth}{469bp}

\@setplength{firstfoothpos}{72bp}
\@setplength{firstfootvpos}{764bp}
\@setplength{firstfootwidth}{\useplength{firstheadwidth}}


\footskip= 30bp %

\@setplength{subjectaftervskip}{23bp}

%\@setplength{refvpos}{1sp}
%\@setplength{refhpos}{1sp}
%\@setplength{refwidth}{110bp}
\removereffields

\addtokomafont{addressee}{\sffamily}
\setkomafont{refname}{\sffamily\tiny}
\setkomafont{refvalue}{\normalfont\footnotesize}

\setkomavar{firsthead}{
  \begin{minipage}[b]{\linewidth}%
    \sffamily\bfseries\huge
    Physikalisch-Technische Bundesanstalt\\[3bp]
    %%%\large
    Braunschweig und Berlin\\
  \end{minipage}%
}

\setkomavar{location}{%
  \begingroup
  \extrarowheight=-1bp %
  \begin{tabular}%
    {@{}&gt;{\usekomafont{refname}}l&lt;{:}@{~\,}&gt;{\usekomafont{refvalue}}l@{}}
    \usekomavar*{yourref} &amp; \usekomavar{yourref}\\
    \usekomavar*{yourmail} &amp; \usekomavar{yourmail}\\
    \usekomavar*{myref} &amp; \usekomavar{myref}\\
    \usekomavar*{mymail} &amp; \usekomavar{mymail}\\
    \multicolumn{2}{@{}l@{}}{} \\
    \usekomavar*{handledby} &amp; \usekomavar{handledby}\\
    \usekomavar*{myphone} &amp; \usekomavar{myphone}\\
    \usekomavar*{myfax} &amp; \usekomavar{myfax}\\
    \usekomavar*{emailseparator} &amp; \usekomavar{fromemail}\\
    \multicolumn{2}{@{}l@{}}{} \\
    \usekomavar*{date} &amp; \usekomavar{date}
  \end{tabular}
  \endgroup
}

\setkomavar{firstfoot}{%  TODO: engl/dt
  \parbox{\useplength{firstfootwidth}}{%
    \sffamily\tiny
    \begin{tabular}{@{}l@{}}
      \iflanguage{ngerman}{Hausadresse, Lieferanschrift:}{Domicile:} \\
      \ifptb@BLN Abbestr. 2--12 \else Bundesallee 100 \fi \\
      \ifptb@BLN 10587 Berlin \else 38116 Braunschweig\fi \\
      \iflanguage{ngerman}{DEUTSCHLAND}{GERMANY} \\
    \end{tabular}%
    \hfill
    \begin{tabular}{@{}l@{~}l@{}}
      \usekomavar*{fromphone} &amp; \ifptb@BLN +49 30 3481-0 \else +49 531 592-0 \fi \\
      \usekomavar*{fromfax} &amp; \ifptb@BLN +49 30 3481-7490 \else +49 531 592-9292 \fi \\
      \usekomavar*{fromemail} &amp; \ifptb@BLN poststelle\_ib@ptb.de \else poststelle@ptb.de \fi \\
      Internet: &amp; http://www.ptb.de
    \end{tabular}%
    \hfill
    \begin{tabular}{@{}l@{~}l@{}}
      \multicolumn{2}{@{}l@{}}{Deutsche Bundesbank, Filiale Leipzig} \\
      IBAN: &amp; DE38 8600 0000 0086 0010 40 \\
      BIC: &amp; MARKDEF1860 \\
      VAT-Nr.:  &amp; DE 811 240 952
    \end{tabular}%
    \hfill
    \begin{tabular}{@{}l@{}}
      \ifptb@BLN PTB Braunschweig \else PTB Berlin-Charlottenburg \fi \\
      \ifptb@BLN Bundesallee 100 \else Abbestr. 2--12 \fi \\
      \ifptb@BLN 38116 Braunschweig \else 10587 Berlin \fi \\
      \iflanguage{ngerman}{DEUTSCHLAND}{GERMANY}
    \end{tabular}%
    \hfill \mbox{}
  }%
}

\setkomavar{backaddressseparator}{\,\,\textbullet\,\,}
\ifptb@BLN
  \setkomavar{backaddress}{PTB\\Abbestr. 2--12\\10587 Berlin}
\else
  \setkomavar{backaddress}{PTB\\Postfach 33 45\\38023 Braunschweig}
\fi

\newcommand*\ptb@setcommand[3][]{%  #1=default (opt.), #2=macro, #3=value
  \edef\ptb@tempa{\trim@spaces@noexp{#3}}%
  \expandafter\protected@edef\csname #2\endcsname{%
    \ifx\@empty\ptb@tempa #1\else\ptb@tempa\fi}%
}
\newcommand*\ptb@setkomavar[2]{%
  \ptb@setcommand{ptb@tempb}{#2}%
  \edef\ptb@tempa{\noexpand\setkomavar{#1}{\ptb@tempb}}%
  \ptb@tempa
}
\newcommand*\handledby[1]{\ptb@setkomavar{handledby}{#1}}
\newcommand*\myref[1]{\ptb@setkomavar{myref}{#1}}
\newcommand*\mymail[1]{\ptb@setkomavar{mymail}{#1}}
\newcommand*\myphone[1]{\ptb@setkomavar{myphone}{#1}}
\newcommand*\myfax[1]{\ptb@setkomavar{myfax}{#1}}
\newcommand*\myemail[1]{\ptb@setkomavar{fromemail}{#1}}

\newcommand*\yourref[1]{\ptb@setkomavar{yourref}{#1}}
\newcommand*\yourmail[1]{\ptb@setkomavar{yourmail}{#1}}

\newcommand*\backaddress[1]{\ptb@setkomavar{backaddress}{#1}}
\newcommand*\subject[1]{\setkomavar{subject}{#1}}
\renewcommand*\date[1]{\ptb@setkomavar{date}{#1}}

\newkomavar[\mymailname]{mymail}
\newkomavar[\myphonename]{myphone}
\newkomavar[\myfaxname]{myfax}
\newkomavar[\handledbyname]{handledby}

\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\yourrefname{Your reference}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\yourmailname{Your letter of}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\myrefname{My reference}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\mymailname{My letter of}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\myphonename{Telephone}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\myfaxname{Fax}%
%\defcaptionname{american,australian,british,canadian,%
%  english,newzealand,UKenglish,USenglish}\emailname{E-mail}%
\defcaptionname{american,australian,british,canadian,%
  english,newzealand,UKenglish,USenglish}\handledbyname{Handled by}%

\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\yourmailname{Ihre Nachricht vom}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\myrefname{Mein Zeichen}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\mymailname{Meine Nachricht vom}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\myphonename{Telefondurchwahl}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\myfaxname{Telefaxdurchwahl}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\handledbyname{Bearbeitet von}%
\defcaptionname{german,ngerman,austrian,naustrian,%
  swissgerman,nswissgerman}\enclname{Anlagen}%

\AtBeginDocument{%
  \ifxetex\else
    \RequirePackage[%
    ,factor=1500
    ,protrusion=true
    ,expansion=true
    ,verbose=true
    ,final=true
    ,letterspace=100
    ,babel=true
    ]{microtype}
  \fi
}
\RequirePackage{enumitem}
\setlist{leftmargin=*,nosep,topsep=.5em,itemsep=.25em}
\setlist[1]{labelindent=1em}

\iflanguage{ngerman}{%
  \newcommand*\MFG{Mit freundlichen Gr\"u\ss en}
  \newcommand*\MFg{Mit freundlichem Gru\ss}
  \newcommand*\MHG{Mit herzlichen Gr\"u\ss en}
}{%
  \newcommand*\MFG{Yours sincerely}
  \newcommand*\MFg{Sincerely}
  \newcommand*\MHG{With kind regards}
}
\endinput
</pre></body></html>