Debian Codegraph @

texmf-dist/source/latex/adrconv/adrconv.dtx

raw
1 % \CheckSum{547}
2 % \iffalse
3 % ====================================================================
4 %% adrguide.dtx
5 %% Copyright 2006, 2010, 2018 Axel Kielhorn
6 %
7 % This work may be distributed and/or modified under the
8 % conditions of the LaTeX Project Public License, either version 1.3
9 % of this license or (at your option) any later version.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3 or later is part of all distributions of LaTeX
13 % version 2003/12/01 or later.
14 %
15 % This work has the LPPL maintenance status "maintained".
16 %
17 % This Current Maintainer of this work is Axel Kielhorn ([email protected])
18 %
19 % This work consists of the files adrconv.ins, adrconv.dtx, adrguide.tex
20 % and the derived file adrguide.pdf.
21 %
22 % Use
23 % tex adrconv.ins
24 % or
25 % latex adrconv.ins
26 % to generate the other files, which are indirect parts of the
27 % bundle. Use
28 % latex adrconv.dtx
29 % to generate the implementation documentation. Use
30 % latex adrguide.tex
31 % to generate the user documentation.
32 %
33 % ====================================================================
34 %
35 %<*dtx>
36 \ProvidesFile{adrconv.dtx}
37 %</dtx>
38 %<driver>\ProvidesFile{adrconv.drv}
39 %<guide>\ProvidesFile{adrguide.tex}
40 %<*tex|cfg|dir|montage>
41 %<tex|cfg|dir|montage>\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
42 %<tex|cfg|dir|montage>\ProvidesFile{%
43 %<conv> adrconv%
44 %<fax> adrfax%
45 %<dir> adrdir%
46 %<birthday> adrbirthday%
47 %<planer> adrplaner
48 %<small> adrsmall
49 %<montage&erster> adrmontage1.tex
50 %<montage&zweiter> adrmontage2.tex
51 %<tex> .tex%
52 %<dir&!cfg> .tex%
53 %<cfg> .cfg%
54 %<tex|cfg|dir|montage> }
55 %</tex|cfg|dir|montage>
56 %<*dtx|driver|guide|tex|cfg|dir>
57 [2018/01/30 v1.4 LaTeX2e
58 %<*dtx>
59 adrconv docstrip file]
60 %</dtx>
61 %<driver> adrconv implementation documentation driver]
62 %<guide> Address guide]
63 %<tex> Interactive driver of BibTeX database to addressfile converter]
64 %<cfg> adrconv configuration file]
65 %<dir&!cfg> Interactive address directory generation]
66 %</dtx|driver|guide|tex|cfg|dir>
67 %<*driver>
68 \documentclass{ltxdoc}
69 \CodelineIndex
70 \RecordChanges
71
72 \newcommand*{\Class}[1]{\textsf{#1}}
73 \newcommand*{\Package}[1]{\textsf{#1}}
74 \newcommand*{\File}[1]{\texttt{#1}}
75
76 \ifx\KOMAScipt\undefined
77 \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
78 M\kern.05em A\kern.1em-\kern.1em Script}}
79 \fi
80
81 \makeatletter
82 \DeclareRobustCommand{\BibTeX}{B\kern-.05em%
83 % Der folgende Hack stammt aus der Definition des
84 % Makros \LaTeX, siehe Datei `ltlogos.dtx' der
85 % LaTeX2e-Verteilung.
86 \hbox{$\m@th$% %% force math size calculations
87 \csname S@\f@size\endcsname \fontsize\sf@size\z@
88 \math@fontsfalse\selectfont
89 I\kern-.025emB}%
90 \kern-.08em%
91 \-\TeX%
92 }
93 \makeatother
94
95 \begin{document}
96 \DocInput{adrconv.dtx}
97 \end{document}
98 %</driver>
99 % \fi
100 %
101 % \GetFileInfo{adrconv.dtx}
102 % \title{\BibTeX{} address database to addressfile
103 % converter\footnote{This file has version number \fileversion, last
104 % revised \filedate}}
105 % \author{Axel Kielhorn\thanks{[email protected]} \and Markus Kohm}
106 % \date{\filedate}
107 % \maketitle
108 % \begin{abstract}
109 % \Package{adrconv} is an example for converting \BibTeX{} address
110 % databases to \KOMAScript{} address files. For more information see
111 % the ``ADRconv Anleitung''. This is only the implementation
112 % documentation.
113 % \end{abstract}
114 %
115 % \StopEventually{\PrintIndex\PrintChanges}
116 %
117 % \tableofcontents
118 %
119 % \section{General}
120 %
121 % This implementation documentation is very rudimentary because it was
122 % not written by Axel Kielhorn but by Markus Kohm. I've done this
123 % because after two years waiting I wanted to make the break and
124 % remove the old version of \Package{adrconv} from \KOMAScript.
125 %
126 % The use of \Package{adrconv} is described at the ``ADRconv
127 % Anleitung''. You'll get the guide, running \TeX{} or \LaTeX{} in
128 % \File{adrconv.ins}.
129 %
130 %
131 % \section{The interactive drivers}
132 %
133 % \iffalse
134 %<*tex>
135 % \fi
136 % Remember the files should work not only with \LaTeX{} but also with
137 % Plain\TeX. So we can olny use macros, which are defined at both:
138 % \LaTeX{} and Plain\TeX.
139 %
140 % \begin{macrocode}
141 \catcode`\@=11
142 \newlinechar`\^^J
143 \message{%
144 Now you have to typein the name of the BibTeX addressfile, you want
145 to^^J%
146 convert to script-address-file-format (without extension
147 `.bib'):^^J%
148 Geben Sie nun den Namen der BibTeX-Adressdatei ein, die sie in
149 das^^J%
150 Script-Adressdateiformat konvertieren wollen (ohne `.bib'):^^J%
151 ^^J%
152 addressfile=%
153 }
154 \def\skiplastspace#1 \@e@o@l@{#1}
155 \read-1 to \addressfile
156 \edef\addressfile{\expandafter\skiplastspace\addressfile\@e@o@l@}
157 \newwrite\auxfile
158 \immediate\openout\auxfile=\addressfile.aux
159 \immediate\write\auxfile{%
160 \string\citation{*}^^J%
161 %<conv> \string\bibstyle{adrconv}^^J%
162 %<fax> \string\bibstyle{adrfax}^^J%
163 %<birthday> \string\bibstyle{adrbirthday}^^J%
164 \string\bibdata{\addressfile}%
165 }
166 \immediate\closeout\auxfile
167 \message{%
168 After running BibTeX rename file `\addressfile.bbl' to
169 `\addressfile.adr'!^^J%
170 Nach dem BibTeX-Lauf benennen Sie bitte die Datei `\addressfile.bbl'
171 in^^J%
172 `\addressfile.adr' um!^^J%
173 }
174 \ifx\@@end\undefined\let\@@end\end\fi
175 \@@end
176 % \end{macrocode}
177 % \iffalse
178 %</tex>
179 % \fi
180 %
181 %
182 % \section{The interactive generator}
183 %
184 % \iffalse
185 %<*!cfg>
186 %<*dir>
187 % \fi
188 % \begin{macrocode}
189 \documentclass[headsepline,10pt,twoside,pagesize]{scrartcl}
190 % \end{macrocode}
191 % Define some new commands
192 % \begin{macrocode}
193 \newcommand*\jj {j}
194 \newcommand*\ja {ja}
195 \newcommand*\y {y}
196 \newcommand*\yes{yes}
197 \newread\ttyin
198 \newcommand*{\gobble}[1]{}
199 \def\iden#1{#1}
200 \def\strip#1#2 \gobble{\def #1{#2}}
201 \def\defpar{\par}
202 \def\Ask#1#2{%
203 \message{#2}\read\ttyin to #1\ifx#1\defpar\def#1{}\else
204 \iden{\expandafter\strip\expandafter#1#1\gobble\gobble}
205 \gobble\fi}
206 % \end{macrocode}
207 % \cs{ifGerman} to load \Package{german} or \Package{ngerman}.
208 % \cs{RunningHead} to get the names in the header (Telephonebook
209 % style). Otherwise a new page is started for each new letter (This is
210 % needed for Birthday lists).
211 % \begin{macrocode}
212 \newif\ifGerman
213 \newif\ifRunningHead
214 \newif\ifEmail
215 % \end{macrocode}
216 % \begin{macrocode}
217 \newdimen\leftfield
218 \newdimen\rightfield
219 \newdimen\adrindent
220 \oddsidemargin -1in
221 \evensidemargin -1in
222 % \end{macrocode}
223 % \begin{macrocode}
224 \newcommand*\adrfile{}
225 \newcommand*\adrtitle{}
226 \typeout{^^J%
227 *** dir.tex v2.0 by Frank Neukam <01 Dec 1993>^^J%
228 *** LaTeX2e-changes by Markus Kohm 1994/10/29^^J%
229 *** ADRconv-changes by Axel Kielhorn 1999^^J%
230 *** ngerman-changes by Markus Kohm 2001^^J%
231 ^^J%
232 To create a address-directory just answer the questions:^^J%
233 ^^J}
234 \Ask\answer{Use german? [y/n]^^J%
235 Mit deutscher Sprachanpassung? [j/n]}
236 \ifx\jj\answer\Germantrue\else
237 \ifx\ja\answer\Germantrue\else
238 \ifx\y\answer\Germantrue\else
239 \ifx\yes\answer\Germantrue\else
240 \Germanfalse\fi\fi\fi\fi
241 \ifGerman
242 \def\germanpackage{ngerman}
243 \Ask\answer{Mit alter deutscher Rechtschreibung? [j/n]}
244 \ifx\jj\answer\def\germanpackage{german}\else
245 \ifx\ja\answer\def\germanpackage{german}\else
246 \ifx\y\answer\def\germanpackage{german}\else
247 \ifx\yes\answer\def\germanpackage{german}\fi\fi\fi\fi
248 \usepackage{\germanpackage}
249 \fi
250 % \end{macrocode}
251 % \changes{v1.3}{2010/04/02}{Added support to print the e-mail Address in the addressbook.}
252 % \begin{macrocode}
253 \Ask\answer{^^JPrint email? [y/n]^^J%
254 E-Mail ausgeben? [j/n]}
255 \ifx\jj\answer\Emailtrue\else
256 \ifx\ja\answer\Emailtrue\else
257 \ifx\y\answer\Emailtrue\else
258 \ifx\yes\answer\Emailtrue\else
259 \Emailfalse\fi\fi\fi\fi
260 \ifEmail
261 \usepackage{url}
262 \fi
263 \InputIfFileExists{dir.cfg}{%
264 \typeout{Load local configuration-file.}}{%
265 \typeout{No local configuration-file found.}}
266 \Ask\adrfile{^^J%
267 Name of address-file (without .adr)?^^J%
268 Name der Adressdatei (ohne .adr)?}
269 \Ask\adrtitle{^^J%
270 Title of directory/list?^^J%
271 Titel des Verzeichnisses?}
272 \Ask\adrformat{^^J%
273 Name of the layout^^J%
274 Layoutname?}
275 \Ask\answer{^^J%
276 With running head? [y/n]^^J%
277 Namen in der Kopfzeile? [j/n]}
278 \ifx\jj\answer\RunningHeadtrue\else
279 \ifx\ja\answer\RunningHeadtrue\else
280 \ifx\y\answer\RunningHeadtrue\else
281 \ifx\yes\answer\RunningHeadtrue\else
282 \RunningHeadfalse\fi\fi\fi\fi
283 % \end{macrocode}
284 % \changes{v1.4}{2018/01/30}{usage of \Package{scrlayer-scrpage}}
285 % Since the file uses \Class{scrartcl} it assumes that
286 % \Package{scrlayer-scrpage} is available. We do not use \Package{scrpage} any
287 % longer, because it is not longer part of the \KOMAScript{} bundle for more
288 % than 10 years.
289 % \begin{macrocode}
290 \ifRunningHead
291 \usepackage[manualmark,headsepline]{scrlayer-scrpage}
292 \clearpairofpagestyles
293 \ohead{\if@twoside\rightmark\ -- \leftmark\fi}
294 \chead{\if@twoside\else\rightmark\ -- \leftmark\fi}
295 \ofoot{\if@twoside\pagemark\fi}
296 \cfoot{\if@twoside\else\pagemark\fi}
297 \fi
298 \setkomafont{pagehead}{\sffamily\bfseries}
299 % \end{macrocode}
300 % Loading the Layout definition.
301 % If no filename is specified, adrdir will be used.
302 % \begin{macrocode}
303 \ifx\adrformat\empty
304 \def\adrformat{adrdir}
305 \fi
306 \InputIfFileExists{\adrformat.cfg}{}{%
307 \typeout{^^J%
308 *** File \adrformat.cfg not found!^^J%
309 *** Datei \adrformat.cfg nicht gefunden!^^J%
310 ^^J}
311 }
312 % \end{macrocode}
313 % All definitions are done, let's start with the document.
314 % \begin{macrocode}
315 \begin{document}
316 % \end{macrocode}
317 % Don't start a new page for every letter when running head is used.
318 % \begin{macrocode}
319 \ifRunningHead
320 \def\adrchar#1{\typeout{#1}}
321 \else
322 \def\adrchar#1{\clearpage\typeout{#1}\markboth{#1}{#1}}
323 \fi
324 % \end{macrocode}
325 % \changes{v1.4}{2018/01/30}{replaced old font command \cs{sc} by NFSS2 font
326 % command}
327 % \changes{v1.4}{2018/01/30}{replaced old font command \cs{sfb} by NFSS2 font
328 % command}
329 % \changes{v1.4}{2018/01/30}{support for \cs{addrchar} and \cs{addrentry}}
330 % This command does all the formatting:
331 % \begin{macrocode}
332 %\adrentry
333 % 1 {Nachname}
334 % 2 {Vorname}
335 % 3 {Strasse \\ PLZ Ort}
336 % 4 {Telefon\\Mobil}
337 % 5 {E-Mail} \ifEmail
338 % 6 {Organisation}
339 % 7 {Notiz}
340 % 8 {Key}
341 \def\adrentry#1#2#3#4#5#6#7#8{\hspace{\adrindent}%
342 \parbox[b]{\leftfield}
343 {\raggedright \hspace{-\adrindent}{\normalfont\scshape #1}%
344 \def\tempa{#1}\ifx \tempa\empty \else , #2\fi%
345 \def\tempa{#3}\ifx \tempa\empty \else \par #3\fi%
346 \ifEmail
347 \def\tempa{#5}\ifx \tempa\empty \else \par \url{#5}\fi%
348 \fi
349 \def\tempa{#7}\ifx \tempa\empty \else \par (#7)\fi%
350 }%
351 \hfill%
352 \parbox[b]{\rightfield}
353 {\raggedleft%
354 \def\tempa{#8}\ifx \tempa\empty \else {\scriptsize #8}\par \fi
355 {\small #4}%
356 }\par%
357 \ifRunningHead
358 \markboth{#1}{#1}
359 \fi
360 }
361 \def\addrentry#1#2#3#4#5#6#7#8#9{%
362 \adrentry{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#9}%
363 }
364 \def\addrchar{\adrchar}
365 \ifx\adrfile\empty \else
366 \InputIfFileExists{\adrfile.adr}{%
367 \pagestyle{empty}
368 \null\vfil
369 \begin{center}
370 {\Large \normalfont\sffamily\bfseries \adrtitle\par}
371 \end{center}
372 \vfil\vfil\null
373 % \end{macrocode}
374 % Always start on a right page
375 % \begin{macrocode}
376 \cleardoublepage
377 \raggedbottom
378 \pagestyle{headings}
379 }{%
380 \typeout{^^J%
381 *** File \adrfile.adr not found!^^J%
382 *** Datei \adrfile.adr nicht gefunden!^^J%
383 ^^J}
384 }
385 \fi
386 \end{document}
387 % \end{macrocode}
388 % \iffalse
389 %</dir>
390 %</!cfg>
391 % \fi
392 %
393 %
394 % \section{The configuration files}
395 %
396 % \iffalse
397 %<*cfg>
398 % \fi
399 % \begin{macrocode}
400 %<*dir>
401 % \end{macrocode}
402 % Configfile for A6 phone book (105\,mm $\times$ 148\,mm).
403 % Original was former part of \KOMAScript{}.
404 %
405 % \begin{macrocode}
406 \setlength{\paperwidth}{105mm}
407 \setlength{\textwidth}{85mm}
408 \setlength{\leftfield}{50mm}
409 \setlength{\rightfield}{30mm}
410 % \end{macrocode}
411 % \begin{macrocode}
412 \addtolength{\evensidemargin}{9mm}
413 \addtolength{\oddsidemargin}{\paperwidth}
414 \addtolength{\oddsidemargin}{-9mm}
415 \addtolength{\oddsidemargin}{-\textwidth}
416 % \end{macrocode}
417 % \begin{macrocode}
418 %</dir>
419 % \end{macrocode}
420 %
421 % \begin{macrocode}
422 %<*planer>
423 % \end{macrocode}
424 % Configfile for organizers (95\,mm $\times$ 172\,mm) maybe from
425 % ALDI.
426 %
427 % \begin{macrocode}
428 \setlength{\paperwidth}{95mm}
429 \setlength{\textwidth}{70mm}
430 \setlength{\leftfield}{45mm}
431 \setlength{\rightfield}{25mm}
432 % \end{macrocode}
433 % \begin{macrocode}
434 \addtolength{\evensidemargin}{12mm}
435 \addtolength{\oddsidemargin}{12mm}
436 % \end{macrocode}
437 % \begin{macrocode}
438 %</planer>
439 % \end{macrocode}
440 %
441 % \begin{macrocode}
442 %<*small>
443 % \end{macrocode}
444 % Configfile for pocket calenders (87\,mm $\times$ 148\,mm)
445 % e.g. ``Sparkassenkalender''.
446 %
447 % \begin{macrocode}
448 \setlength{\paperwidth}{87mm}
449 \setlength{\textwidth}{75mm}
450 \setlength{\leftfield}{45mm}
451 \setlength{\rightfield}{30mm}
452 % \end{macrocode}
453 % \begin{macrocode}
454 \addtolength{\evensidemargin}{9mm}
455 \addtolength{\oddsidemargin}{\paperwidth}
456 \addtolength{\oddsidemargin}{-9mm}
457 \addtolength{\oddsidemargin}{-\textwidth}
458 % \end{macrocode}
459 % \begin{macrocode}
460 %</small>
461 % \end{macrocode}
462 %
463 % \begin{macrocode}
464 \setlength{\adrindent}{1em}
465 \addtolength{\leftfield}{-\adrindent}
466 % \end{macrocode}
467 % \begin{macrocode}
468 %<*dir>
469 \setlength{\paperheight}{148mm}
470 \setlength{\textheight}{112mm}
471 %</dir>
472 %<*planer>
473 \setlength{\paperheight}{172mm}
474 \setlength{\textheight}{148mm}
475 %</planer>
476 %<*small>
477 \setlength{\paperheight}{148mm}
478 \setlength{\textheight}{112mm}
479 %</small>
480 \setlength{\headheight}{1.25\baselineskip}
481 \setlength{\headsep}{0.25\baselineskip}
482 \setlength{\footskip}{1.50\baselineskip}
483 \setlength{\topmargin}{-1in}
484 %<dir>\addtolength{\topmargin}{8mm}
485 %<planer|small>\addtolength{\topmargin}{7mm}
486 \setlength{\marginparwidth}{0in}
487 \setlength{\marginparsep}{0in}
488 \setlength{\marginparpush}{0in}
489 \setlength{\parskip}{0.5\baselineskip}
490 \setlength{\parindent}{0in}
491 \typeout{%
492 ********************************************************************%
493 ^^J^^J%
494 DVIDVI Options:^^J%
495 Front:^^J%
496 %<*dir|small>
497 %<dir> 1st Step (2 x A6 at A5)^^J%
498 %<small> 1st Step (2 x callenders at A5)^^J%
499 -l xx -m 4:-1,2^^J%
500 2nd Step (2 x A5 at A4)^^J%
501 -m 2:0,1(0mm,148mm)^^J%
502 %</dir|small>
503 %<planer> -l 24 -m 6:0(4mm,0mm),2(99mm,0mm),4(192mm,0mm)
504 ^^J%
505 Back:^^J%
506 %<*dir|small>
507 1st Step^^J%
508 -l xx -r -m 4:-3,0^^J%
509 2nd Step^^J%
510 -m 2:1,0(0mm,148mm)^^J%
511 %</dir|small>
512 %<planer> -l 24 -r -m 6:5(8mm,0mm),3(103mm,0mm),1(198mm,0mm)
513 ^^J%
514 %<dir|small> xx must be the result of a multiplication with 4.^^J%
515 %<small> Cut 36 mm from one side and tack in the middle.^^J%
516 ^^J%
517 ********************************************************************
518 }
519 % \end{macrocode}
520 % German Remark from Axel to \File{adrdir.cfg}:
521 % \begin{quote}
522 % Das ist die einfache Version, einfach in der Mitte durchschneiden,
523 % Seiten sortieren, ineinanderstecken und heften.
524 %
525 % Nicht alle Tacker k\"onnen dieses Format verarbeiten, ich habe
526 % lange gesucht und benutze den Novus B5, der passt ganz knapp und ist
527 % noch bezahlbar. Danach kommen die Hochleistungstacker \"uber 50 DM.
528 % \end{quote}
529 %
530 % German Remark from Axel to \File{adrplaner.cfg}:
531 % \begin{quote}
532 % Der Deskjet kann die letzten 14\,mm des Blattes nicht bedrucken,
533 % daher wurde das ganze Layout um 4\,mm verschoben, diese m\"ussen an
534 % der kurzen Kante abgeschnitten werden.
535 %
536 % Bei anderen Druckern kann man bei den Vorderseiten 3\,mm von der
537 % x-Koordinate abziehen und bei den R\"uckseiten zuaddieren.
538 % \end{quote}
539 %
540 % German Remark from Axel to \File{adrsmall.cfg}:
541 % \begin{quote}
542 % Von einer Seite m\"ussen noch 36\,mm abgeschnitten werden, dann
543 % in der Mitte heften und in den Taschenkalender einstecken.
544 % \end{quote}
545 %
546 % \iffalse
547 %</cfg>
548 % \fi
549 %
550 %
551 % \section{The \BibTeX{} files}
552 %
553 % \iffalse
554 %<*bst>
555 % \fi
556 %
557 % These \BibTeX{} files are BibTeX-Database to \Class{scrlettr}
558 % converters. They are based on BibTeX bibliography style
559 % \File{address} Gerd Neugebauer has written in 1994.
560 %
561 % The files generated from these files may be used for
562 % \Class{scrlettr}, \Class{scrlttr2}, \File{phone.tex} or
563 % \File{dir.tex} from the \KOMAScript{} Package, \Class{akletter} and
564 % some versions of \Class{myletter} which preceded
565 % \Class{akletter}. They will even work with the \LaTeX 2.09 version
566 % of \textsc{Script}.
567 %
568 % This is only one way to use the address database layout defined by
569 % Gerd Neugebauer. Use this as an example for your own conversion
570 % program.
571 %
572 % \changes{v1.0}{1996/01/01}{Added the key-field}
573 % \changes{v1.1}{1996/01/02}{Changed \texttt{net} to \texttt{url} and
574 % \texttt{email}}
575 % \changes{v1.1.1}{1996/01/03}{Function address: moved
576 % \texttt{\bslash\bslash} inside if condition}
577 % \changes{v1.1.1}{1996/01/03}{No more warnings if street is empty
578 % (reported by Jan Holl\"ander)}
579 % \changes{v1.1.2}{1996/01/04}{The \emph{von} part was ignored in
580 % names}
581 % \changes{v1.1.3}{1996/01/04}{Support for second (mobile)
582 % telephonenumber}
583 % \changes{v1.2}{1999/11/01}{New release independent of KOMA-Script}
584 % \changes{v1.2a}{2001/10/11}{\Package{docstrip} version}
585 % \changes{v1.2b}{2002/06/23}{Documentation updated}
586 % \changes{v1.2c}{2006/04/19}{Documentation updated, license information
587 % updated to LPPL 1.3}
588 % \changes{v1.3}{2010/04/02}{Removed \texttt{email.bst}, the email address is now
589 % written to the standard \texttt{bbl} by \texttt{adrconv}.}
590 % \changes{v1.3}{2010/04/02}{Renamed \texttt{birthday.bst}
591 % to \texttt{adrbirthday.bst} to avoid a collision with \texttt{directory.cls}.}
592 %
593 % The \File{adrbirthday.bst} prints the entries with birthdays only. The
594 % entries are sorted by month and inside one month by date.
595 %
596 % \begin{macrocode}
597 ENTRY
598 { name
599 sortas
600 title
601 organization
602 city
603 zip
604 country
605 street
606 phone
607 mobile
608 fax
609 url
610 email
611 note
612 key
613 birthday
614 nbirthday
615 }
616 {}
617 %<!birthday> { adr.char }
618 %<birthday> { b.month }
619 % \end{macrocode}
620 % \begin{macrocode}
621 %<!birthday>INTEGERS { cur.adr.char }
622 %<birthday>STRINGS { cur.month num.index alpha.index }
623 % \end{macrocode}
624 % \begin{macrocode}
625 FUNCTION {get.names}
626 { name empty$
627 { organization empty$
628 { "{}{}" }
629 { organization "{}" * }
630 if$
631 }
632 { "{" name #1 "{ll}" format.name$ "}" * *
633 "{" name #1 "{ff}{ vv}" format.name$ "}" * * *
634 }
635 if$
636 }
637 % \end{macrocode}
638 % \begin{macrocode}
639 FUNCTION {print.adrchr}
640 %<*!birthday>
641 { adr.char chr.to.int$ cur.adr.char >
642 { newline$ "\adrchar{" adr.char "}" * * write$ newline$
643 adr.char chr.to.int$ 'cur.adr.char :=
644 }
645 'skip$
646 %</!birthday>
647 %<*birthday>
648 { b.month cur.month =
649 'skip$
650 { newline$ "\adrchar{\convdate{" b.month "}}" * * write$ newline$
651 b.month 'cur.month :=
652 }
653 %</birthday>
654 if$
655 }
656 % \end{macrocode}
657 %\iffalse
658 % $% <-- we do this to correct syntax highlight.
659 %\fi
660 % \begin{macrocode}
661 %<*!fax>
662 FUNCTION{format.phone.and.mobile}
663 { phone empty$
664 {
665 mobile empty$
666 { "" }
667 { mobile }
668 if$
669 }{
670 mobile empty$
671 { phone }
672 { phone "\\" mobile * * }
673 if$
674 }
675 if$
676 }
677 %</!fax>
678 % \end{macrocode}
679 % \begin{macrocode}
680 %<*fax>
681 FUNCTION{format.phone.and.fax}
682 { phone empty$
683 { "" }
684 { phone }
685 if$
686 fax empty$
687 'skip$
688 { phone empty$
689 { fax * }
690 { "\\Fax:\\" fax * * }
691 if$
692 }
693 if$
694 }
695 %</fax>
696 % \end{macrocode}
697 %\iffalse
698 % $% <-- we do this to correct syntax hightlight.
699 %\fi
700 % \begin{macrocode}
701 FUNCTION{address}
702 {
703 %<*birthday>
704 nbirthday empty$
705 'skip$
706 {
707 %</birthday>
708 print.adrchr
709 "\adrentry" write$
710 get.names write$ newline$
711 "{"
712 street empty$
713 { "" * }
714 { street " \\ " * *}
715 if$
716 zip empty$
717 { "" * }
718 { zip " " * *}
719 if$
720 city empty$
721 { "" * }
722 { city * }
723 if$
724 "}{" *
725 %<!fax> format.phone.and.mobile
726 %<fax> format.phone.and.fax
727 "}" * *
728 email empty$
729 { "{}" * }
730 { "{" email "}" * * * }
731 if$
732 organization empty$
733 { "{}" * }
734 { "{" organization "}" * * *}
735 if$
736 note empty$
737 { "{}" * }
738 { "{" note "}" * * * }
739 if$
740 "{" *
741 %<*birthday>
742 birthday empty$
743 { "" }
744 { birthday }
745 if$
746 "}{" * *
747 %</birthday>
748 key empty$
749 { "" }
750 { key }
751 if$
752 "}" * * write$ newline$
753 %<*birthday>
754 }
755 if$
756 %</birthday>
757 }
758 % \end{macrocode}
759 % \begin{macrocode}
760 FUNCTION{presort}
761 %<*!birthday>
762 {
763 sortas empty$
764 { name empty$
765 { organization empty$
766 { key empty$
767 { "No name, organization, or key to sort " cite$ * warning$
768 "???"
769 }
770 { key }
771 if$
772 }
773 { organization }
774 if$
775 }
776 { name #1 "{ll},{f }{v }{, j}" format.name$ }
777 if$
778 }
779 { sortas }
780 %</!birthday>
781 %<*birthday>
782 { nbirthday empty$
783 { "" }
784 { nbirthday }
785 %</birthday>
786 if$
787 duplicate$
788 'sort.key$ :=
789 %<*!birthday>
790 #1 #1 substring$
791 'adr.char :=
792 %</!birthday>
793 %<*birthday>
794 #1 #2 substring$
795 'b.month :=
796 %</birthday>
797 % \end{macrocode}
798 % At every but \File{adrbirthday.bst} the adr.char is the first letter of
799 % the sort.key.
800 % \begin{macrocode}
801 }
802 % \end{macrocode}
803 % \begin{macrocode}
804 READ
805 % \end{macrocode}
806 % \begin{macrocode}
807 ITERATE {presort}
808 % \end{macrocode}
809 % \begin{macrocode}
810 SORT
811 % \end{macrocode}
812 % \begin{macrocode}
813 FUNCTION {begin.bib}
814 {
815 %<*birthday>
816 "\def\convdate#1{\ifcase#1 \or 1 \or 2 \or 3 \or 4 \or 5 "
817 "\or 6 \or 7 \or 8 \or 9 \or 10 \or 11 \or 12 \fi}" * 'num.index :=
818 "\def\convdate#1{\ifcase#1 \or Januar \or Februar \or "
819 " M{^^b a}rz \or April \or Mai \or Juni \or Juli "
820 "\or August \or September \or Oktober \or November \or Dezember \fi}"
821 * * 'alpha.index :=
822 alpha.index write$
823 newline$
824 %</birthday>
825 preamble$ empty$
826 'skip$
827 { preamble$ write$ newline$ }
828 if$
829 %<!birthday> #0 'cur.adr.char :=
830 %<birthday> "00" 'cur.month :=
831 }
832 %\iffalse
833 % $% <-- we do this to correct syntax hightlight.
834 %\fi
835 % \begin{macrocode}
836 EXECUTE {begin.bib}
837 % \end{macrocode}
838 % \begin{macrocode}
839 ITERATE {call.type$}
840 % \end{macrocode}
841 % Print a newline and flush the write buffer
842 % \begin{macrocode}
843 FUNCTION {end.bib}
844 { newline$ }
845 % \end{macrocode}
846 % \begin{macrocode}
847 EXECUTE {end.bib}
848 % \end{macrocode}
849 %
850 % \iffalse
851 %</bst>
852 % \fi
853 %
854 %
855 % \section{An example \BibTeX{} database}
856 %
857 % Do not believe everything you read here. It is just a
858 % demonstration.
859 %
860 % \iffalse
861 %<*bib>
862 %<*example>
863 % \fi
864 % \begin{macrocode}
865
866 @address{VornameNachname,
867 name = {Vorname Nachname},
868 street = {Strasse},
869 zip = {PLZ},
870 city = {Ort},
871 phone = {Telefon},
872 email = {E-mail@domain},
873 mobile = {Mobil},
874 birthday = {Geburtstag},
875 note = {Notiz},
876 organization = {Organisation},
877 key = {Key},
878 nbirthday = {0101},
879 }
880
881 @address{mustermann,
882 name = {Hans Mustermann},
883 city = {Heimstatt},
884 zip = 01234,
885 country = {D -},
886 street = {Einbahnstra{\ss}e 1},
887 phone = {01234 / 5 67 89},
888 fax = {01234 / 5 67 89},
889 email = {[email protected]},
890 note = {Alles nur Erfindung},
891 }
892 @address{AxelK,
893 name = {Axel Kielhorn},
894 city = {Verden},
895 zip = 27283,
896 street = {Lange Stra{\ss}e 17},
897 phone = {04231 / 12 34 56},
898 fax = {04231 / 65 34 21},
899 email = {[email protected]},
900 key = {Aki},
901 note = {Author of the modified addressen.bst},
902 birthday = {16.05.1967},
903 nbirthday = 0516,
904 }
905 @address{RalfK,
906 name = {Ralf Kielhorn},
907 city = {Braunschweig},
908 zip = 38116,
909 street = {Gro{\ss}e Stra{\ss}e 17},
910 phone = {0531 / 12 34 56},
911 key = {Rki},
912 birthday = {05.08.1969},
913 nbirthday = 0805,
914 }
915 @address{SabineK,
916 name = {Sabine Kielhorn},
917 city = {Oldenburg},
918 zip = 26133,
919 street = {Fraunhoferstra{\ss}e 21},
920 phone = {0441 / 12 34 56},
921 key = {Ski},
922 birthday = {13.11.1970},
923 nbirthday = 1113,
924 }
925 @address{OEKZ,
926 name = {{{"O}kologisches Zentrum~e.\,V.}},
927 sortas = {Okologisches Zentrum},
928 organization = {Verband der Vereine},
929 city = {Heimstatt},
930 zip = 01234,
931 country = {Germany},
932 street = {Mauerstra{\ss}e 1},
933 phone = {01234 / 5 67 89},
934 fax = {01234 / 5 67 89},
935 email = {[email protected]},
936 key = {OEKZ},
937 }
938 @address{DANTE,
939 name = {{DANTE~e.\,V.}},
940 sortas = {Dante},
941 street = {Postfach 10 18 40},
942 zip = {69008},
943 city = {Heidelberg},
944 phone = {0 62 21 / 2 97 66},
945 fax = {0 62 21 / 16 79 06},
946 email = {[email protected]},
947 url = {http://www.dante.de},
948 key = {DANTE},
949 birthday = {14. April 1989},
950 nbirthday = {0414}
951 }
952
953 % \end{macrocode}
954 %
955 % \iffalse
956 %</example>
957 %</bib>
958 % \fi
959 % \changes{v1.3}{2010/04/02}{Added support for PDF workflow.}
960 %<*montage>
961 % \begin{macrocode}
962 \documentclass{article}
963 \usepackage{geometry}
964 \geometry{verbose,twoside,nofoot,pdftex,%
965 %<erster>a5paper, top=0mm,bottom=0mm,inner=0mm}
966 %<zweiter>a4paper,top=0mm,bottom=0mm,inner=0mm}
967 \usepackage{pdfpages}
968 \begin{document}
969 \includepdf[pages={-},
970 landscape,
971 nup=1x2,
972 %<erster>signature=16,
973 %<zweiter>signature=4,
974 %<erster>noautoscale,scale=1]{adrdir.pdf}
975 %<zweiter>noautoscale,scale=1]{adrmontage1.pdf}
976 \end{document}
977 % \end{macrocode}
978 %</montage>
979 %
980 % \Finale
981 \endinput
982 %
983 % end of file ``adrconv.dtx''