summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lexitex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/lexitex
Initial commit
Diffstat (limited to 'macros/latex/contrib/lexitex')
-rw-r--r--macros/latex/contrib/lexitex/README69
-rw-r--r--macros/latex/contrib/lexitex/catalog13
-rw-r--r--macros/latex/contrib/lexitex/lexibib.doc2441
-rw-r--r--macros/latex/contrib/lexitex/lexismp1.tex1150
-rw-r--r--macros/latex/contrib/lexitex/lexismp2.bib305
-rw-r--r--macros/latex/contrib/lexitex/lexismp2.tex712
-rw-r--r--macros/latex/contrib/lexitex/lexitex.doc3643
-rw-r--r--macros/latex/contrib/lexitex/mainfest16
8 files changed, 8349 insertions, 0 deletions
diff --git a/macros/latex/contrib/lexitex/README b/macros/latex/contrib/lexitex/README
new file mode 100644
index 0000000000..f33fb71913
--- /dev/null
+++ b/macros/latex/contrib/lexitex/README
@@ -0,0 +1,69 @@
+READ.ME (lexitex)
+
+NOTE: A near complete re-draft of this package, to be called
+ `the Camel Citator', is now in progress. The new package
+ consists of two files, camel.doc and law.doc. You will
+ also need the beta version of the LaTeX2e index.sty by
+ David Jones. All of these files can be fetched from
+ rumple.soas.ac.uk:/pub. Alternatively, try the WWW
+ page http://rumple.soas.ac.uk/~fbennett/, and follow
+ the links from there.
+
+LexiTeX is a LaTeX2e style package for simplifying the in-
+footnote citation styles required by major law journals. A list
+of citations is entered at the top of the document (or included
+using \input), and references are made by nickname tags, in a
+fashion similar to the normal usage of the \cite command.
+Nickname references expand into context-sensitive
+cross-referenced citations, which conform to the Harvard `Blue
+Book' style with respect to typeface, punctuation and
+cross-referencing form. Tables of authorities can also be easily
+produced.
+
+LexiBib is a BibTeX style that exports citations from a BibTeX-
+format database in the syntax required for digestion by LexiTeX.
+This allows documents containing context-sensitive citations to
+be prepared in much the same way as bibliographies and reference
+tags are produced using standard BibTeX. LexiBib is currently
+`under construction', but it is now beyond the mere-novelty stage
+of development.
+
+The style has only recently been shifted to LaTeX2e; please
+report any problems, so they can be dealt with promptly.
+
+These utilities are distributed as two files, lexitex.doc and
+lexibib.doc respectively. To extract the files and print the
+documentation you will need the docstrip and doc utilities
+distributed as part of LaTeX2e. Type `latex docstrip', or
+whatever command will process the docstrip.tex file on your
+system, and follow the prompts. You want to process the file
+call `lexitex' (or `lexibib'), with extension `doc', using option
+`driver', to a file with extension `drv'. Then type `latex
+lexitex.drv' or `latex lexibib.drv', and watch the chips fly.
+Extraction of lexitex.doc takes about 10 minutes on a 33mhz 486
+running a big TeX on the Linux operating system. On DOS-based
+systems it will probably take much longer.
+
+Once everything is extracted, you can edit the files lexitex.man
+and lexibib.man to your taste, and print the documentation.
+There is very little of this for LexiBib at present, but it will
+come if I receive feedback from users or prospective users.
+
+LexiTeX will eventually be released in a LaTeX2e version, but I
+can't say when. This largely depends on when LaTeX2e becomes
+available for use with NTT-JTeX, since the entire reason LexiTeX
+was developed in the first place was for the typesetting of
+mixed-text Japanese and English documents for publication.
+
+Upgrades to both of these packages will be released from time to
+time. If you have a problem or a question concerning them,
+please drop a line to fbennett@rumple.soas.ac.uk; I'll be happy
+to help.
+
+Cheers,
+Frank Bennett
+SOAS Law Department
+Thornhaugh Street
+London WC1H 0XG
+Tel: (071)323-6351
+
diff --git a/macros/latex/contrib/lexitex/catalog b/macros/latex/contrib/lexitex/catalog
new file mode 100644
index 0000000000..c82073c737
--- /dev/null
+++ b/macros/latex/contrib/lexitex/catalog
@@ -0,0 +1,13 @@
+Name: lexibib
+Problems-To: fbennett@soas.ac.uk
+Author: Frank G Bennett, Jr
+Version: 1.0f 1994/12/08
+Description: LexiBib is a *.bst file for use with BibTeX,
+ which creates a *.bbl file containing citations
+ embedded in a `lexilist' environment, suitable
+ for digestion by LexiTeX. The style is still
+ under construction, but getting more useful as
+ the support for BibTeX entry types grows.
+ This is the only BibTeX style package that
+ supports citations to law cases and statutes.
+Keywords: law, legal, lawyer, bibliography, BibTeX, cross-referencing
diff --git a/macros/latex/contrib/lexitex/lexibib.doc b/macros/latex/contrib/lexitex/lexibib.doc
new file mode 100644
index 0000000000..39fa157e2a
--- /dev/null
+++ b/macros/latex/contrib/lexitex/lexibib.doc
@@ -0,0 +1,2441 @@
+% \def\fileversion{ver.~1.0g}
+% \def\filedate{1994/12/12}
+% \def\docdate {1994/12/07}
+% \CheckSum{92}
+%
+%\iffalse
+%
+% Copyright (C) 1992-1994 by Frank Bennett. All rights reserved.
+%
+% This file contains the entire LexiBib package. The complementary
+% LaTeX2e style package LexiTeX is contained in the separate file
+% lexitex.doc.
+%
+%
+% To get started with unpacking, run this file through DOCSTRIP
+% giving `driver' as the extraction option, with the extension
+% `ins'. Then run the resulting lexibib.ins file through LaTeX,
+% which will strip the files. Run lexibib.man through LaTeX
+% to print the documented file. I have tried to make the commented
+% code as informative as possible; comments are welcome on the
+% commentary as well as the code itself.
+%
+% IMPORTANT NOTICE:
+%
+% You are not allowed to change this file. You may however copy
+% this file to a file with a different name and then change the
+% copy if (a) you do not charge for the modified code, (b) you
+% acknowledge LexiBib and its author(s) in the new file, if it
+% is distributed to others, and (c) you attach these same
+% conditions to the new file.
+%
+% You are not allowed to distribute this file alone. You are not
+% allowed to take money for the distribution or use of this file
+% (or a changed version) except for a nominal charge for copying
+% etc.
+%
+% You are allowed to distribute this file under the condition that
+% it is distributed with all of its contents, intact.
+%
+% For error reports, or offers to help make LexiTeX a more powerful,
+% friendlier, and better package, please contact me on
+% fbennett@clus1.ulcc.ac.uk
+%\fi
+%
+% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
+% \DoNotIndex{\@flushglue,\@gobble,\@input}
+% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
+% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
+% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
+% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
+% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
+% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
+% \DoNotIndex{\|,\~,\,\active,\advance,\aftergroup,\begingroup,\bgroup}
+% \DoNotIndex{\cal,\csname,\def,\documentstyle,\dospecials,\edef}
+% \DoNotIndex{\egroup}
+% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
+% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
+% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
+% \DoNotIndex{\ifcase}
+% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
+% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
+% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
+% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
+% \DoNotIndex{\strutbox}
+% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
+% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
+% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
+% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
+% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
+% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
+% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
+% \DoNotIndex{\nopagebreak}
+% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
+% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
+% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
+% \DoNotIndex{\[,\{,\},\]}
+% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
+% \DoNotIndex{\baselineskip,\begin,\tw@}
+% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
+% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
+% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
+% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
+% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
+% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
+% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
+% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
+% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
+% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
+% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
+% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
+% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
+% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
+% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
+% \DoNotIndex{\bfdefault}
+% \setcounter{StandardModuleDepth}{1}
+% \MakeShortVerb{\"}
+
+% \title{\LexiBib\\a style file to link\\\BibTeX\ databases with
+% the \\\LexiTeX\ style engine.\thanks{%
+% This file has version number \fileversion{} dated
+% \filedate{}.
+% The documentation was last revised on \docdate.
+% The documentation and the code for \LexiBib{} and \LexiTeX{}
+% are \copyright{} 1992--94 Frank Bennett, Jr. Distribution
+% and use are freely welcomed, on the sole condition that
+% acknowledgement of the \LexiTeX{} package and of its author
+% be made in any published using these utilities.
+% }}
+% \author{Frank G. Bennett, Jr.}
+% \maketitle
+%
+% \begin{abstract}
+% \LexiBib\ is a style for use with \BibTeX\ which permits
+% legal and other citations to be stored in \BibTeX\ databases,
+% and incorporated in documents in a manner similar to
+% the normal operation of
+% \BibTeX. Citations exported using \LexiBib\ are written in
+% the syntax required for digestion by \LexiTeX, a citation
+% engine that produces in-footnote, cross-referenced citations
+% from nickname references to a single citation source list.
+% \LexiTeX\ is currently a \LaTeX\ 2.09 style, which will be
+% upgraded to \LaTeX2e form in due course.
+% \end{abstract}
+%
+% \tableofcontents
+% \lexiforcefoots
+% \section*{Preface to Version 1.0b}
+%
+% This {\tt doc} package contains a \BibTeX\ style named
+% {\tt lexibib.bst}. This style file can be used to
+% export citations from a \BibTeX{} database in a form
+% that can be used by the \LexiTeX\ citation engine.
+% This permits a user to store citation details and
+% annotations in a separate database, and incorporate
+% those citations into a document using simple nickname
+% tags. When the document is printed, the nickname tags
+% will automagically be converted into properly formatted,
+% Blue Book-conformant citations.\\
+% The {\tt lexibib.bst} style file contains only a modest
+% amount of code from the original 1988 release of {\tt
+% btxbst.doc}
+% by Oren Patashnik. While the original style is very
+% efficient in its operation, its output, formatting and
+% logical function are intertwined in a way that makes
+% modification of the style rather difficult. At some cost
+% in speed, in {\tt lexibib.bst} I have tried to provide
+% a set of modular functions that can be more easily modified
+% to suit specialized formatting requirements.\\
+% Please note that this is a {\sf beta} release. Full support
+% for databases prepared according the general conventions laid
+% down by Oren Patashnik is not yet provided,
+% so please don't rely on this style in the way you would rely
+% on the standard styles (yet). Your comments will help to
+% speed the development of \LexiBib\ into a reliable clone
+% of the standard styles.
+%
+% \newpage
+% \pagenumbering{arabic}
+% \section{User Guide}
+% \subsection{Introduction}
+%
+% An adage in office management is that you should
+% only touch incoming paper once; to respond to it, to file
+% it, to forward it, or to destroy it. A number of
+% commercial citation
+% database managers provide a facility for ``filing'' citations
+% in a flexible form, the idea being to extend this principle
+% to citations as well as paper. A hanging point for this
+% strategy as been in-text context-sensitive citation styles.
+% Database managers are at their best in exporting
+% entire bibliographies
+% and lists of authorities. Some packages are
+% capable of scanning a document for citation ``tags'',
+% which eliminates the need to separately select bibliography
+% items in the database. Some, too, can replace ``tags''
+% in the document with the formatted text of a citation.
+% But once the text is replaced, the format of citations
+% added in this way is fixed; conversion is a one-way process.
+%
+% A more serious problem is that, while the database manager
+% can easily identify the {\em tag}, it cannot identify its
+% {\em context\/}---whether it occurs in a footnote, how many
+% items were in the preceding footnote, how many articles
+% by the same author are cited in the document, and so forth.
+% As a result, citation formatting of cross-referenced styles
+% is still done by hand.
+%
+% One of the most demanding cross-referenced styles is that
+% laid down in {\sl A Uniform System of Citation}, or ``the Blue
+% Book'', for the citation of legal materials. This style
+% has survived the era of computerization largely because
+% most U.S. law journals using the style are edited by highly
+% competitive law students. Staff members contribute their
+% editorial time to their journal free of charge, because of
+% the value of listing law journal membership on their resume.
+% The Blue Book style minimizes the bulk of citation
+% text, while conveying sufficient information to the reader
+% for the location of cited material. It is also designed
+% to provide all information required for the location of
+% {\em primary\/} legal authority from the face of any citation
+% to it, without tracing down cross-references.
+%
+% \LexiTeX{} and \LexiBib{} constitute the first attempt
+% to allow documents requiring {\em cross-referenced},
+% {\em in-text\/} citations in the demanding Blue Book style
+% to draw all citation details
+% from a separately maintained bibliography, with all
+% citation formatting taking place automatically at print time.
+% \LexiTeX{} is a style for use with the \LaTeX{} typesetting
+% system.
+%
+% The implications of such a system are particularly interesting
+% if it comes to be widely used, say, in the publication of
+% law journals. The efficiency with which
+% citations can be reported to citation services would be
+% increased, since \LexiBib{}-format database entries
+% are in a standard format that can
+% be processed electronically. These same lists could
+% be made available as text-searchable databases of authority.
+% Network discussions of legal issues could be accompanied by
+% growing lists of annotated authority, available for all to
+% use.
+%
+% Even for personal use, the combination of \LexiTeX{} and
+% \LexiBib{}
+
+% Details on the use of \LexiTeX\ are contained in a separate
+% manual. The purpose of this guide is to explain the
+% preparation
+% and processing of \BibTeX\ databases for use with \LexiBib{}
+% and
+% \LexiTeX. If you have any queries, please feel free to contact
+% me on {\tt fbennett@clus1.ulcc.ac.uk}.
+%
+% \subsection{Preparing bibliography files}
+%
+% \subsection{Processing files using \LexiBib}
+% \subsection{\LexiBib\ entry types}
+% \subsection{\LexiBib\ entry fields}
+%\StopEventually{}
+% \section{The style code}
+% \subsection{To prospective style hackers}
+% The \BibTeX\ style language differs from \TeX\ both in style
+% and in syntax. Whereas \TeX\ tears through a document from
+% start to finish, clearing memory as it feeds out pages and
+% terminating at the end of the input file, \BibTeX\ reads its
+% own {\tt *.bst} file in a linear fashion, but the
+% commands used in that file to not treat treat the {\em
+% database\/} input file as a linear input stream.\\
+% At startup, \BibTeX\ latches onto the
+% {\tt *.aux} file at which it has been pointed, and scans it for
+% certain strings, which are hardwired into \BibTeX's own code.
+% These strings tell the program (a) which citation databases it
+% must open, and (b) what citation nicknames it must search those
+% databases for. A series of initializing operations are then
+% performed, which define variables and functions much as one
+% defines \TeX\ macros in advance of their use. Finally,
+% the matching items from the database can be read for use by
+% \BibTeX, and the defined functions can be invoked on each item.
+% The entire list may be read several times if necessary. In the
+% end, special functions which write formatted entries on an
+% output file are invoked after which, having reached the end of
+% the {\tt *.bst} file, the program terminates.
+%
+% The {\tt *.bst} style code below has been divided into logical
+% sections which, I hope, will illustrate the logical phases of
+% \BibTeX's progress.
+%
+% \subsection{About cross-referencing}
+% About cross-referencing, Oren Patashnik wrote:
+% \begin{quote}
+% Now come the cross-referencing functions (these are invoked
+% because one entry in the database file(s) cross-references
+% another, by giving the other entry's database key in a
+% "crossref"
+% field). This feature allows one or more titled things that are
+% part of a larger titled thing to cross-reference the larger
+% thing. These styles allow for five posibilities:
+%
+% \begin{enumerate}
+% \item an {\bf article} may cross-reference an {\bf article};
+%
+% \item a cross-reference to a {\bf book} may be made in an
+% entry for:
+%
+% \begin{enumerate}
+% \item a {\bf book};
+% \item an {\bf inbook}; or
+% \item an {\bf incollection}; and
+% \end{enumerate}
+%
+% \item
+% an {\bf inproceedings} may cross-reference a {\bf proceedings}.
+% \end{enumerate}
+% Each of
+% these is explained in more detail later.
+%
+% An {\bf article} entry type may cross reference another
+% {\bf article}
+% (this
+% is intended for when an entire journal is devoted to a single
+% topic--- but since there is no {\bf journal} entry type, the
+% journal,
+% too, should be classified as an {\bf article} but without the
+% author
+% and title fields). This will result in two warning messages for
+% the journal's entry if it's included in the reference list, but
+% such is life. The other cross-referencing functions are
+% similar,
+% so no "comment version" will be given for them. We use just the
+% last names of editors for a cross reference: either "editor",
+% or
+% "editor1 and editor2", or "editor1 et~al." depending on whether
+% there are one, or two, or more than two editors.
+% \end{quote}
+% \def\option#1{\item\def\lawtemp{#1}\def\lawtemptwo{none}
+% \ifx\lawtemp\lawtemptwo
+% {\em none}
+% \else{\small`{\bf#1}':}\fi}
+% \newenvironment{Ventry}[1]%
+% {\begin{list}{}{\renewcommand{\makelabel}[1]{\textsf{##1:}\hfil}%
+% \settowidth{\labelwidth}{\textsf{#1:}}%
+% \setlength{\leftmargin}{\labelwidth}
+% \addtolength{\leftmargin}{1\labelsep}}}%
+% {\end{list}}
+% \changes{1.0f}{1994/12/08}{Rewrote the `spec' macro used in the
+% documentation, which was not happy with either compatibility
+% mode or 2e.}
+% \changes{1.0f}{1994/12/08}{\LaTeX 2e version released!}
+% \def\spec#1#2#3{\begin{Ventry}{Expected}
+% \item[Expected] \begin{enumerate}
+% #1
+% \end{enumerate}
+% \item[Left] \begin{enumerate}
+% #2
+% \end{enumerate}
+% \item[Toggles] \begin{enumerate}
+% #3
+% \end{enumerate}
+% \end{Ventry}}
+% Each function defined using the {\tt FUNCTION} operator
+% is accompanied by a brief description of what it is
+% intended to do, followed by a box in the following form:
+%
+% \spec{\item What the function expects to find on the stack,
+% numbered from the top (most recently pushed) to the bottom
+% item.}
+% {\item What the function will leave on the stack, numbered in
+% the
+% same fashion.}
+% {\option{toggle name} What the effect of any toggles is on the
+% behaviour of the function.}
+%
+% Happy reading.
+% \subsection{Hello!}
+% As ever, we start by telling the world who we are.
+% \begin{macrocode}
+%<*newbst>
+FUNCTION { hello }
+{ " ========================================="
+" package, version 2.0g or later"
+" Use with LateX2e and the LexiTeX style"
+" -----------------------------------------"
+" documentation last updated: 5 December 1994"
+" code last updated: 12 December 1994"
+" style version: 1.0g"
+" This is the LexiBib style for BibTeX"
+" ========================================="
+stack$
+}
+% \end{macrocode}
+% \subsection{Variable initializations}
+% \DescribeEnv{ENTRY}
+% This command takes three braced arguments, which in order are:
+% \begin{enumerate}
+% \item A list of field names;
+% \item A list of integer variables; and
+% \item A list of string variables.
+% \end{enumerate}
+% 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.
+% \begin{macrocode}
+ENTRY
+% \end{macrocode}
+%
+% \DescribeEnv{field names}
+% \mbox{}
+% \begin{macrocode}
+{ address
+annote
+author
+booktitle
+chapter
+edition
+editor
+howpublished
+institution
+journal
+key
+month
+note
+number
+organization
+pages
+publisher
+school
+series
+title
+type
+volume
+year
+date
+jurisdiction
+court
+division
+divno
+casedate
+translator
+booktranslator
+}
+% \end{macrocode}
+%
+% \DescribeEnv{entry integers}
+% None are defined. Note that any integers or strings defined
+% with the
+% ENTRY command are created for {\em each\/} entry in the
+% citation list.
+% \begin{macrocode}
+{}
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+% \begin{macrocode}
+{}
+% \end{macrocode}
+%
+% \DescribeEnv{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 \ldots
+% \begin{macrocode}
+STRINGS { s t u theyear themonth theday }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+% \begin{macrocode}
+INTEGERS { itemcount date.specials charcount a b
+ nameptr namesleft numnames a.logical }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+% \begin{macrocode}
+FUNCTION {dc..} {"District Court"}
+FUNCTION {sc..} {"Supreme Court"}
+% \end{macrocode}
+%
+% \subsection{Function definitions}
+% \subsubsection{Logic and measurement}
+%
+% \DescribeEnv{not}
+% \DescribeEnv{and}
+% \DescribeEnv{or}
+% These have been copied verbatim from Oren Patashnik's 1988
+% release.
+% His commentary on these functions reads:
+% {\em These three functions pop one or two (integer) arguments
+% from the stack
+% and push a single one, either "0" or "1".
+% The {\tt 'skip\$} in the `"and"' and `"or"' functions are used
+% because
+% the corresponding {\tt if\$} would be idempotent.}
+%
+% \spec{\item The result of a logical test
+% \item The result of a second logical test}
+% {\item A single logical test result}
+% {\option{none}}
+%
+% \begin{macrocode}
+ FUNCTION {not}
+ { { #0 }
+ { #1 }
+ if$
+ }
+ FUNCTION {and}
+ { 'skip$
+ { pop$ #0 }
+ if$
+ }
+ FUNCTION {or}
+ { { pop$ #1 }
+ 'skip$
+ if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A single integer.}
+% {\item A single integer.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {times.ten}
+ { duplicate$ duplicate$ duplicate$ duplicate$ duplicate$
+ duplicate$ duplicate$ duplicate$ duplicate$
+ + + + + + + + + +
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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 {\em characters\/};
+% this function provides
+% that facility.
+%
+% \spec{\item A string.}
+% {\item An integer giving the number of characters in the
+% string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {character.length}
+ { 'u :=
+ #0 'charcount :=
+ { u empty$ not }
+ { u #2 global.max$ substring$ 'u :=
+ charcount #1 + 'charcount :=
+ }while$
+ charcount
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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, {\tt t} is the substring length, and
+% {\tt u} is the string length.
+%
+% \spec{\item A string toggle.
+% \item A string (the string in which to look).
+% \item A string (the substring to look for).}
+% {\item A single integer ({\tt 0} or {\tt 1}), indicating
+% whether
+% the substring was found at the specified location in the
+% string for search.}
+% {\option{end} The function looks at the end of the
+% given string.
+% \option{start} The function looks at the start of the
+% given string.}
+%
+% \begin{macrocode}
+FUNCTION {first.in.second}
+ { 's :=
+ duplicate$ empty$
+ { pop$ pop$ #0 }
+ { swap$ duplicate$ character.length 'a :=
+ swap$ duplicate$ character.length 'b :=
+ b a <
+ { pop$ pop$ #0 }
+ { s "end" =
+ { b a - #1 + global.max$ substring$ =
+ { #1 }
+ { #0
+ }if$
+ }
+ { #1 a substring$ =
+ { #1 }
+ { #0
+ }if$
+ }if$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+% \begin{macrocode}
+FUNCTION { get.character.type }
+ { duplicate$ empty$
+ { pop$ "other" }
+ { duplicate$ chr.to.int$
+ duplicate$ #47 > swap$ #58 < and
+ { pop$ "numeral" }
+ { chr.to.int$
+ duplicate$ #64 > swap$ duplicate$ #91 < swap$
+ duplicate$ #96 > swap$ #123 < and 'a.logical :=
+ and a.logical or
+ { "letter" }
+ { "other"
+ }if$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \subsubsection{Housekeeping}
+% These functions are used to issue warning messages and avoid
+% errors during processing.
+%
+% \DescribeEnv{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.
+%
+% \spec{\item The contents of a field, which may be an empty
+% field marker.}
+% {\item A string, possibly the null string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+ FUNCTION {empty.to.null}
+ { duplicate$ empty$
+ { pop$ "" }
+ 'skip$
+ if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string for
+% use in an error message.
+% \item The contents of a field.}
+% {\item The field contents.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION { check }
+{ 't :=
+ duplicate$ empty$
+ { "empty " t * " in " * cite$ * warning$}
+ 'skip$
+ if$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{either.or}
+% \changes{1.0c}{94/08/10}{Added the {\tt either.or}
+% housekeeping function, for use in {\tt j.cases}.}
+% 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.
+%
+% \spec{\item A string.
+% \item A string.}
+% {\item A single string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {either.or}
+ { duplicate$ empty$
+ { pop$ duplicate$ empty$
+ { pop$ "" }
+ 'skip$
+ if$
+ }
+ { swap$ duplicate$ empty$
+ { pop$ }
+ { "both items in an either.or pair are non-empty in " cite$ *
+ warning$
+ " I'm using only ONE of these items (the second passed by the function)."
+ warning$
+ pop$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \subsubsection{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.
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string.
+% \item A string.
+% \item A string.}
+% {\item none}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {must.must.must}
+ { empty.to.null 't :=
+ empty.to.null swap$ empty.to.null swap$ t
+ * *
+ write$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string.
+% \item A string.
+% \item A string.}
+% {\item {\em none}}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {might.ifone.must}
+ { empty.to.null 't :=
+ swap$ duplicate$ empty$
+ { pop$ pop$ t }
+ { swap$ empty.to.null t * * }
+ if$
+ write$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string.
+% \item A string.
+% \item A string.}
+% {\item none}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {iftwo.might.iftwo}
+ { 't :=
+ duplicate$ empty$
+ { pop$ pop$ }
+ { empty.to.null swap$ empty.to.null swap$
+ t empty.to.null
+ * * write$ }
+ if$
+ }
+% \end{macrocode}
+% \DescribeEnv{ifthree.ifthree.might}
+% This outputs a pair of prefixes if the suffix to which they are
+% to be attached exists. Otherwise it outputs a null string.
+%
+% \spec{\item A string.
+% \item A string.
+% \item A string.}
+% {\item none}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {must.ifthree.might}
+ { 't :=
+ duplicate$ empty$
+ { pop$ write$ }
+ { swap$ empty.to.null
+ swap$ empty.to.null
+ t * * write$ }
+ if$
+ }
+% \end{macrocode}
+%
+% \subsubsection{Parsing and conversion}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string toggle.
+% \item An identifier (i.e.\ a report number).
+% \item A text prefix for the identifier.
+% \item A string label (i.e.\ ``Technical Report'' or somesuch).}
+% {\item A single string.}
+% {\option{endlabel} Combines the text items in the same order
+% in
+% which they are found.
+% \option{frontlabel} Places the label in front, followed by the
+% identifier, followed by the first item pushed.}
+%
+% \begin{macrocode}
+FUNCTION {field.tag.no.combine}
+ { "endlabel" =
+ { duplicate$ empty$
+ { pop$ pop$ empty.to.null }
+ { empty.to.null 's := empty.to.null
+ swap$ empty.to.null swap$ s * *
+ }if$
+ }
+ { duplicate$ empty$
+ { pop$ pop$ empty.to.null }
+ { empty.to.null 's := empty.to.null
+ swap$ empty.to.null s swap$ * *
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{change.letter.case}
+% This is a simple front-end to the {\tt 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.
+%
+% \spec{\item A single character---either
+% an {\tt n}, a {\tt t}, an {\tt l}, or a {\tt u}.
+% \item A string for conversion.}
+% {\item One string, converted according to the option toggle
+% pushed
+% after the string.}
+% {\option{n} yields the string unchanged.
+% \option{t} yields
+% all lower case letters except for the first.
+% \option{l} yields all lower case letters.
+% \option{u} yields all
+% upper case letters.}
+%
+% \begin{macrocode}
+FUNCTION {change.letter.case}
+ { 't :=
+ duplicate$ empty$
+ 'skip$
+ { t chr.to.int$ "n" chr.to.int$ =
+ 'skip$
+ { t change.case$ }
+ if$
+ }
+ if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{n.dashify}
+% The "n.dashify" function makes each single "-" in a string a
+% double "--".
+% if it's not already.\footnote{This comment by Oren Patashnik.}
+%
+% \spec{\item A single string for conversion.}
+% {\item A single converted string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+ FUNCTION {n.dashify}
+ { 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string for parsing.}
+% {\item A string toggle showing the character type of the
+% first homogenous substring in the string for parsing.
+% \item A string of characters from the front of the given string
+% which are letters or numbers only.
+% \item The remainder of the string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION { gather.chars }
+ { 't :=
+ { t empty$ not
+ t #1 #1 substring$ get.character.type
+ "other" = and }
+ { t #2 global.max$ substring$ 't :=
+ }while$
+ t #1 #1 substring$ duplicate$ get.character.type
+ "" swap$ duplicate$ 'u :=
+ t #2 global.max$ substring$ 't :=
+ { u = }
+ { * t #1 #1 substring$ duplicate$ get.character.type
+ duplicate$ u =
+ { t #2 global.max$ substring$ 't := }
+ { swap$ pop$
+ }if$
+ }while$
+ t swap$ u
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A string
+% \item A second string}
+% {\item One string}
+% {\item {none}}
+%
+% \begin{macrocode}
+ FUNCTION {tie.or.space.connect}
+ { duplicate$ text.length$ #3 <
+ { "~" }
+ { " " }
+ if$
+ swap$ * *
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.dashify"s
+% 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.
+%
+% \spec{\item A toggle string.
+% \item page number or possibly
+% a range of pages.}
+% {\item One string, constituting a finished page number, or {\tt
+% empty\$}.}
+% {\option{short} will return only the
+% first number given in the string.
+% \option{full}
+% will return the page number, n-dashified.}
+% \changes{1.0e}{94/12/05}{Altered {\tt format.pages} so
+% that the {\tt short} scan stops at a {\tt-} character,
+% rather than a non-integer. Simpler and more robust.}
+% \begin{macrocode}
+FUNCTION {format.pages}
+ { swap$ duplicate$ empty$
+ { pop$ pop$ "" }
+ { swap$ duplicate$ "short" =
+ { pop$
+ 's :=
+ ""
+ s #1 #1 substring$
+ { "-" = not }
+ { s #1 #1 substring$ *
+ s #2 global.max$ substring$ 's :=
+ s #1 #1 substring$
+ duplicate$ "" =
+ { pop$ "-" }
+ 'skip$
+ if$
+ }
+ while$
+ }
+ { "full" =
+ { pages n.dashify }
+ { "invalid switch fed to the format.pages function"
+ warning$
+ }if$
+ }if$
+ }if$
+}
+% \end{macrocode}
+%
+% \paragraph{Names}
+% The code for parsing and formatting names is extremely
+% economical,
+% thanks to the powerful built-in functions that \BibTeX\
+% supplies
+% for this purpose.
+%
+% \DescribeEnv{format.names}
+% This is based on Oren Patashnik's original function of the same
+% name. His comment was as follows:
+% \begin{quote}
+% The format.names function formats the argument (which should
+% be in
+% \BibTeX name format) into ``{\tt 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.
+% \end{quote}
+%
+% 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.
+%
+% \spec{\item The contents of one name field
+% \item string toggle
+% (either {\tt firstinitial}, {\tt lastonly} or {\tt full})}
+% {\item A single string, containing a formatted name or names,
+% or {\tt empty\$}}
+% {\option{firstinitial} Yields the form ``F.~Bennett, Jr.''
+% \option{lastonly}
+% Yields the form ``Bennett''
+% \option{full} yields ``Frank Bennett, Jr.''}
+%
+% \begin{macrocode}
+FUNCTION {format.names}
+ { 'u :=
+ duplicate$ empty$
+ 'skip$
+ { 's :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { u "lastonly" =
+ { s nameptr "{vv~}{ll}" format.name$ 't := }
+ { u "firstinitial" =
+ { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$
+'t := }
+ { u "full" =
+ { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=}
+ { "style error; invalid or non-existent toggle" warning$ }
+ if$
+ }
+ if$
+ }
+ if$
+ nameptr #1 >
+ { namesleft #1 >
+ { ", " * t * }
+ { numnames #2 >
+ { "," * }
+ 'skip$
+ if$
+ t "others" =
+ { " et~al." * }
+ { " and " * t * }
+ if$
+ }
+ if$
+ }
+ 't
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ }
+ if$
+ }
+% \end{macrocode}
+%
+% \paragraph{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.
+%
+% \subparagraph{Old format routine}
+%
+% \DescribeEnv{format.month.year}
+% 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.\footnote{This comment by Oren
+% Patashnik.}
+%
+% 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.
+%
+% \spec{\item none}
+% {\item A single string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+ FUNCTION {format.month.year}
+ { year empty$
+ { month empty$
+ { "" }
+ { "there's a month but no year in " cite$ * warning$
+ month
+ }
+ if$
+ }
+ { month empty$
+ 'year
+ { month " " * year * }
+ if$
+ }
+ if$
+ }
+% \end{macrocode}
+%
+% \subparagraph{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.
+%
+% \DescribeEnv{fillout.a.year}
+% This adds a leading "19" to a year entered in two-digit
+% form.
+%
+% \spec{\item A single string.}
+% {\item A single string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {fillout.a.year}
+ { duplicate$ character.length #2 =
+ { pop$ "19" swap$ * }
+ 'skip$
+ if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A single string, which should consist of
+% exactly three alphabetic characters.}
+% {\item A single string of numbers.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {parse.month}
+ { duplicate$ "jan" =
+ { pop$ "1" }
+ { duplicate$ "feb" =
+ { pop$ "2" }
+ { duplicate$ "mar" =
+ { pop$ "3" }
+ { duplicate$ "apr" =
+ { pop$ "4" }
+ { duplicate$ "may" =
+ { pop$ "5" }
+ { duplicate$ "jun" =
+ { pop$ "6" }
+ { duplicate$ "jul" =
+ { pop$ "7" }
+ { duplicate$ "aug" =
+ { pop$ "8" }
+ { duplicate$ "sep" =
+ { pop$ "9" }
+ { duplicate$ "oct" =
+ { pop$ "10" }
+ { duplicate$ "nov" =
+ { pop$ "11" }
+ { duplicate$ "dec" =
+ { pop$ "12" }
+ { "invalid month in " cite$ * warning$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+%
+% \DescribeEnv{extract.date}
+% This function takes a labelled stack of numeric items,
+% and places its contents into the appropriate variables
+% representing elements of a date. It will probably
+% tolerate further enhancement, and should probably
+% deliver its result to the stack, rather than into
+% variables.
+%
+% 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 stack is always left empty, and there are no
+% toggles that affect the overall behaviour of the
+% function. 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", 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.
+%
+% \begin{macrocode}
+FUNCTION {extract.date}
+ { "" 'theyear := "" 'themonth := "" 'theday :=
+ itemcount #0 =
+ { "some date or other is COMPLETELY empty in " cite$ * warning$ }
+ { itemcount #1 =
+ { pop$ fillout.a.year 'theyear := "" 'theday := "" 'themonth := }
+ { itemcount #2 =
+ { pop$ fillout.a.year 'theyear :=
+ pop$ 'themonth :=
+ "" 'theday :=
+ }
+ { itemcount #3 =
+ { date.specials
+ { pop$ fillout.a.year 'theyear :=
+ "month" =
+ { 'themonth :=
+ pop$ 'theday := }
+ { 'theday :=
+ pop$ 'themonth :=
+ }if$
+ }
+ { pop$ fillout.a.year 'theyear :=
+ pop$ 'theday :=
+ pop$ 'themonth :=
+ }if$
+ }
+ { "too many items for date in " cite$ * warning$
+ }if$
+ }if$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{format.month.name}
+% \changes{\LexiBib{} 1.0b}{94/08/09}{Added {\tt swap\$} as appropriate
+% to expose string on stack for {\tt empty\$} check.}
+% This takes a numerical string and converts it to either an
+% abbrviated or a spelled-out month name.
+%
+% \spec{\item A toggle string.
+% \item A numerical string.}
+% {\item A string.}
+% {\option{long} The month name placed on the stack will be
+% spelled out.
+% \option{short} The month name will be abbreviated.}
+%
+% \begin{macrocode}
+FUNCTION { format.month.name }
+ { swap$ duplicate$ empty$
+ { pop$ pop$ "" }
+ { swap$ "long" =
+ { duplicate$ "1" =
+ { "January" }
+ { duplicate$ "2" =
+ { "February" }
+ { duplicate$ "3" =
+ { "March" }
+ { duplicate$ "4" =
+ { "April" }
+ { duplicate$ "5" =
+ { "May" }
+ { duplicate$ "6" =
+ { "June" }
+ { duplicate$ "7" =
+ { "July" }
+ { duplicate$ "8" =
+ { "August" }
+ { duplicate$ "9" =
+ { "September" }
+ { duplicate$ "10" =
+ { "October" }
+ { duplicate$ "11" =
+ { "November" }
+ { duplicate$ "12" =
+ { "December" }
+ { "invalid month in " cite$ * warning$ ""
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }
+ { duplicate$ "1" =
+ { "Jan." }
+ { duplicate$ "2" =
+ { "Feb." }
+ { duplicate$ "3" =
+ { "Mar." }
+ { duplicate$ "4" =
+ { "Apr." }
+ { duplicate$ "5" =
+ { "May" }
+ { duplicate$ "6" =
+ { "Jun." }
+ { duplicate$ "7" =
+ { "Jul." }
+ { duplicate$ "8" =
+ { "Aug." }
+ { duplicate$ "9" =
+ { "Sept." }
+ { duplicate$ "10" =
+ { "Oct." }
+ { duplicate$ "11" =
+ { "Nov." }
+ { duplicate$ "12" =
+ { "Dec." }
+ { ""
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+ }if$
+swap$ pop$
+ }if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{topup.date}
+% This is used to perform an addition operation on a
+% string of numerals.
+%
+% \spec{\item An integer to be added.
+% \item A string consisting of numerals only.}
+% {\item A string consisting of the sum of the integer and
+% the numeric string.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {topup.date}
+ { 'a :=
+ duplicate$ character.length #2 =
+ { duplicate$ #1 #1 substring$ chr.to.int$ #48 -
+ times.ten swap$ #2 #1 substring$ chr.to.int$ #48 -
+ +
+ }
+ { duplicate$ character.length #1 =
+ { chr.to.int$ #48 - }
+ { pop$ #0 "I can't cope with more than two Japanese year digits in "
+ cite$ * warning$
+ }if$
+ }if$
+ a + int.to.str$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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".
+%
+% \spec{\item A string in the form: {\tt 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.}
+% {\item {\tt itemcount} is set to {\tt 2} (one more is added
+% by the {\tt format.date} function in which is function is
+% nested).
+% \item Six stack items are output---see {\tt extract.date}
+% for details on stack syntax.}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {format.jdate}
+ { duplicate$ #2 global.max$ substring$ gather.chars
+ pop$ 't := swap$
+ #1 #1 substring$ duplicate$ "s" =
+ { pop$ t #1925 topup.date }
+ { duplicate$ "m" =
+ { pop$ t #1867 topup.date }
+ { duplicate$ "t" =
+ { pop$ t #1911 topup.date }
+ { duplicate$ "h" =
+ { t #1988 topup.date }
+ { "invalid Imperial calendar code in " cite$ * warning$
+ }if$
+ }if$
+ }if$
+ }if$
+ swap$
+ gather.chars
+ pop$ swap$
+ gather.chars
+ pop$ swap$ pop$ 't := swap$ "default" swap$ t swap$ "default"
+ swap$ "default"
+ #2 'itemcount :=
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{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.
+%
+% \spec{\item A single string in appropriate date syntax.}
+% {\item none}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {format.date}
+ { empty.to.null 's :=
+ #0 'charcount :=
+ #0 'itemcount :=
+ #0 'date.specials :=
+ { s empty$ not }
+ { s gather.chars
+ duplicate$ "letter" =
+ { pop$ duplicate$ character.length #1 = itemcount not and
+ { pop$ pop$ s format.jdate "" 's := }
+ { duplicate$ character.length #3 =
+ { swap$ 's :=
+ parse.month "month" #1 'date.specials := }
+ { swap$ 's :=
+ pop$ "1" "invalid date in " cite$ * warning$
+ "default"
+ }if$
+ }if$
+ }
+ { "numeral" =
+ { duplicate$ character.length #1 =
+ { swap$ 's := "default" }
+ { duplicate$ character.length #2 =
+ { swap$ 's := "default" }
+ { duplicate$ character.length #4 =
+ { swap$ 's := "default" }
+ { swap$ 's := pop$ "1"
+ "invalid numerical element in date for " cite$ * warning$
+ "default"
+ }if$
+ }if$
+ }if$
+ }
+ { swap$ 's := pop$ "1"
+ "failed to parse date in " cite$ * warning$
+ "default"
+ }if$
+ }if$
+ itemcount #1 + 'itemcount :=
+ }while$
+ extract.date
+ }
+% \end{macrocode}
+%
+% \subsubsection{Entry type specific functions}
+% The functions below should not be used as general utilities;
+% they are designed specifically for use with a particular entry
+% type. While they could be placed directly into the entry
+% functions to which they apply, defining them separately
+% helps improve the transparency of the code.
+%
+% \DescribeEnv{j.format.division}
+% This function assembles the various fields relevant to the
+% division of a Japanese court into a single string.
+%
+% \spec{\item none}
+% {\item A single string}
+% {\option{none}}
+%
+% \begin{macrocode}
+FUNCTION {j.format.division}
+ { division empty$
+ { "" }
+ { dc.. court "end" first.in.second
+ { " no.~" 's := "endlabel" 't := }
+ { sc.. court "start" first.in.second
+ { "No.\ " 's := "frontlabel" 't := }
+ { " " 's := "endlabel" 't :=
+ }if$
+ }if$
+ }if$
+ division s divno t field.tag.no.combine
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{format.thesis.type}
+% The function "format.thesis.type" returns either the
+% (case-changed) type field,
+% if it is defined, or else the default string already on the
+% stack
+% (like ``Master's thesis'' or ``PhD thesis'').\footnote{This
+% comment by Oren Patashnik.}
+%
+% \spec{\item One string, representing the default label for a
+% thesis}
+% {\item One string, to stand as the label for a thesis}
+% {\option{none}}
+% \begin{macrocode}
+%<*oldbdoc>
+FUNCTION {format.thesis.type}
+{ type empty$
+'skip$
+{ pop$
+type "t" change.case$
+}
+if$
+}
+%</oldbdoc>
+% \end{macrocode}
+%
+% \DescribeEnv{format.tr.number}
+% The function "format.tr.number" makes a string starting with
+% ``Technical Report''
+% (or type, if that field is defined), followed by the number if
+% there is one;
+% it returns the starting part (with a case change) even if there
+% is no number.
+% This is used at the beginning of a sentence.\footnote{This
+% comment by Oren Patashnik.}
+%
+% \spec{\item none}
+% {\item One string, the label for a technical report}
+% {\option{none}}
+%
+% \begin{macrocode}
+%<*oldbdoc>
+FUNCTION {format.tr.number}
+{ type empty$
+{ "Technical Report" }
+'type
+if$
+number empty$
+{ "t" change.case$ }
+{ number tie.or.space.connect }
+if$
+}
+%</oldbdoc>
+% \end{macrocode}
+%
+% \subsubsection{Entry type functions}
+% Now we define the type functions for all entry types that may
+% appear
+% in the {\tt*.bib} file---e.g., functions like `"article"' and
+% `"book"'. These
+% are the routines that actually generate the "*.bbl" file output
+% for
+% the entry. These must all precede the "READ" command. In
+% addition, the
+% style designer should have a function `"default.type"' for
+% unknown types.\footnote{This comment by Oren Patashnik.}
+%
+% \DescribeEnv{article}
+% This function performs the necessary operations for
+% exporting a valid \LexiTeX\ citation to an article.
+% For this and for all citation types defined in the
+% \LexiBib{} style, the goal is to provide reasonably
+% complete commentary, so that anyone wanting to
+% alter the behaviour of the style can set to work
+% with a fair degree of confidence about what needs to
+% be done to achieve a particular result.
+% \begin{macrocode}
+FUNCTION { article }
+% \end{macrocode}
+% The "article" entry is used for all kinds of material, so
+% it ends up as one of the most complex entries. Before we
+% do anything, we have to check whether the default \LexiTeX{}
+% bridges are acceptable. If the volume and the number are both
+% non-empty, we need to add a special set of substitute bridges.
+% \begin{macrocode}
+{ volume empty$ number empty$ and not
+ { "\bridges{,\ p.~}{,\ }{,\ }{\ at~}{\ at~}"
+ "" "" must.must.must
+ newline$ }
+ 'skip$
+ if$
+% \end{macrocode}
+% Then we write the citation leader, to prepare for outputting the
+% actual content of the citation text.
+% \begin{macrocode}
+ "\lexibib{article}{" cite$ "}{" must.must.must
+% \end{macrocode}
+% The author name is pushed to the stack, followed by a toggle
+% to trigger last-name-only formatting. Then the "format.names"
+% reduces this to a single, appropriately-formatted string,
+% possibly the null string. All that is left to do is push a
+% set a braces, a null string to make up three arguments to the
+% export routine, and write the lot on the output
+% file unconditionally, using "must.must.must".
+% \begin{macrocode}
+author "lastonly" format.names
+"}{"
+""
+must.must.must
+% \end{macrocode}
+% Next comes the title of the article. This is not specially
+% formatted; we simply push the title field, then a warning
+% string
+% followed by a check for whether it is empty or not, then
+% braces and a null string, and write again.
+% \begin{macrocode}
+title "title" check
+"}{"
+""
+must.must.must
+% \end{macrocode}
+% The next bit is actually rather thorny. Our first
+% formatting decision is based on whether or not there
+% is a "volume" for this source. If not, we adopt a
+% Commonwealth-style citation scheme, using the bracketed
+% year for the volume. This will be coupled with suppression
+% of the year in the final LexiTeX ``field''.
+% \begin{macrocode}
+volume empty$
+ { "[" year format.date theyear "] " must.must.must
+ number "\ " journal "journal" check might.ifone.must
+ }
+% \end{macrocode}
+% If there {{\em is\/} a volume, we make different formatting
+% decisions, depending on
+% whether an issue number exists for this source.
+% \begin{macrocode}
+ { number empty$
+% \end{macrocode}
+% If there is no number, we do as follows. We
+% push the volume, providing
+% a warning if it it is empty, then
+% a separating space, then the name of the journal, writing
+% all three on the output, or just the journal name if the
+% volume number is empty. This is a nice illustration of
+% the utility of the "might.ifone.must" export routine.
+% The braces are pushed and written separately.
+% \begin{macrocode}
+ { volume "volume" check
+ "\ "
+ journal "journal" check
+ might.ifone.must }
+% \end{macrocode}
+% If the "number" field was non-empty, then we do as follows.
+% The journal name goes up first, and is checked. Then the
+% bridge for the volume number, and the volume number itself
+% go up, both being checked. The "must.ifthree.might" export
+% routine will drop the bridge and number, if the volume number
+% was empty, although this will probably leave us with an incomplete
+% (but nice-looking) citation anyway. The we push a bridge to
+% the number, the issue number, and a null string,
+% and force all three on the
+% output (no need for conditions in this last action, since we
+% know already that "number" is non-empty.
+% \begin{macrocode}
+ { journal "journal" check
+ ", \\vol.~"
+ volume "volume" check
+ must.ifthree.might
+ ", no.~" number "\\" must.must.must
+ }if$
+ }if$
+% \end{macrocode}
+% Finally, we complete the second \LexiTeX{} argument
+% and start the next. The emply strings just take up space
+% of course.
+% \begin{macrocode}
+ "}{" "" "" must.must.must
+% \end{macrocode}
+% The Blue Book does not like page ranges
+% so we need to clean
+% out anything following a dash in the "pages" field. The
+% "short" option
+% toggles this behaviour on. We also check to see that the page
+% is not empty. This is followed by braces, a null string, and
+% output.
+% \begin{macrocode}
+pages "short" format.pages "pages" check
+"}{"
+""
+must.must.must
+% \end{macrocode}
+% We add the year next, but only if the "volume" field is
+% non-empty (if "volume" is empty, we'll have put the year
+% is as a bracketed volume number, Commonwealth-style.
+% We could use just the year (this is normal for Blue Book
+% style, but we'll add the month for good measure, if it's
+% been provided in the "year" field.
+% \begin{macrocode}
+volume empty$
+ 'skip$
+ { year format.date themonth "short" format.month.name
+ "\ " theyear might.ifone.must
+ }if$
+% \end{macrocode}
+% Finally, we have to tangle with cross-references.
+% Yuck. (Not a complaint about \BibTeX, just a general
+% response to the design problems inherent in the task).
+% Formatting depends on whether there is a "crossref" entry.
+% Hear that, guys? If you don't use the "crossref" field,
+% we'll short-change you on formatting service.
+% \begin{macrocode}
+crossref empty$
+% \end{macrocode}
+% If there is no "crossref", we just push a brace and a couple
+% of nulls, and write. Done! Hurray!
+% \begin{macrocode}
+{ "}" "" "" must.must.must }
+% \end{macrocode}
+% But if there {\em was\/} a "crossref", we've go work to do.
+% Darn. The first thing we do is have a look at "booktitle".
+% This should be non-null in this situation; there's no sense
+% setting up a cross-reference to an individual volume of
+% a journal unless there's something special to be said
+% about it.
+% \begin{macrocode}
+{ booktitle empty$
+% \end{macrocode}
+% So if no "booktitle" is found, we whinge and format
+% as for a no-cross-reference entry.
+% \begin{macrocode}
+ { "no booktitle (name of special issue) for "
+ cite$ "/" crossref * * * warning$
+ "}" "" "" must.must.must }
+% \end{macrocode}
+% If there {\em is\/} a "booktitle", though,
+% and if the "volume" field is non-empty (which
+% means that we just printed, or at least should
+% have printed, the year), we close the
+% parens following the year (which is opened by \LexiTeX),
+% and open another (which will be closed by \LexiTeX).
+% That's it for conditional punctuation; we follow
+% with "booktitle", which should be
+% the title or subject description of the special
+% issue of the journal.
+% \begin{macrocode}
+ { volume empty$ {""} {") ("} if$ booktitle "}" must.must.must}
+ if$
+}if$
+% \end{macrocode}
+% Add a fresh new line in the export file, and we're done! Whew!
+% \begin{macrocode}
+newline$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{book}
+% This is the entry for books, which includes individual
+% volumes in a series, and multi-volume works with a single
+% title. Correct me if I'm wrong, but I think this latter
+% citation type is not supported by \BibTeX. \LexiBib{}
+% manages it by allowing the user to specify the volume
+% number in the text using the optional ":<number>:" argument to
+% the "\lexicite" tag.
+% \begin{macrocode}
+FUNCTION {book}
+% \end{macrocode}
+% After the opener, we push the opening macro tag for a book
+% entry, the nickname of the citation, and a couple of
+% braces. This is all mandatory and can safely be given
+% unconditional export.
+% \begin{macrocode}
+{ "\lexibib{book}{" cite$ "}{" must.must.must
+% \end{macrocode}
+% A non-empty "volume" field means we need a leading
+% volume number in the Blue Book style. If a volume
+% number (or anything else) is found in the "volume"
+% field of a book entry, we replace it with a
+% "volno" macro. This will expand in the document to
+% whatever the author has specified using the optional
+% ":<number>" argument to "\lexicite". For example,
+% volume 8 of "holdsworth" would be: "\lexicite:8:{holdsworth}".
+% \begin{macrocode}
+ volume empty$
+ { "" }
+ { "\volno " }
+ if$
+% \end{macrocode}
+% The author comes first. We push the contents of the
+% "author" field, then the toggle string ``"firstinitial"'',
+% and run the "format.names" function to produce the name
+% formatted properly for a book entry. Then we push
+% fa couple of braces
+% and force all three items ("\volno" or null, author, and
+% braces) onto the output.
+% \begin{macrocode}
+ author
+ "firstinitial" format.names "}{" must.must.must
+% \end{macrocode}
+% The title is very straightforward. We push the title, then
+% check to be sure it's non-empty, then a couple of braces
+% go up, filled out with a null string, and force all three
+% onto the output.
+% \begin{macrocode}
+ title "title" check "}{" "" must.must.must
+% \end{macrocode}
+% We're now in the final ``field'' of the \LexiTeX{} entry.
+% This is mainly for the year, but we also give the
+% name of the editor(s) or translator(s)
+% if present. If there is no
+% editor or translator, we'll put a series name here, to help identify
+% the source. We don't put both, because this would
+% confuse things (there can be book editors and
+% series editors too, and the Blue Book style is
+% too streamlined to distinguish the two elegantly).
+% So our first task is to see if there is an editor\ldots
+% \begin{macrocode}
+ editor empty$ translator empty$ and
+% \end{macrocode}
+% \ldots{} and if there is none, we put in a
+% series name if it exists.
+% The "series" \BibTeX{} field should be used for the
+% name of the series of which a volume forms a part,
+% but some folks might accidentally use "booktitle".
+% We'll be forgiving and accept it anyway.
+% \begin{macrocode}
+ { series empty$ booktitle empty$ and
+% \end{macrocode}
+% If both
+% "series" and "booktitle" are empty, we've nothing to do.
+% \begin{macrocode}
+ 'skip$
+% \end{macrocode}
+% If at least one is non-empty, we push both,
+% and cull them to just one using the "either.or" function.
+% If only one is non-empty, this function leaves that one;
+% if both are non-empty, the "either.or" function whinges
+% and chooses one arbitrarily.
+%
+% Next, we push a bridge and a series item number,
+% and a toggle for the "field.tag.no.combine" function.
+% The "endlabel" toggle causes this function to put
+% the bridge and the number after the series name,
+% if a number exists, and push the lot back as a single
+% item on the stack. Otherwise it leaves just the series
+% name.
+%
+% And last, we put up a comma to close, and do a mandatory
+% export of the lot.
+% \begin{macrocode}
+ { series booktitle either.or " No.~" number
+ "endlabel" field.tag.no.combine ", " "" must.must.must }
+ if$
+ }
+% \end{macrocode}
+% If either the editor or the translator fields were not empty,
+% we format the editor or translator name
+% instead, and put those details here.
+% \begin{macrocode}
+ { editor translator either.or "firstinitial" format.names
+% \end{macrocode}
+% We need to append the correct designator, either ``ed.''\ or
+% ``trans.''. The "either.or" function will use the second
+% item pushed if both are non-empty, so we take advantage of
+% this ``feature'' in making our choice of designators; the
+% "ed." or "eds." strings are only used if the "translator"
+% field is empty. And finally, we push a null string to
+% round out, and do a compulsory export.
+% \begin{macrocode}
+ translator empty$
+ { editor num.names$ #1 >
+ { " eds.\ " }
+ { " ed.\ " }
+ if$
+ }
+ { " trans.\ " }
+ if$
+ "" must.must.must
+ }if$
+% \end{macrocode}
+% We also need to indicate the edition, if any.
+% \begin{macrocode}
+ edition " ed.\ " "" might.ifone.must
+% \end{macrocode}
+% The year itself is easy. We push the year, do a check to issue
+% a warning if necessary, then run format.date over it,
+% which yields the year in "theyear", which can be pushed
+% back onto the stack. Then we fill out to six
+% \LexiTeX{} fields in
+% all, and do a compulsory export.
+% \begin{macrocode}
+ year "year" check format.date theyear "}{}{}" "" must.must.must
+% \end{macrocode}
+% A new line for a new macro, and we're done! Rejoice!
+% On to the next function definition!
+% \begin{macrocode}
+ newline$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{incollection}
+% This is for those nasty entries that are created when someone
+% publishes an article in a collection of essays edited by someone
+% else.
+% \begin{macrocode}
+FUNCTION{incollection}
+{ "\lexibib{article}{" cite$ "}{" must.must.must
+ author "lastonly" format.names "author" check
+ "}{" "" must.must.must
+ title "title" check
+ "}{" "" must.must.must
+ chapter empty$
+ { "" }
+ { "\\" chapter " of \\" * * }
+ if$
+ booktitle "booktitle" check
+ "}{" must.must.must
+ pages "short" format.pages "pages" check
+ "}{" "" must.must.must
+% We're now in the final ``field'' of the \LexiTeX{} entry.
+% The coding here is the same as for a "book" entry; the
+% reader is referred to that entry for the commentary
+% on the following code.
+% \begin{macrocode}
+ editor empty$ translator empty$ and
+ { series empty$ booktitle empty$ and
+ 'skip$
+ { series booktitle either.or " No.~" number
+ "endlabel" field.tag.no.combine ", " "" must.must.must }
+ if$
+ }
+ { editor booktranslator either.or "firstinitial" format.names
+ booktranslator empty$
+ { editor num.names$ #1 >
+ { " eds.\ " }
+ { " ed.\ " }
+ if$
+ }
+ { " trans.\ " }
+ if$
+ "" must.must.must
+ }if$
+ edition " ed.\ " "" might.ifone.must
+ year "year" check format.date theyear "}" "" must.must.must
+ newline$
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION{booklet}
+{ "\lexibib{man}{" cite$ "}{" must.must.must
+ author "}{" "" must.must.must
+ "\\" title "\\}{" must.must.must
+ howpublished ", " "" might.ifone.must
+ year "year" check format.date theyear
+ "}{}{}" "" must.must.must
+ newline$
+}
+% \end{macrocode}
+% \changes{1.0g}{1994/12/12}{Added the `techreport' function,
+% to support draft article sent to Pedro Aphalo for comments.}
+% \begin{macrocode}
+FUNCTION {techreport}
+{"\lexibib{man}{" cite$ "}{" must.must.must
+ author "full" format.names "author" check
+ "}{" title "title" check must.must.must
+ "}{"
+ type empty$
+ { "Technical report" }
+ { type
+ }if$
+ " no.~" number "endlabel" field.tag.no.combine
+ ", " must.must.must
+ year format.date
+ themonth empty$
+ { "" }
+ { themonth "short" format.month.name "\ " * }
+ if$
+ theyear
+ "}{}{}{}" must.must.must
+ newline$
+ }
+% \end{macrocode}
+%
+% \paragraph{Cases} Law cases are all entered using the
+% {\tt\string@CASE} entry type. The formatting of citations
+% varies from jurisdiction to jurisdiction, so the behaviour
+% of citations of this type is controlled via a "jurisdiction"
+% field. Supported jurisdictions are listed in the user
+% guide. Below, the functions for each jurisdiction are
+% defined first, followed by the "case" function itself.
+%
+% \DescribeEnv{j.case}
+% This function applies to cases from Japan.
+% \begin{macrocode}
+FUNCTION { j.case }
+{ "\lexibib{jcase}{" cite$ "}{" must.must.must
+ "Decision of the " court "court" check "" must.must.must
+ " (" j.format.division ")" iftwo.might.iftwo
+ ", " "" "" must.must.must
+ casedate format.date themonth "short" format.month.name "\ "
+ theday must.must.must
+ ", " theyear "}{" must.must.must
+ volume empty$ not number empty$ not and
+ { journal "journal" check ", no.~" number must.must.must
+ ", vol.~" volume "" must.must.must }
+ { volume number either.or "\ " journal "journal" check
+ might.ifone.must
+ "}{" pages "}{" must.must.must
+ }if$
+ year "year" check empty.to.null format.date
+ themonth "short" format.month.name " " "" might.ifone.must
+ theday ", " "" might.ifone.must
+ theyear "}" "{}" must.must.must
+ newline$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{e.case}
+% This function applies to English cases.
+% \begin{macrocode}
+FUNCTION { e.case }
+{ "\lexibib{ecase}{" cite$ "}{" must.must.must
+ title "title" check "}{" "" must.must.must
+ year "year" check format.date "[" theyear "] " must.must.must
+ journal "}{" "" must.must.must
+ pages "short" format.pages "}" "{}{}{}" must.must.must
+ newline$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{p.case}
+% This function applies to Pakistani cases.
+% \begin{macrocode}
+FUNCTION {p.case}
+{e.case}
+% \end{macrocode}
+%
+% \DescribeEnv{us.case}
+% This function applies to U.S. cases.
+% \begin{macrocode}
+FUNCTION { us.case }
+{"\lexibib{case}{" cite$ "}{" must.must.must
+ title "title" check "}{" "" must.must.must
+ volume "\ " journal must.must.must
+ "}{" pages "}{" must.must.must
+ court "court" check "\ " year format.date theyear
+ might.ifone.must
+ "}{}{}" "" "" must.must.must
+ newline$
+}
+% \end{macrocode}
+
+% \DescribeEnv{case}
+% This function simply reads the contents of the "jurisdiction"
+% field, and invokes the appropriate case function.
+% \begin{macrocode}
+FUNCTION { case }
+ { jurisdiction empty.to.null duplicate$ "jurisdiction (sine qua non!)" check
+ "japan" =
+ { pop$ j.case }
+ { duplicate$ "england" =
+ { pop$ e.case }
+ { duplicate$ "pakistan" =
+ { pop$ p.case }
+ { duplicate$ "singapore" =
+ { pop$ e.case }
+ { pop$ us.case
+ }if$
+ }if$
+ }if$
+ }if$
+% \end{macrocode}
+% The following item adds annotations; this may be eliminated by
+% stripping with "noannotes".
+% \begin{macrocode}
+%<*!noannotes>
+annote empty.to.null write$ newline$
+%</!noannotes>
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{j.statute}
+% This function applies to Japanese statutory materials.
+% \changes{\LexiBib 1.0c}{94/08/03}{Added support for Japanese statutes.}
+% \begin{macrocode}
+FUNCTION {j.statute}
+ { "\lexibib{jstatute}{" cite$ "}{" must.must.must
+ title "title" check "}{" "" must.must.must
+ "Law no.~" number "number" check " of "
+ iftwo.might.iftwo
+ year format.date theyear "}{}{}{}" "" must.must.must
+ newline$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{s.statute}
+% This function formats a statute entry for Singapore.
+% \begin{macrocode}
+FUNCTION { s.statute }
+{ "\lexibib{statute}{" cite$ "}{" must.must.must
+ title "title" check ", No.~" number
+ "got it" warning$ "endlabel" field.tag.no.combine
+ number empty$
+ { "\ " * }
+ { "\ of " * }
+ if$
+ year format.date theyear "}{" must.must.must
+ "}{}{}{}{}" "" "" must.must.must
+ newline$
+}
+% \end{macrocode}
+%
+% \DescribeEnv{statute}
+% This function selects the correct statute entry function.
+% \begin{macrocode}
+FUNCTION { statute }
+ { jurisdiction empty.to.null duplicate$
+ "japan" =
+ { pop$ j.statute }
+ { duplicate$ "singapore" =
+ { pop$ s.statute }
+ { pop$ "IMPORTANT: unknown jurisdiction for " cite$ * warning$
+ }if$
+ }if$
+ }
+% \end{macrocode}
+%
+% \DescribeEnv{default.type}
+% We use the "book" type as our default type. When "manual" is
+% completed, we should probably use that type instead.
+% \begin{macrocode}
+FUNCTION {default.type} { book }
+%</newbst>
+% \end{macrocode}
+%
+%
+% \subsection{Macro definitions}
+% We don't define any macros for abbreviating law journal
+% names. Instead, we will use Blue Book abbreviations
+% ``native'', with a special syntax (probably the full
+% form in syntax:
+% ``"\gobble{Accountant}{}"'' immediately after
+% the abbreviation) for resolving
+% ambiguous abbreviations. Meanwhile, trust me: use the
+% Blue Book abbreviations and take this upcoming facility
+% on faith. And besides, do you ever {\em need\/} to spell
+% out journal and reporter names?
+%
+% \subsection{Execution}
+% With all preliminaries out of the way, our first act is
+% to read in the entries from {\tt *.bib}..
+% \begin{macrocode}
+%<*newbst>
+READ
+% \end{macrocode}
+% Then we say ``Hi'' to the user. It would be nice to make this
+% the first message, but the structure of \BibTeX{} style files
+% dictates that it will follow any warnings about missing
+% entries.
+% \begin{macrocode}
+EXECUTE {hello}
+% \end{macrocode}
+%
+% \DescribeEnv{begin.bib}
+% \DescribeEnv{end.bib}
+% We need a couple of functions to write the starting and
+% finishing strings on to output file.
+% \begin{macrocode}
+FUNCTION {begin.bib}
+ { "\begin{lexilist}" write$ newline$
+ }
+FUNCTION {end.bib}
+ { "\end{lexilist}" write$ newline$
+ }
+% \end{macrocode}
+% Now we put it all together by running the entry-type
+% function on each entry selected from the database in turn,
+% bracketed by the starting and ending output functions
+% just defined.
+% \begin{macrocode}
+EXECUTE {begin.bib}
+ITERATE {call.type$}
+EXECUTE {end.bib}
+%</newbst>
+% \end{macrocode}
+% And, er, that's it!
+%
+% \section{Extraction utilities}
+% \subsection{The Driver}
+% Here is a simple driver for extracting the files in the
+% package.
+% \begin{macrocode}
+%<*driver>
+\def\batchfile{lexibib.ins}
+\input docstrip
+\preamble
+%
+\endpreamble
+\generateFile{lexibib.man}{t}{\from{lexibib.doc}{manual}}
+\generateFile{lexitest.tex}{t}{\from{lexibib.doc}{testdoc}}
+\postamble
+\endpostamble
+\generateFile{lexitest.bib}{t}{\from{lexibib.doc}{testbib}}
+\generateFile{lexibib.bst}{t}{\from{lexibib.doc}{newbst}}
+%</driver>
+% \end{macrocode}
+% \subsection{The Manual}
+% This is a simple driver that generates the documentation.
+% \begin{macrocode}
+%<*manual>
+\let\lawhline=\hline
+\documentclass{ltxdoc}
+\usepackage{lexitexm}
+% \makebooktable
+\EnableCrossrefs
+\RecordChanges % Gather update information
+\CodelineIndex % Index code by line number
+%\OnlyDescription % comment out for implementation details
+\begin{document}
+\DocInput{lexibib.doc}
+\end{document}
+%</manual>
+% \end{macrocode}
+% \begin{macrocode}
+%<*testbib>
+@STRING{tdc..="Tokyo District Court"}
+@STRING{minjibu..="Civil Division"}
+@STRING{ksh..="Kin'y{\=u} sh{\=o}ji hanrei"}
+@PREAMBLE{ "\newcommand{\kk}{K.K. } "
+ # "\newcommand{\v}{v.~} " }
+@book{tanaka-tekisuto,
+ author = {Akira Tanaka and others},
+ title = {Tekisutobukku Tegata, Kogitte H{\=o}},
+ year = {1987},
+ publisher = {Y{\=u}hikaku Bukkusu},
+ subject = {commtrans}
+}
+@case{tdc.s57.9.27,
+ journal = ksh..,
+ volume = {663},
+ annote = {
+ \holding{
+ \item The Business Suspension Sanction of the Notes
+Clearing Center falls
+ within the terms of the explicit exemption of Notes and
+Cheque Clearing
+ Centers from the terms of Anti-Monopoly Act section 8, as
+a practice
+ necessary to the specialized function of such Centers.
+ }},
+ court = tdc..,
+ division = minjibu..,
+ divno = {30},
+ casedate = {s57.9.27},
+ page = {35},
+ jurisdiction = {j},
+ subject = {commtrans: aml attack on clearing system}
+}
+@book{horitsu-jiten,
+ title = {H\=oritsu jiten},
+ year = {s11.3.10},
+ editor = {? Suehiro and ? Tanaka},
+ publisher = {Iwanami sh\=oten},
+ volume = {1},
+ subject = {general}
+}
+%</testbib>
+% \end{macrocode}
+% \begin{macrocode}
+%<*testdoc>
+\documentclass{article}
+\usepackage{lexitex}
+\begin{document}
+\bibliography{lexitest}
+\bibliographystyle{lexibib}
+Waffle burble.\footnote{\lexicite{tanaka-tekisuto}.}
+More waffle and burble.\footnote{\lexicite:2:{horitsu-jiten}.}
+\lexicite{tdc.s57.9.27}:
+\theholding
+\end{document}
+%</testdoc>
+% \end{macrocode}
+% \changes{no ver}{84/12/16}{ (HWT) Original `plain'
+% version, by Howard Trickey.}
+% \changes{no ver}{84/12/23}{ (LL) Some comments made
+% by Leslie Lamport.}
+% \changes{no ver}{85/2/16}{ (OP) Changes based on
+% LL's comments, Oren Patashnik.}
+% \changes{no ver}{85/2/17}{ (HWT) Template file and
+% other standard styles made.}
+% \changes{0.98b}{85/3/28}{ (OP) First
+% release, for BibTeX 0.98f.}
+% \changes{0.98c}{85/5/9}{ (OP) for BibTeX
+% 0.98i:
+% fixed Theoretical Computer Science macro name;
+% fixed the format.vol.num.pages function.}
+% \changes{0.99a}{88/1/24}{ (OP) for BibTeX
+% 0.99a, main changes:
+% assignment operator (:=) arguments reversed;
+% the preamble$ function outputs the database
+% PREAMBLE;
+% entry.max$ and global.max$ (built-in) variables
+% replace
+% entry.string.max and global.string.max functions;
+% alphabetizing by year then title, not just title;
+% many unnecessary ties removed; \it ==> \em;
+% the `alpha' style uses a superscripted `+'
+% instead of a
+% `*' for unnamed names in constructing the label;
+% the `abbrv' style now uses "Mar." and "Sept.";
+% the functions calc.label and presort now look at
+% just
+% the fields they're supposed to;
+% BOOKLET, MASTERSTHESIS, TECHREPORT use nonbook
+% titles;
+% INBOOK and INCOLLECTION take an optional type
+% (e.g.
+% type = "Section"), overriding the default
+% "chapter";
+% BOOK, INBOOK, INCOLLECTION, and PROCEEDINGS now
+% allow
+% either volume or number, not just volume;
+% INCOLLECTION now allows an edition and series
+% field;
+% PROCEEDINGS and INPROCEEDINGS now use the address
+% field
+% to tell where a conference was held;
+% INPROCEEDINGS and PROCEEDINGS now allow either
+% volume
+% or number, and also a series field;
+% MASTERSTHESIS and PHDTHESIS accept types other
+% than
+% "Master's thesis" and "PhD thesis";
+% UNPUBLISHED now outputs, in one block, note then
+% date;
+% MANUAL now prints out the organization in
+% the first block if the author field is empty;
+% MISC can't be empty---it requires some optional
+% field.}
+% \changes{0.99b}{88/3/23}{ (OP) For BibTeX
+% 0.99c---changed the three
+% erroneous occurrences of `{\tt cite }'
+% to `{\tt cite\$ }';
+% this
+% change didn't affect the four standard styles,
+% so the
+% 0.99a versions of those styles are still
+% current.}
+%
+% \changes{\LexiBib{} 1.0}{94/6/12}{ (FB) Copied into
+% {\tt btxbst.doc} to {\tt lexibib.doc} and commenced editing.}
+% \changes {\LexiBib{} 1.0a}{94/7/25}{(FB) First successful
+% trial of \LexiBib.}
+% \changes{\LexiBib{} 1.0b}{94/8/9}{(FB) Completed first
+% operational version, with date parsing, for use with
+% articles, books and Japanese case materials.}
+% \Finale \PrintIndex \PrintChanges
+
+
+
diff --git a/macros/latex/contrib/lexitex/lexismp1.tex b/macros/latex/contrib/lexitex/lexismp1.tex
new file mode 100644
index 0000000000..f6b357e2f3
--- /dev/null
+++ b/macros/latex/contrib/lexitex/lexismp1.tex
@@ -0,0 +1,1150 @@
+% lexismp1.tex
+% To process this file, you will need the bibliography
+% btxdoc.bib, at:
+%
+% /ctan/tex-archive/biblio/bibtex/distribs/doc/btxdoc.bib
+%
+% NOTE: This is simply the original btxdoc.tex file, with the
+% following minor changes:
+% (a) [lexitex] has been inserted after \documentstyle
+% (b) the leading ~ has been removed from the \cite tags
+% (c) the \lexiforcefoots tag was inserted
+% (d) new \bibliography and \bibliographystyle commands
+% were inserted at the top, and those at the end were
+% commented out.
+% (e) the \cite command was defined to be \lexicite
+% (f) the page reference for `chicago' is put in the document
+% according to standard LexiTeX practice. This difference
+% makes BibTeX and LexiTeX `incompatible' to a degree
+% (you need to put pinpoint references into the document
+% for LexiTeX), but pinpointing references are much easier
+% to handle as part of the document---you need to specify
+% them while you're doing the writing, not when you're
+% collecting material---so the difference is worth the candle.
+%
+% There will be errors in the BibTeX log; the `inbook' and
+% `unpublished' citation types have not yet been defined in
+% lexibib.bst. But you'll get the idea---try it!
+%
+% Original is Copyright (C) 1988 Oren Patashnik, all rights reserved.
+
+\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
+ T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
+
+\title{B\kern-.05em{\large I}\kern-.025em{\large B}\kern-.08em\TeX ing}
+\author{Oren Patashnik}
+\date{February 8, 1988}
+
+\documentstyle[lexitex]{article}
+
+\begin{document}
+\def\cite{\lexicite}
+\bibliography{btxdoc}
+\bibliographystyle{lexibib}
+\lexiforcefoots
+
+\maketitle
+
+\section{Overview}
+
+[This document will be expanded when \BibTeX\ version 1.00 comes out.
+Please report typos, omissions, inaccuracies,
+and especially unclear explanations
+to me ({\tt patashnik@SCORE.STANFORD.EDU}).
+Suggestions for improvements are wanted and welcome.]
+
+This documentation, for \BibTeX\ version 0.99b,
+is meant for general \BibTeX\ users;
+bibliography-style designers should read this document
+and then read ``Designing \BibTeX\ Styles''\cite{btxhak},
+which is meant for just them.
+
+This document has three parts:
+Section~\ref{differences}
+describes the differences between versions 0.98i and 0.99b
+of \BibTeX\ and between the corresponding versions of the standard styles;
+Section~\ref{latex-appendix}
+updates Appendix~B.2 of the \LaTeX\ book\cite{latex};
+and Section~\ref{odds-and-ends}
+gives some general and specific tips
+that aren't documented elsewhere.
+It's assumed throughout that you're familiar with
+the relevant sections of the \LaTeX\ book.
+
+This documentation also serves as sample input to help
+\BibTeX\ implementors get it running.
+For most documents, this one included, you produce the reference list by:
+running \LaTeX\ on the document (to produce the {\tt aux} file(s)),
+then running \BibTeX\ (to produce the {\tt bbl} file),
+then \LaTeX\ twice more (first to find the information in the {\tt bbl} file
+and then to get the forward references correct).
+In very rare circumstances you may need an extra \BibTeX/\LaTeX\ run.
+
+\BibTeX\ version 0.99b should be used with \LaTeX\ version 2.09,
+for which the closed bibliography format is the default;
+to get the open format, use the optional document style {\tt openbib}
+(in an open format there's a line break between major blocks of a
+reference-list entry; in a closed format the blocks run together).]
+
+Note: \BibTeX\ 0.99b is not compatible with the old style files;
+nor is \BibTeX\ 0.98i compatible with the new ones
+(the new \BibTeX, however, is compatible with old database files).
+
+Note for implementors: \BibTeX\ provides logical-area names
+\hbox{\tt TEXINPUTS:} for bibliography-style files and
+\hbox{\tt TEXBIB:} for database files it can't otherwise find.
+
+
+\section{Changes}
+\label{differences}
+
+This section describes the differences between
+\BibTeX\ versions 0.98i and 0.99b, and also between
+the corresponding standard styles.
+There were a lot of differences;
+there will be a lot fewer between 0.99 and 1.00.
+
+
+\subsection{New \BibTeX\ features}
+\label{features}
+
+The following list explains \BibTeX's new features and how to use them.
+\begin{enumerate}
+
+\item
+With the single command `\hbox{\verb|\nocite{*}|}'
+you can now include in the reference list
+every entry in the database files, without having to explicitly
+\verb|\cite| or \hbox{\verb|\nocite|} each entry.
+Giving this command, in essence,
+\hbox{\verb|\nocite|}s
+all the enties in the database, in database order,
+at the very spot in your document
+where you give the command.
+
+\item
+\label{concat}
+You can now have as a field value (or an {\tt @STRING} definition)
+the concatenation of several strings.
+For example if you've defined
+\begin{verbatim}
+ @STRING( WGA = " World Gnus Almanac" )
+\end{verbatim}
+then it's easy to produce nearly-identical
+{\tt title} fields for different entries:
+\begin{verbatim}
+ @BOOK(almanac-66,
+ title = 1966 # WGA,
+ . . .
+ @BOOK(almanac-67,
+ title = 1967 # WGA,
+\end{verbatim}
+and so on. Or, you could have a field like
+\begin{verbatim}
+ month = "1~" # jan,
+\end{verbatim}
+which would come out something like
+`\hbox{\verb|1~January|}' or `\hbox{\verb|1~Jan.|}' in the {\tt bbl} file,
+depending on how your bibliography style defines
+the {\tt jan} abbreviation.
+You may concatenate as many strings as you like
+(except that there's a limit to the overall length
+of the resulting field);
+just be sure to put the concatenation character `{\tt\#}'$\!$,
+surrounded by optional spaces or newlines,
+between each successive pair of strings.
+
+\item
+\BibTeX\ has a new cross-referencing feature,
+explained by an example.
+Suppose you say \hbox{\verb|\cite{no-gnats}|} in your document,
+and suppose you have these two entries in your database file:
+\begin{verbatim}
+ @INPROCEEDINGS(no-gnats,
+ crossref = "gg-proceedings",
+ author = "Rocky Gneisser",
+ title = "No Gnats Are Taken for Granite",
+ pages = "133-139")
+ . . .
+ @PROCEEDINGS(gg-proceedings,
+ editor = "Gerald Ford and Jimmy Carter",
+ title = "The Gnats and Gnus 1988 Proceedings",
+ booktitle = "The Gnats and Gnus 1988 Proceedings")
+\end{verbatim}
+Two things happen.
+First, the special \hbox{\tt crossref} field tells \BibTeX\
+that the \hbox{\tt no-gnats} entry should inherit
+any fields it's missing from
+the entry it cross references, \hbox{\tt gg-proceedings}.
+In this case it in inherits the two fields
+\hbox{\tt editor} and \hbox{\tt booktitle}.
+Note that, in the standard styles at least,
+the \hbox{\tt booktitle} field is irrelevant
+for the \hbox{\tt PROCEEDINGS} entry type.
+The \hbox{\tt booktitle} field appears here
+in the \hbox{\tt gg-proceedings} entry
+only so that the entries that cross reference it
+may inherit the field.
+No matter how many papers from this meeting exist in the database,
+this \hbox{\tt booktitle} field need only appear once.
+
+The second thing that happens:
+\BibTeX\ automatically puts the entry \hbox{\tt gg-proceedings}
+into the reference list if it's cross
+referenced by two or more entries that you
+\verb|\cite| or \hbox{\verb|\nocite|},
+even if you don't \verb|\cite| or \hbox{\verb|\nocite|}
+the \hbox{\tt gg-proceedings} entry itself.
+So \hbox{\tt gg-proceedings} will automatically appear
+on the reference list if one other entry
+besides \hbox{\tt no-gnats} cross references it.
+
+To guarantee that this scheme works, however,
+a cross-referenced entry must occur later in the database files
+than every entry that cross-references it.
+Thus, putting all cross-referenced entries at the end makes sense.
+(Moreover, you may not reliably nest cross references;
+that is, a cross-referenced entry may
+not itself reliably cross reference an entry.
+This is almost certainly not something you'd
+want to do, though.)
+
+One final note:
+This cross-referencing feature is completely unrelated
+to the old \BibTeX's cross referencing,
+which is still allowed.
+Thus, having a field like
+\begin{verbatim}
+ note = "Jones \cite{jones-proof} improves the result"
+\end{verbatim}
+is not affected by the new feature.
+
+\item
+\BibTeX\ now handles accented characters.
+For example if you have an entry with the two fields
+\begin{verbatim}
+ author = "Kurt G{\"o}del",
+ year = 1931,
+\end{verbatim}
+and if you're using the \hbox{\tt alpha} bibliography style,
+then \BibTeX\ will construct the label
+\hbox{[G{\"o}d31]} for this entry, which is what you'd want.
+To get this feature to work you must place the entire accented
+character in braces;
+in this case either \hbox{\verb|{\"o}|}
+or \hbox{\verb|{\"{o}}|} will do.
+Furthermore these braces must not themselves be
+enclosed in braces (other than the ones that might delimit
+the entire field or the entire entry);
+and there must be a backslash
+as the very first character inside the braces.
+Thus neither \hbox{\verb|{G{\"{o}}del}|}
+nor \hbox{\verb|{G\"{o}del}|} will work for this example.
+
+This feature handles all the accented characters and
+all but the nonbackslashed foreign symbols found in Tables
+3.1 and~3.2 of the \LaTeX\ book.
+This feature behaves similarly for ``accents'' you might define;
+we'll see an example shortly.
+For the purposes of counting letters in labels,
+\BibTeX\ considers everything contained inside the braces
+as a single letter.
+
+\item
+\BibTeX\ also handles hyphenated names.
+For example if you have an entry with
+\begin{verbatim}
+ author = "Jean-Paul Sartre",
+\end{verbatim}
+and if you're using the \hbox{\tt abbrv} style,
+then the result is `J.-P. Sartre'$\!$.
+
+\item
+\label{preamble}
+There's now an \hbox{\verb|@PREAMBLE|} command
+for the database files.
+This command's syntax is just like \hbox{\verb|@STRING|}'s,
+except that there is no name or equals-sign, just the string.
+Here's an example:
+\begin{verbatim}
+ @PREAMBLE{ "\newcommand{\noopsort}[1]{} "
+ # "\newcommand{\singleletter}[1]{#1} " }
+\end{verbatim}
+(note the use of concatenation here, too).
+The standard styles output whatever information you give this command
+(\LaTeX\ macros most likely) directly to the {\tt bbl} file.
+We'll look at one possible use of this command,
+based on the \hbox{\verb|\noopsort|} command just defined.
+
+The issue here is sorting (alphabetizing).
+\BibTeX\ does a pretty good job,
+but occasionally weird circumstances conspire to confuse \BibTeX:
+Suppose that you have entries in your database for
+the two books in a two-volume set by the same author,
+and that you'd like volume~1 to appear
+just before volume~2 in your reference list.
+Further suppose that there's now a second edition of volume~1,
+which came out in 1973, say,
+but that there's still just one edition of volume~2,
+which came out in 1971.
+Since the {\tt plain} standard style
+sorts by author and then year,
+it will place volume~2 first
+(because its edition came out two years earlier)
+unless you help \BibTeX.
+You can do this by using the {\tt year} fields below
+for the two volumes:
+\begin{verbatim}
+ year = "{\noopsort{a}}1973"
+ . . .
+ year = "{\noopsort{b}}1971"
+\end{verbatim}
+According to the definition of \hbox{\verb|\noopsort|},
+\LaTeX\ will print nothing but the true year for these fields.
+But \BibTeX\ will be perfectly happy pretending that
+\hbox{\verb|\noopsort|} specifies some fancy accent
+that's supposed to adorn the `a' and the~`b';
+thus when \BibTeX\ sorts it will pretend that
+`a1973' and `b1971' are the real years,
+and since `a' comes before~`b'$\!$, it will place volume~1 before volume~2,
+just what you wanted.
+By the way, if this author has any other works included
+in your database, you'd probably want to use instead something like
+\hbox{\verb|{\noopsort{1968a}}1973|} and
+\hbox{\verb|{\noopsort{1968b}}1971|},
+so that these two books would come out in a reasonable spot
+relative to the author's other works
+(this assumes that 1968 results in a reasonable spot,
+say because that's when the first edition of volume~1 appeared).
+
+There is a limit to the number of \hbox{\verb|@PREAMBLE|} commands
+you may use, but you'll never exceed this limit if
+you restrict yourself to one per database file;
+this is not a serious restriction,
+given the concatenation feature (item~\ref{concat}).
+
+\item
+\BibTeX's sorting algorithm is now stable.
+This means that if two entries have identical sort keys,
+those two entries will appear in citation order.
+(The bibliography styles construct these sort keys---%
+usually the author information followed by the year and the title.)
+
+\item
+\BibTeX\ no longer does case conversion for file names;
+this will make \BibTeX\ easier to install on Unix systems, for example.
+
+\item
+It's now easier to add code for processing a
+command-line {\tt aux}-file name.
+
+\end{enumerate}
+
+
+\subsection{Changes to the standard styles}
+
+This section describes changes to the standard styles
+({\tt plain}, {\tt unsrt}, {\tt alpha}, {\tt abbrv})
+that affect ordinary users.
+Changes that affect style designers appear in
+the document ``Designing \BibTeX\ Styles''\cite{btxhak}.
+\begin{enumerate}
+
+\item
+In general, sorting is now by ``author''$\!$, then year, then title---%
+the old versions didn't use the year field.
+(The {\tt alpha} style, however, sorts first by label,
+then ``author''$\!$, year, and title.)
+The quotes around author mean that some entry types
+might use something besides the author, like the editor or organization.
+
+\item
+Many unnecessary ties (\verb|~|) have been removed.
+\LaTeX\ thus will produce slightly fewer
+`\hbox{\tt Underfull} \verb|\hbox|' messages
+when it's formatting the reference list.
+
+\item
+Emphasizing (\hbox{\verb|{\em ...}|})
+has replaced italicizing (\hbox{\verb|{\it ...}|}).
+This will almost never result in a difference
+between the old output and the new.
+
+\item
+The {\tt alpha} style now uses a superscripted~`$^{+}$' instead of a~`*'
+to represent names omitted in constructing the label.
+If you really liked it the way it was, however,
+or if you want to omit the character entirely,
+you don't have to modify the style file---%
+you can override the~`$^{+}$' by
+redefining the \hbox{\verb|\etalchar|} command
+that the {\tt alpha} style writes onto the {\tt bbl} file
+(just preceding the \hbox{\verb|\thebibliography|} environment);
+use \LaTeX's \hbox{\verb|\renewcommand|} inside
+a database \hbox{\tt @PREAMBLE} command,
+described in the previous subsection's item~\ref{preamble}.
+
+\item
+The {\tt abbrv} style now uses `Mar.' and `Sept.'\
+for those months rather than `March' and `Sep.'
+
+\item
+The standard styles use \BibTeX's new cross-referencing feature
+by giving a \verb|\cite| of the cross-referenced entry and by
+omitting from the cross-referencing entry
+(most of the) information that appears
+in the cross-referenced entry.
+These styles do this when
+a titled thing (the cross-referencing entry)
+is part of a larger titled thing (the cross-referenced entry).
+There are five such situations:
+when (1)~an \hbox{\tt INPROCEEDINGS}
+(or \hbox{\tt CONFERENCE}, which is the same)
+cross references a \hbox{\tt PROCEEDINGS};
+when (2)~a {\tt BOOK}, (3)~an \hbox{\tt INBOOK},
+or (4)~an \hbox{\tt INCOLLECTION}
+cross references a {\tt BOOK}
+(in these cases, the cross-referencing entry is a single
+volume in a multi-volume work);
+and when (5)~an \hbox{\tt ARTICLE}
+cross references an \hbox{\tt ARTICLE}
+(in this case, the cross-referenced entry is really a journal,
+but there's no \hbox{\tt JOURNAL} entry type;
+this will result in warning messages about
+an empty \hbox{\tt author} and \hbox{\tt title} for the journal---%
+you should just ignore these warnings).
+
+\item
+The \hbox{\tt MASTERSTHESIS} and \hbox{\tt PHDTHESIS}
+entry types now take an optional {\tt type} field.
+For example you can get the standard styles to
+call your reference a `Ph.D.\ dissertation'
+instead of the default `PhD thesis' by including a
+\begin{verbatim}
+ type = "{Ph.D.} dissertation"
+\end{verbatim}
+in your database entry.
+
+\item
+Similarly, the \hbox{\tt INBOOK} and \hbox{\tt INCOLLECTION}
+entry types now take an optional {\tt type} field,
+allowing `section~1.2' instead of the default `chapter~1.2'$\!$.
+You get this by putting
+\begin{verbatim}
+ chapter = "1.2",
+ type = "Section"
+\end{verbatim}
+in your database entry.
+
+\item
+The \hbox{\tt BOOKLET}, \hbox{\tt MASTERSTHESIS},
+and \hbox{\tt TECHREPORT} entry types now format
+their \hbox{\tt title} fields as if they were
+\hbox{\tt ARTICLE} \hbox{\tt title}s
+rather than \hbox{\tt BOOK} \hbox{\tt title}s.
+
+\item
+The \hbox{\tt PROCEEDINGS} and \hbox{\tt INPROCEEDINGS}
+entry types now use the \hbox{\tt address} field
+to tell where a conference was held,
+rather than to give the address
+of the publisher or organization.
+If you want to include the
+publisher's or organization's address,
+put it in the \hbox{\tt publisher}
+or \hbox{\tt organization} field.
+
+\item
+The \hbox{\tt BOOK}, \hbox{\tt INBOOK}, \hbox{\tt INCOLLECTION},
+and \hbox{\tt PROCEEDINGS} entry types now allow either
+\hbox{\tt volume} or \hbox{\tt number} (but not both),
+rather than just \hbox{\tt volume}.
+
+\item
+The \hbox{\tt INCOLLECTION} entry type now allows
+a \hbox{\tt series} and an \hbox{\tt edition} field.
+
+\item
+The \hbox{\tt INPROCEEDINGS} and \hbox{\tt PROCEEDINGS}
+entry types now allow either a \hbox{\tt volume} or \hbox{\tt number},
+and also a \hbox{\tt series} field.
+
+\item
+The \hbox{\tt UNPUBLISHED} entry type now outputs,
+in one block, the \hbox{\tt note} field
+followed by the date information.
+
+\item
+The \hbox{\tt MANUAL} entry type now prints out
+the \hbox{\tt organization} in the first block
+if the \hbox{\tt author} field is empty.
+
+\item
+The {\tt MISC} entry type now issues a warning
+if all the optional fields are empty
+(that is, if the entire entry is empty).
+
+\end{enumerate}
+
+
+\section{The Entries}
+\label{latex-appendix}
+
+This section is simply a corrected version of
+Appendix~B.2 of the \LaTeX\ book\cite{latex},
+\copyright~1986, by Addison-Wesley.
+The basic scheme is the same, only a few details have changed.
+
+
+\subsection{Entry Types}
+
+When entering a reference in the database, the first thing to decide
+is what type of entry it is. No fixed classification scheme can be
+complete, but \BibTeX\ provides enough entry types to handle almost
+any reference reasonably well.
+
+References to different types of publications contain different
+information; a reference to a journal article might include the volume
+and number of the journal, which is usually not meaningful for a book.
+Therefore, database entries of different types have different fields.
+For each entry type, the fields are divided into three classes:
+\begin{description}
+
+\item[required]
+Omitting the field will produce a warning message
+and, rarely, a badly formatted bibliography entry.
+If the required information is not meaningful,
+you are using the wrong entry type.
+However, if the required information is meaningful
+but, say, already included is some other field,
+simply ignore the warning.
+
+\item[optional]
+The field's information will be used if present,
+but can be omitted without causing any formatting problems.
+You should include the optional field if it will help the reader.
+
+\item[ignored]
+The field is ignored.
+\BibTeX\ ignores any field that is not required or optional, so you can include
+any fields you want in a \hbox{\tt bib} file entry. It's a good idea
+to put all relevant information about
+a reference in its \hbox{\tt bib} file entry---even information that
+may never appear in the bibliography. For example, if you want to
+keep an abstract of a paper in a computer file, put it in an \hbox{\tt
+abstract} field in the paper's \hbox{\tt bib} file entry. The
+\hbox{\tt bib} file is likely to be as good a place as any for the
+abstract, and it is possible to design a bibliography style for
+printing selected abstracts.
+Note: Misspelling a field name will
+result in its being ignored,
+so watch out for typos
+(especially for optional fields,
+since \BibTeX\ won't warn you when those are missing).
+
+\end{description}
+
+The following are the standard entry types, along with their required
+and optional fields, that are used by the standard bibliography styles.
+The fields within each class (required or optional)
+are listed in order of occurrence in the output,
+except that a few entry types may perturb the order slightly,
+depending on what fields are missing.
+These entry types are similar to those adapted by Brian Reid
+from the classification scheme of van~Leunen\cite{van-leunen}
+for use in the {\em Scribe\/} system.
+The meanings of the individual fields are explained in the next section.
+Some nonstandard bibliography styles may ignore some optional fields
+in creating the reference.
+Remember that, when used in the \hbox{\tt bib}
+file, the entry-type name is preceded by an \hbox{\tt @} character.
+
+\begin{description}
+\sloppy
+
+\item[article\hfill] An article from a journal or magazine.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt journal},
+\hbox{\tt year}.
+Optional fields: \hbox{\tt volume}, \hbox{\tt number},
+\hbox{\tt pages}, \hbox{\tt month}, \hbox{\tt note}.
+
+\item[book\hfill] A book with an explicit publisher.
+Required fields: \hbox{\tt author} or \hbox{\tt editor},
+\hbox{\tt title}, \hbox{\tt publisher}, \hbox{\tt year}.
+Optional fields: \hbox{\tt volume} or \hbox{\tt number}, \hbox{\tt series},
+\hbox{\tt address}, \hbox{\tt edition}, \hbox{\tt month},
+\hbox{\tt note}.
+
+\item[booklet\hfill] A work that is printed and bound,
+but without a named publisher or sponsoring institution.
+Required field: \hbox{\tt title}.
+Optional fields: \hbox{\tt author}, \hbox{\tt howpublished},
+\hbox{\tt address}, \hbox{\tt month}, \hbox{\tt year}, \hbox{\tt note}.
+
+\item[conference\hfill] The same as {\tt INPROCEEDINGS},
+included for {\em Scribe\/} compatibility.
+
+\item[inbook\hfill] A part of a book,
+which may be a chapter (or section or whatever) and/or a range of pages.
+Required fields: \hbox{\tt author} or \hbox{\tt editor}, \hbox{\tt title},
+\hbox{\tt chapter} and/or \hbox{\tt pages}, \hbox{\tt publisher},
+\hbox{\tt year}.
+Optional fields: \hbox{\tt volume} or \hbox{\tt number}, \hbox{\tt series},
+\hbox{\tt type}, \hbox{\tt address},
+\hbox{\tt edition}, \hbox{\tt month}, \hbox{\tt note}.
+
+\item[incollection\hfill] A part of a book having its own title.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt booktitle},
+\hbox{\tt publisher}, \hbox{\tt year}.
+Optional fields: \hbox{\tt editor}, \hbox{\tt volume} or \hbox{\tt number},
+\hbox{\tt series}, \hbox{\tt type}, \hbox{\tt chapter}, \hbox{\tt pages},
+\hbox{\tt address}, \hbox{\tt edition}, \hbox{\tt month}, \hbox{\tt note}.
+
+\item[inproceedings\hfill] An article in a conference proceedings.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt booktitle},
+\hbox{\tt year}.
+Optional fields: \hbox{\tt editor}, \hbox{\tt volume} or \hbox{\tt number},
+\hbox{\tt series}, \hbox{\tt pages}, \hbox{\tt address}, \hbox{\tt month},
+\hbox{\tt organization}, \hbox{\tt publisher}, \hbox{\tt note}.
+
+\item[manual\hfill] Technical documentation. Required field: \hbox{\tt title}.
+Optional fields: \hbox{\tt author}, \hbox{\tt organization},
+\hbox{\tt address}, \hbox{\tt edition}, \hbox{\tt month}, \hbox{\tt year},
+\hbox{\tt note}.
+
+\item[mastersthesis\hfill] A Master's thesis.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt school},
+\hbox{\tt year}.
+Optional fields: \hbox{\tt type}, \hbox{\tt address}, \hbox{\tt month},
+\hbox{\tt note}.
+
+\item[misc\hfill] Use this type when nothing else fits.
+Required fields: none.
+Optional fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt howpublished},
+\hbox{\tt month}, \hbox{\tt year}, \hbox{\tt note}.
+
+\item[phdthesis\hfill] A PhD thesis.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt school},
+\hbox{\tt year}.
+Optional fields: \hbox{\tt type}, \hbox{\tt address}, \hbox{\tt month},
+\hbox{\tt note}.
+
+\item[proceedings\hfill] The proceedings of a conference.
+Required fields: \hbox{\tt title}, \hbox{\tt year}.
+Optional fields: \hbox{\tt editor}, \hbox{\tt volume} or \hbox{\tt number},
+\hbox{\tt series}, \hbox{\tt address}, \hbox{\tt month},
+\hbox{\tt organization}, \hbox{\tt publisher}, \hbox{\tt note}.
+
+
+\item[techreport\hfill] A report published by a school or other institution,
+usually numbered within a series.
+Required fields: \hbox{\tt author},
+\hbox{\tt title}, \hbox{\tt institution}, \hbox{\tt year}.
+Optional fields: \hbox{\tt type}, \hbox{\tt number}, \hbox{\tt address},
+\hbox{\tt month}, \hbox{\tt note}.
+
+\item[unpublished\hfill] A document having an author and title,
+but not formally published.
+Required fields: \hbox{\tt author}, \hbox{\tt title}, \hbox{\tt note}.
+Optional fields: \hbox{\tt month}, \hbox{\tt year}.
+
+\end{description}
+
+In addition to the fields listed above, each entry type also has an
+optional \hbox{\tt key} field, used in some styles
+for alphabetizing, for cross referencing,
+or for forming a \hbox{\verb|\bibitem|} label.
+You should include a \hbox{\tt key} field for any entry whose
+``author'' information is missing;
+the ``author'' information is usually the \hbox{\tt author} field,
+but for some entry types it can be the \hbox{\tt editor}
+or even the \hbox{\tt organization} field
+(Section~\ref{odds-and-ends} describes this in more detail).
+Do not confuse the \hbox{\tt key} field with the key that appears in the
+\hbox{\verb|\cite|} command and at the beginning of the database entry;
+this field is named ``key'' only for compatibility with {\it Scribe}.
+
+
+\subsection{Fields}
+
+Below is a description of all fields
+recognized by the standard bibliography styles.
+An entry can also contain other fields, which are ignored by those styles.
+\begin{description}
+
+\item[address\hfill]
+Usually the address of the \hbox{\tt publisher} or other type
+of institution.
+For major publishing houses,
+van~Leunen recommends omitting the information entirely.
+For small publishers, on the other hand, you can help the
+reader by giving the complete address.
+
+\item[annote\hfill]
+An annotation.
+It is not used by the standard bibliography styles,
+but may be used by others that produce an annotated bibliography.
+
+\item[author\hfill]
+The name(s) of the author(s),
+in the format described in the \LaTeX\ book.
+
+\item[booktitle\hfill]
+Title of a book, part of which is being cited.
+See the \LaTeX\ book for how to type titles.
+For book entries, use the \hbox{\tt title} field instead.
+
+\item[chapter\hfill]
+A chapter (or section or whatever) number.
+
+\item[crossref\hfill]
+The database key of the entry being cross referenced.
+
+\item[edition\hfill]
+The edition of a book---for example, ``Second''$\!$.
+This should be an ordinal, and
+should have the first letter capitalized, as shown here;
+the standard styles convert to lower case when necessary.
+
+\item[editor\hfill]
+Name(s) of editor(s), typed as indicated in the \LaTeX\ book.
+If there is also an \hbox{\tt author} field, then
+the \hbox{\tt editor} field gives the editor of the book or collection
+in which the reference appears.
+
+\item[howpublished\hfill]
+How something strange has been published.
+The first word should be capitalized.
+
+\item[institution\hfill]
+The sponsoring institution of a technical report.
+
+\item[journal\hfill]
+A journal name.
+Abbreviations are provided for many journals; see the {\it Local Guide}.
+
+\item[key\hfill]
+Used for alphabetizing, cross referencing, and creating a label when
+the ``author'' information
+(described in Section~\ref{odds-and-ends}) is missing.
+This field should not be confused with the key that appears in the
+\hbox{\verb|\cite|} command and at the beginning of the database entry.
+
+\item[month\hfill]
+The month in which the work was
+published or, for an unpublished work, in which it was written.
+You should use the standard three-letter abbreviation,
+as described in Appendix B.1.3 of the \LaTeX\ book.
+
+\item[note\hfill]
+Any additional information that can help the reader.
+The first word should be capitalized.
+
+\item[number\hfill]
+The number of a journal, magazine, technical report,
+or of a work in a series.
+An issue of a journal or magazine is usually
+identified by its volume and number;
+the organization that issues a
+technical report usually gives it a number;
+and sometimes books are given numbers in a named series.
+
+\item[organization\hfill]
+The organization that sponsors a conference or that publishes a \hbox{manual}.
+
+\item[pages\hfill]
+One or more page numbers or range of numbers,
+such as \hbox{\tt 42--111} or \hbox{\tt 7,41,73--97} or \hbox{\tt 43+}
+(the `{\tt +}' in this last example indicates pages following
+that don't form a simple range).
+To make it easier to maintain {\em Scribe\/}-compatible databases,
+the standard styles convert a single dash (as in \hbox{\tt 7-33})
+to the double dash used in \TeX\ to denote number ranges
+(as in \hbox{\tt 7--33}).
+
+\item[publisher\hfill]
+The publisher's name.
+
+\item[school\hfill]
+The name of the school where a thesis was written.
+
+\item[series\hfill]
+The name of a series or set of books.
+When citing an entire book, the the \hbox{\tt title} field
+gives its title and an optional \hbox{\tt series} field gives the
+name of a series or multi-volume set
+in which the book is published.
+
+\item[title\hfill]
+The work's title, typed as explained in the \LaTeX\ book.
+
+\item[type\hfill]
+The type of a technical report---for example,
+``Research Note''$\!$.
+
+\item[volume\hfill]
+The volume of a journal or multivolume book.
+
+\item[year\hfill]
+The year of publication or, for
+an unpublished work, the year it was written.
+Generally it should consist of four numerals, such as {\tt 1984},
+although the standard styles can handle any {\tt year} whose
+last four nonpunctuation characters are numerals,
+such as `\hbox{(about 1984)}'$\!$.
+
+\end{description}
+
+
+\section{Helpful Hints}
+\label{odds-and-ends}
+
+This section gives some random tips
+that aren't documented elsewhere,
+at least not in this detail.
+They are, roughly, in order
+of least esoteric to most.
+First, however, a brief spiel.
+
+I understand that there's often little choice in choosing
+a bibliography style---journal~$X$ says you must use style~$Y$
+and that's that.
+If you have a choice, however, I strongly recommend that you
+choose something like the {\tt plain} standard style.
+Such a style, van~Leunen\cite{van-leunen} argues convincingly,
+encourages better writing than the alternatives---%
+more concrete, more vivid.
+
+{\em The Chicago Manual of Style\/}\cite{chicago}++{{400}\dash{401}},
+on the other hand,
+espouse the author-date system,
+in which the citation might appear in the text as `(Jones, 1986)'$\!$.
+I argue that this system,
+besides cluttering up the
+text with information that may or may not be relevant,
+encourages the passive voice and vague writing.
+Furthermore the strongest arguments for
+using the author-date system---like ``it's the most practical''---%
+fall flat on their face with the advent
+of computer-typesetting technology.
+For instance the {\em Chicago Manual\/} contains,
+right in the middle of page~401, this anachronism:
+``The chief disadvantage of [a style like {\tt plain}] is that additions
+or deletions cannot be made after the manuscript is typed without changing
+numbers in both text references and list.''
+\LaTeX, obviously, sidesteps the disadvantage.
+
+Finally, the logical deficiencies of the author-date style
+are quite evident once you've written a program to implement it.
+For example, in a large bibliography,
+using the standard alphabetizing scheme,
+the entry for `(Aho et~al., 1983b)'
+might be half a page later than the one for `(Aho et~al., 1983a)'$\!$.
+Fixing this problem results in even worse ones.
+What a mess.
+(I have, unfortunately, programmed such a style,
+and if you're saddled with an unenlightened publisher
+or if you don't buy my propaganda,
+it's available from the Rochester style collection.)
+
+Ok, so the spiel wasn't very brief;
+but it made me feel better,
+and now my blood pressure is back to normal.
+Here are the tips for using \BibTeX\
+with the standard styles
+(although many of them hold for nonstandard styles, too).
+\begin{enumerate}
+
+\item
+With \BibTeX's style-designing language
+you can program general database manipulations,
+in addition to bibliography styles.
+For example it's a fairly easy task for someone familiar with the language
+to produce a database-key/author index of all the entries in a database.
+Consult the {\em Local Guide\/} to see
+what tools are available on your system.
+
+\item
+The standard style's thirteen entry types
+do reasonably well at formatting most entries,
+but no scheme with just thirteen formats
+can do everything perfectly.
+Thus, you should feel free to be creative
+in how you use these entry types
+(but if you have to be too creative,
+there's a good chance you're using the wrong entry type).
+
+\item
+Don't take the field names too seriously.
+Sometimes, for instance, you might have to include
+the publisher's address along with the publisher's name
+in the \hbox{\tt publisher} field,
+rather than putting it in the \hbox{\tt address} field.
+Or sometimes, difficult entries work best when you
+make judicious use of the {\tt note} field.
+
+\item
+Don't take the warning messages too seriously.
+Sometimes, for instance, the year appears in the title,
+as in {\em The 1966 World Gnus Almanac}.
+In this case it's best to omit the {\tt year} field
+and to ignore \BibTeX's warning message.
+
+\item
+If you have too many names to list in an
+\hbox{\tt author} or \hbox{\tt editor} field,
+you can end the list with ``and others'';
+the standard styles appropriately append an ``et~al.''
+
+\item
+In general, if you want to keep \BibTeX\ from changing
+something to lower case, you enclose it in braces.
+You might not get the effect you want, however,
+if the very first character after the left brace is a backslash.
+The ``special characters'' item later in this section explains.
+
+\item
+For {\em Scribe\/} compatibility, the database files
+allow an \hbox{\tt @COMMENT} command; it's not really
+needed because \BibTeX\ allows in the database files
+any comment that's not within an entry.
+If you want to comment out an entry,
+simply remove the `{\tt @}' character preceding the entry type.
+
+\item
+The standard styles have journal abbreviations that are
+computer-science oriented;
+these are in the style files primarily for the example.
+If you have a different set of journal abbreviations,
+it's sensible to put them in \hbox{\tt @STRING} commands
+in their own database file and to list this database file
+as an argument to \LaTeX's \hbox{\verb|\bibliography|} command
+(but you should list this argument before the ones that
+specify real database entries).
+
+\item
+It's best to use the three-letter abbreviations for the month,
+rather than spelling out the month yourself.
+This lets the bibliography style be consistent.
+And if you want to include information for the day of the month,
+the {\tt month} field is usually the best place.
+For example
+\begin{verbatim}
+ month = jul # "~4,"
+\end{verbatim}
+will probably produce just what you want.
+
+\item
+If you're using the \hbox{\tt unsrt} style
+(references are listed in order of citation)
+along with the \hbox{\verb|\nocite{*}|} feature
+(all entries in the database are included),
+the placement of the \hbox{\verb|\nocite{*}|} command
+within your document file will determine the reference order.
+According to the rule given in Section~\ref{features}:
+If the command is placed at the beginning of the document,
+the entries will be listed in exactly the order
+they occur in the database;
+if it's placed at the end,
+the entries that you explicitly
+\hbox{\verb|\cite|} or \hbox{\verb|\nocite|}
+will occur in citation order,
+and the remaining database entries will be in database order.
+
+\item
+For theses, van Leunen recommends not giving
+the school's department after the name of the degree,
+since schools, not departments, issue degrees.
+If you really think that giving the department information
+will help the reader find the thesis,
+put that information in the \hbox{\tt address} field.
+
+\item
+The \hbox{\tt MASTERSTHESIS} and \hbox{\tt PHDTHESIS} entry types
+are so named for {\em Scribe\/} compatibility;
+\hbox{\tt MINORTHESIS} and \hbox{\tt MAJORTHESIS}
+probably would have been better names.
+Keep this in mind when trying to classify
+a non-U.S.\ thesis.
+
+\item
+Here's yet another suggestion for what to do when an author's
+name appears slightly differently in two publications.
+Suppose, for example, two journals articles use these fields.
+\begin{verbatim}
+ author = "Donald E. Knuth"
+ . . .
+ author = "D. E. Knuth"
+\end{verbatim}
+There are two possibilities.
+You could (1)~simply leave them as is,
+or (2)~assuming you know for sure that
+these authors are one and the same person,
+you could list both in the form that the author prefers
+(say, `Donald~E.\ Knuth').
+In the first case, the entries might be alphabetized incorrectly,
+and in the second, the slightly altered name might
+foul up somebody's electronic library search.
+But there's a third possibility, which is the one I prefer.
+You could convert the second journal's field to
+\begin{verbatim}
+ author = "D[onald] E. Knuth"
+\end{verbatim}
+This avoids the pitfalls of the previous two solutions,
+since \BibTeX\ alphabetizes this as if the brackets weren't there,
+and since the brackets clue the reader in that a full first name
+was missing from the original.
+Of course it introduces another pitfall---`D[onald]~E.\ Knuth' looks ugly---%
+but in this case I think the increase in accuracy outweighs
+the loss in aesthetics.
+
+\item
+\LaTeX's comment character `{\tt\%}' is not a comment character
+in the database files.
+
+\item
+Here's a more complete description of
+the ``author'' information referred to in previous sections.
+For most entry types the ``author'' information
+is simply the \hbox{\tt author} field.
+However:
+For the \hbox{\tt BOOK} and \hbox{\tt INBOOK} entry types
+it's the \hbox{\tt author} field, but if there's no author
+then it's the \hbox{\tt editor} field;
+for the \hbox{\tt MANUAL} entry type
+it's the \hbox{\tt author} field, but if there's no author
+then it's the \hbox{\tt organization} field;
+and for the \hbox{\tt PROCEEDINGS} entry type
+it's the \hbox{\tt editor} field, but if there's no editor
+then it's the \hbox{\tt organization} field.
+
+\item
+When creating a label,
+the \hbox{\tt alpha} style uses the ``author'' information described above,
+but with a slight change---%
+for the \hbox{\tt MANUAL} and \hbox{\tt PROCEEDINGS} entry types,
+the {\tt key} field takes precedence over the \hbox{\tt organization} field.
+Here's a situation where this is useful.
+\begin{verbatim}
+ organization = "The Association for Computing Machinery",
+ key = "ACM"
+\end{verbatim}
+Without the {\tt key} field, the \hbox{\tt alpha} style
+would make a label from the first three letters of information
+in the \hbox{\tt organization} field;
+\hbox{\tt alpha} knows to strip off the `\hbox{\tt The }'$\!$,
+but it would still form a label like `\hbox{[Ass86]}'$\!$,
+which, however intriguing, is uninformative.
+Including the {\tt key} field, as above,
+would yield the better label `\hbox{[ACM86]}'$\!$.
+
+You won't always need the {\tt key} field to override the
+\hbox{\tt organization}, though:
+With
+\begin{verbatim}
+ organization = "Unilogic, Ltd.",
+\end{verbatim}
+for instance, the \hbox{\tt alpha} style would
+form the perfectly reasonable label `\hbox{[Uni86]}'$\!$.
+
+\item
+Section~\ref{features} discusses accented characters.
+To \BibTeX, an accented character is really a special case
+of a ``special character''$\!$,
+which consists of everything from a left brace at the top-most level,
+immediately followed by a backslash,
+up through the matching right brace.
+For example in the field
+\begin{verbatim}
+ author = "\AA{ke} {Jos{\'{e}} {\'{E}douard} G{\"o}del"
+\end{verbatim}
+there are just two special characters,
+`\hbox{\verb|{\'{E}douard}|}' and `\hbox{\verb|{\"o}|}'
+(the same would be true if the pair of double quotes
+delimiting the field were braces instead).
+In general, \BibTeX\ will not do any processing
+of a \TeX\ or \LaTeX\ control sequence inside a special character,
+but it {\em will\/} process other characters.
+Thus a style that converts all titles to lower case
+would convert
+\begin{verbatim}
+ The {\TeX BOOK\NOOP} Experience
+\end{verbatim}
+to
+\begin{verbatim}
+ The {\TeX book\NOOP} experience
+\end{verbatim}
+(the `{\tt The}' is still capitalized
+because it's the first word of the title).
+
+This special-character scheme is useful for handling accented characters,
+for getting \BibTeX's alphabetizing to do what you want,
+and, since \BibTeX\ counts an entire special character as just one letter,
+for stuffing extra characters inside labels.
+The file \hbox{\tt XAMPL.BIB} distributed with \BibTeX\
+gives examples of all three uses.
+
+\item
+This final item of the section describes \BibTeX's names
+(which appear in the \hbox{\tt author} or \hbox{\tt editor} field)
+in slightly more detail than what
+appears in Appendix~B of the \LaTeX\ book.
+In what follows, a ``name'' corresponds to a person.
+(Recall that you separate multiple names in a single field
+with the word ``and''$\!$, surrounded by spaces,
+and not enclosed in braces.
+This item concerns itself with the structure of a single name.)
+
+Each name consists of four parts: First, von, Last, and~Jr;
+each part consists of a (possibly empty) list of name-tokens.
+The Last part will be nonempty if any part is,
+so if there's just one token, it's always a Last token.
+
+Recall that Per Brinch~Hansen's name should be typed
+\begin{verbatim}
+ "Brinch Hansen, Per"
+\end{verbatim}
+The First part of his name has the single token ``Per'';
+the Last part has two tokens, ``Brinch'' and ``Hansen'';
+and the von and Jr parts are empty.
+If you had typed
+\begin{verbatim}
+ "Per Brinch Hansen"
+\end{verbatim}
+instead, \BibTeX\ would (erroneously) think ``Brinch'' were a First-part token,
+just as ``Paul'' is a First-part token in ``John~Paul Jones''$\!$,
+so this erroneous form would have two First tokens and one Last token.
+
+Here's another example:
+\begin{verbatim}
+ "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin"
+\end{verbatim}
+This name has four tokens in the First part, two in the von, and
+two in the Last.
+Here \BibTeX\ knows where one part ends and the other begins because
+the tokens in the von part begin with lower-case letters.
+
+In general, it's a von token if the first letter at brace-level~0
+is in lower case.
+Since technically everything
+in a ``special character'' is at brace-level~0,
+you can trick \BibTeX\ into thinking that
+a token is or is not a von token by prepending a dummy
+special character whose first letter past the \TeX\ control sequence
+is in the desired case, upper or lower.
+
+To summarize, \BibTeX\ allows three possible forms for the name:
+\begin{verbatim}
+ "First von Last"
+ "von Last, First"
+ "von Last, Jr, First"
+\end{verbatim}
+You may almost always use the first form;
+you shouldn't if either there's a Jr part,
+or the Last part has multiple tokens but there's no von part.
+
+\end{enumerate}
+
+%\bibliography{btxdoc}
+%\bibliographystyle{plain}
+\end{document}
diff --git a/macros/latex/contrib/lexitex/lexismp2.bib b/macros/latex/contrib/lexitex/lexismp2.bib
new file mode 100644
index 0000000000..dd74a87adc
--- /dev/null
+++ b/macros/latex/contrib/lexitex/lexismp2.bib
@@ -0,0 +1,305 @@
+@STRING{mlj..="MLJ"}
+@STRING{feer..="Far East Econ.\ Rev."}
+@STRING{jcps..="JCPS"}
+@STRING{sjls..="Singapore J.\ L.\ Stud."}
+@STRING{icj..="ICJ"}
+@STRING{jlp..="J.\ Legal Pluralism"}
+
+@incollection{harding-singapore-prevent,
+ crossref = {harding-prevent},
+ author = {Andrew J Harding},
+ title = {Singapore},
+ chapter = {Chapter 11}
+}
+
+
+@incollection{tan-parliament,
+ crossref = {woon-sing-legal},
+ author = {Kevin Tan},
+ title = {Parliament and the Making of Law in
+ Singapore},
+ chapter = {Chapter 2}
+}
+
+
+@incollection{tan-short,
+ crossref = {woon-sing-legal},
+ author = {Kevin Tan},
+ title = {A Short Legal and Constitutional History of
+ Singapore},
+ chapter = {Chapter 1}
+}
+
+
+@incollection{tynne-admin-state,
+ crossref = {woon-sing-legal},
+ author = {I Thynne},
+ title = {The Administrative State},
+ chapter = {Chapter 3}
+}
+
+
+@incollection{bartholomew-englaw,
+ author = {G W Bartholomew},
+ title = {English Law in Partibus Orientalium},
+ chapter = {Chapter 1},
+ crossref = {harding-common-law}
+}
+
+
+@article{batterman-sing-news,
+ author = {N Batterman},
+ title = {Singapore's Newspaper and Printing Presses
+ (Amendment) Act 1986: A Bad News Bear?},
+ journal = {Lawasia},
+ year = {1987},
+ pages = {35}
+}
+
+
+@case{chngsuantzevminister,
+ title = {Chng Suan Tze v Minister for Home Affairs},
+ journal = mlj..,
+ year = {1989},
+ number = {1},
+ pages = {69},
+ jurisdiction = {singapore}
+}
+
+
+@statute{constamend-1989,
+ title = {Constitution (Amendment) Act},
+ year = {1989},
+ jurisdiction = {singapore}
+}
+
+
+@statute{constamend-n19,
+ title = {Constitution (Amendment) Act},
+ year = 1969,
+ number = 19,
+ jurisdiction = {singapore}
+}
+
+
+@article{disc-democracy,
+ title = {Discipline vs Democracy},
+ journal = feer..,
+ year = {10 dec 1992}
+}
+
+
+@book{harding-common-law,
+ title = {The Common Law in Singapore and Malaysia},
+ booktitle = {The Common Law in Singapore and Malaysia},
+ year = 1985 ,
+ editor = {A J Harding}
+}
+
+
+@article{harding-const-proc,
+ author = {Andrew J Harding},
+ title = {Constitutional Protection of Minorities
+ in Singapore},
+ journal = jcps..,
+ year = {1990},
+ pages = {1}
+}
+
+
+@book{harding-prevent,
+ title = {Preventive Detention and
+ Security Law: a Comparative Survey},
+ booktitle = {Preventive Detention and
+ Security Law: a Comparative Survey},
+ year = {1993},
+ editor = {Andrew J Harding},
+ publisher = {Martinus Nijhoff}
+}
+
+
+@booklet{intelligent-island,
+ title = {Horizon: The Intelligent Island},
+ year = {4 apr 1990},
+ howpublished = {BBC Television broadcast}
+}
+
+
+@statute{internal-security-act,
+ title = {Internal Security Act},
+ journal = {Revised Edition of the Laws},
+ year = 1985,
+ number = {Cap 143},
+ jurisdiction = {singapore}
+}
+
+
+@statute{intl-sec-amend-1989,
+ title = {Internal Security (Amendment) Act},
+ year = {1989},
+ jurisdiction = {singapore}
+}
+
+
+@case{jeyaretnam-v-law-soc-sing,
+ title = {Jeyaretnam v Law Society of Singapore},
+ journal = mlj..,
+ year = {1988},
+ number = {3},
+ pages = {425},
+ jurisdiction = {singapore}
+}
+
+
+@case{lee-mau-seng-v-min,
+ title = {Lee Mau Seng v Minister for Home Affairs},
+ journal = mlj..,
+ year = {1971},
+ number = {2},
+ pages = {137},
+ jurisdiction = {singapore}
+}
+
+
+@statute{m-const-amend-1991,
+ title = {Constitution of the Republic of Singapore
+ (Amendment) Act},
+ year = 1991,
+ number = 5 ,
+ jurisdiction = {singapore}
+}
+
+
+@book{m-const-commn-rept,
+ title = {Constitutional Commission Report},
+ year = 1966
+}
+
+
+@statute{maint-of-relig-harmony-act,
+ title = {Maintenance of Religious Harmony Act},
+ year = {1990},
+ number = {26},
+ jurisdiction = {singapore}
+}
+
+
+@statute{newsp-printing-presses-amd-act,
+ title = {Newspaper and Printing Presses (Amendment) Act},
+ year = {1986},
+ number = {22},
+ jurisdiction = {singapore}
+}
+
+
+@book{phang-development,
+ author = {A B L Phang},
+ title = {The Development of Singapore Law: A Historical
+ and
+ Socio-Legal
+ Perspective},
+ year = 1990
+}
+
+
+@case{re-dow-jones-asia,
+ title = {Re Dow Jones (Asia) Inc},
+ journal = mlj..,
+ year = {1988},
+ number = {2},
+ pages = {414},
+ jurisdiction = {singapore}
+}
+
+
+@book{ricjs-1987,
+ author = icj..,
+ title = {Report of the International Commission
+ of Jurists to Singapore},
+ year = {1987}
+}
+
+
+@statute{s-const,
+ title = {Constitution of Singapore},
+ jurisdiction = {singapore}
+}
+
+
+@statute{s-constamend-n9,
+ title = {Constitution of the Republic of
+ Singapore (Amendment) Act},
+ year = 1988,
+ number = {9},
+ jurisdiction = {singapore}
+}
+
+
+@case{sin-boon-ann-chingvminister,
+ title = {Ching Suan Tze v Minister of Home Affairs},
+ journal = mlj..,
+ year = {1989},
+ number = {2},
+ pages = {ci},
+ jurisdiction = {singapore}
+}
+
+
+@case{teo-soh-lung-v-min,
+ title = {Teo Soh Lung v Min of Home Affairs},
+ journal = mlj..,
+ year = {1989},
+ number = {2},
+ pages = {449},
+ jurisdiction = {singapore}
+}
+
+
+@case{vincent-cheng-v-min,
+ title = {Vincent Cheng v Min of Home Affairs},
+ journal = mlj..,
+ year = {1990},
+ number = {1},
+ pages = {449},
+ jurisdiction = {singapore}
+}
+
+
+@article{woodman-allotrev,
+ author = {Gordon Woodman},
+ title = {Review Essay - the Limits of The Limits of Law:
+ a
+ Review of Antony Allott, The Limits of Law (1980)},
+ journal = jlp..,
+ year = 1983,
+ volume = {21},
+ pages = {129}
+}
+
+
+@article{woodman-allottrev-reply,
+ author = {Gordon Woodman},
+ title = {Reply to Woodman},
+ journal = jlp..,
+ year = 1983,
+ volume = {21},
+ pages = {147}
+}
+
+
+@book{woon-sing-legal,
+ title = {The Singapore Legal System},
+ booktitle = {The Singapore Legal System},
+ year = 1990 ,
+ editor = {W Woon}
+}
+
+
+@article{tan-constamend-note,
+ author = {Kevin Tan},
+ title = {Note},
+ journal = sjls..,
+ year = 1991 ,
+ pages = 179
+}
+
diff --git a/macros/latex/contrib/lexitex/lexismp2.tex b/macros/latex/contrib/lexitex/lexismp2.tex
new file mode 100644
index 0000000000..ea18675e6e
--- /dev/null
+++ b/macros/latex/contrib/lexitex/lexismp2.tex
@@ -0,0 +1,712 @@
+% Copyright (C) 1994, Andrew J Harding. All rights reserved.
+\documentstyle[lexitex,11pt]{article}
+\begin{document}
+\bibliographystyle{lexibib}
+\bibliography{spore}
+\title{Law as Social Engineering in Singapore: `Smart' Laws in the
+Intelligent Island}
+\author{Andrew Harding\thanks{Senior Lecturer School of Oriental and
+African Studies, London University; presented in the Asian studies
+seminar series State and Law in Asia, Asian Studies Centre, St
+Anthony's College, Oxford, 19 October 1993.}}
+\maketitle
+
+\begin{abstract}
+ The development of Singapore law has been an outcome of its
+ peculiar history, geography and politics. The ideology of
+ social discipline has profoundly affected this development: law
+ has been seen primarily as an instrument of social engineering
+ rather than as the expression of a particular balance of
+ principles defined politically or culturally and regarded as
+ the embodiment of justice. The development of the region's
+ legal systems along the lines of Singapore's is unlikely
+ because of the growth of democracy movements.
+\end{abstract}
+
+\section{Introduction}
+Ever since Sir Stamford Raffles in 1819 alighted at the point on
+the Singapore River where his statue now gazes benevolently down
+on the backs of public buildings on the waterfront, Singapore has
+been a byword for firm government. In his brief sojourns in
+Singapore Raffles laid down many of the principles by which
+Singapore is now governed: an economically ambitious policy of
+free trade, in particular a free port;\footnote{ It is
+ interesting to note that the BBC's excellent documentary
+ \lexicite{intelligent-island}, focused on the operation of the
+ port of Singapore as the most obvious example of the
+ ``on-line'' society. Whatever else is argued in this paper, it
+ may well be that in the field of information technology the
+ Asia-Pacific region's future will resemble Singapore's
+ present.} the recruitment of Singapore's many ethnic
+communities behind Government policies; law and order;
+cleanliness; purposeful administration; centralization of
+political power. Raffles was motivated not only by
+utilitarianism, but also by humanitarianism. This latter aspect
+of his policy has also been fulfilled, though only partially.
+Raffles would no doubt be pleased with Singapore's prosperity and
+environment, the expansion and efficacy of its education, health
+care, public services and social institutions, and its prominence
+in international counsels. He would, I think, be disappointed
+that Singapore has not become the cultural focal point of
+maritime South East Asia,\footnote{ Or the Malay world, as he
+ would have called it.} and that it has moved away from those
+principles of the enlightenment which inspired its creator.
+
+I mention Raffles rather than Lee Kuan Yew in this introduction
+because it is easy to lose sight of the fact that Singapore's
+history, policy and legal system have been determined to a a
+large extent by geopolitics. It was chosen by Raffles because of
+its natural harbour, situated so as to serve India and Europe in
+the West, China in the East, and South East Asia all around it.
+It was from the beginning a commercial colony rather than a
+strategic necessity.
+
+The Singapore of what we might call ``the Lee Kuan Yew era''
+(1959 to the present)\footnote{ In 1990 Lee stepped down as Prime
+ Minister after 29 years, but since then, under the leadership
+ of Goh Chok Tong as Prime Minister, Singapore clearly stills
+ follows all the principle points of Lee's policy, even if some
+ slight differences in style of Government can be detected. As
+ Senior Minister in the Prime Minister's Department, Lee still
+ clearly exercises great influence, and his position in no way
+ corresponds to that of Margaret Thatcher over a similar period.
+ A common joke in Singapore is that Goh is now ``the Prime
+ Minister in the Senior Minister's Department''. Lee himself has
+ described his position as that of a goalkeeper rather than a
+ centre forward. Recently Lee has finally relinquished the
+ important post of Secretary-General of the People's Action
+ Party [PAP] to Goh.} has been to a large extent preordained by
+an accident of history which resulted in the failure of its
+federation within Malaysia (1963-5). Much of what follows in this
+paper would have been true even if federation had succeeded, but
+the casting out of Singapore into the unpredictable political
+environment of 1960s South East Asia has resulted in the
+recognition of its leaders that Singapore is a potentially
+vulnerable city-state with a racial make-up which differs greatly
+from all the surrounding countries. Indeed it was this racial
+difference, as well as economic and political factors, which
+hastened Singapore's departure from Malaysia in 1965. The
+ideology put forward by Lee and other leaders since then has been
+that Singapore has only the intelligence and discipline of its
+workforce, and no hinterland of rice-padi and rich natural
+resources to fall back on, as Malaysia, China and Indonesia have.
+Its only route to survival, let alone economic propserity, has
+therefore been to take advantage of its position and
+infrastructure to provide goods and services to others, and to be
+a prime location for multi-national corporations. It is too small
+and vulnerable to withstand the shock-waves of a genuinely open
+society, and must maintain a rigid policy of social discipline
+and clearly defined, forcefully implemented, social objectives.
+This siege mentality is reinforced by, for example, the
+continuation of national service and reservist training, even
+though there is no military threat to Singapore. Attempts have
+also been made to enlist confucianism as a guiding philosophy,
+but this has had limited success.
+
+The ideology of social discipline has profoundly affected the
+development of law in Singapore. Law has been seen primarily as
+an instrument of social engineering rather than as the expression
+of a particular balance of principles defined politically or
+culturally and regarded as the embodiment of justice. This is a
+proposition which would probably find few dissenters, but what I
+think is interesting is to speculate on the nature and extent of
+this analysis, and to see to what extent it represents a model
+for other societies to follow. Is law as social engineering in
+Singapore purely an outcome of its situation, or is it indeed a
+glimpse of the legal future of the 21st century, not just perhaps
+in Asia, but over the rest of the planet? To this question I will
+return.
+
+
+\section{Legal Development in Singapore: Common Law and Statute Law}
+
+After the establishment of Raffles' colony, commerce brought with
+it Chinese, Indian and other immigrants from SE Asia and beyond.
+Commerce brings not only new ideas and values, carried by people
+freed from the traditional constraints of their own
+cultures,\footnote{ This was written as referring to the Chinese,
+ but applies in some ways to the British colonialists too, who
+ were constantly at odds with their overlords.} but also a
+motive for legal development: a degree of social stability and
+law and order is required; guarantees of private property and the
+honouring of promises; the legitimation and bolstering of
+institutions. The increase in population too, which in
+Singapore's case was an essential ingredient of prosperity,
+requires all these things.
+
+Imperial policy required the introduction of the common law,
+achieved formally by Charter in
+1826,\footnote{\lexicite{bartholomew-englaw}.} and then by the
+progressive development of legal institutions---courts, judges,
+lawyers, local legislation, police, and eventually a bureaucracy,
+taxation, elections to a representative legislature,
+constitutional government, and political
+independence.\footnote{\lexicite{tan-short}.}
+
+
+The most notable feature of Singapore's legal development during
+the Lee Kuan Yew era has been the growth of statute law. Of
+course this is probably true of every country in the world, but
+in Singapore it has taken a particular form. Statutes have on the
+whole conferred administrative powers going far beyond what is
+regarded in most common-law countries as appropriate or
+necessary, and to the extent that Singapore has developed an
+indigenous legal system with its own peculiar features, these
+features are almost exclusively uncommon in the extent to which
+they regulate social behaviour. The legal system has become, in
+short, a regulatory system. In this one can contrast the emerging
+legal systems of other developing countries,\footnote{Singapore
+ is of course no longer properly described as a developing
+ country, and I am speaking historically here.} which, although
+occasionally embodying laws comparable with Singapore's, have
+been essentially pluralistic in nature, and attempt to establish
+a balance of interests, assuming a diverse rather than a
+monolithic society. It is this divergence of statute law from the
+standard model one generally finds in common-law countries which
+marks the autochthony of Singapore's legal system.
+
+The common law, as is forcefully argued by Andrew Phang in a
+recent and very impressive monograph,\footnote{
+ \lexicite{phang-development}.} has been characterized by its
+lack of development in Singapore. Taking the example of contract
+law, Phang shows how the judges failed to take a Singaporean view
+of the subject, simply applying English precedents mechanically,
+even where the needs of society demanded a different
+result.\footnote{\lexicite{phang-development}, chapter 3.} He
+refers to the ``emaciation of custom'' and the lack of
+development of alternative forms of dispute resolution. Much the
+same can be said of tort law and many other areas of Singapore
+law. The common law is characterized by its failure to achieve
+autochthony,\footnote{ This is not of course true of most other
+ states which have received the common law, even those in the
+ developing areas of Africa and Asia. These states have made the
+ common law their own, and local precedents are argued alongside
+ English and other cases. An interesting example of the lack of
+ development of common law was the insistance on the rule
+ against perpetuities, which directly contradicted Chinese
+ customary law in preventing the tying up of property for
+ ancestor worship. This approach was typical of the colonial
+ judges, but has been continued by the Singaporean judiciary.
+ See, further, \lexicite{phang-development}+{55, n.~8}.} and, I
+would argue because of this, there is, in parallel, an atrophy of
+judicial power.\footnote{Phang goes on to discuss criminal law,
+ family law, labour law, and public housing law, finding that
+ the innovative legislation in these areas has been successfully
+ based on Singapore's particular social and economic
+ circumstances.}
+
+
+On this basis I want to take a brief look, by way of example, at
+some particular areas of public law in Singapore by way of
+amplification of the thesis of this paper.
+
+
+\section{Constitutional Development}
+
+Singapore inherited a Westminster-style Constitution from its
+colonial past. After independence in 1965 a new Constitution was
+promised, but in fact Singapore's constitutional development has
+proceeded by a series of amendments over the span of the Lee Kuan
+Yew era. Far from failing, like the common law, to achieve
+autochthony, Singapore's constitutional development has seen a
+series of experiments, and has probably now finally worn into its
+shoes with the election in 1993 of Singapore's first elected
+President, Ong Teng Cheong, under constitutional amendments
+passed in 1991.\footnote{See \lexicite{m-const-amend-1991}, and a
+ note on this by Kevin Tan at \lexicite{tan-constamend-note}.}
+
+Developments have centred around three issues, which are linked:
+race, opposition, and PAP succession. The objectives have been to
+recruit the support of the non-Chinese communities while
+suppressing communalism; to provide avenues for the expression of
+views opposed to those of the Government without undermining the
+dominant-party system; and to ensure that the main tenets of Lee
+Kuan Yew's policy will be continued by his successors, and not be
+replaced by ``welfarism'', which is regarded as the antithesis of
+PAP ideology, now that communism is no longer seen as a threat to
+Singapore.
+
+\subsection{Race}
+The racial tensions and riots of the 1950s and early 1960s made
+race an important issue after independence. A Constitutional
+Commission under the Chief Justice, reporting in 1966,\footnote{
+ \lexicite{m-const-commn-rept}.} was asked to explore ways of
+securing the confidence of the non-Chinese communities in their
+future as Singaporeans. The result was the Presidential Council
+for Minority Rights, set up in 1970,\footnote{ See
+ \lexicite{constamend-n19}.} whose function was to scrutinize
+legislation to see if it discriminated against any racial or
+religious community. The experiment, promising in its original
+conception, foundered because the Government insisted that
+members of political parties be allowed to sit on the Council;
+the result was that the Council was packed with senior members
+and former senior members of the Government, including Lee
+himself as Chairman. Naturally the Council has never submitted an
+adverse report on any legislation; it quickly became an
+irrelevance.\footnote{ See \lexicite{harding-const-proc}.}
+
+
+The eventual resolution of the problem of ethnic minorities was
+the creation of the Group Representation Constituencies (GRCs) in
+1988.\footnote{ \lexicite{s-constamend-n9}.} The Constitution now
+requires that certain constituencies, which supply one half of
+the total number of MPs, be represented by a team of three MPs
+elected as a ``slate'' by the voters in three former
+constituencies now grouped together; one member of each slate
+must be a member of an ethnic minority, ie usually a Singaporean
+of Malay/ Muslim or Indian (South Asian) descent. Thus the voters
+may choose between a PAP slate and an opposition slate, but are
+bound to elect at least one non-Chinese MP, whichever way they
+vote.
+
+The ostensible objective of the reform was to ensure that ethnic
+minorities were represented in Parliament. In fact the objectives
+were probably (i) to ensure that the PAP vote remained stable
+without resorting to the laying off of non-Chinese MPs, which
+would give the lie to the concept of a multi-racial
+Singapore;\footnote{ Non-Chinese PAP MPs generally garnered a
+ smaller proportion of the vote than their Chinese counterparts;
+ this phenomenon was likely to be accentuated by (i) the
+ increasingly mathematical distribution of races into new
+ housing estates (itself an important aspect of social
+ engineering); and (ii) the adoption of an increasingly
+ ``Chinese'' policy by the PAP (Lee has been frank about the
+ perceived lack of ``loyalty'' among the Malays, and has said
+ that Singapore would do better if its population was racially
+ monolithic like that of Japan).} and (ii) to make it more
+difficult for the opposition to secure an electoral victory in
+particular areas.\footnote{ It is far more difficult for the
+ opposition parties to win in the equivalent of three adjoining
+ constituencies than to pick off the odd constituency here and
+ there.}
+
+
+This would suggest that voters had not returned non-Chinese MPs
+in the past. In fact both the PAP and the opposition had included
+non-Chinese MPs, and some disquiet was occasioned by this reform,
+as it implied that non-Chinese candidates were unelectable. It
+is not insignificant that the visit of Israel's President to
+Singapore in 1986, which provoked an outraged response from
+Indonesia and Malaysia, was perceived to have provided evidence
+of disloyalty among Singapore Malay servicemen.\footnote{
+ \lexicite{harding-const-proc}.}
+
+
+\subsection{Opposition}
+The Singapore Government has always taken the question of
+opposition seriously, even though it ruled in a one-party
+Parliament from 1965 to 1980, and since then has been troubled by
+only one, then two, then four opposition members in a 81-member
+chamber. The reason for this is that, unlike most other
+countries, Singapore, as a city-state, has more or less identical
+constituencies;\footnote{ Indeed it is part of PAP policy that
+ this should be so.} it is thus possible for almost total PAP
+domination of Parliament to be suddenly reversed (following
+perhaps some serious economic setback), into almost total defeat.
+Proportional representaiton was expressly rejected in
+1966.\footnote{ See, further, \lexicite{tan-parliament}.}
+
+
+One solution, the creation of a one-party state, is closed off.
+Although the PAP has defined itself as a national movement
+(1983), it was forced by adverse reaction to concede that this
+was not a step towards elevation of the PAP to the ``leading
+role'' given to communist parties in pre-1989 Europe. A severe
+reduction in the PAP vote at the ensuing election (1984)
+emphasized that Singapore, with a fairly solid 30--40\%
+opposition vote,\footnote{ The PAP share of the vote has dwindled
+ from around 80\% in the late 1960s to 63\% in 1991 (voting is
+ compulsory in Singapore). This perhaps shows that even
+ Singapore's apparently total success in implementing its social
+ engineering policy must be qualified by the need to defer to
+ some extent to public opinion: see, further,
+ \lexicite{phang-development}+{357ff}.} could not go down that
+road. As a result, the PAP has had to countenance the legitimacy
+of parliamentary opposition, and has sought instead to control
+it.
+
+The second option, the creation of Non-constituency MPs, designed
+to give a seat in Parliament to the most successful of the
+unelected opposition candidates, an apparently generous gesture,
+did not solve the problem, as it proved unpopular among the
+opposition parties, who prefer to win their seats rather than
+rely on government charity; and the provisions, applying only
+where there are less than two opposition MPs, have been overtaken
+by events.
+
+ More recently, the creation of Nominated MPs (the third
+option), currently four in number, has met with greater success.
+These ``NMPs'' can participate in debates and vote.\footnote{ Except on money bills, supply bills, constitutional
+amendments, and confidence motions.}
+
+
+In case of PAP members deciding to cross the floor, an amendment
+introduced to deal with the politics of the tubulent 1960s
+ensures that they will not be able to do so without forfeiting
+their seats in Parliament.\footnote{ \lexicite{s-const}+{46(2)}.}
+Indeed PAP MPs who vote against the Government, or even abstain,
+are threatened with expulsion from the party.
+
+Any notion that legal development has embraced political
+opposition, is however, quickly contradicted by the constant
+legal harrassment of opposition MPs and the tough action taken
+against those who express opinions outside the arena of party
+politics. Not only the Singapore Law Society, but also NGOs and
+individual critics, have been targeted, especially in ``Operation
+Spectrum'' in 1987, in which 29 people, mainly Church workers and
+social activists, were detained without trial under the Internal
+Security Act, accused of having mounted a Marxist conspiracy to
+overthrow the Government.\footnote{ See \lexicite{ricjs-1987}.}
+This action outraged international opinion. At present, however,
+there are no ostensibly political detainees in Singapore.
+
+(c) Succession.
+ The notion of an elected presidency to replace the nomination
+of the President by Parliament was conceived as a means of
+buttressing PAP rule, or at least the main tenets of PAP rule, and
+in particular as a means of preventing the dissipation of
+Singapore's substantial reserves. Although it was thought by most
+that this post was one into which Lee Kuan Yew would ease himself
+as he talked more and more of giving up executive power, in fact he
+remains as Senior Minister, and a former Deputy Prime Minister, Ong
+Teng Cheong, has been elected. His single opponent in the 1993
+election was a little-known former civil servant.
+
+The main problem with such an elected President is of course how
+his powers relate to those of the Government itself. The
+structure created in Singapore is unique. The President is
+endowed not only with an electoral mandate, but with a formidable
+array of powers. He can withhold assent to certain Bills, veto
+Government loans, senior appointments and budgets of statutory
+boards and Government companies, and exercise various other
+powers. In short, by use of his purely negative powers, he can
+bring government grinding to a standstill at any time.
+
+Another problem with this reform, from the PAP point of view, was
+always that the presidential election might become a hustings for
+opposition candidates. This possibility has been preempted by
+imposing onerous requirements on presidential candidates, so that
+opposition politicans of the present echelon at least, are unable
+to stand. The rules are designed so that only members of the
+PAP-led political, administrative and business elite, can stand
+for election.
+
+Concluding this part of the paper, I would observe that law as
+social engineering in the field of constitutional law in
+Singapore has been largely a success, judged in terms of the
+objectives of reforms.\footnote{ It must be conceded that the
+ theme of this paper raises some interesting theoretical issues
+ about the nature of law which there has been no space to go
+ into. I have deliberately adopted a positivist, Austinian
+ approach, because that seems to me appropriate to the
+ subject-matter. However, the ``social engineering'' approach to
+ the analysis of legal systems does, in general, have to be
+ handled with care. For some of the difficulties involved, see
+ \lexicite{woodman-allotrev}, and Allott's reply, which follows,
+ \lexicite{woodman-allottrev-reply}.} However, there is a kind
+of ``smartness'' about these laws which could lead to their
+removal at some time in the future. By ``smartness'', I mean that
+they appear to be programmed to produce not just in general, but
+rather too precisely, the result desired by their creators. This
+is a characteristic of many of Singapore's social engineering
+laws. They are the kind of laws which in the short term seek out
+their targets with relentless accuracy, negotiating every
+obstacle placed to thwart their efficacy; but in the long term
+they may be shorn of legitimacy by their very smartness---they
+are too smart for their own good. Perhaps they will disappear to
+the same part of the legal underworld which is reserved for Henry
+VIII's Star Chamber and the laws of the communist dictatorships
+of Eastern Europe. They do not provide a framework within which
+any future Government, even perhaps a PAP Government, would feel
+happy.
+
+
+\section{Administrative Law and the Administrative State}\footnote{See \lexicite{tynne-admin-state}.}
+
+Administrative law has seen burgeoning growth in developing
+countries over the last decade or so, and we are now getting used
+to examples of judicial independence and administrative-law
+reform cropping up in unlikely places, such as Indonesia and
+China.
+
+As a generalization about administrative law in Singapore, I
+would say that it has displayed great activity but quite
+remarkable lack of development. The courts have proved very
+unwilling to question administrative decisions in most areas:
+compulsory purchase, taxation, citizenship, immigration, control
+of the press, to name but a few.\footnote{ See, eg,
+ \lexicite{re-dow-jones-asia}.} By way of contrast, they have
+been willing to intervene with the decisions of tribunals and
+disciplinary bodies where natural justice has not been observed.
+But the cases have been few and rather insignificant.
+
+As against the atrophy of judicial review and rule-of-law
+principles, administrative law in the narrower sense of
+regulatory statute law and meticulous enforcement has been
+developing rapidly. Hardly anything regarded by the Government
+as a mischief has been left without drastic regulation: adverse
+comment by NGOs, lawyers, church leaders or foreign
+journalists;\footnote{ Dealt with by the
+ \lexicite{maint-of-relig-harmony-act}++{{8}\dash{19}};
+ \lexicite{internal-security-act}++{{8}\dash{19}};
+ \lexicite{newsp-printing-presses-amd-act}. For the last see
+ \lexicite{batterman-sing-news}. } blocking of refuse chutes
+in apartment blocks; failure by the elite to perpetuate their
+genes; smoking in public; drug-trafficking; firearms; strikes;
+silent defendants; traffic jams in the city centre; crooked
+lawyers; traditional Malay villages (kampongs); official
+corruption; litter; chewing gum; and even unflushed public
+toilets.\footnote{ The tropical mosquito did not stand a chance,
+ and has been dismissed by the irresistible advance of concrete
+ modernity.}
+
+
+In many of these things the Singapore Government's actions have
+been amply and loudly justified. However, the smartness of the
+legal mechanisms used does not extend to preserving from
+collateral damage a large number of fundamental liberties. The
+statutes are not sufficiently smart to be programmed to
+distinguish between activities which are simply anti-social, and
+activities which may have a combination of desirable and
+undesirable aspects, or which may be wholly desirable. For
+example, restricting traffic in the centre at peak hours and the
+size of the car population in general seems sensible (to this
+observer at least), the infringement of personal liberty being
+marginal. The restrictions on criticism by the press, the
+churches, and NGOs, however, the sign of a healthy, democratic
+society, may (for all I know) marginally increase foreign
+investment, in the sense that Singapore will be perceived as a
+stable business environment, but the cost in terms of freedom of
+thought and expression, which any entrepreneurial society, let
+alone an open society, needs, is very great,\footnote{ Having
+ taught at the National University for several years, I can
+ vouch for the effect of discouragement of criticism on the
+ mentality of a generation of Singaporeans.} unless one sees the
+population simply as an unintelligent resource, obedient
+automata, or ``digits'', to use the word often used by Lee
+himself and other PAP leaders.
+
+\subsection{Habeas corpus}
+The development of habeas corpus is a good example of the
+smartness of Singapore laws. In \footnote{% to use -t- here
+ % later
+ \lexicite{chngsuantzevminister}; for comment see Sin Boon
+ Ann, `Judges and Executive Discretion---a Look at
+ \lexicite{sin-boon-ann-chingvminister};
+ \lexicite{harding-singapore-prevent}. See also
+ \lexicite{teo-soh-lung-v-min}; \lexicite{vincent-cheng-v-min}.}
+the Court of Appeal had to address what is probably the single
+most important question of administrative law: to what extent can
+the courts review the exercise of a subjectively-framed
+discretion (in this case to detain persons under the Internal
+Security Act as a threat to security or public order)?
+
+The Court commented adversely on a previous decision\footnote{
+ \lexicite{lee-mau-seng-v-min}.} denying the possibility of such
+review in security cases, and opined that the appropriate test
+was an objective one: the satisfaction of the President (acting
+on ministerial advice) had to be objectively reasonable, and it
+was not sufficient that the minister genuinely believed himself
+satisfied. However, the actual ratio of the case was that there
+was no actual evidence of presidential satisfaction. As a result,
+habeas corpus was granted and the detainees released. However,
+quite cynically, the Government arranged for their rearrest
+outside the detention centre on freshly prepared documentation
+which complied with the Court's ruling. If the court had framed
+the ratio of the case more generally, this would not have been
+possible.
+
+Legislation was then passed restoring the previous law, excluding
+the relevance of the case-law of any other
+jurisdiction,\footnote{ Cases from other Commonwealth countries,
+ including Namibia and Zimbabwe were cited in Chng's case.} and
+denying an appeal to the Privy Council in security
+cases.\footnote{ \lexicite{intl-sec-amend-1989}. Consequential
+ constitutional amendments were effected by the
+ \lexicite{constamend-1989}.}
+
+
+The smartness of these laws goes even further. The appeal to the
+Privy Council could of course be abolished at any time, but has
+been retained because it encourages inward investment. However,
+the appeal requires agreement between the parties at any time
+before the case goes to the Singapore Court of Appeal, and is not
+allowed in security cases and cases involving professional
+discipline. Thus important commercial cases can still go the
+Privy Council and be decided by English judges in London, but
+cases involving the Government can be filtered out simply by the
+expedient of the Government refusing to agree to the appeal, thus
+allowing the case to be determined finally by the Singaporean
+judiciary. The competence and independence of the judges need not
+be in issue: if their decisions are not sufficiently smart, they
+can be reversed by exercise of legislative power, and if this
+requires a constitutional amendment, the Constitution also
+ensures that the two-thirds requisite majority is always
+forthcoming.
+
+\subsection{Eugenics}
+Another example which has become famous is the so-called
+`Graduate Mothers Scheme', under which university-educated
+mothers were allowed certain privileges with regard to choice of
+primary school for their children. The object of this scheme was
+to encourage the reproduction of the elite, which was reckoned to
+have fallen behind that of less qualified parents. This
+represented the reversal of a family-planning policy which had
+been rigorously enforced by a series of carrot-and-stick methods
+over a period of several years, the object of which was to
+prevent a population explosion in a small island with little land
+to spare. The scheme failed, as very few mothers took up their
+rights under the scheme.\footnote{ Tax incentives still remain,
+ however.} After a vigorous defence of its purpose, the
+Government quietly dropped it the year following its
+introduction. What is interesting is that, although there was no
+constitutional challenge to the scheme, it was clearly perceived
+by a significant number of people as an illegitimate use of
+administrative power. Smartness, even in Singapore, has to extend
+to smartness about public opinion, even though the Singapore
+Government has proved adept at opinion-formation, and has
+sometimes succeeded in altering what Governments elsewhere might
+regard as an intractable environment of public opinion. The
+extremes to which Government goes to alter the environmental of
+opinion makes the nature of Singaporean laws highly instrumental
+and regulatory, when taken in conjunction with administrative
+measures and campaigns.\footnote{ Here I part company with Phang
+ (eg, \lexicite{phang-development}++{{274}\dash{75}}), who regards
+ these laws as proceeding from a favourable environment of
+ public opinion. It is of course true that there are
+ countervailing values such as ``westernization'', which have
+ made the Singapore Government's task much more difficult; this
+ development has resulted in a more materialistic society, but
+ not in a greater emphasis on individual rights.}
+
+
+Laws on voluntary sterilization and abortion have also played a
+large part in the eugenics policy; these have had the effect of
+encouraging and liberalizing access to sterilization and
+abortion, thereby restricting population growth.
+
+To conclude this section, administrative law in Singapore has
+become law for administrators, not in my view a balance between
+the rights of citizens and the practical attainment of collective
+goals. There have been some very desirable consequences apart
+from the erosion of basic liberties: the virtual abolition of
+corruption, the provision of public housing and health care, and
+the reduction in environmental pollution, for example. None of
+these achievements can really be attributable to the denial of
+fundamental rights as such. Labour laws, on the other hand, have
+severely restricted rights of freedom of expression, assembly and
+association.
+
+\section{Conclusions}
+
+Let me now return to the question posed near the beginning of
+this paper: is law as social engineering in Singapore purely an
+outcome of its situation, or is it indeed a glimpse of the legal
+future of the 21st century in the Asia-Pacific region?
+
+To answer this question one must look more widely at events in
+East and South East Asia, and look carefully at the crystal ball
+(or at the yam sticks!).
+
+I hope to have shown how the development of Singapore law has
+been an outcome of its peculiar history, geography and politics.
+It would be an easily achieved answer to say that the case of
+Singapore affords us no general propositions about the future of
+state and law in the region or the world: it is a one-off case,
+albeit a remarkable one.
+
+This would be superficial reductionism. There is much in the
+Singapore experience which matches that of the premier-league
+players, Japan, Hong Kong, Taiwan, and South Korea, and now also
+to some extent, in the first division, Malaysia, Thailand, China,
+and possibly also, looking to those aspirants for promotion,
+Indonesia, the Philippines, and Vietnam.
+
+ There is also no doubt that Lee Kuan Yew and other Singapore
+leaders see Singapore as a model for others to follow. This
+attitude is clearly shared by the leaders of some other countries.
+China has asked Singapore to create a Singapore clone at the city
+of Suzhou, near Shanghai. Thailand, Indonesia and Malaysia are
+cooperating with Singapore in the creation of special economic
+zones. Singaporean enterprises are investing in Vietnam and China;
+the latter has now become the largest recipient of Singaporean
+outward investment.
+
+There are of course important differences. These countries all
+have autochthonous legal systems dating from pre-industrial
+times. Some are still communist states. Although they display
+different degrees of openness in their political systems, all
+have large and growing democracy movements, spawned by
+educational advances, the rise of a prosperous and ambitious
+middle class, and the influence of NGO movements and other
+international movements. In December 1991 President Ramos of the
+Philippines politely rebuked Lee Kuan Yew for suggesting a
+Singapore-model approach in that country, reminding him that his
+country had already tried an authoritarian approach without much
+success.\footnote{ \lexicite{disc-democracy}.} It is a grave
+error, in my view, to think that state structures, political
+cultures and legal systems in Asia are similar or are converging.
+
+The question therefore arises whether these emerging NICs, as
+they are often called, or newly democratizing countries (NDCs, as
+I would prefer) can pursue a Singapore-style legal system. I
+think the answer to this is that although, to an extent, they
+have already done so, further development of the region's legal
+systems along the lines of Singapore's is unlikely. Although it
+has been affected by the tail-end of the region's democratic
+reform-oriented movement, snuffed out in the 1987 detentions,
+Singapore has only marginally conceded a point or two to this
+movement, putting forward an alternative ``style'' of PAP
+government under Prime Minister Goh Chok Tong since
+1990.\footnote{ By representing the two most popular approaches
+ to Government in Singapore, the PAP has cleverly, to some
+ extent, succeeded in garnering the radical (``consensual
+ Government'') vote as well as the conservative (``authoritarian
+ Government'') vote.}
+
+
+The Singaporean educated middle-classes are a much more malleable
+entity than their equivalents elsewhere in the region, where
+important concessions have been made to ``multi-party
+democracy''. Even in Japan, the model which others in the region
+try to emulate, a coalition of non-LDP parties has taken power
+after two generations of LDP rule, an event unthinkable until
+recently. The effect of such events on Singapore has, so far,
+been slight. Even the present ``consensual style'' of Government
+has been able to embrace the dismissal of an opposition
+politician from his university post on the flimsiest of charges,
+and the hounding of Workers' Party leader JB Jeyaratnam resulted
+in some very adverse comments from the Privy Council.\footnote{
+ \lexicite{jeyaretnam-v-law-soc-sing}.} There is little sign
+that the new style is anything more than the old policy in new
+clothing. The necessities of Singapore's situation and the
+economic success achieved over the past two decades have enabled
+the PAP to immunize itself effectively against the democracy
+movement, albeit with some international disapproval. The size
+of Singapore has enabled a growth and effectiveness of the organs
+of state to an extent which even Japan, with all its social
+cohesion, has not been able to achieve. The severe
+anti-corruption laws protect the Government from the most telling
+charge which is brought against its peers elsewhere in the
+region, and which fuels the demand for legal reform.
+
+My conclusion is therefore that the monsoon-winds of change now
+sweeping the region cannot be broken by the wide espousal of a
+Singapore-type legal system. On the contrary, I think the
+question is whether Singapore itself will be swept along by these
+winds. My guess is that the legal system is now firmly
+entrenched, and that it will ride the storm. I envisage that much
+of the region will become, superficially, more like Singapore,
+but Singapore itself will have to make some concessions to the
+growing desire for rule-of-law institutions, or a rechtstaat,
+and the paraphernalia of constitutional democracy.
+
+\end{document}
+
+
+
+
+
+
+
+
diff --git a/macros/latex/contrib/lexitex/lexitex.doc b/macros/latex/contrib/lexitex/lexitex.doc
new file mode 100644
index 0000000000..2397b7176a
--- /dev/null
+++ b/macros/latex/contrib/lexitex/lexitex.doc
@@ -0,0 +1,3643 @@
+% \def\fileversion{ver.~2.0j}
+% \def\filedate{1994/12/12}
+% \def\docdate {1994/07/06}
+% \CheckSum{3744}
+%\iffalse
+%
+% Copyright (C) 1992-1994 by Frank Bennett. All rights reserved.
+%
+% This file contains the entire LexiTeX package. The LexiBib
+% package for BibTeX is contained in the separate file
+% lexibib.doc.
+%
+%
+% To get started with unpacking, run this file through DOCSTRIP
+% giving `driver' as the extraction option, with the extension
+% `ins'. Then run the resulting lexitex.ins file through LaTeX,
+% which will strip all of the files in the package. This
+% requires about 10-15 minutes on my 33mhz Linux box, with
+% an X server running; your mileage may vary. To print
+% the manual, edit the lexitex.man file to your taste and run
+% it through LaTeX. To make the reference cards, run lexicard.tex
+% through LaTeX.
+%
+% IMPORTANT NOTICE:
+%
+% You are not allowed to change this file. You may however copy
+% this file to a file with a different name and then change the
+% copy if (a) you do not charge for the modified code, (b) you
+% acknowledge LexiTeX and its author(s) in the new file, if it
+% is distributed to others, and (c) you attach these same
+% conditions to the new file.
+%
+% You are not allowed to distribute this file alone. You are not
+% allowed to take money for the distribution or use of this file
+% (or a changed version) except for a nominal charge for copying
+% etc.
+%
+% You are allowed to distribute this file under the condition that
+% it is distributed with all of its contents, intact.
+%
+% For error reports, or offers to help make LexiTeX a more powerful,
+% friendlier, and better package, please contact me on
+% fbennett@clus1.ulcc.ac.uk
+%\fi
+%
+%
+% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
+% \DoNotIndex{\@flushglue,\@gobble,\@input}
+% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
+% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
+% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
+% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
+% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
+% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
+% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
+% \DoNotIndex{\cal,\csname,\def,\documentstyle,\dospecials,\edef}
+% \DoNotIndex{\egroup}
+% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
+% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
+% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
+% \DoNotIndex{\ifcase}
+% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
+% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
+% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
+% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
+% \DoNotIndex{\strutbox}
+% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
+% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
+% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
+% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
+% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
+% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
+% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
+% \DoNotIndex{\nopagebreak}
+% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
+% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
+% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
+% \DoNotIndex{\[,\{,\},\]}
+% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
+% \DoNotIndex{\baselineskip,\begin,\tw@}
+% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
+% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
+% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
+% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
+% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
+% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
+% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
+% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
+% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
+% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
+% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
+% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
+% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
+% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
+% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
+% \DoNotIndex{\bfdefault}
+% \setcounter{StandardModuleDepth}{1}
+% \MakeShortVerb{\"}
+%
+% \title{User's Guide\\to\\\LexiTeX\\{\large a context-sensitive citation engine
+% for \LaTeX}\thanks{%
+% This file has version number \fileversion{} dated \filedate{}.
+% The documentation was last revised on \docdate.
+% }}
+% \author{Frank G. Bennett, Jr.\thanks{The text and source code
+% contained in this file are
+% \copyright~1992--1994 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 \LexiTeX.
+% The author wishes to thank
+% Steve Bellovin, George Greenwade and Boris Pevzner for their
+% helpful comments on earlier versions on \LexiTeX. 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 the initial release of \LexiTeX.}}
+% \maketitle
+%
+% \begin{abstract}
+% \noindent This {\tt doc} file contains all of the code and
+% documentation for \LexiTeX, a set of macros
+% that enables \LaTeX\ to produce cross-referenced
+% in-footnote citations for legal and other materials
+% from a single list of citations
+% specified at the top of the document or in a separate citation
+% source file. Citations produced by \LexiTeX\ conform to
+% the style specified in the {\sl Uniform
+% System of Citation} (the `Blue Book'). This style will also
+% generate tables of authorities if required.
+% \end{abstract}
+%
+%
+% \tableofcontents
+% \newpage
+%
+%
+%
+% \bigskip
+% \begin{lexilist}
+% \newbook{bluebook}{}{A Uniform System of Citation}{19th ed.\ 1989}
+% \newbook{knuth}{D.E. Knuth}{The \TeX book}{1990}
+% \newbook{leunen}{M.-C. van Leunen}{A Handbook for Scholars}
+% {1979}
+% \end{lexilist}
+% \lexiforcefoots
+% \hfill {``Now comes the fun part.''}\par
+% \smallskip
+% {\hfill ---Donald Knuth}\lexicite{knuth}+{176}.%
+%
+% \bigskip
+% \section{Preface to release 2.0}
+%
+% This {\tt doc}-format release of \LexiTeX{} replaces the set
+% of files released in June of 1993. There is no change in
+% the syntax used to declare citations, but that for nickname
+% invocations of a cite {\em has\/} changed; some editing of
+% documents prepared for use with the initial release may be
+% required before they will run with the new version.
+% The syntax of the {\tt lexicite.tex} file
+% has also changed. Any alterations that you have made to
+% your existing file must be replicated by hand in the new
+% {\tt lexicite.tex} style definition file. The new syntax
+% in that file has changed only slightly, and the way to
+% proceed should be readily apparent. If you made any
+% changes to this file, please send me a note of them, so that
+% they can maybe be included in a future release.
+%
+% \subsection{Changes over the previous release}
+% \begin{itemize}
+% \item {\bf List input:} It is now possible to input citations from a
+% separate file, and use nickname references throughout
+% the text. This opens the prospect of linking \BibTeX\
+% databases with \LexiTeX\ documents once appropriate
+% \BibTeX\ styles are developed. It also greatly simplifies
+% document editing, since one no longer need worry about
+% assuring that the first use of a citation is in the form
+% of a declaration.
+%
+% \item {\bf List macro storage:} Citation information is now stored in
+% list macro form. This has made it possible to edit macros
+% during processing with \LaTeX, which is necessary both for
+% the list-input feature, and for several enhancements planned
+% for the future.
+%
+% \item {\bf Redundant {\tt\string\xdef} of \meta{cite type
+% name}{\tt faces}:}
+% The
+% last release redefined this macro every time a declaration was
+% made of a new citation---unnecessary, since this information
+% is common to all citations declared in a particular style.
+% This redundancy has been eliminated by moving the relevant
+% definition inside {\tt\string\newcitestyle} where it belongs.
+% It therefore executes once for each cite type, during the
+% processing of {\tt lexicite.tex} at start-up.
+%
+% \item {\bf Redundant arguments:} One of the central processing macros
+% in the old storage routines passed data to a chaining macro
+% both as arguments to that macro {\em and\/} as defined
+% temporary token registers. This bit of confusing and time-wasting
+% silliness has been eliminated.
+%
+% \item {\bf Print routine simplification:} The print routine is still an
+% uncommented mass of conditions, but the method for selecting
+% long- or short-form citations has been changed from the
+% passing of macro arguments and the use of separate print
+% macros to an {\tt\string\if} toggle. This allows a much
+% higher degree of control in further development of the style.
+% \end{itemize}
+%
+% \subsection{Desiderata and future undevelopment}
+% \begin{itemize}
+% \item The `anon' style names in {\tt lexicite.tex} are now
+% optional. Citations with an author argument, or without a
+% last citation part, automatically drop their bridging
+% punctuation, so these styles are no longer necessary.
+%
+% \item We should be able to draw upon an existing list macro in
+% \LaTeX{} in the {\tt\string\@law@clean} routine. I don't
+% know enough about \LaTeX's inner workings to do this;
+% if anyone wants to have a go or suggest how to go about
+% doing things in a less cumbersome way, please do.
+%
+% \item Parallel citations should be supported.
+%
+% \item Hereinafter references should be supported.
+%
+% \item There should be support for cross-referenced styles other
+% than the Blue Book.
+%
+% \item Cross-referencing to different chapters in the same book
+% should refer back to the first cite to the book, rather than
+% seeing each as a separate source. This is difficult, but
+% nothing is impossible.
+%
+% \item Internal sorting of the tables of references could be added.
+%
+% \item \BibTeX\ styles exporting in \LexiTeX\ format would now
+% allow full support for legal publications in \LaTeX.
+%
+% \item There should be more meaningful error messages.
+%\end{itemize}
+% \newpage
+% \pagenumbering{arabic}
+% \section{Introduction}
+%
+% This guide outlines the use of \LexiTeX, a suite of macros
+% for use with the \LaTeX\ typesetting system that automates
+% the formatting of cross-referenced citations in the style
+% specified by the so-called Blue Book.\lexicite{bluebook}{}
+% Using this package, it is possible to maintain a list
+% of cases, articles, books and statutes, and incorporate
+% these into the document in properly cross-referenced
+% footnotes using simple nickname flags. The list of
+% sources may be written into the document, or may be
+% included from a separate file of citations.
+%
+% This package is still under development. This means that
+% there are some citation forms that it cannot produce
+% automatically. It does not (or should not) mean that the
+% behaviour of the formatting engine is in any way
+% unstable or unpredictable. If you find a bug, please
+% inform me, and it will be dealt with as soon as possible.
+% The main citation forms that \LexiTeX\ cannot produce automatically
+% at present are parallel citations to court decisions,
+% and `hereinafter' short-forms. The latter is, at least
+% for U.S. materials, a minor drawback. The former is more
+% serious, and also more difficult to provide for. That
+% said, I do have strategies for providing both, and a future
+% release supporting both of these citation forms is planned.
+% I use \LexiTeX\ every
+% day in my own work; these enhancements {\em will\/}
+% be provided in due course.
+%
+% The ultimate aim in the development of this package is to allow
+% the integration of bibliographies of legal materials stored in \BibTeX\
+% format into \LaTeX\ documents, following conventions similar
+% to those used in preparing ``conventional'' documents with
+% bibliographies. When this is achieved, it
+% will be possible for users to enjoy automated cross-referencing
+% facilities without any need to prepare citations specially for digestion
+% by \LexiTeX; the syntax for declaring citations, described
+% below, will become an interface syntax for transporting citation
+% details between \BibTeX\ and \LexiTeX.
+%
+% Even at present, for the user who has access to \LaTeX\ and
+% is willing to learn a new
+% method of entering citations, this package should make it
+% possible to produce a more professional memorandum with less
+% fuss, in the long run, than required using a straight word-processor.
+%
+% This guide contains basic instructions on the use of
+% \LexiTeX. Users who wish to know more about the inner
+% working of the macros should obtain a copy of this
+% guide that contains the commented listing of the code.
+%
+% \section{Entering citations}
+%
+% \subsection{Generally}
+%
+% Within a document, there are just two forms for entering
+% citations: a declaration form, and a nickname form.
+% A cite declaration feeds \LexiTeX\ the information it needs
+% to generate references to a particular source.
+% A nickname cite tells \LexiTeX\ to expand that citation
+% in the form appropriate to a particular place in the
+% document. Declarations take the form:
+%
+% \begin{quote}
+% {\tt\string\new\meta{style name}\{\meta{nickname}\}%
+% \meta{arguments\ldots}}
+% \end{quote}
+%
+% The various style names are defined in the file
+% {\tt lexicite.tex}. The citation style in which a cite
+% is declared determines
+% the typefaces used in various parts of its printed form,
+% the punctuation that appears between
+% its elements, and whether it will be handled (in
+% making short form citations and generating tables) as
+% a cite to an article, a book, a case or a statute.
+% You can edit the {\tt lexicite.tex} file to add
+% entries or change the behaviour of existing citations,
+% but the distributed file should cover most needs.
+%
+% The style name also determines the number of arguments
+% required by the declaration macro for cites of that
+% style. The maximum possible number of arguments (apart
+% from page references, about which more later) is six.
+% For example, the cite declaration {\tt\string\newarticle}
+% requires all six arguments (nickname, author, title,
+% source, page number and year), while the {\tt\string\newbook}
+% style takes four (nickname, author, title, year).
+% Study the examples in Table 1;
+% with a little practice, the entry of citations in \LexiTeX\
+% format will become second nature, at least for common sources.
+%
+% One item worthy of special note is that citation styles which
+% make use of the second argument (that immediately following
+% the nickname) and the very last argument will automatically
+% eliminate any bridging punctuation pertaining to these arguments
+% if they are
+% missing. So you can equally well type:
+% \begin{quote}
+% \begin{verbatim}
+% \newanonbook{bloggs}{The Boop Diaries}{1994}
+%\end{verbatim}
+% \end{quote}
+% for which the author argument is unnecessary, or:
+% \begin{quote}
+% \begin{verbatim}
+% \newbook{bloggs}{}{The Boop Diaries}{1994}
+%\end{verbatim}
+% \end{quote}
+% for which the author argument is simply empty.
+%
+% Cite declarations can be included in your document in either of two
+% ways: directly in the text as above, or via list input. The only
+% difference between the two is that the latter are placed
+% within a {\tt lexilist} environment. Citations
+% declared within this environment may be entered directly in
+% the document, or may be included from another file using
+% {\tt\string\input}. All of the following entries are valid:
+%
+% \begin{quote}
+% \begin{verbatim}
+% \begin{lexilist}
+% \newbook{ramsrose}{J.M.~Ramseyer \& F.~Rosenbluth}
+% {Japan's Political Marketplace}{1993}
+% \end{lexilist}
+%
+% \begin{lexilist}
+% \input mycites.tex
+% \end{lexilist}
+%
+% \begin{lexilist}
+% \newbook{ramsrose}{J.M. Ramseyer \& F. Rosenbluth}{Japan's
+% Political Marketplace}{1993}
+% \input mycites.tex
+% \end{lexilist}
+%\end{verbatim}
+% \end{quote}
+%
+% You can use multiple input files, and you can have more than
+% one "lexilist" environment in a single document.
+%
+% Citations entered within a {\tt lexilist} environment do not
+% print themselves at that point, but their information is
+% stored for future use. You should therefore put the {\tt lexilist}
+% environment at the top of your document, to be sure \LaTeX\ knows
+% about your citations before it needs them.
+%
+% While citations can be declared in the text where they are
+% first used,
+% there are advantages to using the {\tt
+% lexilist} environment. Collecting citation details
+% in one place makes it easier to clip
+% citations from one document and include them in another.
+% It is also possible to use a common database of citations
+% for several documents.\footnote{Careful with this,
+% though; remember that each citation uses up a little
+% memory; \TeX\ will eventually run out of space.
+% On my system (NTT-J\TeX~1.52 compiled as a big \TeX)
+% the capacity appears to be about 1,000--1,500 citations.
+% Too small for a database, but large enough for most
+% individual documents.}
+% Some short forms change if two works
+% by the same author are cited in the document; list input assures
+% that these citations will be correct throughout the text. It is
+% also convenient to have all of your citations in one place; this
+% makes it easier to snip a citation out of one document and include
+% it in another. Nonetheless, there may be times when you
+% want to enter a citation declaration directly into your text.
+% You can. It will work exactly like a list input declaration,
+% but it will expand into the full form of the citation at the
+% point where it is entered.
+%
+% Nickname citations are entered in the following form:
+%
+% \begin{quote}
+% "\lexicite{"\meta{nickname}"}"
+% \end{quote}
+%
+% There may be times when you want to use a full-form
+% citation in a particular spot. This is permitted by
+% the Blue Book.%
+%\footnote{`\thinspace``{\em Supra}'' and ``hereinafter''
+% {\em may} be used \ldots' (emphasis added). \lexicite{bluebook}+{22}.}
+% If you want to force a full-form citation, you can use
+% "\lexicitefull" instead of "lexicite". Otherwise the
+% reference will automatically shift to sort-form if
+% appropriate in the context. If you set the toggle
+% "\lexiforcefoots" at the top of your
+% document, \LexiTeX\ will create a footnote when it finds
+% a "\lexicite" command in the text, and place the
+% formatted citation inside it.\footnote{Remember, however, that an
+% explicit space should be placed after
+% the {\tt\string\lexicite} command and its arguments (if any) if a space should
+% follow it.}
+%
+% \subsection{Pinpointing references}
+%
+% Citations often refer to a particular page in a work,
+% and page references work differently for long- and short-form
+% citations. These differences are handled automatically
+% by \LexiTeX, drawing upon the style information contained in the
+% citation style used to create the original cite. To append
+% an additional page reference, just type a {\tt+} after
+% the \LexiTeX\ reference, followed by the page number
+% in squiggly braces. This works for initial declarations,
+% full-form nickname citations and short-form nickname citations
+% (But for initial declarations, please note
+% that the {\tt+} goes {\em after\/} the last argument
+% of the declaration):
+%
+% \begin{quote}
+% \begin{verbatim}
+% \newbook{walk}{}{Walker's Britain}{1992}+{126}
+% \end{verbatim}
+% \end{quote}
+% \begin{quote}
+% \begin{verbatim}
+% \lexicite{walk}+{126}
+% \end{verbatim}
+% \end{quote}
+% \begin{quote}
+% \begin{verbatim}
+% \lexicitefull{walk}+{126}
+% \end{verbatim}
+% \end{quote}
+% \subsection{Multiple page references}
+%
+% To add a reference to more than one page, the following
+% syntax is used:
+%
+% \begin{quote}
+% \begin{verbatim}
+% \lexicite{walk}++{{126}\& {132}}
+%\end{verbatim}
+% \end{quote}
+% The "++" tells \LexiTeX\ that plural page or section references
+% are called for. Page references themselves should be enclosed
+% within their own braces, and an outer set of braces must
+% enclose the group. Valid separators between individual
+% page or section references are "\&", "\," and "\dash".
+% These control characters should {\em always\/} be used
+% instead of raw punctuation; they are used in the production
+% of tables.\footnote{Actually, this only applies to statute
+% references, but life is simpler if you keep things uniform.}
+%
+% \subsection{``Advanced'' features}
+%
+% \subsubsection{Producing tables}
+%
+% Most articles do not include tables of cases and statutory
+% references, and law review articles seldom include a bibliography.
+% But if you wish to typeset a book, or if you must check
+% the citations for an extensive article against the original
+% sources, tables of cases and statutes are useful.
+%
+% \LexiTeX\ can generate tables of references
+% automatically.
+% The production of tables is a three-stage process. First,
+% the raw table data must be generated using \hbox{\LaTeX}. Then this
+% raw data is sorted and formatted using the "makeindex"%
+%\footnote{The {\tt makeindex} utility is \copyright{}
+% 1989 by Chen \& Harrison International Systems, Inc.; \copyright{}
+% 1988 by Olivetti Research Center; and \copyright{}
+% 1987 by Regents of the University of California. It is currently
+% maintained by Nelson Beebe, "beebe@math.utah.edu".}
+% utility. Finally, \TeX\ is run on the document again to
+% create the full text containing the finished tables.
+%
+% When the document is run through \TeX\ the first time,
+% the appropriate declarations must appear in the preamble
+% of the document (i.e. between {\tt\string\document\-style}
+% and {\tt\string\begin\{document\}}). The commands for
+% each type of table are: {\tt\string\make\-book\-table},
+% {\tt\string\make\-article\-table}, {\tt\string\make\-case\-table},
+% and {\tt\string\make\-statute\-table}. When \TeX\ is run
+% with these commands present in the preamble, files with
+% the respective extensions {\tt.btb}, {\tt.atb}, {\tt.ctb} and
+% {\tt.stb} will be produced.
+% These must then be processed into properly formatted
+% lists using {\tt makeindex}.%
+%\footnote{The documentation for
+% {\tt makeindex} will explain how it should be set
+% up for your system. On a UNIX or DOS installation,
+% the basic requirements are that the {\tt makeindex}
+% program be in your search path, and that the appropriate
+% environment variable (usually {\tt indexstyle}) be set---%
+% this tells {\tt makeindex} where to find the style
+% files that tell it exactly how to format the finished
+% table lists.} On a UNIX or DOS system you would type the
+% following for each type of table:
+% \begin{itemize}
+% \small
+% \item
+% {\tt makeindex -s lexibook.ist -o} \meta{file name}".bok" \meta{file name}".btb"
+% \item
+% {\tt makeindex -s lexiarti.ist -o} \meta{file name}".art" \meta{file name}".atb"
+% \item
+% {\tt makeindex -s lexicase.ist -o} \meta{file name}".cas" \meta{file name}".ctb"
+% \item
+% {\tt makeindex -s lexistat.ist -o} \meta{file name}".sta" \meta{file name}".stb"
+% \end{itemize}
+% You should then check to be sure the appropriate
+% command or commands among {\tt\string\print\-case\-table},
+% {\tt\string\printstatutetable}, {\tt\string\print\-article\-table} and
+% {\tt\string\print\-book\-table}
+% are in the appropriate places in your document.%
+%\footnote{In other words, at the location where the relevant
+% table should appear.}
+% Run the document
+% through \LaTeX\ again, and the tables should appear in the printed
+% output.
+% To avoid typing the detailed commands required by {\tt makeindx},
+% you might prefer to write a script or batch file for your
+% site that does this automatically for you.
+%
+% For books, articles and cases, only the full citation of the
+% work or source is written to the table file. For statutes, however,
+% \LexiTeX\ writes both the full citation of the statute and
+% any section reference that you have specified, as a
+% sub-entry. When the statute table is sorted, these entries
+% will be arranged in a column below the statute name.
+% This formatting can of course be altered by a wizard.
+% You may find that statute sections appear out of their
+% proper numerical order. This is because {\tt makeindx}
+% performs an alphabetical sort, in which 1's come first,
+% 2's come second, etc., regardless of the number of digits
+% which follow. Can't have everything. In these cases,
+% you need to rearrange the entries by hand before printing.
+%
+% \subsubsection{Selective printing}
+%
+% The simple syntax described so far is sufficient for most situations.
+% However, for some references---particularly references to
+% statutes---greater flexibility is required. \LexiTeX\ provides
+% three special characters that can be used to suppress printing
+% within a document. The characters, and their functions, are
+% as follows:
+%
+% \begin{description}
+% \item[\tt\string^] Putting a "^" at the start and end of a
+% piece of text within the pinpointing argument to a citation
+% causes that text to be printed only in the text, and only
+% when the citation is printed in full form; it will be
+% omitted from the tables when they are printed, and from
+% short-form citations. This is useful for including
+% explanatory comments on an individual's title, for example,
+% in an initial citation. It can also be used to prevent
+% subsections of a statute from being entered on the
+% tables.
+%
+% \item[\tt\string_] Putting a "_" at the start and end
+% of a piece of text within the pinpointing argument causes
+% that text to be printed only in the tables, but to be
+% omitted from the text itself.
+%
+% \item[\tt\string|] Placing a page or section number between
+% "|" characters inside a pinpointing reference to a {\em
+% statute\/} causes that section number to be suppressed
+% when the text is printed, but causes a full entry for
+% the citation, pinpointed to that page or section number,
+% to be written on the statute table raw data file. This
+% is useful as a way of coping with section ranges; \LexiTeX\
+% does not know what the intervening section numbers are,
+% but using this feature you can tell it explicitly.
+% \end{description}
+%
+% It is also possible to suppress the printing of an entire citation
+% in the text
+% by placing a "*" character immediately after the citation.
+% This can be used to assure that a manually-typed citation
+% is correctly cross-referenced by later cites to the same
+% source.
+%\StopEventually{\printbooktable}
+%
+% \section{The Citation Engine: {\tt lexitex.sty}}
+%
+% \subsection{Initialization}
+% \subsubsection{Hello!}
+% To start things off on the right foot, we tell the world
+% who we are.
+% \begin{macrocode}
+%<*lexitex>
+%<!noshorthanding>\ProvidesPackage{lexitex}[1994/12/07]
+%<noshorthanding>\ProvidesPackage{lexitexm}[1994/12/07]
+\NeedsTeXFormat{LaTeX2e}[1993/11/11]
+% \end{macrocode}
+% \subsubsection{Customizable text elements}
+% The user may wish to tailor the text contained in the
+% following control sequence definitions to suit their own
+% language and taste.
+%
+% \begin{macro}{\casetablename}
+% \begin{macro}{\statutetablename}
+% \begin{macro}{\articletablename}
+% \begin{macro}{\booktablename}
+% The use of these four
+% definitions is obvious.
+% \begin{macrocode}
+\def\casetablename{Table of Cases}%
+\def\statutetablename{Table of Statutes}%
+\def\articletablename{Table of Articles}%
+\def\booktablename{Table of Books}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\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
+% {\tt\string\em}. An italic space ("\/") is not added, since
+% this might be followed by a period.
+% \begin{macrocode}
+\def\supra {, {\em supra}}%
+% \end{macrocode}
+% \end{macro}
+% The {\tt\string\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 {\em Id.} be lower case
+% when it occurs, the user can switch it to lower case by entering
+% {\tt\string\lowcase} immediately before an in-text citation
+% declaration or citation nickname. The lower case macro thus
+% invoked turns itself off after {\em id.} has printed, so no
+% grouping is required.
+% \begin{macrocode}
+\def\Id{{\em\@law@lettercase Id.}}%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\newtoks\@ltok@userconetop%
+\newtoks\@ltok@userconetopplural%
+\newtoks\@ltok@userptop%
+\newtoks\@ltok@useratbridge%
+\newtoks\@ltok@useratbridgeplural%
+\newtoks\@ltok@infoot
+\@ltok@infoot={\ note\ }
+\newtoks\@ltok@onpage
+\@ltok@onpage={\ page\ }
+% \end{macrocode}
+% The following tokens are used in making proof sheets.
+% Change the content of these to taste, {\em except
+% for\/} "\@ltok@citeforproof" and "\@ltok@otherciteforproof",
+% which mustn't be changed.
+% \begin{macrocode}
+\newtoks\@ltok@proofcitelast
+ \@ltok@proofcitelast{{Editor, publisher and stuff, 1994}}
+\newtoks\@ltok@proofpage
+ \@ltok@proofpage{{12345}}
+\newtoks\@ltok@proofciteone
+ \@ltok@proofciteone{{Source}}
+\newtoks\@ltok@prooftitle
+ \@ltok@prooftitle{{Title of work}}
+\newtoks\@ltok@proofauthor
+ \@ltok@proofauthor{{Author's name}}
+% \end{macrocode}
+% \subsubsection{User selectable switches}
+% The Blue Book\lexicite{bluebook}{} 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.\footnote{{\em See}
+% \lexicite{bluebook}+{25}.}
+% 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.
+% \begin{macrocode}
+\newif\if@law@statuteverbose
+\def\statuteverboseon{\@law@statuteverbosetrue}
+\def\statuteverboseoff{\@law@statuteverbosefalse}
+\statuteverboseoff
+% \end{macrocode}
+% \begin{macro}{\lexiforcefoots}
+% This fun little item is used to toggle the "\lexicite"
+% 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!
+% \begin{macrocode}
+\newif\if@law@lexiforcefoots
+\def\lexiforcefoots{\global\@law@lexiforcefootstrue}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Alternative shorthanding configurations}
+% The following changes make the "_", "^" and "|" characters active,
+% but set them to expand into the form which is normally expected
+% of them in English text.
+% Use of these shorthand characters is explained in the {\sl
+% User's Guide}.
+% The reason this is done globally is that these are used in shorthand
+% formatting expressions that occur mostly in footnotes. In
+% standard \LaTeX, footnote text is read in as an argument to the
+% {\tt\string\footnote} command. It is therefore impossible for a
+% \LexiTeX{} citation macro to redefine the character as active before
+% it is read by \hbox{\TeX}. So if we don't set them as active now,
+% we can't. This seems to live with {\tt index.sty}, but I'm
+% told it blows up with {\tt german.sty}. If you absolutely
+% positively have to avoid having these characters set active,%
+%\footnote{This manual and code readout cannot be printed with
+% these shorthand characters in force, for example.}
+% you can strip this file using the
+% "noshorthanding" option.
+% When \LexiTeX\ is stripped in this way, you can use
+% {\tt\string\TB} (table only) instead of
+% {\tt\string_}, {\tt\string\TX} (text only) instead of {\tt\string^}, and
+% {\tt\string\CT} (clone in table) instead of {"|"}. It's a lot
+% uglier that way, and harder to read, but it should work.
+% If anyone has suggestions
+% for how to fix this better, I'm on "fbennett@clus1.ulcc.ac.uk" .
+% \begin{macrocode}
+%<*!noshorthanding>
+ \ifcat\noexpand_\noexpand~\else
+ \global\catcode`\_=13
+ \global\let_\sb
+\fi
+\ifcat\noexpand^\noexpand~\else
+ \global\catcode`\^=13
+ \global\let^\sp
+\fi
+\ifcat\noexpand|\noexpand~
+\else
+ \global\edef\@boondoggle{|}
+ \global\catcode`\|=13
+ \global\edef|{\@boondoggle}
+\fi
+%</!noshorthanding>
+% \end{macrocode}
+% The shorthanding definitions have to behave differently
+% in different contexts. The definitions shown here are all pretty
+% nearly self-explanatory. Some redefinitions are contained
+% elsewhere in the code, and are documented where they occur.
+% \begin{macrocode}
+\gdef\@law@barkill{\def_##1_{}\def|##1|{}\def^{}}
+\gdef\@law@barnil{\def_{}\def^##1^{}\def|{}}
+\gdef\@law@barinfull{\def^{}}
+\gdef\@law@barinshort{\def^##1^{}}
+% \end{macrocode}
+% The following definitions simply replicate those used for
+% shorthanding; they will only be valid if they are asked for
+% when this file is run through {\tt docstrip}. This file must
+% be stripped for one or the other, but cannot be stripped for
+% both. Again, if anyone has any ideas \ldots
+% \begin{macrocode}
+%<*noshorthanding>
+\gdef\@law@barkill{\def\TB##1\TB{}%
+ \def\CT##1\CT{}%
+ \def\TX{}}%
+\gdef\@law@barnil{\def\TB{}%
+ \def\TX##1\TX{}%
+ \def\CT{}}%
+\gdef\@law@barinfull{\def\TX{}}%
+\gdef\@law@barinshort{\def\TX##1\TX{}}
+%</noshorthanding>
+% \end{macrocode}
+% \changes{2.0g}{94/08/12}{Added {\tt\protect\string\protect\bridges} macro to
+% allow users to specify pinpoint bridges that diverge from the
+% cite style default.}
+% \begin{macrocode}
+\def\bridges#1#2#3#4#5{%
+ \@ltok@userconetop{#1}%
+ \@ltok@userconetopplural{#2}%
+ \@ltok@userptop{#3}%
+ \@ltok@useratbridge{#4}%
+ \@ltok@useratbridgeplural{#5}%
+}
+% \end{macrocode}
+% \subsubsection{Miscellaneous other macros}
+% Sometimes it might be nice to avoid using {\tt--} 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 {\tt makeindex}.
+% \begin{macrocode}
+\def\dash{--}
+\def\exclaim{!}%
+% \end{macrocode}
+% The {\tt\string\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.
+% \begin{macrocode}
+\def\@law@gobble{}
+% \end{macrocode}
+% If you think \LexiTeX\ is spiffy, you might want to adorn your
+% documents with a logo, so one is defined here. It is
+% {\tt\string\protect}ed just like the \LaTeX\ logo.
+% \begin{macrocode}
+\def\p@LexiTeX{{\reset@font\rm\ \unskip\hbox{L%
+ \kern-.06em\hbox{\sc e}%
+ \kern-.05em\hbox{\sc x}%
+ \kern-.05em\lower.65ex\hbox{I}%
+ \kern-.18emT%
+ \kern-.1667em\lower.65ex\hbox{E}%
+ \kern-.125emX}}}%
+\def\LexiTeX{\protect\p@LexiTeX}%
+\def\p@LexiBib{{\reset@font\rm\ \unskip\hbox{L%
+ \kern-.06em\hbox{\sc e}%
+ \kern-.05em\hbox{\sc x}%
+ \kern-.05em\hbox{\sc i}%
+ \kern-.06em{\sc B}%
+ \kern-.05em\hbox{\sc i}%
+ \kern-.05em{\sc b}}}}%
+\def\LexiBib{\protect\p@LexiBib}%
+% \end{macrocode}
+% \subsubsection{New environment}
+% There is just one new environment in \LexiTeX, and all it does
+% is set the list-input toggle to true, so that input citations
+% will feed into memory but not print.
+% \begin{macrocode}
+\newenvironment{lexilist}%
+{\@law@listinputtingtrue}{\@law@listinputtingfalse}
+% \end{macrocode}
+% \subsubsection{Token registers}
+% The following are used as temporary token registers in various
+% places.
+% \begin{macrocode}
+\newtoks\@ltok@a
+\newtoks\@ltok@b
+\newtoks\@ltok@argtwo
+\newtoks\@ltok@pagesstring
+% \end{macrocode}
+% The following token registers are used for temporary storage of
+% typeface information.
+% \begin{macrocode}
+\newtoks\@ltok@authormainface
+\newtoks\@ltok@authoroptionface
+\newtoks\@ltok@titlemainface
+\newtoks\@ltok@titleoptionface
+\newtoks\@ltok@citefirstmainface
+\newtoks\@ltok@citefirstoptionface
+\newtoks\ltokspecialface
+% \end{macrocode}
+% One token register is needed to store the name of the current cite type
+% (as declared using {\tt\string\newcitestyle} in the {\tt
+% lexicite.tex} file). With this string in hand, all of the
+% typeface and punctuation bridge information can be recovered
+% for that type of citation.
+% \begin{macrocode}
+\newtoks\@ltok@citetype%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\newtoks\@ltok@whereitsat
+\newtoks\@ltok@stylename
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\newtoks\@ltok@nickname
+\newtoks\@ltok@author
+\newtoks\@ltok@name
+\newtoks\@ltok@citefirst
+\newtoks\@ltok@citepage
+\newtoks\@ltok@citelast
+\newtoks\@ltok@pageorfootno
+\newtoks\@ltok@hereinafter
+\newtoks\@ltok@bigsourcecite
+\newtoks\@ltok@bigsourcepage
+% \end{macrocode}
+% We also need token registers for citation bridge information.
+% \begin{macrocode}
+\newtoks\@ltok@atot
+\newtoks\@ltok@ttocone
+\newtoks\@ltok@conetop
+\newtoks\@ltok@conetopplural
+\newtoks\@ltok@ptop
+\newtoks\@ltok@ptoctwo
+\newtoks\@ltok@atbridge
+\newtoks\@ltok@atbridgeplural
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newtoks\@ltok@plistmacro
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\newcounter{citesinfoot}
+\newcounter{citeslastfoot}
+% \end{macrocode}
+% \subsubsection{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.
+% \begin{macrocode}
+\newif\if@law@printcite
+% \end{macrocode}
+% The next one is used by the list-input environment.
+% \begin{macrocode}
+\newif\if@law@listinputting
+% \end{macrocode}
+% The next if will be used to toggle the print routine between
+% long and short citation forms.
+% \begin{macrocode}
+\newif\if@law@longcite
+% \end{macrocode}
+% This will tell us whether we are in a footnote or not.
+% \begin{macrocode}
+\newif\if@law@infoot
+% \end{macrocode}
+% 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
+% {\tt\string\@law@justabovecheck}.
+% \begin{macrocode}
+\newif\if@justabove
+\newif\if@l@quiteexact
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\newif\if@nosupra
+% \end{macrocode}
+% The next is used to signal the presence of {\tt ++}
+% 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 {\tt makeindex}.
+% \begin{macrocode}
+\newif\if@law@multipages
+% \end{macrocode}
+% A single "\if" controls whether a table of cases or statutes is
+% exported.
+% \begin{macrocode}
+\newif\if@writecasetable
+\newif\if@writestatutetable
+\newif\if@writearticletable
+\newif\if@writebooktable
+% \end{macrocode}
+% \subsubsection{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 {\em id.} if
+% necessary. The operation of {\tt\string\normcase} is
+% obvious enough; it defines the case-switching macro
+% to a no-op. \verb+\lowcase+ works by setting
+% the case toggle to force a lowercase letter. The
+% use of \verb+\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.
+% \begin{macrocode}
+\def\normcase{\def\@law@lettercase{}}
+\def\lowcase{\def\@law@lettercase##1{{\aftergroup\normcase\lowercase{##1}}}}
+\normcase
+% \end{macrocode}
+% The \LexiTeX{} nickname macros are now kept out of the name
+% space by executing them via \verb+\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 "\lexicite" 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.
+% \changes{2.0e}{6 August 1994}{Added the {\tt\protect\string\protect\lexibib}
+% code and related macros, which allow selective printing of
+% coments, holdings, questions and fact patterns direct from
+% a \LexiBib database. A veritable production line for
+% casebooks now---if we can overcome the 3,000 character limit
+% of \BibTeX!}
+% \changes{2.0f}{94/08/11}{Added code for leading volume numbers.}
+% \begin{macrocode}
+\newcount\c@law@footnote%
+\newif\if@law@forcing%
+\def\volno{}%
+% \end{macrocode}
+%
+% \begin{macro}{\lexicite}
+% \begin{macro}{\@lexicite}
+% \begin{macro}{\lexicitefull}
+% \begin{macro}{\@lexicitefull}
+% These constitute the user interface for invoking citations.
+% \begin{macrocode}
+\def\lexicite{\@ifnextchar:{\@lexicite}{\@lexicite::}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@lexicite:#1:#2{%
+ \def\volno{#1\ }%
+ \@ifundefined{@lnick@#2}{%
+ \expandafter\def\csname @lnick@#2\endcsname{{\small\bf
+ <undefined: #2>}}}%
+ {\relax}%
+ \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \global\c@law@footnote\c@footnote%
+ \if@law@infoot%
+ \global\@law@forcingfalse%
+ \else%
+ \if@law@lexiforcefoots%
+ \@law@footnoteprefix%
+ \advance\c@law@footnote by 1%
+ \global\@law@forcingtrue%
+\else%
+ \fi%
+ \fi%
+\csname @lnick@#2\endcsname}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\lexicitefull{\@ifnextchar:{\@lexicitefull}{\@lexicitefull::}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@lexicitefull:#1:#2{%
+ \def\volno{#1\ }
+ \@ifundefined{@lnick@#2}{%
+ \expandafter\def\csname @lnick@#2\endcsname{{\small\bf
+ <undefined: #2>}}}%
+ {\global\@law@longcitetrue}%
+ \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \if@law@infoot%
+ \global\c@law@footnote\c@footnote%
+ \else\if@law@lexiforcefoots%
+ \@law@footnoteprefix%
+ \advance\c@law@footnote by 1%
+ \global\@law@forcingtrue%
+ \fi%
+ \fi\csname @lnick@#1\endcsname}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\lexibib}
+% This is used bye \LexiBib{} to declare citations in a {\tt lexilist}
+% environment. Use of a single macro permits
+% {\tt\string\theholding} and its friends to work more simply.
+% \begin{macrocode}
+\def\lexibib#1{\csname new#1\endcsname}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@law@showholding}
+% \begin{macro}{\@law@hideholding}
+% \begin{macro}{\holding}
+% \begin{macro}{\theholding}
+% These macros allow database storage of itemized details of a
+% case holding, and their recall using {\tt\string\theholding}.
+% \begin{macrocode}
+\def\@law@showholding#1{\def\holding{\@law@hideholding}
+ \begin{enumerate}#1\end{enumerate}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@hideholding#1{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\holding{\@law@hideholding}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\theholding{\def\lexibib##1##2##3##4##5##6##7{%
+ \edef\@law@temp{\the\@ltok@nickname}
+ \def\@law@temptwo{##2}
+ \ifx\@law@temp\@law@temptwo\def\holding{\@law@showholding}
+ \else\def\holding{\@law@hideholding}\fi}
+\@input {\jobname.bbl}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@law@showcomment}
+% \begin{macro}{\@law@hidecomment}
+% \begin{macro}{\comment}
+% \begin{macro}{\thecomment}
+% These macros allow database storage of
+% comments on a case,
+% and their recall using {\tt\string\thecomment}.
+% \begin{macrocode}
+\def\@law@showcomment#1{\def\comment{\@law@hidecomment}
+ #1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@hidecomment#1{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\comment{\@law@hidecomment}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\thecomment{\def\lexibib##1##2##3##4##5##6##7{%
+ \edef\@law@temp{\the\@ltok@nickname}
+ \def\@law@temptwo{##2}
+ \ifx\@law@temp\@law@temptwo\def\comment{\@law@showcomment}
+ \else\def\comment{\@law@hidecomment}\fi}
+\@input {\jobname.bbl}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@law@showquestions}
+% \begin{macro}{\@law@hidequestions}
+% \begin{macro}{\questions}
+% \begin{macro}{\thequestions}
+% These macros allow database storage of itemized questions on a case,
+% and their recall using {\tt\string\thequestions}.
+% \begin{macrocode}
+% \begin{macrocode}
+\def\@law@showquestions#1{\def\questions{\@law@hidequestions}
+ \begin{enumerate}#1\end{enumerate}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@hidequestions#1{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\questions{\@law@hidequestions}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\thequestions{\def\lexibib##1##2##3##4##5##6##7{%
+ \edef\@law@temp{\the\@ltok@nickname}
+ \def\@law@temptwo{##2}
+ \ifx\@law@temp\@law@temptwo\def\questions{\@law@showquestions}
+ \else\def\questions{\@law@hidequestions}\fi}
+\@input {\jobname.bbl}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@law@showfacts}
+% \begin{macro}{\@law@hidefacts}
+% \begin{macro}{\facts}
+% \begin{macro}{\thefacts}
+% These macros allow database storage of the facts of a case,
+% and their recall using {\tt\string\thefacts}.
+% \begin{macrocode}
+\def\@law@showfacts#1{\def\facts{\@law@hidefacts}
+ #1}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@hidefacts#1{}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\facts{\@law@hidefacts}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\thefacts{\def\lexibib##1##2##3##4##5##6##7{%
+ \edef\@law@temp{\the\@ltok@nickname}
+ \def\@law@temptwo{##2}
+ \ifx\@law@temp\@law@temptwo\def\facts{\@law@showfacts}
+ \else\def\facts{\@law@hidefacts}\fi}
+\@input {\jobname.bbl}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+
+% The following piece of nasty business adds a zeroed counter
+% to the front of the \LaTeX\ footnote routine, so that we can
+% keep track of how many cites there are in a footnote.
+% \begin{macrocode}
+\let\@law@foothold=\footnote
+\def\footnote#1{\@law@footnoteprefix\@law@foothold{#1}%
+ \global\@law@infootfalse}%
+\def\@law@footnoteprefix{\global\@law@infoottrue%
+ \ifnum\the\c@citesinfoot=1\relax%
+ \let\@law@lastcite\@law@currentcite%
+ \else%
+ \def\@law@lastcite{\@dummy}%
+ \fi%
+ \setcounter{citesinfoot}{0}}
+
+% \end{macrocode}
+% The {\tt *.ist} files that accompany {\tt lexitex.sty} use
+% \verb+\leaderfill+ instead
+% of \verb+\dotfill+. When I get around to changing them, this
+% can be cut.
+% \begin{macrocode}
+\let\leaderfill=\dotfill
+% \end{macrocode}
+% We need to initialize the list macro used as a workspace
+% by the list macro handlers.
+% \begin{macrocode}
+\def\@law@templistmacro{}
+\def\@law@tempplistmacro{}
+% \end{macrocode}
+% These macros are used for \verb+\if+-branching in various
+% formatting routines.
+% \begin{macrocode}
+\def\@law@case{case}
+\def\@law@statute{statute}
+\def\@law@article{article}
+\def\@law@book{book}
+% \end{macrocode}
+% \subsection{Main macros}
+% \subsubsection{Utility macros}
+% This section contains larger macros that perform major
+% tasks and smaller bits of code that are complex in their operation.
+% \begin{macro}{\@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.
+% \begin{macrocode}
+%<*parabeta>
+[HEREIN GOES THE PARALLEL CITATION UNPACKING STUFF]
+[NOTE THAT THIS SHOULD RECYCLE TO ARGSCHECK WHEN DONE]
+[THIS CAN USE TEMPLISTMACRO, BECAUSE EVERYTHING HAS BEEN
+TRANSFERRED TO REGISTERS BY THIS POINT]
+%</parabeta>
+% \end{macrocode}
+% \end{macro}
+% This is a rough set of routines; if anyone has a
+% suggestion on how to more elegantly clean
+% most of \LaTeX'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 \verb+\@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 \LaTeX\
+% passes out of the current group.
+% The "\ifx" condition at the start is meant to catch empty
+% strings fed to the routine. Without it, 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.
+% \begin{macrocode}
+\gdef\@law@clean#1#2{%
+ \def\protect##1{\string##1\space}%
+ \xdef\@law@cleantemp{\the#1}%
+ \ifx\@law@cleantemp\empty%
+ \edef#2{}%
+ \else%
+%<*!noshorthanding>
+ \def^{\string^}%
+ \def_{\string_}%
+%</!noshorthanding>
+ \@law@barnil%
+ \def\exclaim{\string\exclaim}%
+ \def\hbox{\string\hbox}%
+ \def\&{\string\&}\def\%{\string\%}%
+ \def\hskip{\string\hskip}%
+ \def\jintercharskip{\string\jintercharskip}%
+ \def\char{\string\char}%
+ \def~{\string~}\def\/{\string\/}%
+ \def\\{\string\\}\def\ {\string\ }\def\sc{\string\sc\space}%
+ \def\rm{\string\rm\space}\def\bf{\string\bf\space}%
+ \def\em{\string\em\space}%
+ \def\={\string\=}%
+ \def\`{\string\`}\def\'{\string\'}%
+ \def\^{\string\^}\def\"{\string\"}\def\~{\string\~}%
+ \def\.{\string\.}\def\u{\string\u}\def\v{\string\v}%
+ \def\H{\string\H\space}\def\t{\string\t\space}\def\c{\string\c\space}%
+ \def\d{\string\d\space}\def\b{\string\b\space}\def\oe{\string\oe\space}%
+ \def\ae{\string\ae\space}\def\aa{\string\aa\space}\def\o{\string\o\space}%
+ \def\l{\string\l\space}\def\ss{\string\ss\space}%
+ \def\OE{\string\OE\space}\def\AE{\string\AE\space}%
+ \def\AA{\string\AA\space}%
+ \def\O{\string\O\space}\def\L{\string\L\space}%
+ \def\dag{\string\dag\space}\def\ddag{\string\ddag\space}%
+ \def\S{\string\S\space}%
+ \def\P{\string\P\space}%
+ \def\TeX{\string\TeX\space}\def\LaTeX{\string\LaTeX\space}%
+ \def\LexiTeX{\string\LexiTeX\space}%
+ \def\BibTeX{\string\BibTeX\space}\def\-{\string\-}%
+\xdef\@law@temp{\the#1}%
+\xdef#2{\expandafter\expandafter\expandafter\@gobble\expandafter%
+\string\csname\@law@temp\endcsname}%
+\fi}
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\def\@law@cleanup{%
+\@law@clean\@ltok@authormainface\@law@authormainfacetemp%
+\@law@clean\@ltok@authoroptionface\@law@authoroptionfacetemp%
+\@law@clean\@ltok@author\@law@authortemp%
+\@law@clean\@ltok@titlemainface\@law@titlemainfacetemp%
+\@law@clean\@ltok@titleoptionface\@law@titleoptionfacetemp%
+\@law@clean\@ltok@argtwo\@law@argtwotemp%
+\@law@clean\@ltok@name\@law@nametemp%
+\@law@clean\@ltok@citepage\@law@citepagetemp%
+\@law@clean\@ltok@citefirstmainface\@law@citefirstmainfacetemp%
+\@law@clean\@ltok@citefirstoptionface\@law@citefirstoptionfacetemp%
+\@law@clean\@ltok@citefirst\@law@citefirsttemp%
+\@law@clean\@ltok@conetop\@law@conetoptemp%
+\@law@clean\@ltok@citelast\@law@citelasttemp%
+\@law@clean\@ltok@ptop\@law@ptoptemp}
+% \end{macrocode}
+% \subsubsection{Declaration of citation types}
+% This section contains macros used in creating the citation
+% declaration macros actually entered in the document by the user.
+% \paragraph{{\tt @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 {\tt lexicite.tex}
+% file, but the \verb+\newcitestyle+ macro is accessible
+% within the document as well.
+% The \verb+\newcitestyle+ macro expects the following arguments:
+% \begin{enumerate}
+% \item the nickname of the citation style to be created;
+% \item a list of typeface and cite type options, in the
+% syntax required by \verb+\@newciteoptions+;
+% \item a list of cite bridges, in the syntax required
+% by \verb+\@newcitebridges+;
+% \item an integer giving the number of arguments the
+% finished cite-generation macro will accept; and
+% \item an argument consisting of a balanced list of six arguments
+% indicating which of the six possible \LexiTeX\ arguments
+% will be used.
+% \end{enumerate}
+% The last two of these are fed to \verb+\newcommand+ as formatting
+% arguments in the creation of citation style macros.
+% In operation, the token register assignments
+% performed by \verb+\@newcitebridges+ and\verb+\@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 \verb+\xdef+ed,
+% but the expansion of everything
+% except the existing contents of the registers (inserted
+% at one level of expansion using \verb+\the+) is prevented
+% with \verb+\noexpand+s. The
+% macro containing the faces is created inside \verb+\newcitestyle+
+% itself to save an argument position in the definition of
+% \verb+\@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 \meta{cite type name}{\tt 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 \verb+\newcitestyle+ {\em always\/} begin
+% with \verb+\new+. This will help simplify the integration
+% of \BibTeX\ and \LexiTeX.
+% \begin{macrocode}
+\def\newcitestyle#1#2#3#4#5{%
+ \@newcitebridges#1#3%
+ \expandafter\@law@parsefaces#2%
+ \expandafter\xdef\csname#1faces\endcsname{%
+ \noexpand\global\noexpand\@ltok@authormainface\noexpand{%
+ \the\@ltok@authormainface\noexpand}%
+ \noexpand\global\noexpand\@ltok@authoroptionface\noexpand{%
+ \the\@ltok@authoroptionface\noexpand}%
+ \noexpand\global\noexpand\@ltok@titlemainface\noexpand{%
+ \the\@ltok@titlemainface\noexpand}%
+ \noexpand\global\noexpand\@ltok@titleoptionface\noexpand{%
+ \the\@ltok@titleoptionface\noexpand}%
+ \noexpand\global\noexpand\@ltok@citefirstmainface\noexpand{%
+ \the\@ltok@citefirstmainface\noexpand}%
+ \noexpand\global\noexpand\@ltok@citefirstoptionface\noexpand{%
+ \the\@ltok@citefirstoptionface\noexpand}%
+ \noexpand\global\noexpand\@ltok@citetype\noexpand{%
+ \the\@ltok@citetype\noexpand}}%
+ \expandafter\newcommand\csname new#1\endcsname[#4]%
+ {\@newcite{#1}#5}}
+% \end{macrocode}
+% The following are parsing routines that are called by \verb+\newcitestyle+.
+% In \verb+\@law@parsefaces+, the seven arguments are the string of letters
+% in the second argument of \verb+\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.
+% \begin{macrocode}
+\def\@law@parsefaces#1#2#3#4#5#6#7{%
+ \@law@parseoneoption\@ltok@authormainface#1%
+ \@law@parseoneoption\@ltok@authoroptionface#2%
+ \@law@parseoneoption\@ltok@titlemainface#3%
+ \@law@parseoneoption\@ltok@titleoptionface#4%
+ \@law@parseoneoption\@ltok@citefirstmainface#5%
+ \@law@parseoneoption\@ltok@citefirstoptionface#6%
+ \@law@parselastoption\@ltok@citetype#7}
+%
+\def\@law@parseoneoption#1#2{%
+ \if#2s\global#1{\sc}\fi%
+ \if#2i\global#1{\em}\fi%
+ \if#2b\global#1{\bf}\fi%
+ \if#2r\global#1{\rm}\fi%
+ \if#2S\global#1{\sc}\fi%
+ \if#2I\global#1{\em}\fi%
+ \if#2B\global#1{\bf}\fi%
+ \if#2R\global#1{\rm}\fi}
+%
+\def\@law@parselastoption#1#2{%
+ \if#2a\global#1{article}\fi%
+ \if#2b\global#1{book}\fi%
+ \if#2c\global#1{case}\fi%
+ \if#2s\global#1{statute}\fi%
+ \if#2A\global#1{article}\fi%
+ \if#2B\global#1{book}\fi%
+ \if#2C\global#1{case}\fi%
+ \if#2S\global#1{statute}\fi}
+% \end{macrocode}
+% 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
+% \verb+\newcitestyle+, above.
+% \changes{2.0h}{94/11/22}{Added a set of token registers (c through
+% j), used in the newcitebridges macro. Initial storage, with the
+% scope of the xdef contained in that macro, to token registers
+% prevents expansion. Corrects a bug that arose with the use of
+% makestatutetable etc with the newly reorganized storage scheme of
+% lexitex.sty.}
+% \begin{macrocode}
+\newtoks\@ltok@c%
+\newtoks\@ltok@d%
+\newtoks\@ltok@e%
+\newtoks\@ltok@f%
+\newtoks\@ltok@g%
+\newtoks\@ltok@h%
+\newtoks\@ltok@i%
+\newtoks\@ltok@j%
+\def\@newcitebridges#1[a]#2[t]#3[c]#4[p]#5(pl)#6[rp]#7[e]:[id]#8(pl)#9[xrf]{%
+\@ltok@c{#2}%
+\@ltok@d{#3}%
+\@ltok@e{#4}%
+\@ltok@f{#5}%
+\@ltok@g{#6}%
+\@ltok@h{#7}%
+\@ltok@i{#8}%
+\@ltok@j{#9}%
+ \expandafter\xdef\csname#1bridges\endcsname{%
+ \noexpand\global\noexpand\@ltok@atot\noexpand{\the\@ltok@c\noexpand}%
+ \noexpand\global\noexpand\@ltok@ttocone\noexpand{\the\@ltok@d\noexpand}%
+ \noexpand\global\noexpand\@ltok@conetop\noexpand{\the\@ltok@e\noexpand}%
+ \noexpand\global\noexpand\@ltok@conetopplural\noexpand{\the\@ltok@g\noexpand}%
+ \noexpand\global\noexpand\@ltok@ptop\noexpand{\the\@ltok@f\noexpand}%
+ \noexpand\global\noexpand\@ltok@ptoctwo\noexpand{\the\@ltok@h\noexpand}%
+ \noexpand\global\noexpand\@ltok@atbridge\noexpand{\the\@ltok@i\noexpand}%
+ \global\@ltok@atbridgeplural\noexpand{\the\@ltok@j\noexpand}}}%
+% \end{macrocode}
+% \subsubsection{Declaration of citation nicknames}
+% The following macros are called by the macros generated
+% by the \verb+\newcitestyle+ macro and its arguments.
+% Their effect is to create nickname macros which can then
+% be called by the user with the \verb+lexicite+ and
+% \verb+\lexicitefull+ commands, with the nickname as
+% a single argument in braces.
+% This macro is called by
+% \verb+\new+\meta{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 \verb+\newcitestyle+ in creating the particular
+% \verb+\new+\meta{citation type name} macro that is
+% doing the calling. The arguments are there, the user just
+% can't put anything into them.\\
+% The \verb+\@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
+% \verb+\@law@authortracing+ macro. Then this {\em name\/}
+% is defined as a macro, expanding to {\tt 1} or {\tt 2},
+% depending on whether it has been defined once already.
+% The macro may look something
+% like \verb+\Jayeff Huggins~Jr.+. Drastic, but effective.
+% Try doing that with a WordPerfect macro \ldots
+% \changes{2.0g}{94/08/12}{Added new if statement,
+% {\tt\protect\string\protect\if@law@specialbridges}, to indicate whether
+% a special bridge had been noticed before restash by
+% {\tt\protect\string\protect\@law@unstasheverything}.}
+% \begin{macrocode}
+\newif\if@law@specialbridges%
+\def\@newcite#1#2#3#4#5#6#7{%
+{\@ltok@a={#3}\@law@clean\@ltok@a\@law@temp
+\expandafter\ifx\csname\@law@temp\endcsname\relax%
+\expandafter\expandafter\expandafter\xdef\expandafter%
+ \csname\@law@temp\endcsname{1}%
+\else%
+ \expandafter\expandafter\expandafter\xdef\expandafter%
+ \csname\@law@temp\endcsname{2}%
+\fi}%
+% \end{macrocode}
+% The \verb+\@law@stasheverything+ macro creates the
+% list macro that can be used to retrieve all citation
+% details at a later point in the document. \verb+\@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 \verb+lexilist+ environment.\footnote{%
+% The previous release used a {\tt\string\@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:
+% \begin{itemize}
+% \item We don't need two macros; and
+% \item The stash routines can be included in {\tt\string\@newcite}
+% itself---information needn't be passed through macro arguments
+% at all, which helps speed things up.
+% \end{itemize}
+% 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 ``{\tt TeX capacity
+% exceeded}'' messages, and {\tt\string\tracingmacros=2} showed that every
+% cite was a stack containing the desired cite---and every preceding
+% citation as well!}
+% \changes{2.0g}{94/08/12}{Added conditional code for user
+% bridges to {\tt\protect\@newcite}.}
+% \begin{macrocode}
+\def\@law@templistmacro{}%
+\def\@law@tempplistmacro{}%
+ \xdef\@law@temp{\the\@ltok@useratbridgeplural}%
+ \ifx\@law@temp\empty%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \else%
+ \@law@addtoken\@ltok@userconetop\tocitelist%
+ \@law@addtoken\@ltok@userconetopplural\tocitelist%
+ \@law@addtoken\@ltok@userptop\tocitelist%
+ \@law@addtoken\@ltok@useratbridge\tocitelist%
+ \@law@addtoken\@ltok@useratbridgeplural\tocitelist%
+ \fi%
+\@law@addargument{#1}\tocitelist%
+\@law@addtoken\@ltok@bigsourcepage\tocitelist% (not yet implemented)
+\@law@addtoken\@ltok@bigsourcecite\tocitelist% (not yet implemented)
+\@law@addtoken\@ltok@hereinafter\tocitelist% (not yet implemented)
+% \end{macrocode}
+% Two fields are made nil during stash; they will be filled
+% when the macro is first unpacked.
+% \begin{macrocode}
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+\@law@addtoken\@ltok@citetype\tocitelist% cite type
+\@law@addargument{#7}\tocitelist% cite last part
+\@law@addargument{#6}\tocitelist% cite page
+\@law@addargument{#5}\tocitelist% cite first part
+\@law@addargument{#4}\tocitelist% name of work
+\@law@addargument{#3}\tocitelist% author
+\@law@addargument{#2}\tocitelist% nickname
+\def\@law@tempplistmacro{}%
+\@law@paracheckone{#2}}%
+% \end{macrocode}
+%
+% \changes{2.0i}{94/11/23}{Added and tested storage routines for an
+% arbitrary number of parallel citations. Complementary table
+% output and print routines still to come.}
+% \begin{macro}{\@law@paracheckone}
+% \begin{macro}{\@law@parachecktwo}
+% \begin{macro}{\@law@getpara}
+% The following three macros look ahead (after the initial
+% arguments to a cite declaration have been digested but {\em
+% before\/} the cite information has been stored to the list
+% macro) for a {\tt =} sign, which signals parallel citation
+% details. If a {\tt =} sign is found, a further check is made
+% for a {\tt [}, which signals a set of special bridges for the
+% upcoming parallel citation. Note the use of two {\tt =} signs
+% in braces as the first argument to {\tt\string\@ifnextchar}.
+% This is required because of the internal syntax of the
+% {\tt\string\@ifnextchar} macro.
+% \changes{2.0j}{94/12/06}{Cut the second {\tt =} from the {\tt
+% @law@paracheck} and {\tt @law@getpara} macros; it looks as though this was a
+% limitation that is overcome in \LaTeX{} 2.09 compatibility
+% mode; {\tt ==} was a necessary hack in \LaTeX{} 2.09 on my old
+% system, but was producing garbage {\tt =} signs before the
+% start of the document with NTT-J\LaTeX2e{} in 2.09
+% compatibility mode.}
+% \begin{macrocode}
+\def\@law@paracheckone#1{%
+ \def\@law@temp{{#1}}%
+ \@ifnextchar{=}
+ {\expandafter\expandafter\expandafter\@law@parachecktwo
+ \expandafter\@law@temp\@gobble}%
+ {\@@newcite{#1}}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@parachecktwo#1{\@ifnextchar[%
+ {\@law@getpara{#1}}%
+ {\@law@getpara{#1}[,,,,]}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% The following add a single set of parallel citation details
+% into a list macro used as a holding area for this purpose.
+% \begin{macrocode}
+\def\@law@getpara#1[#2,#3,#4,#5,#6]#7#8{%
+ \def\@law@temp{{#1}}%
+ \@law@addpargument{{#2}{#3}{#4}{#5}{#6}{#7}{#8}}\tolist%
+ \@ifnextchar{=}
+ {\expandafter\expandafter\expandafter
+ \@law@paracheckone\expandafter\@law@temp\@gobble}%
+ {\@@newcite{#1}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@@newcite#1{%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+\@ltok@a\expandafter{\@law@tempplistmacro}%
+\@law@addtoken\@ltok@a\tocitelist%
+\expandafter\global\expandafter\let\csname @ldata@#1\endcsname=\@law@templistmacro%
+\@ltok@userconetop{}%
+\@ltok@userconetopplural{}%
+\@ltok@userptop{}%
+\@ltok@useratbridge{}%
+\@ltok@useratbridgeplural{}%
+% \end{macrocode}
+% 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".
+% \begin{macrocode}
+\@law@makecitenick{#1}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \if@law@listinputting\def\@law@nick{}\else%
+ \def\@law@nick{\lexicitefull{#1}}\fi\@law@nick}%
+% \end{macrocode}
+% 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 \TeX book.\lexicite{knuth}+{378}{}
+% This and the other macros in this set do their work on
+% one list macro, \verb+\@law@templistmacro+, in order
+% to avoid the need for lots of \verb+\expandafter+s.
+% \begin{macrocode}
+\def\@law@addargument#1\tocitelist{%
+\@law@leftappendargument#1\to\@law@templistmacro}
+\long\def\@law@leftappendargument#1\to#2{\@ltok@a={\\{#1}}%
+ \@ltok@b=\expandafter{#2}%
+ \xdef#2{\the\@ltok@a\the\@ltok@b}}
+% \end{macrocode}
+% This macro adds the contents of one token register to
+% the temporary list macro.
+% \begin{macrocode}
+\def\@law@addtoken#1\tocitelist{\@law@leftappendtoken#1\to\@law@templistmacro}
+\long\def\@law@leftappendtoken#1\to#2{%
+ \xdef\@law@temp{\noexpand\\\noexpand{\the#1\noexpand}}%
+ \@ltok@a=\expandafter{\@law@temp}%
+ \@ltok@b=\expandafter{#2}%
+ \xdef#2{\the\@ltok@a\the\@ltok@b}}
+% \end{macrocode}
+% This macro cuts one token-register item \verb+#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.
+% \begin{macrocode}
+\def\@law@cut#1\fromcitelist{\@law@lop\@law@templistmacro\to#1}
+\def\@law@lop#1\to#2{\expandafter\@law@lopoff#1\@law@lopoff#1#2}%
+\long\def\@law@lopoff\\#1#2\@law@lopoff#3#4{\global#4={#1}\gdef#3{#2}}
+% \end{macrocode}
+%
+% \begin{macro}{\@law@addpargument}
+% \begin{macro}{\@law@addptoken}
+% \begin{macro}{\@law@pcut}
+% The following three macros are used to manipulate a list
+% macro containing parallel citation details.
+% \begin{macrocode}
+\def\@law@addpargument#1\tolist{%
+\@law@leftappendpargument#1\to\@law@tempplistmacro}
+\long\def\@law@leftappendpargument#1\to#2{\@ltok@a={\\{#1}}%
+ \@ltok@b=\expandafter{#2}%
+ \xdef#2{\the\@ltok@a\the\@ltok@b}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@addptoken#1\tolist{\@law@leftappendptoken#1\to\@law@tempplistmacro}
+\long\def\@law@leftappendptoken#1\to#2{%
+ \xdef\@law@temp{\noexpand\\\noexpand{\the#1\noexpand}}%
+ \@ltok@a=\expandafter{\@law@temp}%
+ \@ltok@b=\expandafter{#2}%
+ \xdef#2{\the\@ltok@a\the\@ltok@b}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@law@pcut#1\fromlist{\@law@lop\@law@tempplistmacro\to#1}
+\def\@law@lop#1\to#2{\expandafter\@law@lopoff#1\@law@lopoff#1#2}%
+\long\def\@law@lopoff\\#1#2\@law@lopoff#3#4{\global#4={#1}\gdef#3{#2}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% This macro turns off the gobbling feature (it may be
+% turned on during execution, if {\em 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 \verb+#1+, and puts it into token registers for
+% further processing. After it unpacks the list macro
+% \verb+\@ldata@+\meta{nickname}, it unpacks the formatting
+% details appropriate
+% to the style in which it was declared.
+% After the list is unpacked,
+% {\em 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 {\em 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.
+% \begin{macrocode}
+\def\@law@unstasheverything#1{%
+\def\@law@gobble{}%
+\global\@ltok@argtwo{}%
+\if@law@infoot%
+ \addtocounter{citesinfoot}{1}%
+\fi%
+\expandafter\let\expandafter\@law@templistmacro\csname @ldata@#1\endcsname%
+\@law@cut\@ltok@plistmacro\fromcitelist%
+\@law@cut\@ltok@nickname\fromcitelist%
+\@law@cut\@ltok@author\fromcitelist%
+\@law@cut\@ltok@name\fromcitelist%
+\@law@cut\@ltok@citefirst\fromcitelist%
+\@law@cut\@ltok@citepage\fromcitelist%
+\@law@cut\@ltok@citelast\fromcitelist%
+\@law@cut\@ltok@citetype\fromcitelist%
+\@law@cut\@ltok@whereitsat\fromcitelist%
+\@law@cut\@ltok@pageorfootno\fromcitelist%
+\@law@cut\@ltok@hereinafter\fromcitelist%
+\@law@cut\@ltok@bigsourcecite\fromcitelist%(not yet implemented)
+\@law@cut\@ltok@bigsourcepage\fromcitelist%(not yet implemented)
+\@law@cut\@ltok@stylename\fromcitelist%
+\csname \the\@ltok@stylename bridges\endcsname%
+\csname \the\@ltok@stylename faces\endcsname%
+% \end{macrocode}
+% 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.
+% \changes{2.0g}{94/08/12}{Added conditional bridges code
+% for cutting from the citation stack to
+% {\tt\protect\@law@unstasheverything}.}
+% \begin{macrocode}
+\@law@cut\@ltok@a\fromcitelist%
+ \xdef\@law@temp{\the\@ltok@a}%
+ \ifx\@law@temp\empty%
+ \else%
+ \@ltok@atbridgeplural\@ltok@a%
+ \@law@cut\@ltok@atbridge\fromcitelist%
+ \@law@cut\@ltok@ptop\fromcitelist%
+ \@law@cut\@ltok@conetopplural\fromcitelist%
+ \@law@cut\@ltok@conetop\fromcitelist%
+ \@law@specialbridgestrue
+ \fi%
+\edef\@law@temp{\the\@ltok@whereitsat}%
+\ifx\@law@temp\empty%
+ \global\@law@longcitetrue%
+% \end{macrocode}
+% \changes{2.0d}{27 July 1994}{Added a write to the {\tt aux}
+% file for initial uses of a citation. This is the first step toward the
+% \protect\BibTeX\ linkup. (later moved to {\tt\protect\string\protect\lexicite})}
+% \begin{macrocode}
+ \if@law@infoot%
+ \global\@ltok@whereitsat\@ltok@infoot%
+ \global\@ltok@pageorfootno=\expandafter{\the\c@law@footnote}%
+ \else%
+ \global\@ltok@whereitsat\@ltok@onpage%
+ \global\@ltok@pageorfootno=\expandafter{\the\c@page}%
+ \fi%
+% \end{macrocode}
+% \changes{2.0g}{94/08/12}{Added code for re-stashing special
+% bridges to {\tt\protect\string\protect\@law@unstasheverything}.}
+% \begin{macrocode}
+ \if@law@specialbridges%
+ \@law@addtoken\@ltok@conetop\tocitelist%
+ \@law@addtoken\@ltok@conetopplural\tocitelist%
+ \@law@addtoken\@ltok@ptop\tocitelist%
+ \@law@addtoken\@ltok@atbridge\tocitelist%
+ \@law@addtoken\@ltok@atbridgeplural\tocitelist%
+ \else%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \@law@addargument{}\tocitelist%
+ \fi%
+\@law@addtoken\@ltok@stylename\tocitelist% style name
+\@law@addtoken\@ltok@bigsourcepage\tocitelist%(not yet implemented)
+\@law@addtoken\@ltok@bigsourcecite\tocitelist%(not yet implemented)
+\@law@addtoken\@ltok@hereinafter\tocitelist% (not yet implemented)
+\@law@addtoken\@ltok@pageorfootno\tocitelist% (1)(b) stash the footnote bridge
+\@law@addtoken\@ltok@whereitsat\tocitelist% (2)(b) footnote number
+\@law@addtoken\@ltok@citetype\tocitelist% cite type
+\@law@addtoken\@ltok@citelast\tocitelist% cite last part
+\@law@addtoken\@ltok@citepage\tocitelist% cite page
+\@law@addtoken\@ltok@citefirst\tocitelist% cite first part
+\@law@addtoken\@ltok@name\tocitelist% name of work
+\@law@addtoken\@ltok@author\tocitelist% author
+\@law@addtoken\@ltok@nickname\tocitelist% nickname
+\@law@addtoken\@ltok@plistmacro\tocitelist%
+\global\expandafter\let\csname @ldata@#1\endcsname\@law@templistmacro%
+\fi%
+}
+% \end{macrocode}
+% \subsubsection{Calling citation nicknames}
+% The nickname macro defined by this routine
+% (\verb+\@lnick@+\meta{nickname}), is immensely
+% more compact than in the
+% first release. \verb+\@law@argscheck+ eventually
+% leads to \verb+\@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.
+% \begin{macrocode}
+\def\@law@makecitenick#1{%
+ \expandafter\xdef\csname @lnick@#1\endcsname{%
+ \noexpand\@law@unstasheverything\noexpand{#1\noexpand}%
+ \noexpand\@law@argscheck}}
+% \end{macrocode}
+% \begin{macro}{\@law@argscheck}
+% This is a chain of macros that look forward for the
+% markers {\tt *}, {\tt +}, {\tt -}, {\tt ++} and {\tt -+},
+% gobbling the markers and setting toggles along the way.
+% The toggles control whether the cite will print,
+% and whether \LexiTeX\ will assume there is a single or a
+% multiple page/section reference (or none at all, if
+% no flag is seen).
+% \begin{macrocode}
+\long\def\@law@argscheck{%
+ \@ifnextchar+{\@law@printcitetrue\expandafter\@law@argscheckplusplus\@gobble}%
+ {\@law@multipagesfalse\@law@argschecktwo}}
+%
+\long\def\@law@argscheckplusplus{%
+ \@ifnextchar+{\@law@multipagestrue\expandafter\@law@getargs\@gobble}%
+ {\@law@argscheckplusminus}}
+%
+\long\def\@law@argscheckplusminus{%
+ \@ifnextchar-{\@law@multipagestrue\expandafter\@law@getargs\@gobble}%
+ {\@law@multipagesfalse\@law@getargs}}
+%
+\long\def\@law@argschecktwo{%
+ \@ifnextchar-{\@law@printcitefalse\expandafter\@law@getargs\@gobble}%
+ {\@law@argscheckthree}}
+%
+\long\def\@law@argscheckthree{%
+ \@ifnextchar*{\@law@printcitefalse\expandafter\@law@setup\@gobble}%
+ {\global\@law@printcitetrue\@law@setup}}
+% \end{macrocode}
+% These macros are part of the above chain; they are called
+% if a flag is found and \LexiTeX\ has finished its search for
+% more. \verb+\@law@barnil+ redefines the shorthanding
+% characters so that matter will be suppressed or interatively
+% written to the output files as appropriate.
+% \begin{macrocode}
+\def\@law@getargs{\begingroup\@law@barnil\@law@@getargs}
+%
+\def\@law@@getargs#1{\global\@ltok@argtwo{#1}%
+\endgroup\@law@setup}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@law@newcitefirst}
+% The following code will be used to kick off the existing "\@newcite"
+% routine when hereinafter-style references come to be supported.
+% \begin{macrocode}
+%<*hereinafters>
+\def\@law@newcitefirst{\@ifnextchar[]{\catcode`\[=??
+\catcode`\]=??
+\expandafter\@law@newcitesecond\@law@grabhereinafter}
+{\@law@newcite}}
+\def\@law@grabhereinafter#1{\@ltok@hereinafter={#1}
+\catcode`\[=??
+\catcode`\]=??}
+%</hereinafters>
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Table writes and preliminary formatting}
+% Once the printing information has been stashed, the
+% \verb+\@lnick@+\meta{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 \verb+\@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 set of macros supports the operation of \verb+\@law@setup+
+% by redefining one control character and several command
+% strings in such a way that they will write a complete
+% entry to the output file for the citation for each pinpointing
+% reference that follows them. This relevant only for
+% statute citations, which are organized as two-level
+% indexes, with the statute section cited at the second level.
+% The special function of the vertical bar character
+% is to write an entry to the table in this way, without
+% writing anything in the document. This may be necessary
+% where a range of sections is cited; \LexiTeX\ has no way
+% of knowing whether the intervening sections are
+% continuous, so references to them cannot be done automatically.
+% \begin{macrocode}
+ \def\setcherpage#1{\@ltok@argtwo{#1}\write@one@statute@entry}%
+ \def\MiekosPatience{\def\,{\setcherpage}\def\&{\setcherpage}%
+ \def\dash{\setcherpage}\def|##1|{\setcherpage{##1}}%
+ \expandafter\setcherpage\the\@ltok@pagesstring}%
+% \end{macrocode}
+% 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 {\tt lexicite.tex} file. Grouping braces enclosing
+% all operations within \verb+\@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 (\verb+\@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 \verb+\@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.
+% \begin{macrocode}
+\long\def\@law@setup{%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+{\def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+% \end{macrocode}
+% This carries out the necessary checks on the context of the
+% current citation.
+% \begin{macrocode}
+\@law@justabovecheck%
+% \end{macrocode}
+% Now that the \verb+\@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
+% \begin{macrocode}
+\if@law@infoot%
+ \xdef\@law@currentcite{\the\@ltok@author\the\@ltok@name\the\@ltok@citefirst%
+ \the\@ltok@citepage\the\@ltok@citelast}%
+ \xdef\@law@lastpage{\the\@ltok@argtwo}%
+\fi%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@author}%
+ \ifx\@law@temp\empty%
+ \xdef\@law@temptwo{\the\@ltok@citefirst}%
+ \ifx\@law@temptwo\empty%
+ \global\@ltok@ttocone{}%
+ \fi%
+ \global\@ltok@atot{}%
+ \fi%
+ \xdef\@law@temp{\the\@ltok@citelast}%
+ \ifx\@law@temp\empty%
+ \global\@ltok@ptoctwo{}%
+ \fi%
+ \def\@law@temptwo{()}%
+ \ifx\@law@temp\@law@temptwo%
+ \global\@ltok@ptoctwo{}%
+ \global\@ltok@citelast{}%
+ \fi%
+ \xdef\@law@temp{\the\@ltok@citepage}%
+ \ifx\@law@temp\empty%
+ \global\@ltok@ptop{}%
+ \fi%
+ \xdef\@law@temp{\the\@ltok@argtwo}%
+ \ifx\@law@temp\empty%
+ \global\@ltok@ptop{}%
+ \xdef\@law@temptwo{\the\@ltok@citepage}%
+ \ifx\@law@temptwo\empty%
+ \global\@ltok@conetop{}%
+ \fi%
+ \fi%
+% \end{macrocode}
+% 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.
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@citetype}%
+ \ifx\@law@temp\@law@case%
+ \if@writecasetable\write@one@case@entry%
+ \fi%
+ \fi%
+ \ifx\@law@temp\@law@statute%
+ \if@writestatutetable%
+ \if@law@multipages%
+ {\@ltok@pagesstring\@ltok@argtwo%
+ \MiekosPatience}%
+ \else%
+ \write@one@statute@entry%
+ \fi%
+ \fi%
+ \fi%
+ \ifx\@law@temp\@law@article%
+ \if@writearticletable\write@one@article@entry%
+ \fi%
+ \fi%
+ \ifx\@law@temp\@law@book%
+ \if@writebooktable\write@one@book@entry%
+ \fi%
+ \fi%
+% \end{macrocode}
+% And here the \verb+\@law@setup+ routine comes to an end;
+% punt to the print routine, possibly followed by a gobble,
+% if {\em Id.} is printed. If footnote ``forcing''
+% is in effect, the printed text is placed in the argument
+% to a vanilla footnote command.
+% \begin{macrocode}
+\if@law@forcing{\@law@foothold%
+ {\@law@print}\global\@law@infootfalse}%
+\else\@law@print\fi}\@law@gobble}
+% \end{macrocode}
+% \subsection{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.
+% \subsubsection{The print macro}
+% This section contains the code for the print routine and
+% its supporting macros. We begin with the supporting stuff.
+% \begin{macro}{\@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 \verb+\if+ statements,
+% each of which sets a toggle or toggles appropriately.
+% In the end, this macro tells us:
+% \begin{itemize}
+% \item Whether the immediately-preceding citation is to
+% the same work; and if it is
+% \item Whether the preceding cite had no pinpoint
+% page reference; and if it had one
+% \item Whether the pages referred to by the two cites
+% are exactly identical.
+% \end{itemize}
+% Try {\em that\/} with
+% WordPerfect!
+% If \LexiTeX\ isn't getting the decisions right, let me know.
+% \begin{macrocode}
+\def\@law@justabovecheck{%
+ \xdef\@law@temptwo{\the\@ltok@author\the\@ltok@name%
+ \the\@ltok@citefirst\the\@ltok@citepage%
+ \the\@ltok@citelast}%
+ \ifx\@law@lastcite\@law@temptwo%
+ \ifnum\the\c@citesinfoot=1\relax%
+ \@law@justabovecheckdetails%
+ \else%
+ \ifx\@law@currentcite\@law@temptwo%
+ \@law@justabovecheckdetails%
+ \else%
+ \@justabovefalse%
+ \fi%
+ \fi%
+ \else%
+ \ifnum\the\c@citesinfoot>1\relax%
+ \ifx\@law@currentcite\@law@temptwo%
+ \@law@justabovecheckdetails%
+ \else%
+ \@justabovefalse%
+ \fi%
+ \fi%
+ \fi}
+\def\@law@justabovecheckdetails{%
+ \ifx\@law@lastpage\empty%
+ \@justabovetrue%
+ \@l@quiteexactfalse%
+ \else%
+ \xdef\@law@temp{\the\@ltok@argtwo}%
+ \ifx\@law@temp\empty%
+ \@justabovefalse%
+ \else%
+ \@justabovetrue%
+ \ifx\@law@temp\@law@lastpage%
+ \@l@quiteexacttrue%
+ \else%
+ \@l@quiteexactfalse%
+ \fi%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% There is just one macro that does the printing, and it
+% is a big one---the rest of this heading is dedicated
+% to this single macro.
+% \begin{macrocode}
+\def\@law@print{%
+% \end{macrocode}
+% This toggles the printing on and off. We can't catch
+% it earlier, because the long citation form toggle can't
+% be touched until after printing.
+% \begin{macrocode}
+\if@law@printcite%
+ \begingroup
+ \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+% \end{macrocode}
+% There are two halves to the macro; one for long cite forms,
+% the other for short. Long cite forms are in the first
+% half.
+% \begin{macrocode}
+\if@law@longcite%
+% \end{macrocode}
+% Long citations are pretty straightforward; we've gathered all
+% the information we needed; now we just need to plunk it
+% all down in order, pretty much. The one exception is the
+% page bridges. If the location page exists, we leave the
+% singular bridge alone. If no location page exists, {\em and\/}
+% the pinpoint reference is plural, then we install a plural
+% bridge.
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@citepage}%
+ \ifx\@law@temp\empty%
+ \if@law@multipages%
+ \global\@ltok@conetop\@ltok@conetopplural%
+ \fi%
+ \fi%
+% \end{macrocode}
+% First to print is the author field (the second argument to the
+% citation declaration command), followed by the
+% author-to-title punctuation bridge. The enclosing
+% braces limit the scope of the special active character
+% definitions of "^", "_" and "|".
+% \begin{macrocode}
+ \global\ltokspecialface=\@ltok@authoroptionface%
+ {\the\@ltok@authormainface%
+ \@law@barinfull\the\@ltok@author}\the\@ltok@atot%
+% \end{macrocode}
+% Next comes similar treatment for the title.
+% \begin{macrocode}
+ \global\ltokspecialface=\@ltok@titleoptionface%
+ {\the\@ltok@titlemainface%
+ \@law@barinfull\the\@ltok@name}\the\@ltok@ttocone%
+% \end{macrocode}
+% And for the first citation part. Ho-hum \ldots
+% \begin{macrocode}
+ \global\ltokspecialface=\@ltok@citefirstoptionface%
+ {\the\@ltok@citefirstmainface%
+ \@law@barinfull\the\@ltok@citefirst}\the\@ltok@conetop%
+% \end{macrocode}
+% Next comes the location page and its following
+% bridge. Both of these may be blank. No funny
+% business with the shorthand active characters is
+% required, since we assume this will not contain
+% any special text for which they will be required.
+% \begin{macrocode}
+ \the\@ltok@citepage\the\@ltok@ptop%
+% \end{macrocode}
+% A special use of "\," is defined before we expand
+% the optional argument stuff.
+% \begin{macrocode}
+{\def\,{,}\@law@barkill\the\@ltok@argtwo}%
+\the\@ltok@ptoctwo%
+% \end{macrocode}
+% And finally, we print the final portion of the citation.
+% \begin{macrocode}
+{\@law@barinfull\the\@ltok@citelast}%
+% \end{macrocode}
+% This else marks the boundary between long-form citations
+% (which we have seen are relatively simple to print)
+% and short-form citations (which are rather complex).
+% This "\else" matches the "\if@law@longcite" conditional.
+% \begin{macrocode}
+\else%
+% \end{macrocode}
+% The footnote number and the accompanying bridge
+% should not appear in a short-form citation if
+% the citation being printed first occurred in the
+% current footnote. Rather than suppressing printing,
+% we just set the relevant tokens to nil.
+% \begin{macrocode}
+ \ifnum\the\@ltok@pageorfootno=\the\c@law@footnote\relax%
+ \if\@ltok@whereitsat\@ltok@infoot%
+ \global\@ltok@whereitsat{}%
+ \global\@ltok@pageorfootno{}%
+ \fi%
+ \fi%
+% \end{macrocode}
+% If \LexiTeX\ found a \verb!++! or a \verb!+-! marker
+% linking a pinpointing argument, the bridges preceding
+% the page references must be set to their plural form.
+% This change applies to both long and short form citations.
+% \begin{macrocode}
+ \if@law@multipages%
+ \@ltok@conetop\@ltok@conetopplural%
+ \@ltok@atbridge\@ltok@atbridgeplural%
+ \fi%
+% \end{macrocode}
+% If for some reason either the pinpoint argument is nil,
+% or it {\em and\/} the location page token register is nil,
+% we set the accompanying bridges to nil.
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@argtwo}%
+ \ifx\@law@temp\empty%
+ \global\@ltok@ptop{}%
+ \global\@ltok@atbridge{}%
+ \xdef\@law@temptwo{\the\@ltok@citepage}%
+ \ifx\@law@temptwo\empty%
+\global\@ltok@conetop{}%
+ \fi%
+ \fi%
+% \end{macrocode}
+% Special forms of tidying-up may be appropriate to
+% each of the four classes of citation. An appropriate
+% cleaning macro is called here.
+% \begin{macrocode}
+\csname @law@\the\@ltok@citetype preformat\endcsname%
+% \end{macrocode}
+% If it has been found that the same citation has been
+% used immediately previous to this instance,
+% we use {\em Id.} If the "\@justabove" test showed
+% that {\em Id.} by itself is appropriate, we prepare
+% to eat any period immediately following the citation
+% macro. Otherwise, we tack on the pinpoint reference
+% and its accompanying bridge. A fail-safe conditional
+% reverts to the original plan if the pinpoint reference
+% is empty.
+% \begin{macrocode}
+ \if@justabove%
+ {\def\,{,}%
+ \Id%
+ \if@l@quiteexact%
+ \gdef\@law@gobble{\@ifnextchar.{\@gobble}{}}%
+ \else%
+ \the\@ltok@atbridge{\@law@barkill\the\@ltok@argtwo}%
+ \xdef\@law@temptwo{\the\@ltok@argtwo}%
+ \ifx\@law@temptwo\empty%
+ \gdef\@law@gobble{\@ifnextchar.{\@gobble}{}}%
+ \fi%
+ \fi}%
+% \end{macrocode}
+% If {\em Id.} was not called for, we have to create
+% a proper short-form reference. This "\else" corresponds
+% with the "\@justabove" toggle, above.
+% \begin{macrocode}
+ \else%
+% \end{macrocode}
+% The author will be used in any case. Note that the author
+% and its following bridge may have been set to nil, above.
+% \begin{macrocode}
+ \global\ltokspecialface=\@ltok@authoroptionface%
+ {\the\@ltok@authormainface%
+% print whatever there if for the author
+ \@law@barinshort\the\@ltok@author}\the\@ltok@atot%
+% \end{macrocode}
+% The title information is also used, if it is present.
+% \begin{macrocode}
+ \global\ltokspecialface=\@ltok@titleoptionface%
+ {\the\@ltok@titlemainface%
+% \end{macrocode}
+% If we have specified a nickname for this cite for
+% `hereinafter' references, we use it instead of the
+% title of the work.
+%<*parabeta>
+[DWEEZLE: a test and a token register replacement goes here.]
+%</parabeta>
+% \begin{macrocode}
+ \@law@barinshort\the\@ltok@name}%
+% \end{macrocode}
+% At this point, we must make decisions concerning whether
+% to use the {\em supra\/} cross-referencing form. This
+% depends on the type of citation we are working on.
+% The "\@nosupra" condition is set to true if we are working
+% on a case or a statute, otherwise it is set to false.
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@citetype}%
+ \ifx\@law@temp\@law@case%
+ \@nosupratrue%
+ \else%
+ \ifx\@law@temp\@law@statute%
+ \@nosupratrue%
+ \else%
+ \@nosuprafalse%
+ \fi%
+ \fi%
+% \end{macrocode}
+% Now we put the result of the above test to work.
+% First, the citation form for cases or statutes, which
+% do not permit the {\em supra\/} form.
+% \begin{macrocode}
+ \if@nosupra%
+% \end{macrocode}
+% We will always use the first part of the citation
+% (usually the source of the work).
+% \begin{macrocode}
+ \the\@ltok@ttocone%
+ \global\ltokspecialface=\@ltok@citefirstoptionface%
+ {\the\@ltok@citefirstmainface%
+ \@law@barinshort\the\@ltok@citefirst}%
+% \end{macrocode}
+% If the pinpoint reference is empty, we tack on the
+% location page after the appropriate bridge. Otherwise,
+% we do nothing for the present; any pinpoint reference
+% will be produced later on.
+% Note that the bridge
+% used here will only be in plural form if something was
+% given for use as a pinpoint reference.
+% \begin{macrocode}
+ \the\@ltok@conetop%
+ \xdef\@law@temp{\the\@ltok@argtwo}%
+ \ifx\@law@temp\empty%
+ \the\@ltok@citepage%
+ \fi%
+% \end{macrocode}
+% Now we deal with resources other than cases and statutes.
+% This needs just the {\em supra\/} bridge, plus the
+% footnote or page number information pointing to the earlier
+% citation.
+% \begin{macrocode}
+ \else%
+ \supra\the\@ltok@whereitsat\the\@ltok@pageorfootno%
+ \the\@ltok@atbridge%
+ \fi%
+% \end{macrocode}
+% The pinpoint reference, if present, is used for all
+% forms of citation.
+% \begin{macrocode}
+ {\def\,{,}%
+ {\@law@barkill\the\@ltok@argtwo}}%
+% \end{macrocode}
+% The following routine prints the second citation part
+% if the citation is to a statute, and the first citation
+% part was empty. I can't think of a situation where this
+% is necessary, offhand, but it was included in the original
+% coding, so I must have had a stylistic reason for putting
+% it there \ldots
+% \begin{macrocode}
+ \xdef\@law@temp{\the\@ltok@citetype}%
+ \ifx\@law@temp\@law@statute%
+ \xdef\@law@temptwo{\the\@ltok@citefirst}%
+ \ifx\@law@temp\empty%
+ \the\@ltok@ptoctwo{\@law@barinshort\the\@ltok@citelast}%
+ \fi%
+ \fi%
+% \end{macrocode}
+% In order, these close "\if@justabove", "\if@law@longcite"
+% and "\if@law@printcite".
+% \begin{macrocode}
+ \fi%
+ \fi%
+\endgroup%
+\fi% <- end of if@law@printcite
+% \end{macrocode}
+% The "\@law@gobble" here will consume a period inserted
+% automatically after a forced footnote, if the printed
+% form turned out to be an {\em Id.}. See the concluding
+% code of "\@law@setup".
+% \changes{2.0c}{26 July 1994}{Moved {\tt\protect\string%
+% \protect\@law@forcingfalse} outside of a conditional
+% expression at the end of the print routine, to correct
+% the failure of the forcing mechanism to work more than once.}
+% \begin{macrocode}
+\global\@law@longcitefalse\global\def\volno{}%
+\if@law@forcing.\gdef\@law@gobble{\@ifnextchar.{\@gobble}{}}%
+\fi\global\@law@forcingfalse%
+\@law@gobble}%
+% \end{macrocode}
+% \paragraph{Print format subroutines}
+% \begin{macro}{\@law@casepreformat}
+% This is empty; no special preparations are necessary
+% for the printing of a case citation.
+% \begin{macrocode}
+\def\@law@casepreformat{}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@law@statutepreformat}
+% If short statutory references are in force,
+% the title and the following bridge are set to nil,
+% if some reference is provided in the first citation
+% part.
+% \begin{macrocode}
+\def\@law@statutepreformat{%
+\if@law@statuteverbose%
+\else%
+ \xdef\@law@temp{\the\@ltok@citefirst}%
+ \ifx\@law@temp\empty%
+ \else%
+ \global\@ltok@name{}%
+ \global\@ltok@ttocone{}%
+ \fi%
+\fi%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@law@articlepreformat}
+% If a work by the identical author has been cited more than once, we leave
+% everything intact (the print routine does the necessary culling);
+% otherwise, we cut the title here. The use of "\@law@authortracing"
+% is explained above.
+% \begin{macrocode}
+\def\@law@articlepreformat{%
+\xdef\@law@temp{\the\@ltok@author}%
+\ifx\@law@temp\empty%
+\else%
+{\@law@clean\@ltok@author\@law@authortracing%
+\expandafter\expandafter\expandafter\if\expandafter%
+\csname\@law@authortracing\endcsname2%
+ \else%
+ \global\@ltok@atot{}\global\@ltok@name{}%
+\fi}\fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@law@bookpreformat}
+% This provides the same treatment given to articles.
+% \begin{macrocode}
+\def\@law@bookpreformat{%
+\xdef\@law@temp{\the\@ltok@author}%
+\ifx\@law@temp\empty%
+\else%
+{\@law@clean\@ltok@author\@law@authortracing%
+\expandafter\expandafter\expandafter\if\expandafter%
+\csname\@law@authortracing\endcsname2%
+ \else%
+ \global\@ltok@atot{}\global\@ltok@name{}%
+ \fi}\fi}%
+% \end{macrocode}
+% \end{macro}
+% \subsection{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.
+% \changes{2.0b}{22/vii/94}{Complete re-write of the parsing
+% routines for proof pages, to eliminate much unnecessary
+% complexity.}
+%
+% \begin{macrocode}
+\def\lexihashcheck#1#2{\def\@law@temp{#2}\ifx\@law@temp\empty%
+ #1={}\fi}
+\def\scancitestyle#1#2#3#4#5#6#7{%
+ \begingroup
+ \lexihashcheck\@ltok@proofcitelast{#7}
+ \lexihashcheck\@ltok@proofpage{#6}
+ \lexihashcheck\@ltok@proofciteone{#5}
+ \lexihashcheck\@ltok@prooftitle{#4}
+ \lexihashcheck\@ltok@proofauthor{#3}
+ \expandafter\xdef\csname @law@#1proofdata\endcsname{%
+ \noexpand{proofcite\noexpand}%
+ \the\@ltok@proofauthor
+ \the\@ltok@prooftitle
+ \the\@ltok@proofciteone
+ \the\@ltok@proofpage
+ \the\@ltok@proofcitelast}
+ \expandafter\xdef\csname @law@#1otherproofdata\endcsname{%
+ \noexpand{othercite\noexpand}%
+ \the\@ltok@proofauthor
+ \the\@ltok@prooftitle
+ \the\@ltok@proofciteone
+ \the\@ltok@proofpage
+ \the\@ltok@proofcitelast}
+ \endgroup}
+\def\lexiproofs{\begingroup\def\newcitestyle##1##2##3##4##5{%
+ \scancitestyle{##1}##5}\catcode`\#=12%
+ \input lexicite.tex\endgroup}
+\def\proofpagefor#1{\centerline{\Large \LexiTeX\ Proof Page}
+\medskip
+\centerline{\large for}
+\medskip
+\centerline{\Large\tt\string\new#1}
+\bigskip
+ \def\citestyledeclaration{\csname new#1\endcsname}
+ \expandafter\let\expandafter\proofciteargs
+ \csname @law@#1proofdata\endcsname
+ \expandafter\let\expandafter\otherciteargs
+ \csname @law@#1otherproofdata\endcsname
+\c@footnote=0
+\thispagestyle{empty}
+The footnotes to this text give many of the permutations
+of the \LexiTeX\ citation style named {\tt\string\new#1}.
+Unfortunately, I cannot guarantee that it covers them all.
+This page is produced by the command sequence
+{\tt\string\proofpagefor\string{<blah>\string}},
+where {\tt <blah>} is the name of a citation style (without
+a leading {\tt\string\new}). Used to proofread citation styles
+before they are put to use in typesetting your documents,
+it can help you avoid unexpected results.\\
+\begin{enumerate}
+\item We begin with a full-form citation in the {\tt #1} style,
+with no pinpoint page reference appended.\footnote{%
+\expandafter\citestyledeclaration\proofciteargs.}
+\item Next, we have the full form of the citation, {\em with\/}
+a pinpoint page reference.\footnote{\lexicitefull{proofcite}+{7890}.}
+\item Finishing with full-form references, we then have a full
+citation with a plural pinpoint reference. In this instance
+we use {\tt\string\dash} between the plural
+elements.\footnote{\lexicitefull{proofcite}++{{78}\dash{90}}.}
+\item In the next instance, we have several short-form references to the
+same work. No pinpoint references are given in this series of
+examples.\footnote{\lexicite{proofcite}.
+\lexicite{proofcite}. \lexicite{proofcite}.}
+\item We do the same again, but this time
+the three references have singular
+pinpoint references, each of which is different. As above, the second
+will be in {\em Id.} form, following Blue Book
+convention.\footnote{\lexicite{proofcite}+{67}.
+\lexicite{proofcite}+{78}. \lexicite{proofcite}+{89}.}
+\item Then we do the same again, but with plural pinpoint
+references. This time, we link the page references with
+{\tt\string\&}.\footnote{\lexicite{proofcite}++{{67} \& {89}}.
+\lexicite{proofcite}+{{78} \& {90}}. \lexicite{proofcite}+{{67}
+\& {89}}.}
+\item Now we insert cite to a work by the same
+author.\footnote{\expandafter\citestyledeclaration\otherciteargs.}
+\item A cite to the same work as that in the previous footnote
+is given here. It should reduce to {\em Id.}\footnote{\lexicite{othercite}.}
+\item Styles of articles and books will give differing results
+when two works by the same author exist. We therefore repeat
+the citations of item 4, above.\footnote{\lexicite{proofcite}.
+\lexicite{proofcite}. \lexicite{proofcite}.}
+\item Then we repeat the references from 5, above.\footnote{\lexicite{proofcite}+{67}.
+\lexicite{proofcite}+{78}. \lexicite{proofcite}+{89}.}
+\item And from item 6, above.\footnote{\lexicite{proofcite}++{{67} \& {89}}.
+\lexicite{proofcite}+{{78} \& {90}}. \lexicite{proofcite}+{{67}
+\& {89}}.}
+\end{enumerate}
+\newpage}
+% \end{macrocode}
+% Finally, we input the user-editable supporting files.
+% \begin{macrocode}
+\input lexicite.tex
+\input lexitabl.tex
+%</lexitex>
+% \end{macrocode}
+% \subsubsection{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.
+% \begin{macrocode}
+%<*proofsheets>
+\documentclass{article}
+\usepackage{lexitex}[1994/12/07]
+\begin{document}
+\lexiproofs
+\def\newcitestyle#1#2#3#4#5{\proofpagefor{#1}}
+\input lexicite.tex
+\end{document}
+%</proofsheets>
+% \end{macrocode}
+%
+% \subsection{Macros for data export}
+%
+% It may be possible to merge at least three of these
+% export routines together. The current configuration
+% works, however, so that task will have to wait for
+% another day. These macros are based on \LaTeX\ indexing
+% routines---to such an extent that I don't fully understand
+% myself exactly what some of the code actually does.
+% Works though, and many thanks to Leslie Lamport.
+%
+% \paragraph{Cases} The items under each of these sections
+% are the same, although the content of the macros varies slightly.
+% We first address cases.
+%
+% \begin{macro}{\thecasetable}
+% This sets up the page for a case table---places the section
+% header and the running header, and defines the appropriate
+% macro to use for "\item".
+% \begin{macrocode}
+%<*lexitabl>
+\ProvidesFile{lexitabl.tex}[1994/12/07]
+\def\thecasetable{\section*{\casetablename}%
+ \@mkboth{\uppercase{\casetablename}}{\uppercase{\casetablename}}%
+ \thispagestyle{plain}\parindent\z@%
+ \parskip\z@ plus.3\p@\relax\let\item\@ctbitem}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endthecasetable}
+% This was just borrowed. It restores the text to one-column
+% mode if the case table started that way---probably either
+% redundant or incorrect, since the two-column code has been
+% cut from the original \LaTeX\ model in the "\thecasetable" macro.
+% \begin{macrocode}
+\def\endthecasetable{%
+ \if@restonecol\onecolumn%
+ \else\clearpage%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\casetablespace}
+% This sets up the correct vertical spacing inside the case table.
+% Season to taste.
+% \begin{macrocode}
+\def\casetablespace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\printcasetable}
+% This simply jumps down the page an appropriate amount,
+% defines a double-backslash appropriately, and imports the
+% sorted data file of case citations and page numbers.
+% I wonder, however, whether this can be correctly set up;
+% using this strategy, the special typeface will simply be
+% that which happens to be defined when the table is printed;
+% we haven't yet pulled the {\em cases\/} off the shelf.
+% Further, I believe that the double-backslashes that are
+% exported to the raw data file end up half-expanded there;
+% no double-backslashes should be left when the file is
+% re-input here. If there {\em is\/} a problem here, it is
+% not surprising that it hasn't cropped up in documents
+% yet, since "\\" is most often used to restore to roman
+% from a funny typeface. If trouble {\em does\/} emerge,
+% it will be dead easy to fix.
+% \begin{macrocode}
+\def\printcasetable{%
+{ \raggedright%
+ \def\@ctbitem##1{\par\smallskip\rule{8pt}{0cm}}%
+ \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+ \@input{\jobname.cas}}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\makecasetable}
+% Tricky, or at least sensitive, operations happen here.
+% This defines the declaration that is put in the preamble
+% to trigger the creation of a raw data table for cases.
+% It performs two functions: opening the output file,
+% and defining the macro that is used to write and entry
+% on the file.
+% \begin{macrocode}
+\def\makecasetable{%
+% \end{macrocode}
+% We open the output file immediately. The "\if@filesw"
+% condition brackets the entire macro; I don't know what
+% it's for.
+% \begin{macrocode}
+ \if@filesw \newwrite\@casetablefile%
+ \immediate\openout\@casetablefile=\jobname.ctb%
+% \end{macrocode}
+% Then the write macro is defined. "\@bsphack" is a mystery
+% to me, and so is "\@sanitize". The definition of
+% "\protect" here just makes a string of anything preceded
+% by "\protect"; character codes don't matter, since this
+% exported data will be re-read afresh later.
+% \begin{macrocode}
+ \def\write@one@case@entry{\@bsphack\begingroup%
+ \def\protect####1{\string####1\space}\@sanitize%
+% \end{macrocode}
+% "\thepage" is set to nil now; it is redefined (I think)
+% during the actual file write, so that it accords with the
+% actual page on which the entry is printed.
+% \begin{macrocode}
+ \let\thepage\relax%
+% \end{macrocode}
+% The "\@law@cleanup" macro here effectively "\protect"s
+% things that could expand into unprintable commands during
+% export.
+% \begin{macrocode}
+ \@law@cleanup%
+% \end{macrocode}
+% This is straight \LaTeX\ strategy still. I'm not sure why
+% I'm not quite sure why "\@tempa" is "\edef"ed and then
+% expanded outside the group. It may simply be that this
+% assures that "\@tempa" does not consume memory unnecessarily.
+% Alternatively, it may assure that the conditions inside the
+% group govern one level of expansion, and those outside the
+% group govern another. If anyone can clarify this,
+% I would appreciate it.
+%
+% The literal write of "\casetableentry" is the macro that
+% will formats and prints an entry in the finished table.
+% \begin{macrocode}
+ \edef\@tempa{\write\@casetablefile{\string\casetableentry%
+% \end{macrocode}
+% Here, it's just a matter of putting down the citation details.
+% The "\@ltok@nickname" register has its own set of brackets;
+% "\casetableentry" will see it as its first argument, and
+% it will throw it away. It is used only to establish the
+% order of the sort for "makeindex".
+% \begin{macrocode}
+ {{\the\@ltok@nickname}%
+ {{\@law@titlemainfacetemp%
+ \ltokspecialface=\noexpand{\@law@titleoptionfacetemp\noexpand}%
+ \@law@nametemp}%
+ \the\@ltok@ttocone%
+ {\@law@citefirstmainfacetemp%
+ \ltokspecialface=\noexpand{\@law@citefirstoptionfacetemp\noexpand}%
+ \@law@citefirsttemp}%
+ \@law@conetoptemp%
+ \@law@citepagetemp%
+ \the\@ltok@ptoctwo\@law@citelasttemp}}{\thepage}}}%
+ \expandafter\endgroup\@tempa%
+% \end{macrocode}
+% I haven't a clue what the concluding code to this internally defined
+% portion of the macro is for. Sorry.
+% \begin{macrocode}
+ \if@nobreak%
+ \ifvmode%
+ \nobreak%
+ \fi%
+ \fi%
+ \@esphack}%
+% \end{macrocode}
+% We finish by telling the rest of the style to pay attention
+% to case table options, and by reminding the user of what
+% is going on with his file.
+% \begin{macrocode}
+ \@writecasetabletrue
+ \typeout{Writing case table file \jobname.ctb;}\fi}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Statutes} Herein the stuff for exporting
+% statute data.
+%
+% \begin{macro}{\thestatutetable}
+% This corresponds to "\thecasetable", above. It's the same
+% darn thing, except that it turns on columns.
+% \begin{macrocode}
+\def\thestatutetable{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi%
+\twocolumn\section*{\statutetablename}%
+ \@mkboth{\uppercase{\statutetablename}}%
+{\uppercase{\statutetablename}}%
+ \thispagestyle{plain}\parindent\z@%
+ \parskip\z@ plus.3\p@\relax\let\item\@stbitem}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endthestatutetable}
+% This corresponds to "\endthecasetable", above.
+% \begin{macrocode}
+\def\endthestatutetable{%
+ \if@restonecol\onecolumn%
+ \else\clearpage%
+ \fi}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\statutetablespace}
+% \begin{macrocode}
+\def\statutetablespace{\par \vskip 10\p@ plus5%
+ \p@ minus3\p@\relax}%
+\def\printstatutetable{%
+{ \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+\def\@stbitem##1{\par\hangindent 20\p@}%
+\@input{\jobname.sta}}}%
+% \end{macrocode}
+% \end{macro}
+% Define declaration that makes a statute table.
+% \begin{macrocode}
+\def\makestatutetable{%
+ \if@filesw \newwrite\@statutetablefile%
+ \immediate\openout\@statutetablefile=\jobname.stb%
+ \def\write@one@statute@entry{\@bsphack\begingroup%
+ \def\protect####1{\string####1\space}\@sanitize%
+ \let\thepage\relax%
+\@law@cleanup%
+ \edef\@tempa{\write\@statutetablefile{\string%
+ \statutetableentry%
+ {{\the\@ltok@nickname}%
+ {{\@law@titlemainfacetemp%
+ \ltokspecialface=\noexpand{\@law@titleoptionfacetemp\noexpand}%
+ \@law@nametemp}%
+ \the\@ltok@ttocone%
+ {\@law@citefirstmainfacetemp%
+ \ltokspecialface=\noexpand{\@law@citefirstoptionfacetemp\noexpand}%
+ \@law@citefirsttemp}}%
+ \ifx\@law@argtwotemp\empty\else!%
+ {\@law@conetoptemp\@law@argtwotemp}\fi}{\thepage}}}%
+ \expandafter\endgroup\@tempa%
+ \if@nobreak%
+ \ifvmode%
+ \nobreak%
+ \fi%
+ \fi%
+ \@esphack}%
+ \@writestatutetabletrue
+ \typeout{Writing statute table file \jobname.stb;}\fi}
+% \end{macrocode}
+% \paragraph{Articles}
+% \begin{macrocode}
+\def\thearticletable{\section*{\articletablename}%
+ \@mkboth{\uppercase{\articletablename}}%
+ {\uppercase{\articletablename}}%
+ \thispagestyle{plain}\parindent\z@%
+ \parskip\z@ plus.3\p@\relax\let\item\@ctbitem}%
+\def\endthearticletable{%
+ \if@restonecol\onecolumn%
+ \else\clearpage%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\articletablespace{\par \vskip 10\p@ plus5%
+ \p@ minus3\p@\relax}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\printarticletable{%
+{ \raggedright%
+ \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+ \def\@ctbitem##1{\par\smallskip\rule{15pt}{0cm}}%
+ \@input{\jobname.art}}}%
+% \end{macrocode}
+% This sets up for the creation of an external table
+% of articles file.
+% \begin{macrocode}
+\def\makearticletable{%
+ \if@filesw \newwrite\@articletablefile%
+ \immediate\openout\@articletablefile=\jobname.atb%
+ \def\write@one@article@entry{\@bsphack\begingroup%
+ \def\protect####1{\string####1\space}\@sanitize%
+ \let\thepage\relax
+\@law@cleanup%
+ \edef\@tempa{%
+\write\@articletablefile{%
+ \string\articletableentry%
+ {{\the\@ltok@nickname}%
+ {{\@law@authormainfacetemp%
+ \ltokspecialface=\noexpand{\@law@authoroptionfacetemp\noexpand}%
+ \@law@authortemp}%
+ \the\@ltok@atot%
+ {\@law@titlemainfacetemp%
+ \ltokspecialface=\noexpand{\@law@titleoptionfacetemp\noexpand}%
+ \@law@nametemp}%
+ \the\@ltok@ttocone%
+ {\@law@citefirstmainfacetemp%
+ \ltokspecialface=\noexpand{\@law@citefirstoptionfacetemp\noexpand}%
+ \@law@citefirsttemp}%
+ \@law@conetoptemp%
+ \@law@citepagetemp%
+ \the\@ltok@ptoctwo\@law@citelasttemp}}{\thepage}}}%
+ \expandafter\endgroup\@tempa%
+ \if@nobreak%
+ \ifvmode%
+ \nobreak%
+ \fi%
+ \fi%
+ \@esphack}%
+ \@writearticletabletrue
+ \typeout{Writing article table file \jobname.atb;}\fi}
+% \end{macrocode}
+% \paragraph{Books}
+% \begin{macrocode}
+\def\thebooktable{\section*{\booktablename}%
+ \@mkboth{\uppercase{\booktablename}}{\uppercase{\booktablename}}%
+ \thispagestyle{plain}\parindent\z@%
+ \parskip\z@ plus.3\p@\relax\let\item\@ctbitem}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\endthebooktable{%
+ \if@restonecol\onecolumn%
+ \else\clearpage%
+ \fi}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\booktablespace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\printbooktable{%
+{ \raggedright%
+ \def\@law@firstslash{\begingroup\def\\{\@law@secondslash}%
+ \the\ltokspecialface}%
+ \def\@law@secondslash{\endgroup\def\\{\@law@firstslash}}%
+ \def\\{\@law@firstslash}%
+ \def\@ctbitem##1{\par\smallskip\rule{15pt}{0cm}}%
+ \@input{\jobname.bok}}}%
+% \end{macrocode}
+% This sets up for the creation of an external table
+% of books file.
+% \begin{macrocode}
+\def\makebooktable{%
+ \if@filesw \newwrite\@booktablefile%
+ \immediate\openout\@booktablefile=\jobname.btb%
+ \def\write@one@book@entry{\@bsphack\begingroup%
+ \def\protect####1{\string####1\space}\@sanitize%
+ \let\thepage\relax
+ \@law@cleanup%
+ \edef\@tempa{\write\@booktablefile{\string%
+ \booktableentry{{\the\@ltok@nickname}%
+ {{\@law@authormainfacetemp%
+ \ltokspecialface=\noexpand{\@law@authoroptionfacetemp\noexpand}%
+ \@law@authortemp}%
+ \the\@ltok@atot%
+ {\@law@titlemainfacetemp%
+ \ltokspecialface=\noexpand{\@law@titleoptionfacetemp\noexpand}%
+ \@law@nametemp}%
+ \the\@ltok@ttocone%
+ {\@law@citefirstmainfacetemp%
+ \ltokspecialface=\noexpand{\@law@citefirstoptionfacetemp\noexpand}%
+ \@law@citefirsttemp}%
+ \the\@ltok@ptoctwo\@law@citelasttemp}}%
+ {\thepage}}}%
+ \expandafter\endgroup\@tempa%
+ \if@nobreak%
+ \ifvmode%
+ \nobreak%
+ \fi%
+ \fi%
+ \@esphack}%
+ \@writebooktabletrue
+ \typeout{Writing book table file \jobname.btb;}\fi}
+%</lexitabl>
+% \end{macrocode}
+% \subsubsection{Citation style definitions}
+% The style definitions are also stored in a separate file,
+% to make it easier and less risky for users to play with
+% the styles to produce desired output. Table 3
+% provides a guide to the macro arguments and their functions.
+% \paragraph{Books} The styles used for citing books and
+% book-like things follow.
+% \begin{macrocode}
+%<*lexicite>
+\ProvidesFile{lexicite.tex}[1994/12/07]
+\newcitestyle{book}%
+ {srsrrrB}
+ {[a],\ [t][c]\ [p](pl)\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
+ {4}%
+ {{#1}{#2}{#3}{}{}{(#4)}}%
+%
+\def\newanonbook#1#2#3{\newbook{#1}{}{#2}{#3}}
+%
+\newcitestyle{news}%
+ {rrirrrA}
+ {[a],\ [t],\ [c], p.~[p],\ at~(pl),\ at~[rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
+ {6}%
+ {{#1}{#2}{#3}{#4}{#5}{(#6)}}%
+%
+\newcitestyle{man}%
+ {riririB}
+ {[a],\ [t][c],\ [p](pl),\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
+ {4}%
+ {{#1}{#2}{#3}{}{}{(#4)}}%
+%
+\def\newanonman#1#2#3{\newman{#1}{}{#2}{#3}}
+% \end{macrocode}
+% \paragraph{Articles} Styles used for articles follow.
+% There is currently just one, because the Blue Book is
+% pretty consistent on this type of work. Note
+% that this may be used to cite chapters in books and stuff
+% as well.
+% \begin{macrocode}
+\newcitestyle{article}%
+ {rsirsrA}
+ {[a],\ [t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
+ {6}%
+ {{#1}{#2}{#3}{#4}{#5}{(#6)}}%
+%
+\def\newanonarticle#1#2#3#4#5{\newarticle{#1}{}{#2}{#3}{#4}{#5}}
+% \end{macrocode}
+% \paragraph{Cases} There are several styles for cases; we pretty
+% much need a separate style for each jurisdiction.
+% \begin{macrocode}
+\newcitestyle{case}%
+ {rrirrsC}
+ {[a][t],\ [c]\ [p],\ (pl),\ [rp]\ [e]:[id]\ at~(pl)\ at~[xrf]}
+ {5}%
+ {{#1}{}{#2}{#3}{#4}{(#5)}}%
+%
+\newcitestyle{ecase}%
+ {rrirriC}
+ {[a][t],\ [c]\ [p],\ (pl),\ [rp][e]:[id]\ at~(pl)\ at~[xrf]}
+ {4}%
+ {{#1}{}{#2}{#3}{#4}{}}%
+%
+\newcitestyle{jcase}%
+ {rrririC}
+ {[a][t],\ [c]\ p.~[p],\ (pl),\ [rp][e]:[id]\ at~(pl)\ at~[xrf]}
+ {4}%
+ {{#1}{}{#2}{#3}{#4}{}}%
+% \end{macrocode}
+% \paragraph{Statutes} There are several of these. More may
+% need to be added on an {\em ad hoc\/} basis.
+% \begin{macrocode}
+\newcitestyle{statute}%
+ {rrrsrsS}
+ {[a][t],\ [c]\ \S~[p](pl)\ \S\S~[rp]\ [e]:[id]\ \S~(pl)\ \S\S~[xrf]}
+ {4}%
+ {{#1}{}{#2}{#3}{}{(#4)}}%
+%
+\newcitestyle{shortstatute}%
+ {rrrsrsS}
+ {[a][t][c]\ \S~[p](pl)\ \S\S~[rp]\ [e]:[id]\ \S~(pl)\ \S\S~[xrf]}
+ {3}%
+ {{#1}{}{#2}{}{}{(#3)}}%
+%
+\newcitestyle{jstatute}%
+ {rrrsrsS}
+ {[a][t][c]\ \S~[p](pl)\ \S\S~[rp]\ [e]:[id]\ \S~(pl)\ \S\S~[xrf]}
+ {3}%
+ {{#1}{}{}{#2}{}{(#3)}}%
+% \end{macrocode}
+% \paragraph{Temporary hacks} These citation forms have special
+% bridges hard-wired into them. The plan for the future is to
+% use a prefix macro to alter the behaviour of "\newstatute" and
+% its friends, instead of proliferating custom macros like this.
+% \begin{macrocode}
+\newcitestyle{shortstatuteart}%
+ {rrrsrsS}
+ {[a][t][c]\ art.~[p](pl)\ arts.~[rp]\ [e]:[id]\ art.~(pl)\ arts.~[xrf]}
+ {3}%
+ {{#1}{}{#2}{}{}{(#3)}}%
+%
+\newcitestyle{constitutionart}%
+ {rrrsrsS}
+ {[a][t][c]\ art.~[p](pl)\ arts.~[rp]\ [e]:[id]\ art.~(pl)\ arts.~[xrf]}
+ {3}%
+ {{#1}{}{#2}{}{}{(#3)}}%
+%
+\newcitestyle{constitutionsch}%
+ {rrrsrsS}
+ {[a][t][c]\ sch.~[p](pl)\ schs.~[rp]\ [e]:[id]\ sch.~(pl)\ schs.~[xrf]}
+ {3}%
+ {{#1}{}{#2}{}{}{(#3)}}%
+%</lexicite>
+% \end{macrocode}
+% \subsection{Article table style}
+% articletable.ist: index style for tables of articles
+%
+% \begin{macrocode}
+%<*lexiarti>
+keyword "\\articletableentry"
+actual '*'
+delim_n ",~"
+delim_0 "\~\\leaderfill"
+preamble "\\begin{thearticletable}\n"
+postamble "\n\n\\end{thearticletable}\n"
+group_skip "\n\n \\articletablespace\n"
+%</lexiarti>
+% \end{macrocode}
+% \paragraph{Book table style}
+% \begin{macrocode}
+%<*lexibook>
+keyword "\\booktableentry"
+delim_n ",~"
+delim_0 "\~\\leaderfill"
+preamble "\\begin{thebooktable}\n"
+postamble "\n\n\\end{thebooktable}\n"
+group_skip "\n\n \\booktablespace\n"
+%</lexibook>
+% \end{macrocode}
+% \paragraph{Case table style}
+% \begin{macrocode}
+%<*lexicase>
+keyword "\\casetableentry"
+delim_n ",~"
+delim_0 "\~\\leaderfill"
+preamble "\\begin{thecasetable}\n"
+postamble "\n\n\\end{thecasetable}\n"
+group_skip "\n\n \\casetablespace\n"
+%</lexicase>
+% \end{macrocode}
+% \paragraph{Statute table style}
+% \begin{macrocode}
+%<*lexistat>
+keyword "\\statutetableentry"
+delim_n "\$\\rightarrow\$"
+delim_0 "\~\\leaderfill"
+preamble "\\begin{thestatutetable}\n"
+postamble "\n\n\\end{thestatutetable}\n"
+group_skip "\n\n \\statutetablespace\n"
+%</lexistat>
+% \end{macrocode}
+% \section{The Driver File}
+% \begin{macrocode}
+%<*driver>
+\def\batchfile{lexitex.ins}
+\input docstrip
+\preamble
+IMPORTANT NOTICE:^^M
+You are not allowed to change this file. You may however copy
+this file to a file with a different name and then change the
+copy if you obey the restrictions on file changes described
+at the end of lexitex.doc under RESTRICTIONS.^^M
+You are NOT ALLOWED to distribute this file alone. You are NOT
+ALLOWED to take money for the distribution or use of this file
+(or a changed version) except for a nominal charge for copying
+etc.^^M
+You are allowed to distribute this file under the condition that
+it is distributed with all of its contents, intact.^^M
+If you receive only some of these files from someone, complain!^^M
+However, if these files are distributed by established suppliers
+as part of a complete TeX distribution, and the structure of the
+distribution would make it difficult to distribute the whole set
+of files, *those parties* are allowed to distribute only some of
+the files provided that it is made clear that the user will get
+a complete distribution-set upon request to that supplier (not
+me). Notice that this permission is not granted to the end
+user.^^M
+For error reports in case of UNCHANGED versions contact me on
+fbennett@clus1.ulcc.ac.uk
+\endpreamble
+\generateFile{lexitex.sty}{t}{\from{lexitex.doc}{lexitex}}
+\generateFile{lexitexm.sty}{t}{\from{lexitex.doc}{lexitex,noshorthanding}}
+\generateFile{lexicite.tex}{t}{\from{lexitex.doc}{lexicite}}
+\generateFile{lexitabl.tex}{t}{\from{lexitex.doc}{lexitabl}}
+\generateFile{lexiarti.ist}{t}{\from{lexitex.doc}{lexiarti}}
+\generateFile{lexibook.ist}{t}{\from{lexitex.doc}{lexibook}}
+\generateFile{lexicase.ist}{t}{\from{lexitex.doc}{lexicase}}
+\generateFile{lexistat.ist}{t}{\from{lexitex.doc}{lexistat}}
+\generateFile{lexitex.man}{t}{\from{lexitex.doc}{manual}}
+\generateFile{lexicard.tex}{t}{\from{lexitex.doc}{refcards}}
+\generateFile{lexiproo.tex}{t}{\from{lexitex.doc}{proofsheets}}
+%</driver>
+%<*manual>
+% dimensions from ltugboat.sty:
+\documentclass{ltxdoc}
+\usepackage{lexitexm}
+\pagenumbering{roman}
+
+\EnableCrossrefs
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\RecordChanges % Gather update information
+\CodelineIndex % Index code by line number
+\OnlyDescription % comment out for implementation details
+%\OldMakeindex % use if your MakeIndex is pre-v2.9
+\begin{document}
+ \DocInput{lexitex.doc}
+\end{document}
+%</manual>
+% \end{macrocode}
+% \begin{macrocode}
+%<*refcards>
+\catcode`\@=11
+\catcode`\"=\active
+\def"{\verb"}
+\documentclass{article}
+\usepackage{lexitex}
+\pagestyle{empty}
+\oddsidemargin -10pt
+\evensidemargin -10pt
+\topmargin -47pt
+\headheight 12pt
+\headsep 25pt
+\footskip 75pt
+\textheight 9in
+\textwidth 6.75in
+\columnsep .375in
+\columnseprule 0pt
+\begin{document}
+\newlength{\cardwidth}
+\setlength{\cardwidth}{\textwidth}
+\newlength{\cardsep}
+\setlength{\cardsep}{\fboxsep}
+\addtolength{\cardwidth}{-4\cardsep}
+\addtolength{\cardwidth}{-15pt}
+\newlength{\subcardwidth}
+\setlength{\subcardwidth}{0.5\cardwidth}
+\addtolength{\subcardwidth}{-6\cardsep}
+\hyphenation{con-sti-tu-tion}
+\small
+\begin{tabular}{|c|c|c|} \cline{1-1}\cline{3-3}
+\begin{minipage}[t]{\subcardwidth}
+\flushbottom\rule{0cm}{12pt}
+\centerline{\bf\large\LexiTeX\footnote[1]{%
+\raggedright\LexiTeX\ is by Frank G. Bennett, Jr., Lecturer in Law at the~School
+ of Oriental and African Studies, University of London.\\
+(Internet) {\tt fbennett@clus1.ulcc.ac.uk}} Reference Card}
+
+\bigskip
+
+\fbox{\sc Style Template} $+$ \fbox{\sc
+Blueprint}$\longrightarrow$\\
+\rule{0cm}{12pt}$\hookrightarrow$\fbox{\sc Citation Template} $+$ \fbox{\sc Text}$\longrightarrow$\\
+\rule{0cm}{12pt}$\hookrightarrow$\fbox{\sc Nickname} $+$ Maybe a \fbox{\sc
+Page Reference}\\[\medskipamount]
+\noindent After a~citation template declaration for a~particular
+work, use the~nickname to refer to that source thereafter.\\[\medskipamount]
+\noindent The~style template is called once, by {\tt lexi\-tex.sty} at startup.
+Blueprints for use by the style template are contained in {\tt lexi\-cite.tex}.
+The~dis\-tribution contains blueprints for the style template which will
+suit most purposes.\\[\medskipamount]
+\noindent {\bf Options and Special Commands}\\
+\begin{description}
+\item[{\tt\string\lowcase}] before any \LexiTeX\ citation, forces {\em Id.}\ to
+ lowercase, should it occur.
+\item[{\tt \string\lexicite\{blah\}}] is used to cite the source
+ with the nickname {\tt blah}.
+\item[{\tt\string\\...\string\\}]marks special
+ typeface (usually roman) with\-in an argument of a~citation template
+ declaration.
+\end{description}
+\begin{itemize}
+\item[{\tt *}] used immediately after a \LexiTeX\ citation, suppresses
+ output of a~bare citation template declaration or nickname.
+ \item[{\tt -}] used between a \LexiTeX\ citation and an optional page
+ or section reference, suppresses output of the~citation template declaration or
+ nickname, and of the page reference.
+\end{itemize}
+\rule{0cm}{.5pc}
+\end{minipage}
+& &
+\begin{minipage}[t]{\subcardwidth}
+\rule{0cm}{.5pc}
+\begin{itemize}
+\item[{\tt+}] appends a~page or section number when typed after a
+ citation template declaration or a~nickname. Always enclose in braces:
+ \verb=+{123}=.
+\item[{\tt++}] appends a~plural page or section argument to any
+ \LexiTeX\ citation. Enclose page numbers in braces, and separate
+ items with \verb+\,+, \verb+\&+ or \verb+\dash+ (ranges not
+ supported, but do no harm when used with non-statute citation
+ templates and nicknames).
+\item[{\tt+-}] appends a~singular page or section argument, but
+ writes multiple references to the table file. Most often used in
+ combination with \verb+^...^+ and \verb+_..._+ to cope with references
+ to multiple subsections of a single statutory provision.
+\item[{\tt\string^}] used within appended page or section references to
+ enclose material that will appear only in the text, not in the table
+ file. Used in all other arguments to enclose material that will
+ appear only in initial or full-form citations.
+\item[{\tt\string_}] used within appended page or section references to
+ enclose material that will appear only in the table file, not in the
+ text.
+\end{itemize}
+\medskip
+\noindent {\bf Tables}\\[\smallskipamount]
+\noindent To write external table files, use:
+\begin{quote}
+\verb+\makebooktable+ (makes \verb+*.btb)+\\
+\verb+\makearticletable+ (makes \verb+*.atb)+\\
+\verb+\makecasetable+ (makes \verb+*.ctb)+\\
+\verb+\makestatutetable+ (makes \verb+*.stb)+
+\end{quote}
+\noindent Process the~external table file using
+\verb+makeindx+ with the~appropriate style file and output
+file name:
+\begin{quote}
+\verb+lexibook.ist+ $\rightarrow$\ \verb+*.bok+\\
+\verb+lexiarti.ist+ $\rightarrow$\ \verb+*.art+\\
+\verb+lexicase.ist+ $\rightarrow$\ \verb+*.cas+\\
+\verb+lexistat.ist+ $\rightarrow$\ \verb+*.sta+
+\end{quote}
+\noindent Place finished tables in the~document using:
+\begin{quote}
+\verb+\printbooktable+\\
+\verb+\printarticletable+\\
+\verb+\printcasetable+\\
+\verb+\printstatutetable+
+\end{quote}
+\vspace{3pt}
+\end{minipage}\\ \cline{1-1}\cline{3-3}
+\end{tabular}\\
+{\small
+\begin{tabular}{|c|} \hline
+\begin{minipage}{\cardwidth}
+ \renewcommand{\thefootnote}{\alph{footnote}}
+\centerline{\rule{0cm}{12pt}\large\bf Sample {\tt lexicite.tex} blueprint entry for
+\LexiTeX}
+\bigskip
+"\newcitestyle{article"\footnotemark[1]"}%"\\
+" {rsirsr"\footnotemark[2]"A"\footnotemark[3]"}%"\\
+" {[a],\ "\footnotemark[4]"[t],\ "\footnotemark[4]
+"[c]\ "\footnotemark[4]
+"[p],\ "\footnotemark[4]
+"(pl),\ "\footnotemark[4]
+"[rp]\ "\footnotemark[4]
+"[e]:[id]\ at~"\footnotemark[4]
+"(pl)\ at~"\footnotemark[4]
+"[xrf]}%"\\
+" {6}"\footnotemark[5]"%"\\
+"
+{{\#1}"\footnotemark[6]"{\#2}"\footnotemark[6]"{#3}"\footnotemark[6]"{\#4}"\footnotemark[6]"{#5}"\footnotemark[6]"{(\#6)}"\fo
+otnotemark[6]"}%"\\
+\footnotetext[1]{This gives the name of the citation template to be generated.}
+\footnotetext[2]{The 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 first-cite-part portions of the citation. {\tt r}, {\tt s}, {\tt b} and
+ {\tt i} select roman, small caps, boldface and italic type as the main
+ typeface. These letter flags are not case sensitive.
+ The alternative typefaces may the be specially selected in the text
+ arguments to a citation using
+ {\tt\string\\...\string\\}.}
+\footnotetext[3]{The last letter in this list sets the classification
+ of citations declared with the resulting style macro. {\tt a}, {\tt b}, {\tt
+ c} and {\tt 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.}
+\footnotetext[4]{These are the citation bridges that
+ will be placed between the portions of the citation indicated. Two
+ bridges, singular and plural, are given between {\tt [p]}
+(page) and
+ {\tt [rp]} (reference page), and between {\tt [id]} ({\em id.}
+or {\em supra\/}) and {\tt [xrf]} (cross-reference).}
+\footnotetext[5]{This argument states how many arguments the finished citation
+ template will accept. It must be a number between {\tt 1} and {\tt
+ 6}.}
+\footnotetext[6]{Six 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.}
+\vspace{3pt}
+\end{minipage}\\ \hline
+\end{tabular}}\\
+{\small
+\begin{tabular}{|c|}\hline
+\begin{minipage}{\cardwidth}
+\centerline{\large\bf\rule{0cm}{12pt}Standard \LexiTeX\ ver.~2.0i Citation Templates}
+\bigskip
+\def\ts{\vspace{6pt}}
+\small
+\begin{verbatim}
+\newbook{blah1}{B. Cardozo}{The Growth of The Law}{1924}+{15}.
+\end{verbatim}
+$\hookrightarrow$\newbook{blah1}{B. Cardozo}{The Growth of the Law}{1924}+{15}.
+\ts
+\begin{verbatim}
+\newbook{blah2}{}{Eastern Air Lines, Inc., 1978 Annual Report}{1979}+{15}.
+\end{verbatim}
+$\hookrightarrow$\newbook{blah2}{}{Eastern Air Lines, Inc., 1978 Annual Report}{1979}+{15}.
+\ts
+\begin{verbatim}
+\newman{blah3}{Comics Magazine Ass'n of America}{Press Release No.~51}{Sept.~16, 1954}+{15}.
+\end{verbatim}
+$\hookrightarrow$\newman{blah3}{Comics Magazine Ass'n of America}{Press Release
+ No.~51}{Sept.~16, 1954}+{15}.
+\ts
+\begin{verbatim}
+\newman{blah4}{}{Telephone conversation with Douglas Borisky, Senior Revising Editor of
+the \\Columbia Law Review\\}{Apr. 10, 1986}.
+\end{verbatim}
+$\hookrightarrow$\newman{blah4}{}{Telephone conversation with Douglas
+Borisky, Senior Revising Editor of the \\Columbia Law Review\\}{Apr.
+10,\newline 1986}.
+\ts
+\begin{verbatim}
+\newarticle{blah5}{Cox}{Federalism and Individual Rights}{73~Nw.~U.L. Rev.}{1}{1978}+{15}.
+\end{verbatim}
+$\hookrightarrow$\newarticle{blah5}{Cox}{Federalism and Individual
+ Rights}{73~Nw.~U.L. Rev.}{1}
+ {1978}+{15}.
+\ts
+\begin{verbatim}
+\newarticle{blah6}{\\O.W. Holmes\\}{Law in Science and Science in Law}{\\in\\ Collected Legal
+Papers}{210}{1920}.
+\end{verbatim}
+$\hookrightarrow$\newarticle{blah6}{\\O.W.
+Holmes\\}{Law in Science and
+ Science in Law}{\\in\\ Collected Legal Papers}{210}{1920}.
+\ts
+\begin{verbatim}
+\newarticle{blah7}{Maitland}{The Mystery of Seisin}{\\in\\ 3 Select Essays in Anglo-American
+Legal History}{591}{1909}.
+\end{verbatim}
+$\hookrightarrow$\newarticle{blah7}{Maitland}{The Mystery of
+ Seisin}{\\in\\ 3 Select Essays in Anglo-American Legal
+ History}{591}{1909}.
+\ts
+\begin{verbatim}
+\newnews{blah8}{}{Abscam Jury Sees Videotape of Deal}{San Francisco Chron., Aug.~14, 1980}
+{14, col.~1}{}.
+\end{verbatim}
+$\hookrightarrow$\newnews{blah8}{}{Abscam Jury Sees Videotape of Deal}{San Francisco Chron., Aug.~14, 1980}{14, col.~1}{}.
+\ts
+\begin{verbatim}
+\newcase{blah9}{Baker v.\ Fortney}{299~S.W.2d}{563}{Mo.\ Ct.\ App.\ 1957}+{564}.
+\end{verbatim}
+$\hookrightarrow$\newcase{blah9}{Baker v.\ Fortney}{299~S.W.2d}{563}{Mo.\ Ct.\ App.\ 1957}+{564}.
+\ts
+\begin{verbatim}
+\newecase{blah10}{Clough Mill Ltd v Martin}{[1984] 3~All ER}{982}+{986}.
+\end{verbatim}
+$\hookrightarrow$\newecase{blah10}{Clough Mill Ltd v Martin}{[1984] 3~All
+ ER}{982}+{986}.
+\ts
+\begin{verbatim}
+\newjcase{blah11}{Decision of the Tokyo District Court, February 18,
+ 1988}{Hanrei jih\=o, n.~1295}
+{132}+{133}.
+\end{verbatim}
+$\hookrightarrow$\newjcase{blah11}{Decision of the Tokyo District Court, February 18,
+ 1988}{Hanrei jih\=o, n.~1295}{132}+{133}.
+\ts
+\begin{verbatim}
+\newstatute{blah12}{Robinson-Patman Act}{15~U.S.C.}{1982}+{{13^--13b^}\,
+ {21^a^}}.
+\end{verbatim}
+$\hookrightarrow$\newstatute{blah12}{Robinson-Patman Act}{15~U.S.C.}{1982}++{{13--13b}\, {21a}}.
+\ts
+\begin{verbatim}
+\newconstitutionart{blah13}{Federal Constitution}{1957}+{1}.
+\end{verbatim}
+$\hookrightarrow$\newconstitutionart{blah13}{Federal Constitution}{1957}+{1}.
+\ts
+\begin{verbatim}
+\newconstitutionsch{blah14}{Federal Constitution}{1957}+{1}.
+\end{verbatim}
+$\hookrightarrow$\newconstitutionsch{blah14}{Federal Constitution}{1957}+{1}.
+\vspace{3pt}
+\end{minipage}\\ \hline
+\end{tabular}
+ }
+\end{document}
+%</refcards>
+% \end{macrocode}
+% \changes{beta}{15 May 1993}{Put all typeface selectors in the
+% print routine in braces, so that punctuation does not get caught up in
+% the game. Things are a bit messy; the
+% problem has been solved by rearranging the bridges so that they conform
+% to their
+% preceding text, but the full wax will be to set them all in roman.}
+% \changes{beta}{19 May 1993}{Cite to previous work in the same footnote,
+% where there is an intervening source, should produce {\protect\em supra},
+% without a footnote number reference. Fixed.}
+% \changes{beta}{25 May 1993}{Fixed failure to suppress section
+% markers in statute
+% tables for cites with no section specified.}
+% \changes{beta}{25 May 1993}{Fixed failure to properly
+% truncate short book citations
+% where the author has not been previously cited.}
+% \changes{beta}{26 May 1993}{Fixed problem with use of {\tt\protect\string\protect\ldots}
+% (was appending a comma
+% to the three dots).}
+% \changes{beta}{8 June 1993}{Completed addition of
+% {\tt\protect\string\protect^...\protect\string\protect^},
+% {\tt\protect\string\protect_...\protect\string\protect_} and
+% {\tt\protect\string\protect|...\protect\string\protect|}.}
+% \changes{beta}{9 June 1993}{fixed
+% {\tt\protect\string\protect\gdef}
+% bug in definitions
+% of {\tt\protect\string\protect^}, {\tt\protect\string\protect|}
+% and {\tt\protect\string\protect_} as active
+% characters, so that these defs are
+% {\tt\protect\string\protect\def},
+% and turn off
+% under grouping.}
+% \changes{beta}{11 June 1993}{localized use of
+% {\tt\protect\string\protect\@law@barkill}
+% in full and short
+% print routines, to prevent chaos.}
+% \changes{prerelease}{5 June 1994}{General proofreading and tidying-up.
+% Discovered
+% that placement of {\tt\protect\string\protect\newcite}
+% macro was initiating a complete
+% parsing of the string produced by
+% {\tt\protect\string\protect\@newciteoptions} every time
+% a new citation was declared. Moved higher so it only happens
+% once. \LexiTeX\ will not be any faster to load, and there are
+% no memory savings from this particular change, but running
+% should be a little quicker.
+% Also cut out a couple of declarations that
+% went unused.}
+% \changes{prerelease}{5 June 1994}{
+% Found that the old {\tt\protect\string\protect\@law@stashinfo}
+% macro was being
+% passed at least six arguments that were duplicated in
+% token registers! This was fixed in the course of the
+% (start of) complete re-drafting of the citation-defining
+% routines. The time saved should make the finished macros
+% faster, although some speed will be lost on list-macro
+% parsing.}
+% \changes{prerelease}{5 June 1994}{Completed all list-macro routines, with the exception of
+% the cutting and adding macros themselves.}
+% \changes{prerelease}{5 June 1994}{{\em Drastically\/}
+% simplified
+% parsing of typeface choices by
+% cutting out all of the {\tt\protect\string\protect\@ifnextchar}
+% rubbish, and getting
+% all typeface options at one go, parsing them with a
+% generic macro. The trade-off is that there have to be
+% exactly seven arguments passed to
+% {\tt\protect\string\protect\@law@parseoptions}.
+% And so eliminated all the prone-to-error syntax surrounding
+% these typeface selectors. Not much of a loss. Should load and
+% be a lot faster to load now.}
+% \changes{prerelease}{5 June 1994}{Changed the syntax for specifying bridges in the
+% {\tt lexicite.tex} file. May not be all that much more readable,
+% but at least now it fits on one line most of the time.}
+% \changes{prerelease}{6 June 1994}{First trial of revised code---it
+% works! Minor debugging not worthy of note.}
+% \changes{prerelease}{11 June 1994}{Set to work on adding comments in DOCSTRIP
+% format. Realized that this is going to be a very big file
+% by the time it's done, and can't wait to get finished and be shut
+% of it for the time being. Also began investigating \BibTeX\
+% and its style language. Correspondence with Nelson Beebe and
+% George Greenwade concerning a \BibTeX/\LexiTeX\ link-up.}
+% \changes{prerelease}{24 June 1994}{Concluded that using
+% a separate ``{\tt\protect\string\protect\@law@stasheverything}'' macro
+% was unnecessary; merged with {\tt\protect\string\protect\@newcite}. From
+% six arguments and six token registers to no data shunting
+% at all in this routine. Again, a little speed gained.}
+% \changes{2.0}{6 July 1994}{Release to known users
+% of first running DOCSTRIP version of code}
+% \changes{2.0a}{7 July 1994}{Minor fix to {\tt lexicite.tex}
+% file.}
+% \changes{2.0b}{23 July 1994}{Major redrafting of code for
+% proof pages completed. File to generate proof pages for
+% all styles on system incorporated in {\tt lexitex.doc} for
+% distribution.}
+% \changes{2.0b}{23 July 1994}{Redrafting of {\tt
+% \protect\string\protect\@justabovecheck} routine, after
+% numerous glitches showed up
+% on the proof pages.}
+% \changes{2.0b}{23 July 1994}{Version 2.0b released on the world.}
+% \changes{2.0j}{94/12/06}{Numerous bug fixes and some tidying
+% up.}
+% \begin{macrocode}
+\endinput
+% \end{macrocode}
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+% \Finale \PrintIndex \PrintChanges
diff --git a/macros/latex/contrib/lexitex/mainfest b/macros/latex/contrib/lexitex/mainfest
new file mode 100644
index 0000000000..c629e29442
--- /dev/null
+++ b/macros/latex/contrib/lexitex/mainfest
@@ -0,0 +1,16 @@
+6 December 1994
+
+The full LexiTeX package consists of the following
+files:
+
+ lexitex.doc
+ lexibib.doc
+ MANIFEST
+ README
+ CATALOG
+ lexismp1.tex
+ lexismp2.tex
+ lexismp2.bib
+
+If all of these files are not available to you, contact
+me on fbennett@rumple.soas.ac.uk.