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
|
%-*-Web-*-
% This is APREAMBL.DOC, written by Hans-Hermann Bode (HHBODE@@DOSUNI1.BITNET).
% Use MAKEPROG to generate the program, use TeX to produce the documentation.
% This program is distributed WITHOUT ANY WARRANTY, express or implied.
% Copyright (C) 1991, 1992 Hans-Hermann Bode
% Permission is granted to make and distribute verbatim copies of this
% document provided that the copyright notice and this permission notice
% are preserved on all copies.
% Permission is granted to copy and distribute modified versions of this
% document under the conditions for verbatim copying, provided that the
% entire resulting derived work is distributed under the terms of a
% permission notice identical to this one.
% Version history:
%
% Version Date Author Comment
% 1.10a 18 Jul 1991 H2B First version for public release.
% 1.10b 10 Aug 1991 H2B Improved handling of the language
% switch, using MakeProg for
% documentation.
% 1.10c 04 Apr 1992 H2B Preventing multiple input, hiding
% local identifiers, extending
% documentation.
% 1.10d 15 Apr 1992 H2B Incompatibility with german.sty 2.4a
% fixed.
% 1.10e 28 Jun 1992 H2B Problem with |\mdqoff| fixed.
%-----------------------------------------------------------------------------
\input docmac
\def\title{APREAMBL}
\def\curversion{1.10e}
\def\curdate{June 1992}
\def\topofcontents{\null\vfill
\centerline{\ttitlefont\title}
\medskip
\centerline{Preamble definitions for the \BibTeX\ `adaptable' family}
\medskip
\centerline{Version \curversion, \curdate}
\bigskip
\centerline{\sl Hans-Hermann Bode}
\centerline{\sl Arbeitsgruppe Systemforschung, Universit\"at Osnabr\"uck}
\vfill}
\def\botofcontents{\vfill
\noindent
Copyright \copyright\ 1991,\thinspace1992 Hans-Hermann Bode
\bigskip\noindent
Permission is granted to make and distribute verbatim copies of this
document provided that the copyright notice and this permission notice
are preserved on all copies.
\smallskip\noindent
Permission is granted to copy and distribute modified versions of this
document under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.}
%-----------------------------------------------------------------------------
%\input amssym.def
%\input btxmac
%\input sammac
\input a4c
%\frenchspacing
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\chap Introduction. %---------------------------------------------------------
This file provides preamble definitions for use with the \BibTeX\
`adaptable' family. It has to be read in at the beginning of a bibliography
that was generated by one of the adaptable styles. Usually this will be done
implicitly by means of an |@PREAMBLE| command in one of the bibliography
databases included in the |\bibliography| enumeration (e.g.,
\.{jourfull.bib} or \.{jourabbr.bib}), otherwise it must be |\input|
explicitly right before the |\bibliography| macro is executed.
\beginprog
% This is APREAMBL.TEX, version 1.10e, written by Hans-Hermann Bode
% (HHBODE@DOSUNI1.BITNET), for the BibTeX `adaptable' family, version 1.10.
% See the file APREAMBL.DOC for a detailed documentation.
% This program is distributed WITHOUT ANY WARRANTY, express or implied.
% Copyright (C) 1991, 1992 Hans-Hermann Bode
% Permission is granted to make and distribute verbatim copies of this
% document provided that the copyright notice and this permission notice
% are preserved on all copies.
% Permission is granted to copy and distribute modified versions of this
% document under the conditions for verbatim copying, provided that the
% entire resulting derived work is distributed under the terms of a
% permission notice identical to this one.
\endprog
\sect We use the---hopefully unique---identifier
|\csname__APREAMBLE_TEX\endcsname| to decide whether this file was already
read. If that identifier hasn't the meaning of |\relax|, we assume that this
event arose and execute an |\endinput|; otherwise, we continue and store the
|\catcode| of~|@| into it, which then will be set to~11 for use in local
macro names. Hence, |\csname__APREAMBLE_TEX\endcsname| now is defined to
prevent the file from multiply being input, and---on the other hand---we can
restore the |\catcode| of~|@| in the end.
\beginprog
\expandafter\ifx\csname__APREAMBLE_TEX\endcsname\relax \else\endinput\fi
\expandafter\chardef\csname__APREAMBLE_TEX\endcsname=\the\catcode`\@
\catcode`\@=11
\endprog
\chap Setting style parameters. %---------------------------------------------
The typesetting style of certain fields of the bibliography entries is
determined by the |\abtype| command. It is called by the adaptable styles
with two arguments: The first is a number that denotes the field in
question, the second is the text to format. The meaning of the first
parameter is declared in Tab.~1.
$$\hbox{\sl Table~1: The first parameter of |\abtype|.\strut}$$
$$\vbox{\halign{\strut\hfill#\hfill\quad & \vtop{\hsize=5cm\noindent#} \cr
\noalign{\hrule\hrule}
Value & Meaning \cr
\noalign{\hrule}
0 & author and editor names \cr
1 & titles of books and series \cr
2 & journal titles \cr
3 & journal volumes \cr
4 & journal numbers \cr
5 & dates \cr
\noalign{\hrule\hrule}
}}
$$
A comparison with the definition below shows that {\sc author and editor
names} will be typeset in small caps, ``titles of books and series'' will be
put in quotes, {\it journal titles\/} will come out in italics, {\bf journal
volumes} will be boldface, and (journal numbers) and (dates) will be
parenthesized. This may be changed to fit your needs.
Currently, there is an English and a German version of the command. In the
German version, the commands |\glqq| and |\grqq|---defined in
\.{german.sty}---are used instead of |"`| and |"'|, in case we have
|\mdqoff| (double-quotes inactive) but |\language=\german|.
\beginprog
\gdef\abtype@english{%
\def\abtype##1##2{%
\ifcase##1{\sc##2}\or``##2''\or{\em##2\/}\or{\bf##2}\or(##2)\or(##2)\else##2\fi}}
\gdef\abtype@german{%
\def\abtype##1##2{%
\ifcase##1{\sc##2}\or\glqq##2\grqq\or{\em##2\/}\or{\bf##2}\or(##2)\or(##2)\else##2\fi}}
\endprog
\chap Definition of phrases. %------------------------------------------------
Phrases are defined by the |\abphrase| command. The only parameter is a code
for the phrase that is explained in Tab.~2.
$$\hbox{\sl Table~2: The parameter of |\abphrase|.\strut}$$
$$\vbox{\halign{\strut\hfill#\hfill\quad & \vtop{\hsize=10cm\noindent#} \cr
\noalign{\hrule\hrule}
Value & Meaning \cr
\noalign{\hrule}
0 & conjunction between two or before the last name of a name list \cr
1 & comes before the last conjunction of a name list \cr
2 & replaces names of co-authors and co-editors (``et al.'') \cr
3 & marks multiple editors \cr
4 & marks a single editor \cr
5 & ``of'' for a volume of a series or crossref \cr
6 & ``in'' for a number in a series \cr
7 & ``In'' for crossrefs to books, articles, etc. \cr
8 & comes before a volume number, lower-case \cr
9 & comes before a volume number, upper-case \cr
10 & comes before a series number, lower-case \cr
11 & comes before a series number, upper-case \cr
12 & comes after an edition number \cr
13 & comes before multiple page numbers \cr
14 & comes before a single page number \cr
15 & comes before a chapter number \cr
16 & denotes a technical report \cr
17 & denotes a master's thesis \cr
18 & denotes a phd thesis \cr
\noalign{\hrule\hrule}
}}
$$
Besides, macros for month names, edition numbers, and ``chapter'' names are
defined. (The |\abedition| command may be extended for higher edition numbers
and called directly or---better---via |@STRING| declarations in the \.{bib}
files).
For all these commands there exists a ``full'' and an ``abbreviated''
version. The |\ifabfull| switch is automatically defined by the adaptable
styles in front of the preamble and tells which version to use.
Furthermore, phrases can be supplied for various languages. For now, English
and German versions are available, but other languages might be implemented
similarly. If you carry out such an implementation, {\sl watch out for
spaces\/} that may be significant.
\sect Here is the English version:
\beginprog
\ifabfull
\gdef\abetc@english{
\def\abphrase##1{%
\ifcase##1{ and }\or{,}\or{ et~al.}\or{, editors}\or{, editor}\or%
{ of }\or{ in }\or{In }\or{volume}\or{Volume}\or{number}\or{Number}\or%
{ edition}\or{pages}\or{page}\or{chapter}\or%
{Technical Report}\or{Master's thesis}\or{PhD thesis}\fi}
\def\abmonth##1{\ifcase##1\or January\or February\or March\or April\or May\or
June\or July\or August\or September\or October\or November\or December\fi}
\def\abedition##1{\ifcase##1\or First\or Second\or Third\or Fourth\or Fifth\or
Sixth\or Seventh\or Eighth\or Ninth\or Tenth\else?\fi}
\def\abchapter##1{\ifcase##1Section\or Paragraph\or Appendix\or Part\fi}
}
\else
\gdef\abetc@english{
\def\abphrase##1{%
\ifcase##1{ and }\or{,}\or{ et~al.}\or{, editors}\or{, editor}\or%
{ of }\or{ in }\or{In }\or{vol.}\or{Vol.}\or{no.}\or{No.}\or%
{ ed.}\or{pp.}\or{p.}\or{ch.}\or%
{Technical Report}\or{Master's thesis}\or{PhD thesis}\fi}
\def\abmonth##1{\ifcase##1\or Jan.\or Feb.\or Mar.\or Apr.\or May\or June\or
July\or Aug.\or Sept.\or Oct.\or Nov.\or Dec.\fi}
\def\abedition##1{\ifcase##1\or 1st\or 2nd\or 3rd\or 4th\or 5th\or
6th\or 7th\or 8th\or 9th\or 10th\else?\fi}
\def\abchapter##1{\ifcase##1Sec.\or Par.\or App.\or Part\fi}
}
\fi
\endprog
\sect And here is the German version, in which again we bear in mind the
potential case that the current language is German but double-quotes are not
active. Thus, we use |{\kern0pt}| instead of \.{"\vbar} (from
\.{german.sty}) to get rid of ligatures and |\"| instead of |"| (ditto) for
umlauts.
\beginprog
\ifabfull
\gdef\abetc@german{
\def\abphrase##1{%
\ifcase##1{ und }\or{}\or{ und andere}\or{ (Herausgeber)}\or{ (Herausgeber)}\or%
{ aus }\or{ in }\or{In }\or{Band}\or{Band}\or{Nummer}\or{Nummer}\or%
{ Auf{\kern0pt}lage}\or{Seiten}\or{Seite}\or{Kapitel}\or%
{Bericht}\or{Diplomarbeit}\or{Dissertation}\fi}
\def\abmonth##1{\ifcase##1\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}
\def\abedition##1{\ifcase##1\or Erste\or Zweite\or Dritte\or Vierte\or F\"unf\-te\or
Sechste\or Siebte\or Achte\or Neunte\or Zehnte\else?\fi}
\def\abchapter##1{\ifcase##1Abschnitt\or Absatz\or Anhang\or Teil\fi}
}
\else
\gdef\abetc@german{
\def\abphrase##1{%
\ifcase##1{ und }\or{}\or{ u.\thinspace a.}\or{ (Hrsg.)}\or{ (Hrsg.)}\or%
{ aus }\or{ in }\or{In }\or{Bd.}\or{Bd.}\or{Nr.}\or{Nr.}\or%
{ Aufl.}\or{S.}\or{S.}\or{Kap.}\or%
{Bericht}\or{Diplomarbeit}\or{Dissertation}\fi}
\def\abmonth##1{\ifcase##1\or Jan.\or Feb.\or M\"arz\or Apr.\or Mai\or
Juni\or Juli\or Aug.\or Sep.\or Okt.\or Nov.\or Dez.\fi}
\def\abedition##1{\ifcase##1\or 1.\or 2.\or 3.\or 4.\or 5.\or
6.\or 7.\or 8.\or 9.\or 10.\else?\fi}
\def\abchapter##1{\ifcase##1Abschn.\or Abs.\or Anh.\or Teil\fi}
}
\fi
\endprog
\chap Establishing a language switch. %---------------------------------------
Now we have reached the point where we have to decide which of the language
versions defined above to use. We like to make this decision automatically,
without bothering the user with the declaration of an extra language
command. This, however, is a somewhat delicate task since, although \TeX~3
defines a |\language| counter, it doesn't say which code belongs to a given
actual language (and, in addition, what about former \TeX\ versions?).
It will come out that at least two groups of users should agree with our way
to handle this: those who always write English documents and those who use
the \.{german.sty} macro package. If we detect that \.{german.sty} is loaded
we follow the codes defined there, otherwise we create an English
bibliography. (Due to this, \.{german.sty} clearly has to be loaded before
\.{apreambl.tex}---if at all---; this should be no problem with \LaTeX\
where |german| is a document-style option, but with plain \TeX, take care
that |\input german.sty| comes before |\bibliography{...}| if necessary.)
Incidentally, the checking of certain conditions and the definitions made in
the following are stolen from \.{german.sty}.
First, if |\language| has not yet been declared we allocate a counter:
\beginprog
\expandafter\ifx\csname language\endcsname\relax % \ifundefined{language}
\csname newcount\endcsname\language
\fi
\endprog
\sect If the macro |\mdqon| is undefined or is equal to |\relax|, it is
assumed that \.{german.sty} is not included. In this case we define language
codes according to \.{german.sty} and select |\USenglish| as the default
setting. The |\chardef| declarations for the other languages aren't really
necessary for \.{apreambl}, but in this manner the user can rely on the
fact that |\USenglish|, |\german|, |\austrian|, |\french|, and |\english| are
defined and have appropriate meanings whether \.{german.sty} is loaded or
not; so, he or she can make use of them in his or her \.{bib} files for
special purposes.
A slight surprise came about when \.{german.sty}, version 2.4a, was
released: the control sequences above disappeared and are replaced by
|\l@USenglish| etc. Furthermore, one can't rely on certain values for these
anymore. To fix this problem quickly, we check for that new control
sequences, if \.{german.sty} is loaded, and in case define the old ones
appropriately (this may be changed in the future). Thus, \.{apreambl} should
work with old and new versions of \.{german.sty}.
\beginprog
\expandafter\ifx\csname mdqon\endcsname\relax % \ifundefined{mdqon}
\chardef\USenglish=0
\chardef\german=1
\chardef\austrian=1
\chardef\french=2
\chardef\english=0
\language\USenglish
\else
\expandafter\ifx\csname l@USenglish\endcsname\relax \else
\chardef\USenglish=\l@USenglish\fi
\expandafter\ifx\csname l@german\endcsname\relax \else
\chardef\german=\l@german\fi
\expandafter\ifx\csname l@austrian\endcsname\relax \else
\chardef\austrian=\l@austrian\fi
\expandafter\ifx\csname l@french\endcsname\relax \else
\chardef\french=\l@french\fi
\expandafter\ifx\csname l@english\endcsname\relax \else
\chardef\english=\l@english\fi
\fi
\endprog
\sect Finally, depending on the language switch and the abbreviation mode, one
of the macro sets is chosen. (At the moment, since only English and German
macro versions are available, the German versions are used for |\german| and
|\austrian|, and the English versions are used for all other languages.)
\beginprog
\ifnum\language=\german
\abtype@german \abetc@german
\else\ifnum\language=\austrian
\abtype@german \abetc@german
\else
\abtype@english \abetc@english
\fi\fi
\endprog
\chap Postlude. %-------------------------------------------------------------
At the very end, we restore the |\catcode| of~|@| and force the end of
inputting this file.
\beginprog
\catcode`\@=\csname__APREAMBLE_TEX\endcsname
\endinput
\endprog
%-----------------------------------------------------------------------------
\contentspage
|