From 7410502d1d3c16f11d788b7d082770e45b421b12 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Apr 2007 23:09:15 +0000 Subject: abstyles fix/update (Juan Torrens mail to mactex-support, 9 Apr 2007 15:42:42) git-svn-id: svn://tug.org/texlive/trunk@4150 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/bibtex/abstyles/README | 140 + Master/texmf-dist/doc/bibtex/abstyles/a4c.sty | 27 + Master/texmf-dist/doc/bibtex/abstyles/a4c.tex | 30 + Master/texmf-dist/doc/bibtex/abstyles/abstdok.pdf | Bin 0 -> 121954 bytes Master/texmf-dist/doc/bibtex/abstyles/abstdok.tex | 483 ++++ Master/texmf-dist/doc/bibtex/abstyles/apreambl.doc | 396 +++ Master/texmf-dist/doc/bibtex/abstyles/btxabst.doc | 2878 ++++++++++++++++++++ Master/texmf-dist/doc/bibtex/abstyles/docmac.doc | 778 ++++++ Master/texmf-dist/doc/bibtex/abstyles/docmac.tex | 238 ++ 9 files changed, 4970 insertions(+) create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/README create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/a4c.sty create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/a4c.tex create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/abstdok.pdf create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/abstdok.tex create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/apreambl.doc create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/btxabst.doc create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/docmac.doc create mode 100644 Master/texmf-dist/doc/bibtex/abstyles/docmac.tex (limited to 'Master/texmf-dist/doc/bibtex/abstyles') diff --git a/Master/texmf-dist/doc/bibtex/abstyles/README b/Master/texmf-dist/doc/bibtex/abstyles/README new file mode 100644 index 00000000000..fdaf3133569 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/README @@ -0,0 +1,140 @@ + -*-Text-*- +This is the BibTeX `adaptable' family of style files, version 1.10 as of +April 1992, derived from the `plain' family by Hans-Hermann Bode. It allows +setting of certain style parameters and definition of phrases without +changing the style files, thus a multiple-language support is provided and +the user may adapt the bibliography layout to his or her requirements within +some limits. + +Send suggestions and bug reports to HHBODE@DOSUNI1.BITNET. + +This directory contains the following files: + +./README this file +./btxabst.doc master file for creating the bst files +./aplain.bst adaptable style, `plain' version +./aabbrv.bst adaptable style, `abbreviated' version +./aunsrt.bst adaptable style, `unsorted' version +./aalpha.bst adaptable style, `alphanumeric' version +./anotit.bst adaptable style, `no titles' version +./aunsnot.bst adaptable style, `unsorted/no titles' version +./apreambl.doc preamble file, documentation +./apreambl.tex preamble file, to be input at the beginning of the bibliography +./jourabbr.bib journal names, abbreviated version +./jourfull.bib journal names, full version +./acompat.bib compatibility definitions for use with standard styles +./abstdok.tex documentation of the adaptable family (in German) +./abstdok.bbl bibliography for abstdok +./a4c.sty definition of length parameters for DIN-A4 paper, LaTeX version +./a4c.tex definition of length parameters for DIN-A4 paper, WEB version +./docmac.doc documentation of documentation macros (indeed!) +./docmac.tex documentation macros + +*** Installation ------------------------------------------------------------- + +To get a working adaptable-styles system you have to copy the following +files into special directories. + +-- Copy all *.bst files into a directory where BibTeX looks for style files. +This will usually be a directory in the TEXINPUT(S) path, i.e., in the same +path where TeX looks for its input files. + +-- Copy apreambl.tex into a directory where TeX looks for its input files, +see above. + +-- Copy all *.bib files into a directory where BibTeX looks for bibliography +databases. This will usually be a directory in the BIBINPUT(S) path. + +Optionally, you may copy a4c.* and docmac.tex into a directory in the +TEXINPUT(S) path. These files will be needed when printing the +documentation; they may be useful, however, for other applications as well. + +*** Printing the documentation ----------------------------------------------- + +The main documentation is a LaTeX source in abstdok.tex. Run LaTeX on this +file twice (for resolving cross references) and make sure that apreambl.tex, +abstdok.bbl, and a4c.sty can be loaded. In addition, the file german.sty is +required; it is not included in this distribution, since you should be able +to get it from every good TeX server (at least in Germany). The style file +a4c.sty will set up length parameters so that the document will come out +centered with margins of 2 cm on each side of a DIN-A4 sheet; if this +doesn't fit to your paper format, you may want to edit this file first. +Unfortunately, this documentation is written in German (which is due to the +fact that European people sometimes get nostalgic and switch to their native +language); if you feel the need to translate this into English, don't +hesitate to do so (and send me the file, so I can include it into the next +distribution). + +The definition of the adaptable parameters is discussed in apreambl.doc (in +English, yes). Run this through TeX (not LaTeX, and don't forget the .doc +extension!) and make sure that a4c.tex and docmac.tex can be loaded. The +file a4c.tex corresponds to a4c.sty above, and docmac.tex contains macros +for typesetting a WEB-style documentation. In fact, apreambl.tex is derived +from apreambl.doc by means of Joachim Schrod's MAKEPROG system, which is a +general documentation tool much similar to the WEB system of structured +documentation; docmac.tex is an enhancement of MAKEPROG's macro package +progdoc.tex which makes the documentation layout more ``WEB-like''. If you +want to change some of the adaptable parameters, the best way to do it is to +get MAKEPROG (it should be available from the same source as the adaptable +style files) and write a changefile to apreambl.doc. Then there is a good +chance that you can apply your changes to future versions of this +distribution without major modifications. Moreover, you can use MAKEPROG and +docmac.tex for your own developments, it's worth a try! (In this case you may +want to look at docmac's documentation: just run TeX on docmac.doc and make +sure that docmac.tex is loadable.) + +Further documentation is provided in plain-text form in the files +jourabbr.bib, jourfull.bib, and acompat.bib. You may want to edit the first +two of them to add more journal names or other general stuff that should be +defined at the beginning of your bibliographies. + +*** Usage hints (VERY brief) ------------------------------------------------- + +It is assumed that you are familiar with the BibTeX philosophy and the +standard style files, so here is a short description what you have to do in +addition to use the adaptable styles. + +Choose one of the styles aplain, aabbrv, aunsrt, aalpha, anotit, or aunsnot +(the first four are the adaptable versions of the corresponding standard +styles, anotit is like aabbrv but omits titles of articles and some other +redundant information, aunsnot is like anotit but doesn't sort the +bibliography) and put a statement like + + \bibliographystyle{aplain} + +somewhere into your document. + +Make sure that apreambl.tex is input before the \bibliography command is +executed. The easiest way to do so is to include jourfull or jourabbr at the +beginning of your \bibliography list. The file apreambl.tex carries out all +parameter settings and switches between `full' and `abbreviated' as well as +English and German versions of phrases automatically. The version it selects +depends on the bibliography style and on the fact whether german.sty is +loaded or not. The databases jourfull.bib and jourabbr.bib will load +apreambl.tex and, furthermore, will define all strings that are lacking in +the adaptable styles in comparison with the standard styles; hence, with +this files you can use your old databases without changes, and---as +mentioned above---this is the right place to add your own general +definitions. So, a typical \bibliography command should look like + + \bibliography{jourfull,user1,user2,user3} + +where user1, user2, and user3 are your private bibliography databases. + +If you ever feel the need to use one of the standard styles again, your +databases---due to the use of special features of the adaptable styles---may +not be compatible any more. The compatibility can be restored by means of +acompat.bib, which defines all additional strings of the adaptable styles +and should be included at the very beginning of the \bibliography list, e.g., + + \bibliography{acompat,jourfull,user1,user2,user3}\bibliographystyle{plain} + +Of course, acompat is not required for use with the adaptable styles alone. + +*** Correction --------------------------------------------------------------- + +In parts of the documentation, the files apreambl.doc and apreambl.tex are +referred to as apreamble.doc and apreamble.tex. The names were shortened to +avoid difficulties with some operating systems with low-length file names. + + --H2B diff --git a/Master/texmf-dist/doc/bibtex/abstyles/a4c.sty b/Master/texmf-dist/doc/bibtex/abstyles/a4c.sty new file mode 100644 index 00000000000..7d407b75d10 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/a4c.sty @@ -0,0 +1,27 @@ +% This is A4C.STY, a LaTeX style file written by Hans-Hermann Bode +% (HHBODE@DOSUNI1.BITNET), that sets up a page layout appropriate for DIN-A4 +% paper sheets (210 mm x 297 mm). +% +% The text is horizontally centered with margins of 2 cm left and right. +% +% It is assumed, that the DVI driver sets margins of 1 in left and top. +% +% Version Date Author Comment +% 1.00 08 Sep 1991 H2B First version + +\textwidth21cm % full paper +\textheight29.7cm + +\oddsidemargin2cm % margins +\evensidemargin\oddsidemargin +\topmargin2cm + +\addtolength{\textwidth}{-\oddsidemargin} % odd/left or even/right margin +\addtolength{\textwidth}{-\evensidemargin} % odd/right or even/left margin +\addtolength{\textheight}{-2\topmargin} % top and bottom margin +\addtolength{\textheight}{-\headheight} +\addtolength{\textheight}{-\headsep} +\addtolength{\textheight}{-\footskip} + +\hoffset-1in % compensate the driver margins +\voffset-1in diff --git a/Master/texmf-dist/doc/bibtex/abstyles/a4c.tex b/Master/texmf-dist/doc/bibtex/abstyles/a4c.tex new file mode 100644 index 00000000000..ae619c66ab7 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/a4c.tex @@ -0,0 +1,30 @@ +% This is A4C.TEX, a TeX macro file for WEB written by Hans-Hermann Bode +% (HHBODE@DOSUNI1.BITNET), that sets up a page layout appropriate for DIN-A4 +% paper sheets (210 mm x 297 mm). +% +% The text is horizontally centered with margins of 2 cm left and right. +% +% It is assumed, that the DVI driver sets margins of 1 in left and top. +% +% Version Date Author Comment +% 1.00 08 Sep 1991 H2B First version +% 1.00a 28 Sep 1991 H2B Correction: missing setpage included + +\pagewidth21cm % full paper +\fullpageheight29.7cm + +\hoffset2cm % left margin +\pageshift0cm % additionally for odd-numbered pages +\voffset2cm % top margin + +\advance\pagewidth by-2\hoffset % minus margins +\advance\pagewidth by-2\pageshift % minus extra margins +\advance\fullpageheight by-2\voffset % minus margins + +\pageheight\fullpageheight % full text +\advance\pageheight by-0.3in % minus header + +\advance\hoffset by-1in % compensate the driver margins +\advance\voffset by-1in + +\setpage % tell TeX new dimensions diff --git a/Master/texmf-dist/doc/bibtex/abstyles/abstdok.pdf b/Master/texmf-dist/doc/bibtex/abstyles/abstdok.pdf new file mode 100644 index 00000000000..9d2c07f0e32 Binary files /dev/null and b/Master/texmf-dist/doc/bibtex/abstyles/abstdok.pdf differ diff --git a/Master/texmf-dist/doc/bibtex/abstyles/abstdok.tex b/Master/texmf-dist/doc/bibtex/abstyles/abstdok.tex new file mode 100644 index 00000000000..67911ed93ea --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/abstdok.tex @@ -0,0 +1,483 @@ + %-*-LaTeX-*- +\documentstyle[twoside,german,a4c]{article} +\pagestyle{headings} +\frenchspacing +\setlength{\doublerulesep}{0pt} + +\title{Neue \BibTeX-Style-Files: Die {\em adaptable family}} +\author{Hans-Hermann Bode\thanks{Postanschrift: Arbeitsgruppe Systemforschung, + Universit"at Osnabr"uck, Artilleriestra"se 34, D-W-4500 Osnabr"uck; e-mail: + {\tt hhbode@dosuni1.bitnet}.}} +\date{08. April 1992} + +\newcommand{\BibTeX}{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +%----------------------------------------------------------------------------- + +\begin{document} + +\maketitle +%\tableofcontents +%\listoffigures +%\listoftables + +\begin{abstract}\footnotesize + Es wird eine neue Familie von \BibTeX-Style-Files vorgestellt, die von den + Standard-Style-Files abgeleitet ist und sich durch nachtr"agliche + Anpa"sbarkeit von Layout und F"ullw"ortern seitens des Benutzers oder der + Benutzerin\footnote{Im folgenden gilt die Fu"snote auf Seite~v von Knuths + fundamentalem Werk~\cite{art1} sinngem"a"s.} auszeichnet. Das Paket + umfa"st neben den eigentlichen Stilen Dateien mit Definitionen, die + automatisch eine englische oder deutsche Bibliographie mit ausgeschriebenen + oder abgek"urzten F"ullw"ortern erzeugen und au"serdem die volle + Kompatibilit"at bestehender \BibTeX-Datenbanken zu den neuen Stilen sowie + umgekehrt die Vertr"aglichkeit neuer Datenbanken zu den alten Stilen + herstellen. +\end{abstract} + +%----------------------------------------------------------------------------- + +Mit {\BibTeX} steht dem \LaTeX- wie dem plain-\TeX-Anwender ein +au"serordentlich leistungsf"ahiges Werkzeug zur Verf"ugung, um +Bibliographien zu Artikeln, Berichten, B"uchern und {\em literate +programs\/} zu erstellen. Mu"ste man fr"uher m"uhsam alle zitierten +Literaturstellen zusammensuchen, alle Angaben -- oft immer wieder dieselben +-- per Hand eintippen (m"oglichst, ohne Fehler bei Seitenangaben, +Bandnummern, Jahreszahlen usw.~zu machen) und sich schlie"slich auch noch um +Layout-Fragen k"ummern, so beschr"ankt sich diese Arbeit mit {\BibTeX} auf +die einmalige Eingabe der bibliographischen Informationen in eine +Literaturdatenbank und das Aufrufen von \verb|\cite|-Kommandos mit einem +Schl"ussel f"ur das zu zitierende Werk. {\BibTeX} stellt dann die +Literaturliste zusammen und sorgt auch f"ur ein konsistentes Aussehen +derselben. + +{\BibTeX} ist "`offizieller"' Bestandteil des \LaTeX-Makropakets und von +Lamport in~\cite{latex} beschrieben, eine deutsche Fassung findet man etwa +bei Kopka~\cite{kopka-einf}. Dar"uberhinaus erlaubt das zur +Standard-\BibTeX-Distribution geh"orige Makropaket {\tt btxmac.tex} auch die +Verwendung unter plain-\TeX\, und zwar mit der gleichen +Benutzerschnittstelle (dieses Makropaket ist auch mit dem {\tt WEB}-System +f"ur strukturierte Dokumentation kompatibel, so da"s \BibTeX\ auch beim {\em +literate programming\/} eingesetzt werden kann). Oren Patashnik, der Autor +des \BibTeX-Programms, legt mit~\cite{bibtex-doc} ein Manual f"ur +\BibTeX-Benutzer vor, das im Gegensatz zu den zuvor genannten Stellen die +jeweils aktuelle Version dokumentiert und das in einer Datei {\tt +btxdoc.tex} jeder \BibTeX-Implementation beigegeben sein sollte. Die +Kenntnis wenigstens einer der angegebenen Quellen wird hier vorausgesetzt +und nicht weiter auf allgemeine Grundlagen der Benutzung von {\BibTeX} +eingegangen. + +Das Schlu"skapitel von Patashniks Manual -- herausgegeben als separates +Dokument~\cite{bibtex-hak} -- beschreibt M"oglichkeiten der Erzeugung von +Style-Files, die das Layout der Bibliographie bestimmen. Vier solcher +Style-Files ({\tt plain}, {\tt unsrt}, {\tt alpha} und {\tt abbrv}) geh"oren +zum Standardumfang von {\BibTeX}. Weitere Styles -- wie {\tt siam}, {\tt +ieeetr} oder {\tt apalike} -- wurden von Patashnik u.\,a.~erstellt, in +erster Linie, um den Anforderungen bestimmter Zeitschriftenherausgeber zu +entsprechen. Die Erzeugung von solchen Styles, auch wenn es nur um relativ +geringf"ugige Ab"anderungen vorhandener Stile geht, ist allerdings ein recht +m"uhsamer Vorgang (man mu"s Programme in einer Spezialsprache mit +Postfixnotation schreiben), der die meisten {\BibTeX}-Anwender "uberfordern +d"urfte. Aus diesem Grund entstand die {\em adaptable family}, die eine +einfache Anpassung an pers"onliche oder fremde Vorstellungen erlaubt. + +\section*{Die Styles} %------------------------------------------------------- + +\begin{table}\small\centering + \caption{\sf "Ubersicht der Stile mit ihren Attributen.\strut} + \label{tab:stile} + \medskip + \begin{tabular}{lcccccc} + \hline\hline + Stil & numerisch & sortiert & initial & klein & kurz & titellos\\ + \hline + {\tt aplain} & ja & ja & nein & ja & nein & nein\\ + {\tt aunsrt} & ja & nein & nein & ja & nein & nein\\ + {\tt aalpha} & nein & ja & nein & ja & nein & nein\\ + {\tt aabbrv} & ja & ja & ja & ja & ja & nein\\ + {\tt anotit} & ja & ja & ja & ja & ja & ja\\ + {\tt aunsnot} & ja & nein & ja & ja & ja & ja\\ + \hline\hline + \end{tabular} +\end{table} + +Das grunds"atzliche Aussehen der Bibliographie wird auch bei den anpa"sbaren +Versionen durch den jeweiligen, im \verb|\bibliographystyle| der \TeX-Quelle +gew"ahlten Stil festgelegt. Dieser bestimmt im wesentlichen, welche +Informationen "uberhaupt auszugeben sind und in welcher Reihenfolge diese +angeordnet werden sollen; dar"uber hinaus sind f"ur jeden Stil eine Reihe von +festen, unver"anderlichen Merkmalen vorgegeben, die in Tabelle~\ref{tab:stile} +f"ur die sechs Stile der {\em adaptable family\/} zusammengefa"st sind. + +Alle Stile bis auf {\tt aalpha} erzeugen numerische Marken zur Kennzeichnung +der Zitate ("`[1]"', "`[2]"' usw.), w"ahrend {\tt aalpha} die Marken +alphanumerisch, i.\,allg.~aus K"urzeln f"ur die Autorennamen und +Erscheinungsjahr, zusammensetzt (z.\,B.~"`[knu73]"'). Bei {\tt aunsrt} und +{\tt aunsnot} erscheint die Bibliographie in der Reihenfolge der Zitate, bei +den anderen Stilen wird sie nach Autorennamen, Erscheinungsjahren +usw.~sortiert. Das Attribut "`initial"' zeigt an, ob die Vornamen der +Autoren abgek"urzt werden oder nicht; das erstere ist der Fall f"ur {\tt +aabbrv}, {\tt anotit} und {\tt aunsnot}, die zudem im Unterschied zu den +"ubrigen Stilen als "`kurz"' gekennzeichnet sind (die Bedeutung dieses +Attributs wird im n"achsten Abschnitt erkl"art). Alle Stile setzen +Gro"sbuchstaben, die in Titeln von Zeitschriftenartikeln -- sofern diese +"uberhaupt ausgegeben werden -- vorkommen und nicht am Satzanfang stehen, in +Kleinschreibung um (Attribut "`klein"'); dies ist zwar f"ur deutsche Titel +nicht geeignet, l"a"st sich aber leicht unterdr"ucken (s.~die Er"orterung am +Ende dieses Artikels). Schlie"slich zeichnen sich die Stile {\tt anotit} und +{\tt aunsnot} dadurch aus, da"s die Titel von Zeitschriftenartikeln +unterdr"uckt werden, wie es etwa in der physikalischen Literatur +durchg"angig "ublich ist. + +Insgesamt entsprechen die Stile {\tt aplain}, {\tt aunsrt}, {\tt aalpha} und +{\tt aabbrv} -- wie auch aus der Namensgebung hervorgeht -- den vier +Standardstilen von \BibTeX\ (Patashniks {\em plain family\/}), w"ahrend {\tt +anotit} und {\tt aunsnot} hinzugef"ugt wurden, um eine L"ucke zu schlie"sen. + +\section*{Anpassung von Layout und F"ullw"ortern} %--------------------------- + +Die Anpassung der {\tt a}-Stile erfolgt durch Definition bestimmter +\TeX-Makros; andererseits funktionieren die Stile nicht, wenn diese Makros +undefiniert sind. Die Definition geschieht zweckm"a"sigerweise "uber ein +\verb|@PREAMBLE|-Kommando, das sich in einer der bibliographischen +Datenbanken befindet (vgl.~das n"achste Kapitel). Die {\tt a}-Styles +definieren einen Schalter \verb|abfull|, der in Abh"angigkeit davon, ob es +sich um einen "`Kurzstil"' handelt oder nicht (s.~Tab.~\ref{tab:stile}), den +Wert \verb|false| oder \verb|true| bekommt. So k"onnen sich die Makros +automatisch darauf einstellen, F"ullw"orter abzuk"urzen oder voll +auszuschreiben. + +\begin{table}\small\centering + \caption{\sf Zusammenstellung der verwendeten Makros.\strut} + \label{tab:makros} + \medskip + \begin{tabular}{lp{8cm}} + \hline\hline + Makroname & Bedeutung\\ + \hline + \verb|\abtype| & Definiert die Schriftauszeichnung einzelner Felder + eines Bibliographieeintrags.\\ + \verb|\abphrase| & Legt die F"ullw"orter fest.\\ + \verb|\abmonth| & Enth"alt die Monatsnamen.\\ + \verb|\abedition| & Stellt Bezeichnungen f"ur Auflagen eines Buches zur + Verf"ugung ("`Erste"', "`Zweite"', "`Dritte"' usw.).\\ + \verb|\abchapter| & Gibt Namen f"ur bestimmte Segmente eines + Schriftst"ucks zur"uck ("`Abschnitt"', "`Absatz"', + "`Anhang"' oder "`Teil"').\\ + \hline\hline + \end{tabular} +\end{table} + +Die fraglichen Makros sind in Tab.~\ref{tab:makros} zusammengestellt. Alle +Makronamen beginnen mit {\tt ab}. W"ahrend \verb|\abtype| f"ur die +Schriftauszeichnung verantworlich ist, haben alle anderen Makros mit +F"ullw"ortern zu tun und erlauben sprachspezifische Anpassungen sowie +Unterscheidung zwischen "`Kurz-"' und "`Vollstilen"'. Es folgen detaillierte +Beschreibungen der Makros mit ihren Parametern. + +\subsection*{{\tt abtype}} + +\begin{table}\small\centering + \caption{\sf Der erste Parameter von {\tt abtype}.\strut}\label{tab:abtype} + \medskip + \begin{tabular}{rp{5cm}} + \hline\hline + Code & Bedeutung\\ + \hline + 0 & Namen von Autoren und Editoren\\ + 1 & Titel von B"uchern und Reihen\\ + 2 & Zeitschriftentitel\\ + 3 & Bandnummern von Zeitschriften\\ + 4 & Heftnummern von Zeitschriften\\ + 5 & Datumsangaben\\ + \hline\hline + \end{tabular} +\end{table} + +Die Layoutsteuerung wird "uber das Makro \verb|\abtype| vorgenommen. Die {\tt +a}-Stile schreiben die meisten Felder eines Eintrags indirekt "uber einen +Aufruf von \verb|\abtype| in die Bibliographie, wobei zwei Argumente +"ubergeben werden: eine Codenummer f"ur die Art des Feldes und der in das +Feld einzutragende Text. Dieser kann dann vom Makro beliebig formatiert +zur"uckgegeben werden. Die Codewerte f"ur den ersten Parameter von +\verb|\abtype| findet man in Tab.~\ref{tab:abtype}. + +Durch eine Definition der Form +\begin{verbatim} +\def\abtype##1##2{% +\ifcase##1{\sc##2}\or"`##2"'\or{\em##2\/}\or{\bf##2}\or% +(##2)\or(##2)\else##2\fi}} +\end{verbatim} +also erreichte man beispielweise, da"s Autorennamen in {\sc Kapit"alchen}, +Buchtitel in "`Anf"uhrungszeichen"' und Zeitschriftentitel {\em kursiv\/} +gesetzt werden und da"s Bandnummern von Zeitschriften {\bf fett} erscheinen, +w"ahrend Heftnummern ebenso wie Datumsangaben geklammert werden. +Vorsichtshalber wurde noch eine \verb|\else|-Klausel angef"ugt, die bewirkt, +da"s bei Aufruf des Makros mit einem undefinierten Codewert das zweite +Argument unformatiert zur"uckgegeben wird (f"ur die Original-{\tt a}-Stile +w"are dies nicht erforderlich). + +\subsection*{{\tt abphrase}} + +\begin{table}\small\centering + \caption{\sf Der Parameter von {\tt abphrase}.\strut}\label{tab:abphrase} + \medskip + \begin{tabular}{rp{9.5cm}} + \hline\hline + Code & Bedeutung\\ + \hline + 0 & Bindewort zwischen zwei oder vor dem letzten Namen einer Liste + ("`und"')\\ + 1 & Satzzeichen vor dem letzten Bindewort einer Namensliste (im + Deutschen nichts, im Englischen ein Komma)\\ + 2 & Ersatz f"ur Namen von Mitautoren und Mitherausgebern ("`u.\,a."' oder + "`et~al."')\\ + 3 & Bezeichnung f"ur mehrere Herausgeber (z.\,B.~"`Editoren"')\\ + 4 & Bezeichnung f"ur einen Herausgeber ("`Editor"')\\ + 5 & Wort nach der Bandnummer einer Reihe oder Kreuzreferenz ("`aus"')\\ + 6 & Wort nach der Ausgabennummer einer Reihe ("`in"')\\ + 7 & Wort vor Querverweisen auf B"ucher, Artikel usw.~("`In"')\\ + 8 & Wort vor einer Bandnummer mitten im Satz ("`volume"' auf + Englisch, aber "`Band"' auf Deutsch)\\ + 9 & dto.~am Satzanfang ("`Volume"' bzw.~erneut "`Band"')\\ + 10 & Wort vor einer Reihennummer mitten im Satz ("`Nummer"')\\ + 11 & dto. am Satzanfang (im Deutschen dasselbe)\\ + 12 & Wort hinter einer Auf"|lagennummer ("`Auf"|lage"')\\ + 13 & Wort vor mehreren Seitennummern ("`Seiten"')\\ + 14 & Wort vor einer einzelnen Seitennummer ("`Seite"')\\ + 15 & Wort vor einer Kapitelnummer ("`Kapitel"')\\ + 16 & Bezeichnung f"ur einen Forschungsbericht ("`Technical Report"')\\ + 17 & Bezeichnung f"ur eine Diplomarbeit ("`Master's thesis"')\\ + 18 & Bezeichnung f"ur eine Doktorarbeit ("`PhD Thesis"')\\ + \hline\hline + \end{tabular} +\end{table} + +Der gr"o"ste Teil der F"ullw"orter wird durch \verb|\abphrase| abgedeckt. +Das Makro hat einen Parameter, der wieder eine Codenummer darstellt. +Die vorkommenden Werte zeigt Tab.~\ref{tab:abphrase}. + +Ein Beispiel f"ur eine geeignete Definition von \verb|\abphrase| mit +ausgeschriebenen, deutschen F"ullw"ortern w"are: +\begin{verbatim} +\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"|lage}\or{Seiten}\or{Seite}\or{Kapitel}\or% +{Bericht}\or{Diplomarbeit}\or{Dissertation}\fi} +\end{verbatim} + +\subsection*{{\tt abmonth}} + +Einfacher als die vorangegangenen Makros ist \verb|\abmonth|: Es wird mit +einer Zahl zwischen 1~und~12 als Argument aufgerufen und sollte die +Bezeichnung f"ur den entsprechenden Monat zur"uckgeben; also etwa +\begin{verbatim} +\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} +\end{verbatim} +Man beachte, da"s vor \verb|Januar| bereits ein \verb|\or| stehen mu"s, da +dieser Monat den Code~1 hat und nicht~0. Desweiteren gilt, da"s die +Definition von \verb|\abmonth| nur dann einen Effekt hat, wenn in den +Bibliographiedatenbanken von den vordefinierten Strings {\tt jan}, {\tt +feb}, \dots, {\tt dec} Gebrauch gemacht wird -- es sei denn, man ruft das +Makro direkt auf, wovon man jedoch im Hinblick auf m"ogliche +Kompatibilit"atsprobleme mit anderen Styles oder zuk"unftigen Versionen der +anpa"sbaren Stile Abstand nehmen sollte. + +\subsection*{{\tt abedition}} + +Ein weiteres Makro mit einem numerischen Wert als Parameter ist +\verb|\abedition|. Die "ubergebene Zahl bezeichnet eine Auf"|lagennummer und +es sollte ein entsprechender String zur"uckgegeben werden, z.\,B.: +\begin{verbatim} +\def\abedition##1{\ifcase##1\or Erste\or Zweite\or Dritte\or + Vierte\or F"unfte\or Sechste\or Siebte\or Achte\or + Neunte\or Zehnte\else?\fi} +\end{verbatim} +In den anpa"sbaren Stilen existieren vordefinierte Strings {\tt first}, {\tt +second}, \dots, {\tt tenth}, die man aus den gleichen Gr"unden wie oben f"ur +das {\tt EDITION}-Feld der Bibliographieeintr"age verwenden sollte. Ein +Problem ergibt sich, wenn eine Auflagennummer gr"o"ser als~10 ben"otigt +wird; in diesem Fall sollte man das Makro entsprechend erweitern und +zus"atzliche Strings durch {\tt @STRING}-Kommandos definieren. + +\subsection*{{\tt abchapter}} + +Schlie"slich ist noch ein Makro mit einem Code zwischen 0~und~3 f"ur +Bezeichnungen verschiedener Segmente eines Dokuments zu definieren. Die +Bedeutung ergibt sich unmittelbar aus dem Beispiel +\begin{verbatim} +\def\abchapter##1{\ifcase##1Abschnitt\or Absatz\or +Anhang\or Teil\fi} +\end{verbatim} +Auch f"ur den Aufruf dieses Makros gibt es vordefinierte Strings, die man in +den Datenbanken tunlichst benutzen sollte; sie hei"sen {\tt section}, {\tt +paragraph}, {\tt appendix} und {\tt part} und sind gedacht f"ur den Einsatz +im {\tt TYPE}-Feld mancher Eintr"age, mit welchem sich das {\tt +CHAPTER}-Feld umwidmen l"a"st. + +\section*{Benutzungshinweise} %----------------------------------------------- + +Zum Gl"uck braucht man die im letzten Kapitel vorgestellten Makros nicht +selbst einzugeben, sie sind vielmehr bereits in der Datei {\tt +apreamble.tex} enthalten, die zum Lieferumfang des Pakets geh"ort. Sie +stellt in Abh"angigkeit vom \verb|abfull|-Schalter ausgeschriebene oder +abgek"urzte F"ullw"orter zur Verf"ugung. Mehr noch, diese Datei enth"alt +neben den deutschen F"ullw"ortern auch "aquivalente Definitionen in +englischer Sprache. Die Auswahl zwischen den beiden Sprachversionen wird +automatisch getroffen, und zwar nach folgenden Kriterien: +\begin{itemize} + \item Ist das Makropaket {\tt german.sty} {\em nicht\/} geladen, wird die +englische Version genommen. + \item Wird dagegen festgestellt, da"s {\tt german.sty} eingelesen wurde, +h"angt die Sprachauswahl vom eingestellten \verb|\language|-Wert ab: + \begin{itemize} + \item Ist dieser gleich \verb|\german| oder \verb|\austrian|, wird die + deutsche Version gew"ahlt. + \item In allen anderen F"allen ist es wieder die englische. + \end{itemize} +\end{itemize} +Auf diese Weise sollten zumindest alle diejenigen zufriedengestellt sein, +die entweder nur englische Dokumente verfassen oder unter Benutzung von {\tt +german.sty} sowohl englische als auch deutsche Texte schreiben. Nat"urlich +steht es jedem frei, {\tt apreamble.tex} um zus"atzliche Sprachen zu +erweitern oder die mittels \verb|\abtype| vorgenommenen Formatierungen nach +eigenem Gutd"unken abzu"andern. + +Damit der oben vorgestellte Mechanismus zur Sprachauswahl funktioniert, mu"s +die Datei {\tt german.sty} -- wenn "uberhaupt -- {\em vor\/} {\tt +apreamble.tex} eingelesen werden. Dies sollte im Zusammenhang mit \LaTeX\ +kein Problem darstellen, da \verb|german| f"ur gew"ohnlich als +Dokumentstiloption verwendet wird. Wie oben erw"ahnt l"a"st sich \BibTeX\ +aber auch mit plain-\TeX\ nutzen, wenn das Makropaket {\tt btxmac.tex} +eingebunden wird; hier ist dann sicherzustellen, da"s der Befehl +\verb|\input german.sty| vor \verb|\input apreamble| (bzw., wie im n"achsten +Absatz erl"autert, vor \verb|\bibliography{...}|) erscheint. Alle zur {\em +adaptable family\/} geh"origen Makros sind "ubrigens so abgefa"st, da"s sie +sowohl mit \LaTeX\ als auch mit plain-\TeX\ funktionieren; insbesondere +vertragen sie sich auch mit dem {\tt WEB}-System f"ur strukturierte +Dokumentation. + +Weiterhin ist es nat"urlich erforderlich, da"s {\tt apreamble.tex} vor der +eigentlichen Bibliographie eingelesen wird; auch daf"ur steht eine implizite +L"osung bereit. Es ist ohnehin vorteilhaft, wenn man eine oder mehrere {\tt +bib}-Dateien mit allgemeinen Definitionen (haupts"achlich +\verb|@STRING|-Kommandos) anlegt und diese stets am Anfang der +\verb|\bibliography|-Liste aufz"ahlt. Zum Lieferumfang der {\em adaptable +family\/} geh"oren zwei solche Dateien, {\tt jourfull.bib} und {\tt +jourabbr.bib}, die Namen f"ur Zeitschriften -- einmal in ausgeschriebener +und zum anderen in abgek"urzter Form -- definieren, und zwar gerade die, +welche in den Standard-Bibliographiestilen (der {\em plain family\/}) +bereits vordefiniert sind\footnote{Der Autor der {\em adaptable family\/} +war der Meinung, da"s die Auswahl dieser Zeitschriften zu speziell auf ein +Fach bezogen ist, und hat die Definitionen daher in seinen Stildateien +weggelassen. Unter Benutzung dieser beiden Dateien ist jedoch die volle +Kompatibilit"at von Datenbanken, die f"ur die Standardstile erstellt wurden, +zu den anpa"sbaren Stilen gew"ahrleistet.}. Beide Dateien laden {\tt +apreamble.tex} automatisch am Anfang der Bibliographie. Alles, was man zur +Nutzung der anpa"sbaren Stile -- abgesehen vom eventuellen Laden von {\tt +btxmac} -- innerhalb eines Dokuments zu tun hat, beschr"ankt sich somit auf +zwei Kommandos, die typischerweise so aussehen: +\begin{verbatim} +\bibliography{jourfull,user1,user2,user3}\bibliographystyle{aplain} +\end{verbatim} +Dabei sind \verb|user1|, \verb|user2| und \verb|user3| irgendwelche +Benutzerdatenbanken, \verb|jourfull| kann nat"urlich auch durch +\verb|jourabbr| ersetzt werden (mu"s aber immer am Anfang der Liste stehen!) +und statt \verb|aplain| kann selbstverst"andlich ein beliebiger anderer +anpa"sbarer Stil verwendet werden. Es ist zu betonen, da"s die Auswahl +"`ausgeschriebene oder abgek"urzte Zeitschriftennamen"' nicht vom +Bibliographiestil bestimmt wird, sondern durch Angabe von \verb|jourfull| +oder \verb|jourabbr| erfolgt. + +Au"serdem definieren die beiden Dateien {\tt jourfull.bib} und {\tt +jourabbr.bib} Strings namens \verb|ifger|, \verb|else| und \verb|fi|, die es +auf einfache Weise erm"oglichen, innerhalb der Datenbanken bei einzelnen +Feldern von der automatischen Sprachauswahl zu profitieren. Beispielsweise +k"onnte damit das \verb|NOTE|-Feld eines Eintrags etwa folgendes enthalten: +\begin{verbatim} +ifger # "Wird demn{\"a}chst erscheinen." # else # "To be published." # fi +\end{verbatim} +Wie man unschwer erkennt, handelt es sich um eine bedingte Anweisung: +\verb|ifger| sorgt daf"ur, da"s der nachstehende Text ausgegeben wird, wenn +die automatische Sprachauswahl sich f"ur "`deutsch"' entschieden hat, +\verb|else| leitet die Alternative f"ur den gegenteiligen Fall ein und +\verb|fi| schlie"st die ganze Konstruktion ab. Der Operator~\verb|#| +verkettet die einzelnen Teile zu einem von \TeX\ interpretierbaren +Gesamtstring. + +Gelegentlich mag es vorkommen, da"s man die neuen, auf die {\em adaptable +family\/} zugeschnittenen Datenbanken mit einem der Standardstile verwenden +will. Dies st"o"st auf Schwierigkeiten, da die anpa"sbaren Stile einige +zus"atzliche Strings definieren, von denen man sicherlich Gebrauch gemacht +hat (genauer: machen sollte). Es steht aber eine Datei {\tt acompat.bib} zur +Verf"ugung, die alle zus"atzlichen Strings nachtr"aglich definiert. Bindet +man diese noch vor {\tt jourfull.bib} oder {\tt jourabbr.bib} (die man f"ur +die oben beschriebenen Mechanismen weiterhin braucht) in die +\verb|\bibliography|-Liste ein, so steht einer Nutzung der Standardstile +etwa in der Form +\begin{verbatim} +\bibliography{acompat,jourfull,user1,user2,user3}\bibliographystyle{plain} +\end{verbatim} +nichts mehr im Wege. Nat"urlich funktioniert die automatische Sprachauswahl +jetzt nicht mehr bei den F"ull"-w"or"-tern, sondern nur noch bei den +"`handgemachten"' \verb|ifger|-Konstruktionen. + +Abschlie"send noch eine Anmerkung zur Gro"s-/Kleinschreibung von +Zeitschriftentiteln. Die Stile der {\em plain family\/} setzen solche stets +in Kleinschreibung um; so wird z.\,B. aus +\begin{verbatim} +TITLE="A Horror Story about Integration Methods" +\end{verbatim} +die Titelangabe "`A horror story about integration methods"'. Es wurde +verschiedentlich die Meinung vertreten, da"s ein deutscher Bibliographiestil +diese Umsetzung abschalten sollte, da sie f"ur deutsche Titel nicht ad"aquat +ist. Der Autor der {\em adaptable family\/} schlie"st sich dieser Meinung +nicht an (und hat die Umsetzung daher beibehalten): Gro"s-/Kleinschreibung +von Zeitschriftentiteln ist nicht eine Frage der Sprache, in der das +Dokument gesetzt ist, sondern eine Funktion der Sprache des Titels selbst. +So sollte die Eingabe +\begin{verbatim} +TITLE="Graphische Sprachelemente in ALGOL 68" +\end{verbatim} +{\em immer\/} zu der Ausgabe "`Graphische Sprachelemente in ALGOL~68"' +f"uhren -- auch in einem englischen Dokument; ebensowenig ist etwas dagegen +einzuwenden, wenn im obigen Beispiel mit dem englischen Titel die Umsetzung +auch in einem deutschen Dokument stattfindet. + +Es ist also {\em bei den einzelnen Titelangaben\/} daf"ur zu sorgen, da"s die +Umsetzung ggf.~verhindert wird. Dies ist aber -- bei den Standard- wie bei +den anpa"sbaren Stilen -- leicht m"oglich, wie im +\BibTeX-Manual~\cite{bibtex-doc} beschrieben wird: Man schlie"se den +gesamten Titel in ein zus"atzliches Paar geschweifter Klammern ein. Also +bewirkt +\begin{verbatim} +TITLE="{Graphische Sprachelemente in ALGOL 68}" +\end{verbatim} +genau das Gew"unschte (die G"ansef"u"schen z"ahlen als "au"seres Klammerpaar +und k"onnten auch durch geschweifte Klammern ersetzt werden, die +zus"atzlichen Klammern sind aber trotzdem erforderlich). Statt dessen +k"onnte man auch nur die gro"szuschreibenden W"orter oder Buchstaben +klammern, z.\,B. +\begin{verbatim} +TITLE="{G}raphische {S}prachelemente in {ALGOL} 68" +\end{verbatim} +Diese Technik wendet man manchmal auch in englischen Titeln an, etwa in +\begin{verbatim} +TITLE="Stiff {ODE} Solvers: A Review of Current and Coming Attractions" +\end{verbatim} +so da"s sich der Titel "`Stiff ODE solvers: A review of current and coming +attractions"' ergibt (das Wort nach dem Doppelpunkt bleibt ohne besondere +Ma"snahme gro"sgeschrieben). + +%----------------------------------------------------------------------------- + +\footnotesize\bibliography{jfull,inf}\bibliographystyle{aplain} +%\addcontentsline{toc}{section}{\refname} + +\end{document} diff --git a/Master/texmf-dist/doc/bibtex/abstyles/apreambl.doc b/Master/texmf-dist/doc/bibtex/abstyles/apreambl.doc new file mode 100644 index 00000000000..8a8c434726e --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/apreambl.doc @@ -0,0 +1,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 diff --git a/Master/texmf-dist/doc/bibtex/abstyles/btxabst.doc b/Master/texmf-dist/doc/bibtex/abstyles/btxabst.doc new file mode 100644 index 00000000000..2829e8a6101 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/btxabst.doc @@ -0,0 +1,2878 @@ +% BibTeX `adaptable' family + % version 1.10 derived by Hans-Hermann Bode (H2B), Osnabr\"uck, + % (BitNet/EARN: HHBODE@DOSUNI1) + % from the `plain' family version 0.99b. + % The copying statement declared below extends to this file also with + % the file names btxabst.doc, aplain.bst, aunsrt.bst, aalpha.bst, + % aabbrv.bst, anotit.bst, and aunsnot.bst added. +% BibTeX `plain' family + % version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09. + % Copyright (C) 1985, all rights reserved. + % Copying of this file is authorized only if either + % (1) you make absolutely no changes to your copy, including name, or + % (2) if you do make changes, you name it something other than + % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst. + % This restriction helps ensure that all standard styles are identical. + % The file btxbst.doc has the documentation for this style. +% Please notify Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU) of any bugs in +% these standard styles or in this documentation file. +% +% This is file btxbxt.doc; it helps document bibliography styles, +% and is also a template file that you can use to make +% several different style files, if you have access to a C preprocessor. +% For example, the standard styles were made by doing something like +% cpp -P -DAPLAIN btxabst.doc aplain.txt +% cpp -P -DAUNSRT btxabst.doc aunsrt.txt +% cpp -P -DAALPHA btxabst.doc aalpha.txt +% cpp -P -DAABBRV btxabst.doc aabbrv.txt +% cpp -P -DANOTIT btxabst.doc anotit.txt +% cpp -P -DAUNSNOT btxabst.doc aunsnot.txt +% and then renaming after removing unwanted comments and blank lines. +% If you don't have access, +% you can edit this file by hand to imitate the preprocessor, +% with the following explanation of the C preprocessor constructs used here. +% +% The output of the preprocessor is the same as the input, except that certain +% lines will be excluded (and some blank lines will be added). The sequence +% #if VAR +% lines to be included when VAR is not zero +% #else +% lines to be included when VAR is zero +% #endif +% (with the #-signs appearing in column 1) means that one set or the other of +% the lines are to be included depending on the value of VAR. +% The #else part is optional. Comments can be added after #else and #endif. +% Variables can be set by +% #define VAR value +% and one can also use #ifdef VAR to see if VAR has any value, and #ifndef +% to see if it has none. +% Another #if form used in this file is #if !VAR, which includes the lines +% after the #if only if VAR is zero. +% +% Convention: Use all uppercase identifiers for these preprocessor variables +% so you can spot them easily +% +% The command line to the preprocessor should define one of APLAIN, AUNSRT, AALPHA +% or AABBRV (though APLAIN will be used by default if none is given), +% and the following lines will set various boolean variables to control the +% various lines that are chosen from the rest of the file. +% Each boolean variable should be set true (1) or false (0) in each style. +% Here are the current variables, and their meanings: +% LAB_ALPH: an alphabetic label is used (if false then a numeric +% label is used) +% SORTED: the entries should be sorted by label (if nonnumeric) +% and other info, like authors (if false, then +% entries remain in order of occurrence) +% NAME_FULL: the authors, editors, etc., get the full names as +% given in the bibliography file (if false, the first +% names become initials) +% ATIT_LOWER: titles of non-"books" (e.g., articles) should be +% converted to lower-case, except the first letter or +% first letter after a colon +% (if false then they appear as in the database) +% MONTH_FULL: months are spelled out in full (if false, then +% they're abbreviated); now used generally for +% distinction between ``full'' and ``abbreviated'' +% styles (H2B) +% JOUR_FULL: macro journal names are spelled out in full +% (if false then they are abbreviated, currently +% as they appear in ACM publications); no more used +% (H2B) +% NO_TITLE: the titles of articles, incollections, inproceedings +% and techreports are omitted, if there are other +% informations to identify the work cited (added by H2B) +% +#ifndef AUNSRT +# ifndef AALPHA +# ifndef AABBRV +# ifndef ANOTIT +# ifndef AUNSNOT +# define APLAIN 1 +# endif +# endif +# endif +# endif +#endif +#ifdef APLAIN +% aplain style (sorted numbers) +# define LAB_ALPH 0 +# define SORTED 1 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +# define NO_TITLE 0 +#endif +#ifdef AUNSRT +% aunsrt style (unsorted numbers) +# define LAB_ALPH 0 +# define SORTED 0 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +# define NO_TITLE 0 +#endif +#ifdef AALPHA +% aalpha style (sorted short alphabetics) +# define LAB_ALPH 1 +# define SORTED 1 +# define NAME_FULL 1 +# define ATIT_LOWER 1 +# define MONTH_FULL 1 +# define JOUR_FULL 1 +# define NO_TITLE 0 +#endif +#ifdef AABBRV +% aabbrv style (sorted numbers, with abbreviations) +# define LAB_ALPH 0 +# define SORTED 1 +# define NAME_FULL 0 +# define ATIT_LOWER 1 +# define MONTH_FULL 0 +# define JOUR_FULL 0 +# define NO_TITLE 0 +#endif +#ifdef ANOTIT +% anotit style (sorted numbers, with abbreviations, no article titles) +# define LAB_ALPH 0 +# define SORTED 1 +# define NAME_FULL 0 +# define ATIT_LOWER 1 +# define MONTH_FULL 0 +# define JOUR_FULL 0 +# define NO_TITLE 1 +#endif +#ifdef AUNSNOT +% aunsnot style (unsorted numbers, with abbreviations, no article titles) +# define LAB_ALPH 0 +# define SORTED 0 +# define NAME_FULL 0 +# define ATIT_LOWER 1 +# define MONTH_FULL 0 +# define JOUR_FULL 0 +# define NO_TITLE 1 +#endif +% +% Entry formatting: Similar to that recommended by Mary-Claire van Leunen +% in "A Handbook for Scholars". Book-like titles are italicized +% (emphasized) and non-book titles are converted to sentence +% capitilization (and not enclosed in quotes). +% This file outputs a \newblock between major blocks of an entry +% (the name \newblock is analogous to the names \newline and \newpage) +% so that the user can obtain an "open" format, which has a line break +% before each block and lines after the first are indented within blocks, +% by giving the optional \documentstyle argument `openbib'; +% The default is the "closed" format---blocks runs together. +% +% Citation alphabetic label format: +% [Knu73] for single author (or editor or key) +% [AHU83] (first letters of last names) for multiple authors +% +% Citation label numberic format: +% [number] +% +% Reference list ordering for sorted, alphabetic lables: +% alphabetical by citation label, then by author(s) or whatever +% passes for author in the absence of one, then by year, +% then title +% +% Reference list ordering for sorted, numeric lables: +% alphabetical by author(s) or whatever passes +% for author in the absence of one, then by year, then title +% +% Reference list ordering for unsorted: +% by the order cited in the text +% +% History +% 12/16/84 (HWT) Original `plain' version, by Howard Trickey. +% 12/23/84 (LL) Some comments made by Leslie Lamport. +% 2/16/85 (OP) Changes based on LL's comments, Oren Patashnik. +% 2/17/85 (HWT) Template file and other standard styles made. +% 3/28/85 (OP) First release, version 0.98b for BibTeX 0.98f. +% 5/ 9/85 (OP) Version 0.98c for BibTeX 0.98i: +% fixed Theoretical Computer Science macro name; +% fixed the format.vol.num.pages function. +% 1/24/88 (OP) Version 0.99a for BibTeX 0.99a, main changes: +% assignment operator (:=) arguments reversed; +% the preamble$ function outputs the database PREAMBLE; +% entry.max$ and global.max$ (built-in) variables replace +% entry.string.max and global.string.max functions; +% alphabetizing by year then title, not just title; +% many unnecessary ties removed; \it ==> \em; +% the `alpha' style uses a superscripted `+' instead of a +% `*' for unnamed names in constructing the label; +% the `abbrv' style now uses "Mar." and "Sept."; +% the functions calc.label and presort now look at just +% the fields they're supposed to; +% BOOKLET, MASTERSTHESIS, TECHREPORT use nonbook titles; +% INBOOK and INCOLLECTION take an optional type (e.g. +% type = "Section"), overriding the default "chapter"; +% BOOK, INBOOK, INCOLLECTION, and PROCEEDINGS now allow +% either volume or number, not just volume; +% INCOLLECTION now allows an edition and series field; +% PROCEEDINGS and INPROCEEDINGS now use the address field +% to tell where a conference was held; +% INPROCEEDINGS and PROCEEDINGS now allow either volume +% or number, and also a series field; +% MASTERSTHESIS and PHDTHESIS accept types other than +% "Master's thesis" and "PhD thesis"; +% UNPUBLISHED now outputs, in one block, note then date; +% MANUAL now prints out the organization in +% the first block if the author field is empty; +% MISC can't be empty---it requires some optional field. +% 3/23/88 (OP) Version 0.99b for BibTeX 0.99c---changed the three +% erroneous occurrences of `cite ' to `cite$ '; this +% change didn't affect the four standard styles, so the +% 0.99a versions of those styles are still current. +% 5/11/91 (H2B) Version 1.00 of the `b' style family by +% Hans-Hermann Bode with the following changes and +% extensions: renaming the styles, adding a `anotit' +% style; adding an output.state named continue.sentence +% and a new.clause function; setting author names in +% small caps, putting booktitles in quotes rather than +% to emphasize them, boldfacing volume numbers of +% journals, including date specification in parentheses, +% discarding macros for journal names. +% 6/15/91 (H2B) Version 1.10 of the `adaptable' style family (which +% replaces the `b' style family) with adaptable +% type styles, phrases, conjunctions etc., new macros +% for edition numbers and ``chapter'' names and a new +% `aunsnot' style. +% +% The ENTRY declaration +% Like Scribe's (according to pages 231-2 of the April '84 edition), +% but no fullauthor or editors fields because BibTeX does name handling. +% The annote field is commented out here because this family doesn't +% include an annotated bibliography style. And in addition to the fields +% listed here, BibTeX has a built-in crossref field, explained later. + +ENTRY +% Fields: + { address +% Usually the address of a publisher or other type of organization. +% Put information in this field only if it helps the reader find the +% thing---for example you should omit the address of a major +% publisher entirely. For a PROCEEDINGS or an INPROCEEDINGS, +% however, it's the address of the conference; for those two entry +% types, include the publisher's or organization's address, if +% necessary, in the publisher or organization field. +% annote +% Long annotation---for annotated bibliographies (begins sentence). + author +% Name(s) of author(s), in BibTeX name format. + booktitle +% Book title when the thing being referenced isn't the whole book. +% For book entries, the title field should be used instead. + chapter +% Chapter (or section or whatever) number. + edition +% Edition of a book---should be an ordinal (e.g., "Second"). + editor +% Name(s) of editor(s), in BibTeX name format. +% If there is also an author field, then the editor field should be +% for the book or collection that the work appears in. + howpublished +% How something strange has been published (begins sentence). + institution +% Sponsoring institution of a technical report. + journal +% Journal name (macros are provided for many). + key +% Alphabetizing, labeling, and cross-referencing key +% (needed when an entry has no author or editor). + month +% Month (macros are provided). + note +% To help the reader find a reference (begins sentence). + number +% Number of a journal or technical report, or of a work in a series. + organization +% Organization sponsoring a conference (or publishing a manual); if +% the editor (or author) is empty, and if the organization produces +% an awkward label or cross reference, you should put appropriately +% condensed organization information in the key field as well. + pages +% Page number or numbers (use `--' to separate a range, use `+' +% to indicate pages following that don't form a simple range). + publisher +% Publisher name. + school +% School name (for theses). + series +% The name of a series or set of books. +% An individual book will will also have it's own title. + title +% The title of the thing you're referred to. + type +% Type of a Techreport (e.g., "Research Note") to be used instead of +% the default "Technical Report"; or, similarly, the type of a +% thesis; or of a part of a book. + volume +% The volume number of a journal or multivolume work. + year +% The year should contain only numerals (technically, it should end +% with four numerals, after purification; doesn't a begin sentence). + } +% There are no integer entry variables + {} +% These string entry variables are used to form the citation label. +% In a storage pinch, sort.label can be easily computed on the fly. +#if LAB_ALPH +#if SORTED + { label extra.label sort.label } +#else !SORTED +% It doesn't seem like a good idea to use an order-of-citation +% reference list when using alphabetic labels, but when this happens +% we do things a little differently + { label } +#endif SORTED +#else !LAB_ALPH + { label } +#endif LAB_ALPH + +% The following macros have to be defined by the user (e.g., with the +% expansions given below) for formatting of certain fields and to replace the +% constant built-in strings for phrases, conjunctions etc. This makes the +% BibTeX style files adaptable---a feature introduced by H2B. +% +% The type style of certain fields is determined by the \abtype command. The +% first parameter is a number, that denotes the field in question, namely: +% 0 author and editor names, +% 1 titles of books and series, +% 2 journal titles, +% 3 journal volumes, +% 4 journal numbers, and +% 5 dates. +% The second parameter is the text to format. Hence, the type style macro +% could be something like: +% \def\abtype#1#2{% +% \ifcase#1{\sc#2}\or``#2''\or{\em#2\/}\or{\bf#2}\or(#2)\or(#2)\else#2\fi} +% The \else clause returns the text unformatted, if the command is called with +% an undefined field number (which is not used in this file). +% +% Phrases are defined by the \abphrase command. The only parameter is a code +% for the phrase: +% 0 conjunction between two or before the last name of a name list +% 1 comes before the last conjunction of a name list +% 2 replaces names of co-authors and co-editors (``et al.'') +% 3 marks multiple editors +% 4 marks a single editor +% 5 ``of'' for a volume of a series or crossref +% 6 ``in'' for a number in a series +% 7 ``In'' for crossrefs to books, articles, etc. +% 8 comes before a volume number, lower-case +% 9 comes before a volume number, upper-case +% 10 comes before a series number, lower-case +% 11 comes before a series number, upper-case +% 12 comes after an edition number +% 13 comes before multiple page numbers +% 14 comes before a single page number +% 15 comes before a chapter number +% 16 denotes a technical report +% 17 denotes a master's thesis +% 18 denotes a phd thesis +% An appropriate definition of the phrases macro would be: +% \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} + +% Each entry function starts by calling output.bibitem, to write the +% \bibitem and its arguments to the .BBL file. Then the various fields +% are formatted and printed by output or output.check. Those functions +% handle the writing of separators (commas, periods, \newblock's), +% taking care not to do so when they are passed a null string. +% Finally, fin.entry is called to add the final period and finish the +% entry. +% +% A bibliographic reference is formatted into a number of `blocks': +% in the open format, a block begins on a new line and subsequent +% lines of the block are indented. A block may contain more than +% one sentence (well, not a grammatical sentence, but something to +% be ended with a sentence ending period). The entry functions should +% call new.block whenever a block other than the first is about to be +% started. They should call new.sentence whenever a new sentence is +% to be started. The output functions will ensure that if two +% new.sentence's occur without any non-null string being output between +% them then there won't be two periods output. Similarly for two +% successive new.block's. +% +% The output routines don't write their argument immediately. +% Instead, by convention, that argument is saved on the stack to be +% output next time (when we'll know what separator needs to come +% after it). Meanwhile, the output routine has to pop the pending +% output off the stack, append any needed separator, and write it. +% +% To tell which separator is needed, we maintain an output.state. +% It will be one of these values: +% before.all just after the \bibitem +% continue.sentence in the middle of a sentence: blank---no +% comma---needed if more sentence is +% output (value added by H2B) +% mid.sentence in the middle of a sentence: comma needed +% if more sentence is output +% after.sentence just after a sentence: period needed +% after.block just after a block (and sentence): +% period and \newblock needed. +% Note: These styles don't use after.sentence. +% This note doesn't apply really (H2B). +% +% VAR: output.state : INTEGER -- state variable for output +% +% The output.nonnull function saves its argument (assumed to be nonnull) +% on the stack, and writes the old saved value followed by any needed +% separator. The ordering of the tests is decreasing frequency of +% occurrence. +% +% output.nonnull(s) == +% BEGIN +% s := argument on stack +% if output.state = continue.sentence then -- added by H2B +% write$(pop() * " ") -- dto. +% -- "pop" isn't a function: just use stack top +% else +% if output.state = mid.sentence then +% write$(pop() * ", ") +% else +% if output.state = after.block then +% write$(add.period$(pop())) +% newline$ +% write$("\newblock ") +% else +% if output.state = before.all then +% write$(pop()) +% else -- output.state should be after.sentence +% write$(add.period$(pop()) * " ") +% fi +% fi +% fi +% output.state := continue.sentence +% fi +% push s on stack +% END +% +% The output function calls output.nonnull if its argument is non-empty; +% its argument may be a missing field (thus, not necessarily a string) +% +% output(s) == +% BEGIN +% if not empty$(s) then output.nonnull(s) +% fi +% END +% +% The output.check function is the same as the output function except that, if +% necessary, output.check warns the user that the t field shouldn't be empty +% (this is because it probably won't be a good reference without the field; +% the entry functions try to make the formatting look reasonable even when +% such fields are empty). +% +% output.check(s,t) == +% BEGIN +% if empty$(s) then +% warning$("empty " * t * " in " * cite$) +% else output.nonnull(s) +% fi +% END +% +% The output.bibitem function writes the \bibitem for the current entry +% (the label should already have been set up), and sets up the separator +% state for the output functions. And, it leaves a string on the stack +% as per the output convention. +% +% output.bibitem == +% BEGIN +% newline$ +% write$("\bibitem[") % for alphabetic labels, +% write$(label) % these three lines +% write$("]{") % are used +% write$("\bibitem{") % this line for numeric labels +% write$(cite$) +% write$("}") +% push "" on stack +% output.state := before.all +% END +% +% The fin.entry function finishes off an entry by adding a period to the +% string remaining on the stack. If the state is still before.all +% then nothing was produced for this entry, so the result will look bad, +% but the user deserves it. (We don't omit the whole entry because the +% entry was cited, and a bibitem is needed to define the citation label.) +% +% fin.entry == +% BEGIN +% write$(add.period$(pop())) +% newline$ +% END +% +% The new.block function prepares for a new block to be output, and +% new.sentence prepares for a new sentence. +% Added by H2B was new.clause, that prepares for a new subordinate clause. +% +% new.block == +% BEGIN +% if output.state <> before.all then +% output.state := after.block +% fi +% END +% +% new.sentence == +% BEGIN +% if output.state <> after.block then +% if output.state <> before.all then +% output.state := after.sentence +% fi +% fi +% END +% +% new.clause == +% BEGIN +% if output.state <> after.sentence then +% if output.state <> after.block then +% if output.state <> before.all then +% output.state := mid.sentence +% fi +% fi +% fi +% END +% + +INTEGERS { output.state before.all mid.sentence after.sentence after.block + continue.sentence } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := + #4 'continue.sentence := +} + +% the variables s and t are temporary string holders + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state continue.sentence = + { " " * write$ } + { output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + } + if$ + continue.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {output.bibitem} +{ newline$ +#if LAB_ALPH + "\bibitem[" write$ + label write$ + "]{" write$ +#else + "\bibitem{" write$ +#endif LAB_ALPH + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +% This function finishes all entries. + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {new.clause} +{ output.state after.sentence = + 'skip$ + { output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { mid.sentence 'output.state := } + if$ + } + if$ + } + if$ +} + +% These three functions pop one or two (integer) arguments from the stack +% and push a single one, either 0 or 1. +% The 'skip$ in the `and' and `or' functions are used because +% the corresponding if$ would be idempotent + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +% Sometimes we begin a new block only if the block will be big enough. The +% new.block.checka function issues a new.block if its argument is nonempty; +% new.block.checkb does the same if either of its TWO arguments is nonempty. + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +% The new.sentence.check functions are analogous. + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +% And the new.clause.check functions, which were added by H2B, also. + +FUNCTION {new.clause.checka} +{ empty$ + 'skip$ + 'new.clause + if$ +} + +FUNCTION {new.clause.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.clause + if$ +} + +% Here are some functions for formatting chunks of an entry. +% By convention they either produce a string that can be followed by +% a comma or period (using add.period$, so it is OK to end in a period), +% or they produce the null string. +% +% A useful utility is the field.or.null function, which checks if the +% argument is the result of pushing a `missing' field (one for which no +% assignment was made when the current entry was read in from the database) +% or the result of pushing a string having no non-white-space characters. +% It returns the null string if so, otherwise it returns the field string. +% Its main (but not only) purpose is to guarantee that what's left on the +% stack is a string rather than a missing field. +% +% field.or.null(s) == +% BEGIN +% if empty$(s) then return "" +% else return s +% END +% +% Another helper function is emphasize, which returns the argument emphazised, +% if that is non-empty, otherwise it returns the null string. Italic +% corrections aren't used, so this function should be used when punctation +% will follow the result. In contrast to the last sentence, now italic +% corrections are always used (H2B). +% +% emphasize(s) == +% BEGIN +% if empty$(s) then return "" +% else return "{\em " * s * "\/}" +% END +% +% Similar to emphasize is capitalize, from which the argument comes out in +% small caps. This function was added by H2B. +% +% capitalize(s) == +% BEGIN +% if empty$(s) then return "" +% else return "{\sc " * s * "}" +% END +% +% And here is another such function---added by H2B---, that returns a boldface +% string. +% +% boldface(s) == +% BEGIN +% if empty$(s) then return "" +% else return "{\bf " * s * "}" +% END +% +% The function quote will put its argument string in quotes (added by H2B). +% +% quote(s) == +% BEGIN +% if empty$(s) then return "" +% else return "``" * s * "''" +% END +% +% And parentheses includes it in parentheses (added by H2B). +% +% parentheses(s) == +% BEGIN +% if empty$(s) then return "" +% else return "(" * s * ")" +% END +% +% The format.names function formats the argument (which should be in +% BibTeX name format) into "First Von Last, Junior", separated by commas +% and with an "and" before the last (but ending with "et~al." if the last +% of multiple authors is "others"). This function's argument should always +% contain at least one name. +% +% VAR: nameptr, namesleft, numnames: INTEGER +% pseudoVAR: nameresult: STRING (it's what's accumulated on the stack) +% +% format.names(s) == +% BEGIN +% nameptr := 1 +% numnames := num.names$(s) +% namesleft := numnames +% while namesleft > 0 +% do +% % for full names: +% t := format.name$(s, nameptr, "{ff~}{vv~}{ll}{, jj}") +% % for abbreviated first names: +% t := format.name$(s, nameptr, "{f.~}{vv~}{ll}{, jj}") +% if nameptr > 1 then +% if namesleft > 1 then nameresult := nameresult * ", " * t +% else if numnames > 2 +% then nameresult := nameresult * "," +% fi +% if t = "others" +% then nameresult := nameresult * " et~al." +% else nameresult := nameresult * " and " * t +% fi +% fi +% else nameresult := t +% fi +% nameptr := nameptr + 1 +% namesleft := namesleft - 1 +% od +% return nameresult +% END +% +% The format.authors function returns the result of format.names(author) +% if the author is present, or else it returns the null string. +% Capitalization of names added by H2B. +% +% format.authors == +% BEGIN +% if empty$(author) then return "" +% else return capitalize(format.names(author)) +% fi +% END +% +% Format.editors is like format.authors, but it uses the editor field, +% and appends ", editor" or ", editors". +% Capitalization of names added by H2B. +% +% format.editors == +% BEGIN +% if empty$(editor) then return "" +% else +% if num.names$(editor) > 1 then +% return capitalize(format.names(editor)) * ", editors" +% else +% return capitalize(format.names(editor)) * ", editor" +% fi +% fi +% END +% +% Other formatting functions are similar, so no "comment version" will be +% given for them. +% +% The `pop$' in this function gets rid of the duplicate `empty' value and +% the `skip$' returns the duplicate field value + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\abtype{2}{" swap$ * "}" * } %H2B + if$ +} + +FUNCTION {capitalize} +{ duplicate$ empty$ + { pop$ "" } + { "\abtype{0}{" swap$ * "}" * } %H2B + if$ +} + +FUNCTION {boldface} +{ duplicate$ empty$ + { pop$ "" } + { "\abtype{3}{" swap$ * "}" * } %H2B + if$ +} + +FUNCTION {quote} +{ duplicate$ empty$ + { pop$ "" } + { "\abtype{1}{" swap$ * "}" * } %H2B + if$ +} + +FUNCTION {parentheses} +{ duplicate$ empty$ + { pop$ "" } + { "\abtype{5}{" swap$ * "}" * } %H2B + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } +#if NAME_FULL + { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := +#else + { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := +#endif NAME_FULL + nameptr #1 > + { namesleft #1 > + { ", " * t * } + { numnames #2 > + { "\abphrase{1}" * } %H2B + 'skip$ + if$ + t "others" = + { "\abphrase{2}" * } %H2B + { "\abphrase{0}" * t * } %H2B + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names capitalize } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names capitalize + editor num.names$ #1 > + { "\abphrase{3}" * } %H2B + { "\abphrase{4}" * } %H2B + if$ + } + if$ +} + +% The format.title function is used for non-book-like titles. +% For most styles we convert to lowercase (except for the very first letter, +% and except for the first one after a colon (followed by whitespace)), +% and hope the user has brace-surrounded words that need to stay capitilized; +% for some styles, however, we leave it as it is in the database. + +FUNCTION {format.title} +{ title empty$ + { "" } +#if ATIT_LOWER + { title "t" change.case$ } +#else + 'title +#endif ATIT_LOWER + if$ +} + +% By default, BibTeX sets the global integer variable global.max$ to the BibTeX +% constant glob_str_size, the maximum length of a global string variable. +% Analogously, BibTeX sets the global integer variable entry.max$ to +% ent_str_size, the maximum length of an entry string variable. +% The style designer may change these if necessary (but this is unlikely) + +% The n.dashify function makes each single `-' in a string a double `--' +% if it's not already +% +% pseudoVAR: pageresult: STRING (it's what's accumulated on the stack) +% +% n.dashify(s) == +% BEGIN +% t := s +% pageresult := "" +% while (not empty$(t)) +% do +% if (first character of t = "-") +% then +% if (next character isn't) +% then +% pageresult := pageresult * "--" +% t := t with the "-" removed +% else +% while (first character of t = "-") +% do +% pageresult := pageresult * "-" +% t := t with the "-" removed +% od +% fi +% else +% pageresult := pageresult * the first character +% t := t with the first character removed +% fi +% od +% return pageresult +% END + +FUNCTION {n.dashify} +{ 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +% The format.date function is for the month and year, but we give a warning if +% there's an empty year but the month is there, and we return the empty string +% if they're both empty. +% The resulting string is enclosed in parentheses (H2B). + +FUNCTION {format.date} +{ year empty$ + { month empty$ + { "" } + { "there's a month but no year in " cite$ * warning$ + month parentheses + } + if$ + } + { month empty$ + { year parentheses } + { month " " * year * parentheses } + if$ + } + if$ +} + +% The format.btitle is for formatting the title field when it is a book-like +% entry---the style used here keeps it in uppers-and-lowers and emphasizes it. +% The emphasis will be done by quotation marks (H2B). + +FUNCTION {format.btitle} +{ title quote +} + +% For several functions we'll need to connect two strings with a +% tie (~) if the second one isn't very long (fewer than 3 characters). +% The tie.or.space.connect function does that. It concatenates the two +% strings on top of the stack, along with either a tie or space between +% them, and puts this concatenation back onto the stack: +% +% tie.or.space.connect(str1,str2) == +% BEGIN +% if text.length$(str2) < 3 +% then return the concatenation of str1, "~", and str2 +% else return the concatenation of str1, " ", and str2 +% END + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +% The either.or.check function complains if both fields or an either-or pair +% are nonempty. +% +% either.or.check(t,s) == +% BEGIN +% if empty$(s) then +% warning$(can't use both " * t * " fields in " * cite$) +% fi +% END + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +% The format.bvolume function is for formatting the volume and perhaps +% series name of a multivolume work. If both a volume and a series field +% are there, we assume the series field is the title of the whole multivolume +% work (the title field should be the title of the thing being referred to), +% and we add an "of ". This function is called in mid-sentence. +% The emphasis will be done by quotation marks (H2B). + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { "\abphrase{8}" volume tie.or.space.connect %H2B + series empty$ + 'skip$ + { "\abphrase{5}" * series quote * } %H2B + if$ + "volume and number" number either.or.check + } + if$ +} + +% The format.number.series function is for formatting the series name +% and perhaps number of a work in a series. This function is similar to +% format.bvolume, although for this one the series must exist (and the +% volume must not exist). If the number field is empty we output either +% the series field unchanged if it exists or else the null string. +% If both the number and series fields are there we assume the series field +% gives the name of the whole series (the title field should be the title +% of the work being one referred to), and we add an "in ". +% We capitilize Number when this function is used at the beginning of a block. +% The latter applies if output.state is mid.sentence or continue.sentence +% (H2B). + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = output.state continue.sentence = or + { "\abphrase{10}" } %H2B + { "\abphrase{11}" } %H2B + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { "\abphrase{6}" * series * } %H2B + if$ + } + if$ + } + { "" } + if$ +} + +% The format.edition function appends " edition" to the edition, if present. +% We lowercase the edition (it should be something like "Third"), because +% this doesn't start a sentence. +% The latter applies if output.state is mid.sentence or continue.sentence +% (H2B). + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = output.state continue.sentence = or + { edition "l" change.case$ "\abphrase{12}" * } %H2B + { edition "t" change.case$ "\abphrase{12}" * } %H2B + if$ + } + if$ +} + +% The format.pages function is used for formatting a page range in a book +% (and in rare circumstances, an article). +% +% The multi.page.check function examines the page field for a "-" or "," or "+" +% so that format.pages can use "page" instead of "pages" if none exists. +% Note: global.max$ here means "take the rest of the string" +% +% VAR: multiresult: INTEGER (actually, a boolean) +% +% multi.page.check(s) == +% BEGIN +% t := s +% multiresult := false +% while ((not multiresult) and (not empty$(t))) +% do +% if (first character of t = "-" or "," or "+") +% then multiresult := true +% else t := t with the first character removed +% fi +% od +% return multiresult +% END + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +% This function doesn't begin a sentence so "pages" isn't capitalized. +% Other functions that use this should keep that in mind. + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { "\abphrase{13}" pages n.dashify tie.or.space.connect } %H2B + { "\abphrase{14}" pages tie.or.space.connect } %H2B + if$ + } + if$ +} + +% The format.vol.num.pages function is for the volume, number, and page range +% of a journal article. We use the format: vol(number):pages, with some +% variations for empty fields. This doesn't begin a sentence. +% The format was changed to `vol(number), pages', where the `vol' comes out in +% boldface, by H2B. + +FUNCTION {format.vol.num.pages} +{ volume field.or.null boldface + number empty$ + 'skip$ + { "\abtype{4}{" number * "}" * * %H2B + volume empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { ", " * pages n.dashify * } + if$ + } + if$ +} + + +% The format.chapter.pages, if the chapter is present, puts whatever is in the +% type field (or else "chapter" if type is empty) in front of a chapter number. +% It then appends the pages, if present. This doesn't begin a sentence. + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { "\abphrase{15}" } %H2B + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +% The format.in.ed.booktitle function is used for starting out a sentence +% that begins "In ", putting an editor before the title if one +% exists. +% The emphasis will be done by quotation marks (H2B). + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { "\abphrase{7}" booktitle quote * } %H2B + { "\abphrase{7}" format.editors * ", " * booktitle quote * } %H2B + if$ + } + if$ +} + +% The function empty.misc.check complains if all six fields are empty, and +% if there's been no sorting or alphabetic-label complaint. + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and +#if SORTED + key empty$ not and +#else !SORTED +#if LAB_ALPH + key empty$ not and +#endif LAB_ALPH +#endif SORTED + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +% The function format.thesis.type returns either the (case-changed) type field, +% if it is defined, or else the default string already on the stack +% (like "Master's thesis" or "PhD thesis"). + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +% The function format.tr.number makes a string starting with "Technical Report" +% (or type, if that field is defined), followed by the number if there is one; +% it returns the starting part (with a case change) even if there is no number. +% This is used at the beginning of a sentence. + +FUNCTION {format.tr.number} +{ type empty$ + { "\abphrase{16}" } %H2B + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +% Now come the cross-referencing functions (these are invoked because +% one entry in the database file(s) cross-references another, by giving +% the other entry's database key in a `crossref' field). This feature +% allows one or more titled things that are part of a larger titled +% thing to cross-reference the larger thing. These styles allow for +% five posibilities: (1) an ARTICLE may cross-reference an ARTICLE; +% (2) a BOOK, (3) INBOOK, or (4) INCOLLECTION may cross-reference a BOOK; +% or (5) an INPROCEEDINGS may cross-reference a PROCEEDINGS. +% Each of these is explained in more detail later. +% +% An ARTICLE entry type may cross reference another ARTICLE (this is +% intended for when an entire journal is devoted to a single topic--- +% but since there is no JOURNAL entry type, the journal, too, should be +% classified as an ARTICLE but without the author and title fields). +% This will result in two warning messages for the journal's entry +% if it's included in the reference list, but such is life. +% In the original true function the emphasis with italic correction had been +% made by inserting the necessary TeX control sequences directly; this is +% substituted by a call to emphasize (H2B). +% +% format.article.crossref == +% BEGIN +% if empty$(key) then +% if empty$(journal) then +% warning$("need key or journal for " * cite$ * +% " to crossref " * crossref) +% return(" \cite{" * crossref * "}") +% else +% return("In " * emphazise.correct (journal) * +% " \cite{" * crossref * "}") +% fi +% else +% return("In " * key * " \cite{" * crossref * "}") +% fi +% END +% +% The other cross-referencing functions are similar, so no "comment version" +% will be given for them. + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { "\abphrase{7}" journal emphasize * } %H2B + if$ + } + { "\abphrase{7}" key * } %H2B + if$ + " \cite{" * crossref * "}" * +} + +% We use just the last names of editors for a cross reference: either +% "editor", or "editor1 and editor2", or "editor1 et~al." depending on +% whether there are one, or two, or more than two editors. + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ "\abphrase{2}" * } %H2B + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { "\abphrase{2}" * } %H2B + { "\abphrase{0}" * editor #2 "{vv~}{ll}" format.name$ * } %H2B + if$ + } + if$ + } + if$ +} + +% A BOOK (or INBOOK) entry type (assumed to be for a single volume in a +% multivolume work) may cross reference another BOOK (the entire multivolume). +% Usually there will be an editor, in which case we use that to construct the +% cross reference; otherwise we use a nonempty key field or else the series +% field (since the series gives the title of the multivolume work). +% The series title is enclosed in quotes rather than emphasized (H2B). + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + "\abphrase{7}" %H2B + } + { "\abphrase{9}" volume tie.or.space.connect %H2B + "\abphrase{5}" * %H2B + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series quote * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +% An INCOLLECTION entry type may cross reference a BOOK (assumed to be the +% collection), or an INPROCEEDINGS may cross reference a PROCEEDINGS. +% Often there will be an editor, in which case we use that to construct +% the cross reference; otherwise we use a nonempty key field or else +% the booktitle field (which gives the cross-referenced work's title). +% The booktitle is enclosed in quotes rather than emphasized (H2B). + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "\abphrase{7}" booktitle quote * } %H2B + if$ + } + { "\abphrase{7}" key * } %H2B + if$ + } + { "\abphrase{7}" format.crossref.editor * } %H2B + if$ + " \cite{" * crossref * "}" * +} + +% Now we define the type functions for all entry types that may appear +% in the .BIB file---e.g., functions like `article' and `book'. These +% are the routines that actually generate the .BBL-file output for +% the entry. These must all precede the READ command. In addition, the +% style designer should have a function `default.type' for unknown types. +% Note: The fields (within each list) are listed in order of appearance, +% except as described for an `inbook' or a `proceedings'. +% +% The article function is for an article in a journal. An article may +% CROSSREF another article. +% Required fields: author, title, journal, year +% Optional fields: volume, number, pages, month, note +% +% article == +% BEGIN +% output.bibitem +% output.check(format.authors,"author") +% new.block +% output.check(format.title,"title") % omitted if NO_TITLE (H2B) +% new.block % dto. +% if missing$(crossref) then +% output.check(emphasize(journal),"journal") +% % italic correction added (H2B) +% output(format.vol.num.pages) +% output.check(format.date,"year") +% else +% output.nonnull(format.article.crossref) +% new.clause % added by H2B +% output(format.pages) +% fi +% new.block +% output(note) +% fin.entry +% END +% +% The book function is for a whole book. A book may CROSSREF another book. +% Required fields: author or editor, title, publisher, year +% Optional fields: volume or number, series, address, edition, month, +% note +% +% book == +% BEGIN +% if empty$(author) then output.check(format.editors,"author and editor") +% else output.check(format.authors,"author") +% if missing$(crossref) then +% either.or.check("author and editor",editor) +% fi +% fi +% new.block +% output.check(format.btitle,"title") +% if missing$(crossref) then +% new.clause % added by H2B +% output(format.bvolume) +% new.block +% output(format.number.series) +% new.sentence +% output.check(publisher,"publisher") +% new.clause.checka(address) % added by H2B +% output(address) +% else +% new.block +% output.nonnull(format.book.crossref) +% fi +% edition new.clause.checka % added by H2B +% output(format.edition) +% output.check(format.date,"year") +% new.block +% output(note) +% fin.entry +% END +% +% The other entry functions are all quite similar, so no "comment version" +% will be given for them. + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + new.block +#if !NO_TITLE + format.title "title" output.check + new.block +#endif + crossref missing$ + { journal emphasize "journal" output.check + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + new.clause + format.pages output + } + if$ + new.block + note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { new.clause + format.bvolume output + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address new.clause.checka + address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + edition new.clause.checka + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A booklet is a bound thing without a publisher or sponsoring institution. +% Required: title +% Optional: author, howpublished, address, month, year, note + +FUNCTION {booklet} +{ output.bibitem + format.authors output + new.block + format.title "title" output.check + howpublished address new.block.checkb + howpublished output + address new.clause.checka + address output + format.date output + new.block + note output + fin.entry +} + +% For the conference entry type, see inproceedings. + +% An inbook is a piece of a book: either a chapter and/or a page range. +% It may CROSSREF a book. If there's no volume field, the type field +% will come before number and series. +% Required: author or editor, title, chapter and/or pages, publisher,year +% Optional: volume or number, series, type, address, edition, month, note + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + new.clause + crossref missing$ + { format.bvolume output + new.clause + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + publisher "publisher" output.check + address new.clause.checka + address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + edition new.clause.checka + format.edition output + format.date "year" output.check + new.block + note output + fin.entry +} + +% An incollection is like inbook, but where there is a separate title +% for the referenced thing (and perhaps an editor for the whole). +% An incollection may CROSSREF a book. +% Required: author, title, booktitle, publisher, year +% Optional: editor, volume or number, series, type, chapter, pages, +% address, edition, month, note +% For the NO_TITLE option the title is suppressed, if the chapter or the pages +% field is nonempty (H2B). + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block +#if NO_TITLE + chapter empty$ pages empty$ and + { +#endif + format.title "title" output.check + new.block +#if NO_TITLE + } + 'skip$ + if$ +#endif + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + new.clause + format.bvolume output + new.clause + format.number.series output + new.clause + format.chapter.pages output + new.sentence + publisher "publisher" output.check + address new.clause.checka + address output + edition new.clause.checka + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + new.clause + format.chapter.pages output + } + if$ + new.block + note output + fin.entry +} + +% An inproceedings is an article in a conference proceedings, and it may +% CROSSREF a proceedings. If there's no address field, the month (& year) +% will appear just before note. +% Required: author, title, booktitle, year +% Optional: editor, volume or number, series, pages, address, month, +% organization, publisher, note +% For the NO_TITLE option the title is suppressed, if the pages field is +% nonempty (H2B). + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block +#if NO_TITLE + pages empty$ + { +#endif + format.title "title" output.check + new.block +#if NO_TITLE + } + 'skip$ + if$ +#endif + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + volume new.clause.checka + format.bvolume output + number series new.clause.checkb + format.number.series output + pages new.clause.checka + format.pages output + address empty$ + { organization publisher new.sentence.checkb + organization output + publisher new.clause.checka + publisher output + format.date "year" output.check + } + { new.clause + address output.nonnull + format.date "year" output.check + new.sentence + organization output + new.clause + publisher output + } + if$ + } + { format.incoll.inproc.crossref output.nonnull + new.clause + format.pages output + } + if$ + new.block + note output + fin.entry +} + +% The conference function is included for Scribe compatibility. + +FUNCTION {conference} { inproceedings } + +% A manual is technical documentation. +% Required: title +% Optional: author, organization, address, edition, month, year, note + +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + new.clause + address output + } + if$ + } + { format.authors output.nonnull } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ + { address new.block.checka + address output + } + 'skip$ + if$ + } + { organization address new.block.checkb + organization output + address new.clause.checka + address output + } + if$ + edition new.clause.checka + format.edition output + format.date output + new.block + note output + fin.entry +} + +% A mastersthesis is a Master's thesis. +% Required: author, title, school, year +% Optional: type, address, month, note + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + "\abphrase{17}" format.thesis.type output.nonnull %H2B + new.clause + school "school" output.check + address new.clause.checka + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A misc is something that doesn't fit elsewhere. +% Required: at least one of the `optional' fields +% Optional: author, title, howpublished, month, year, note + +FUNCTION {misc} +{ output.bibitem + format.authors output + title howpublished new.block.checkb + format.title output + howpublished new.block.checka + howpublished output + format.date output + new.block + note output + fin.entry + empty.misc.check +} + +% A phdthesis is like a mastersthesis. +% Required: author, title, school, year +% Optional: type, address, month, note + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle "title" output.check + new.block + "\abphrase{18}" format.thesis.type output.nonnull %H2B + new.clause + school "school" output.check + address new.clause.checka + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% A proceedings is a conference proceedings. +% If there is an organization but no editor field, the organization will +% appear as the first optional field (we try to make the first block nonempty); +% if there's no address field, the month (& year) will appear just before note. +% Required: title, year +% Optional: editor, volume or number, series, address, month, +% organization, publisher, note + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + volume new.clause.checka + format.bvolume output + number series new.clause.checkb + format.number.series output + address empty$ + { editor empty$ + { publisher new.sentence.checka } + { organization publisher new.sentence.checkb + organization output + publisher new.clause.checka + } + if$ + publisher output + format.date "year" output.check + } + { new.clause + address output.nonnull + format.date "year" output.check + new.sentence + editor empty$ + 'skip$ + { organization output + new.clause + } + if$ + publisher output + } + if$ + new.block + note output + fin.entry +} + +% A techreport is a technical report. +% Required: author, title, institution, year +% Optional: type, number, address, month, note +% For the NO_TITLE option the title is suppressed, if the number field is +% nonempty (H2B). + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block +#if NO_TITLE + number empty$ + { +#endif + format.title "title" output.check + new.block +#if NO_TITLE + } + 'skip$ + if$ +#endif + format.tr.number output.nonnull + new.clause + institution "institution" output.check + address new.clause.checka + address output + format.date "year" output.check + new.block + note output + fin.entry +} + +% An unpublished is something that hasn't been published. +% Required: author, title, note +% Optional: month, year + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + note "note" output.check + format.date output + fin.entry +} + +% We use entry type `misc' for an unknown type; BibTeX gives a warning. + +FUNCTION {default.type} { misc } + +% Here are macros for common things that may vary from style to style. +% Users are encouraged to use these macros. +% +% Months are either written out in full or abbreviated +% +% The macros for the month names now expand to TeX macros, so they are +% adaptable too. Thus no conditional MONTH_FULL is needed anymore (H2B). +% +% The \abmonth macro should be defined by the user as something like: +% \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} + +MACRO {jan} {"\abmonth{1}"} + +MACRO {feb} {"\abmonth{2}"} + +MACRO {mar} {"\abmonth{3}"} + +MACRO {apr} {"\abmonth{4}"} + +MACRO {may} {"\abmonth{5}"} + +MACRO {jun} {"\abmonth{6}"} + +MACRO {jul} {"\abmonth{7}"} + +MACRO {aug} {"\abmonth{8}"} + +MACRO {sep} {"\abmonth{9}"} + +MACRO {oct} {"\abmonth{10}"} + +MACRO {nov} {"\abmonth{11}"} + +MACRO {dec} {"\abmonth{12}"} + +% The next ten macros are provided for edition numbers. For higher numbers the +% \abedition command should be extended by the user and called directly or--- +% better---via @STRING declarations in the BIB files. The \abedition command +% to be defined by the user is, e.g.: +% \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} + +MACRO {first} {"\abedition{1}"} + +MACRO {second} {"\abedition{2}"} + +MACRO {third} {"\abedition{3}"} + +MACRO {fourth} {"\abedition{4}"} + +MACRO {fifth} {"\abedition{5}"} + +MACRO {sixth} {"\abedition{6}"} + +MACRO {seventh} {"\abedition{7}"} + +MACRO {eighth} {"\abedition{8}"} + +MACRO {ninth} {"\abedition{9}"} + +MACRO {tenth} {"\abedition{10}"} + +% Finally, some macros are defined to re-dedicate the CHAPTER field via the +% TYPE field. An appropriate \abchapter command were: +% \def\abchapter#1{\ifcase#1Section\or Paragraph\or Appendix\or Part\fi} + +MACRO {section} {"\abchapter{0}"} + +MACRO {paragraph} {"\abchapter{1}"} + +MACRO {appendix} {"\abchapter{2}"} + +MACRO {part} {"\abchapter{3}"} + +% Journals are either written out in full or abbreviated; +% the abbreviations are like those found in ACM publications. +% +% To get a completely different set of abbreviations, it may be best to make +% a separate .bib file with nothing but those abbreviations; users could then +% include that file name as the first argument to the \bibliography command. +% +% All journal macros were commented off, because the set applies only to a +% very special field of sciences; so the hint in the previous paragraph +% becomes mandatory (H2B). + +% #if JOUR_FULL +% +% MACRO {acmcs} {"ACM Computing Surveys"} +% +% MACRO {acta} {"Acta Informatica"} +% +% MACRO {cacm} {"Communications of the ACM"} +% +% MACRO {ibmjrd} {"IBM Journal of Research and Development"} +% +% MACRO {ibmsj} {"IBM Systems Journal"} +% +% MACRO {ieeese} {"IEEE Transactions on Software Engineering"} +% +% MACRO {ieeetc} {"IEEE Transactions on Computers"} +% +% MACRO {ieeetcad} +% {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} +% +% MACRO {ipl} {"Information Processing Letters"} +% +% MACRO {jacm} {"Journal of the ACM"} +% +% MACRO {jcss} {"Journal of Computer and System Sciences"} +% +% MACRO {scp} {"Science of Computer Programming"} +% +% MACRO {sicomp} {"SIAM Journal on Computing"} +% +% MACRO {tocs} {"ACM Transactions on Computer Systems"} +% +% MACRO {tods} {"ACM Transactions on Database Systems"} +% +% MACRO {tog} {"ACM Transactions on Graphics"} +% +% MACRO {toms} {"ACM Transactions on Mathematical Software"} +% +% MACRO {toois} {"ACM Transactions on Office Information Systems"} +% +% MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} +% +% MACRO {tcs} {"Theoretical Computer Science"} +% +% #else !JOUR_FULL +% +% MACRO {acmcs} {"ACM Comput. Surv."} +% +% MACRO {acta} {"Acta Inf."} +% +% MACRO {cacm} {"Commun. ACM"} +% +% MACRO {ibmjrd} {"IBM J. Res. Dev."} +% +% MACRO {ibmsj} {"IBM Syst.~J."} +% +% MACRO {ieeese} {"IEEE Trans. Softw. Eng."} +% +% MACRO {ieeetc} {"IEEE Trans. Comput."} +% +% MACRO {ieeetcad} +% {"IEEE Trans. Comput.-Aided Design Integrated Circuits"} +% +% MACRO {ipl} {"Inf. Process. Lett."} +% +% MACRO {jacm} {"J.~ACM"} +% +% MACRO {jcss} {"J.~Comput. Syst. Sci."} +% +% MACRO {scp} {"Sci. Comput. Programming"} +% +% MACRO {sicomp} {"SIAM J. Comput."} +% +% MACRO {tocs} {"ACM Trans. Comput. Syst."} +% +% MACRO {tods} {"ACM Trans. Database Syst."} +% +% MACRO {tog} {"ACM Trans. Gr."} +% +% MACRO {toms} {"ACM Trans. Math. Softw."} +% +% MACRO {toois} {"ACM Trans. Office Inf. Syst."} +% +% MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."} +% +% MACRO {tcs} {"Theoretical Comput. Sci."} +% +% #endif JOUR_FULL + +% Now we read in the .BIB entries. + +READ + +% The sortify function converts to lower case after purify$ing; it's +% used in sorting and in computing alphabetic labels after sorting +% +% The chop.word(w,len,s) function returns either s or, if the first len +% letters of s equals w (this comparison is done in the third line of the +% function's definition), it returns that part of s after w. + +#if SORTED + +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +#else !SORTED +#if LAB_ALPH + +% We need the chop.word stuff for the dubious unsorted-list-with-labels case. + +INTEGERS { len } + +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} + +#endif LAB_ALPH +#endif SORTED + +% This long comment applies only to alphabetic labels +% +% The format.lab.names function makes a short label by using the initials of +% the von and Last parts of the names (but if there are more than four names, +% (i.e., people) it truncates after three and adds a superscripted "+"; +% it also adds such a "+" if the last of multiple authors is "others"). +% If there is only one name, and its von and Last parts combined have just +% a single name-token ("Knuth" has a single token, "Brinch Hansen" has two), +% we take the first three letters of the last name. The boolean +% et.al.char.used tells whether we've used a superscripted "+", so that we +% know whether to include a LaTeX macro for it. +% +% format.lab.names(s) == +% BEGIN +% numnames := num.names$(s) +% if numnames > 1 then +% if numnames > 4 then +% namesleft := 3 +% else +% namesleft := numnames +% nameptr := 1 +% nameresult := "" +% while namesleft > 0 +% do +% if (name_ptr = numnames) and +% format.name$(s, nameptr, "{ff }{vv }{ll}{ jj}") = "others" +% then nameresult := nameresult * "{\etalchar{+}}" +% et.al.char.used := true +% else nameresult := nameresult * +% format.name$(s, nameptr, "{v{}}{l{}}") +% nameptr := nameptr + 1 +% namesleft := namesleft - 1 +% od +% if numnames > 4 then +% nameresult := nameresult * "{\etalchar{+}}" +% et.al.char.used := true +% else +% t := format.name$(s, 1, "{v{}}{l{}}") +% if text.length$(t) < 2 then % there's just one name-token +% nameresult := text.prefix$(format.name$(s,1,"{ll}"),3) +% else +% nameresult := t +% fi +% fi +% return nameresult +% END +% +% Exactly what fields we look at in constructing the primary part of the label +% depends on the entry type; this selectivity (as opposed to, say, always +% looking at author, then editor, then key) helps ensure that "ignored" fields, +% as described in the LaTeX book, really are ignored. Note that MISC is part +% of the deepest `else' clause in the nested part of calc.label; thus, any +% unrecognized entry type in the database is handled correctly. +% +% There is one auxiliary function for each of the four different sequences of +% fields we use. The first of these functions looks at the author field, and +% then, if necessary, the key field. The other three functions, which might +% look at two fields and the key field, are similar, except that the key field +% takes precedence over the organization field (for labels---not for sorting). +% +% The calc.label function calculates the preliminary label of an entry, which +% is formed by taking three letters of information from the author or editor or +% key or organization field (depending on the entry type and on what's empty, +% but ignoring a leading "The " in the organization), and appending the last +% two characters (digits) of the year. It is an error if the appropriate fields +% among author, editor, organization, and key are missing, and we use +% the first three letters of the cite$ in desperation when this happens. +% The resulting label has the year part, but not the name part, purify$ed +% (purify$ing the year allows some sorting shenanigans by the user). +% +% This function also calculates the version of the label to be used in sorting. +% +% The final label may need a trailing 'a', 'b', etc., to distinguish it from +% otherwise identical labels, but we can't calculated those "extra.label"s +% until after sorting. +% +% calc.label == +% BEGIN +% if type$ = "book" or "inbook" then +% author.editor.key.label +% else if type$ = "proceedings" then +% editor.key.organization.label +% else if type$ = "manual" then +% author.key.organization.label +% else +% author.key.label +% fi fi fi +% label := label * substring$(purify$(field.or.null(year)), -1, 2) +% % assuming we will also sort, we calculate a sort.label +% sort.label := sortify(label), but use the last four, not two, digits +% END + +#if LAB_ALPH + +INTEGERS { et.al.char.used } + +FUNCTION {initialize.et.al.char.used} +{ #0 'et.al.char.used := +} + +EXECUTE {initialize.et.al.char.used} + +FUNCTION {format.lab.names} +{ 's := + s num.names$ 'numnames := + numnames #1 > + { numnames #4 > + { #3 'namesleft := } + { numnames 'namesleft := } + if$ + #1 'nameptr := + "" + { namesleft #0 > } + { nameptr numnames = + { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { "{\etalchar{+}}" * + #1 'et.al.char.used := + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + } + { s nameptr "{v{}}{l{}}" format.name$ * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + numnames #4 > + { "{\etalchar{+}}" * + #1 'et.al.char.used := + } + 'skip$ + if$ + } + { s #1 "{v{}}{l{}}" format.name$ + duplicate$ text.length$ #2 < + { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ } + 'skip$ + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author or key in " cite$ * warning$ + cite$ #1 #3 substring$ + } +#endif SORTED + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author, editor, or key in " cite$ * warning$ + cite$ #1 #3 substring$ + } +#endif SORTED + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.key.organization.label} +{ author empty$ + { key empty$ + { organization empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need author, key, or organization in " cite$ * + warning$ + cite$ #1 #3 substring$ + } +#endif SORTED + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.organization.label} +{ editor empty$ + { key empty$ + { organization empty$ +#if SORTED + { cite$ #1 #3 substring$ } +#else !SORTED % need warning here because we won't give it later + { "for label, need editor, key, or organization in " cite$ * + warning$ + cite$ #1 #3 substring$ + } +#endif SORTED + { "The " #4 organization chop.word #3 text.prefix$ } + if$ + } + { key #3 text.prefix$ } + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.label} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.organization.label + { type$ "manual" = + 'author.key.organization.label + 'author.key.label + if$ + } + if$ + } + if$ + duplicate$ + year field.or.null purify$ #-1 #2 substring$ + * + 'label := + year field.or.null purify$ #-1 #4 substring$ + * + sortify 'sort.label := +} + +% It doesn't seem like a particularly good idea to use an order-of-citation +% reference list when using alphabetic labels, but we need to have a +% special pass to calculate labels when this happens. + +#if !SORTED + +ITERATE {calc.label} + +#endif !SORTED + +#endif LAB_ALPH + +% When sorting, we compute the sortkey by executing "presort" on each entry. +% The presort key contains a number of "sortify"ed strings, concatenated +% with multiple blanks between them. This makes things like "brinch per" +% come before "brinch hansen per". +% +% The fields used here are: the sort.label for alphabetic labels (as set by +% calc.label), followed by the author names (or editor names or organization +% (with a leading "The " removed) or key field, depending on entry type and on +% what's empty), followed by year, followed by the first bit of the title +% (chopping off a leading "The ", "A ", or "An "). +% Names are formatted: Von Last First Junior. +% The names within a part will be separated by a single blank +% (such as "brinch hansen"), two will separate the name parts themselves +% (except the von and last), three will separate the names, +% four will separate the names from year (and from label, if alphabetic), +% and four will separate year from title. +% +% The sort.format.names function takes an argument that should be in +% BibTeX name format, and returns a string containing " "-separated +% names in the format described above. The function is almost the same +% as format.names. + +#if SORTED + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { nameptr #1 > + { " " * } + 'skip$ + if$ +#if NAME_FULL + s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := +#else + s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := +#endif NAME_FULL + nameptr numnames = t "others" = and + { "et al" * } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +% The sort.format.title function returns the argument, +% but first any leading "A "'s, "An "'s, or "The "'s are removed. +% The chop.word function uses s, so we need another string variable, t + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} + +% The auxiliary functions here, for the presort function, are analogous to +% the ones for calc.label; the same comments apply, except that the +% organization field takes precedence here over the key field. For sorting +% purposes, we still remove a leading "The " from the organization field. + +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {author.organization.sort} +{ author empty$ + { organization empty$ + { key empty$ + { "to sort, need author, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { author sort.format.names } + if$ +} + +FUNCTION {editor.organization.sort} +{ editor empty$ + { organization empty$ + { key empty$ + { "to sort, need editor, organization, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { "The " #4 organization chop.word sortify } + if$ + } + { editor sort.format.names } + if$ +} + +% There is a limit, entry.max$, on the length of an entry string variable +% (which is what its sort.key$ is), so we take at most that many characters +% of the constructed key, and hope there aren't many references that match +% to that many characters! + +FUNCTION {presort} +#if LAB_ALPH +{ calc.label + sort.label + " " + * + type$ "book" = +#else !LAB_ALPH +{ type$ "book" = +#endif LAB_ALPH + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.organization.sort + { type$ "manual" = + 'author.organization.sort + 'author.sort + if$ + } + if$ + } + if$ +#if LAB_ALPH + * +#endif LAB_ALPH + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} + +% And now we can sort + +SORT + +#endif SORTED + +% This long comment applies only to alphabetic labels, when sorted +% +% Now comes the final computation for alphabetic labels, putting in the 'a's +% and 'b's and so forth if required. This involves two passes: a forward +% pass to put in the 'b's, 'c's and so on, and a backwards pass +% to put in the 'a's (we don't want to put in 'a's unless we know there +% are 'b's). +% We have to keep track of the longest (in width$ terms) label, for use +% by the "thebibliography" environment. +% +% VAR: longest.label, last.sort.label, next.extra: string +% longest.label.width, last.extra.num: integer +% +% initialize.longest.label == +% BEGIN +% longest.label := "" +% last.sort.label := int.to.chr$(0) +% next.extra := "" +% longest.label.width := 0 +% last.extra.num := 0 +% END +% +% forward.pass == +% BEGIN +% if last.sort.label = sort.label then +% last.extra.num := last.extra.num + 1 +% extra.label := int.to.chr$(last.extra.num) +% else +% last.extra.num := chr.to.int$("a") +% extra.label := "" +% last.sort.label := sort.label +% fi +% END +% +% reverse.pass == +% BEGIN +% if next.extra = "b" then +% extra.label := "a" +% fi +% label := label * extra.label +% if width$(label) > longest.label.width then +% longest.label := label +% longest.label.width := width$(label) +% fi +% next.extra := extra.label +% END + +#if LAB_ALPH + +#if SORTED + +STRINGS { longest.label last.sort.label next.extra } + +INTEGERS { longest.label.width last.extra.num } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 int.to.chr$ 'last.sort.label := + "" 'next.extra := + #0 'longest.label.width := + #0 'last.extra.num := +} + +FUNCTION {forward.pass} +{ last.sort.label sort.label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + sort.label 'last.sort.label := + } + if$ +} + +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + label extra.label * 'label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ + extra.label 'next.extra := +} + +EXECUTE {initialize.longest.label} + +ITERATE {forward.pass} + +REVERSE {reverse.pass} + +#else !SORTED + +% It still doesn't seem like a good idea to use an order-of-citation +% reference list when using alphabetic labels, but when this happens we +% must compute the longest label + +STRINGS { longest.label } + +INTEGERS { longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +#endif SORTED + +#else !LAB_ALPH + +% Now comes the computation for numeric labels. +% We use either the sorted order or original order. +% We still have to keep track of the longest (in width$ terms) label, for use +% by the "thebibliography" environment. + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +#endif LAB_ALPH + +% Now we're ready to start writing the .BBL file. +% We begin, if necessary, with a LaTeX macro for unnamed names in an alphabetic +% label; next comes stuff from the `preamble' command in the database files. +% Then we give an incantation containing the command +% \begin{thebibliography}{...} +% where the `...' is the longest label. +% +% We also call init.state.consts, for use by the output routines. +% +% At first a TeX definition is output, that makes user commands able to +% distinguish between a ``full'' and an ``abbreviated'' style (H2B). + +FUNCTION {begin.bib} +{ +#if MONTH_FULL + "\newif\ifabfull\abfulltrue" write$ newline$ +#else + "\newif\ifabfull\abfullfalse" write$ newline$ +#endif +#if LAB_ALPH + et.al.char.used + { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ } + 'skip$ + if$ +#endif LAB_ALPH + preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +% Now we produce the output for all the entries + +ITERATE {call.type$} + +% Finally, we finish up by writing the `\end{thebibliography}' command. + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} diff --git a/Master/texmf-dist/doc/bibtex/abstyles/docmac.doc b/Master/texmf-dist/doc/bibtex/abstyles/docmac.doc new file mode 100644 index 00000000000..9327e67279f --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/docmac.doc @@ -0,0 +1,778 @@ +% This is DOCMAC.DOC, Release 1 of 12 Aug 1991. +%--------------------------------------------------------- +% This macro package is based on PROGDOC.DOC, which is +% (c) 1988 by J.Schrod. Put into the public domain. +% It is enhanced by incorporating some macros from WEBMAC.TEX to deal with +% header lines and a table of contents and offers some additional typesetting +% capabilities. The enhancements and changes are done by +% Hans-Hermann Bode (HHBODE@DOSUNI1.BITNET). + +% +% Macro package for the documentation of programs (and TeX macros) +% english version +% + +% Version of the basic PROGDOC.DOC: +% first version (for ftp/Bitnet) (88-12-05) +% +% Release history of DOCMAC.DOC: +% +% Rel. Date Author Comment +% 1 12 Aug 1991 H2B First change file to PROGDOC.DOC. +% + + + +% documented with itself... +\input docmac + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% local macros +% + +\font\mc=cmr9 % for names like ASCII + +\def\title{DOCMAC} + + +\def\topofcontents{\null\vfill + \centerline{\titlefont\title} + \bigskip + \centerline{Joachim Schrod} + \medskip + \centerline{Hans-Hermann Bode} + \vfill} + +\def\botofcontents{\vfill + The macro package and the documentation was written initially by J.~Schrod + under the name \.{progdoc}. H.-H.~Bode enhanced the package with some stuff + from \.{webmac} and completed the documentation with material from the + ``\.{WEB} User Manual''; this makes up the chapter on + ``Formatting''---besides some minor changes in the remainder. + \par} + +\def\WEB{{\tt WEB\/}} +\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em\TeX}} + +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + +\chap Introduction. + +\WEB{} systems allow the documentation of programs by supporting the +separation in program fragments which can be collected and rearranged +afterwards. This allows {\it top-down\/} programming as well as the +{\it bottom-up\/} design of programs. Each program fragment can be +documented, usually with \TeX{}. A disadvantadge is that \WEB{} +actually exists only for a few programming languages (Pascal, C, +Modula-2). Besides, building up \WEB{} systems for ``exotic'' +programming languages like \TeX{} is very difficult. + +This macro package was built to allow good documentation for programs +in languages for which \WEB{} doesn't exist. It separates a program +text in sections that can be documented. All sections, collected +sequentially, will result in the complete program. In every section +begin and end of the program part are marked with |\beginprog| and +|\endprog|, this program part will be formatted as it is input +(``verbatim''). + +The separation of the sections is done in this version (which is based +on Plain~\TeX{}) by the macros |\chap| and |\sect|. But this can be +changed easily, e.g.\ for preparing the documentation with \LaTeX{}. +Then the last section group of this macro package must be omitted and +the rest must be realized as a style option. + +In the documentation part of a section text pieces, e.g.\ names of +variables, can be inserted verbatim to demonstrate the connection to +the program text. These parts are included in vertical bars +(`{\tt\vbar}') while the vertical bar itself can be obtained by +|\origvert|. + +This macro package does not offer the creation of an index because it is not +known which syntactical tokens the language has that should be mentioned in +an index. If you want a table of contents, just say |\contentspage| at the +end of your document (you need not put a |\bye| after that, |\contentspage| +does this for you). Some remarks about future enhancements which should be +done urgently are set in slanted type. + + +\sect We have to realize three parts: (1)~the formatting of rather +small verbatim texts in a line, (2)~the formatting of larger parts of +program and (3)~the document structuring elements for the separation +of the sections. Before we start we declare some shorthands for +category codes. + +By declaring the at sign~(`|@|') as well as the underscore~`(|_|)' as +letters we can use them in our macros. +{\tolerance=10000 +(I agree with D.~Knuth that |\identifier_several_words_long| is much +better readable than |\IdentifierSeveralWordsLong| and both are better +than |\pr@@@s|.) +With the at sign we can use the ``private'' Plain macros and with the +underscore we can make our own macros more readable. But as we have +to restore these category codes at the end of this macro file we store +their former values in the control sequences |\atcode| and |\uscode|. +This method is better than the usage of a group because not all macros +have to be defined global this way. +\par} + +\beginprog +\chardef\escape=0 +\chardef\letter=11 +\chardef\other=12 +%\chardef\active=13 % is defined in Plain already + +\chardef\atcode=\catcode`\@ +\chardef\uscode=\catcode`\_ + +\catcode`\@=\letter +\catcode`\_=\letter +\endprog + + + + +\chap Local Verbatim Formatting. + +The main point of every verbatim formatting is the switching of the +character codes of all characters that have a special \TeX{} meaning. +This can be done with the control sequence |\dospecials| that applies +the control sequence |\do| to all special characters. Additionally, +every line is regarded as a paragraph without indentation. Between +two paragraphs, i.e.\ between two lines, no extra space is set. +Finally all blanks and tabular characters shall be obeyed and the +inter word space after sentence terminators shall not be enlarged. +The activation of the tabular characters with |\obeytabs| is +equivalent to |\obeyspaces| in {\tt plain.tex\/}. + +Verbatim texts are set in monospace, we use (like in \WEB{}) the +character set with the extended {\mc ASCII}. For \LaTeX{} we would +have to add here |\ttex| to all size modifications like |\xpt|, +|\xiipt|, etc. + +\beginprog +\font\tentex=cmtex10 % typewriter extended ASCII 10pt +\let\ttex=\tentex % only for PLAIN with base size 10pt + +\def\setup_verbatim{% + \def\do##1{\catcode`##1\other}\dospecials + \parskip\z@skip \parindent\z@ + \obeylines \obeyspaces \obeytabs \frenchspacing + \ttex + } + +\let\tab=\space +\begingroup + \catcode`\^^I=\active% % Attention: no tabs! + \gdef\obeytabs{\catcode`\^^I=\active\def^^I{\tab}} + \global\let^^I=\tab% % if an active tab appears in a \write +\endgroup +\endprog + +\sect After having saved the old meaning of `{\tt\vbar}' in +|\origvert| and after declaring |\vbar| as a synonym for the character +that has the code of a vertical bar in the actual font, the vertical +bar can be made active. Then we call |\setup_verbatim|. But the +newline characters shall not be processed, they shall be regarded like +blank space. This can be reached by defining |\par| as |\space|. + +The next vertical bar in the input closes the group which becomes an +(unbreakable) |\hbox| then. The old meanings of the special +characters and of the vertical bar are restored and \TeX{} is in +normal (horizontal) mode again. + +\beginprog +\let\origvert=| +\chardef\vbar=`\| + +\catcode`\|=\active + +\def|{% + \leavevmode + \hbox\bgroup + \let\par\space \setup_verbatim + \let|\egroup + } +\endprog + + + + +\chap Program Fragments in Verbatim. + +We need macros to format the program fragments without any +linebreaking. Such a text area shall start with the macro +|\beginprog| and end with |\endprog|. The macro |\endprog| must stand +at the very beginning of a line and must be followed by white space +(blank, tab or newline character). After |\beginprog| as well as +after |\endprog| the rest of the line is ignored. + +Two demands must be regarded: There should be no length restrictions +for the processed text, and the tabular characters should be expanded +so that this macro works on PC's and on VAXes, too. + + +\sect The implementation method is quite simple: We read the next +line, test, wether the end is reached (by comparing with |\endprog|) +and otherwise set the character actually read. Every character is +inspected and tabular characters are expanded. + +Wether a line is set or wether the end of the processed area is +reached is indicated by the switch |\if@print|. At the beginning of +the |\beginprog| macro most settings are done with |\setup_verbatim| +(the vertical bar must be handled separately) and the rest of the line +is ignored. As everything is done within a group, the end of the +verbatim text can be processed by simply closing this group. + +For the user it looks as if |\endprog| terminates the processing, but +it just serves for the identification of the end, the true processing +is done with the internal macro |\end_verbatim|. + +\beginprog +\newif\if@print + +\def\beginprog{% + \endgraf + \bigbreak + \begingroup + \setup_verbatim \catcode`\|\other + \@printtrue + \ignore_rest_line + } +\let\end_verbatim=\endgroup % internal command ! +\endprog + + +\sect The first line is ignored, all the other lines are identified +with |\set_next_line| and processed with |\do_set|. This separation +in identification and processing allows that the line end character is +active in the definition only for a short time. + +When a line is to be formatted, we first check with |\check_print| +wether it contains |\endprog|, otherwise it is printed with +|\print_char|. The printing must be done for every character +individually because we want to check for tabular characters; the +exact algorithm is described below. Here we just have to note that +|\print_char| is used with two parameters of which the second one is +finished with the token |\end_line|. The first parameter is the first +character of the line, the second parameter is the rest of the line. +If the line is empty, the argument of |\do_set| is empty, too; so the +activation of |\print_char| must be finished with two |\end_line|. +Then the first |\end_line| is the first argument for |\print_char| and +the second argument is empty. But if the line did contain something, +the second |\end_line| is evaluated, for this case it is defined as +|\relax|. + +At last we call |\set_next_line| again to format the next line. If +the end is reached, i.e.\ if a line with |\endprog| was found, +|\set_next_line| is redefined as |\relax|. This can be done because +the original meaning is restored while closing the group with +|\end_verbatim|. + +\beginprog +\begingroup + \obeylines% % ^^M is active! ==> every line must end with % + \gdef\ignore_rest_line#1^^M{\set_next_line}% + \gdef\set_next_line#1^^M{\do_set{#1}}% +\endgroup + +\def\do_set#1{% + \endgraf + \check_print{#1}% + \if@print \indent \print_char#1\end_line\end_line + \else \let\set_next_line\end_verbatim + \fi + \set_next_line + } +\let\end_line=\relax +\endprog + + +\sect Before we look at the problem of formatting a line, we declare +|\check_print| that checks the end of the verbatim mode. We have to +do two things: we must split everything in front of the first blank +or tabular character and compare for identity with |\endprog|. The +splitting is easy because the line which is our first argument +contains blanks and tabulators as active characters. First we call +|\cut_at_tab| that demands a tabular character as separator for its +two pramenters so that everything in the line in front of the first +tabulator is part of the first parameter. If there is no tabular +character in the line, we append one so that the second parameter is +empty. The same trick is used to separate the part in front of the +first blank character from the resulting first part. + +The check is done with |\do_check|. We use a separate macro here so +that we can indent it (in the following definition blanks are active!) + +\beginprog +\begingroup +\obeyspaces\obeytabs +\gdef\check_print#1{\cut_at_tab#1^^I\end_line} +\gdef\cut_at_tab#1^^I#2\end_line{\check_first_part#1 \end_line}% blank ! +\gdef\check_first_part#1 #2\end_line{\do_check{#1}} +\endgroup +\endprog + + +\sect |\do_check| compares the line with a sample line that is +available in |\@endverbatim|. During the definition of +|\@endverbatim| it must be cared for that the escape character `|\|' +is a printable character: A comparison with |\ifx| demands identical +category codes. As a temporary escape character we use the vertical +bar. + +\beginprog +\def\do_check#1{% + \def\@line{#1}% + \ifx \@line\@endverbatim \@printfalse + \fi + } + +{\catcode`\|=\escape \catcode`\\=\other % | is temporary escape char + |gdef|@endverbatim{\endprog} % sample line +} % here \endgroup can't be used +\endprog + + +\sect Now we can set a line: we start with the first character, +followed by the rest of the line. Each character is counted in +|\char_count|. At the beginning of a line |\char_count| is~1, this +is reset at the end of the line. + +\goodbreak + +\beginprog +\newcount\char_count \char_count\@ne + +\def\print_char#1#2\end_line{% + \print_first_char{#1}% + \print_rest_of_line{#2}% + } +\endprog + + +\sect For each character that is set |\char_count| is incremented. +If a character is a tabulator, we set with |\print_tab| the fitting +amount of blank characters, otherwise the character itself. We must +compare the character that is stored in |\@char| with a macro of which +the ``first-level'' expansion is an active tabulator. For this case +we declare |\@tab|. + +\beginprog +{\obeytabs\gdef\@tab{^^I}} + +\def\print_first_char#1{% + \def\@char{#1}% + \advance \char_count\@ne + \ifx \@char\@tab \print_tab + \else \@char + \fi + } +\endprog + + +\sect If we want to fill the line with blank spaces up to the next +column with a number that can be divided by~8, we must be able to +compute the column number modulo~8, but \TeX{} has no modulo operator. +So we define the macro |\mod_viii| that computes its argument modulo~8 +and returns the result in the counter |\count_mod_viii|. For the +computation we need the temporary counter |\count@|. + +\beginprog +\newcount\count_mod_viii +\def\mod_viii#1{% + \count@ #1\relax \count_mod_viii\count@ + \divide \count@ 8\relax + \multiply \count@ 8\relax + \advance \count_mod_viii -\count@ + } +\endprog + + +\sect Now we can declare |\print_tab|. We must remember that +|\char_count| was incremented already, if we set only one blank +character the counter keeps untouched. + +\beginprog +\def\print_tab{% + \loop \space \mod_viii\char_count + \ifnum \count_mod_viii>\z@ + \advance \char_count\@ne + \repeat + } +\endprog + + +\sect If the rest of the line is empty, we are ready. |\char_count| +is reset to~1 for the next line. + +Inside the |\else| part of |\ifx| |\print_char| should not be used +directly because this costs too much storage of \TeX{}. Instead we +set a control sequence |\next| that is processed afterwards, depending +on the result of the comparison. If there is still something to set, +we use |\print_char| again, otherwise a syntactically similar macro +that expands to |\relax|. + +\beginprog +\def\print_rest_of_line#1{% + \def\@line{#1}% + \ifx \@line\empty \char_count\@ne + \def\next##1\end_line{\relax}% + \else \let\next\print_char + \fi + \next#1\end_line + } +\endprog + + + + +\chap Document Structuring. + +The layout of the document shall be like in \WEB{}. This can be done +easily in Plain. If \LaTeX{} shall be used for the document +preparation, this part of the macro must be eliminated. It will also +be better to include the program parts \LaTeX-like as an environment +between |\begin{prog}| and |\end{prog}| and to define control +sequences |\makebaractive| and |\makebarother| for the switch of the +special meaning of the vertical bar (`{\tt \origvert\/}') (for the +{\tt tabular\/} environment!) + +All sections are enumerated, the number of the next section is stored +in the counter |\sectno|. We differenciate between main sections +which start a group of sections and between normal sections within a +group. + +\beginprog +\newcount\sectno \sectno=\@ne +\endprog + + +\sect The main sections are started with the macro |\chap| that has +one parameter, the title of the section group. This parameter must be +terminated by a dot. We start a new page, typeset the title in bold +face and separate it from the section text with a |\medskip|. This +text, the documentation part of the section, is formatted without +paragraph indentation. + +The deletion of the paragraph indentation is done with |\everypar|. +We do not care if |\everypar| is used for something else and delete it +after usage. + +The section number is marked to appear {\it via\/} |\topmark| in the +headline, the title goes as a running head into the headline too. The +section number is displayed on the terminal as a progress report, and title, +section and page number are recorded in the contents file. + +\begingroup \sl +The dealing with |\everypar| should not be so cruel. +\endgroup + +\beginprog +\def\chap#1.{% + \mark{\number\sectno} + \endgraf + \vfill\eject + \def\rhead{\uppercase{\ignorespaces#1}} % define running headline + \message{*\number\sectno} % progress report + \let\Z=\let % now you can \send the control sequence \Z + \edef\next{\write\cont{\Z{#1}{\number\sectno}{\the\pageno}}}\next % to contents file + \noindent {\bf \number\sectno.\quad #1.}% + \advance \sectno\@ne + \endgraf + \medskip \nobreak + \everypar{% + \setbox0\lastbox + \global\everypar{}% + }% + } +\endprog + + +\sect Normal sections are started with |\sect|. This macro has no +parameter. Between two paragraphs we set 2~pica space (if possible) +and prefer the page breaking. Between the section number and the text +one quad of space is set. + +\begingroup \sl +The page break manipulation could be more sophisticated. +\endgroup + +\beginprog +\def\sect{% + \mark{\number\sectno} + \endgraf + \vskip 2pc plus 1pc minus 6dd \goodbreak + \noindent {\bf \number\sectno.}\advance \sectno\@ne + \quad \ignorespaces + } +\endprog + + +\chap Formatting. +The macros in this chapter are extracted from \.{WEBMAC.TEX}, while most of +the documentation is taken from Appendix~G of the ``\.{WEB} User Manual''. +The macros in \.{docmac} make it possible to produce a variety of formats, +and the purpose of this appendix is to explain some of the possibilities. +Displayed examples, that are included in the documentation, come out centered +to distinguish them from program text, which is flushleft. + +\def\lpile{\def\cr{\hfill\endline}\matrix} % I [D E Knuth] only use \lpile by itself + +\sect We begin the formatting part with some declarations that should make +look the output a little better for documenting programs. + +\beginprog +\parskip 0pt % no stretch between paragraphs +\parindent 1em % for paragraphs and for the first line of Pascal text +\endprog + +\sect Three fonts have been declared in addition to the standard fonts of +\.{PLAIN} format: You can say `\.{\{\\sc stuff\}}' to get {\sc stuff} +in small caps; and you can select the largish fonts \.{\\titlefont} +and \.{\\ttitlefont} in the title of your document, where \.{\\ttitlefont} +is a typewriter style of type. + +\beginprog +\font\eightrm=cmr8 +\font\sc=cmcsc10 % this IS a caps-and-small-caps font! +\let\mainfont=\tenrm +\font\titlefont=cmr7 scaled\magstep4 % title on the contents page +\font\ttitlefont=cmtt10 scaled\magstep2 % typewriter type in title +%\font\tentex=cmtex10 % TeX extended character set (used in strings) + % already defined above +\fontdimen7\tentex=0pt % no extra space after punctuation +\endprog + +\sect You can say `\.{\\\\\{identifier\}}' to set \\{identifier} in +italics. + +To get typewriter-like type, as when referring to `\.{WEB}', you +can use the `\.{\\.}' macro (e.g., `\.{\\.\{WEB\}}'). In the argument to +this macro you should insert an additional backslash before the symbols +listed below, i.e., +before backslashes and dollar signs and the like. +A `\.{\\\ }' here will result in the visible space symbol; to get an +invisible space following a control sequence you can say `\.{\{\ \}}'. + +\beginprog +\def\\#1{\hbox{\it#1\/\kern.05em}} % italic type for identifiers +\def\|#1{\hbox{$#1$}} % one-letter identifiers look a bit better this way +\def\{\hbox{\bf#1\/}} % boldface type for reserved words +\def\.#1{\hbox{\tentex % typewriter type for strings + \let\\=\BS % backslash in a string + \let\'=\RQ % right quote in a string + \let\`=\LQ % left quote in a string + \let\{=\LB % left brace in a string + \let\}=\RB % right brace in a string + \let\~=\TL % tilde in a string + \let\ =\SP % space in a string + \let\_=\UL % underline in a string + \let\&=\AM % ampersand in a string + #1}} +\def\#{\hbox{\tt\char`\#}} % parameter sign +\def\${\hbox{\tt\char`\$}} % dollar sign +\def\%{\hbox{\tt\char`\%}} % percent sign +\def\^{\ifmmode\mathchar"222 \else\char`^ \fi} % pointer or hat +% circumflex accents can be obtained from \^^D instead of \^ +\def\AT!{@} % at sign for control text + +\chardef\AM=`\& % ampersand character in a string +\chardef\BS=`\\ % backslash in a string +\chardef\LB=`\{ % left brace in a string +\def\LQ{{\tt\char'22}} % left quote in a string +\chardef\RB=`\} % right brace in a string +\def\RQ{{\tt\char'23}} % right quote in a string +\def\SP{{\tt\char`\ }} % (visible) space in a string +\chardef\TL=`\~ % tilde in a string +\chardef\UL=`\_ % underline character in a string +\endprog + +\sect The three control sequences \.{\\pagewidth}, \.{\\pageheight}, +and \.{\\fullpageheight} can be redefined in the limbo section at the +beginning of your source file, to change the dimensions of each page. +The standard settings +$$\lpile{\.{\\pagewidth=6.5in}\cr + \.{\\pageheight=8.7in}\cr + \.{\\fullpageheight=9in}\cr}$$ +were used to prepare the present report; \.{\\fullpageheight} is +\.{\\pageheight} plus room for the additional heading and page numbers at +the top of each page. If you change any of these quantities, you should +call the macro \.{\\setpage} immediately after making the change. + +The \.{\\pageshift} macro defines an amount by which right-hand +pages (i.e., odd-numbered pages) are shifted right with respect to +left-hand (even-numbered) ones. By adjusting this amount you may be +able to get two-sided output in which the page numbers line up on +opposite sides of each sheet. + +\beginprog +\newdimen\pagewidth \pagewidth=6.5in % the width of each page +\newdimen\pageheight \pageheight=8.7in % the height of each page +\newdimen\fullpageheight \fullpageheight=9in % page height including headlines +\newdimen\pageshift \pageshift=0in % shift righthand pages wrt lefthand ones +\def\magnify#1{\mag=#1\pagewidth=6.5truein\pageheight=8.7truein + \fullpageheight=9truein\setpage} +\def\setpage{\hsize\pagewidth\vsize\pageheight} % use after changing page size +\endprog + +\sect The \.{\\title} macro will appear at the top of each page +in small caps. For example, this document was produced after saying +`\.{\\def\\title\{DOCMAC\}}'. + +\beginprog +\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead\hfill\title\qquad + \tensy x\mainfont\topmark} % top line on left-hand pages +\def\rheader{\tensy x\mainfont\topmark\eightrm\qquad\title\hfill\rhead + \qquad\mainfont\the\pageno} % top line on right-hand pages +\def\page{\box255 } +\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi + \shipout\vbox{ + \vbox to\fullpageheight{ + \iftitle\global\titlefalse + \else\hbox to\pagewidth{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi + \vfill#1}} % parameter #1 is the page itself + \global\advance\pageno by1} + +\def\rhead{\.{DOCMAC} OUTPUT} % this running head is reset by starred sections +\def\title{} % an optional title can be set by the user +\endprog + +\sect The first page usually is assigned page number 1. +To start on page 16, with contents +on page 15, say this: `\.{\\def\\contentspagenumber\{15\}} +\.{\\pageno=\\contentspagenumber} \.{\\advance\\pageno by 1}'. + +\beginprog +\def\contentspagenumber{0} % default page number for table of contents +\endprog + +\sect The macro \.{\\iftitle} will suppress the header line if it is +defined by `\.{\\titletrue}'. The normal value is \.{\\titlefalse} +except for the table of contents; thus, the contents +page is usually unnumbered. + +Two macros are provided to give flexibility to the table of +contents: \.{\\topofcontents} is invoked just before the contents +info is read, and \.{\\botofcontents} is invoked just after. +For example, you can define: +$$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr + \.{ { }\\titlefalse \% include headline on the contents page}\cr + \.{ { }\\def\\rheader\{\\mainfont Appendix D\\hfil 15\}}\cr + \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont WEAVE\}{ }processor\}}\cr + \.{ { }\\vskip 15pt \\centerline\{(Version 4)\}{ }\\vfill\}}\cr}$$ +Redefining \.{\\rheader}, which is the headline for right-hand pages, +suffices in this case to put the desired information at the top of the +contents page. + +\beginprog +\newif\iftitle + +\def\topofcontents{\centerline{\titlefont\title} + \vfill} % this material will start the table of contents page +\def\botofcontents{\vfill} % this material will end the table of contents page +\endprog + +\sect Data for the table of contents is written to a file that +is read when |\contentspage| is called; there's one line of data +for every starred module. For example, when this document was being created, a +file \.{DOCMAC.TOC} containing +$$\lpile{\.{\\Z \{{ }Introduction\}\{1\}\{1\}}\cr + \.{\\Z \{{ }Local Verbatim Formatting\}\{3\}\{2\}}\cr}$$ +and similar lines was created. The \.{\\topofcontents} macro could +redefine \.{\\Z} so that the information appears in another format. + +\beginprog +\def\contentsfile{\jobname.toc} % file that gets table of contents info +\def\readcontents{\expandafter\input \contentsfile} + +\newwrite\cont +\output{\setbox0=\page % the first page is garbage + \openout\cont=\contentsfile + \global\output{\normaloutput\page\lheader\rheader}} +\setpage +\vbox to \vsize{} % the first \topmark won't be null + +\def\con{% + \write\cont{} % ensure that the contents file isn't empty + \closeout\cont % the contents information has been fully gathered + \par\vfill\eject % finish the preceding page + \rightskip 0pt \hyphenpenalty 50 \tolerance 200 + \setpage + \output{\normaloutput\page\lheader\rheader} + \titletrue % prepare to output the table of contents + \pageno=\contentspagenumber \def\rhead{TABLE OF CONTENTS} + \message{Table of contents:} + \topofcontents + \line{\hfil Section\hbox to3em{\hss Page}} + \def\Z##1##2##3{\line{\ignorespaces##1 + \leaders\hbox to .5em{.\hfil}\hfil\ ##2\hbox to3em{\hss##3}}} + \readcontents\relax % read the contents info + \botofcontents \end} % print the contents page(s) and terminate +\let\contentspage=\con +\endprog + +\sect Sometimes it is necessary or desirable to divide the output of +\.{docmac} into subfiles that can be processed separately. For example, +the listing of \TeX\ runs to more than 500 pages, and that is enough to +exceed the capacity of many printing devices and/or their software. +When an extremely large job isn't cut into smaller pieces, the entire +process might be spoiled by a single error of some sort, making it +necessary to start everything over. + +Here's a safe way to break a docmac'ed file into three parts: +Say the pieces are $\alpha$, +$\beta$, and $\gamma$, where each piece begins with a starred module. +All macros should be defined in the opening limbo section of $\alpha$, +and copies of this \TeX\ code should be placed at the +beginning of $\beta$ and of $\gamma$. In order to process the parts +separately, we need to take care of two things: The starting page +numbers of $\beta$ and $\gamma$ need to be set up properly, and +the table of contents data from all three runs needs to be +accumulated. + +The \.{docmac} macros include two control sequences \.{\\contentsfile} and +\.{\\readcontents} that facilitate the necessary processing. We include +`\.{\\def\\contentsfile\{CONT1\}}' in the limbo section of~$\alpha$, we +include `\.{\\def\\contentsfile\{CONT2\}}' in the limbo section of~$\beta$, +and we include `\.{\\def\\contentsfile\{CONT3\}}' in the limbo section +of~$\gamma$; this causes \TeX\ to write the contents data for +$\alpha$,~$\beta$, and~$\gamma$ into \.{CONT1.TEX}, \.{CONT2.TEX}, and +\.{CONT3.TEX}. Now in~$\gamma$ we say $$\.{\\def\\readcontents\{\\input CONT1 +\\input CONT2 \\input CONT3\}};$$ this brings in the data from all three +pieces, in the proper order. + +However, we still need to solve the page-numbering problem. One way to +do it is to include the following in the limbo material for $\beta$: +$$\lpile{\.{\\message\{Please type the last page number of part 1: \}}\cr + \.{\\read -1 to \\temp \\pageno=\\temp \\advance\\pageno by 1}\cr}$$ +Then you simply provide the necessary data when \TeX\ requests +it; a similar construction is used at the beginning of $\gamma$. + +This method can, of course, be used to divide a docmac'ed file into +any number of pieces. + +\sect The counter \.{\\sectno} is set to the number of the +module being typeset. + +\sect We are finished and just have to restore the category codes. + +\beginprog +\catcode`\@=\atcode +\catcode`\_=\uscode + +\endinput +\endprog + + + + + +\contentspage + diff --git a/Master/texmf-dist/doc/bibtex/abstyles/docmac.tex b/Master/texmf-dist/doc/bibtex/abstyles/docmac.tex new file mode 100644 index 00000000000..c832c74f1cc --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/abstyles/docmac.tex @@ -0,0 +1,238 @@ +\chardef\escape=0 +\chardef\letter=11 +\chardef\other=12 +%\chardef\active=13 % is defined in Plain already + +\chardef\atcode=\catcode`\@ +\chardef\uscode=\catcode`\_ + +\catcode`\@=\letter +\catcode`\_=\letter +\font\tentex=cmtex10 % typewriter extended ASCII 10pt +\let\ttex=\tentex % only for PLAIN with base size 10pt + +\def\setup_verbatim{% + \def\do##1{\catcode`##1\other}\dospecials + \parskip\z@skip \parindent\z@ + \obeylines \obeyspaces \obeytabs \frenchspacing + \ttex + } + +\let\tab=\space +\begingroup + \catcode`\^^I=\active% % Attention: no tabs! + \gdef\obeytabs{\catcode`\^^I=\active\def^^I{\tab}} + \global\let^^I=\tab% % if an active tab appears in a \write +\endgroup +\let\origvert=| +\chardef\vbar=`\| + +\catcode`\|=\active + +\def|{% + \leavevmode + \hbox\bgroup + \let\par\space \setup_verbatim + \let|\egroup + } +\newif\if@print + +\def\beginprog{% + \endgraf + \bigbreak + \begingroup + \setup_verbatim \catcode`\|\other + \@printtrue + \ignore_rest_line + } +\let\end_verbatim=\endgroup % internal command ! +\begingroup + \obeylines% % ^^M is active! ==> every line must end with % + \gdef\ignore_rest_line#1^^M{\set_next_line}% + \gdef\set_next_line#1^^M{\do_set{#1}}% +\endgroup + +\def\do_set#1{% + \endgraf + \check_print{#1}% + \if@print \indent \print_char#1\end_line\end_line + \else \let\set_next_line\end_verbatim + \fi + \set_next_line + } +\let\end_line=\relax +\begingroup +\obeyspaces\obeytabs +\gdef\check_print#1{\cut_at_tab#1^^I\end_line} +\gdef\cut_at_tab#1^^I#2\end_line{\check_first_part#1 \end_line}% blank ! +\gdef\check_first_part#1 #2\end_line{\do_check{#1}} +\endgroup +\def\do_check#1{% + \def\@line{#1}% + \ifx \@line\@endverbatim \@printfalse + \fi + } + +{\catcode`\|=\escape \catcode`\\=\other % | is temporary escape char + |gdef|@endverbatim{\endprog} % sample line +} % here \endgroup can't be used +\newcount\char_count \char_count\@ne + +\def\print_char#1#2\end_line{% + \print_first_char{#1}% + \print_rest_of_line{#2}% + } +{\obeytabs\gdef\@tab{^^I}} + +\def\print_first_char#1{% + \def\@char{#1}% + \advance \char_count\@ne + \ifx \@char\@tab \print_tab + \else \@char + \fi + } +\newcount\count_mod_viii +\def\mod_viii#1{% + \count@ #1\relax \count_mod_viii\count@ + \divide \count@ 8\relax + \multiply \count@ 8\relax + \advance \count_mod_viii -\count@ + } +\def\print_tab{% + \loop \space \mod_viii\char_count + \ifnum \count_mod_viii>\z@ + \advance \char_count\@ne + \repeat + } +\def\print_rest_of_line#1{% + \def\@line{#1}% + \ifx \@line\empty \char_count\@ne + \def\next##1\end_line{\relax}% + \else \let\next\print_char + \fi + \next#1\end_line + } +\newcount\sectno \sectno=\@ne +\def\chap#1.{% + \mark{\number\sectno} + \endgraf + \vfill\eject + \def\rhead{\uppercase{\ignorespaces#1}} % define running headline + \message{*\number\sectno} % progress report + \let\Z=\let % now you can \send the control sequence \Z + \edef\next{\write\cont{\Z{#1}{\number\sectno}{\the\pageno}}}\next % to contents file + \noindent {\bf \number\sectno.\quad #1.}% + \advance \sectno\@ne + \endgraf + \medskip \nobreak + \everypar{% + \setbox0\lastbox + \global\everypar{}% + }% + } +\def\sect{% + \mark{\number\sectno} + \endgraf + \vskip 2pc plus 1pc minus 6dd \goodbreak + \noindent {\bf \number\sectno.}\advance \sectno\@ne + \quad \ignorespaces + } +\parskip 0pt % no stretch between paragraphs +\parindent 1em % for paragraphs and for the first line of Pascal text +\font\eightrm=cmr8 +\font\sc=cmcsc10 % this IS a caps-and-small-caps font! +\let\mainfont=\tenrm +\font\titlefont=cmr7 scaled\magstep4 % title on the contents page +\font\ttitlefont=cmtt10 scaled\magstep2 % typewriter type in title +%\font\tentex=cmtex10 % TeX extended character set (used in strings) + % already defined above +\fontdimen7\tentex=0pt % no extra space after punctuation +\def\\#1{\hbox{\it#1\/\kern.05em}} % italic type for identifiers +\def\|#1{\hbox{$#1$}} % one-letter identifiers look a bit better this way +\def\{\hbox{\bf#1\/}} % boldface type for reserved words +\def\.#1{\hbox{\tentex % typewriter type for strings + \let\\=\BS % backslash in a string + \let\'=\RQ % right quote in a string + \let\`=\LQ % left quote in a string + \let\{=\LB % left brace in a string + \let\}=\RB % right brace in a string + \let\~=\TL % tilde in a string + \let\ =\SP % space in a string + \let\_=\UL % underline in a string + \let\&=\AM % ampersand in a string + #1}} +\def\#{\hbox{\tt\char`\#}} % parameter sign +\def\${\hbox{\tt\char`\$}} % dollar sign +\def\%{\hbox{\tt\char`\%}} % percent sign +\def\^{\ifmmode\mathchar"222 \else\char`^ \fi} % pointer or hat +% circumflex accents can be obtained from \^^D instead of \^ +\def\AT!{@} % at sign for control text + +\chardef\AM=`\& % ampersand character in a string +\chardef\BS=`\\ % backslash in a string +\chardef\LB=`\{ % left brace in a string +\def\LQ{{\tt\char'22}} % left quote in a string +\chardef\RB=`\} % right brace in a string +\def\RQ{{\tt\char'23}} % right quote in a string +\def\SP{{\tt\char`\ }} % (visible) space in a string +\chardef\TL=`\~ % tilde in a string +\chardef\UL=`\_ % underline character in a string +\newdimen\pagewidth \pagewidth=6.5in % the width of each page +\newdimen\pageheight \pageheight=8.7in % the height of each page +\newdimen\fullpageheight \fullpageheight=9in % page height including headlines +\newdimen\pageshift \pageshift=0in % shift righthand pages wrt lefthand ones +\def\magnify#1{\mag=#1\pagewidth=6.5truein\pageheight=8.7truein + \fullpageheight=9truein\setpage} +\def\setpage{\hsize\pagewidth\vsize\pageheight} % use after changing page size +\def\lheader{\mainfont\the\pageno\eightrm\qquad\rhead\hfill\title\qquad + \tensy x\mainfont\topmark} % top line on left-hand pages +\def\rheader{\tensy x\mainfont\topmark\eightrm\qquad\title\hfill\rhead + \qquad\mainfont\the\pageno} % top line on right-hand pages +\def\page{\box255 } +\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi + \shipout\vbox{ + \vbox to\fullpageheight{ + \iftitle\global\titlefalse + \else\hbox to\pagewidth{\vbox to10pt{}\ifodd\pageno #3\else#2\fi}\fi + \vfill#1}} % parameter #1 is the page itself + \global\advance\pageno by1} + +\def\rhead{\.{DOCMAC} OUTPUT} % this running head is reset by starred sections +\def\title{} % an optional title can be set by the user +\def\contentspagenumber{0} % default page number for table of contents +\newif\iftitle + +\def\topofcontents{\centerline{\titlefont\title} + \vfill} % this material will start the table of contents page +\def\botofcontents{\vfill} % this material will end the table of contents page +\def\contentsfile{\jobname.toc} % file that gets table of contents info +\def\readcontents{\expandafter\input \contentsfile} + +\newwrite\cont +\output{\setbox0=\page % the first page is garbage + \openout\cont=\contentsfile + \global\output{\normaloutput\page\lheader\rheader}} +\setpage +\vbox to \vsize{} % the first \topmark won't be null + +\def\con{% + \write\cont{} % ensure that the contents file isn't empty + \closeout\cont % the contents information has been fully gathered + \par\vfill\eject % finish the preceding page + \rightskip 0pt \hyphenpenalty 50 \tolerance 200 + \setpage + \output{\normaloutput\page\lheader\rheader} + \titletrue % prepare to output the table of contents + \pageno=\contentspagenumber \def\rhead{TABLE OF CONTENTS} + \message{Table of contents:} + \topofcontents + \line{\hfil Section\hbox to3em{\hss Page}} + \def\Z##1##2##3{\line{\ignorespaces##1 + \leaders\hbox to .5em{.\hfil}\hfil\ ##2\hbox to3em{\hss##3}}} + \readcontents\relax % read the contents info + \botofcontents \end} % print the contents page(s) and terminate +\let\contentspage=\con +\catcode`\@=\atcode +\catcode`\_=\uscode + +\endinput -- cgit v1.2.3