summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/serial/serial.dtx
blob: 86580c64007d020e7737dbd2fc2aa0894797ce03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
% \iffalse
%<*drv>
\documentclass{ltxdoc}
\usepackage{doc}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\parindent0pt
\begin{document}
%\OnlyDescription  %Comment out for Desription only
\setlength\hfuzz{15pt}
\sloppy
\DocInput{serial.dtx}
\end{document}
%</drv>
%\fi
% \MakeShortVerb{\|}
% \CheckSum{589}
% \section{Guide}
% \subsection{Introduction}
% This class has been designed as a local wrapper for the KOMA-Script letter 
% class to allow easy generation of serial letters.
%
% Three different approaches
% are now implemented, one based on the method described in the 
% scrlettr-guide, and one based on the textmerg package, and one using 
% the delimtxt-package. 
%
% An interface for a local configuration file is integrated, allowing for
% easy modification of the letter layout for your site.
%
% It is recommended to use the |inputenc| package with suitable options
% if interfacing to an tex-unaware database to avoid problems with characters
% not in the default character class (e.g. german Umlaut and the like).
%
% \bigskip
% TODO:
% Integration of the standard letter class. (KOMA uses some different names
% for part of the letter information).
%
% The documentation is not fully done yet.
% The examples still need
% to be translated from german to english.
%
% \bigskip
% 
% Copyright  1999 Bjoern Pedersen
%
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
%
%  Permission is granted to to customize the declarations in this file
%  to serve the needs of your installation.  However, no permission is
%  granted to distribute a modified version of this file under its
%  original name "serial.dtx".
%
%
%\subsection{Class options}
% \begin{enumerate}
% \item \lbrack |kein|\rbrack |vordruck| switches from preprinted to white paper 
% \lbrack default:white paper\rbrack
% \item |adrentry| use KOMA-Script based data file
% \item |merg| use textmerg style data file  \lbrack default\rbrack
% \item |delim| use delimtxt style data file  
% \item \lbrack |no|\rbrack |nofoldmarks| switches foldmarks on/off \lbrack on\rbrack
% \item |latin1/asciinew/ansi/applemac| If present, these are passed to the |inputenc|
%       package
% \item |draft| This options outputs one letter, skipping the reading
% of the data file and substituting the macros with their
% name. (useful for testing the letter)
%\end{enumerate}
%
%\subsection{Macros}
% \subsubsection{Setup and Utility Macros}
% \DescribeMacro{\MyFirstHead}|\MyFirstHead|:
%
% This generates our local header on the first page of each letter.
%
% \DescribeMacro{\MyFirstFoot}|\MyFirstFoot|:
% This generates our local header on the first page of each letter.
% Use |DeclareRobustCommand{\MyFirst[Head/Foot]}| to change it e.g. in the cfg-file.
%
% \DescribeMacro{\MyNextHead}|\MyNextHead|,
% \DescribeMacro{\MyNextFoot}|\MyNextFoot|:
%
% These are the headers/footers on the following pages and by default empty.
%
% Behind the scenes, the fancyhdr-package is used to customize these headers/
% footers.
%
% \subsubsection{KOMA-script -letter macros}
% These scrlettr-macros have to be declared either in the config-file or in the preamble.
%
% \DescribeMacro{\signature}|\signature|
%
% \DescribeMacro{\place}|\place|
%
% \DescribeMacro{\name}|\name|
%
% \DescribeMacro{\location}|\location|
%
% \DescribeMacro{\telephone}|\telephone|
%
% \DescribeMacro{\backadress}|\backadress|
%
% \subsubsection{The serial letter macros}
% \DescribeMacro{\Serial}
% The |\Serial| macro is the main interface to this class. Its semantics are
% as follows:
%
% |\Serial{adressfile}{letter-body}|
% 
% It will read an adressfile( formatted as decribed in section \ref{adfile})
% and generate the serial letters. In each version an extra counter will enumerate the letters,
% so later selected letters could be printed.
%
% The following macros will be defined in the letterbody (using the textmerg/delimtxt-options
% , these can be further customized, see below): 
%
% Entries marked with (\textbf{+}) are used internally and should always be present with this
% name if customizing the data base format. Otherwise you have to rewrite the relevant parts
% in your local class. 
%
%\DescribeMacro{\Name}|\Name|  The surname(\textbf{+}).
%
%\DescribeMacro{\VorName}|\VorName|  The first name(s)(\textbf{+}).
%
%\DescribeMacro{\Street}|\Street|  The street(\textbf{+}).
%
%\DescribeMacro{\City}|\City| The City (with ZIP-code)(\textbf{+}).
%
%\DescribeMacro{\Phone}|\Phone| The phone number.
%
%\DescribeMacro{\Geschlecht}|\Geschlecht|  The sex.
%
%\DescribeMacro{\FreeII}|\FreeII|  A multipurpose spare field.
%
%\DescribeMacro{\Comment}|\Comment| A comment field.
%
% \DescribeMacro{\Anrede}|\Anrede| Use this for the (by default german) opening. It depends on |\Geschlecht|
% being either |w| or |m| and selects \DescribeMacro{\Wanredetext}|\Wanredetext| or 
% \DescribeMacro{\Manredetext}|\Manredetext|. For other languages, customize it in the configuration file.
%
%
% \subsubsection{The Fields macro}
%\DescribeMacro{\Fields}
%  In the textmerg or delimtxt-based version, the input format can be easily customized using 
% |\renewcommand{\Fields}|. 
%
% The definition should contain the desired macro names, optionally preceeded by |+| to
% allow skipping blank lines in the input. For a full description see the |textmerg|/|delimtxt| description.  
% Remember not to omit required fields.
%
% \subsection{The Adressfile format}
% \label{adfile}
% \subsubsection{The adrentry version}
% This file with extension |.adr| should consist of lines containing:
%
%{\noindent\small |\adrentry{name}{firstname}{street}{city}{phone}{sec}{free}{comment}|}
% 
% \subsubsection{The textmerg version}
% This file with extension |.adt| has a more loosely defined format:
% Each line corresponds to one entry in the |\Fields|-macro. These blocks are repeated for each letter.
% If enabled with the |+| switch, blank lines are ignored in the input.
%
% So, for the default 
%
% |\Fields{\Name\VorName\Street\City\Phone\Geschlecht\FreeII\Comment}|
%
% there should be 8 lines for each letter in the adress file.
% \subsubsection{The delimtxt version}
% This file with extension |.del| is analogous to the textmerg file, but fields are separated by \verb+|+ .
% This delimiter can be changed by the delimtxt function |\SetDel|. Each new line starts a new letter.
% For more info on delimtxt see the documentation supplied there.
%
% \StopEventually
%
% \section{Implementation}
% \subsection{Serial-specific setup}
%<*class>
% 
% 
% Announce the classname.
%
%
%% Copyright  1999 Bjoern Pedersen
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%%
%%  Permission is granted to to customize the declarations in this file
%%  to serve the needs of your installation.  However, no permission is
%%  granted to distribute a modified version of this file under its
%%  original name "serial.dtx".
%    \begin{macrocode}
\def\filedate{1999/04/30}
\ProvidesClass{serial}[\filedate]
\NeedsTeXFormat{LaTeX2e}[1998/06/01]
%    \end{macrocode}
%
% Declare the necesary class options.
%
% \DescribeMacro{\firsthead}
% \DescribeMacro{\firstfoot}
% This generates our local header and footer on the first page of each letter.
% The real definition should be in the configuration file. 
%
%    \begin{macrocode}
\DeclareOption{keinvordruck}{
\AtBeginDocument{\firsthead{\MyFirstHead}
              \firstfoot{\MyFirstFoot}
%    \end{macrocode}
%
% \DescribeMacro{\nexthead} \DescribeMacro{\nextfoot}
% On the following pages, no header or footer is planned.
%
%    \begin{macrocode}

\nexthead{\MyNextHead}  
\nextfoot{\MyNextFoot}

\pagestyle{headings}
}% end of AtBeginDocument
}
%    \end{macrocode}
%
% If a preprinted paper is used, use option vordruck.
%
%    \begin{macrocode}
\DeclareOption{vordruck}%
{\AtBeginDocument{%
\firsthead{}%
\firstfoot{}%
\nexthead{}%
\nextfoot{}%
\pagestyle{empty}
}}
%    \end{macrocode}
%
% Load the required package, if any.
% To select the right behaviour, we let |\Serial| to either |\Serialx| or |\Seriala|.
% For the koma-script version make |\Fields| a no-op.
%
%    \begin{macrocode}
\newif\ifTextM
\TextMfalse
\newif\ifDelT
\DelTfalse
\newif\ifDraft
\Draftfalse

