User’s Guide to the Camel Citator^{∗}

Frank G. Bennett, Jr.^{†}

February 17, 1997

Abstract

This is the core documentation for Camel, a L^{A}TEX macro package that drastically simplifies the typesetting of citations and bibliographies in a wide variety of styles and formats. Camel is similar in look and feel to standard BibTEX, but introduces a number of long-desired enhancements. When the document is printed, Camel allows the generation of subdivided bibliographies, separate bibliographies for each subdivision of a larger work, in-footnote cross-referenced citations, bibliographies indexed to the pages where citations to the relevant work occur, and much else. This is the only fully supported bibliography package for L^{A}TEX that provides full support for legal citations. The package also provides genuinely helpful error messages and an extremely simple syntax for adding details like page numbers and the like to citation tags. Camel provides the logical engine and skeleton macros that make these things possible; a separate style package is required to actually typeset documents. For an example of a working style package, see law.dtx in the camel subdirectory on CTAN.

Contents

1 Introduction 1 1.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 BibTEX features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Processing documents . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Notes for Implementors 9 2.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 The .cst file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3 Toggles and hooks for the .cit file . . . . . . . . . . . . . . . . . . 10

2.3.1 Citation history . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.2 Formatting toggles . . . . . . . . . . . . . . . . . . . . . . . 10 2.3.3 typefaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.4 Citation details . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.5 Bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3.6 Pinpoint printing . . . . . . . . . . . . . . . . . . . . . . . . 12

∗This file is version number 1.0t. The documentation was last revised on 97/02/17.

†The text and source code contained in this file are \begin{matrix}c \\ ◯ \end{matrix} 1992–1995 by Frank G. Bennett, Jr.

This file can be freely distributed; the sole condition of use is that acknowledgement to the author be made in any published work produced using Camel. The author wishes to thank Pedro Aphalo, Steve Bellovin, George Greenwade and Boris Pevzner and David Rhead for their helpful comments on versions of LexITEX, the predecessor to Camel. In addition, David Rhead provided a mass of information on bibliographic conventions, which was used in shaping the options supported by this package. Gratitude is also owed to Marcia Elliot and Yoshiko Makino, LL.B. finalists in the Law Department of the School of Oriental and African Studies in 1993 and 1994 respectively, who prepared extended essays using early releases of LexITEX.

2.4 The .cit file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.5 The .bst file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.5.1 Entry types . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.5.2 About cross-referencing . . . . . . . . . . . . . . . . . . . . 14

3 The Citation Engine: camel.sty 15

3.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1.1 Hello! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1.2 Customizable text elements . . . . . . . . . . . . . . . . . . 15 3.1.3 User selectable switches . . . . . . . . . . . . . . . . . . . . 16 3.1.4 Shorthanding essentials . . . . . . . . . . . . . . . . . . . . 16 3.1.5 Miscellaneous other macros . . . . . . . . . . . . . . . . . . 17 3.1.6 New environment . . . . . . . . . . . . . . . . . . . . . . . . 17 3.1.7 Token registers . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.1.8 Peek-word-ahead macro . . . . . . . . . . . . . . . . . . . . 19 3.1.9 If initializations . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.10 Macro initializations . . . . . . . . . . . . . . . . . . . . . . 20

3.2 Main macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.2.1 Utility macros . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.2.2 Declaration of citation types . . . . . . . . . . . . . . . . . 32 3.2.3 Declaration of citation nicknames . . . . . . . . . . . . . . . 34 3.2.4 Calling citation nicknames . . . . . . . . . . . . . . . . . . . 40 3.2.5 Table writes and preliminary formatting . . . . . . . . . . . 41

3.3 Output routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.3.1 The print macro . . . . . . . . . . . . . . . . . . . . . . . . 43 3.3.2 Proof sheet master document . . . . . . . . . . . . . . . . . 44

3.4 Proof sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.5 Macros for data export . . . . . . . . . . . . . . . . . . . . . . . . . 45

3.5.1 Citation style definitions . . . . . . . . . . . . . . . . . . . . 50 3.6 Index styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

4 A BibTEX Library 51 4.1 Hello! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.2 Variable initializations . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3 Function definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4.3.1 Logic and measurement . . . . . . . . . . . . . . . . . . . . 53 4.3.2 Housekeeping . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.3.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.3.4 Parsing and conversion . . . . . . . . . . . . . . . . . . . . . 60

5 A .bib file 81

6 The Driver File 83 “Now comes the fun part.”

—Donald Knuth^{1}.

Preface to release 1.0

Welcome to Camel, a comprehensive bibliography manager developed as a prototype citation engine for the L^{A}TEX3 project. The Camel engine offers a highly flexible yet straightforward syntax for entering citation keys into a L^{A}TEX document. The Camel engine is designed to support a wide range of citation styles. Documents prepared for Camel can be converted into virtually any supported bibliography or citation style, usually by editing only a few toggles at the top of the document.^{2}

Within the L^{A}TEX3 project, an extensive survey of bibliographic styles was carried out by David Rhead. Pedro Aphalo, Task Coordinator for bibliographic support on the L^{A}TEX3 Project, first proposed adopting a unified syntax for all bibliographic styles. Camel itself is the brainchild of Frank Bennett, and is based upon his earlier work on the LexITEX style engine for legal materials. This package completely supercedes LexITEX, and that earlier style package will no longer be supported. The new package should be referred to as “the Camel citator”.^{3}

The core Camel package provides hooks for the development of style options that satisfy all bibliographic requirements that have come to the attention of the L^{A}TEX3 bibliography team. The foundation has been laid, but much work remains to be done in drafting Camel modules to meet all known bibliographic requirements in all fields (and in all languages) for which L^{A}TEX is used. This work will involve the drafting or modification of .bst files in the reverse polish notation used by BibTEX, and of Camel style modules written in TEX. If you want to contribute to a project that will dramatically enhance the utility of L^{A}TEX as an author’s productivity tool, get involved! The developers’ email addresses are as follows:

• Frank Bennett: fb@soas.ac.uk.

   • Pedro Aphalo: aphalo@cc.joensuu.fi.

1D. Knuth, The TEX book 176 (1990).

2This is potentially exciting (he said), but as of this writing only one module — law.dtx, the legal citation module used for beta-testing the Camel engine — exists. Some followers of Camel development have expressed serious interest in developing other modules, but I cannot make any promises about when additional styles will appear. I’ve done my work, it is now up to the wider world.

3Why Camel? The first point to make, I suppose, is that the Camel citator has absolutely nothing to do with Perl. I had never heard of Perl when Camel development began, and scarcely knew anything about it by the time most of Camel had been finished. I didn’t even realize I was in Larry Wall’s space when I used the Perl camel logo for the Camel home page!

That aside, I can offer several reasons for the name, and users may take their pick. The style operates by gathering citation details that it carries with it through the desert of plain text, until the bibliography engine reaches its oasis at document’s end. Alternatively, in his daily work the author uses the multi-lingual enchancement of Emacs, which is called “Mule”. It’s nice for one critter to have the company of another in the stable. A third arbitrary explanation is that the Japanese word for “camel” is rakuda. These syllables, with a different intonation, mean “dead easy”. Since the design goal of Camel is to make bibliography management as easy, as fool-proof and as robust as possible, this cross-lingual pun seems fitting.

• David Rhead: David Rhead@vme.ccc.nottingham.ac.uk.

A programmer’s reference guide for drafting Camel styles is included in this manual. Don’t delay—start coding today.

1 Introduction

This guide explains the use of the Camel Citator. It covers all commands available in the style. This should be the only user manual that you need to prepare a document for use with any Camel bibliography style. The package provides eight commands, listed in the table at the bottom of this page. The opening commands may be combined in a variety of ways, but a typical document heading might look like this:

      \documentclass{article}
      \usepackage{camel}
      \citationsubject{english}{Materials in English}
      \citationsubject{german}{Materials in German}
      \begin{document}
      \citationstyle{law}
      \citationdata{gorp,slush,fodder}
      \forcefootnotes

You should be careful to decide on the subject classification, if any, that you wish to apply to your citations, before you begin your writing. With that in hand, you can begin entering \source commands into the document, adjusting the style parameters at print time. A detailed description of command usage follows. Throughout this guide, it is assumed that the reader has a general familiarity with BibTEX and its use in preparing bibliographies with standard-issue L^{A}TEX. If you need to learn more about BibTEX, a number of excellent sources of information are available.^{4} The treatment given to the programming language tends to be quite brief, but you should not be put off by this; the language is, in fact, quite simple to use, and the Camel programming library makes things even easier.

1.1 Commands

\citationstyle The \citationstyle command is used to tell both BibTEX and the Camel engine how your citations should be formatted; its argument is the name of a Camel module (contained in a .cst, a .cit and a .bst file) such as ‘law’. In this

Camel commands

4L. Lamport, L^{A}TEX: a document preparation system (1994); M. Goosens, F. Mittelbach, and A. Samarin, The L^{A}TEX Companion: The L^{A}TEX Companion (1994); Oren Patashnik, BibTEXing (CTAN document, 1988) and Oren Patashnik, Designing BibTEX Styles (CTAN document, 1988).

\citationsubject[⟨options⟩]{⟨nickname⟩}{⟨heading text⟩} optional  preamble \citationstyle{⟨style package name⟩} required doc top \citationdata{⟨bib1,bib2… ⟩}  alternative doc top \bibliographymanager{⟨product name⟩}  alternative doc top \forcefootnotes  optional  doc top \newinterword{⟨nickname⟩}{⟨text⟩}  optional  doc top \printbibliography{⟨nickname⟩}  optional  anywhere \source[⟨options⟩]{⟨nickname⟩}[⟨page numbers⟩]  n/a  anywhere

respect, it is similar to a “document class”, but for citations instead of whole documents. This declaration may be make more than once.^{5}

\citationdata This command is used to indicate the .bib files from which citation entries should be drawn. As in the \bibliography command of standard L^{A}TEX, the \citationdata command takes one option, which is a comma-separated list of bibliographies for use in the documents. Each refers to a .bib file, each of which should be in the path of your local BibTEX.

\bibliographymanager While we hope that you find BibTEX the most satisfactory means of formatting your citations, you might prefer to use some other software product for the separate task of managing a large citation database. Camel has been designed so that it can be used with a number of such utilities. If you are using an external bibiliography manager, you should declare the name of the package at the top of the document using the \bibliographymanager command. Supported managers, and their corresponding nicknames for this command, are:

• Reference Manager (referencemanager)

• Papyrus (papyrus)

• ProCite (procite)

• EndNote (endnote)

The details on how to join external bibliography managers with Camel are below at page 8.

If you use the \bibliographymanager command, you should not use the \citationdata command. This is not felt to be a serious limitation; if you use a bibliography manager, you might as well put all of your citations into it anyway, and use it as the sole source of citations in your documents.

\citationsubject You may wish to produce a bibliography classified into subheadings by subject or by type of material. To do this, place a set of \citationsubject commands at the top of your document, or after a \printbibliography command. Each command takes two mandatory arguments and one optional argument. The first mandatory argument indicates the nickname that you will use in your document to attach a citation to the category. The second is the section heading that you wish to see displayed for that section of the bibliography.

The optional argument may be used for two purposes. First, you may want to further divide your bibliography into sub-subheadings. You can specify a such a subcategory by putting a 2 as the optional argument to the \citationsubject command. Otherwise, a first-level header is used. Where the \printbibliography command is issued, the parts and sub-parts of the bibiliography will be produced in the order in which they were declared.

For some types of citation, you may wish to produce a table that shows more detail about citations made. With Camel, simply add an optional argument to the \citationsubject command applicable to your desired table which includes an o= argument of three letters (giving the extension of the raw data output file), and an i= argument of three letters (giving the extension of the makeindexprocessed input file). Optionally, you may also include arguments of p or P. With p, the output file will be passed the page or section numbers given in pinpoint arguments to the \source command. With P, index-style page references to the main text are turned on. With or without the P or p,^{6} the export file should be processed with makeindex using Camel’s own camel.ist file to produce the import file. This table-creation feature exists principally for typesetting tables of statutes.

5This feature (support for multiple citation styles in a single document) will be added after the release of BibTEX 1.0.

\forcefootnotes If you are preparing a document that is to be, or may be, prepared with citations in footnotes at the bottom of the page, you can save yourself some typing (and make it easier to produce the same document in other formats) by using the \forcefootnotes command at the top of the document. In some styles this command has no effect since, for example, a footnote containing only “[2]” would look rather peculiar.

\newinterword In a string citation, you may want to use a connecting word that is not already in Camel’s internal list. You can add a word to this list with the \newinterword command. This command takes two mandatory arguments. The first is the nickname you wish to give to the word and its associated punctuation. The second is the text to be inserted when you use the new connecting word between two \source commands.

The connecting word may appear either at the beginning of a citation string (as the argument to a != option in the first \source command of a string), or in the middle, between two citations. Two special characters are used to control the appearance of the word in these two positions. A leading punctuation mark should be preceded by a _character. This will suppress such a punctuation mark, and the space following it, if the connecting word is used as a prefix to an initial citation in a string. The ^character should precede the first word of the phrase associated with the connecting word, and that character should be capitalized. The first character of the phrase will then be forced to lower case if the connecting word is used between two \source commands.

The following examples may be useful for guidance:

   • \newinterword{cf}{_; ^C.f.~}
   • \newinterword{see-generally}{_. ^See generally\ }

\printbibliography Place a \printbibliography command in your document wherever you would like the bibliography to appear. The \printbibliography command takes one optional argument, labels. In the keyval= syntax, this may be set to either labels=false or labels=true. This toggles the appearance of bracketed numerical or shorthand labels in front of each bibliography item.

If no \citationsubject commands are used at the top of the document, \printbibliography{all} will produce a full bibliography of all references made in the document up to that point. If \citationsubject has been used, then \printbibliography{all} will produce the same bibliography, but classified by subject, with the headers specified in the \citationsubject commands at the top of the document.

You may also specify a subject to the \printbibliography command, instead of all. This will produce a bibliography formatted as requested in the \citationsubject command. Note that, if the i= and o= options are used with \citationsubject, makeindex must be used to generate the input file that will be expected for that subject. Note also that such external tables will be ignored by \printbibliography{all} where citation subjects are used.

6The syntax of these options is the same as for options to the \source command, discussed above.

\source The most common command for Camel users is the \source command, which replaces the \cite command of standard L^{A}TEX. It is used to identify the citation in the .bib data files, and to provide a logical description of any ‘fine-tuning’ of the citation form that the user might desire. Because it is frequently used, and must be accessible to authors with more interest in the content of what they are writing than the inner workings of L^{A}TEX, much effort has gone into making the command as simple to use as possible.

Options

The valid options that may be placed inside the first set of square braces are shown below.

Single character options

a — Supress printing of author’s name in the document. t — Suppress printing of the title in the document. l — Force automatically generated abbreviations to lower case. n — Suppress printing of the citation in the document (equivalent to \nocite in

standard L^{A}TEX). f — Force the full form of the citation to be printed in the document. h — Suppress automated footnote generation and the use of interwords for the cur-

rent and following citations. This option should not be used in the middle of a string of citations linked with interwords.

String options

s= — Associate the citation with the specified subject. This option can be freely specified, but only has significance when a classified bibliography is being produced. When these subject tags are being used for that purpose, they must be declared at the top of the document, and a given source must be associated with the same subject throughout the document; specifying a different subject from that used in the first use of the citation will produce an error message from L^{A}TEX.

v= — Give a volume number for use in the citation. BOOK entries in a BibTEX database may be given a volume number. Such citations are assumed to be multi-volume works, and a volume number should be supplied when citing them; the volume number given in a BOOK entry itself ignored, and an error message will be produced if an explicit volume number is not given using this option.

!= — Precede the citation with the interword given in the argument.

These options may be entered in the option braces in any order, with the single requirement that a comma must separate all options.^{7}

The number of possible citation forms that can be generated using these command options is very large, and varies from one style to another. The best way of familiarizing yourself with them is to finish reading the next section of this guide, and then do a little experimentation with the various options. This will serve you much better than a verbose set of illustrations here, which would not stick in the memory, would be difficult to use as a reference, and could not in any case cover all of the possibilities.

7Separating commas are required from version 1.0r, because this is the syntax of the keyval package.

The following citations are all valid:

   • \source[ats=school]{ucla}
   • \source[av=8,t]{harvard}
   • \source[s=town,nat]{oxford}

A string of citations applying to a particular statement may be entered as follows:

• \source[⟨options⟩]{⟨nickname⟩}[⟨page numbers⟩] ⟨interword⟩ \source[⟨options⟩]{⟨nickname⟩}[⟨page numbers⟩]

Keys

The key given in the squiggly braces should correspond to the key that identifies the entry in the BibTEX or other database that you are using. If you have a series of citations to make, and do not need to give separate options to any of them, you can enter them as a comma-delimited string, in the following manner:

     \source[s=stooges]{joe,curly,moe}

Pinpoints

For most citations, pinpoint references are simply typed between the second pair of square braces, using normal punctuation marks ( , & - ). Spacing is irrelevant, so long as the punctuation marks are entered. A valid simple pinpoint citation might look as follows:

     \source{major}[2, 7, 9 & 23]

In some very special situations, Camel needs more information to handle pinpoint references correctly. Suppose you are entering a citation for a statute, and you intend to produce a table showing where references to each cited section of the statute are made in the text. If your citation includes references to more than one section of the statute, Camel will produce a table entry for each cited section automatically. But what if you are citing a range of sections? Camel cannot know whether the range is continuous, or has gaps in it where provisions have been repealed. You therefore need to tell Camel explicitly about each section number—but you don’t want the numbers to be printed in the text. To feed citation numbers to the table, but suppress printing in the document, separate the numbers to “hidden” from the rest with a “fence” in the form of the | character. A typical citation of this kind might look like this:

     \source{SaleofGoodsAct}[19-25 | 20, 21, 22, 23, 24]

There are two other situations, also related only to the production of tables, where special markings may need to be included in the pinpointing string. These are (a) where you want material to appear only in the text, and (b) where you want material to appear only in the table. The first case may arise where you are citing subsections of a statute. In this situation, you can enclose in ^characters any text that you want to withhold from the table. A simple citation of this kind might look as follows:

     \source{VehicleCode}[23(A)^(3)(a)(i)^]

Where material should appear only in the table, enclose that pinpoint material in _characters. This might be necessary where, for example, you are citing two subsections of the same statute. An example might look as follows:

     \source{LawofPropertyAct}[70(1)(f) & _70(1)_(g)]

Finally, there is one more feature that applies only to ‘parallel citations’ to law cases. If a law case to which you are referring is reported in more than one location (see below), and you want to give a pinpoint to each location, you can do so by using the the = sign between the pinpoint strings. For example:

     \source{bloggvkermit}[20-25 = 125-26 ]

If more parallel pinpoints are given than exist in the BibTEX entry for the case nicknames bloggvkermit, the extra pinpoints will be ignored. Similarly, if you give fewer pinpoints than there are parallels in the BibTEX entry, the portions of the entry with no matching pinpoints will be omitted. No warnings are issued, although they could be if there is a demand for it.

1.2 BibTEX features

A number of enhancements for processing BibTEX entries have been incorporated into the Camel BibTEX programmer’s library. These enhancements are drawn upon by the law.bst style, and should also be used by subsequent Camel style modules. These features are described briefly here. Please see the BibTEX documentation for more information on the format of BibTEX entries et cetera.

Cases

A new entry type, @CASE, has been added. This entry type should be used for reported law cases. Although citation forms vary widely between jurisdictions, Camel bases the formatting of the citation on the information contained in the citation, rather than a tag indicating the jurisdiction.

A result of this approach is that there are no ‘required’ fields in the usual sense that BibTEX will complain if something is missing. Instead, is a set of ‘core’ fields for each of three different formatting styles. For someone familiar with legal resources, this is actually quite intuitively straightforward.

For reported U.S. law cases, the core fields are title, volume, journal, pages and year. In addition, you may wish to specify court.^{8} Procedural histories may not be represented in the BibTEX entry.

8This is not yet implemented, but can be and should be.

For reported Commonwealth cases, use number instead of volume. The effect of this will be to place the year at the front of the citation in square braces, with the number and journal following it. Again, you may specify court optionally.

For cases reported in ephemeral media such as newspapers, leave out volume and number, and give the full date in the year field instead (see below for the formatting of dates). The formatting of the citation will adjust accordingly.^{9}

For cases reported in jurisdictions such as Japan that refer to cases by date

rather than title, use casedate, court, journal, volume, pages and year. Op-

tionally, you may also wish to include divno and division, to specify the exact identity of the deciding court.

Statutes

Support for statutes is still in its infancy. You need, at minimum, to enter

title, year and jurisdiction. Supported jurisdictions are japan, singapore
and england.

Dates

The entry of dates has been considerably simplified in Camel BibTEX entries. Always use the year field (or, if appropriate, the casedate field). Months may be entered as numbers or as a three-character string. The following date forms are all valid:

      year = {10 jun 1995},
      year = {jun 10 1995},
      year = {jun 1995},
      year = {1995},
      year = {10/06/95},

Parallel citations

For @CASE entries, it is possible to enter multiple citations in a single BibTEX entry using a short form of citation in a field called cites, separating entries with a = character.^{10} There are several valid syntaxes for this field, which closely follow the citation format used in the Blue Book for the relevant sources. They are:

      cites = {[1995] 1 All ER 25 = [1995] 2 WLR 125},
      cites = {123 Cal.3d 237 (1995) = 124 S.W.2d 235 (1995)},

You can string together an arbitrary number of parallel citations in this way.^{11} Be sure to read the notes on pinpointing, above, for details on how to specify pinpoint references to parallel citations.

9I’m not sure whether this works with parallels yet. If it doesn’t but you need it to, let me know and I’ll fix it.

10It actually does work. Halsall v Brizell, [1957] Ch 169; [1957] 1 All ER 371.

11Cross-references are complex to format, but they work correctly. Id. In a competition for speed and accuracy between typists equipped with L^{A}TEX/Camel and with WordPerfect, who do you reckon would win?

1.3 Processing documents

Ordinary processing

For a simple document containing no cross-references other than those produced by Camel, printing requires one run of L^{A}TEX, one run of BibTEX, and a second run of L^{A}TEX. Because Camel absorbs all citation information at the start of

the document (at the point of the \citationdata or \bibliographymanager

commands), there is no need for the third L^{A}TEX run required in the standard L^{A}TEX setup. You may, however, need additional runs of L^{A}TEX to resolve other cross-references in the document, or to work out misspellings and other errors.

Producing tables

When the o= and i= options are used for one or more declared citation subjects, those subjects will be excluded from the bibliography. Instead, Camel will write an external table file according to the specifications given in the \citationsubject command. Any such files must then be processed into properly formatted lists using makeindex before they will appear in the printed document.^{12} On a UNIX or DOS system you would type the following for a table declared with the export extension .atb and the input extension .art:

     makeindex -s camel.ist -o ⟨file name⟩.art ⟨file name⟩.atb

If the subject associated with this table is article, the table can then be placed in the document for the next L^{A}TEX run using the command:

   • \printcitationtable{article}.

When the option p is used with the \citationsubject command and the i= and o= options, the table will include any section or other numbers given as optional arguments to \source commands in the document. Because makeindex sorts alphabetically, not numerically, the section numbers may be out of their proper order in the makeindex-processed file. This must be corrected by hand.

12The documentation for makeindex will explain how it should be set up for your system. On a UNIX or DOS installation, the basic requirements are that the makeindex program be in your search path, and that the appropriate environment variable (usually indexstyle) be set—this tells makeindex where to find the style files that tell it exactly how to format the finished table lists.

2 Notes for Implementors

2.1 Getting started

The purpose of this section is to provide style designers with all of the information required to write a new bibliography style from scratch, drawing on the powerful facilities available in BibTEX and the Camel style engine.^{13} Before you start, you should have a sound knowledge of BibTEX primitives, and of the programmer’s function library contained in the file camel.dtx. A bibliography style consists of a .bst file, a .cst file and a .cit file. The .bst file should produce entries suitable for digestion by Camel for all of the BibTEX entry types supported by the style.

The modules of the Camel system work together in an integrated fashion to format citations. Raw citation details are kept in .bib databases. The function of the Camel system is to massage those details into formatted citations, and include them in appropriate locations in typeset pages. When a document invoking the Camel package encounters a \citationstyle command, the relevant .cst and .cit files are loaded. A corresponding \bibstyle entry is also written on the .aux file. A \citationdata command causes a relevant \bibdata command to be written there as well. If a \bibliographymanager declaration is used instead, a \bibdata entry calling on the file camel.bib is written to .aux. When a \source command is encountered during processing, code contained in camel.sty writes a \citation entry for that citation on the .aux file. In this way, an orthodox set of entries and files for use with BibTEX is generated.

