Debian Codegraph @

texmf-dist/doc/bibtex/abstyles/apreambl.doc

raw
1 %-*-Web-*-
2 % This is APREAMBL.DOC, written by Hans-Hermann Bode (HHBODE@@DOSUNI1.BITNET).
3 % Use MAKEPROG to generate the program, use TeX to produce the documentation.
4
5 % This program is distributed WITHOUT ANY WARRANTY, express or implied.
6
7 % Copyright (C) 1991, 1992 Hans-Hermann Bode
8
9 % Permission is granted to make and distribute verbatim copies of this
10 % document provided that the copyright notice and this permission notice
11 % are preserved on all copies.
12
13 % Permission is granted to copy and distribute modified versions of this
14 % document under the conditions for verbatim copying, provided that the
15 % entire resulting derived work is distributed under the terms of a
16 % permission notice identical to this one.
17
18 % Version history:
19 %
20 % Version Date Author Comment
21 % 1.10a 18 Jul 1991 H2B First version for public release.
22 % 1.10b 10 Aug 1991 H2B Improved handling of the language
23 % switch, using MakeProg for
24 % documentation.
25 % 1.10c 04 Apr 1992 H2B Preventing multiple input, hiding
26 % local identifiers, extending
27 % documentation.
28 % 1.10d 15 Apr 1992 H2B Incompatibility with german.sty 2.4a
29 % fixed.
30 % 1.10e 28 Jun 1992 H2B Problem with |\mdqoff| fixed.
31
32 %-----------------------------------------------------------------------------
33
34 \input docmac
35
36 \def\title{APREAMBL}
37 \def\curversion{1.10e}
38 \def\curdate{June 1992}
39
40 \def\topofcontents{\null\vfill
41 \centerline{\ttitlefont\title}
42 \medskip
43 \centerline{Preamble definitions for the \BibTeX\ `adaptable' family}
44 \medskip
45 \centerline{Version \curversion, \curdate}
46 \bigskip
47 \centerline{\sl Hans-Hermann Bode}
48 \centerline{\sl Arbeitsgruppe Systemforschung, Universit\"at Osnabr\"uck}
49 \vfill}
50
51 \def\botofcontents{\vfill
52 \noindent
53 Copyright \copyright\ 1991,\thinspace1992 Hans-Hermann Bode
54 \bigskip\noindent
55 Permission is granted to make and distribute verbatim copies of this
56 document provided that the copyright notice and this permission notice
57 are preserved on all copies.
58 \smallskip\noindent
59 Permission is granted to copy and distribute modified versions of this
60 document under the conditions for verbatim copying, provided that the
61 entire resulting derived work is distributed under the terms of a
62 permission notice identical to this one.}
63
64 %-----------------------------------------------------------------------------
65
66 %\input amssym.def
67 %\input btxmac
68 %\input sammac
69 \input a4c
70
71 %\frenchspacing
72
73 \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
74 T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
75 \def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
76 T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
77
78 \chap Introduction. %---------------------------------------------------------
79 This file provides preamble definitions for use with the \BibTeX\
80 `adaptable' family. It has to be read in at the beginning of a bibliography
81 that was generated by one of the adaptable styles. Usually this will be done
82 implicitly by means of an |@PREAMBLE| command in one of the bibliography
83 databases included in the |\bibliography| enumeration (e.g.,
84 \.{jourfull.bib} or \.{jourabbr.bib}), otherwise it must be |\input|
85 explicitly right before the |\bibliography| macro is executed.
86
87 \beginprog
88 % This is APREAMBL.TEX, version 1.10e, written by Hans-Hermann Bode
89 % ([email protected]), for the BibTeX `adaptable' family, version 1.10.
90 % See the file APREAMBL.DOC for a detailed documentation.
91
92 % This program is distributed WITHOUT ANY WARRANTY, express or implied.
93
94 % Copyright (C) 1991, 1992 Hans-Hermann Bode
95
96 % Permission is granted to make and distribute verbatim copies of this
97 % document provided that the copyright notice and this permission notice
98 % are preserved on all copies.
99
100 % Permission is granted to copy and distribute modified versions of this
101 % document under the conditions for verbatim copying, provided that the
102 % entire resulting derived work is distributed under the terms of a
103 % permission notice identical to this one.
104 \endprog
105
106 \sect We use the---hopefully unique---identifier
107 |\csname__APREAMBLE_TEX\endcsname| to decide whether this file was already
108 read. If that identifier hasn't the meaning of |\relax|, we assume that this
109 event arose and execute an |\endinput|; otherwise, we continue and store the
110 |\catcode| of~|@| into it, which then will be set to~11 for use in local
111 macro names. Hence, |\csname__APREAMBLE_TEX\endcsname| now is defined to
112 prevent the file from multiply being input, and---on the other hand---we can
113 restore the |\catcode| of~|@| in the end.
114
115 \beginprog
116 \expandafter\ifx\csname__APREAMBLE_TEX\endcsname\relax \else\endinput\fi
117 \expandafter\chardef\csname__APREAMBLE_TEX\endcsname=\the\catcode`\@
118 \catcode`\@=11
119 \endprog
120
121 \chap Setting style parameters. %---------------------------------------------
122 The typesetting style of certain fields of the bibliography entries is
123 determined by the |\abtype| command. It is called by the adaptable styles
124 with two arguments: The first is a number that denotes the field in
125 question, the second is the text to format. The meaning of the first
126 parameter is declared in Tab.~1.
127 $$\hbox{\sl Table~1: The first parameter of |\abtype|.\strut}$$
128 $$\vbox{\halign{\strut\hfill#\hfill\quad & \vtop{\hsize=5cm\noindent#} \cr
129 \noalign{\hrule\hrule}
130 Value & Meaning \cr
131 \noalign{\hrule}
132 0 & author and editor names \cr
133 1 & titles of books and series \cr
134 2 & journal titles \cr
135 3 & journal volumes \cr
136 4 & journal numbers \cr
137 5 & dates \cr
138 \noalign{\hrule\hrule}
139 }}
140 $$
141 A comparison with the definition below shows that {\sc author and editor
142 names} will be typeset in small caps, ``titles of books and series'' will be
143 put in quotes, {\it journal titles\/} will come out in italics, {\bf journal
144 volumes} will be boldface, and (journal numbers) and (dates) will be
145 parenthesized. This may be changed to fit your needs.
146
147 Currently, there is an English and a German version of the command. In the
148 German version, the commands |\glqq| and |\grqq|---defined in
149 \.{german.sty}---are used instead of |"`| and |"'|, in case we have
150 |\mdqoff| (double-quotes inactive) but |\language=\german|.
151
152 \beginprog
153 \gdef\abtype@english{%
154 \def\abtype##1##2{%
155 \ifcase##1{\sc##2}\or``##2''\or{\em##2\/}\or{\bf##2}\or(##2)\or(##2)\else##2\fi}}
156
157 \gdef\abtype@german{%
158 \def\abtype##1##2{%
159 \ifcase##1{\sc##2}\or\glqq##2\grqq\or{\em##2\/}\or{\bf##2}\or(##2)\or(##2)\else##2\fi}}
160 \endprog
161
162 \chap Definition of phrases. %------------------------------------------------
163 Phrases are defined by the |\abphrase| command. The only parameter is a code
164 for the phrase that is explained in Tab.~2.
165 $$\hbox{\sl Table~2: The parameter of |\abphrase|.\strut}$$
166 $$\vbox{\halign{\strut\hfill#\hfill\quad & \vtop{\hsize=10cm\noindent#} \cr
167 \noalign{\hrule\hrule}
168 Value & Meaning \cr
169 \noalign{\hrule}
170 0 & conjunction between two or before the last name of a name list \cr
171 1 & comes before the last conjunction of a name list \cr
172 2 & replaces names of co-authors and co-editors (``et al.'') \cr
173 3 & marks multiple editors \cr
174 4 & marks a single editor \cr
175 5 & ``of'' for a volume of a series or crossref \cr
176 6 & ``in'' for a number in a series \cr
177 7 & ``In'' for crossrefs to books, articles, etc. \cr
178 8 & comes before a volume number, lower-case \cr
179 9 & comes before a volume number, upper-case \cr
180 10 & comes before a series number, lower-case \cr
181 11 & comes before a series number, upper-case \cr
182 12 & comes after an edition number \cr
183 13 & comes before multiple page numbers \cr
184 14 & comes before a single page number \cr
185 15 & comes before a chapter number \cr
186 16 & denotes a technical report \cr
187 17 & denotes a master's thesis \cr
188 18 & denotes a phd thesis \cr
189 \noalign{\hrule\hrule}
190 }}
191 $$
192 Besides, macros for month names, edition numbers, and ``chapter'' names are
193 defined. (The |\abedition| command may be extended for higher edition numbers
194 and called directly or---better---via |@STRING| declarations in the \.{bib}
195 files).
196
197 For all these commands there exists a ``full'' and an ``abbreviated''
198 version. The |\ifabfull| switch is automatically defined by the adaptable
199 styles in front of the preamble and tells which version to use.
200
201 Furthermore, phrases can be supplied for various languages. For now, English
202 and German versions are available, but other languages might be implemented
203 similarly. If you carry out such an implementation, {\sl watch out for
204 spaces\/} that may be significant.
205
206 \sect Here is the English version:
207
208 \beginprog
209 \ifabfull
210
211 \gdef\abetc@english{
212
213 \def\abphrase##1{%
214 \ifcase##1{ and }\or{,}\or{ et~al.}\or{, editors}\or{, editor}\or%
215 { of }\or{ in }\or{In }\or{volume}\or{Volume}\or{number}\or{Number}\or%
216 { edition}\or{pages}\or{page}\or{chapter}\or%
217 {Technical Report}\or{Master's thesis}\or{PhD thesis}\fi}
218
219 \def\abmonth##1{\ifcase##1\or January\or February\or March\or April\or May\or
220 June\or July\or August\or September\or October\or November\or December\fi}
221
222 \def\abedition##1{\ifcase##1\or First\or Second\or Third\or Fourth\or Fifth\or
223 Sixth\or Seventh\or Eighth\or Ninth\or Tenth\else?\fi}
224
225 \def\abchapter##1{\ifcase##1Section\or Paragraph\or Appendix\or Part\fi}
226
227 }
228
229 \else
230
231 \gdef\abetc@english{
232
233 \def\abphrase##1{%
234 \ifcase##1{ and }\or{,}\or{ et~al.}\or{, editors}\or{, editor}\or%
235 { of }\or{ in }\or{In }\or{vol.}\or{Vol.}\or{no.}\or{No.}\or%
236 { ed.}\or{pp.}\or{p.}\or{ch.}\or%
237 {Technical Report}\or{Master's thesis}\or{PhD thesis}\fi}
238
239 \def\abmonth##1{\ifcase##1\or Jan.\or Feb.\or Mar.\or Apr.\or May\or June\or
240 July\or Aug.\or Sept.\or Oct.\or Nov.\or Dec.\fi}
241
242 \def\abedition##1{\ifcase##1\or 1st\or 2nd\or 3rd\or 4th\or 5th\or
243 6th\or 7th\or 8th\or 9th\or 10th\else?\fi}
244
245 \def\abchapter##1{\ifcase##1Sec.\or Par.\or App.\or Part\fi}
246
247 }
248
249 \fi
250 \endprog
251
252 \sect And here is the German version, in which again we bear in mind the
253 potential case that the current language is German but double-quotes are not
254 active. Thus, we use |{\kern0pt}| instead of \.{"\vbar} (from
255 \.{german.sty}) to get rid of ligatures and |\"| instead of |"| (ditto) for
256 umlauts.
257
258 \beginprog
259 \ifabfull
260
261 \gdef\abetc@german{
262
263 \def\abphrase##1{%
264 \ifcase##1{ und }\or{}\or{ und andere}\or{ (Herausgeber)}\or{ (Herausgeber)}\or%
265 { aus }\or{ in }\or{In }\or{Band}\or{Band}\or{Nummer}\or{Nummer}\or%
266 { Auf{\kern0pt}lage}\or{Seiten}\or{Seite}\or{Kapitel}\or%
267 {Bericht}\or{Diplomarbeit}\or{Dissertation}\fi}
268
269 \def\abmonth##1{\ifcase##1\or Januar\or Februar\or M\"arz\or April\or Mai\or
270 Juni\or Juli\or August\or September\or Oktober\or November\or Dezember\fi}
271
272 \def\abedition##1{\ifcase##1\or Erste\or Zweite\or Dritte\or Vierte\or F\"unf\-te\or
273 Sechste\or Siebte\or Achte\or Neunte\or Zehnte\else?\fi}
274
275 \def\abchapter##1{\ifcase##1Abschnitt\or Absatz\or Anhang\or Teil\fi}
276
277 }
278
279 \else
280
281 \gdef\abetc@german{
282
283 \def\abphrase##1{%
284 \ifcase##1{ und }\or{}\or{ u.\thinspace a.}\or{ (Hrsg.)}\or{ (Hrsg.)}\or%
285 { aus }\or{ in }\or{In }\or{Bd.}\or{Bd.}\or{Nr.}\or{Nr.}\or%
286 { Aufl.}\or{S.}\or{S.}\or{Kap.}\or%
287 {Bericht}\or{Diplomarbeit}\or{Dissertation}\fi}
288
289 \def\abmonth##1{\ifcase##1\or Jan.\or Feb.\or M\"arz\or Apr.\or Mai\or
290 Juni\or Juli\or Aug.\or Sep.\or Okt.\or Nov.\or Dez.\fi}
291
292 \def\abedition##1{\ifcase##1\or 1.\or 2.\or 3.\or 4.\or 5.\or
293 6.\or 7.\or 8.\or 9.\or 10.\else?\fi}
294
295 \def\abchapter##1{\ifcase##1Abschn.\or Abs.\or Anh.\or Teil\fi}
296
297 }
298
299 \fi
300 \endprog
301
302 \chap Establishing a language switch. %---------------------------------------
303 Now we have reached the point where we have to decide which of the language
304 versions defined above to use. We like to make this decision automatically,
305 without bothering the user with the declaration of an extra language
306 command. This, however, is a somewhat delicate task since, although \TeX~3
307 defines a |\language| counter, it doesn't say which code belongs to a given
308 actual language (and, in addition, what about former \TeX\ versions?).
309
310 It will come out that at least two groups of users should agree with our way
311 to handle this: those who always write English documents and those who use
312 the \.{german.sty} macro package. If we detect that \.{german.sty} is loaded
313 we follow the codes defined there, otherwise we create an English
314 bibliography. (Due to this, \.{german.sty} clearly has to be loaded before
315 \.{apreambl.tex}---if at all---; this should be no problem with \LaTeX\
316 where |german| is a document-style option, but with plain \TeX, take care
317 that |\input german.sty| comes before |\bibliography{...}| if necessary.)
318
319 Incidentally, the checking of certain conditions and the definitions made in
320 the following are stolen from \.{german.sty}.
321
322 First, if |\language| has not yet been declared we allocate a counter:
323
324 \beginprog
325 \expandafter\ifx\csname language\endcsname\relax % \ifundefined{language}
326 \csname newcount\endcsname\language
327 \fi
328 \endprog
329
330 \sect If the macro |\mdqon| is undefined or is equal to |\relax|, it is
331 assumed that \.{german.sty} is not included. In this case we define language
332 codes according to \.{german.sty} and select |\USenglish| as the default
333 setting. The |\chardef| declarations for the other languages aren't really
334 necessary for \.{apreambl}, but in this manner the user can rely on the
335 fact that |\USenglish|, |\german|, |\austrian|, |\french|, and |\english| are
336 defined and have appropriate meanings whether \.{german.sty} is loaded or
337 not; so, he or she can make use of them in his or her \.{bib} files for
338 special purposes.
339
340 A slight surprise came about when \.{german.sty}, version 2.4a, was
341 released: the control sequences above disappeared and are replaced by
342 |\l@USenglish| etc. Furthermore, one can't rely on certain values for these
343 anymore. To fix this problem quickly, we check for that new control
344 sequences, if \.{german.sty} is loaded, and in case define the old ones
345 appropriately (this may be changed in the future). Thus, \.{apreambl} should
346 work with old and new versions of \.{german.sty}.
347
348 \beginprog
349 \expandafter\ifx\csname mdqon\endcsname\relax % \ifundefined{mdqon}
350 \chardef\USenglish=0
351 \chardef\german=1
352 \chardef\austrian=1
353 \chardef\french=2
354 \chardef\english=0
355 \language\USenglish
356 \else
357 \expandafter\ifx\csname l@USenglish\endcsname\relax \else
358 \chardef\USenglish=\l@USenglish\fi
359 \expandafter\ifx\csname l@german\endcsname\relax \else
360 \chardef\german=\l@german\fi
361 \expandafter\ifx\csname l@austrian\endcsname\relax \else
362 \chardef\austrian=\l@austrian\fi
363 \expandafter\ifx\csname l@french\endcsname\relax \else
364 \chardef\french=\l@french\fi
365 \expandafter\ifx\csname l@english\endcsname\relax \else
366 \chardef\english=\l@english\fi
367 \fi
368 \endprog
369
370 \sect Finally, depending on the language switch and the abbreviation mode, one
371 of the macro sets is chosen. (At the moment, since only English and German
372 macro versions are available, the German versions are used for |\german| and
373 |\austrian|, and the English versions are used for all other languages.)
374
375 \beginprog
376 \ifnum\language=\german
377 \abtype@german \abetc@german
378 \else\ifnum\language=\austrian
379 \abtype@german \abetc@german
380 \else
381 \abtype@english \abetc@english
382 \fi\fi
383 \endprog
384
385 \chap Postlude. %-------------------------------------------------------------
386 At the very end, we restore the |\catcode| of~|@| and force the end of
387 inputting this file.
388
389 \beginprog
390 \catcode`\@=\csname__APREAMBLE_TEX\endcsname
391 \endinput
392 \endprog
393
394 %-----------------------------------------------------------------------------
395
396 \contentspage