%
% TKSBRIEF.STY von Torsten-Karl Strempel am 11.10.1994
%    (in Anlehnung an HBRIEF.STY von Henrik Roes)
%
% ACHTUNG : Die Escape-Sequenzen fuer HP-kompatible-Drucker 
%           funktionieren nur fuer die entsprechenden Treiber
%
\typeout{}
\typeout{Document Style `TKSBRIEF' Version vom 11.10.1994}
\typeout{(in Anlehnung an HBRIEF.STY von Henrik Roes)}
\typeout{}
%
\newcounter{seite}
%
\def\firma{firma}
\def\altfirma{altfirma}
\def\thd{thd}
\def\privat{privat}
\def\zweit{zweit}
\def\Von{von}
\def\An{an}
\def\fm{fm}
\def\dinavierq{dinavierq}
\def\dinafuenf{dinafuenf}
\def\dinafuenfq{dinafuenfq}
\def\dinasechs{dinasechs}
\def\dinasechsq{dinasechsq}
\def\kassette{kassette}
\def\manuell{manuell}
%
\def\ps@headings{\def\@evenhead{} \def\@evenfoot{}
                 \def\@oddfoot{}
                 \def\@oddhead{\stepcounter{seite}
                               \sl\hfil Seite \arabic{seite}}}
\def\ps@theadings{\def\@evenhead{}
                  \def\@evenfoot{}
                  \def\@oddfoot{}
                  \def\@oddhead{\stepcounter{seite}
                                \sl\hfil Seite
                                \arabic{seite}}
                  \hrule}
\def\ps@firstpage{\setcounter{seite}{1}
                  \def\@evenhead{} \def\@evenfoot{}
                  \def\@oddhead{}
                  \ifx\ftest\fm
                      \def\@oddfoot{\begin{picture}(0,0)
                                    \put(0,0){\usebox{\faltbox}}
                                    \end{picture}
                                    \hfill}
                  \else
                      \def\@oddfoot{}
                  \fi}
%
\newsavebox{\vonbox}
\newsavebox{\anbox}
\newsavebox{\datumbox}
\newsavebox{\adrbox}
\newsavebox{\absbox}
\newsavebox{\faltbox}
%
% Mit dem Befehl \INCHWEG werden \voffset und \hoffset auf -1 inch gesetzt.
% Der Drucker NEC P6 beginnt dann im oberen linken Eck eines DIN-A4-Blattes
% zu drucken, falls dieses mit der linken Kante an der Marke A4 und
% mit der Oberkante am Strich in Hoehe des Druckkopfs eingespannt ist.
%
\newcommand{\ohnekopf}{\headheight0pt \headsep0pt}
\newcommand{\ohnefuss}{\footheight0pt \footskip0pt}
\newcommand{\inchweg}{\voffset=-1in \hoffset=-1in}
%
% ACHTUNG der Befehl darf nur am Anfang vor \begin{doc...} vorkommen !!!
%
% \setpage{linker Rand}{rechter Rand}{oberer Rand}{unterer Rand}{format}
%
%  Wenn beidseitig gedruckt wird, gelten die Angaben fuer die rechten
%  Seiten. Die linken Seiten werden spiegelbildlich dazu angelegt,
%  d.h. die Angaben fuer den linken und rechten Rand werden einfach
%  vertauscht.
%
%  Fuer format sind erlaubt :          x = DinA4 laengs (297 x 210mm default)
%                              dinavierq = DinA4 quer   (210 x 297mm)
%                              dinafuenf = DinA5 laengs (148 x 210mm)
%                             dinafuenfq = DinA5 quer   (210 x 148mm)
%                              dinasechs = DinA6 laengs (148 x 105mm)
%                             dinasechsq = DinA6 quer   (105 x 148mm)
%
% Da DinA4papier nicht im Querformat in normale A4-Drucker eingespannt werden
% kann, wird eine ESCAPE-Sequenz gesendet, die den Drucker veranlasst die
% Ausgabe intern um 90 Grad zu drehen (HP-Laserjet).
%
\newcommand{\setpage}[5]{\global\def\test{#5}
                         \textheight 297mm
                         \textwidth 210mm
                         \ifx\test\dinavierq
                           \typeout{Papierformat : DINA4 quer (210x297mm)}
                           \textheight 210mm
                           \textwidth 297mm
                           \special{file=/tex/hplandsc.esc}
                         \fi
                         \ifx\test\dinafuenf
                           \typeout{Papierformat : DINA5 (210x148mm)}
                           \textheight 210mm
                           \textwidth 148mm
                         \fi
                         \ifx\test\dinafuenfq
                           \typeout{Papierformat : DINA5 quer (148x210mm}
                           \textheight 148mm
                           \textwidth 210mm
                         \fi
                         \ifx\test\dinasechs
                           \typeout{Papierformat : DINA6 (147x104mm}
                           \textheight 147mm
                           \textwidth 104mm
                         \fi
                         \ifx\test\dinasechsq
                           \typeout{Papierformat : DINA6 quer (104x147mm}
                           \textheight 104mm
                           \textwidth 147mm
                         \fi
                         \oddsidemargin#1
                         \evensidemargin#2
                         \topmargin#3
                         \addtolength{\textwidth}{-#1}
                         \addtolength{\textwidth}{-#2}
                         \addtolength{\textheight}{-#3}
                         \addtolength{\textheight}{-#4}
                         \addtolength{\textheight}{-\headheight}
                         \addtolength{\textheight}{-\headsep}
                         \addtolength{\textheight}{-\footskip}
                         \clearpage}
%
% Auswahl der Papierquelle
%
\newcommand{\papersource}[1]{\clearpage\global\def\test{#1}
                         \ifx\test\manuell
                           \typeout{Papierquelle : Manuell}
                           \special{file=/tex/hpmanuel.esc}
                         \fi
                         \ifx\test\kassette
                           \typeout{Papierquelle : Kassette}
                           \special{file=/tex/hpkasset.esc}
                         \fi}
%
\newcommand{\hfilll}{\hspace*{\fill}}
\newcommand{\vfilll}{\vspace*{\fill}}
\newcommand{\heute}{\the\day .\space\the\month .\space\the\year}
\newcommand{\Heute}{\the\day .\space\ifcase\month\or Januar\or Februar
                    \or M\"arz\or April\or Mai\or Juni\or Juli\or August
                    \or September\or Oktober\or November\or Dezember\fi
                    \space\the\year}
\newcommand{\platz}[2]{\begin{figure}[#2]
                        \unitlength#1
                        \begin{picture}(0,1)
                        \end{picture}
                        \end{figure}}
\newcommand{\plz}[1]{\underline{\underline{\bf #1}}}
%
\newcommand{\llabel}[1]{{#1\hfill}}
\newcommand{\lblabel}[1]{{\bf #1\hfill}}
%
\newenvironment{llist}[1]{\begin{list}{#1}%
                         {\settowidth{\labelwidth}{#1}
                          \setlength{\leftmargin}{\labelwidth}
                          \addtolength{\leftmargin}{\labelsep}
                          \renewcommand{\makelabel}{\llabel}}}%
                         {\end{list}}
\newenvironment{lblist}[1]{\begin{list}{\bf #1}%
                          {\settowidth{\labelwidth}{\bf #1}
                           \setlength{\leftmargin}{\labelwidth}
                           \addtolength{\leftmargin}{\labelsep}
                           \renewcommand{\makelabel}{\lblabel}}}%
                          {\end{list}}
\newenvironment{einzeilig}{\par\renewcommand{\baselinestretch}{0.9}
                           \small\normalsize}{\par}
\newenvironment{eineinhalbzeilig}{\par\renewcommand{\baselinestretch}{1.2}
                                  \small\normalsize}{\par}
\newenvironment{texzeilig}{\par\renewcommand{\baselinestretch}{1}
                           \small\normalsize}{\par}
\newcommand{\faltmarken}{\global\def\ftest{fm}}
\newcommand{\ohnefaltmarken}{\global\def\|ftest{}}
\unitlength=1mm
\newcommand{\an}[2]{\savebox{\adrbox}(0,0){\put(0,0){\parbox{85mm}{#1}}}
                    \savebox{\anbox}
                      {\begin{picture}(0,0)
                         \put(0,0){\parbox[b]{85mm}{#1}}
                         \put(0,40){\parbox[b]{85mm}{\scriptsize#2}}
                       \end{picture}}
}
\newcommand{\AN}[2]{\savebox{\adrbox}(0,0){\put(0,0){\parbox{85mm}{#1}}}
                    \savebox{\anbox}
                      {\begin{picture}(0,0)
                         \put(0,0){\parbox[b]{85mm}{#1}}
                         \put(0,40){\parbox[b]{85mm}{\scriptsize#2}}
                         \put(-2,-2){\line(0,1){49}}
                         \put(87,-2){\line(0,1){49}}
                         \put(-2,-2){\line(1,0){89}}
                         \put(-2,47){\line(1,0){89}}
                       \end{picture}}
}
\savebox{\faltbox}{\begin{picture}(0,0)(20,-80)
                   \put(0,0){\line(1,0){2}}
                   \put(0,105){\line(1,0){2}}
                   \end{picture}}
\newcommand{\datum}[1]{\savebox{\datumbox}(0,0){\put(0,0)
                                               {\parbox[b]{\hsize}
                                                {\hfilll\hfill\hfill #1}}}}
\newcommand{\betreff}[1]{\par\medskip\smallskip
                         {#1}\par
                         \bigskip\bigskip}
\newcommand{\Betreff}[1]{\begin{llist}{Betreff :}
                         \item{#1}
                         \end{llist}
                         \bigskip\smallskip}
\newcommand{\betrifft}[1]{\begin{llist}{Betrifft :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\bestellung}[1]{\begin{llist}{Bestellung :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\quittung}[1]{\begin{llist}{Quittung :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\rechnung}[1]{\begin{llist}{Rechnung :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\lieferschein}[1]{\begin{llist}{Lieferschein :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\lieferung}[1]{\begin{llist}{Lieferung :}
                          \item{#1}
                          \end{llist}
                          \bigskip\smallskip}
\newcommand{\sgdh}{\par Sehr geehrte Damen und Herren,\par\bigskip\medskip}
\newcommand{\sgh}[1]{\par Sehr geehrter Herr {#1},\par\bigskip\medskip}
\newcommand{\sgf}[1]{\par Sehr geehrte Frau {#1},\par\bigskip\medskip}
\newcommand{\mfg}{\par\bigskip\medskip
                  Mit freundlichen Gr\"u{\ss}en\newline}
\newcommand{\mfgr}{\par\bigskip\medskip
                   \hfilll\hfill\hfill Mit freundlichen Gr\"u{\ss}en
                   \hfilll\newline}
\newcommand{\Mfgr}[1]{\par\bigskip\medskip
                      \hfilll\hfill\hfill Mit freundlichen Gr\"u{\ss}en
                      \hfilll\newline\begin{center}#1\end{center}}
\newcommand{\hav}{\par\bigskip\medskip
                  Hochachtungsvoll\newline}
\newcommand{\havl}{\par\bigskip\medskip
                   \hfilll\hfill\hfill Hochachtungsvoll
                   \hfilll\newline}
\newcommand{\Havl}[1]{\par\bigskip\medskip
                      \hfilll\hfill\hfill Hochachtungsvoll
                      \hfilll\newline\begin{center}#1\end{center}}
\newcommand{\ieg}{\par\bigskip\medskip
                  \hfilll\hfill\hfill In Empfang genommen von \rule{5cm}{1pt}
                  \hfilll\newline}
\newcommand{\we}{\par\bigskip\medskip
                 \hfilll\hfill\hfill Ware erhalten \rule{5cm}{1pt}
                 \hfilll\newline}
\newcommand{\be}{\par\bigskip\medskip
                 \hfilll\hfill\hfill Betrag erhalten \rule{5cm}{1pt}
                 \hfilll\newline}
\newcommand{\gez}[1]{\par\bigskip\medskip
                     gez. {#1}\newline}
\newcommand{\anlage}[1]{\par\vfill
                        {#1}\newline}
\newcommand{\Anlage}[1]{\par\vfill
                        Anlage : {#1}\newline}
\newcommand{\anlagen}[1]{\par\vfill
                         Anlagen :\newline
                         {#1}\newline}
\newcommand{\anlageN}{\par\vfill
                      Anlagen\newline}
\newcommand{\Anlagen}[1]{\vfill
                         \begin{llist}{Anlagen :}
                         \item{#1}
                         \end{llist}}
\newcommand{\briefkopf}{\newpage \thispagestyle{firstpage}
                        \begin{picture}(165,60)(0,-10)
                          \put(-5,66){\usebox{\vonbox}}
                          \put(-5,16){\usebox{\anbox}}
                          \put(0,-5){\usebox{\datumbox}}
                        \end{picture}
                        \newline}
\newcommand{\Ps}[1]{\vfill\begin{llist}{p.s. :\small }
                         \item{#1}
                         \end{llist}
                         \bigskip\smallskip}
\newcommand{\Pps}[1]{\vfill\begin{llist}{p.p.s. :\small }
                         \item{#1}
                         \end{llist}
                         \bigskip\smallskip}
\newcounter{Nr}
\newcommand{\nr}{\addtocounter{Nr}{1}\arabic{Nr}}
\newcommand{\Nr}{\addtocounter{Nr}{1}\fbox{\arabic{Nr}}}
%
% kleine Postkarte 13.9 x 8.9 cm
%
% \karte{Kartentext}{Absender und Datum}{Adresse}
%
\newcommand{\karte}[3]{\newpage \thispagestyle{plain}
  \begin{picture}(139,89)(25,-22)
    \put(0,80){\parbox[t]{55mm}{#1}}
    \put(70,80){\parbox[t]{35mm}{#2}}
    \put(70,47){\parbox[t]{65mm}{#3}}
    \put(15,0){\line(1,0){25}}
  \end{picture}}
%
% grosse Postkarte 14.7 x 10.4 cm
%
% \Karte{Kartentext}{Absender und Datum}{Adresse}
%
\newcommand{\Karte}[3]{\newpage \thispagestyle{plain}
  \begin{picture}(147,104)(20,-12)
    \put(0,95){\parbox[t]{65mm}{#1}}
    \put(80,95){\parbox[t]{35mm}{#2}}
    \put(80,45){\parbox[t]{60mm}{#3}}
    \put(20,0){\line(1,0){25}}
  \end{picture}}
%
% grosse Postkarte (Vordruck mit Briefmarke) 14.7 x 10.4 cm
%
% \postkarte{Absender}{Text1}{Adresse}
%
\newcommand{\postkarte}[4]{\newpage \thispagestyle{plain}
  \begin{picture}(147,104)(20,-12)
    \put( 0,94){\parbox[t]{65mm}{#1}}  % Absender
    \put( 0,50){\parbox[t]{65mm}{#2}}  % Text1 (unterm Absender)
    \put( 0, 5){\line(1,0){65}}        % Untere Grenze fuer Text1
    \put(80,60){\parbox[t]{60mm}{#3}}  % Adresse
  \end{picture}
  \newpage\thispagestyle{plain}
  \begin{picture}(147,104)(20,-32)
    \put( 0,94){\parbox[t]{137mm}{#4}} % Text2 (unterm Absender)
    \put( 0, 5){\line(1,0){137}}       % Untere Grenze fuer Text2
  \end{picture}}
%
% Verechnungsscheck 15.0 x 13.0 cm
%
% \scheck{Absender}{Empfaenger}{Betragzahl}{Betragwort}{Ort}{Datum}
%
\newcommand{\scheck}[6]{\newpage \thispagestyle{plain}
  \begin{picture}(150,130)(25,-32)
    \put( 20,122){\parbox[b]{125mm}{\scriptsize\bf #1}} % Absender auf Empfaengerbeleg
    \put( 20, 95){\parbox[b]{100mm}{#1}}         % Absender auf Scheck
    \put( 15, 50){\parbox[t]{80mm}{#2}}          % Empfaenger (Adressfeld)
    \put(115, 65){\parbox[b]{30mm}{\bf-~#3~-}}   % Betrag als Zahl
    \put(115,112){\parbox[b]{30mm}{\bf #3}}      % Betrag auf Empfaengerbeleg
    \put( 40, 65){\parbox[b]{55mm}{\bf-~#4~-}}   % Betrag in Worten
    \put(115, 53){\parbox[b]{30mm}{#5}}          % Unterzeichnungsort
    \put(115, 45){\parbox[b]{30mm}{#6}}          % Unterzeichnungsdatum
  \end{picture}}
%
\newcommand{\brieftext}{}
\newcommand{\brief}[1]{\renewcommand{\brieftext}{#1}}
%
% Beschriftung von DIN-C6-Umschlaegen
%
\newcommand{\umschlagc}[2]{\newpage \thispagestyle{plain}
                            \typeout{}
                            \typeout{Achtung: Seite (\thepage ) ist ein
                                     Briefumschlag! Anschlagstaerke!!!}
                            \typeout{}
                            \global\def\test{#1}
                            \ifx\test\Von
                                \relax
                            \else
                                \savebox{\absbox}(0,0)
                                        {\put(0,0){\parbox[t]{70mm}{#1}}}
                            \fi
                            \global\def\test{#2}
                            \ifx\test\An
                                \relax
                            \else
                                \savebox{\adrbox}(0,0)
                                        {\put(0,0){\parbox{80mm}{#2}}}
                            \fi
                            \begin{picture}(160,110)(25,-30)
                              \put(70,35){\usebox{\adrbox}}
                              \put(0,95){\usebox{\absbox}}
                            \end{picture}}
%
% Beschriftung von DL-Umschlaegen
%
\newcommand{\umschlagdl}[2]{\newpage \thispagestyle{plain}
                            \typeout{}
                            \typeout{Achtung: Seite (\thepage ) ist ein
                                     Briefumschlag! Anschlagstaerke!!!}
                            \typeout{}
                            \global\def\test{#1}
                            \ifx\test\Von
                                \relax
                            \else
                                \savebox{\absbox}(0,0)
                                        {\put(0,0){\parbox[t]{70mm}{#1}}}
                            \fi
                            \global\def\test{#2}
                            \ifx\test\An
                                \relax
                            \else
                                \savebox{\adrbox}(0,0)
                                        {\put(0,0){\parbox{80mm}{#2}}}
                            \fi
                            \begin{picture}(160,110)(25,-30)
                              \put(110,35){\usebox{\adrbox}}
                              \put(0,95){\usebox{\absbox}}
                            \end{picture}}
\newcommand{\von}[3]{\clearpage
                 \global\def\test{#1}
                 \ifx\test\thd
                   \savebox{\vonbox}{\Thdadresse}
                   \savebox{\absbox}(0,0){\thdadresse}
                 \else\ifx\test\firma
                     \savebox{\vonbox}{\Firmenadresse}
                     \savebox{\absbox}(0,0){\firmenadresse}
                   \else\ifx\test\altfirma
                       \savebox{\vonbox}{\Altfirmenadresse}
                       \savebox{\absbox}(0,0){\altfirmenadresse}
                     \else\ifx\test\privat
                         \savebox{\vonbox}(0,0){\Privatadresse}
                         \savebox{\absbox}(0,0){\privatadresse}
                       \else\ifx\test\zweit
                           \savebox{\vonbox}(0,0){\Zweitadresse}
                           \savebox{\absbox}(0,0){\zweitadresse}
                         \else
                            \savebox{\vonbox}{\begin{picture}(0,0)
                              \put(0,0){\parbox[t]{110mm}{#1}}
                              \put(50,0){\parbox[t]{110mm}{#2}}
                              \put(100,0){\parbox[t]{110mm}{#3}}
                             \end{picture}}
                            \savebox{\absbox}{\put(0,0){\parbox[t]{70mm}{\begin{center}
                               #1~\\
                               #2~\\
                               #3
                             \end{center}}}}
                          \fi
                      \fi
                   \fi
               \fi
           \fi}