If an external bibliography manager is used, the file camel.bib must be converted into a valid .bib file, using whatever tools for finding and replacing key entries the database manager has to offer.

BibTEX must then be run on the document. This reads the entries on the .aux file, opens the .bib databases, reads them, and writes the result of its ruminations on a .bbl file. At this point, the operation of Camel diverges sharply from that of conventional L^{A}TEX bibliography tools. With Camel, BibTEX is used to generate \lexibib entries on the .bbl file. Such entries parse the citation into logical typesetting units, but the typefaces used within the units, and the punctuation that appears between them, is not determined by BibTEX. The tasks of punctuation and typeface selection are carried out on the second run of L^{A}TEX on the document, using the details specified in the .cit file for the Camel citation style being used.

It is worth spending some time pondering this programming flow; there are good reasons for spreading the formatting work over a number of different modules in this way, and it is important to understand the design before embarking on the drafting of a style.

2.2 The .cst file

The .cst file should contain, at least, the following macros:

\@law@print: This is the macro that actually prints the citations in the document and in the bibliography. Its structure is discussed below in the commented code listing of the default \@law@print command, which draws on most of the conditional handles provided by Camel.

13As of this writing, however, I’ve not received any feedback on the whether this documentation is any use. If you are attempting to draft a style and feel at sea, complain to me! It’s the only way we can make things easier for the others.

\@law@wordlist: This is a list macro consisting of paired interword nicknames and corresponding punctuation/text sets. Possible changes you may wish to make to this file are discussed in the commented code description of this macro.

Additional macros (including re-definitions of the macros contained in the Camel engine) may be included in the .cst file. Be sure to document your work, however; Camel is among the more complex packages written for use with TEX, and documentation is essential if problems that arise are to be sorted out quickly and efficiently.

Concerning the \@law@wordlist macro, it is best to examine the existing macro in law.dtx, and read the user documentation on the \newinterword command. With this information, you should be able to make any changes you require in the behaviour of the list to suit your new style. You should not omit items from the list—this is important to maintain compatibility between styles. You may want to add to the list, and this is welcomed—drop a note to Frank Bennett on fb@soas.ac.uk to assure that your new addition is incorporated into the law.dtx list, which is used as a model, so others will include it in their styles too.

Drafting the \@law@print macro may be difficult to approach at first. If you examine the example in the law.dtx file, you may be somewhat intimidated by the size and complexity of the macro listed there. But in fact for most styles this macro should be reasonably simple to write; the law.dtx example is complex because it automates a very complex set of style rules applying to legal materials.

Essentially, what \@law@print does is print a citation in a particular form according to a set of conditions that can be recognized from toggles in effect when the macro is run by the Camel engine. The toggles that may be drawn upon are described here. For further information, study the example in law.dtx—bearing in mind that your own macro will probably be simpler to draft.

2.3 Toggles and hooks for the .cit file

2.3.1 Citation history

\if@law@firstuseofcite This is true during the first expansion of a citation nickname in the text.

\if@justabove This is set to true where (a) the author, title, source, page and citation trailer are identical in the last citation used in a footnote and in the current citation, (b) the last citation used in a footnote was the only citation in that footnote, and (c) a pinpoint was not used in the previous citation or, if there was such a pinpoint, a pinpoint is also used in the current citation.

\if@l@quiteexact  This is set to true where (a) \@law@justabove is set true and (b) a pinpoint

was used in both citations, and (c) the pinpoints match exactly.

2.3.2 Formatting toggles

\if@law@printcite If this is true the citation should print. Otherwise it should not. It should also

trigger suppression of footnote forcing.

\if@law@printauthor If this is true the name of the author prints. \if@law@printtitle If this is true the title of the work prints.

\if@law@longcite If this is true the citation should be printed in its full form. This is set true by the f option to the \source command.

2.3.3 typefaces

\@ltok@authormainface This is the typeface set in the .cit file for author names. It, and all other \@ltok@

control strings are token registers that must be expanded using \the.

\@ltok@authoroptionface This is the typeface selected by enclosing text in the author portion of the citation within \\ commands in the current citation’s type (i.e. as defined in its

\newcitestyle entry).

\@ltok@titlemainface The typeface used for the title portion of the citation. \@ltok@titleoptionface The alternative \\ typeface within the title argument to \lexibib.

\@ltok@citefirstmainface The typeface used for the source portion of the citation. \@ltok@citefirstoptionface The alternative for the source portion of the citation.

\@law@firstslash These two commands should be defined as follows in your \@law@print com- \@law@secondslash mand before citation elements are expanded. This could be done within Camel

itself, but this gives you a little more hands-on control in style design maybe.

     \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
     \the\ltokspecialface}%
     \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
     \def\\{\@law@firstslash}%

2.3.4 Citation details

\@ltok@whereitsat This actually contains the text that is used to flag either a note or a page number (i.e. {\ note\ } or {\ page\ }). This is used only where citation crossreferencing is required.

\@ltok@stylename This stores the citation type used to declare the citation with \lexibib. This is mainly used for internal purposes by Camel, but if you’re printing a style or proof sheet, or are just trying to debug a style, you may have a use for it.

\@ltok@nickname This stores the nickname of the citation.

\@ltok@author This stores the author portion of the citation.

\@ltok@name This stores the title portion of the citation. \@ltok@citefirst This stores the source portion of the citation. \@ltok@citepage This stores the page number (not the pinpoint!) of the citation. \@ltok@citelast This stores the citation trailer.

\@ltok@pageorfootno This stores either the page or the footnote number at which the citation first occurred.

2.3.5 Bridges

\@ltok@atot This contains the punctuation bridge, declared in the .cit file for the current citation type, that is to be placed between the author and the title elements of the citation.

\@ltok@ttocone This contains the bridge that is to be placed between the title and the source. \@ltok@conetop This contains the (singular) bridge that goes between the source and the page

number.

\@ltok@conetopplural This contains the alternative plural bridge that goes between the source and

the page number.

\@ltok@ptop This contains the bridge that goes between a page reference giving the location

of an article, for example, and the pinpoint reference.

\@ltok@ptoctwo This contains the bridge that goes between any page numbers and the citation

trailer.

\@ltok@atbridge This contains the bridge that goes between an abbreviated citation (i.e. Id. or

somesuch) and a pinpoint.

\@ltok@atbridgeplural This contains the plural bridge for abbreviated citations.

2.3.6 Pinpoint printing

\@law@barkill The pinpoint information is contained in the token register \@ltok@argtwo. To print the pinpoint, you should always use the following form, which will induce the correct behaviour of the string expansion engine within Camel.

     \@law@barkill\the\@ltok@argtwo\relax

2.4 The .cit file

The .cit file should contain instances of the \newcitestyle command and associated arguments. This defines a Camel style instance for each of the entry types supported by the style’s .bst file. If you find it necessary to add a new entry type to the style defined in the .bst file for your style, you must also define a Camel style instance in the .cit file applying to this new entry type.