\DeclareOption{draft}{\Drafttrue}
\DeclareOption{final}{\Draftfalse}

\DeclareOption{merg}{%
\TextMtrue
        \AtEndOfClass{\global\let\MyMerge=\Merge
        \gdef\ext{.adt}
        \global\let\Serial=\Serialx}}

\DeclareOption{delim}{ 
\DelTtrue
        \AtEndOfClass{\global\let\MyMerge=\DelimRead
        \gdef\ext{.del}
        \global\let\Serial=\Serialx}}

\DeclareOption{adrentry}{
\def\Fields#1{\relax}
\countdef\LetterCounter=1
\LetterCounter=0
        \AtEndOfClass{\global\let\Serial=\Seriala}}

%    \end{macrocode}
%
% Some options for foldmarks.
%
%    \begin{macrocode}
\DeclareOption{nofoldmarks}{\AtEndOfClass{\foldmarksoff}}
\DeclareOption{foldmarks}{\AtEndOfClass{\foldmarkson}}
%    \end{macrocode}
%
% Some inputenc.sty options
%    \begin{macrocode}
\DeclareOption{ansinew}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{latin1}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{ascii}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{applemac}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
%    \end{macrocode}
%
% Setup the defaults and load |scrlettr.cls|.
%
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrlettr}}
\ExecuteOptions{keinvordruck,foldmarks,merge}
\ProcessOptions\relax
\LoadClass[wlocfield,a4paper]{scrlettr}
%    \end{macrocode}
%
% Load required packages based on options
%
%    \begin{macrocode}
\ifTextM
\RequirePackage{textmerg}
\fi
\ifDelT
\RequirePackage{delimtxt}
\fi
%    \end{macrocode}
%
% We use a possibly very high header, so recalutate scrlettr layout ( a4paper only).
% To get those foldmarks right, we calculate the position from the top of the paper.
% |\foldhskip| adjusted for HP LJ5L. This can be done in the .cfg file.
%
%    \begin{macrocode}
\setlength{\voffset}{-5.5truemm}
\setlength{\topmargin}{-1in}
\addtolength{\topmargin}{10truemm}
\setlength{\headheight}{27truemm}
\setlength{\headsep}{4truemm}
%    \end{macrocode}    
%
% calculate vertical skip for foldmarks from other length at the beginnig
% of the document, as head height may be customized in the config file.
% This has do be done after setting backadress in the .cfg-file.
%    \begin{macrocode}
\AtEndOfClass{
\setlength{\foldvskipi}{101.5truemm}

\setlength{\foldvskipii}{47.5truemm}    % mk 960531 (war:40.5truemm)
\setlength{\foldvskipiii}{58.5truemm}    % mk 960531 (war:58.5mm)
\setlength{\foldhskip}{6truemm} % adjust for printer
%    \end{macrocode}    
%  
%    Calculate textheight from footheight.
%
%    \begin{macrocode}  
\newlength{\footheight}
\setlength{\footheight}{25truemm}
\setlength{\textheight}{297truemm}

} % End of AtEndofClass
\AtBeginDocument{
}