The arguments to the \newcitestyle command have the functions described in the following footnoted illustration:

     \newcitestyle{article^{a}}%
      {rsirsr^{b}A^{c}}%
      {[a],\ ^{d}[t],\ ^{d} [c]\ ^{d} [p],\ ^{d} (pl),\ ^{d} [rp]\ ^{d} [e]:[id]\ at~^{d}
     (pl)\ at~^{d} [xrf]}%
      {6}^{e}%
     {{#1}^{f}{#2}^{f} {#3}^{f}{#4}^{f} {#5}^{f}{(#6)}^{f}}%

aThis gives the name of the citation template to be generated.

bThe first part of this list of arguments consists always of exactly six letters: the first three pairs set the main and alternative typefaces for the author, title and firstcite-part portions of the citation. r, s, b and i select roman, small caps, boldface and italic type. These letter flags are not case sensitive. The alternative typefaces may then be specially selected in the text arguments to a citation using \\...\\.

cThe last letter in this list sets the classification of citations declared with the resulting style macro. a, b, c and s will classify all citations generated by this citation template as being to articles, books, cases or statutes, respectively. This letter flag is not case sensitive.

dThese are the citation bridges that will be placed between the portions of the citation indicated. Two bridges, singular and plural, are given between [p] (page) and

[rp] (reference page), and between [id] (id. or supra) and [xrf] (cross-reference). eThis argument states how many arguments the finished citation template will

accept. It must be a number between 1 and 6.

fSix pairs of matched braces must appear inside this argument. Any other than the first (which represents the citation nickname) may be left empty, but the bridges must of course take this into account. The number of arguments inserted here must correspond with the number stated on the line above.

2.5 The .bst file

2.5.1 Entry types

Most of the work in drafting a new style is in writing entry type functions for inclusions in the .bst file. This is, inevitably, an arduous task, because of the number of possibilities that must be covered. The task is made easier, however, by the .bst file programming library contained in the file camel.dtx. This library provides a set of functions for the manipulation of fields pushed onto the stack in the entry type functions themselves. This approach increases the transparency of your code, because you can see in the entry type function itself exactly what fields are being used, and what logical and formatting operations are being carried out on them.

Using the library is highly recommended. If you find that you require functions that are not presently available in the library, you can make your solutions available to others by adhering to a few design guidelines, and passing the function on to fb@soas.ac.uk for inclusion in the Camel distribution. The guidelines are actually quite simple. No library function should directly manipulate a field, but should instead expect to find the field on the stack when it is invoked. No library function should make assumptions about the setting of variables; any parameters should also be passed to the stack before the library function is invoked. When finished, a library function should always leave a fixed number of items on the stack, in a fixed order. And a library function should not pass data to subsequent functions in the form of variables. Finally, a function should be documented concerning (a) the number of items it expects to find on the stack, and in what order, (b) the number of items it leaves on the stack, and in what order, and (c) the effect of any toggle strings that may be fed to the function.

You may find it necessary, in drafting a function, to divide its operation into sub-functions. As between sub-functions, the ban on passing data through variables need not be followed, so long as the set of functions adheres to the rule.

2.5.2 About cross-referencing

About cross-referencing, Oren Patashnik wrote:

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 crossreference the larger thing. These styles allow for five posibilities:

1. an article may cross-reference an article;

2. a cross-reference to a book may be made in an entry for:

(a) a book;

(b) an inbook; or

(c) an incollection; and

3. an inproceedings may cross-reference a proceedings.

Each of these is explained in more detail later.

This is the authoritative statement on the proper use of cross-referencing within a .bib file. The further comments I have to offer here are a non-authoritative gloss, but do accurately reflect the assumptions I made in writing the .bst code for the

law.dtx file.

article: A cross-reference from one article entry to another may be used for special issues of a journal, such as those dedicated to a single topic. The referenced entry should include all details relevant to the issue as a whole, including volume, journal and booktitle (this last for the name or topic description of a special issue), and type (this defaults to “Special issue”).

book: This cross-reference is not recognized by the law.dtx style. It could logically be used for a series, but this is little trouble to type into the original @book entry itself, and a series is not something that should appear separately on the reference list.

inbook: This is used for cross-referencing a chapter or other subdivision within a work by a single author to that work.

incollection: This is used for cross-referencing a work by multiple authors. The typeface conventions used in the Blue Book style differ for inbook and incollection citations, as defined here, so this distinction should be honored in building a database.

inproceedings: This is used only cross-referencing articles appearing to a proceedings volume to that volume.

3 The Citation Engine: camel.sty

3.1 Initialization

3.1.1 Hello!

To start things off on the right foot, we tell the world who we are.

1 ⟨∗lexitex⟩

 2 \NeedsTeXFormat{LaTeX2e}[1994/12/01] \ProvidesPackage{camel}
 3 [1997/02/17 v1.0t General bibliography engine (Frank Bennett)]
 4 \@ifclassloaded{ltxdoc}{}{\RequirePackage{index}[1995/09/28]}
 5 \RequirePackage{keyval}[1995/09/21]
 6 \RequirePackage{overword}

3.1.2 Customizable text elements

\supra The following definition specifies the string used to refer to a cite that occurs in a previous footnote, or in a preceding citation to the same source within the same footnote. It is not used in cross-referencing cases and statutes. The extra internal braces only serve to limit the scope of \em. An italic space (\/) is not added, since this might be followed by a period.

 7 \def\supra{, {\em supra}}%

The \Id macro defined here is used in referring to immediately preceding works, in the same or in a preceding footnote. If the context demands that Id. be lower case when it occurs, the user can switch it to lower case by entering \lowcase immediately before an in-text citation declaration or citation nickname. The lower case macro thus invoked turns itself off after id. has printed, so no grouping is required.

 8 \def\Id{{\em\@law@lettercase Id.}}%

These two tokens hold the text used to indicate the note or page number where a previous reference occurs. These are only used in short-form citations.

 9 \newtoks\@ltok@userconetop%
10 \newtoks\@ltok@userconetopplural%
11 \newtoks\@ltok@userptop%
12 \newtoks\@ltok@userptoctwo%
13 \newtoks\@ltok@useratbridge%
14 \newtoks\@ltok@useratbridgeplural%
15 \newtoks\@ltok@usercitefirst
16 \newtoks\@ltok@usercitepage
17 \newtoks\@ltok@usercitelast
18 \newtoks\@ltok@infoot \@ltok@infoot={\ note\ }
19 \newtoks\@ltok@onpage \@ltok@onpage={\ page\ }

The following tokens are used in making proof sheets. Change the content of these to taste.

20 \newtoks\@ltok@proofcitelast
21 \@ltok@proofcitelast{{Editor, publisher and stuff, 1994}}
22 \newtoks\@ltok@proofpage
23 \@ltok@proofpage{{12345}}
24 \newtoks\@ltok@proofciteone
25 \@ltok@proofciteone{{Source}}
26 \newtoks\@ltok@prooftitle

27 \@ltok@prooftitle{{Title of work}}
28 \newtoks\@ltok@proofauthor
29 \@ltok@proofauthor{{Author's name}}

3.1.3 User selectable switches

The Blue Book^{14} allows us to refer to statutes in a long form or a short form in subsequent references. The long form consists of the name of the Act (if any) plus its source details and the section number. The short form consists of the source details alone.^{15} I’m all in favour of saving ink; the default is for short form statute citations. You can have long form subsequent cites by setting \statuteverboseon at the top of your document. If you need some other form, let me know; statutes are complex, and rather than trying to do everything from the get-go, this really has to be demand led.

30 \global\let\@law@delim\relax
31 \global\let\@law@pingroup\relax
32 \global\let\@law@pinstart\relax
33 \global\let\@law@pinend\relax
34 \newif\if@law@statuteverbose
35 \def\statuteverboseon{\@law@statuteverbosetrue}
36 \def\statuteverboseoff{\@law@statuteverbosefalse}
37 \statuteverboseoff

\forcefootnotes This fun little item is used to toggle the \source macros to create a footnote if none was typed literally into the text. Great finger-saver for shortie footnotes. Conceived on a whim, implementing this turned out to be non-trivial. I hope you find it useful!

38 \newif\if@law@forcefootnotes
39 \def\forcefootnotes{\global\@law@forcefootnotestrue}
40 \def\noforcefootnotes{\global\@law@forcefootnotesfalse}

3.1.4 Shorthanding essentials

The following definitions are established as a means of cutting text using the _, ^and | characters. Although we make them active here, they are not read as active characters. Camel should in no way interfere with styles that require these characters to be set active. The active characters created here are used only for “internal purposes”.

41 {

42 \catcode`\_=13
43 \catcode`\^=13
44 \catcode`\|=13
45 \gdef\@law@barkill{\def\@law@comma{, }%
46  \def\@law@ampersand{\ \& }%
47  \def\@law@dash{--}%
48  \def\@law@delim{}\def_##1_{}\def|##1\relax{}\def^{}}%
49 \gdef\@law@barnil{\def_{}\def^##1^{}\def|{}}
50 \gdef\@law@barinfull{\def^{}}
51 \gdef\@law@barinshort{\def^##1^{}}

14A Uniform System of Citation (19th ed. 1989).

15See Id.

at 25.

53 \def\bridges#1#2#3#4#5#6{%
54 \@ltok@userconetop{#1}%
55 \@ltok@userconetopplural{#2}%
56 \@ltok@userptop{#3}%
57 \@ltok@userptoctwo{#4}%
58 \@ltok@useratbridge{#5}%
59 \@ltok@useratbridgeplural{#6}%

60 }

3.1.5 Miscellaneous other macros

Sometimes it might be nice to avoid using -- for some reason, so a macro is defined here. Same thing for exclamation points. One possible use for the latter is to avoid errors when an exported table is sorted by makeindex.

61 \def\dash{--}
62 \def\exclaim{!}%

The \Id macro contains its own period. Therefore a period supplied by the user becomes redundant. This macro is redefined to gobble this extra period when necessary.

63 \def\@law@gobble{}
64 \def\@law@argtwolist{}

If you are into software history, you might have cause to refer to LexITEX, so its logo and the LexiBiblogo (also R.I.P.) are defined here. They are \protected just like the L^{A}TEX logo.

65 \def\p@LexiTeX{{\reset@font\rm\ \unskip\hbox{L%
66 \kern-.06em\hbox{\sc e}%
67 \kern-.05em\hbox{\sc x}%
68 \kern-.05em\lower.65ex\hbox{I}%
69 \kern-.18emT%
70 \kern-.1667em\lower.65ex\hbox{E}%
71 \kern-.125emX}}}%
72 \def\LexiTeX{\protect\p@LexiTeX}%
73 \def\p@LexiBib{{\reset@font\rm\ \unskip\hbox{L%
74 \kern-.06em\hbox{\sc e}%
75 \kern-.05em\hbox{\sc x}%
76 \kern-.05em\hbox{\sc i}%
77 \kern-.06em{\sc B}%
78 \kern-.05em\hbox{\sc i}%
79 \kern-.05em{\sc b}}}}%
80 \def\LexiBib{\protect\p@LexiBib}%

3.1.6 New environment

There is just one new environment in Camel, and all it does is set the list-input toggle to true, so that input citations will feed into memory but not print.

81 \newenvironment{lexilist}%
82 {\message{Loading citation data}\@law@listinputtingtrue}%
83 {\@law@listinputtingfalse}

3.1.7 Token registers

The following are used as temporary token registers in various places.

 84 \newtoks\@ltok@a
 85 \newtoks\@ltok@b
 86 \newtoks\@ltok@argtwo
 87 \newtoks\@ltok@pagesstring

The following token registers are used for temporary storage of typeface information.

 88 \newtoks\@ltok@authormainface
 89 \newtoks\@ltok@authoroptionface
 90 \newtoks\@ltok@titlemainface
 91 \newtoks\@ltok@titleoptionface
 92 \newtoks\@ltok@citefirstmainface
 93 \newtoks\@ltok@citefirstoptionface
 94 \newtoks\ltokspecialface

One token register is needed to store the name of the current cite type (as declared using \newcitestyle in the .cit file). With this string in hand, all of the typeface and punctuation bridge information can be recovered for that type of citation.

 95 \newtoks\@ltok@citetype%

Tokens to store info on whether a cite is in a footnote or in the main text, and the name of the cite style, in case we need it.

 96 \newtoks\@ltok@whereitsat
 97 \newtoks\@ltok@stylename

Ho-hum. Now we’re going to need a bunch of token registers to stash the information for a cite. Token registers have to be used in processing, in order to provide expansion control.

 98 \newtoks\@ltok@nickname
 99 \newtoks\@ltok@author
100 \newtoks\@ltok@name
101 \newtoks\@ltok@citefirst
102 \newtoks\@ltok@citepage
103 \newtoks\@ltok@citelast
104 \newtoks\@ltok@pageorfootno
105 \newtoks\@ltok@hereinafter
106 \newtoks\@ltok@bigsourcecite
107 \newtoks\@ltok@bigsourcepage

We also need token registers for citation bridge information.

108 \newtoks\@ltok@atot
109 \newtoks\@ltok@ttocone
110 \newtoks\@ltok@conetop
111 \newtoks\@ltok@conetopplural
112 \newtoks\@ltok@ptop
113 \newtoks\@ltok@ptoctwo
114 \newtoks\@ltok@atbridge
115 \newtoks\@ltok@atbridgeplural
116 \newtoks\@ltok@plistmacro

A counter is required to keep track of the number of cites in a footnote, and to store the number that occurred in the previous footnote.

117 \newcounter{citesinfoot}
118 \newcounter{citeslastfoot}
119 \newcounter{law@paranormal}
120 \newcounter{law@parapin}
121 \newcounter{law@paracounter}

3.1.8 Peek-word-ahead macro

This macro will not work if it is placed after the string of \newifs below. I haven’t a clue as to why. I’m leery of whether this will cause problems with other styles. If you have problems, contact me on fb@soas.ac.uk.

3.1.9 If initializations

We need a toggle so we can turn the print routine on and off; this is necessary for list inputting, and for making phantom references to sources in order to handle weird citation forms.

122 \newif\if@law@biblabels
123 \newif\if@law@usepages
124 \newif\if@law@table
125 \newif\if@law@usepinpoints
126 \newif\if@law@maketable
127 \newif\if@law@printcite

The next one is used by the list-input environment.

128 \newif\if@law@listinputting
129 \newif\if@law@bibentry

We also need to know whether a citation is being used for the first time. In some styles, the first citation is treated specially.

130 \newif\if@law@firstuseofcite

The next if will be used to toggle the print routine between long and short citation forms.

131 \newif\if@law@longcite

This will tell us whether we are in a footnote or not.

132 \newif\if@law@infoot

The next \if will let us know if the same work was cited immediately before the current cite, and if so, whether we should pay any attention to a page reference, if given. These are adjusted by \law@justabovecheck.

133 \newif\if@justabove
134 \newif\if@l@quiteexact

The next condition will control the way print output is done in short citation forms; it should set to false for articles and books, and to true for cases and statutes.

135 \newif\if@nosupra

The next is used to signal the presence of ++ as the argument linking a reference to a page/section number argument. This toggles plural bridges on, and tells the file output routine that, for statutes, each section number should be attached to a complete copy of the citation information. These copies are later reassembled in a set of table entries by makeindex.

136 \newif\if@law@printauthor%
137 \newif\if@law@printtitle%
138 \newif\if@law@requiresubjects%
139 \newif\if@law@subjectfound%

3.1.10 Macro initializations

The following is a grab-bag of small macros with simple functions. There is more to say about what other macros use them for than about they themselves, so I’ve put them in the front matter of the code.

First is a little something to force a lowercase id. if necessary. The operation of \normcase is obvious enough; it defines the case-switching macro to a no-op. \lowcase works by setting the case toggle to force a lowercase letter. The use of \aftergroup allows everything to be turned back on without losing the lowercase letter. This was designed by trial and error; there may be a better way.

140 \def\normcase{\def\@law@lettercase{}}
141 \def\lowcase{\def\@law@lettercase##1{%
142 {\aftergroup\normcase\lowercase{##1}}}}
143 \normcase

The following three definitions are used in preparing to print a citation using \@law@print and in printing pinpoint references, respectively. The first extracts a demand for plural bridges, if present. The second is a no-op. The third is the plural bridges flag itself.

144 \def\@law@multicheck#1\@law@multiflag#2\query#3\end{#2}%
145 \def\@law@multiflag#1\query{}%
146 \def\@law@multiset{\global\@ltok@conetop\@ltok@conetopplural%
147  \global\@ltok@atbridge\@ltok@atbridgeplural}

The \newinterword macro simple adds its arguments to the \@law@wordlist macro created by the Camel style module (i.e. the *.cit file).

148 \def\newinterword{\begingroup\catcode`\_=13\catcode`\^=13%
149 \@law@newinterword}
150 \def\newinterword#1#2{\global\@ltok@a=\expandafter{\@law@wordlist}%
151 \global\@ltok@b={#1}\global\@ltok@c={#2}%
152 \xdef\@law@temp{\noexpand\\\noexpand{\the\@ltok@b\noexpand}%
153  \noexpand{\the\@ltok@c\noexpand}\the\@ltok@a}%
154 \global\let\@law@wordlist\@law@temp\endgroup}

The Camel nickname macros are now kept out of the name space by executing them via \csname\endcsname, and adding a prefix that makes the macro inaccessible by direct reference within the document. This change was recommended by a user—sorry out there, I can’t remember who! Note that any nickname can now contain numbers and other stuff, which is handy for cases, which should be organized according to deciding court and date. If in-text references are being forced into footnotes, the footnote toggles are set to true here; the footnote itself is created later, after any optional arguments have been gobbled. Note that footnote forcing will only take effect for \source citations, not for in-text declarations. We need a new counter for footnotes, so that we can keep track of footnote numbers while processing forced footnotes outside of the footnote environment.

155 \newcount\c@law@footnote%
156 \def\volno{\message{(No volume for \the\@ltok@nickname)}}%

\@law@getsubjectheader This macro is used to grab the header appropriate to a given declared subject. The subjects, headers and other related information are kept in a single list macro for quick access.

157 \def\@law@headersearchend{\camelrefname}
158 \def\@law@abandonheadersearch#1\@law@headersearchend{}
159 \def\@law@headersearch#1#2#3#4{%
160 \def\@law@temptwo{#1}%
161 \ifx\@law@temp\@law@temptwo%
162 \let\@law@headersearchend\relax%
163 \let\\=\@law@abandonheadersearch%
164 {}#3%
165 \fi}
166 \def\@law@getsubjectheader#1{%
167 {\def\@law@temp{#1}%
168 \let\\=\@law@headersearch\@law@subjectlist\@law@headersearchend}}
169 \let\@law@bibformatsearchend\relax
170 \def\@law@abandonbibformatsearch#1\@law@bibformatsearchend{}
171 \def\@law@bibformatsearch#1#2#3#4{%
172 \def\@law@temptwo{#1}%
173 \ifx\@law@temp\@law@temptwo%
174 \let\\=\@law@abandonbibformatsearch%
175 {}#4%
176 \fi}
177 \def\@law@getbibformat#1{%
178 {\def\@law@temp{#1}%
179 \let\\=\@law@bibformatsearch\@law@subjectlist\@law@bibformatsearchend}}

\@law@confirmsubject This parser checks whether a given subject exists in the list of declared subjects. It takes no action, only issues a warning.

180 \def\@law@subjectsearchend{%
181 \ifx\@law@citesubject\empty%
182 \@camel@error{No subject declared.^^J
183  After declaring a subject or subjects using
184  \string\citationsubject,^^J
185  you have neglected to give a subject (using the s= option)^^J
186  for one of your \string\source\space commands}\@ehc%
187 \else%
188 \@camel@error{Undeclared subject `\@law@citesubject'.^^J
189  An undeclared subject has been given as an argument to
190  a \string\source\space command.^^J  You must first %
191  declare subjects using \string\citationsubject}\@ehc%
192 \fi}
193 \def\@law@abandonsubjectsearch#1\@law@subjectsearchend{}
194 \def\@law@subjectsearch#1#2#3#4{%
195 \def\@law@temptwo{#1}%
196 \ifx\@law@citesubject\@law@temptwo%
197 \let\@law@subjectsearchend\relax%
198 \let\\=\@law@abandonsubjectsearch%
199 \fi}
200 \def\@law@confirmsubject{%
201 {\let\\=\@law@subjectsearch\@law@subjectlist\@law@subjectsearchend}}

\@law@maybeaddcitesubject This macro adds the nickname of the current citation to the list of nicknames under the current citation subject. It will only do this if the nickname does not already exist in the list. The effect is to keep the lists in citation order. Note that a citation may be listed under more than one citation subject. This may be useful, so it is not prevented.

202 \def\@law@citesubjectcheckend{%
203 \expandafter\let\expandafter\@law@temptwo%
204 \csname @law@\@law@citesubject @citelist\endcsname%
205 \@ltok@a=\expandafter{\@law@temptwo}%
206 \expandafter\xdef%
207 \csname @law@\@law@citesubject @citelist\endcsname{%
208  \the\@ltok@a\noexpand\\%
209 \noexpand{\the\@ltok@nickname\noexpand}}}
210 \def\@law@abandoncitesubjectcheck#1\@law@citesubjectcheckend{}
211 \def\@law@citesubjectcheck#1{%
212 \def\@law@temptwo{#1}%
213 \ifx\@law@nickname\@law@temptwo%
214 \let\@law@citesubjectcheckend\relax%
215 \let\\=\@law@abandoncitesubjectcheck%
216 \fi}
217 \def\@law@maybeaddcitesubject{%
218 {\let\\=\@law@citesubjectcheck%
219 \csname @law@\@law@citesubject @citelist\endcsname%
220 \@law@citesubjectcheckend}}

There are to be three sets of specialized parsing macros in LexiTeX, all three of which are used on the options to the \source command. One parser reads a list of options. The second reads a comma, &, and - delimited list and writes the contents as a macro argument. The third reads the same comma, & and - delimited list and prints it directly on the output after a slight amount of formatting work.

\@law@plone Does a comparison, executes the associated option if there is a match.

221 ⟨+oldparse⟩\def\@law@plone#1#2{\def\@law@listitem{#1}%
222 ⟨+oldparse⟩ \ifx\@law@optionitem\@law@listitem #2%
223 ⟨+oldparse⟩ \let\\=\@law@finish\fi}

\@law@end The internal ending character is also common to all parsers.

224 \def\@law@end{,}

\@law@finish If there is a match, we want to ignore the rest of the list. This is macro is defined and “kept on the shelf” until such time as we need to cut off the rest of the executable list macro below.

225 ⟨+oldparse⟩\def\@law@finish#1\@law@nomatch{}

\@law@sourceoptionlist At the cost (in the short term) of abandoning helpful error messages, from version 1.0r, we use the keyval package by David Carlisle for all parsing except page numbers.

226 \define@key{cameloptions}{a}[F]{\global\@law@printauthorfalse}%
227 \define@key{cameloptions}{t}[F]{\global\@law@printtitlefalse}%
228 \define@key{cameloptions}{n}[F]{\global\@law@printcitefalse}%
229 \define@key{cameloptions}{l}[F]{\message{\lowcase}}%
230 \define@key{cameloptions}{f}[T]{\global\@law@longcitetrue}%
231 \define@key{cameloptions}{b}[T]{\global\@law@bibentrytrue\global\@law@longcitetrue}%
232 \define@key{cameloptions}{Z}{}%
233 \define@key{cameloptions}{s}{\if@law@requiresubjects%

234  \gdef\@law@citesubject{#1}%
235  \fi}%
236 \define@key{cameloptions}{v}{\gdef\volno{#1}}%

\@@parse \@law@parse Now comes the fun bit. Control is passed back and forth between \@law@parse and \@@parse, with the behaviour of those functions altering depending on what is chewed up into them. Amazingly enough, it works. Whatta concept.

237 \def\@@parse{\@law@parse}
238 \let\@law@parse\@law@parseplain

\@law@alone A copy of \@law@plone. Serves same function.

239 \def\@law@alone#1#2{\def\@law@allistitem{#1}%
240 \ifx\@law@alitem\@law@allistitem #2%
241 \let\\=\@law@alfinish\fi}

\@law@alnomatch We don’t care what goes into this field, so there is no error message from the parser.

242 \def\@law@alfinish#1\@law@alnomatch{\@law@alnomatch}
243 \def\@law@alnomatch{%
244 \global\@ltok@a=\expandafter{\@law@alitem}%
245 \xdef\@law@temp{\the\@ltok@argtwo\the\@ltok@a}%
246 \global\@ltok@argtwo=\expandafter{\@law@temp}}

\@law@allist The list of options is simple and expansible. The syntax of the last two lines is required if everything is to work as expected. The items in the help message should probably be drawn from here, to provide a hook for expansion if other styles want to tinker with the options to \source.

247 \gdef\@law@allist{%
248 \\{&}{\gdef\@law@alitem{\@law@delim%
249  \@law@multiflag\@law@multiset\query%
250  \@law@ampersand}}%
251 \\{=}{\gdef\@law@alitem{\@law@delim%
252  \@law@pinend%
253  \@law@pingroup%
254  \@law@pinstart}%
255  \addtocounter{law@parapin}{1}}%
256 \\{-}{\gdef\@law@alitem{\@law@delim
257  \@law@multiflag\@law@multiset\query%
258  \@law@dash}}%
259 \\{,}{\gdef\@law@alitem{}%
260  \let\@law@parse\@law@alparsesavecomma}%
261 \\{_}{\@law@get@ul}%
262 \\{^}{\@law@get@carat}%
263 \\{|}{\@law@get@bar}%
264  \@law@alnomatch}

\@law@get@ul \@law@getcarat \@law@getbar The purpose of the following is to place active versions of the special marking characters on the stack. Note that the characters need not be active when read; they are replaced with active versions of the characters by this routine. Active characters are sent to the stack rather than control strings because they do not swallow following space (possibly not important), and because this made the whole thing easier to follow in the debugging process.

265 {\catcode`\_=13\catcode`\^=13\catcode`\|=13%
266 \gdef\@law@get@ul{\gdef\@law@alitem{_}}%
267 \gdef\@law@get@carat{\gdef\@law@alitem{^}}%
268 \gdef\@law@get@bar{\gdef\@law@alitem{\@law@delim|}}%

269 }

270 \gdef\@law@finishargtwo{%
271 \global\@ltok@a={\@law@pingroup\@law@pinstart}%
272 \xdef\@law@temp{\the\@ltok@a\the\@ltok@argtwo}%
273 \global\@ltok@argtwo=\expandafter{\@law@temp}}

\@law@alparsesavecomma \@law@alparseplain These parsers are switched in as appropriate. The first checks to see if the end of the string for parsing has been reached. The second cycles a comparison.

274 \gdef\@law@alparsesavecomma{\@ifnextchar,%
275 {\gdef\@law@alitem{\@law@delim\@law@pinend}\@law@alnomatch%
276 \expandafter\@law@finishargtwo%
277 \@gobble}%
278 {\gdef\@law@alitem{\@law@delim%
279  \@law@multiflag\@law@multiset\query%
280  \@law@comma}%
281 \@law@alnomatch%
282 \let\@law@parse=\@law@alparseplain\@@parse}}
283 \def\@law@alparseplain#1{%
284 \let\@law@nomatch=\@law@alnomatch%
285 \gdef\@law@alitem{#1}\let\\=\@law@alone\@law@allist\@@parse}

\@law@scanlist This macro is defined and kept on the shelf as a definition of \\ that checks through the list of paired aliases and associated text. If it finds a match, it gives the text one level of expansion, to fix the current definition of _and ^. This allows one entry to serve both between citations, and at the start of a citation string. In addition to these macros, a \@law@wordlist macro must be defined in the .cst file used with Camel.

286 \def\@law@scanlist#1#2{\long\def\@law@temp{#1}%
287 \@ltok@a={#2}%
288 \ifx\@law@temp\@overword\xdef\@SBSword{{\noexpand\em \the\@ltok@a}}%
289 \let\\=\@law@finish\fi}
290 \def\@law@wlnomatch{\message{^^J^^J%
291 There is an unregistered inter-citation word (\@overword) on
292 line no \the\inputlineno.  See the LexiTeX documentation
293 for more information.  Please email fb@soas.ac.uk if
294 you want a word added to the inter-citation list.}}

\@law@checkins This macro works with the \@ifoverword macro; it checks the contents of the \@overword macro defined during the leap, to see if it corresponds to anything in a list of aliases. The alias list could be defined as a set of prefixed macros (to speed things up), or as a single list macro (to conserve string space). I have adopted the latter strategy. If anyone feels strongly that speed is more important, or that somehow the integrity of TEX demands that macros be used, it’s not much of a job to change things; be my guest.

295 {\catcode`\_=\active%
296 \catcode`\^=\active%
297 \gdef\@law@checkins{%
298 \def^##1{\lowercase{##1}}\def_##1{{\em{##1}}}%

299 \let\@law@tempthree=\\%
300 \let\@law@nomatch=\@law@wlnomatch%
301 \let\\=\@law@scanlist\@law@wordlist%
302 \let\\=\@law@tempthree}
303 \gdef\@law@checkpre{%
304 \let\@law@tempthree=\\%
305 \let^\relax\let_\@gobble%
306 \let\@law@nomatch=\@law@wlnomatch%
307 \let\\=\@law@scanlist\@law@wordlist%
308 \let\\=\@law@tempthree}

309 }

\source The front end of the \source command is very much à la typical LaTeX optional command definition stuff. We just carry things a little further because there are two possible options to the \source command.

310 \gdef\source{%
311 \if@law@requiresubjects%
312  \gdef\@law@citesubject{}%
313 \fi%
314 \@law@printcitetrue%
315 \@law@printauthortrue%
316 \@law@printtitletrue%
317 \setcounter{law@parapin}{0}%
318 \setcounter{law@paracounter}{0}%
319 \@ifnextchar[{\@lexicite}{\@lexicite[]}}
320 \def\@lexicite[#1]#2{\@ifnextcharcareful[{%
321 \addtocounter{law@parapin}{1}\@@lexicite{#1}{#2}}%
322 {\@@lexicitenobrace{#1}{#2}}}

Once we’ve gathered up any optional arguments, it’s time to use the \@ifoverword command. If we find a \source command after the next word, we stash the current cite, we check the word separating the two \source commands against an internal list, return the result to \@SBSword, and push the raw citation details and the @SBSword bridge onto a temporary stack. Otherwise, we clear the \@SBSword, push the current cite details, dump the stack, and put the word we found, together with any separating space, back on the output stream.

323 \def\@ifnextcharcareful#1#2#3{%
324 \gdef\@prenextcharspace{}%
325 \let\reserved@e=#1\def\reserved@a{#2}\def\reserved@b{#3}\futurelet
326  \reserved@c\@ifnchcareful}
327 \def\@ifnchcareful{\ifx \reserved@c \@sptoken \let\reserved@d\@xifnchcareful
328  \else \ifx \reserved@c \reserved@e\let\reserved@d\reserved@a\else
329  \let\reserved@d\reserved@b\fi
330  \fi \reserved@d}
331 \def\:{\@xifnchcareful}
332 \expandafter\def\: {%
333 \gdef\@prenextcharspace{ }\futurelet\reserved@c\@ifnch}
334 \def\@@lexicite#1#2[#3]{%
335 \@ifoverword\source%
336  {\@law@checkins\@@@lexicite{#1}{#2}{#3}}%
337  {\gdef\@SBSword{}\@@@lexicite{#1}{#2}{#3}%
338  \@law@citedump{}%
339  \@preoverwordspace%
340  \expandafter\@law@gobble%

341  \@overword{} }%
342  {\gdef\@SBSword{}\@@@lexicite{#1}{#2}{#3}%
343  \@law@citedump{}%
344  \@preoverwordspace%
345  \expandafter\@law@gobble%
346  \@overword{} }}
347 \def\@@lexicitenobrace#1#2{%
348 \@ifoverword\source{\@law@checkins\@@@lexicite%
349  {#1}{#2}{}}%
350  {\gdef\@SBSword{}\@@@lexicite%
351  {#1}{#2}{}%
352  \@law@citedump{}%
353  \@prenextcharspace%
354  \expandafter\@law@gobble%
355  \@overword{} }
356  {\gdef\@SBSword{}\@@@lexicite%
357  {#1}{#2}{}%
358  \@law@citedump{}%
359  \@prenextcharspace%
360  \expandafter\@law@gobble%
361  \@overword{} }}

To push citation details, we use a token assignment with \expandafter, then an \edef of the register contents to get one level of expansion into a macro.

362 \def\@law@citestack{}%
363 \gdef\@SBSword{}%
364 \def\@@@lexicite#1#2#3{%
365 \@ltok@a=\expandafter{\@law@citestack}%
366 \@ltok@b={\@realcite{#1}{#2}{#3}}%
367 \@ltok@c=\expandafter{\@SBSword}%
368 \edef\@law@citestack{\the\@ltok@a\the\@ltok@b\the\@ltok@c}}

\footnote We need a flag to tell us whether we are in a footnote. This allows us to prevent footnote forcing if we’re already in a footnote. L^{A}TEX itself should probably take care of this, but for now we need to give it a helping hand by reinvoking the critical command with Apologies to the L^{A}TEX3 team and everything, but I really truly do need these hooks.

Some thoughts on the tracking of previous citations. This is hardly transparent, and even I the author have trouble following it. Something for tidying up someday. Currentcite is set only at the top of a footnote. The idea apparently is that we need to remember the last cite in the last footnote always. Problems to watch here are (a) what happens for the very first footnote, and (b) what happens in the main text. There should probably be complete isolation of these context records for main text references and footnote references.

369 \long\def\@footnotetext#1{\insert\footins{%
370 \@law@infoottrue%                 % Hooks for citation manager
371 \ifnum\the\c@citesinfoot=1\relax%             %
372 \global\let\@law@lastcite\@law@currentcite%  %
373 \else%                                        %
374 \gdef\@law@lastcite{\@dummy}%                %
375 \fi%                                          %
376 \global\setcounter{citesinfoot}{0}% End of hooks
377  \reset@font\footnotesize

378  \interlinepenalty\interfootnotelinepenalty
379  \splittopskip\footnotesep
380  \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
381  \hsize\columnwidth \@parboxrestore
382  \let\@tempa\protect
383  \def\protect{\noexpand\protect\noexpand}%
384  \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
385  \let\protect\@tempa
386  \color@begingroup
387  \normalcolor
388  \@makefntext{%
389  \rule\z@\footnotesep\ignorespaces#1%
390  \@finalstrut\strutbox}
391  \color@endgroup}}

We require a simple parser to allow multiple citation keys in the scope of a single \source command. We ignore any pinpoint given after the \source command; if you’re using pinpoints, write individual \source commands into your text. This keeps things relatively clean and simple, for future linking to intelligent editors. The voiding of \@ltok@argtwo is going to be redundant if there are more than two keys in the scope, but what the heck, it’s simple this way. Intervening punctuation is assumed to be the “default”, which is signified by the ; character. Note that any leading options will carry through to all of the citations in the key string! If you want to suppress the author, say, for only one citation, you’d better use a separate \source command for that citation, and link it to the string with an inter-word.

392 \def\@law@clparseplain#1,{%
393 \@ifnextchar,%
394  {\def\@law@temp{\@law@onerealcite{#1}}%
395  \expandafter\@law@temp\@gobble}%
396  {\@law@onerealcite{#1}%
397  {\long\def\@overword{;}\@law@checkins%
398  \@SBSword\gdef\@SBSword{}}%
399  \@@parse}}

When citations are dumped, we need to decide what sort of delimiters they receive. If footnote forcing is in effect, we need to protect against the possibility that we’re already in a footnote. The \@citedump command should be redefined for styles that bracket citation strings in, say, square brackets. The following code, the \@law@printcite command and the contents of the lexicite.tex file are the only chunks of the style that need modification to generate different—perhaps radically different—styles. The strategy used here to force footnotes could equally well be used to place the citation string in a \marginpar, in a floating box, on a facing page or what have you. So many possibilities, so little time …

400 \def\@law@citedump{%
401 \if@law@infoot%
402  \begingroup\@law@citestack\endgroup%
403 \else%
404  \if@law@forcefootnotes%
405  \footnote{\begingroup\@law@citestack\@law@gobble.\endgroup}%
406  \else%
407  \begingroup\@law@citestack\endgroup%
408  \fi%

409 \fi%
410 \def\@law@citestack{}}

The actual cites should be expanded only after it has been determined that the end of a citation string has been reached. The expansion sequence for individual citations begins here.

411 \def\@realcite#1#2#3{%
412 \ifcat$#1$\else%
413 \setkeys{cameloptions}{#1}
414 \fi%
415 \if@law@requiresubjects%
416 \@law@confirmsubject%
417 \fi%
418 \global\@ltok@argtwo{}%
419 \ifcat$#3$\else%
420  {\let\@law@parse=\@law@alparseplain\@law@parse #3,,}%
421 \fi%
422 {\let\@law@parse=\@law@clparseplain\@law@parse #2,,}%

423 }

The \@law@onerealcite macro writes the citation key on the .aux file for onward use by BibTEX, and initiates citation expansion.

424 \def\@law@onerealcite#1{%
425 \@ifundefined{@lnick@#1}%
426 {\expandafter\def\csname @lnick@#1\endcsname{%
427  {\small\bf\tt <undefined: #1>}
428  \@latex@warning
429  {Citation `#1' on page \thepage \space undefined}}}%
430  {\relax}%
431 \if@filesw%
432 \immediate\write\@auxout{\string\citation{#1}}%
433 \@ifundefined{@law@managerouthook}%
434  \relax%
435  {\immediate\write\@bibout{\@law@managerouthook{#1}}}%
436 \fi%
437 \global\@law@firstuseofcitefalse%
438 \csname @lnick@#1\endcsname}

\bibitem The bibitem subcommands are redefined, since we don’t need to export the nickname a second time when using Camel.

439 \def\@lbibitem[#1]{\item[\@biblabel{#1}\hfill]\ignorespaces}
440 \def\@bibitem{\item\ignorespaces}

\bibliographymanager This macro provides support for external bibliography managers. If a known manager is declared, the key is written on an ephemeral file with the name camel.bib. If the manager is then set up to replace keys with valid BibTEX .bib entries, and is run over this file, the resulting file can be used as an input file for BibTEX. Simple. Clean. L^{A}TEX.

441 \def\@law@subjectlist{}
442 \def\citationstyle#1{%
443 \ifx\@law@subjectlist\empty%
444  \def\@law@citesubject{all}
445  \expandafter\gdef\csname @law@all@citelist\endcsname{}%

446  \def\@law@subjectlist{\\{all}{}{\camelrefname}{}}%
447 \fi%
448 \if@filesw%
449 \immediate\write\@auxout{\string\bibstyle{#1}}%
450 \fi%
451 \def\@law@savecat{\catcode`@}%
452 \makeatletter%
453 \input{#1.cst}%
454 \input{#1.cit}%
455 \catcode`\@=\@law@savecat%
456 \@ifundefined{@law@bblfile}%
457  {\relax}%
458  {\begin{lexilist}
459  \@input{\@law@bblfile}
460  \end{lexilist}}}
461 \def\citationdata#1{%
462 \def\bibliographymanager{\@camel@error{\string\bibliographymanager\space
463  following \string\citationdata.^^J
464  You can use only one of \string\citationdata\space and
465  \string\bibliographymanager\space^^J at the start of a document
466  or after a
467  \string\printthebibliography\space command}\@ehc}%
468 \if@filesw%
469 \immediate\write\@auxout{\string\bibdata{#1}}%
470 \fi%
471 \@ifundefined{@law@wordlist}%
472  {\gdef\@law@bblfile{\jobname.bbl}}%
473  {\begin{lexilist}
474  \@input {\jobname.bbl}
475  \end{lexilist}}}
476 \def\@camel@error#1#2{%
477 \GenericError{%
478  \space\space\space\@spaces\@spaces\@spaces
479 }{%
480  Camel Error: #1%
481 }{%
482  See the Camel manual for explanation.%
483 }{#2}%

484 }

485 {\catcode`\%=12 \gdef\@law@percent{%}}
486 \def\bibliographymanager#1{%
487 \def\citationdata{\@camel@error{\string\citationdata\space
488  following \string\bibliographymanager.^^J
489  You can use only one of \string\citationdata\space and
490  \string\bibliographymanager\space^^J at the start of a
491  document or after a
492  \string\printthebibliography\space command.}\@ehc}%
493 \if@filesw%
494 \immediate\write\@auxout{\string\bibdata{camel}}%
495 \fi%
496 \@ifundefined{@law@wordlist}%
497  {\gdef\@law@bibfile{\jobname.bbl}}%
498  {\begin{lexilist}%
499  \@input {\jobname.bbl}

500  \end{lexilist}}%
501 \newwrite\@bibout%
502 \immediate\openout\@bibout camel.bib%
503 \gdef\@law@temp{#1}%
504 \gdef\@law@temptwo{procite}%
505 \ifx\@law@temp\@law@temptwo%
506  \def\@law@managerouthook##1{(##1)}%
507 \fi%
508 \gdef\@law@temptwo{endnote}%
509 \ifx\@law@temp\@law@temptwo%
510  \def\@law@managerouthook##1{[##1]}%
511 \fi%
512 \gdef\@law@temptwo{papyrus}%
513 \ifx\@law@temp\@law@temptwo%
514  \def\@law@managerouthook##1{\@law@percent\@law@percent##1\@law@percent\@law@percent}%
515 \fi%
516 \gdef\@law@temptwo{referencemanager}%
517 \ifx\@law@temp\@law@temptwo%
518  \def\@law@managerouthook##1{\{##1\}}%
519 \fi%
520 \gdef\@law@temptwo{tib}%
521 \ifx\@law@temp\@law@temptwo%
522  \def\@law@managerouthook##1{[.##1.]}%
523 \fi}

\lexibib This is used by LexiBib to declare citations in a lexilist environment. Use of a single macro permits \theholding and its friends to work more simply.

524 \def\lexibib#1{\csname new#1\endcsname}%

We need to initialize the list macro used as a workspace by the list macro handlers.

525 \def\@law@templistmacro{}
526 \def\@law@tempplistmacro{}

These macros are used for \if-branching in various formatting routines.

527 \def\@law@case{case}
528 \def\@law@statute{statute}
529 \def\@law@article{article}
530 \def\@law@book{book}

3.2 Main macros

3.2.1 Utility macros

This section contains larger macros that perform major tasks and smaller bits of code that are complex in their operation.

\@law@unstashparas When this is implemented, the above chain of futurelet macros will be linked to this \@law@unstashparas routine, which fetches any parallel items, and then (in \@law@setup) performs the restash of the citation if necessary.

\@law@clean \@law@cleanup This is a rough set of routines; if anyone has a suggestion on how to more elegantly clean most of L^{A}TEX’s control sequences for export, I would be most grateful to hear from them. The effect of these routines is to convert control sequences that might be sent to the output files into harmless strings. This is necessary because the file cannot be written at the time \@law@cleanup is called; the page references would be incorrect. The definitions are local; bracketing the clean command and its arguments will leave the cleaned text in the macro, but restore command strings to operation when L^{A}TEX passes out of the current group. The \ifcat condition at the start (this method of token register checking was suggested by Bernd Raichle— who scolded me for bothering the L^{A}TEX3 list with this question!) is meant to catch empty strings fed to the routine in the fastest possible way. Without any checking, things can blow up. The use of \@law@barnil (somewhere in the middle) makes the vertical-bar character turn wimpish and disappear, which is what we want. Otherwise it prints weird stuff when it is fed back in through the external table.

531 {\catcode`\_=13\catcode`\^=13\catcode`\|=13%
532 \gdef\@law@clean#1#2{%
533 \def\protect##1{\string##1\space}%
534 \ifcat$\the#1$%
535 \edef#2{}%
536 \else%
537 \def^{\string^}%
538 \def_{\string_}%
539 \@law@barnil%
540 \def\volno{\string\volno}%
541 \def\exclaim{\string\exclaim}%
542 \def\hbox{\string\hbox}%
543 \def\&{\string\&}\def\%{\string\%}%
544 \def\hskip{\string\hskip}%
545 \def\jintercharskip{\string\jintercharskip}%
546 \def\char{\string\char}%
547 \def~{\string~}\def\/{\string\/}%
548 \def\\{\string\\}\def\ {\string\ }\def\sc{\string\sc\space}%
549 \def\rm{\string\rm\space}\def\bf{\string\bf\space}%
550 \def\em{\string\em\space}%
551 \def\={\string\=}%
552 \def\`{\string\`}\def\'{\string\'}%
553 \def\^{\string\^}\def\"{\string\"}\def\~{\string\~}%
554 \def\.{\string\.}\def\u{\string\u}\def\v{\string\v}%
555 \def\H{\string\H\space}\def\t{\string\t\space}%
556 \def\c{\string\c\space}%
557 \def\d{\string\d\space}\def\b{\string\b\space}%
558 \def\oe{\string\oe\space}%
559 \def\ae{\string\ae\space}\def\aa{\string\aa\space}%
560 \def\o{\string\o\space}%
561 \def\l{\string\l\space}\def\ss{\string\ss\space}%
562 \def\OE{\string\OE\space}\def\AE{\string\AE\space}%
563 \def\AA{\string\AA\space}%
564 \def\O{\string\O\space}\def\L{\string\L\space}%
565 \def\dag{\string\dag\space}\def\ddag{\string\ddag\space}%
566 \def\S{\string\S\space}%
567 \def\P{\string\P\space}%
568 \def\TeX{\string\TeX\space}\def\LaTeX{\string\LaTeX\space}%
569 \def\LexiTeX{\string\LexiTeX\space}%
570 \def\BibTeX{\string\BibTeX\space}\def\-{\string\-}%
571 \xdef\@law@temp{\the#1}%
572 \xdef#2{\expandafter\expandafter\expandafter\@gobble%

573 \expandafter\string\csname\@law@temp\endcsname}%
574 \fi}

575 }

This routine runs the cleaning routine on every token register that we want to send to the external files. The result is stored in a macro, since we need the registers for the next citation, and because it will be safe to fully expand the contents after cleaning.

576 \def\@law@cleanup{%
577 \@law@clean\@ltok@authormainface\@law@authormainfacetemp%
578 \@law@clean\@ltok@authoroptionface\@law@authoroptionfacetemp%
579 \@law@clean\@ltok@author\@law@authortemp%
580 \@law@clean\@ltok@titlemainface\@law@titlemainfacetemp%
581 \@law@clean\@ltok@titleoptionface\@law@titleoptionfacetemp%
582 \@law@clean\@ltok@argtwo\@law@argtwotemp%
583 \@law@clean\@ltok@name\@law@nametemp%
584 \@law@clean\@ltok@citepage\@law@citepagetemp%
585 \@law@clean\@ltok@citefirstmainface\@law@citefirstmainfacetemp%
586 \@law@clean\@ltok@citefirstoptionface\@law@citefirstoptionfacetemp%
587 \@law@clean\@ltok@citefirst\@law@citefirsttemp%
588 \@law@clean\@ltok@conetop\@law@conetoptemp%
589 \@law@clean\@ltok@citelast\@law@citelasttemp%
590 \@law@clean\@ltok@ptop\@law@ptoptemp}

3.2.2 Declaration of citation types

This section contains macros used in creating the citation declaration macros actually entered in the document by the user.

@newcite and its friends The following macros are used to define the macro suites that relate to particular citation types. These are normally invoked by entries in the lexicite.tex file, but the \newcitestyle macro is accessible within the document as well. The \newcitestyle macro expects the following arguments:

1. the nickname of the citation style to be created;

2. a list of typeface and cite type options, in the syntax required by \@newciteoptions;

3. a list of cite bridges, in the syntax required by \@newcitebridges;

4. an integer giving the number of arguments the finished cite-generation macro will accept; and

5. an argument consisting of a balanced list of six arguments indicating which of the six possible Camel arguments will be used.

The last two of these are fed to \newcommand as formatting arguments in the creation of citation style macros. In operation, the token register assignments performed by \@newcitebridges and\@law@parsefaces are memorized by freezing them in macros whose names are derived from the name of the citation style. The freezing operation is carried out by a list of token assignments within the storage macros. The macros are \xdefed, but the expansion of everything except the existing contents of the registers (inserted at one level of expansion using \the) is prevented with \noexpands. The macro containing the faces is created inside \newcitestyle itself to save an argument position in the definition of \@law@parsefaces; we’ve used up seven, and there are only two to go. This could be done with list macros as well, but this method probably runs a little faster because it does the job directly. The trade-off is that the ⟨cite type name⟩faces macros contain a lot of non-informative text (the names of the token registers); but there are not many citation types, so it is probably worth the cost. in memory.

Note that as of this release, citation declarations defined with \newcitestyle always begin with \new. This will help simplify the integration of BibTEX and Camel.

591 \def\newcitestyle#1#2#3{%
592 \@ifundefined{@law@citeload}%
593 {\def\@law@citeload{Loading citation classes: #1 ... }}%
594 {\message{\@law@citeload#1}\def\@law@citeload{...\space}}%
595 \@newcitebridges#1#3%
596 \expandafter\@law@parsefaces#2%
597 \expandafter\xdef\csname#1faces\endcsname{%
598 \noexpand\global\noexpand\@ltok@authormainface\noexpand{%
599  \the\@ltok@authormainface\noexpand}%
600 \noexpand\global\noexpand\@ltok@authoroptionface\noexpand{%
601  \the\@ltok@authoroptionface\noexpand}%
602 \noexpand\global\noexpand\@ltok@titlemainface\noexpand{%
603  \the\@ltok@titlemainface\noexpand}%
604 \noexpand\global\noexpand\@ltok@titleoptionface\noexpand{%
605  \the\@ltok@titleoptionface\noexpand}%
606 \noexpand\global\noexpand\@ltok@citefirstmainface\noexpand{%
607  \the\@ltok@citefirstmainface\noexpand}%
608 \noexpand\global\noexpand\@ltok@citefirstoptionface\noexpand{%
609  \the\@ltok@citefirstoptionface\noexpand}%
610 \noexpand\global\noexpand\@ltok@citetype\noexpand{%
611  \the\@ltok@citetype\noexpand}}%
612 \expandafter\gdef\csname new#1\endcsname##1##2##3##4##5##6##7%
613 {\@newcite{#1}{##1}{##2}{##3}{##4}{##5}{##6}{##7}}}

The following are parsing routines that are called by \newcitestyle. In \@law@parsefaces, the seven arguments are the string of letters in the second argument of \newcitestyle. This function has been drastically simplified over the first release. I should have done it this way in the first place and saved myself a lot of aggravation. The code should run a lot faster to boot.

614 \def\@law@parsefaces#1#2#3#4#5#6#7{%
615 \@law@parseoneoption\@ltok@authormainface#1%
616 \@law@parseoneoption\@ltok@authoroptionface#2%
617 \@law@parseoneoption\@ltok@titlemainface#3%
618 \@law@parseoneoption\@ltok@titleoptionface#4%
619 \@law@parseoneoption\@ltok@citefirstmainface#5%
620 \@law@parseoneoption\@ltok@citefirstoptionface#6%
621 \@law@parselastoption\@ltok@citetype#7}

622 %

623 \def\@law@parseoneoption#1#2{%
624 \if#2s\global#1{\sc}\fi%
625 \if#2i\global#1{\em}\fi%
626 \if#2b\global#1{\bf}\fi%
627 \if#2r\global#1{\rm}\fi%
628 \if#2S\global#1{\sc}\fi%

629 \if#2I\global#1{\em}\fi%
630 \if#2B\global#1{\bf}\fi%
631 \if#2R\global#1{\rm}\fi}

632 %

633 \def\@law@parselastoption#1#2{%
634 \if#2a\global#1{article}\fi%
635 \if#2b\global#1{book}\fi%
636 \if#2c\global#1{case}\fi%
637 \if#2s\global#1{statute}\fi%
638 \if#2A\global#1{article}\fi%
639 \if#2B\global#1{book}\fi%
640 \if#2C\global#1{case}\fi%
641 \if#2S\global#1{statute}\fi}

Bridges are stored literally, without parsing, so it’s easy to stash them directly in a single macro that is fed the arguments. The assignments here are stored by the same method outlined in the description of \newcitestyle, above.

642 \newtoks\@ltok@c%
643 \newtoks\@ltok@d%
644 \newtoks\@ltok@e%
645 \newtoks\@ltok@f%
646 \newtoks\@ltok@g%
647 \newtoks\@ltok@h%
648 \newtoks\@ltok@i%
649 \newtoks\@ltok@j%
650 \def\@newcitebridges#1[a]#2[t]#3[c]#4[p]#5(pl)#6[rp]#7[e]:[id]#8(pl)#9[xrf]{%
651 \@ltok@c{#2}%
652 \@ltok@d{#3}%
653 \@ltok@e{#4}%
654 \@ltok@f{#5}%
655 \@ltok@g{#6}%
656 \@ltok@h{#7}%
657 \@ltok@i{#8}%
658 \@ltok@j{#9}%
659 \expandafter\xdef\csname#1bridges\endcsname{%
660 \noexpand\global\noexpand\@ltok@atot\noexpand{\the\@ltok@c\noexpand}%
661 \noexpand\global\noexpand\@ltok@ttocone\noexpand{\the\@ltok@d\noexpand}%
662 \noexpand\global\noexpand\@ltok@conetop\noexpand{\the\@ltok@e\noexpand}%
663 \noexpand\global\noexpand\@ltok@conetopplural\noexpand{\the\@ltok@g\noexpand}%
664 \noexpand\global\noexpand\@ltok@ptop\noexpand{\the\@ltok@f\noexpand}%
665 \noexpand\global\noexpand\@ltok@ptoctwo\noexpand{\the\@ltok@h\noexpand}%
666 \noexpand\global\noexpand\@ltok@atbridge\noexpand{\the\@ltok@i\noexpand}%
667 \global\@ltok@atbridgeplural\noexpand{\the\@ltok@j\noexpand}}}%

3.2.3 Declaration of citation nicknames

The following macros are called by the macros generated by the \newcitestyle macro and its arguments. Their effect is to create nickname macros which can then be called by the user with the \source command, with the nickname as a single argument in braces. This macro is called by \new⟨citation type name⟩. While this macro always takes seven arguments, some of these may be masked off from the user, if fewer than the full possible six arguments were called for in the final argument fed to \newcitestyle in creating the particular \new⟨citation type name⟩ macro that is doing the calling. The arguments are there, the user just can’t put anything into them. The \@law@authortracing macro is actually just a temporary macro; I gave it a descriptive name because it was a struggle to keep my head around what it does as I was programming this. What happens is that a token assignment of the author’s name followed by a trip to the cleaning routine is used to store a harmless string consisting of the entire contents of the author’s name field in the \@law@authortracing macro. Then this name is defined as a macro, expanding to 1 or 2, depending on whether it has been defined once already. The macro may look something like \Jayeff Huggins~Jr.. Drastic, but effective. Try doing that with a WordPerfect macro …

668 \newif\if@law@specialbridges%
669 \def\@newcite#1#2#3#4#5#6#7#8{%
670 \message{=}%
671 {\@ltok@a={#4}\@law@clean\@ltok@a\@law@temp%
672 \expandafter\ifx\csname\@law@temp\endcsname\relax%
673 \expandafter\expandafter\expandafter\xdef\expandafter%
674 \csname\@law@temp\endcsname{1}%
675 \else%
676 \expandafter\expandafter\expandafter\xdef\expandafter%
677 \csname\@law@temp\endcsname{2}%
678 \fi}%

The \@law@stasheverything macro creates the list macro that can be used to retrieve all citation details at a later point in the document. \@law@makecitenick creates the short macro that knows how to unstash the stored information. Note that this is where things end if we are inside the lexilist environment.^{16}

679 \def\@law@templistmacro{}%
680 \def\@law@tempplistmacro{}%
681 \setcounter{law@paranormal}{0}
682 \ifcat$\the\@ltok@useratbridgeplural$%
683 \@law@addargument{}\tocitelist%
684 \@law@addargument{}\tocitelist%
685 \@law@addargument{}\tocitelist%
686 \@law@addargument{}\tocitelist%
687 \@law@addargument{}\tocitelist%
688 \@law@addargument{}\tocitelist%
689 \else%
690 \@law@addtoken\@ltok@userconetop\tocitelist%
691 \@law@addtoken\@ltok@userconetopplural\tocitelist%
692 \@law@addtoken\@ltok@userptop\tocitelist%
693 \@law@addtoken\@ltok@userptoctwo\tocitelist%

16The previous release used a \@law@stashinfo macro that took nine arguments. The last two were just toggles, in effect, for the creation of a long- and a short-form nickname macro. Passing the information in this way required the definition of two separate invocation macros, one for full-form citing and one for short-form citing. This was messy. We now do all of this with true toggles that change the behaviour of a single set of routines. This means:

• We don’t need two macros; and

• The stash routines can be included in \@newcite itself—information needn’t be passed

through macro arguments at all, which helps speed things up.

We have to start by emptying the contents of the temporary list macro; a beta version didn’t do this, and loading cites took an amazingly long time. I had problems with “TeX capacity exceeded” messages, and \tracingmacros=2 showed that every cite was a stack containing the desired cite—and every preceding citation as well!

694 \@law@addtoken\@ltok@useratbridge\tocitelist%
695 \@law@addtoken\@ltok@useratbridgeplural\tocitelist%
696 \fi%
697 \@law@addargument{#1}\tocitelist%
698 \@law@addtoken\@ltok@bigsourcepage\tocitelist%  (not yet implemented)
699 \@law@addtoken\@ltok@bigsourcecite\tocitelist%  (not yet implemented)
700 \@law@addtoken\@ltok@hereinafter\tocitelist%    (not yet implemented)

Two fields are made nil during stash; they will be filled when the macro is first unpacked.

701 \@law@addargument{}\tocitelist%
702 \@law@addargument{}\tocitelist%
703 \@law@addtoken\@ltok@citetype\tocitelist%     cite type
704 \@law@addargument{#8}\tocitelist%             cite last part
705 \@law@addargument{#7}\tocitelist%             cite page
706 \@law@addargument{#6}\tocitelist%             cite first part
707 \@law@addargument{#5}\tocitelist%             name of work
708 \@law@addargument{#4}\tocitelist%             author
709 \expandafter\gdef\csname @law@#2@lab\endcsname{#3}% label
710 \@law@addargument{#2}\tocitelist%             nickname
711 \def\@law@tempplistmacro{}%
712 \@law@paracheckone{#2}}%

\@law@paracheckone \@law@parachecktwo \@law@getpara The following three macros look ahead (after the initial arguments to a cite declaration have been digested but before the cite information has been stored to the list macro) for a = sign, which signals parallel citation details. If a = sign is found, a further check is made for a [, which signals a set of special bridges for the upcoming parallel citation. Note the use of two = signs in braces as the first argument to \@ifnextchar. This is required because of the internal syntax of the

 \@ifnextchar macro.
713 \def\@law@paracheckone#1{%
714 \def\@law@temp{{#1}}%
715 \@ifnextchar{=}%
716 {\expandafter\expandafter\expandafter\@law@parachecktwo%
717 \expandafter\@law@temp\@gobble}%
718 {\@@newcite{#1}}}%
719 \def\@law@parachecktwo#1{\@ifnextchar[%
720 {\@law@getpara{#1}}%
721 {\@law@getpara{#1}[{}{}{}{}{}]}}

The following add a single set of parallel citation details into a list macro used as a holding area for this purpose.

722 \def\@law@getpara#1[#2#3#4#5#6]#7#8#9{%
723 \addtocounter{law@parapin}{1}
724 \def\@law@temp{{#1}}%
725 \@law@addpargument{{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}\tolist%
726 \@ifnextchar{=}%
727 {\expandafter\expandafter\expandafter%
728  \@law@parachecktwo\expandafter\@law@temp\@gobble}%
729 {\@@newcite{#1}}}
730 \def\@@newcite#1{%

A counter indicating how many parallel citations are stored for the current citation, and the list macro of parallel citation details built by the routines above is stored as a single item in the general list macro of citation details.

731 \@law@addtoken\c@law@paranormal\tocitelist
732 \@ltok@a\expandafter{\@law@tempplistmacro}%
733 \@law@addtoken\@ltok@a\tocitelist%
734 \expandafter\global\expandafter\let\csname @ldata@#1\endcsname=\@law@templistmacro%
735 \@ltok@userconetop{}%
736 \@ltok@userconetopplural{}%
737 \@ltok@userptop{}%
738 \@ltok@userptoctwo{}%
739 \@ltok@useratbridge{}%
740 \@ltok@useratbridgeplural{}%

Having stashed everything, we’re ready to make the nickname macro itself, and print the long form of the cite. We set \@law@temp equal to the nickname macro, and expand after the condition so that arguments can be examined—otherwise the first thing the nickname sees will be the \fi.

741 \@law@makecitenick{#1}%
742 \if@law@listinputting\def\@law@nick{}\else%
743 \def\@law@nick{\source[f]{#1}}\fi\@law@nick}%

This macro adds one argument item #1 to the end of list macro \@law@templistmacro. This and the other list handlers are modelled on the examples in Knuth’s TEXbook.^{17}+378 This and the other macros in this set do their work on one list macro, \@law@templistmacro, in order to avoid the need for lots of

 \expandafters.
744 \def\@law@addargument#1\tocitelist{%
745 \@law@leftappendargument#1\to\@law@templistmacro}
746 \long\def\@law@leftappendargument#1\to#2{\@ltok@a={\\{#1}}%
747 \@ltok@b=\expandafter{#2}%
748 \xdef#2{\the\@ltok@a\the\@ltok@b}}

This macro adds the contents of one token register to the temporary list macro.

749 \def\@law@addtoken#1\tocitelist{\@law@leftappendtoken#1\to\@law@templistmacro}
750 \long\def\@law@leftappendtoken#1\to#2{%
751 \xdef\@law@temp{\noexpand\\\noexpand{\the#1\noexpand}}%
752 \@ltok@a=\expandafter{\@law@temp}%
753 \@ltok@b=\expandafter{#2}%
754 \xdef#2{\the\@ltok@a\the\@ltok@b}}

This macro cuts one token-register item #1 from the end of list macro \@law@templistmacro. The lopoff portion is almost straight out of the TeXbook, except that it stores the lopped element in a token register instead of a macro.

755 \def\@law@cut#1\fromcitelist{\@law@lop\@law@templistmacro\to#1}
756 \def\@law@lop#1\to#2{\expandafter\@law@lopoff#1\@law@lopoff#1#2}%
757 \long\def\@law@lopoff\\#1#2\@law@lopoff#3#4{\global#4={#1}\gdef#3{#2}}
758 \def\@law@pincut#1\frompinlist{\@law@pinlop\@law@argtwolist\to#1}
759 \def\@law@pinlop#1\to#2{\expandafter\@law@pinlopoff#1\@law@pinlopoff#1#2}%
760 \long\def\@law@pinlopoff\@law@pingroup\@law@pinstart#1\@law@pinend#2\@law@pinlopoff#3#4{\global#4={#1}\gdef#3{#2}}

17D. Knuth, supra note 1.

\@law@addpargument \@law@addptoken \@law@pcut The following nine macros are used to manipulate a list macro containing parallel citation details, and sets of token registers into which the list is extracted.

761 \def\@law@fetchparas{%
762 \ifnum\the\c@law@paranormal>\the\c@law@paracounter\relax%
763  \@law@pcut\@law@tempplist\fromlist%
764  \expandafter\@law@extractparas\@law@tempplist%
765 \fi}
766 \def\@law@extractparas#1#2#3#4#5#6#7#8{%
767 \ifcat$\the\@ltok@useratbridge$%
768 \else%
769  \@ltok@userconetop={#1}%
770  \@ltok@userconetopplural={#2}%
771  \@ltok@userptop={#3}%
772  \@ltok@useratbridge={#4}%
773  \@ltok@useratbridgeplural={#5}%
774 \fi%
775 \global\@ltok@usercitefirst={#6}%
776 \global\@ltok@usercitepage={#7}%
777 \global\@ltok@usercitelast={#8}}
778 \def\@law@shiftparas{%
779 \ifnum\the\c@law@paranormal>\the\c@law@paracounter\relax%
780  \ifcat$\the\@ltok@useratbridge$%
781  \else%
782  \global\@ltok@conetop\@ltok@userconetop%
783  \global\@ltok@conetopplural\@ltok@userconetopplural%
784  \global\@ltok@ptop\@ltok@userptop%
785  \global\@ltok@ptoctwo\@ltok@userptoctwo%
786  \global\@ltok@atbridge\@ltok@useratbridge%
787  \global\@ltok@atbridgeplural\@ltok@useratbridgeplural%
788  \fi%
789  \global\@ltok@citefirst\@ltok@usercitefirst%
790  \global\@ltok@citepage\@ltok@usercitepage%
791  \global\@ltok@citelast\@ltok@usercitelast%
792 \fi}
793 \def\@law@addpargument#1\tolist{%
794 \addtocounter{law@paranormal}{1}%
795 \@law@rightappendpargument#1\to\@law@tempplistmacro}
796 \long\def\@law@rightappendpargument#1\to#2{\@ltok@a={\\{#1}}%
797 \@ltok@b=\expandafter{#2}%
798 \xdef#2{\the\@ltok@b\the\@ltok@a}}
799 \def\@law@addptoken#1\tolist{\@law@leftappendptoken#1\to\@law@tempplistmacro}
800 \long\def\@law@leftappendptoken#1\to#2{%
801 \xdef\@law@temp{\noexpand\\\noexpand{\the#1\noexpand}}%
802 \@ltok@a=\expandafter{\@law@temp}%
803 \@ltok@b=\expandafter{#2}%
804 \xdef#2{\the\@ltok@a\the\@ltok@b}}
805 \def\@law@pcut#1\fromlist{\@law@plop\@law@tempplistmacro\to#1}
806 \def\@law@plop#1\to#2{\expandafter\@law@plopoff#1\@law@plopoff#1#2}%
807 \long\def\@law@plopoff\\#1#2\@law@plopoff#3#4{\gdef#4{#1}\gdef#3{#2}}

This macro turns off the gobbling feature (it may be turned on during execution, if Id. is used), erases any pinpoint reference information that is hanging around, and if we are in a footnote, it increments the counter that was set to zero at the start of the footnote. It then unpacks all of the info for the cite whose nickname is given in #1, and puts it into token registers for further processing. After it unpacks the list macro \@ldata@⟨nickname⟩, it unpacks the formatting details appropriate to the style in which it was declared. After the list is unpacked, if there is no record of a footnote or page number, then this is the first printing of the cite. The note/page and footnote/page number details need to be stored, and then everything has to be repacked for future reference under the appropriate list macro name. The list macro strategy allows on-the-fly editing of macros which adds greatly to the flexibility of the style. Note the parabeta guard below. When we turn on support for parallel citations, we will need to do the restash work later, after checking for any attached items.

808 \def\@law@unstasheverything#1{%
809 \gdef\@law@gobble{}%
810 \if@law@infoot%
811 \addtocounter{citesinfoot}{1}%
812 \fi%
813 \expandafter\let\expandafter\@law@templistmacro\csname @ldata@#1\endcsname%
814 \global\c@law@footnote\c@footnote%
815 \@law@cut\@ltok@plistmacro\fromcitelist%
816 \xdef\@law@tempplistmacro{\the\@ltok@plistmacro}%
817 \@law@cut\@ltok@a\fromcitelist%
818 \expandafter\c@law@paranormal\the\@ltok@a%
819 \@law@cut\@ltok@nickname\fromcitelist%
820 \@law@cut\@ltok@author\fromcitelist%
821 \@law@cut\@ltok@name\fromcitelist%
822 \@law@cut\@ltok@citefirst\fromcitelist%
823 \@law@cut\@ltok@citepage\fromcitelist%
824 \@law@cut\@ltok@citelast\fromcitelist%
825 \@law@cut\@ltok@citetype\fromcitelist%
826 \@law@cut\@ltok@whereitsat\fromcitelist%
827 \@law@cut\@ltok@pageorfootno\fromcitelist%
828 \@law@cut\@ltok@hereinafter\fromcitelist%
829 \@law@cut\@ltok@bigsourcecite\fromcitelist%(not yet implemented)
830 \@law@cut\@ltok@bigsourcepage\fromcitelist%(not yet implemented)
831 \@law@cut\@ltok@stylename\fromcitelist%
832 \csname \the\@ltok@stylename bridges\endcsname%
833 \csname \the\@ltok@stylename faces\endcsname%

The following lines check one of the special bridge fields for content. If it is empty, we leave the bridges alone. Otherwise, we replace the default bridges with those selected by the user for this citation.

834 \@law@cut\@ltok@a\fromcitelist%
835 \ifcat$\the\@ltok@a$%
836 \else%
837 \@ltok@atbridgeplural\@ltok@a%
838 \@law@cut\@ltok@atbridge\fromcitelist%
839 \@law@cut\@ltok@ptoctwo\fromcitelist%
840 \@law@cut\@ltok@ptop\fromcitelist%
841 \@law@cut\@ltok@conetopplural\fromcitelist%
842 \@law@cut\@ltok@conetop\fromcitelist%
843 \@law@specialbridgestrue%
844 \fi%
845 \ifcat$\the\@ltok@whereitsat$%

846 \if@law@requiresubjects%
847 \@ifundefined{@law@\@law@citesubject @citelist}%
848  {\expandafter\gdef\csname @law@\@law@citesubject @citelist\endcsname{}}%
849  {\relax}%
850 \fi%
851 \@law@maybeaddcitesubject
852 \global\@law@firstuseofcitetrue%
853 \if@law@infoot%
854 \global\@ltok@whereitsat\@ltok@infoot%
855 \global\@ltok@pageorfootno=\expandafter{\the\c@law@footnote}%
856 \else%
857 \global\@ltok@whereitsat\@ltok@onpage%
858 \global\@ltok@pageorfootno=\expandafter{\the\c@page}%
859 \fi%
860 \if@law@specialbridges%
861 \@law@addtoken\@ltok@conetop\tocitelist%
862 \@law@addtoken\@ltok@conetopplural\tocitelist%
863 \@law@addtoken\@ltok@ptop\tocitelist%
864 \@law@addtoken\@ltok@ptoctwo\tocitelist%
865 \@law@addtoken\@ltok@atbridge\tocitelist%
866 \@law@addtoken\@ltok@atbridgeplural\tocitelist%
867 \else%
868 \@law@addargument{}\tocitelist%
869 \@law@addargument{}\tocitelist%
870 \@law@addargument{}\tocitelist%
871 \@law@addargument{}\tocitelist%
872 \@law@addargument{}\tocitelist%
873 \@law@addargument{}\tocitelist%
874 \fi%
875 \@law@addtoken\@ltok@stylename\tocitelist%                style name
876 \@law@addtoken\@ltok@bigsourcepage\tocitelist%(not yet implemented)
877 \@law@addtoken\@ltok@bigsourcecite\tocitelist%(not yet implemented)
878 \@law@addtoken\@ltok@hereinafter\tocitelist%  (not yet implemented)
879 \@law@addtoken\@ltok@pageorfootno\tocitelist%   (1)(b) stash the footnote bridge
880 \@law@addtoken\@ltok@whereitsat\tocitelist%     (2)(b) footnote number
881 \@law@addtoken\@ltok@citetype\tocitelist%   cite type
882 \@law@addtoken\@ltok@citelast\tocitelist%   cite last part
883 \@law@addtoken\@ltok@citepage\tocitelist%   cite page
884 \@law@addtoken\@ltok@citefirst\tocitelist%   cite first part
885 \@law@addtoken\@ltok@name\tocitelist%   name of work
886 \@law@addtoken\@ltok@author\tocitelist%   author
887 \@law@addtoken\@ltok@nickname\tocitelist%   nickname
888 \@law@addtoken\c@law@paranormal\tocitelist% parallels counter
889 \@law@addtoken\@ltok@plistmacro\tocitelist% parallels
890 \global\expandafter\let\csname @ldata@#1\endcsname\@law@templistmacro%
891 \fi%

892 }

3.2.4 Calling citation nicknames

The nickname macro defined by this routine (\@lnick@⟨nickname⟩), is immensely more compact than in the first release. \@law@argscheck eventually leads to \@law@setup after a series of checks for optional arguments. For the longest time I used a \the statement for the contents of \@law@argscheck; \noexpand works just as well and is much simpler to arrange.

893 \def\@law@makecitenick#1{%
894  \expandafter\xdef\csname @lnick@#1\endcsname{%
895  \noexpand\@law@unstasheverything\noexpand{#1\noexpand}%
896 \noexpand\@law@setup}}

\@law@newcitefirst The following code will be used to kick off the existing \@newcite routine when hereinafter-style references come to be supported.

897 ⟨∗hereinafters⟩

898 \def\@law@newcitefirst{\@ifnextchar[]{\catcode`\[=??
899 \catcode`\]=??
900 \expandafter\@law@newcitesecond\@law@grabhereinafter}
901 {\@law@newcite}}
902 \def\@law@grabhereinafter#1{\@ltok@hereinafter={#1}

903 ⟨/hereinafters⟩

3.2.5 Table writes and preliminary formatting

Once the printing information has been stashed, the \@lnick@⟨nickname⟩ macro can be used to extract and print it. After extracting the information and storing it in token registers, this looks forward to gather any pinpointing argument that has been appended to the macro in the text. Once all the the necessary information has been collected, the \@law@setup macro tidies up the formatting of the cite and writes it to the export file, if the creation of tables for that type of citation has been toggled on. It then invokes the print routine.

This macro assumes that all citation information stored for the cite has already been retrieved to appropriate token registers. The redefinition of the backslash character here allows it to be used to select the alternate typeface within a citation argument. The alternate typeface can be changed for all documents by editing the relevant .cst file. Grouping braces enclosing all operations within \@law@setup mean than weird stuff turned on the sole purpose of exporting to tables and printing the citation will turn itself off when the print routine is finished. A routine (\@law@justabovecheck) is run to figure out what the citation context is—how a cross-reference should be formatted—and once it’s found out what it needs to know about the last citation, information on the current citation is tucked away for reference by this the context-checking routine next time around. A series of checks is performed so that superfluous bridges for which there is no corresponding argument can be erased. Then a file write is performed to the appropriate export file, if creation of that table has been toggled on. And finally the print routine is called. The \@law@gobble that follows the end of the group is used to eat a superfluous period if necessary. It is brought to life, if appropriate, by the print routine. Note the special catcode of the | character during this definition.

904 {\catcode`\|=13%
905 \long\gdef\@law@setup{%

The following operations restash the citation details if necessary; by this point we will have grabbed any parallel citation details that we needed. The backslash character is redefined as a self-resetting font-switching macro.

906 {\def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
907 \the\ltokspecialface}%

908 \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
909 \def\\{\@law@firstslash}%

This carries out the necessary checks on the context of the current citation.

910 \@law@justabovecheck%

Now that the \@law@justabovecheck macro has been run, it is time to set up for the next comparison. Take note that this source was cited, and of any specific page reference it contains, IF we are in a footnote

911 \if@law@infoot%
912 \xdef\@law@currentcite{\the\@ltok@author\the\@ltok@name\the\@ltok@citefirst%
913 \the\@ltok@citepage\the\@ltok@citelast}%
914 \xdef\@law@lastpage{\the\@ltok@argtwo}%
915 \fi%
916 \begingroup%
917 \@law@tidybridges%
918 \ifx\@law@citesubject\empty%
919 \relax%
920 \else%
921  \if@law@bibentry%
922  \else%
923  \ifnum\the\c@law@paranormal=0\relax%
924  \csname write@one@\@law@citesubject @entry\endcsname%
925  \fi%
926  \fi%
927 \fi%
928 \endgroup%
929 \@law@print}}}
930 \def\@law@conetopsetup{%
931 \gdef\@law@temp{}%
932 \ifx\@law@argtwolist\@law@temp%
933 \else%
934  \@law@pincut\@ltok@argtwo\frompinlist%
935  \expandafter\@law@multicheck\the\@ltok@argtwo%
936  \@law@multiflag\query\end%
937 \fi}
938 \def\@law@tidybridges{%

A number of further tidying-up operations are appropriate regardless of the form in which the citation will be printed. If certain elements are missing, their related bridges must be erased if the citation is not going to look awful. This is also where the author or title are suppressed in response to flags given to the \source command.

939 \if@law@printauthor\else\global\@ltok@author{}\fi%
940 \if@law@printtitle\else\global\@ltok@name{}\fi%
941 \ifcat$\the\@ltok@author$%
942  \global\@ltok@atot{}%
943 \fi%
944 \ifcat$\the\@ltok@name$%
945  \global\@ltok@ttocone{}%
946 \fi%
947 \ifcat$\the\@ltok@citefirst$%
948  \global\@ltok@ttocone{}%
949 \fi%
950 \ifcat$\the\@ltok@citelast$%

951 \global\@ltok@ptoctwo{}%
952 \else%
953  \xdef\@law@temp{\the\@ltok@citelast}%
954  \gdef\@law@temptwo{()}%
955  \ifx\@law@temp\@law@temptwo%
956  \global\@ltok@citelast{}%
957  \global\@ltok@ptoctwo{}%
958  \fi%
959 \fi%
960 \ifcat$\the\@ltok@citepage$%
961  \global\@ltok@ptop{}%
962 \fi%
963 \ifcat$\the\@ltok@argtwo$%
964  \global\@ltok@ptop{}%
965  \ifcat$\the\@ltok@citepage$%
966  \global\@ltok@conetop{}%
967  \fi%
968 \fi%

Now we run a series of checks to determine the class of citation we are dealing with, and if tables for that type of citation have been turned on, an export is performed; if a cite for export is to a statute, then the special routines for handling page references is brought into play.

969 \ifcat$\the\@ltok@argtwo$%
970 \global\@ltok@ptop{}%
971 \global\@ltok@atbridge{}%
972 \ifcat$\the\@ltok@citepage$%
973  \global\@ltok@conetop{}%
974  \fi%

And here the \@law@setup routine comes to an end; punt to the print routine, possibly followed by a gobble, if Id. is printed.

975 \fi}

3.3 Output routines

Once the citation has been unpacked and the basic tidying up appropriate to all appearances of the citation has been carried out, it is time to ship its contents to the various output routines.

3.3.1 The print macro

This section contains the code for the print routine and its supporting macros. We begin with the supporting stuff.

\@law@justabovecheck Check if immediately preceding cite is the same as this one. This macro is called immediately before the citation is printed. There are lots of conditions, but the structure is just a straightforward nesting of \if statements, each of which sets a toggle or toggles appropriately. In the end, this macro tells us:

• Whether the immediately-preceding citation is to the same work; and if it is

• Whether the preceding cite had no pinpoint page reference; and if it had one

• Whether the pages referred to by the two cites are exactly identical.

Try that with WordPerfect! If Camel isn’t getting the decisions right, let me know.

976 \def\@law@justabovecheck{%
977 \xdef\@law@temptwo{\the\@ltok@author\the\@ltok@name%
978  \the\@ltok@citefirst\the\@ltok@citepage%
979  \the\@ltok@citelast}%
980 \ifx\@law@lastcite\@law@temptwo%
981  \ifnum\the\c@citesinfoot=1\relax%
982  \@law@justabovecheckdetails%
983  \else%
984  \ifx\@law@currentcite\@law@temptwo%
985  \@law@justabovecheckdetails%
986  \else%
987  \@justabovefalse%
988  \fi%
989  \fi%
990 \else%
991  \ifnum\the\c@citesinfoot>1\relax%
992  \ifx\@law@currentcite\@law@temptwo%
993  \@law@justabovecheckdetails%
994  \else%
995  \@justabovefalse%
996  \fi%
997  \fi%
998 \fi}
999 \def\@law@justabovecheckdetails{%
1000  \ifx\@law@lastpage\empty%
1001  \@justabovetrue%
1002  \@l@quiteexactfalse%
1003  \else%
1004  \ifcat$\the\@ltok@argtwo$%
1005  \@justabovefalse%
1006  \else%
1007  \@justabovetrue%
1008  \xdef\@law@temp{\the\@ltok@argtwo}%
1009  \ifx\@law@temp\@law@lastpage%
1010  \@l@quiteexacttrue%
1011  \else%
1012  \@l@quiteexactfalse%
1013  \fi%
1014  \fi%
1015  \fi}

1016 ⟨/lexitex⟩

3.3.2 Proof sheet master document

The following short document will generate proof sheets for all of the primary styles on the system. With the standard distribution, this produces twelve pages of output.

3.4 Proof sheets

The following macros produce a proof sheet that shows all of the permutations of a citation that I can think of. This is useful for those who have to design new citation styles. This is a pretty straightforward exercise, except for the task of feeding a cite declaration exactly the right arguments; this requires re-definition of \newcitestyle and the re-parsing of the lexicite.tex file.

If you find permutations that are not represented here, let me know and I’ll add them.

3.5 Macros for data export

\citationsubject This macro toggles on the requirement that every citation be assigned to a subject category, and adds a subject to the subject list, with all of the information needed to create a classified bibliography. This information consists of:

1. The nickname for the category, used as the argument to the s= option in each citation;

2. The title for use in the bibliography.

An optional argument of t creates a table, and must be accompanied by o= and i= options giving the extensions of the input and output files, and by h= and optionally may be accompanied by an option of p to include poinpoints in the table.

NOTE: Definition of \@law@finish below is just being chucked into as a patch. This code should all be gone over an reorganized sometime when there is time for it.

1017 ⟨∗lexitex⟩

1018 \def\@law@finish#1\@law@nomatch{}
1019 \def\@law@slone#1#2{\def\@law@listitem{#1}%
1020 \ifx\@law@optionitem\@law@listitem #2%
1021 \let\\=\@law@finish\fi}

\@law@end The internal ending character is also common to all parsers.

1022 \def\@law@end{,}

\@law@slnomatch If when we execute the list of options we do not find a match, we want an error message to go to the terminal. This is the macro that gives the appropriate error message.

1023 \def\@law@slnomatch{\@camel@error{Citation Warning: Invalid
1024  option `\@law@optionitem'
1025  given to \string\citationsubject.^^J%
1026 Valid options are:^^J
1027  2 (force a second-level header for a subject)^^J
1028  p (to include pinpoints in an exported table)^^J
1029  i=<extension> (use the three-letter extension in^^J
1030  exporting a table)^^J
1031  o=<volume>  (use the three-letter extension in^^J
1032  importing a table)^^J%
1033 To avoid errors in formatting, use commas in the option string^^J%
1034 only where they are logically necessary to the sense of the^^J%
1035 string.}\@ehc}

\longestlabelfor This macro set returns a box the exact width of the longest string given as a label to citations of a specified subject class.

1036 \newlength{\templen}
1037 \newlength{\lawlengthone}
1038 \newlength{\lawlengthtwo}
1039 \def\@law@getlabel#1{\settowidth\lawlengthone{\csname @law@#1@lab\endcsname}%
1040 \ifnum\lawlengthone>\lawlengthtwo%
1041  \settowidth\lawlengthtwo{\csname @law@#1@lab\endcsname}%
1042 \fi}
1043 \def\longestlabelfor#1{%
1044 \setlength\lawlengthone{0pt}%
1045 \setlength\lawlengthtwo{0pt}%
1046 \let\\=\@law@getlabel%
1047 \csname @law@#1@citelist\endcsname}

\@law@subjectoptionlist The list of options is simple and expansible. The syntax of the last two lines is required if everything is to work as expected. The items in the help message should probably be drawn from here, to provide a hook for expansion if other styles want to tinker with the options to \source.

1048 \def\@law@subjectoptionlist{%
1049 \\{1}{\gdef\@law@level{1}}%
1050 \\{2}{\gdef\@law@level{2}}%
1051 \\{p}{\global\@law@usepinpointstrue}%
1052 \\{P}{\gdef\@law@bibformat{\global\@law@usepagestrue}}%
1053 \\{o}{\gdef\@law@parsemacro##1{\gdef\@law@outputext{##1}}%
1054  \let\@law@parse\@law@slparsecomma}%
1055 \\{i}{\gdef\@law@parsemacro##1{%
1056  \ifcat$##1$\else%
1057  \global\@law@maketabletrue%
1058  \expandafter\gdef\csname\@law@temp inputext\endcsname{##1}%
1059  \fi}%
1060  \let\@law@parse\@law@slparsecomma}%
1061 \\{=}{\let\@law@parse\@law@slparsebumequal}%
1062 \\{,}{}%
1063 \\{\end}{\let\@law@nomatch\relax\let\@law@parse\relax}%
1064  \@law@nomatch}
\@law@parselastcheck \@law@parsecomma \@law@parselastcheck \@law@parseplain We switch between three possible forms for the \@law@parse macro, and we also

need to have a special way of ending when the delimiter is found in the list.

1065 \def\@law@slparsecomma=#1,{%
1066 \@law@parsemacro{#1}\let\@law@parse\@law@slparseplain%
1067 \@@parse}
1068 \def\@law@slparsebumequal#1,{\let\@law@parse\@law@slparseplain\@@parse}
1069 \def\@law@slparseplain#1{%
1070 \let\@law@nomatch=\@law@slnomatch%
1071 \def\@law@optionitem{#1}\let\\=\@law@slone\@law@subjectoptionlist\@@parse}
1072 \def\citationsubject{%
1073 \@ifnextchar[{\@citationsubject}{\@citationsubject[1]}}
1074 {\catcode`\|=13%
1075 \gdef\@citationsubject[#1]#2#3{%
1076 \global\let\@law@level\relax%
1077 \global\@law@usepinpointsfalse%

1078 \global\@law@maketablefalse%
1079 \global\@law@requiresubjectstrue%
1080 \gdef\@law@bibformat{}%
1081 \def\@law@temp{#2}%
1082 {\let\@law@parse=\@law@slparseplain\@law@parse #1,\end}%
1083 \expandafter\gdef\csname write@one@#2@entry\endcsname{}%
1084 \if@law@maketable%
1085 \expandafter\def\csname the#2table\endcsname{%
1086  \@restonecoltrue%
1087  \if@twocolumn\@restonecolfalse\fi%
1088  \section*{#3}%
1089  \@mkboth%
1090  {\uppercase{#3}}%
1091  {\uppercase{#3}}%
1092  \thispagestyle{plain}%
1093  \parindent\z@\parskip\z@ plus.3\p@\relax%
1094  \let\item\citationtableitem}
1095 \expandafter\def\csname endthe#2table\endcsname{%
1096  \if@restonecol\onecolumn%
1097  \else\clearpage%
1098  \fi}%
1099 \def\itemspace{%
1100  \par\vskip 10\p@ plus5\p@ minus3\p@\relax}
1101 \newindex{#2}{\@law@outputext}{\csname#2inputext\endcsname}{#3}%
1102 \if@law@usepinpoints%
1103  \expandafter\gdef\csname write@one@#2@entry\endcsname{%
1104  {\ifcat$\the\@ltok@argtwo$\@ltok@argtwo{\@law@delim}\fi%
1105  \@ltok@pagesstring\@ltok@argtwo%
1106  \def\@law@comma{\@law@exportapage}%
1107  \def\@law@ampersand{\@law@exportapage}%
1108  \def\@law@dash{\@law@exportapage}%
1109  \def|{\@law@exportapage}%
1110  \def\@law@exportapage####1\@law@delim{%
1111  \@ltok@argtwo{####1}%
1112  \def\@law@temp{\index[#2]}%
1113  \edef\@law@temptwo{%
1114  \noexpand{\string\bibitem %
1115  \string\source[b,Z=\the\@ltok@nickname]%
1116  \noexpand{\the\@ltok@nickname\noexpand}%
1117  \ifcat$\the\@ltok@argtwo$\else>####1\fi\string|maybe\noexpand}}%
1118  \expandafter\@law@temp\@law@temptwo}
1119  \expandafter\@law@exportapage\the\@ltok@pagesstring}}%
1120 \else%
1121  \expandafter\gdef\csname write@one@#2@entry\endcsname{%
1122  \def\@law@temp{\index[#2]}%
1123  \edef\@law@temptwo{%
1124  \noexpand{\string\bibitem %
1125  \string\source[b,Z=\csname @law@\the\@ltok@nickname @lab\endcsname]%
1126  \string{\the\@ltok@nickname\string}\string|maybe\noexpand}}%
1127  \expandafter\@law@temp\@law@temptwo}%
1128 \fi%
1129 \fi%
1130 \@ltok@a=\expandafter{\@law@subjectlist}%
1131 \@ltok@c=\expandafter{\@law@bibformat}%

1132 \if@law@usepinpoints%
1133  \edef\@law@temp{\noexpand\\\noexpand{#2\noexpand}%
1134  \noexpand{p\noexpand}%
1135  \noexpand{#3\noexpand}
1136  \noexpand{\the\@ltok@c\noexpand}}%
1137  \@ltok@b=\expandafter{\@law@temp}%
1138 \else%
1139  \edef\@law@temp{\noexpand\\\noexpand{#2\noexpand}
1140  \noexpand{\@law@level\noexpand}
1141  \noexpand{#3\noexpand}
1142  \noexpand{\the\@ltok@c\noexpand}}%
1143  \@ltok@b=\expandafter{\@law@temp}%
1144 \fi%
1145  \edef\@law@subjectlist{\the\@ltok@a\the\@ltok@b}}}

\printbibliography To print bibliographies, we use a single command with two modes built into it.

1146 \def\printbibliography{\@ifnextchar[{\@printbibliography}{\@printbibliography[]}}
1147 \def\@printbibliography[#1]#2{%
1148 \global\@law@forcefootnotesfalse%
1149 \gdef\@law@temp{#1}\gdef\@law@temptwo{labels=false}%
1150 \let\camelrefname\refname%
1151 \expandafter\ifx\csname#2inputext\endcsname\relax%
1152  \global\@law@tablefalse%
1153 \else%
1154  \global\@law@tabletrue%
1155 \fi%
1156 \begingroup%
1157  \def\refname{\@law@getsubjectheader{#2}}%
1158  \@law@usepagesfalse%
1159  \@law@getbibformat{#2}
1160  \let\maybe\@gobble%
1161  \let\camelfill\relax%
1162  \let\camelarrow\relax%
1163 \ifx\@law@temp\@law@temptwo%
1164  \advance\@totalleftmargin -\labelsep%
1165  \advance\linewidth \labelsep%
1166  \def\@biblabel##1{}%
1167 \fi%
1168  \if@law@table%
1169  \if@law@usepages%
1170  \let\maybe\relax%
1171  \let\camelfill\dotfill%
1172  \let\camelarrow\rightarrow%
1173  \fi%
1174  \else%
1175  \longestlabelfor{#2}%
1176  \ifdim\lawlengthtwo=0pt%
1177  \advance\@totalleftmargin -\labelsep%
1178  \advance\linewidth \labelsep%
1179  \def\@biblabel##1{}%
1180  \fi%
1181  \fi%
1182  \if@law@requiresubjects%
1183  \@law@dobibliography{#2}%

1184  \else%
1185  \gdef\@law@temp{#2}\gdef\@law@temptwo{all}%
1186  \ifx\@law@temp\@law@temptwo%
1187  \@law@dobibliography{#2}%
1188  \else%
1189  \message{^^J===================================================^^J%
1190  Camel bibliography ^^J
1191  Document type: without-subjects ^^J
1192  Bibliography type: subject-specific (#2) ^^J
1193  Action: impossible task, ignoring ...^^J%
1194  ===================================================^^J}
1195  \fi%
1196  \fi%
1197 \endgroup}
1198 \def\@law@dobibliography#1{%
1199  \begin{thebibliography}{\if@law@biblabels\longestlabelfor{#1}\rule{\lawlengthtwo}{5pt}\fi}
1200  \if@law@table%
1201  \if@law@usepages%
1202  \addtolength{\parsep}{-.5\parsep}%
1203  \addtolength{\itemsep}{-.5\itemsep}%
1204  \fi%
1205  \fi%
1206  \if@law@requiresubjects%
1207  \@law@requiresubjectsfalse%
1208  \if@law@table
1209  \message{^^J===================================================^^J%
1210  Camel bibliography ^^J
1211  Document type: subject-classified cites ^^J
1212  Bibliography type: subject-specific external (#1) ^^J
1213  Action: generating^^J%
1214  ===================================================^^J}
1215  \@input{\jobname.\csname#1inputext\endcsname}
1216  \else%
1217  \gdef\@law@temp{#1}\gdef\@law@temptwo{all}%
1218  \ifx\@law@temp\@law@temptwo%
1219  \message{^^J===================================================^^J%
1220  Camel bibliography ^^J
1221  Document type: subject-classified cites ^^J
1222  Bibliography type: all citations ^^J
1223  Action: header only (not yet implemented)^^J%
1224  ===================================================^^J}
1225  \else%
1226  \message{^^J===================================================^^J%
1227  Camel bibliography ^^J
1228  Document type: subject-classified cites ^^J
1229  Bibliography type: subject-specific internal (#1) ^^J
1230  Action: generating^^J%
1231  ===================================================^^J}
1232  {\let\\\@law@bibslash%
1233  \csname @law@#1@citelist\endcsname}
1234  \fi%
1235  \fi%
1236  \else%

1237  \message{^^J===================================================^^J%
1238  Camel bibliography ^^J
1239  Document type: without-subjects ^^J
1240  Bibliography type: all citations ^^J
1241  Action: generating^^J%
1242  ===================================================^^J}
1243  {\let\\\@law@bibslash%
1244  \csname @law@#1@citelist\endcsname}%
1245  \fi%
1246  \end{thebibliography}}
1247 \def\@law@bibslash#1{\bibitem [\csname @law@#1@lab\endcsname] \source[b]{#1}. }

1248 ⟨/lexitex⟩

3.5.1 Citation style definitions

No styles are included here. See the separate style files in the Camel archive for the matching .bst, .cst and .cit files that make up each Camel style variation. These may be distributed as .doc files, and should be available on CTAN under

  /macros/latex/contrib/supported/camel.

3.6 Index styles

This code, and the table writing code, is provisional; this should be made more general. Less of a hack than the original LexITEX code, though!

1249 ⟨∗camelindex⟩

1250 actual '#'
1251 quote '!'
1252 level '>'
1253 preamble
1254 "\n"
1255 postamble
1256 "\n"
1257 item_0    "\n"
1258 item_x1   "\n \\subitem "
1259 item_x2   "\n \\subsubitem "
1260 delim_n "\$\\rightarrow\$"
1261 delim_0 "\~\\camelfill"
1262 delim_1 "\$\\camelarrow\$"
1263 % The next lines will produce some warnings when
1264 % running Makeindex as they try to cover two different
1265 % versions of the program:
1266 lethead_prefix   "{\\bf\\hfil "
1267 lethead_suffix   "\\hfil}\\nopagebreak\n"
1268 lethead_flag       1
1269 heading_prefix   "{\\bf\\hfil "
1270 heading_suffix   "\\hfil}\\nopagebreak\n"
1271 headings_flag       0
1272 \ifx\on@line\undefined
1273 \def\on@line{ on input line \the\inputlineno}
1274 \errhelp{Support for input line numbers has been added
1275  to latex.tex <dec91>.^^J^^J%
1276  Please update to a newer LaTeX release.}
1277 \errmessage{Obsolete LaTeX release (older than Dec.91)}

1278 \fi 1279 ⟨/camelindex⟩

4 A BibTEX Library

Considerable modification of an existing .bst file may be required to make it give output that can be digested by Camel. You may find that it is actually easier to draft you entry type functions from scratch, using the following library of BibTEX functions. See the file law.dtx for an example of entry types based on this library, and for an example of how to tie the library and your own functions together through a driver file entry. Each function defined using the FUNCTION operator is accompanied by a brief description of what it is intended to do, followed by a box in the following form:

Expected: 1. What the function expects to find on the stack, numbered from the top (most recently pushed) to the bottom item.

Left: 1. What the function will leave on the stack, numbered in the same fashion.

Toggles: 1. toggle name: What the effect of any toggles is on the

behaviour of the function.

Happy reading.

4.1 Hello!

As ever, we start by telling the world who we are.

1280 ⟨∗bstheader⟩

1281 FUNCTION { hello }

1282 {

1283 ⟨jse⟩"     ============================================"
1284 ⟨jse⟩"     for your Camel style and extract again."
1285 ⟨jse⟩"     with standard BibTeX, modify the .ins file"
1286 ⟨jse⟩"     Warning: localized for jBibTeX.  For use    "
1287 "     ============================================"
1288 "     bibliography package, version 1.0k or later"
1289 "     Use with LaTeX2e and the Camel prototype    "
1290 "     --------------------------------------------"
1291 "     documentation last updated: 5 December 1994 "
1292 "     code last updated: 22 March 1995            "
1293 "     version:           1.0i                     "
1294 "     Camel style package.                        "
1295 "     This is the `law' style for BibTeX and the  "
1296 "     ============================================"
1297 stack$

1298 } 1299 ⟨/bstheader⟩

4.2 Variable initializations

ENTRY This command takes three braced arguments, which in order are:

1. A list of field names; 2. A list of integer variables; and

3. A list of string variables.

The field names created here include some not found in the standard BibTEX styles. The use of both the standard and these new items is fully documented elsewhere, so no commentary is given here. Suffice to say that each item in the list creates a field that subsequent code can work on.

1300 ⟨∗bstlibrary⟩

1301 ENTRY
field names
1302 { address
1303 annote
1304 author
1305 booktitle
1306 chapter
1307 edition
1308 editor
1309 howpublished
1310 institution
1311 journal

1312 key

1313 month
1314 note
1315 number
1316 organization
1317 pages
1318 publisher
1319 school
1320 series
1321 title
1322 type
1323 volume
1324 year
1325 date
1326 jurisdiction
1327 court
1328 division
1329 divno
1330 casedate
1331 translator
1332 booktranslator
1333 cites
1334 units

1335 }

entry integers None are defined. Note that any integers or strings defined with the ENTRY command are created for each entry in the citation list.

1336 {}

entry strings There are no general string variables, either. Such variables might be defined for use in building key labels for use in sorting, or in an end-of-document bibliography style.

1337 { label extra.label sort.label }

STRINGS A few string macros are needed to hold things temporarily removed from the stack. BibTEX only allows ten such string variables; the named variables in this list will slowly be reduced in number through redesign of the functions that require them. Meanwhile, let’s hope we don’t find a sudden need for more …

1338 STRINGS { s t u v scrubdate
1339 volume.var year.var number.var journal.var pages.var }

INTEGERS The following list of integers is probably also larger than it needs to be. Again, optimization of stack usage will lead to the elimination of some of these variables.

1340 INTEGERS { itemcount date.specials charcount a b c
1341  nameptr namesleft numnames a.logical }

FUNCTIONS These functions provide strings used in the parsing of Japanese legal citations. If the language of such citations is not English, these strings may need to be edited.

1342 FUNCTION {dc..} {"District Court"}
1343 FUNCTION {sc..} {"Supreme Court"}

4.3 Function definitions

4.3.1 Logic and measurement

not These have been copied verbatim from Oren Patashnik’s 1988 release. His com-

and
or

mentary on these functions reads: 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.

Expected: 1. The result of a logical test 2. The result of a second logical test

Left: 1. A single logical test result

Toggles: 1. none

1344 FUNCTION {not}
1345 {   { #0 }
1346  { #1 }

1347 if$ 1348 }

1349 FUNCTION {and}
1350 {   'skip$
1351  { pop$ #0 }

1352 if$ 1353 }

1354 FUNCTION {or}
1355 {   { pop$ #1 }
1356  'skip$

1357 if$ 1358 }

times.ten One of the date calculation routines requires string-to-integer conversion. BibTEX primitives can only convert in this direction for single characters. Accordingly, we need to be able to raise by a power of ten.

Expected: 1. A single integer.

Left: 1. A single integer.

Toggles: 1. none

1359 FUNCTION {times.ten}
1360 { duplicate$ duplicate$ duplicate$ duplicate$ duplicate$
1361 duplicate$ duplicate$ duplicate$ duplicate$
1362 + + + + + + + + +

1363 }

character.length BibTEX provides a built-in command for measuring the length of a string in “text units”. Sometimes it’s nice to know the length of a string in characters; this function provides that facility.

Expected: 1. A string.

Left: 1. An integer giving the number of characters in the string.

Toggles: 1. none

1364 FUNCTION {character.length}
1365  { 'u :=
1366  #0 'charcount :=
1367  { u empty$ not }

1368 { u

1369 ⟨jse⟩  duplicate$

1370 ⟨eng⟩ #2

1371 ⟨jse⟩  is.kanji.str$ {#3} {#2} if$
1372  global.max$ substring$ 'u :=
1373  charcount #1 + 'charcount :=
1374  }while$
1375  charcount

1376 }

first.in.second This function checks for a substring at the beginning or at the end of a given string. This facility is needed, for example, to provide an automated means of toggling the formatting of the court division string for Japanese cases. In the defintion below, t is the substring length, and u is the string length.

Expected: 1. A string toggle. 2. A string (the string in which to look).

3. A string (the substring to look for).

Left: 1. A single integer (0 or 1), indicating whether the substring was found at the specified location in the string for search.

Toggles: 1. end: The function looks at the end of the given string. 2. start: The function looks at the start of the given string.

1377 FUNCTION {first.in.second}
1378  { 's :=
1379  duplicate$ empty$
1380  { pop$ pop$ #0 #0 }
1381  { swap$ duplicate$ character.length 'a :=
1382  swap$ duplicate$ character.length 'b :=

1383 b a <

1384  { pop$ pop$ #0 #0 }
1385  { s "end" =
1386  { b a - #1 + global.max$ substring$ =
1387  { b a - #1 + #1 }
1388  { #0 #0
1389  }if$

1390 }

1391  { s "start" =
1392  { #1 a substring$ =
1393  { #1 #1 }

1394 { #0

1395  }if$

1396 }

1397  { s "reverse" =
1398  { b a - #1 + 'b :=
1399  { b #0 > }
1400  { duplicate$
1401  b a substring$
1402  's :=
1403  swap$ duplicate$ s =
1404  { pop$ pop$ b #0 'b := #1 }
1405  { b #1 =
1406  { pop$ pop$ #0 #0 'b := #0 }
1407  { swap$ b #1 - 'b :=
1408  }if$
1409  }if$
1410  }while$

1411 }

1412  { b a - #1 + 'b := #1 'c :=
1413  { c b < }
1414  { duplicate$
1415  c a substring$
1416  's :=
1417  swap$ duplicate$ s =
1418  { pop$ pop$ c b 'c := #1 }
1419  { b c - #1 =
1420  { pop$ pop$ #0 b 'c := #0 }
1421  { swap$ c #1 + 'c :=
1422  }if$
1423  }if$
1424  }while$
1425  }if$
1426  }if$
1427  }if$
1428  }if$
1429  }if$

1430 }

get.character.type This function returns one of three strings, ‘letter’, ‘numeral’ or ‘other‘ to indicate the type of the character it finds on the stack. This was written for use in the gather.chars function, but may find other uses as well.

Expected: 1. Either * or a single character to be scanned for. 2. A single character to be examined by the function.

Left: 1. Either letter, numeral or other, the significance of which depends upon the toggle used.

Toggles: 1. * causes the character to be identified as a numeral, and letter

or something else.

2. Any character other than * causes that character to be identified as other, and any other characters to be identified

                     as letter.
1431 FUNCTION { get.character.type }
1432 { duplicate$ "*" =
1433  { pop$ duplicate$ empty$
1434  { pop$ "other" }
1435  { chr.to.int$ duplicate$
1436  duplicate$ #47 > swap$ #58 < and
1437  { pop$ "numeral" }
1438  { duplicate$ #64 > swap$ duplicate$ #91 < swap$
1439  duplicate$ #96 > swap$ #123 < and 'a.logical :=
1440  and a.logical or
1441  { "letter" }
1442  { "other"
1443  }if$
1444  }if$
1445  }if$

1446 } 1447 { =

1448  { "other" }
1449  { "letter"
1450  }if$
1451  }if$

1452 }

type.last.char This was written in order to handle situations where trailing punctuation varies depending upon whether the text being punctuated ends in a numeral or not. The power of the library is (finally, in July of 1995) starting to show through.

Expected: 1. A single string.

Left: 1. A string, either numeral, letter or other.

Toggles: 1. None.

1453 FUNCTION { type.last.char }
1454 { duplicate$ character.length
1455  #1 substring$
1456  "*" get.character.type

1457 }

4.3.2 Housekeeping

These functions are used to issue warning messages and avoid errors during processing.

empty.to.null This is simply the field.or.null function from the standard styles, renamed so that I could more easily remember what it does. Invoked only by the output routines, it assures that empty field markers are replaced with the null string, to prevent smash-ups.

Expected: 1. The contents of a field, which may be an empty field marker.

Left: 1. A string, possibly the null string.

Toggles: 1. none

1458 FUNCTION {empty.to.null}
1459 { duplicate$ empty$
1460  { pop$ "" }
1461  'skip$

1462 if$ 1463 }

check This check function isolates the production of warning messages from the output routines, to enhance transparency. Note that this will not convert an empty field marker to the null string; that is left to the output routines.

Expected: 1. A string for use in an error message. 2. The contents of a field.

Left: 1. The field contents.

Toggles: 1. none

1464 FUNCTION { check }
1465 { 't :=
1466 duplicate$ empty$
1467 { "empty " t * " in " * cite$ * warning$}
1468 'skip$

1469 if$ 1470 }

either.or This checks whether one of a two-item pair is empty. If at least one is empty, the other is returned to the stack. If both are non-empty, a warning is issued, and one item is arbitrarily selected.

Expected: 1. A string.
2. A string.

Left: 1. A single string.

Toggles: 1. none

1471 FUNCTION {either.or}
1472 { duplicate$ empty$
1473 { pop$ duplicate$ empty$
1474  { pop$ "" }
1475  'skip$

1476 if$ 1477 }

1478 { swap$ duplicate$ empty$
1479  { pop$ }
1480  { "both items in an either.or pair are non-empty in " cite$ *
1481  warning$

1482  "  I'm using only ONE of these items (the second passed by the function)."
1483  warning$
1484  pop$
1485  }if$
1486 }if$

1487 }

either.or.nowarning This does the same thing as either.or, but does not issue a warning if both items exist. As with that function, the second item pushed is preferred.

Expected: 1. A string.
2. A string.

Left: 1. A single string.

Toggles: 1. none

1488 FUNCTION {either.or.nowarning}
1489 { duplicate$ empty$
1490 { pop$ duplicate$ empty$
1491  { empty.to.null }
1492  'skip$

1493 if$ 1494 }

1495 { swap$ pop$ }

1496 if$ 1497 }

4.3.3 Output

In the interest of transparency, I have tried to make the output functions as simple to use and as flexible in their operation as possible. Every output routine expects to find three items on the stack, and the name of each routine describes how it will react to what it finds there. To keep things tidy, the empty field marker is replaced with the null string only by the output routines. The names are sometimes coincidentally comical, but I hope informative as well.

must.must.must The simplest output routine is the must.must.must routine; it simply catenates the three strings, replacing any empty field markers it finds with the null string.

Expected: 1. A string.
2. A string.
3. A string.
Left: 1. none
Toggles: 1. none

1498 FUNCTION {must.must.must}
1499  { empty.to.null 't :=
1500  empty.to.null swap$ empty.to.null swap$ t

1501 * *

1502  write$

1503 }

might.ifone.must This output routine is heavily used for conditional output. If the deepmost of the three stack items is an empty field marker, the only the topmost item is written to the output file. If this is not the case, then the three items are written in order.

Expected: 1. A string.
2. A string.
3. A string.
Left: 1. none
Toggles: 1. none

1504 FUNCTION {might.ifone.must}
1505  { empty.to.null 't :=
1506  swap$ duplicate$ empty$
1507  { pop$ pop$ t }
1508  { swap$ empty.to.null t * * }

1509 if$

1510  write$

1511 }

iftwo.might.iftwo This function is typically used to output a formatted item in enclosing braces, where the entire item and its braces should be suppressed if the item is empty.

Expected: 1. A string.
2. A string.
3. A string.
Left: 1. none
Toggles: 1. none

1512 FUNCTION {iftwo.might.iftwo}
1513  { 't :=
1514  duplicate$ empty$
1515  { pop$ pop$ }
1516  { empty.to.null swap$ empty.to.null swap$
1517  t empty.to.null
1518  * * write$ }

1519 if$ 1520 }

must.ifthree.might This function is used to output a definitely-existing item followed by something that might not exist with intervening punctuation that ought to disappear if it’s not needed.

Expected: 1. A string.
2. A string.
3. A string.
Left: 1. none
Toggles: 1. none

1521 FUNCTION {must.ifthree.might}
1522  { duplicate$ empty$
1523  { pop$ pop$ empty.to.null }
1524  { 't :=

1525  swap$ empty.to.null
1526  swap$ empty.to.null

1527 t * *

1528  }if$
1529  write$

1530 }

4.3.4 Parsing and conversion

field.tag.no.combine The no here stands for “number”. This function is typically used to simplify the task of building a numbered label for something (e.g. a technical report). It provides facilities for handling blank entries, so that these error-handling routines do not need to be drafted from scratch for every such situation.

Expected: 1. A string toggle. 2. An identifier (i.e. a report number).

3. A text prefix for the identifier.

4. A string label (i.e. “Technical Report” or somesuch).

Left: 1. A single string.

Toggles: 1. endlabel: Combines the text items in the same order in

which they are found.

2. frontlabel: Places the label in front, followed by the identifier, followed by the first item pushed.

1531 FUNCTION {field.tag.no.combine}
1532 { "endlabel" =
1533  { duplicate$ empty$
1534  { pop$ pop$ empty.to.null }
1535  { empty.to.null 's := empty.to.null
1536  swap$ empty.to.null swap$ s * *
1537  }if$

1538 }

1539  { duplicate$ empty$
1540  { pop$ pop$ empty.to.null }
1541  { empty.to.null 's := empty.to.null
1542  swap$ empty.to.null s swap$ * *
1543  }if$
1544  }if$

1545 }

change.letter.case This is a simple front-end to the change.case$ built-in function, used to change characters in a string from upper to lower case. It slightly enhances the built-in function by providing an option that leaves the string alone.

Expected: 1. A single character—either an n, a t, an l, or a u. 2. A string for conversion.

Left: 1. One string, converted according to the option toggle pushed after the string.

Toggles: 1. n: yields the string unchanged. 2. t: yields all lower case letters except for the first.

3. l: yields all lower case letters.

4. u: yields all upper case letters.

1546 FUNCTION {change.letter.case}
1547  { 't :=
1548  duplicate$ empty$
1549  'skip$
1550  { t chr.to.int$ "n" chr.to.int$ =
1551  'skip$
1552  { t change.case$ }

1553 if$ 1554 } 1555 if$ 1556 }

n.dashify The n.dashify function makes each single - in a string a double --. if it’s not already.^{18}

Expected: 1. A single string for conversion.

Left: 1. A single converted string.

Toggles: 1. none

1557 FUNCTION {n.dashify}
1558 { 't :=

1559 ""

1560  { t empty$ not }
1561  { t #1 #1 substring$ "-" =
1562  { t #1 #2 substring$ "--" = not
1563  { "--" *
1564  t #2 global.max$ substring$ 't :=

1565 }

1566  {   { t #1 #1 substring$ "-" = }
1567  { "-" *
1568  t #2 global.max$ substring$ 't :=

1569 }

1570  while$

1571 } 1572 if$ 1573 }

1574  { t #1 #1 substring$ *
1575  t #2 global.max$ substring$ 't :=

1576 } 1577 if$ 1578 }

18This comment by Oren Patashnik.

1579 while$

1580 }

gather.chars The following function was designed for date parsing, but may find other uses as well. It finds the first letter or numeral in a given string, then proceeds to build a substring until it hits a different character type or the end of the string, at which point it stops parsing and terminates.

Expected: 1. A string for parsing.

Left: 1. A string toggle showing the character type of the first

homogenous substring in the string for parsing.

2. A string of characters from the front of the given string which are letters or numbers only.

3. The remainder of the string.

Toggles: 1. none

1581 FUNCTION { gather.chars }

1582 {

1583  "forward" =
1584  { swap$ duplicate$ character.length 'a :=
1585  't :=
1586  duplicate$
1587  { t #1 #1 substring$ swap$ get.character.type
1588  "other" =
1589  t empty$ not and }
1590  { t #2 global.max$ substring$ 't := duplicate$
1591  }while$
1592  duplicate$ t #1 #1 substring$ swap$ get.character.type
1593  t #1 #1 substring$ swap$
1594  "" swap$ duplicate$ 'u :=
1595  t #2 global.max$ substring$ 't :=
1596  { u = }
1597  { * swap$
1598  u * 'u :=
1599  u #1 #1 substring$ swap$
1600  u #1 #1 substring$
1601  u #2 global.max$ substring$ 'u :=
1602  t #1 #1 substring$ swap$ get.character.type
1603  t #1 #1 substring$ swap$
1604  duplicate$ u =
1605  { t #2 global.max$ substring$ 't :=  }
1606  { swap$ pop$
1607  }if$
1608  }while$
1609  swap$ pop$ t swap$ u

1610 }

1611  { swap$ duplicate$ character.length 'a :=
1612  't :=
1613  duplicate$
1614  { t a #1 substring$ swap$ get.character.type
1615  "other" =
1616  t empty$ not and }
1617  { a #1 - 'a :=

1618  t #1 a substring$ 't :=
1619  }while$
1620  duplicate$ t a #1 substring$ swap$ get.character.type
1621  t a #1 substring$ swap$
1622  "" swap$ duplicate$ 'u :=
1623  a #1 - 'a :=
1624  t #1 a substring$ 't :=
1625  { u = }
1626  { swap$ * swap$
1627  u * 'u :=
1628  u #1 #1 substring$ swap$
1629  u #1 #1 substring$
1630  u #2 global.max$ substring$ 'u :=
1631  t a #1 substring$ swap$ get.character.type
1632  t a #1 substring$ swap$
1633  duplicate$ u =
1634  { a #1 - 'a := t #1 a substring$ 't :=  }
1635  { swap$ pop$
1636  }if$
1637  }while$
1638  swap$ pop$ t swap$ u
1639  }if$

1640 }

tie.or.space.connect We use this function from the standard styles. It adds a tie if the string it is applied to is three characters or less in length.

Expected: 1. A string

2. A second string

Left: 1. One string
Toggles: 1. none

1641 FUNCTION {tie.or.space.connect}
1642 { duplicate$ text.length$ #3 <
1643  { "~" }
1644  { " " }

1645 if$

1646 swap$ * *

1647 }

format.pages This function accepts one toggle option currently, but it is open to expansion. If the short toggle is fed to this function, it reads through the field until it hits a non-integer character. Otherwise, it n.dashifys the whole field. This needs robustification; the page number might be a roman numeral. Might it be simplest to just drop the scan when we hit a -? Deserves some thought.

Expected: 1. A toggle string. 2. page number or possibly a range of pages.

Left: 1. One string, constituting a finished page number, or empty$.

Toggles: 1. short: will return only the first number given in the string. 2. full: will return the page number, n-dashified.

1648 FUNCTION {format.pages}

1649  { swap$ duplicate$ empty$
1650  { pop$ pop$ "" }
1651  { swap$ duplicate$ "short" =
1652  { pop$
1653  's :=

1654 ""

1655  s #1 #1 substring$
1656  { "-" = not }
1657  { s #1 #1 substring$ *
1658  s #2 global.max$ substring$ 's :=
1659  s #1 #1 substring$
1660  duplicate$ "" =
1661  { pop$ "-" }
1662  'skip$

1663 if$ 1664 }

1665  while$

1666 }

1667  { "full" =
1668  { pages n.dashify }
1669  { "invalid switch fed to the format.pages function"
1670  warning$
1671  }if$
1672  }if$
1673  }if$

1674 }

Names The code for parsing and formatting names is extremely economical, thanks to the powerful built-in functions that BibTEX supplies for this purpose.

format.names This is based on Oren Patashnik’s original function of the same name. His comment was as follows:

The format.names function formats the argument (which should be in BibTEXname 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. The format.authors function returns the result of format.names(author) if the author is present, or else it returns the null string.

This function is used to format any name field that is thrown at it. It is based on the 1988 release, but with modifications to permit toggling, since the Blue Book requires different author formats for different types of material. The toggling strategy should also make modification of this style a pretty simple matter.

Expected: 1. The contents of one name field 2. string toggle (either firstinitial, lastonly or full)

Left: 1. A single string, containing a formatted name or names, or

                     empty$

Toggles: 1. firstinitial: Yields the form “F. Bennett, Jr.” 2. lastonly: Yields the form “Bennett”

3. full: yields “Frank Bennett, Jr.”

1675 FUNCTION {format.names}
1676  { swap$ duplicate$ empty$
1677  { swap$ pop$ }
1678  { 's :=
1679  'u :=
1680  #1 'nameptr :=
1681  s num.names$ 'numnames :=
1682  numnames 'namesleft :=
1683  { namesleft #0 > }
1684  { u "lastonly" =
1685  { s nameptr "{vv~}{ll}" format.name$ 't := }
1686  { u "firstinitial"  =
1687  { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
1688  { u "full" =
1689  { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=}
1690  { "style error; invalid or non-existent toggle" warning$ }

1691 if$ 1692 } 1693 if$ 1694 } 1695 if$

1696  nameptr #1 >
1697  { namesleft #1 >
1698  { ", " * t * }
1699  { numnames #2 >
1700  { "," * }
1701  'skip$

1702 if$

1703  t "others" =
1704  { " et~al." * }
1705  { " and " * t * }

1706 if$ 1707 } 1708 if$ 1709 } 1710 't 1711 if$

1712  nameptr #1 + 'nameptr :=
1713  namesleft #1 - 'namesleft :=

1714 }

1715  while$

1716 } 1717 if$ 1718 }

Dates The style code for parsing and formatting dates is much more complex than that for names. This is due to the need to build the necessary tools out of BibTEX primitives, since no built-in tools for this task are supplied. There are two date formatting routines below. The simpler of the two is format.month.year. This is basically just the function supplied with the standard BibTEX styles, under a new name. The LexiBib version of format.date is underpinned by a whole set of new functions, and allows great flexibility in the syntax for entering dates.

format.month.year Old format routine 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.^{19}

This is not changed over the format.date function in the original standard BibTEX styles. It is retained, although the distributed LexiBib styles won’t be making use of it.

Expected: 1. none

Left: 1. A single string.

Toggles: 1. none

1719 FUNCTION {format.month.year}
1720 { year empty$
1721  { month empty$
1722  { "" }
1723  { "there's a month but no year in " cite$ * warning$
1724  month

1725 } 1726 if$ 1727 }

1728  { month empty$
1729  'year
1730  { month " " * year * }

1731 if$ 1732 } 1733 if$ 1734 }

New date parsing routines The format.date function depends upon a number of supporting functions. Some of these are of general utility, and are presented above. Those presented here are specific to this particular function.

fillout.a.year This adds a leading 19 to a year entered in two-digit form.

Expected: 1. A single string.

Left: 1. A single string.

Toggles: 1. none

1735 FUNCTION {fillout.a.year}
1736 { duplicate$ character.length #2 =
1737 { "19" swap$ * }
1738 'skip$

19This comment by Oren Patashnik.

1739 if$ 1740 }

parse.month This function is a simple parser, used in converting database entries that have been identified as probable abbreviated month entries into numerical string form.

Expected: 1. A single string, which should consist of exactly three alphabetic characters.

Left: 1. A single string of numbers.

Toggles: 1. none

1741 FUNCTION {parse.month}
1742 { duplicate$ "jan" =
1743 { pop$ "1" }
1744 { duplicate$ "feb" =
1745  { pop$ "2" }
1746  { duplicate$ "mar" =
1747  { pop$ "3" }
1748  { duplicate$ "apr" =
1749  { pop$ "4" }
1750  { duplicate$ "may" =
1751  { pop$ "5" }
1752  { duplicate$ "jun" =
1753  { pop$ "6" }
1754  { duplicate$ "jul" =
1755  { pop$ "7" }
1756  { duplicate$ "aug" =
1757  { pop$ "8" }
1758  { duplicate$ "sep" =
1759  { pop$ "9" }
1760  { duplicate$ "oct" =
1761  { pop$ "10" }
1762  { duplicate$ "nov" =
1763  { pop$ "11" }
1764  { duplicate$ "dec" =
1765  { pop$ "12" }
1766  { "invalid month in " cite$ * warning$
1767  "passing text to Camel verbatim" warning$
1768  "t" 'scrubdate :=
1769  }if$
1770  }if$
1771  }if$
1772  }if$
1773  }if$
1774  }if$
1775  }if$
1776  }if$
1777  }if$
1778  }if$
1779  }if$
1780 }if$

1781 }

format.month.name This takes a numerical string and converts it to either an abbrviated or a spelled-out month name.

Expected: 1. A toggle string. 2. A numerical string.

Left: 1. A string.

Toggles: 1. long: The month name placed on the stack will be spelled out. 2. short: The month name will be abbreviated.

1782 FUNCTION { format.month.name }
1783 { swap$ duplicate$ empty$
1784 { pop$ pop$ "" }
1785 { swap$ "long" =
1786  { duplicate$ "1" =
1787  { "January" }
1788  { duplicate$  "2" =
1789  { "February" }
1790  { duplicate$  "3" =
1791  { "March" }
1792  { duplicate$ "4" =
1793  { "April" }
1794  { duplicate$  "5" =
1795  { "May" }
1796  { duplicate$ "6" =
1797  { "June" }
1798  { duplicate$  "7" =
1799  { "July" }
1800  { duplicate$  "8" =
1801  { "August" }
1802  { duplicate$  "9" =
1803  { "September" }
1804  { duplicate$  "10" =
1805  { "October" }
1806  { duplicate$  "11" =
1807  { "November" }
1808  { duplicate$  "12" =
1809  { "December" }
1810  { "invalid month in " cite$ * warning$ ""
1811  "passing text to Camel verbatim" warning$
1812  "t" 'scrubdate :=
1813  }if$
1814  }if$
1815  }if$
1816  }if$
1817  }if$
1818  }if$
1819  }if$
1820  }if$
1821  }if$
1822  }if$
1823  }if$
1824  }if$

1825 }

1826  { duplicate$ "1" =

1827  { "Jan." }
1828  { duplicate$  "2" =
1829  { "Feb." }
1830  { duplicate$  "3" =
1831  { "Mar." }
1832  { duplicate$ "4" =
1833  { "Apr." }
1834  { duplicate$  "5" =
1835  { "May" }
1836  { duplicate$ "6" =
1837  { "Jun." }
1838  { duplicate$  "7" =
1839  { "Jul." }
1840  { duplicate$  "8" =
1841  { "Aug." }
1842  { duplicate$  "9" =
1843  { "Sept." }
1844  { duplicate$  "10" =
1845  { "Oct." }
1846  { duplicate$  "11" =
1847  { "Nov." }
1848  { duplicate$  "12" =
1849  { "Dec." }

1850 { ""

1851  }if$
1852  }if$
1853  }if$
1854  }if$
1855  }if$
1856  }if$
1857  }if$
1858  }if$
1859  }if$
1860  }if$
1861  }if$
1862  }if$
1863  }if$
1864 swap$ pop$
1865 }if$

1866 }

extract.date This function takes a labelled stack of numeric items, and places its contents in a formatted string on the stack. It is a subroutine called by format.date, and is not intended for use directly in entry type functions.

The behaviour of this function is a little too complex to describe its input and output behaviour using our usual description box, so we revert to prose here. The expectation of what will appear on the stack depends on the contents of the integer variable itemcount. For each date item counted, the function expects to find two items on the stack: a string possibly flagging the variable into which the item should be placed; and a numerical string.

If itemcount is 0, we check to see whether the streamlined format for parallel citations has been used. If not, a warning of an empty date is issued.

If itemcount is 1, the flag string is ignored, and the numerical item is assumed to be a year.

If itemcount is 2, the flag strings are both ignored, and the numerical items are assumed to be a year and a month, in that order.

If itemcount is 3, the first item is assumed to be a year. The assignment of the second two items depends first upon the contents of the integer variable date.specials. If this is 0, then the flags are ignored, and the numerical items are assumed to be a day and a month, in that order. If date.specials is 1 (‘true’), then the flag of the first item is checked to see whether it is “month”. If so, the first item is assigned to the themonth variable, and the next to the theday variable. Otherwise the assignments are reversed.

1867 FUNCTION {extract.date}
1868  { 'v := "" 's := "" 't := "" 'u :=
1869  itemcount #0 =
1870  { cites empty$
1871  { "some date or other is COMPLETELY empty in " cite$ *
1872  warning$ }
1873  'skip$

1874 if$ 1875 }

1876  { itemcount #1 =
1877  { pop$ fillout.a.year 's := "" 'u := "" 't := }
1878  { itemcount #2 =
1879  { pop$ swap$ pop$ swap$ duplicate$ character.length #4 =
1880  { swap$ "--" swap$ * * 's := "" 't := }
1881  { swap$ fillout.a.year 's := 't :=
1882  }if$
1883  "" 'u :=

1884 }

1885  { itemcount #3 =
1886  { date.specials
1887  { pop$ fillout.a.year 's :=
1888  "month" =
1889  { 't :=
1890  pop$ 'u := }
1891  { 'u :=
1892  pop$ 't :=
1893  }if$

1894 }

1895  { pop$ fillout.a.year 's :=
1896  pop$ 'u :=
1897  pop$ 't :=
1898  }if$

1899 }

1900  { "too many items for date in " cite$ * warning$
1901  }if$
1902  }if$
1903  }if$
1904  }if$
1905  v duplicate$ "month.dd.yy" =
1906  { pop$ s ", " u "\ " t "long" format.month.name }
1907  { duplicate$ "dd.month.yy" =
1908  { pop$ s "\ " t "long" format.month.name "\ " u }
1909  { duplicate$ "mo.dd.yy" =
1910  { pop$ s ", " u "\ " t "short" format.month.name }

1911  { duplicate$ "dd.mo.yy" =
1912  { pop$ s "\ " t "short" format.month.name "\ " u }
1913  { duplicate$ "dd.mm.yy" =
1914  { pop$ s "/" t "/" u }
1915  { duplicate$ "mm.dd.yy" =
1916  { s "/" u "/" t }
1917  { "yy" =
1918  { "" "" "" "" s }
1919  { "invalid date toggle in style file" warning$
1920  }if$
1921  }if$
1922  }if$
1923  }if$
1924  }if$
1925  }if$
1926  }if$
1927  "" 'v :=
1928  duplicate$ empty$
1929  { pop$ pop$ }
1930  { swap$ * 'v := }

1931 if$

1932  duplicate$ empty$
1933  { pop$ pop$ }
1934  { swap$ * v swap$ *  'v := }

1935 if$

1936  duplicate$ empty$
1937  { pop$ v }
1938  { v swap$ * }

1939 if$ 1940 }

topup.date This is used to perform an addition operation on a string of numerals.

Expected: 1. An integer to be added. 2. A string consisting of numerals only.

Left: 1. A string consisting of the sum of the integer and the numeric string.

Toggles: 1. none

1941 FUNCTION {topup.date}
1942 { 'a :=
1943 duplicate$ character.length #2 =
1944 { duplicate$ #1 #1 substring$ chr.to.int$ #48 -
1945  times.ten swap$ #2 #1 substring$ chr.to.int$ #48 -

1946 + 1947 }

1948 { duplicate$ character.length #1 =
1949  { chr.to.int$ #48 - }
1950  { pop$ #0 "I can't cope with more than two Japanese year digits in "
1951  cite$ * warning$
1952  }if$
1953 }if$
1954 a + int.to.str$

1955 }

format.jdate This rather specialized function converts a Japanese Imperial date written in a fixed syntax into the LexiBib internal date stack, for onward handling by

  extract.date.

Expected: 1. A string in the form: s57.9.27, where the first letter indicates the Imperial reign of the year given, the first numeric item is the year, the second the month, and the third the day. Any non-alphabetic, non-numeric character may be used as a separator.

Left: 1. itemcount is set to 2 (one more is added by the format.date

function in which is function is nested).

2. Six stack items are output—see extract.date for details on stack syntax.

Toggles: 1. none

1956 FUNCTION {format.jdate}
1957 { duplicate$ #2 global.max$ substring$ "*" "forward" gather.chars
1958 pop$ 't := swap$
1959 #1 #1 substring$ duplicate$ "s" =
1960 { pop$ t #1925 topup.date }
1961 { duplicate$ "m" =
1962  { pop$ t #1867 topup.date }
1963  { duplicate$ "t" =
1964  { pop$ t #1911 topup.date }
1965  { "h" =
1966  { t #1988 topup.date }
1967  { "invalid Imperial calendar code in " cite$ * warning$
1968  }if$
1969  }if$
1970  }if$
1971 }if$
1972 swap$
1973 "*" "forward" gather.chars
1974 pop$ swap$
1975 "*" "forward" gather.chars
1976 pop$ swap$ pop$ 't := swap$ "default" swap$ t swap$ "default"
1977 swap$ "default"
1978 #2 'itemcount :=

1979 }

format.date This function makes use of gather.chars and other supporting functions to build a stack of date items, which it then parses using extract.date. The syntax for entering dates is described in the user guide.

Expected: 1. A single string in appropriate date syntax.

Left: 1. none
Toggles: 1. none

1980 FUNCTION {format.date}
1981 { 'v :=
1982  empty.to.null 's :=
1983  #0 'charcount :=
1984  #0 'itemcount :=

1985  #0 'date.specials :=
1986  { s empty$ not }
1987  { s "*" "forward" gather.chars
1988  duplicate$ "letter" =
1989  { pop$ duplicate$ character.length #1 = itemcount not and
1990  { pop$ pop$ s format.jdate "" 's := }
1991  { duplicate$ character.length #3 =
1992  { swap$ 's :=
1993  parse.month "month" #1 'date.specials := }
1994  { swap$ 's :=
1995  pop$ "1" "invalid date in " cite$ * warning$
1996  "passing text to Camel verbatim" warning$
1997  "t" 'scrubdate :=
1998  "default"
1999  }if$
2000  }if$

2001 }

2002  { "numeral" =
2003  { duplicate$ character.length #1 =
2004  { swap$ 's := "default" }
2005  { duplicate$ character.length #2 =
2006  { swap$ 's := "default" }
2007  { duplicate$ character.length #4 =
2008  { swap$ 's := "default" }
2009  { swap$ 's := pop$ "1"
2010  "invalid numerical element in date for " cite$ * warning$
2011  "passing text to Camel verbatim" warning$
2012  "t" 'scrubdate :=
2013  "default"
2014  }if$
2015  }if$
2016  }if$

2017 }

2018  { swap$ 's := pop$ "1"
2019  "failed to parse date in " cite$ * warning$
2020  "default"
2021  }if$
2022  }if$
2023  itemcount #1 + 'itemcount :=
2024  }while$
2025  v extract.date
2026  scrubdate "t" =
2027  { pop$ year empty.to.null }
2028  'skip$

2029 if$ 2030 }

Anyways, here’s that line noise. Extracts cite info to variables from a parseable string on the stack. Syntax is:

year volume  /  number journal name pages (year)

       ^^^^^^^

OPT OPT OPT OPT  REQ  OPT OPT

You can give a volume without a number (i.e. the backslash and trailing number can be left out).

2031 FUNCTION {parse.one.cite}
2032 { duplicate$ "=" = not
2033 { "=" "forward" gather.chars pop$
2034  duplicate$ "[" swap$ "forward" first.in.second
2035  { swap$ duplicate$ "]" swap$ "forward" first.in.second
2036  { "" 'volume.var :=
2037  'b := swap$ 'a := a b <
2038  { duplicate$ a #1 + b a #1 + - substring$
2039  'year.var :=
2040  b #1 + global.max$ substring$
2041  " " "forward" gather.chars pop$
2042  duplicate$ "*" "forward" gather.chars
2043  "numeral" =
2044  { swap$ duplicate$ empty$
2045  { pop$ pop$ 'number.var := }
2046  { pop$ pop$ swap$ * "" 'number.var :=
2047  }if$

2048 }

2049  { pop$ pop$ " " swap$ * swap$ * "" 'number.var :=
2050  }if$

2051 }

2052  { "Weird syntax error in " cite$ * warning$
2053  }if$

2054 }

2055  { "Opening [ without closing ] in " cite$ * warning$
2056  }if$

2057 }

2058  { pop$ duplicate$ ")" swap$ "reverse" first.in.second
2059  { swap$ duplicate$ "(" swap$ "reverse" first.in.second
2060  { 'a := swap$ 'b := a b <
2061  { duplicate$ a #1 + b a #1 + - substring$
2062  'year.var :=
2063  #1 a #1 - substring$
2064  " " "forward" gather.chars pop$
2065  duplicate$ "/" swap$ "forward" first.in.second
2066  { pop$ "/" "forward" gather.chars pop$
2067  swap$ duplicate$ empty$
2068  { pop$ "" 'number.var := }
2069  { #2 global.max$ substring$
2070  'number.var :=
2071  }if$

2072 }

2073  { pop$ "" 'number.var :=
2074  }if$
2075  duplicate$ empty$
2076  { pop$ "" 'volume.var := }
2077  { duplicate$ "*" "forward" gather.chars
2078  "numeral" =
2079  { swap$ duplicate$ empty$
2080  { pop$ pop$ 'volume.var := }
2081  { pop$ pop$ swap$ * "" 'volume.var :=
2082  }if$

2083 }

2084  { pop$ pop$ " " swap$ * swap$ * "" 'volume.var :=

2085  }if$
2086  }if$

2087 }

2088  { "Weird syntax error in " cite$ * warning$
2089  }if$

2090 }

2091  { "Closing ) without opening ( in " cite$ * warning$
2092  }if$

2093 }

2094  { pop$ "No recognizable date in string in " cite$ * warning$
2095  }if$
2096  }if$
2097  " " swap$ * " " "reverse" gather.chars pop$
2098  duplicate$ "*" "forward" gather.chars
2099  "numeral" =
2100  { swap$ duplicate$ empty$
2101  { pop$ pop$ 'pages.var := }
2102  { pop$ pop$ swap$ * "" 'pages.var :=
2103  }if$

2104 }

2105  { pop$ pop$ swap$ * "" 'pages.var :=
2106  }if$
2107 duplicate$ empty$
2108 { 'journal.var := }
2109 { duplicate$ character.length #2 -
2110  #3 swap$ substring$ 'journal.var :=
2111 }if$

2112 }

2113 'skip$

2114 if$ 2115 } 2116 ⟨/bstlibrary⟩

2117 ⟨∗bsttrailer⟩

2118 FUNCTION {sortify}
2119 { purify$
2120 "l" change.case$

2121 }

2122

2123 INTEGERS { len }

2124

2125 FUNCTION {chop.word}
2126 { 's :=
2127 'len :=
2128 s #1 len substring$ =
2129  { s len #1 + global.max$ substring$ }

2130 's 2131 if$ 2132 }

2133

2134 INTEGERS { et.al.char.used }

2135

2136 FUNCTION {initialize.et.al.char.used}
2137 { #0 'et.al.char.used :=

2138 }

2140 EXECUTE {initialize.et.al.char.used}

2141

2142 FUNCTION {format.lab.names}
2143 { 's :=
2144 s num.names$ 'numnames :=
2145 numnames #1 >
2146  { numnames #4 >
2147  { #3 'namesleft := }
2148  { numnames 'namesleft := }

2149 if$

2150  #1 'nameptr :=

2151 ""

2152  { namesleft #0 > }
2153  { nameptr numnames =
2154  { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
2155  { "{\etalchar{+}}" *
2156  #1 'et.al.char.used :=

2157 }

2158  { s nameptr "{v{}}{l{}}" format.name$ * }

2159 if$ 2160 }

2161  { s nameptr "{v{}}{l{}}" format.name$ * }

2162 if$

2163  nameptr #1 + 'nameptr :=
2164  namesleft #1 - 'namesleft :=

2165 }

2166  while$
2167  numnames #4 >
2168  { "{\etalchar{+}}" *
2169  #1 'et.al.char.used :=

2170 }

2171  'skip$

2172 if$ 2173 }

2174  { s #1 "{v{}}{l{}}" format.name$
2175  duplicate$ text.length$ #2 <
2176  { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
2177  'skip$

2178 if$ 2179 } 2180 if$ 2181 }

2182

2183 FUNCTION {author.key.label}
2184 { author empty$
2185  { key empty$
2186  { cite$ #1 #3 substring$ }
2187  { key #3 text.prefix$ }

2188 if$ 2189 }

2190  { author format.lab.names }

2191 if$ 2192 }

2194 FUNCTION {author.editor.key.label}
2195 { author empty$
2196  { editor empty$
2197  { key empty$
2198  { cite$ #1 #3 substring$ }
2199  { key #3 text.prefix$ }

2200 if$ 2201 }

2202  { editor format.lab.names }

2203 if$ 2204 }

2205  { author format.lab.names }

2206 if$ 2207 }

2208

2209 FUNCTION {author.key.organization.label}
2210 { author empty$
2211  { key empty$
2212  { organization empty$
2213  { cite$ #1 #3 substring$ }
2214  { "The " #4 organization chop.word #3 text.prefix$ }

2215 if$ 2216 }

2217  { key #3 text.prefix$ }

2218 if$ 2219 }

2220  { author format.lab.names }

2221 if$ 2222 }

2223

2224 FUNCTION {editor.key.organization.label}
2225 { editor empty$
2226  { key empty$
2227  { organization empty$
2228  { cite$ #1 #3 substring$ }
2229  { "The " #4 organization chop.word #3 text.prefix$ }

2230 if$ 2231 }

2232  { key #3 text.prefix$ }

2233 if$ 2234 }

2235  { editor format.lab.names }

2236 if$ 2237 }

2238

2239 FUNCTION {calc.label}
2240 { type$ "book" =
2241 type$ "inbook" =

2242 or

2243  'author.editor.key.label
2244  { type$ "proceedings" =
2245  'editor.key.organization.label
2246  { type$ "manual" =

2247  'author.key.organization.label
2248  'author.key.label

2249 if$ 2250 } 2251 if$ 2252 } 2253 if$

2254 duplicate$
2255 year "yy" format.date purify$ #-1 #2 substring$

2256 *

2257 'label :=
2258 year "yy" format.date purify$ #-1 #4 substring$

2259 *

2260 sortify 'sort.label :=

2261 }

2262

2263 FUNCTION {sort.format.names}
2264 { 's :=
2265 #1 'nameptr :=

2266 ""

2267 s num.names$ 'numnames :=
2268 numnames 'namesleft :=
2269  { namesleft #0 > }
2270  { nameptr #1 >
2271  { "   " * }
2272  'skip$

2273 if$

2274  s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
2275  nameptr numnames = t "others" = and
2276  { "et al" * }
2277  { t sortify * }

2278 if$

2279  nameptr #1 + 'nameptr :=
2280  namesleft #1 - 'namesleft :=

2281 }

2282 while$

2283 }

2284

2285 FUNCTION {sort.format.title}
2286 { 't :=
2287 "A " #2
2288  "An " #3
2289  "The " #4 t chop.word
2290  chop.word
2291 chop.word
2292 sortify
2293 #1 global.max$ substring$

2294 }

2295

2296 FUNCTION {author.sort}
2297 { author empty$
2298  { key empty$
2299  { "to sort, need author or key in " cite$ * warning$

2300 ""

2302  { key sortify }

2303 if$ 2304 }

2305  { author sort.format.names }

2306 if$ 2307 }

2308

2309 FUNCTION {case.sort}
2310 { title empty$
2311  { key empty$
2312  { "to sort, need title or key in " cite$ * warning$

2313 "" 2314 }

2315  { key sortify }

2316 if$ 2317 }

2318  { title sort.format.title }

2319 if$ 2320 }

2321

2322 FUNCTION {author.editor.sort}
2323 { author empty$
2324  { editor empty$
2325  { key empty$
2326  { "to sort, need author, editor, or key in " cite$ * warning$

2327 "" 2328 }

2329  { key sortify }

2330 if$ 2331 }

2332  { editor sort.format.names }

2333 if$ 2334 }

2335  { author sort.format.names }

2336 if$ 2337 }

2338

2339 FUNCTION {author.organization.sort}
2340 { author empty$
2341  { organization empty$
2342  { key empty$
2343  { "to sort, need author, organization, or key in " cite$ * warning$

2344 "" 2345 }

2346  { key sortify }

2347 if$ 2348 }

2349  { "The " #4 organization chop.word sortify }

2350 if$ 2351 }

2352  { author sort.format.names }

2353 if$ 2354 }

2356 FUNCTION {editor.organization.sort}
2357 { editor empty$
2358  { organization empty$
2359  { key empty$
2360  { "to sort, need editor, organization, or key in " cite$ * warning$

2361 "" 2362 }

2363  { key sortify }

2364 if$ 2365 }

2366  { "The " #4 organization chop.word sortify }

2367 if$ 2368 }

2369  { editor sort.format.names }

2370 if$ 2371 }

2372

2373 FUNCTION {presort}
2374 { type$ "book" =
2375 type$ "inbook" =

2376 or

2377  'author.editor.sort
2378  { type$ "proceedings" =
2379  'editor.organization.sort
2380  { type$ "manual" =
2381  'author.organization.sort
2382  { type$ "case" =
2383  'case.sort
2384  { type$ "statute" =
2385  'case.sort
2386  'author.sort

2387 if$ 2388 } 2389 if$ 2390 } 2391 if$ 2392 } 2393 if$ 2394 } 2395 if$ 2396 " " 2397 *

2398 year "yy" format.date sortify

2399 * 2400 " " 2401 *

2402 title empty.to.null
2403 sort.format.title

2404 *

2405 #1 entry.max$ substring$
2406 'sort.key$ :=

2407 }

2408

2409 ITERATE {presort}

2410

2411 SORT

2412

2413 FUNCTION {begin.bib}
2414 { et.al.char.used
2415  { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
2416  'skip$

2417 if$

2418 preamble$ empty$
2419  'skip$
2420  { preamble$ write$ newline$ }

2421 if$ 2422 }

2423

2424 EXECUTE {begin.bib}

2425

2426 ITERATE {call.type$}

2427 ⟨/bsttrailer⟩

5 A .bib file

2428 ⟨∗bib⟩

2429 @string{asr..="Am.~Soc.\ Rev."}
2430 @book{bluebook,
2431 title = {A Uniform System of Citation},
2432 edition = {19th},
2433 year = 1989

2434 }

2435 @book{knuth,
2436 title = {The {\TeX} book},
2437 year = 1990,
2438 author = {D.E. Knuth}

2439 }

2440 @book{leunen,
2441 author = {M.-C. van Leunen},
2442 title = {A Handbook for Scholars},
2443 year = 1979

2444 }

2445 @book{latex-book,
2446 title = {\LaTeX: a document preparation system},
2447 year = 1994,
2448 author = {Leslie Lamport}

2449 }

2450 @inbook{companion-bibs,
2451 title = {Bibliography Generation},
2452 chapter = 13,
2453 pages = {371},
2454 crossref = {latex-companion}

2455 }

2456 @book{latex-companion,
2457 author = {M. Goosens and Frank Mittelbach and A. Samarin},
2458 title = {The \LaTeX\ Companion},

2459 booktitle = {The \LaTeX\ Companion},
2460 year = 1994

2461 }

2462 @techreport{oren-user,
2463 author = {Oren Patashnik},
2464 title = {\BibTeX ing},
2465 year = 1988,
2466 type = {CTAN document}

2467 }

2468 @techreport{oren-hackers,
2469 author = {Oren Patashnik},
2470 title = {Designing \BibTeX\ Styles},
2471 type = {CTAN document},
2472 year = 1988

2473 }

2474 @book{maki-constitution,
2475 author = {Maki, John McGilvrey},
2476 title = {Court and Constitution in Japan: Selected Supreme Court Decisions,
2477  1948-1960},
2478 publisher = {Washington University Press},
2479 year = 1964

2480 }

2481 @booklet{sansom-constitution,
2482 author = {Sansom, {Sir} George Bailey},
2483 title = {The First Japanese Constitution: A Lecture},
2484 note = {delivered before the
2485  Asiatic Society of Japan},
2486 year = 1938

2487 }

2488 @article{macauley,
2489 author = {Stuart Macauley},
2490 title = {Non-Contractual Relations
2491 in Business: A Preliminary Study},
2492 volume = {28},
2493 journal = asr..,
2494 pages = {55},
2495 year = {1963}

2496 }

2497 @mastersthesis{homma-derivative,
2498 title = {The Derivative Suit under Japanese Law as a Measure of
2499  Corporate Governance},
2500 author = {Masahiro Homma},
2501 institution = {School of Oriental and African Studies},
2502 type = {LL.M. thesis},
2503 year = {1994}

2504 }

2505 @case{bradshaw-v-us,
2506 title = {Bradshaw v United States},
2507 cites = {231 Ct.Cl. 144 (1982) = 683 F.2d 365 (1982)}

2508 }

2509 @incollection{haley-land-lease,
2510 title = {Japan's New Land and House Lease Law},
2511 author = {John Owen Haley},
2512 crossref = {policy-failure},

2513 pages = 149,

2514 }

2515 @book{policy-failure,
2516 title = {Land Issues in Japan: A Policy Failure?},
2517 booktitle = {Land Issues in Japan: A Policy Failure?},
2518 year = 1992

2519 }

2520 @article{appleyard-heed,
2521 author = {Bryan Appleyard},
2522 title = {Why Major should heed the press},
2523 pages = 21,
2524 journal = {The Independent},
2525 year = {7 jul 1995},
2526 place = {London}

2527 }

2528 @statute{sga,
2529 title = {Sale of Goods Act},
2530 year = {1979},
2531 jurisdiction = {england}

2532 }

2533 @case{heap,
2534 title = {Heap v Motorists' Advisory Agency Ltd},
2535 year = 1923,
2536 journal = {KB},
2537 number = 1,
2538 pages = 577

2539 }

2540 @case{halsall-v-brizell,
2541 title = {Halsall v Brizell},
2542 cites = {[1957] Ch 169 = [1957] 1 All ER 371}

2543 } 2544 ⟨/bib⟩

6 The Driver File

2545 ⟨∗installer⟩

2546 \def\batchfile{camel.ins}
2547 \input docstrip.tex
2548 \preamble

2549

2550 Copyright (C) 1992--95 Frank Bennett, Jr.
2551 All rights reserved.

2552

2553 This file is part of the Camel package.
2554 \endpreamble

2555

2556 \def\batchfile{camel.dst}      % ignored in distribution
2557 \input docstrip.tex              % ignored in distribution

2558

2559 \Ask\answer{%
2560  **************************************************************
2561 ^^J*                       PLEASE NOTE
2562 ^^J*
2563 ^^J* Camel requires a large BibTeX, with a wizard-defined

2564 ^^J* function space of over 6,000.  The function space in
2565 ^^J* standard BibTeX is only 3,000, so if your BibTeX has never
2566 ^^J* been enlarged, it will probably need to be recompiled.
2567 ^^J*
2568 ^^J* If this seems terribly cryptic, just go ahead and give
2569 ^^J* it a go.  Feel free to write me on fb@soas.ac.uk if you
2570 ^^J* have problems.
2571 ^^J*
2572 ^^J* In addition to camel.dtx, you will also need the keyval
2573 ^^J* and overword packages, also available from CTAN.  You
2574 ^^J* should have an up-to-date copy of index.dtx as well.
2575 ^^J*
2576 ^^J* Also, to print the .dtx files in the Camel bundle, you
2577 ^^J* should use the usual gind.ist file for making the indexes;
2578 ^^J* camel.ist is used for special purposes outlined in the
2579 ^^J* manual.
2580 ^^J*
2581 ^^J* Shall I unpack my things?
2582 ^^J*
2583 ^^J* If you want me to go ahead, answer `y' below, otherwise `n'.
2584 ^^J*
2585 ^^J**************************************************************}

2586

2587 \keepsilent

2588

2589 \preamble

2590

2591 This file is part of the Camel package.
2592 ---------------------------------------
2593 This is a generated file.

2594

2595 IMPORTANT NOTICE:

2596

2597 You are not allowed to change this file.  You may however copy
2598 this file to a file with a different name and then change the
2599 copy if (a) you do not charge for the modified code, (b) you
2600 acknowledge Camel and its author(s) in the new file, if it
2601 is distributed to others, and (c) you attach these same
2602 conditions to the new file.

2603

2604 The above conditions do not apply to the demonstration
2605 file test.tex.

2606

2607 You are not allowed to distribute this file alone.  You are not
2608 allowed to take money for the distribution or use of this file
2609 (or a changed version) except for a nominal charge for copying
2610 etc.

2611

2612 You are allowed to distribute this file under the condition that
2613 it is distributed with all of its contents, intact.

2614

2615 For error reports, or offers to help make Camel a more powerful,
2616 friendlier, and better package, please contact me on
2617 `fb' at soas.ac.uk

2619 \endpreamble

2620 2621

2622 {\ifx\answer\y

2623

2624 \generate{\file{camel.sty} {\from{camel.dtx}{lexitex}}
2625  \file{camel.ist} {\from{camel.dtx}{camelindex}}
2626  \file{camel.bib} {\from{camel.dtx}{bib}}
2627  \file{test.tex}  {\from{camel.dtx}{testtex}}}

2628

2629 \fi}

2630

2631 \keepsilent

2632 2633

2634 \ifToplevel{
2635 \Msg{***********************************************************}
2636 \Msg{*}
2637 \Msg{* To finish the installation, you have to move the following}
2638 \Msg{* file into a directory searched by TeX:}
2639 \Msg{*}
2640 \Msg{* \space\space camel.sty}
2641 \Msg{*}
2642 \Msg{* You also need to move the following file into a directory}
2643 \Msg{* searched by makeindex:}
2644 \Msg{*}
2645 \Msg{* \space\space camel.ist}
2646 \Msg{*}
2647 \Msg{* Note that Camel does not work by itself; style modules}
2648 \Msg{* (such as law.dtx) are supplied separately.  They can}
2649 \Msg{* be found on CTAN in the Camel subdirectory.}
2650 \Msg{*}
2651 \Msg{***********************************************************}

2652 } 2653 ⟨/installer⟩

2654 ⟨∗testtex⟩

2655 \documentclass{article}
2656 \usepackage{camel}

2657

2658 ⟨+testtex⟩%\citationsubject[o=sta,i=stb]{statutes}{Statutory Materials}
2659 ⟨+testtex⟩%\citationsubject[o=sec,i=seb]{second}{Secondary Literature}
2660 ⟨+testtex⟩%\citationsubject[o=cas,i=cab]{case}{Cases}

2661

2662 \begin{document}
2663 \citationstyle{law}
2664 \citationdata{camel}

2665

2666 \section*{{\sc Camel} tests and examples\footnotemark{}{} }
2667 \footnotetext{Note that, in addition to admiring the examples in
2668 this document, you can tinker with it to produce different
2669 kinds of bibliographies.  See the comments in the file for
2670 suggestions.}

2671

2673 We currently have support for articles (including newspaper
2674 articles), items in collections of
2675 essays, books, sections of books, ephemeral booklets, masters theses,
2676 Commonwealth, US and Japanese cases, and statutes from a few
2677 jurisdictions.  An example of each is given below, first without,
2678 then with a pinpoint.  This does not give a complete picture of
2679 the `formatting tree', it''s just a sample.

2680

2681 \begin{itemize}
2682 \item Ordinary articles
2683 \begin{itemize}
2684 \item \source[s=second]{macauley}
2685 \item \source[f,s=second]{macauley}[56]
2686 \end{itemize}
2687 \item Newspaper articles
2688 \begin{itemize}
2689 \item \source[s=second]{appleyard-heed}
2690 \item \source[f,s=second]{appleyard-heed}[21] (A silly example,
2691  since there's only one page to the piece!)
2692 \end{itemize}
2693 \item Articles in collections of essays
2694 \begin{itemize}
2695 \item \source[s=second]{haley-land-lease}
2696 \item \source[f,s=second]{haley-land-lease}[152]
2697 \end{itemize}
2698 \item Books
2699 \begin{itemize}
2700 \item \source[f,s=second]{latex-companion}
2701 \item \source[f,s=second]{latex-companion}[371]
2702 \end{itemize}
2703 \item Sections of books
2704 \begin{itemize}
2705 \item \source[f,s=second]{companion-bibs}
2706 \item \source[f,s=second]{companion-bibs}[374-75] (The BibTeX{}
2707  processing flow shown here is simplified for {\sc Camel} users)
2708 \end{itemize}
2709 \item Ephemeral booklets
2710 \begin{itemize}
2711 \item \source[f,s=second]{sansom-constitution}
2712 \item \source[f,s=second]{sansom-constitution}[2]
2713 \end{itemize}
2714 \item Masters theses
2715 \begin{itemize}
2716 \item \source[f,s=second]{homma-derivative}
2717 \item \source[f,s=second]{homma-derivative}[23]
2718 \end{itemize}
2719 \item Commonwealth law cases
2720 \begin{itemize}
2721 \item \source[f,s=case]{heap}
2722 \item \source[f,s=case]{heap}[578]\footnote{Notice how the
2723  pinpointed citation gives only as many parallel as are
2724  specified in the pinpoint.  Compare this with the next example.}
2725 \end{itemize}

2726 \item US law cases
2727 \begin{itemize}
2728 \item \source[f,s=case]{bradshaw-v-us}
2729 \item \source[f,s=case]{bradshaw-v-us}[145=366]
2730 \end{itemize}
2731 \end{itemize}
2732 Titles that end in a numeral are a special treat.  {\sc Camel}
2733 is not tricked by them.
2734 \begin{itemize}
2735 \item \source[s=statutes]{maki-constitution}[23]
2736 \item \source[f,s=statutes]{maki-constitution}
2737 \end{itemize}
2738 Selective suppression of author, title, or the entire citation is
2739 supported.
2740 \begin{itemize}
2741 \item \source[a,f,s=second]{homma-derivative}
2742 \item \source[t,f,s=second]{homma-derivative}
2743 \item \source[n,s=second]{homma-derivative} (invisible)
2744 \end{itemize}

2745

2746 ⟨+testtex⟩% If you uncomment the \citationsubject lines above,
2747 ⟨+testtex⟩% you can comment out the `all' entry below, run
2748 ⟨+testtex⟩% makeindex in the appropriate way over the output
2749 ⟨+testtex⟩% files, uncomment the three special bibliography
2750 ⟨+testtex⟩% declarations below, and print a whole different sort
2751 ⟨+testtex⟩% of document.  There are a few bugs in the way
2752 ⟨+testtex⟩% bibliographies are set up.  Sorting them out will
2753 ⟨+testtex⟩% best be done once BibTeX 1.0 is available, since
2754 ⟨+testtex⟩% integrating with the new BibTeX will affect the same
2755 ⟨+testtex⟩% portions of the code.
2756 \printbibliography[labels=false]{all}
2757 ⟨+testtex⟩%\printbibliography{statutes}
2758 ⟨+testtex⟩%\printbibliography{case}
2759 ⟨+testtex⟩%\printbibliography{second}
2760 \end{document}

2761 ⟨/testtex⟩

Index

Numbers written in italic refer to the page where the corresponding entry is described, the ones underlined to the code line of the definition, the rest to the code lines where the entry is used.

Symbols

\@@parse . . . . . . . . . . . . . . . . . . . . \underline{237}

  \@law@addpargument . . . . . . . . . . . . \underline{761}

\@law@addptoken . . . . . . . . . . . . . . \underline{761}

\@law@allist . . . . . . . . . . . . . . . . . \underline{247}

\@law@alnomatch . . . . . . . . . . . . . . \underline{242}

\@law@alone . . . . . . . . . . . . . . . . . . \underline{239}

  \@law@alparseplain . . . . . . . . . . . . \underline{274}
  \@law@alparsesavecomma . . . . . . . . \underline{274}

\@law@barkill . . . . . . . . . . . . . . . . 12 \@law@checkins . . . . . . . . . . . . . . . \underline{295} \@law@clean . . . . . . . . . . . . . . . . . . \underline{531} \@law@cleanup . . . . . . . . . . . . . . . . \underline{531}

                                        \@law@confirmsubject . . . . . . . . . . \underline{180}

\@law@end . . . . . . . . . . . . . . \underline{224}, \underline{1022} \@law@finish . . . . . . . . . . . . . . . . . \underline{225}

                                        \@law@firstslash . . . . . . . . . . . . . 11

\@law@get@ul . . . . . . . . . . . . . . . . . \underline{265} \@law@getbar . . . . . . . . . . . . . . . . . \underline{265} \@law@getcarat . . . . . . . . . . . . . . . \underline{265} \@law@getpara . . . . . . . . . . . . . . . . \underline{713}

\@law@getsubjectheader . . . . . . . . \underline{157}
\@law@justabovecheck . . . . . . . . . . \underline{976}
\@law@maybeaddcitesubject . . . . . . \underline{202}
\@law@newcitefirst . . . . . . . . . . . . \underline{897}
\@law@paracheckone . . . . . . . . . . . . \underline{713}
\@law@parachecktwo . . . . . . . . . . . . \underline{713}

\@law@parse . . . . . . . . . . . . . . . . . . \underline{237}

\@law@parsecomma . . . . . . . . . . . . \underline{1065}
\@law@parselastcheck . . . . . . . . . \underline{1065}
\@law@parseplain . . . . . . . . . . . . \underline{1065}

\@law@pcut . . . . . . . . . . . . . . . . . . \underline{761} \@law@plone . . . . . . . . . . . . . . . . . . \underline{221} \@law@scanlist . . . . . . . . . . . . . . . \underline{286}

\@law@secondslash . . . . . . . . . . . . 11

\@law@slnomatch . . . . . . . . . . . . . \underline{1023}

\@law@sourceoptionlist . . . . . . . . \underline{226}
\@law@subjectoptionlist . . . . . . \underline{1048}
\@law@unstashparas . . . . . . . . . . . . \underline{531}

\@ltok@atbridge . . . . . . . . . . . . . . 12

\@ltok@atbridgeplural . . . . . . . . . 12

\@ltok@atot . . . . . . . . . . . . . . . . . . 11 \@ltok@author . . . . . . . . . . . . . . . . 11

\@ltok@authormainface . . . . . . . . . 11
\@ltok@authoroptionface . . . . . . . 11
\@ltok@citefirst . . . . . . . . . . . . . 11
\@ltok@citefirstmainface . . . . . . . 11
\@ltok@citefirstoptionface . . . . . 11

\@ltok@citelast . . . . . . . . . . . . . . 11 \@ltok@citepage . . . . . . . . . . . . . . 11 \@ltok@conetop . . . . . . . . . . . . . . . 11

\@ltok@conetopplural . . . . . . . . . . 11

\@ltok@name . . . . . . . . . . . . . . . . . . 11 \@ltok@nickname . . . . . . . . . . . . . . 11

\@ltok@pageorfootno . . . . . . . . . . . 11

\@ltok@ptoctwo . . . . . . . . . . . . . . . 12 \@ltok@ptop . . . . . . . . . . . . . . . . . . 11

\@ltok@stylename . . . . . . . . . . . . . 11
\@ltok@titlemainface . . . . . . . . . . 11
\@ltok@titleoptionface . . . . . . . . 11

\@ltok@ttocone . . . . . . . . . . . . . . . 11

\@ltok@whereitsat . . . . . . . . . . . . 11

A

and (environment) . . . . . . . . . . . . . . 53

B

\bibitem . . . . . . . . . . . . . . . . . . . . \underline{439}

\bibliographymanager . . . . . . . . 2, \underline{441}

C

change.letter.case (environment) . 60

character.length (environment) . . 54 check (environment) . . . . . . . . . . . . 57 \citationdata . . . . . . . . . . . . . . . . . 2 \citationstyle . . . . . . . . . . . . . . . . 1

                                       \citationsubject . . . . . . . . . . 2, \underline{1017}

E either.or (environment) . . . . . . . . 57

                                       either.or.nowarning (environment) 58

empty.to.null (environment) . . . . . 56 ENTRY (environment) . . . . . . . . . . . . 51 entry integers (environment) …. 52 entry strings (environment) . . . . . 52 environments:

ENTRY . . . . . . . . . . . . . . . . . . . . 51 FUNCTIONS . . . . . . . . . . . . . . . . . 53 INTEGERS . . . . . . . . . . . . . . . . . 53 STRINGS . . . . . . . . . . . . . . . . . . 53 and . . . . . . . . . . . . . . . . . . . . . . 53

                                          change.letter.case . . . . . . . . . 60
                                          character.length . . . . . . . . . . . 54

check . . . . . . . . . . . . . . . . . . . . 57

                                          either.or.nowarning . . . . . . . . 58

either.or . . . . . . . . . . . . . . . . . 57 empty.to.null . . . . . . . . . . . . . 56 entry integers . . . . . . . . . . . . 52 entry strings . . . . . . . . . . . . . 52 extract.date . . . . . . . . . . . . . . 69 field names . . . . . . . . . . . . . . . 52

                                          field.tag.no.combine . . . . . . . 60
                                          fillout.a.year . . . . . . . . . . . . 66
                                          first.in.second . . . . . . . . . . . 54

format.date . . . . . . . . . . . . . . . 72 format.jdate . . . . . . . . . . . . . . 72

                                          format.month.name . . . . . . . . . . 67
                                          format.month.year . . . . . . . . . . 66

format.names . . . . . . . . . . . . . . 64 format.pages . . . . . . . . . . . . . . 63 gather.chars . . . . . . . . . . . . . . 62

                                          get.character.type . . . . . . . . . 55
                                          iftwo.might.iftwo . . . . . . . . . . 59
                                          might.ifone.must . . . . . . . . . . . 58
                                          must.ifthree.might . . . . . . . . . 59
                                          must.must.must . . . . . . . . . . . . 58

n.dashify . . . . . . . . . . . . . . . . . 61 not . . . . . . . . . . . . . . . . . . . . . . 53 or . . . . . . . . . . . . . . . . . . . . . . . 53 parse.month . . . . . . . . . . . . . . . 67

                                          tie.or.space.connect . . . . . . . 63

times.ten . . . . . . . . . . . . . . . . . 53 topup.date . . . . . . . . . . . . . . . . 71

                                          type.last.char . . . . . . . . . . . . 56

extract.date (environment) . . . . . . 69

F if@justabove . . . . . . . . . . . . . . . . . 10 if@l@quiteexact . . . . . . . . . . . . . . 10

if@law@firstuseofcite . . . . . . . . . 10

if@law@longcite . . . . . . . . . . . . . . 11

if@law@printauthor . . . . . . . . . . . . 10
if@law@printcite . . . . . . . . . . . . . 10
if@law@printtitle . . . . . . . . . . . . 10

field names (environment) . . . . . . . 52

field.tag.no.combine (environment) 60

fillout.a.year (environment) …. 66 first.in.second (environment) … 54 \footnote . . . . . . . . . . . . . . . . . . . \underline{369} \forcefootnotes . . . . . . . . . . . . 3, \underline{38} format.date (environment) . . . . . . . 72 format.jdate (environment) . . . . . . 72

format.month.name (environment) . . 67
format.month.year (environment) . . 66

format.names (environment) . . . . . . 64 format.pages (environment) . . . . . . 63 FUNCTIONS (environment) . . . . . . . . 53

G

gather.chars (environment) . . . . . . 62

get.character.type (environment) . 55

I

iftwo.might.iftwo (environment) . . 59

INTEGERS (environment) . . . . . . . . . 53

L

\lexibib . . . . . . . . . . . . . . . . . . . . \underline{524}

                                       \longestlabelfor . . . . . . . . . . . . \underline{1036}

M might.ifone.must (environment) . . 58

                                       must.ifthree.might (environment) . 59

must.must.must (environment) …. 58

N n.dashify (environment) . . . . . . . . 61 \newinterword . . . . . . . . . . . . . . . . . 3 not (environment) . . . . . . . . . . . . . . 53

O or (environment) . . . . . . . . . . . . . . 53

P parse.month (environment) . . . . . . . 67

                                       \printbibliography . . . . . . . . . 3, \underline{1146}

S \source . . . . . . . . . . . . . . . . . . . 4, \underline{310} STRINGS (environment) . . . . . . . . . . 53 \supra . . . . . . . . . . . . . . . . . . . . . . . \underline{7}

T

                                       tie.or.space.connect (environment) 63

times.ten (environment) . . . . . . . . 53 topup.date (environment) . . . . . . . . 71 type.last.char (environment) …. 56