%    \end{macrocode}
%
% Here are the defaults for some scrlettr macros.
% They must be overriden in serial.cfg.
%

% \DescribeMacro{\signature}
% \DescribeMacro{\place}
% \DescribeMacro{\name}
% \DescribeMacro{\location}
% \DescribeMacro{\telephone}
% \DescribeMacro{\backadress}

%    \begin{macrocode}

%%------------
%%
%% this is configurable in serial.cfg
%%

 \signature{Please set this signature in your .cfg file}

 \place{Please set this place in your .cfg file}
 \name{Please set this name in your .cfg file}

 \address{Please set this address in your .cfg file }
 \location{Please set this location in your .cfg file}

 \telephone{Please set this telephone in your .cfg file}

 \backaddress{ Please set this backaddress in your .cfg file }

% \specialmail{\ }
%    \end{macrocode}
%    \begin{macrocode}
\DeclareRobustCommand{\MyFirstHead}{%
\parbox[b]{0.99\textwidth}
{  \begin{minipage}[b]{98truemm}
    {\sffamily\bfseries\fontsize{4.1truemm}{6.0truemm}\selectfont
     \ignorespaces
         SOME NAME\\
         Configure in your .cfg}%
     \end{minipage}
     \begin{minipage}[b]{48truemm}\hfill\parbox[b]{47.5truemm}
                         {here would be a graphic}
     \end{minipage} 
 }%
 }
%    \end{macrocode}
%
%    \begin{macrocode}
\DeclareRobustCommand{\MyFirstFoot}{%
\parbox[t]{\textwidth}
                {\rule{\textwidth}{.4pt}\\[0.6ex]%
                \sffamily\tiny%
You have to override this in your .cfg-file
}% end of parbox
}%
\DeclareRobustCommand{\MyNextHead}{}
\DeclareRobustCommand{\MyNextFoot}{}
%    \end{macrocode}
%
% \section{The serial letter implementation}
% \subsection{Common macros}
%
% \DescribeMacro{\Anrede}
% \DescribeMacro{\Wanredetext}
% \DescribeMacro{\Manredetext}
% In serial letters, we want to differentiate by sex , these macros will do it for us. No babel support, as for now.
% These macros can be redeclared in the configuration file.
%
%    \begin{macrocode}
\DeclareRobustCommand{\Wanredetext}{Sehr geehrte Frau}
\DeclareRobustCommand{\Manredetext}{Sehr geehrter Herr}
\DeclareRobustCommand{\Anrede}{%
\if \Geschlecht w \opening{\Wanredetext\ \Name,} \fi%
\if \Geschlecht m \opening{\Manredetext\ \Name,} \fi%
}
%    \end{macrocode}
% \DescribeMacro{\Serial}
%
% The macro |\Serial{adrfilebasename}{letterbody}| will expand to either |\Seriala| or|\Serialx| as defined 
% by the class-options.
%
% \subsection{The KOMA-Script based version}
%
% \DescribeMacro{\Seriala}
%  Here starts the |\Seriala| macro. This is a simple wrapper of the approach used in scrlettr.
% The the |komascr|-documentation for details. The support for draft modus has been added.
%
% In the example file, long lines have been split to allow inclusion in the documentation,
%  but this not required for normal use.
%    \begin{macrocode}
\DeclareRobustCommand{\Seriala}[2]{
\def\@AddFile{#1.adr}
\long\def\@body{#2}
% This is the draft part
\ifDraft
\begingroup
\global\advance\LetterCounter by1
\expandafter\def\csname Name\endcsname{\texttt{Name}}
\expandafter\def\csname VorName\endcsname{\texttt{VorName}}
\expandafter\def\csname Street\endcsname{\texttt{Street}}
\expandafter\def\csname City\endcsname{\texttt{City}}
\expandafter\def\csname Phone\endcsname{\texttt{Phone}}
\expandafter\def\csname Geschlecht\endcsname{w} % to check \Anrede
\expandafter\def\csname FreeII\endcsname{\texttt{FreeII}}
\expandafter\def\csname Comment\endcsname{\texttt{comment}}
\typeout{Addressfile: \@AddFile would be loaded.}
\begin{letter}{\VorName\ \Name\\\Street\\[1.5ex]\City}
\expandafter\noexpand\@body
\end{letter}
\endgroup%
% end of draft part
% This if the final part
\else
\begingroup
\def\adrentry##1##2##3##4##5##6##7##8{%
 \global\advance\LetterCounter by1
      \expandafter\def\csname Name\endcsname{##1}
      \expandafter\def\csname VorName\endcsname{##2}
      \expandafter\def\csname Street\endcsname{##3}
      \expandafter\def\csname City\endcsname{##4}
      \expandafter\def\csname Phone\endcsname{##5}
      \expandafter\def\csname Geschlecht\endcsname{##6}
      \expandafter\def\csname FreeII\endcsname{##7}
        \ifx\empty\FreeII
                \def\FreeII{\ }
        \fi
      \expandafter\def\csname Comment\endcsname{##8}
    \expandafter\begin{letter}{##2\ ##1\\##3\\[1.5ex]##4}
    \expandafter\noexpand\@body
    \expandafter\end{letter}
}
\InputIfFileExists{\@AddFile}
                   {\typeout{Load addressfile: \@AddFile.}}
                    {\PackageError{serial}
                                  {File \@AddFile not found}
                                  {The addressfile you wanted is not
                                   available}}
  \endgroup%
% end of final part
\fi
}
%    \end{macrocode}
%%
%%---------------
%%
%
% \subsection{The textmerg-based version}
%
% \DescribeMacro{\Serialx}
% This is the wrapper for the |textmerg|-package:
% use a textmerg style inputfile with extension |.adt|,
% containing the desired fields.
% Default is:
%
%|\Name\VorName\Street\City\Phone\Geschlecht\FreeII\Comment|
% 
% \DescribeMacro{\Fields}
% The default can be overwritten using |\Fields{fields}| before the letter. 
% Further information can be found in the documentation for the 
% textmerge-package.
% 
%    \begin{macrocode}
\Fields{\Name\VorName\Street\City\Phone\Geschlecht\FreeII\Comment}
%    \end{macrocode}
%
% The draft merge helper
% In draft mode, we parse the |\Fields| macro and define each csname
% to be its string expansion.( This should really go into |textmerg|/|delimtxt|.)
%    \begin{macrocode}
\DeclareRobustCommand{\DraftMerge}[2]{%
\typeout{The adressfile: #1 would be loaded}
\begingroup
\def\DParseFields##1{%
  \ifx##1\EndParseFields%
      \let\DNextParse\relax%
  \else%
      \let\DNextParse\DParseFields%
      \ifx##1+\relax%
      \else%
        \ifx##1-\relax%
        \else%
           \def##1{\string##1}
        \fi
      \fi
  \fi\DNextParse}%
\let\EndParseFields\DParseFields
\expandafter\DParseFields\the\Fields\EndParseFields 
\global\advance\Iteratecounter by1
\def\Geschlecht{w} % set for \Anrede -> \Wanredetext
  #2
\endgroup
}
%
\DeclareRobustCommand{\Serialx}[2]
{
\def\@AddFile{#1\ext}
\ifDraft
%begin of draft part
\DraftMerge{\@AddFile}{%
    \begin{letter}{\VorName\ \Name \\\Street\\[1.5ex]\City}%
    #2%
    \end{letter}%
}%
%end of draft part
\else
% begin of final part
\MyMerge{\@AddFile}{%
    \begin{letter}{\VorName\ \Name \\\Street\\[1.5ex]\City}%
    #2%
    \end{letter}%
}%
% end of final part
\fi
}
%    \end{macrocode}
% 
% At the end of the class we input the configuration file. This has to
% be done before we set the header and footers to allow them to be customized
% via the config file without extra macro invocations.
%
%    \begin{macrocode}
\AtEndOfClass{\InputIfFileExists{serial.cfg}%
  {\typeout{Loaded local configuration from serial.cfg}}%
  {\typeout{no local configuration in serial.cfg}
   \PackageError{serial}{Missing configuration file}
  {You should really create the %
   cfg-file as described in the documentation}}}
%
% Now recalculate the layout:
\AtEndOfClass{
\addtolength{\foldvskipi}{-1in}
\addtolength{\foldvskipi}{-\topmargin}
\addtolength{\foldvskipi}{-\headsep}
\addtolength{\foldvskipi}{-\headheight}

\addtolength{\textheight}{-1in}
\addtolength{\textheight}{-\topmargin}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\footheight}
\newlength\@backheight
\newlength\@backdepth
\settoheight\@backheight{\frombackaddress}
\settodepth\@backdepth{\frombackaddress}
\addtolength{\foldvskipi}{-\@backheight}
\addtolength{\foldvskipi}{-\@backdepth}
\addtolength{\textheight}{-\@backheight}
\addtolength{\textheight}{-\@backdepth}
}
%% End of file `serial.cls'.
%    \end{macrocode}
%</class>
%
% \section{The example files}
% \subsubsection{Example letters}
%
%    \begin{macrocode} 
%<*ex1>
\documentclass[12pt,draft,adrentry]{serial}
%</ex1>
%<*ex2>
\documentclass[12pt,draft,merg]{serial}
%</ex2>
%<*ex3>
\documentclass[12pt,draft,delim]{serial}
%</ex3>
%<*exa>

\DeclareRobustCommand{\VerbX}[1]{\item[\texttt{\textbackslash#1}]}

\begin{document}

\date{\today}

\Serial{examp}{ 
\subject{Test}

\Anrede

Hier sollte der Text des Briefes stehen.
Folgende Makros stehen zur Verfügung:
\begin{labeling}[:]{\texttt{\textbackslash Geschlecht}}
\VerbX{Name}  Ist der Nachname in der Adressendatei:\fbox{\Name}

\VerbX{VorName}  Ist der Vorname in der Adressendatei: \fbox{\VorName}

\VerbX{Street}  Ist die Strasse in der Adressendatei: \fbox{\Street} 

\VerbX{City}  Ist die Stadt in der Adressendatei: \fbox{\City} 

\VerbX{Phone} Ist die Telephonnummer in der Adressendatei:\fbox{\Phone}

\VerbX{Geschlecht}  Ist das Geschlecht in der Adressendatei: \fbox{\Geschlecht}

\VerbX{FreeII}  Ist noch nicht zugewiesen  in der Adressendatei:\fbox{\FreeII}

\VerbX{Comment}  Ist der Kommentar in der Adressendatei: \fbox{\Comment}

\end{labeling}
\closing{Hier kommt die Grußformel}


}% ende von \Serial

\end{document}
%</exa>
%    \end{macrocode}
%
% \subsection{Example KOMA-Script data file}
%
%    \begin{macrocode}
%<*adr>
\adrentry{Pedersen}{Bjoern}%
{Some Street 1}{11111 Somewhere}%
{11~00~00}{m}{}{Test Kommentar}
\adrentry{Mustermann}{Ingrid}%
{Anotherstreet 99}{99999 Elsewhere}%
{99~99~99}{w}{Hier steht jetzt auch etwas}{Test}
%</adr>
%    \end{macrocode}
% \subsection{Example textmerge data file}
%    \begin{macrocode}
%<*adt>
Pedersen
Bjoern
Some Street 1
11111 Somewhere
11~00~00
m

Test Kommentar
Mustermann
Ingrid
Anotherstreet 99
99999 Elsewhere
99~99~99
w
Hier steht jetz auch etwas
Test
%</adt>
%    \end{macrocode}
%    \begin{macrocode}
%<*del>
Pedersen|Bjoern|Some Street 1|11111 Somewhere|11~00~00|m| |Test Kommentar
Mustermann|Ingrid|Anotherstreet 99|99999 Elsewhere|99~99~99|w|Hier steht jetz auch etwas|Test
%</del>
%    \end{macrocode}
% \subsection{Example configuration file} 
%    \begin{macrocode}
%<*cfg>
%% Some packages which may prove useful: remove  comments as appropriate
%%\RequirePackage[germanb]{babel}
%%\RequirePackage[T1]{fontenc}
%%\RequirePackage{inputenc}
%%\RequirePackage[final]{graphicx}
%%\RequirePackage{times}

%% change certain sizes is allowed here: uncomment and adjust as necessary.
%% The margin will be calculated from the top rim of the paper!
%%\addtolength{\topmargin}{10truemm}
%%\setlength{\headheight}{27truemm}
%%\setlength{\headsep}{4truemm}
%%\setlength{\foldhskip}{6truemm} % adjust for printer
%%\setlength{\footheight}{25truemm}


\signature{Your Name}

\place{Your Place}
\name{Your Name}

\address{%
Your adress name\\%
Your Street\\[1.5ex]%
Your location%
}
\location{\sffamily\scriptsize%
Your Text for the location field
}

\telephone{Your Phone}

\backaddress{\fontsize{7}{8}\selectfont\parbox{70truemm}%
{Your Backaddress,\\ can even be two lines}\rule[-1ex]{0pt}{0pt}}

\DeclareRobustCommand{\MyFirstHead}{%
                \parbox[b]{0.99\textwidth}%
                {%
                \begin{minipage}[b]{98truemm}
                        {\sffamily\bfseries\fontsize{4.1truemm}{6.0truemm}\selectfont
                        \ignorespaces
                         Something for the letter head.}%
                \end{minipage}\hfil
                \begin{minipage}[b]{48truemm}%
                        \hfill\vfill%\parbox[b]{47.5truemm}%
                        {%
                        % maybe ypu want a logo?
                                %\includegraphics[width=47truemm]{logo.eps}%
                        }
                \end{minipage}
                }%
}
\DeclareRobustCommand{\MyFirstFoot}{%
\parbox[t]{\textwidth}
                {\rule{\textwidth}{.4pt}\\[0.6ex]%
                \sffamily\footnotesize%
                \begin{tabular}{lll}
Vorstand:& Sparkasse & Raiffeisenbank \\%
someone &BLZ 700\,530\,70  &BLZ 701\,693\,80\\%
&Kto.-Nr.: 1\,11\,111  &Kto.-Nr.: 999\,999\,999%
                \end{tabular}% 
}% end of parbox
}%

\endinput
%</cfg>
%    \end{macrocode}
%\Finale