The footbib package^{∗}

Eric Domenjoud Eric.Domenjoud@loria.fr

2003/4/27

Contents

1 General overview 1

2 The user interface 2 2.1 Package options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Commands to generate the foot bibliography . . . . . . . . . . . . 4 2.3 customisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Known and potential problems 7

4 Implementation 8 4.1 Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.2 Initial setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3 Test of the output routine . . . . . . . . . . . . . . . . . . . . . . . 8 4.4 Package Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.5 Customisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.6 Some useful definitions . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.7 Units handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

5 Commands to handle the references 15 5.1 Commands to handle the foot bibliography . . . . . . . . . . . . . 16 5.2 AtBeginDocument, AtEndDocument . . . . . . . . . . . . . . . . . 20 5.3 Output routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

1 General overview

This package makes bibliographic references appear as footnotes. It defines a command \footcite which is similar to the \cite command of L^{A}TEX but the references cited in this way are inserted at the bottom of the pages. This foot bibliography does not conflict with the standard one and both may exist simultaneously in a document. The command \cite may still be used to produce the standard bibliography.

The foot bibliography uses its own style and bibliographic database which may be specified independently of the standard one. Any standard bibliography style may be used. If the style does not provide explicit labels (e.g. plain), the references are numbered. The default is to number the references in the order in which they appear in the thebibliography environment. This may be overridden through options which allow the user to define a numbering unit. Then the references will be numbered in the order in which they are cited in the unit and the numbering restarts from 1 in each unit. The numbering unit may be a page, a double page, a chapter, a part or the whole document. Chapter and part may be used only if they are defined by the document class.

∗This file has version number 2.0.3, last revised 2003/4/27.

The user may also define a citation unit which may be a page, a double page, a chapter, a part or the whole document. The text of a reference will be inserted only once in each citation unit, on the page where the first citation occurs in the unit.

The mechanism used to put a reference only once in each citation unit may require several runs of L^{A}TEX (usually at least two) before the references find their exact place. If necessary, L^{A}TEX will issue, near the end of the document, a warning saying

 Package footbib Warning: Bibliography not yet stable. Rerun LaTeX.

Using footbib in a document ⟨doc⟩.tex produces a file ⟨doc⟩.fb.aux. One must pass the argument ⟨doc⟩.fb to BibTEX to produce the bibliography which will be put in the file ⟨doc⟩.fb.bbl. The exact sequence of commands is

     latex ⟨doc⟩
     bibtex ⟨doc⟩.fb
     latex ⟨doc⟩
     latex ⟨doc⟩

…

Note: The name ⟨doc⟩.fb.aux might cause some problem on systems which do not allow a double extension in a file name or put a limit on the length of file names. A user command is provided to change it (see section 2.3).

At the beginning of the document, footbib inputs the bibliography from the file ⟨doc⟩.fb.bbl (or the name given by the user). If one wants to include the thebibliography environment in the main document, this may be done with a filecontents environment before the \documentclass command. See the L^{A}TEX 2ε documentation for more details about this environment.

2 The user interface

2.1 Package options

2.1.1 oneside/twoside

oneside The oneside and twoside options affect the behaviour of footbib when either twoside unit (citation or numbering) is the page. In oneside mode, the actual unit is a

single page while in twoside mode, the unit is a double page. These options may be used to override a global oneside or twoside option.

2.1.2 citeonce[*]

citeonce The citeonce option overrides the default citation unit. footbib puts the text citeonce* of a reference only once in each citation unit which may be a (double) page, a

chapter, a part or the whole document. The default citation unit is the page in oneside mode and the double page in twoside mode. The new citation unit (chapter, part or document) is given as an optional argument between paren-

theses (citeonce(chapter), citeonce(part) or citeonce(document)). If no

argument is supplied, document is assumed. The argument chapter (resp. part) may be used only if the document class defines \chapter (resp. \part). The argument page may also be used but has a somehow special meaning. It defines a citation unit which is not overridden by another citeonce option but instead has a cumulative effect. For instance if one says

    \usepackage[twoside,citeonce(page),citeonce(chapter)]{footbib}

then each double page and also each \chapter command starts a new citation unit. This may be useful if one wants a chapter to start a new unit even if it starts on a right page. It is only meaningful in twoside mode in conjunction with another citeonce option. In all other cases, it has no effect.

The citeonce option has a star form citeonce* with the same optional argument. When the star form is used, for each subsequent citation of a reference in the same citation unit but on another (double) page, the text of the reference is not omitted but replaced with a cross reference to the first citation in the same citation unit. The page argument is not available since it would have no effect.

2.1.3 firstcite

firstcite The firstcite option affects the way the references are labelled. When the bibliography style does not provide explicit labels, the references are numbered. The default is to assign to each reference a static label which is its order in the thebibliography environment. The label is then the same for all citations of a given reference. The firstcite option causes the references to be numbered dynamically according to the order of their first citations. firstcite takes an optional argument between parentheses firstcite(⟨unit⟩) which defines the numbering unit. The numbering restarts then from 1 in each numbering unit. The argument ⟨unit⟩ may take the value page, chapter, part or document. If page is used, then the numbering unit is a page in oneside mode and a double page in twoside mode. If no argument is supplied, document is assumed.

The effect of several firstcite options is cumulative in the sense that if one says for instance

    \usepackage[twoside,firstcite(page),firstcite(chapter)]{footbib}

then each double page and each \chapter command starts a new numbering unit. This means that a \chapter command starts a new numbering unit even if it is on a right page.

If the bibliography style provides explicit labels, the firstcite option has no effect.

2.1.4 crossrefs[*] and nocrossrefs

crossrefs When an entry in the bibliographic database contains a CROSSREF field, BibTEX

crossrefs*
nocrossrefs

includes the cross-referenced entry in the bibliography and puts a \cite command in the entry where the CROSSREF field occurs. If no standard bibliography is produced, L^{A}TEX will complain about an undefined reference. One may generally inhibit this behaviour of BibTEX by invoking it with the -min-crossrefs=⟨number⟩ option which tells how many times an entry must be cross-referenced before it is included in the bibliography and replaced with a \cite command. Setting ⟨number⟩ to a large value will generally inhibit the cross-referencing mechanism. However, this option has no effect if the cross-referenced entry is explicitely cited in the document.

The crossrefs option of footbib solves this problem by replacing each \cite command in a foot reference with \footcite (see the description of this command below). The star form crossrefs* replaces the \cite command with a \footcite*, which means that the text of the reference is not inserted. It is then the responsibility of the user to insert the text in the right place with a \footnocite command. Of course, standard citation through \cite is not possible anymore in a foot reference when either form of this option is used.

A nocrossrefs option is also provided to inhibit this behaviour in case it is not wanted but crossrefs occurs in the global options.

2.1.5 split and nosplit

split The nosplit option tells footbib not to split the references across pages. The nosplit split option allows references to be split. split is the default and exists only to

allow the user to override a global nosplit option.

2.2 Commands to generate the foot bibliography

\footbibliography  \footbibliography{⟨file⟩,⟨file⟩,. . . }

Defines the list of bibliographic databases for the foot bibliography. This command has the same syntax as the \bibliography command of L^{A}TEX.

\footbibliographystyle  \footbibliographystyle{⟨style⟩}

Defines the style of the foot bibliography. This command has the same syntax as

the \bibliographystyle command of L^{A}TEX.
\footcite  \footcite{⟨key⟩,⟨key⟩,. . . }

Puts the list of labels in the text and the text of the references at the bottom of the page. The text of each reference is inserted at most once in a citation unit, even if it is cited several times.

\footcite*  \footcite*{⟨key⟩,⟨key⟩,. . . }

Puts the list of labels in the text but does not put the reference at the bottom of the page.

\footnocite  \footnocite{⟨key⟩,⟨key⟩,. . . }

Puts the reference at the bottom of the page but puts nothing in the text.

Note: The main purpose of the commands \footcite* and \footnocite is to solve the problem of a \footcite occuring inside an environment where the reference will be lost (for instance in a minipage or tabular environment, in a \mbox, etc.). In this case, if the reference is not cited otherwise on the same page, it won’t show up at the bottom of the page. It suffices to add a \footnocite command just before or after this environment. The command \footcite{⟨key⟩} is more or less (but not completely) equivalent

     to \footcite*{⟨key⟩}\footnocite{⟨key⟩}.

2.3 customisation

\footbibliographyname The basename of the .aux and .bbl files used for the foot bibliography may be re-

defined by \footbibliographyname{⟨name⟩}. The default value is \jobname.fb^{1}

which causes footbib to read the bibliography from \jobname.fb.bbl and to use \jobname.fb.aux as an auxiliary file. This command may be used only in the preamble. The name supplied to \footbibliographyname must be different from the name of the main document.

\footcitelabel The list of citations in the text may not be typeset in one step as done by the

\putfootcitelabel
\footcitelistformat

\cite command of L^{A}TEX. The reason is that the command which creates the text of the foot reference must be inserted after each citation. The way (L^{A})TEX handles insertions makes them vanish if they occur in a box. Hence if the command which formats the list of citations puts them in a box, the text is lost and the references do not show up at the bottom of the page. All references could be inserted at once, either before or after the list of citations but if this list gets split across pages, the text of some references could show up on the wrong page. Hence the list is created one piece at a time and the text of the corresponding reference is inserted after each citation. The list of citation is created as follows:

1) start of list

2) for each citation: a) if it is not the first one, separator of citations

b) label of the reference, to which \footcitelabel is applied

c) insertion of the text of the reference

3) end of list

The separator of citations is made of two parts: ⟨sep_{1}⟩ and ⟨sep_{2}⟩. The command \putfootcitelabel is applied to each component of the list, excepted ⟨sep_{2}⟩ which is put as such. Typically, ⟨sep_{2}⟩ is a separator which may disappear at a line break, like a penalty or some spacing. That’s why \putfootcitelabel is not applied to it so that it won’t be put in a box. The effect is as follows:

     \putfootcitelabel{⟨start of list⟩}
     \putfootcitelabel{\footcitelabel{⟨label 1⟩}}

⟨insertion of the text of reference 1⟩

     \putfootcitelabel{⟨sep_{1}⟩}

⟨sep_{2}⟩

     \putfootcitelabel{\footcitelabel{label 2}}

⟨insertion of the text of reference 2⟩

     \putfootcitelabel{⟨sep_{1}⟩}

⟨sep_{2}⟩ ⋮

     \putfootcitelabel{\footcitelabel{label n}}

1\jobname is a primitive TEX command which holds the name of the main document.

⟨insertion of the text of reference n⟩

     \putfootcitelabel{⟨end of list⟩}

Each component of the list may be redefined as follows:

     \renewcommand*\footcitelabel[1]{. . . }
     \renewcommand*\putfootcitelabel[1]{. . . }

\footcitelistformat⟨start of list⟩⟨sep_{1}⟩⟨sep_{2}⟩⟨end of list⟩

Here are some examples of the variations allowed by this mechanism.

example 1: list of citations a la L^{A}TEX : [label 1, label 2, …]

     \renewcommand*\footcitelabel[1]{#1}
     \renewcommand*\putfootcitelabel[1]{#1}
     \footcitelistformat[,{\penalty1000\␣}]

example 2: ditto but the list may not be cut ⋮

     \footcitelistformat[,{\penalty10000\␣}]

example 3: the list is raised and the labels are separated only by commas, without any space: ^{[label 1,label 2,…]}

     \renewcommand*\footcitelabel[1]{#1}
     \renewcommand*\putfootcitelabel[1]{\textsuperscript{\normalfont#1}}
     \footcitelistformat[,{\penalty1000\relax}]

example 4: ditto, but no brackets around the list of labels: ^{label 1,label 2,…} ⋮

     \footcitelistformat{},{\penalty1000\relax}{}

example 5: [label 1], [label 2], …

     \renewcommand*\footcitelabel[1]{[#1]}
     \renewcommand*\putfootcitelabel[1]{#1}
     \footcitelistformat{},{\penalty1000\␣}{}

The default definitions are the ones of example 3 above.

\footbibskip The foot bibliography is separated from the rest of the page by a vertical skip \footbibrule of length \footbibskip in which a horizontal line is drawn by the command

\footbibrule. The length of the skip and the horizontal line may be redefined in the preamble by

     \setlength\footbibskip{. . . }
     \renewcommand\footbibrule{. . . }

CAUTION: \footbibrule must take zero vertical space.

\footreflabel The label of the foot reference is formated by the macro \footreflabel which takes the label as argument. It may be redefined by \renewcommand*\footreflabel[1]{… }.

\footrefstyle The label and the text of the reference at the bottom of the page are typeset in the style defined by the command \footrefstyle which may be redefined in the preamble by \renewcommad\footrefstyle{… }. The default definition is

\normalfont\footnotesize.

\footxref The options citeonce*(⟨unit⟩) tells footbib to replace the text of each reference but the first in each citation unit with a cross-reference to the last place where the full text of the reference appeared. The text of the cross-reference is generated by the command \footxref which takes two arguments: (1) the label and (2) the page of the last full citation. \footxref may be redefined in the preamble by

\renewcommand*\footxref[2]{. . . }.

3 Known and potential problems

• The foot bibliography is not sorted. The references appear at the bottom of the page in the order in which they are cited on the page.

• If a float is inserted at the bottom of the page, the foot bibliography is put above it, like footnotes.

• The result is not very nice in twocolumn mode. The references should be balanced between the two columns of the page (if there are two) or put in the right column like the package ftnright of Frank Mittelbach does for footnotes.

• footbib does not work with most packages which modify the output routine of

L^{A}TEX: multicol, ftnright, floatflt, wrapfig, etc.

• At present, the convergence is not proved. There is no guarantee that the references eventually find their place. However, footbib was used in large documents (several hundreds pages) and such a problem never occured.

• The references must not contain any verbatim environment. But \verb is allowed since it is sometime used to typeset filenames, url’s, etc.

• The braces must be balanced in the references, excepted the ones that might occur inside the argument of a \verb command. This implies that a reference may not contain say \hbox\bgroup… } which is otherwise correct in (L^{A})TEX.

• When references are numbered, the space between the label and the reference itself may be too large because the longest label is determined from the argument of \begin{thebibliography}{⟨longest label⟩} and its length is used for all references. If all references on a page have small numbers and the bibliography contains many references (say more than 100), this length is not reliable. The longest label should be deduced from the maximal number of foot references on a page, but this may not be known at the beginning of the document, at least at the first run. At the second run, the information could be deduces from what was written into the .aux file, provided the \nofiles command was not used (otherwise, the .aux file was not written). When per page numbering is used (option firstcite(page)), the longest label could also be simply initialised to 99 which is not too large and should be enough.

4 Implementation

4.1 Identification

1 ⟨∗package⟩

 2 \NeedsTeXFormat{LaTeX2e}
 3 \ProvidesPackage{footbib}[\filedate\space v\fileversion\space(E.Domenjoud)]

4.2 Initial setup

Some badly behaved packages (written for L^{A}TEX 2.09) change the catcodes before the beginning of the document and make some commands like \@for unusable. The catcodes needed in the definitions are set here and restored at the end of the package.

 4 \@makeother\`
 5 \edef\@tempa{\catcode\string`\string`=\the\catcode\string``\relax}
 6 \def\@tempb#1{\catcode`\noexpand#1\string=\the\catcode`#1\relax}
 7 \edef\@tempa{\@tempa
 8 \@tempb\:\@tempb\?\@tempb\=\@tempb\<\@tempb\>\@tempb\+\@tempb\-%
 9 \@tempb\.\@tempb\'\@tempb\~}
10 \expandafter\AtEndOfPackage\expandafter{\@tempa}
11 \@makeother\: \@makeother\? \@makeother\= \@makeother\< \@makeother\>
12 \@makeother\+ \@makeother\- \@makeother\. \@makeother\'
13 \catcode`\~=\active

4.3 Test of the output routine

If the L^{A}TEX 2ε format is more recent than the package, we test whether the output routine changed. If so, a warning is issued because the user might get unexpected results. The package should work with all previous versions of L^{A}TEX 2ε.

When docstrip is used to extract the package, this code is included only if the ‘checkoutput’ flag is used in addition to ‘package’.

14 ⟨∗checkoutput⟩

15 \@ifpackagelater{footbib}\fmtversion\@tempswafalse\@tempswatrue
16 \if@tempswa
17 \def\@tempa#1#2{\def\@tempb{#2}\ifx#1\@tempb\else\@tempswatrue\fi}
18 \@tempswafalse
19 \@tempa\@specialoutput{\ifnum\outputpenalty>-\@Mii\@doclearpage\else
20 \ifnum\outputpenalty<-\@Miii\ifnum\outputpenalty<-\@MM\deadcycles\z@
21 \fi\global\setbox\@holdpg\vbox{\unvbox\@cclv}\else\global\setbox
22 \@holdpg\vbox{\unvbox\@holdpg\unvbox\@cclv\setbox\@tempboxa\lastbox
23 \unskip}\@pagedp\dp\@holdpg\@pageht\ht\@holdpg\unvbox\@holdpg\@next
24 \@currbox\@currlist{\ifnum\count\@currbox>\z@\advance\@pageht\@pagedp
25 \ifvoid\footins\else\advance\@pageht\ht\footins\advance\@pageht\skip
26 \footins\advance\@pageht\dp\footins\fi\ifvbox\@kludgeins\ifdim\wd
27 \@kludgeins=\z@\advance\@pageht\ht\@kludgeins\fi\fi\@reinserts
28 \@addtocurcol\else\@reinserts\@addmarginpar\fi}\@latexbug\ifnum
29 \outputpenalty<\z@\if@nobreak\nobreak\else\addpenalty\interlinepenalty
30 \fi\fi\fi\fi}
31 \@tempa\@doclearpage{\ifvoid\footins\setbox\@tempboxa\vsplit\@cclv to\z@
32 \unvbox\@tempboxa\setbox\@tempboxa\box\@cclv\xdef\@deferlist{\@toplist
33 \@botlist\@deferlist}\global\let\@toplist\@empty\global\let\@botlist
34 \@empty\global\@colroom\@colht\ifx\@currlist\@empty\else\@latexerr

35 {Float(s) lost}\@ehb\global\let\@currlist\@empty\fi\@makefcolumn
36 \@deferlist\@whilesw\if@fcolmade\fi{\@opcol\@makefcolumn\@deferlist
37 }\if@twocolumn\if@firstcolumn\xdef\@dbldeferlist{\@dbltoplist
38 \@dbldeferlist}\global\let\@dbltoplist\@empty\global\@colht\textheight
39 \begingroup\@dblfloatplacement\@makefcolumn\@dbldeferlist\@whilesw
40 \if@fcolmade\fi{\@outputpage\@makefcolumn\@dbldeferlist}\endgroup\else
41 \vbox{}\clearpage\fi\fi\else\setbox\@cclv\vbox{\box\@cclv\vfil}\@makecol
42 \@opcol\clearpage\fi}
43 \@tempa\@makecol{\ifvoid\footins\setbox\@outputbox\box\@cclv\else\setbox
44 \@outputbox\vbox{\boxmaxdepth\@maxdepth\@tempdima\dp\@cclv\unvbox\@cclv
45 \vskip\skip\footins\color@begingroup\normalcolor
46 \footnoterule\unvbox\footins\color@endgroup}\fi\xdef\@freelist{\@freelist
47 \@midlist}\global\let\@midlist\@empty\@combinefloats\ifvbox\@kludgeins
48 \@makespecialcolbox\else\setbox\@outputbox\vbox to\@colht{\@texttop\dimen@
49 \dp\@outputbox\unvbox\@outputbox\vskip-\dimen@\@textbottom}\fi\global
50 \maxdepth\@maxdepth}\@tempa\@reinserts{\ifvoid\footins\else\insert\footins
51 {\unvbox\footins}\fi\ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins
52 }\fi}
53 \fi
54 \if@tempswa
55 \PackageError{footbib}{the output routine of LaTeX changed}
56 {The output routine of LaTeX changed since the current version of
57 `footbib'.\MessageBreak Since `footbib' patches this routine,
58 using it may produce unexpected\MessageBreak results. Send a mail to \space
59 Eric.Domenjoud@loria.fr \space to get a new version.\MessageBreak\MessageBreak
60 Type \space X <return> \space to quit or cross your fingers and
61 just type <return>.\MessageBreak}
62 \fi

63 ⟨/checkoutput⟩

4.4 Package Options

4.4.1 Initial code

\iffb@twoside \iffb@citeonce \iffb@pagecite \fb@chaptercite \fb@partcite \iffb@firstcite \iffb@pagenum \fb@chapternum \fb@partnum \iffb@xref \iffb@crossrefs \iffb@xcrossrefs \iffb@nosplit First we define some switches which record the user options. The switch

\iffb@twoside is initialised from the current value of \if@twoside because default global options are not passed to packages. If one says \documentclass{book} then the document is in twoside mode but the packages don’t know it.

64 \newif\iffb@twoside     \let\iffb@twoside\if@twoside
65 \newif\iffb@citeonce    \fb@citeoncefalse
66 \newif\iffb@pagecite    \fb@pagecitefalse
67 \let\fb@chaptercite\@empty
68 \let\fb@partcite\@empty
69 \newif\iffb@firstcite   \fb@firstcitefalse
70 \newif\iffb@pagenum     \fb@pagenumfalse
71 \let\fb@chapternum\@empty
72 \let\fb@partnum\@empty
73 \newif\iffb@xref        \fb@xreffalse
74 \newif\iffb@crossrefs   \fb@crossrefsfalse
75 \newif\iffb@xcrossrefs  \fb@xcrossrefsfalse
76 \newif\iffb@nosplit     \fb@nosplitfalse

\fb@checksec The macro \fb@checksec checks whether its first argument (a sectioning command) is defined. If so, the second argument (a list of command) is executed.

Otherwise an error is raised and the second argument is discarded. It is called while processing the options which must patch a sectioning command.

77 \newcommand\fb@checksec[2]{%
78 \ifx#1\@undefined
79  \PackageError{footbib}{Bad option `\CurrentOption'}%
80  {{footbib}: The current document class does not define `\string#1'}%
81 \else
82  #2%
83 \fi}

4.4.2 Declaration and processing of options

oneside twoside
84 \DeclareOption{oneside}{\fb@twosidefalse}
85 \DeclareOption{twoside}{\fb@twosidetrue}
firstcite 86 \DeclareOption{firstcite}{\fb@firstcitetrue}
87 \DeclareOption{firstcite(page)}{\fb@firstcitetrue\fb@pagenumtrue}
88 \DeclareOption{firstcite(chapter)}{\fb@firstcitetrue
89  \fb@checksec\chapter{\def\fb@chapternum{\fb@newnumunit}}}
90 \DeclareOption{firstcite(part)}{\fb@firstcitetrue
91  \fb@checksec\part{\def\fb@partnum{\fb@newnumunit}}}
92 \DeclareOption{firstcite(document)}{\fb@firstcitetrue}
citeonce citeonce*
93 \DeclareOption{citeonce}{\fb@citeoncetrue}
94 \DeclareOption{citeonce(page)}{\fb@pagecitetrue}
95 \DeclareOption{citeonce(chapter)}{\fb@citeoncetrue
96  \fb@checksec\chapter{\def\fb@chaptercite{\fb@newciteunit}}}
97 \DeclareOption{citeonce(part)}{\fb@citeoncetrue
98  \fb@checksec\part{\def\fb@partcite{\fb@newciteunit}}}
99 \DeclareOption{citeonce(document)}{\fb@citeoncetrue}
100 \DeclareOption{citeonce*}{\fb@citeoncetrue\fb@xreftrue}
101 \DeclareOption{citeonce*(chapter)}{%
102  \ExecuteOptions{citeonce(chapter)}\fb@xreftrue}
103 \DeclareOption{citeonce*(part)}{%
104  \ExecuteOptions{citeonce(part)}\fb@xreftrue}
105 \DeclareOption{citeonce*(document)}{\ExecuteOptions{citeonce*}}
crossrefs crossrefs* nocrossrefs
106 \DeclareOption{crossrefs}{\fb@crossrefstrue\fb@xcrossrefstrue}
107 \DeclareOption{crossrefs*}{\fb@crossrefstrue\fb@xcrossrefsfalse}
108 \DeclareOption{nocrossrefs}{\fb@crossrefsfalse\fb@xcrossrefsfalse}
split nosplit
109 \DeclareOption{split}{\fb@nosplitfalse}
110 \DeclareOption{nosplit}{\fb@nosplittrue}
111 \ProcessOptions*
112 \iffb@pagecite
113 \fb@citeoncefalse
114 \fb@xreffalse
115 \fi
116 \let\fb@firstcitetrue\@undefined  \let\fb@firstcitefalse\@undefined
117 \let\fb@citeoncetrue\@undefined   \let\fb@citeoncefalse\@undefined
118 \let\fb@pagecitetrue\@undefined   \let\fb@pagecitefalse\@undefined
119 \let\fb@xreftrue\@undefined       \let\fb@xreffalse\@undefined
120 \let\fb@crossrefstrue\@undefined  \let\fb@crossrefsfalse\@undefined
121 \let\fb@xcrossrefstrue\@undefined \let\fb@xcrossrefsfalse\@undefined

122 \let\fb@pagenumtrue\@undefined    \let\fb@pagenumfalse\@undefined
123 \let\fb@nosplittrue\@undefined    \let\fb@nosplitfalse\@undefined
124 \let\fb@checksec\@undefined

\chapter \part At the beginning of the document, the commands \chapter and \part are patched if necessary so that they start a new citation or numbering unit. This is achieved by adding in front of them the commands hold in \fb@chaptercite,

 \fb@chapternum, \fb@partcite and \fb@partnum defined while processing the

options. When a command is patched, a \clearpage is added so that a new unit always starts at the top of a page.

125 \AtBeginDocument{%
126 \begingroup
127  \def\@tempb#1{%
128  \ifx\@tempa\@empty\else
129  \edef\@tempa{\noexpand\clearpage\@tempa}%
130  \toks@\expandafter\expandafter\expandafter{\expandafter\@tempa#1}%
131  \xdef#1{\the\toks@}%
132  \fi}%
133  \let\fb@newnumunit\relax
134  \let\fb@newciteunit\relax
135  \edef\@tempa{\fb@partcite\fb@partnum}%
136  \@tempb\part
137  \edef\@tempa{\fb@chaptercite\fb@chapternum}%
138  \@tempb\chapter
139 \endgroup}

4.5 Customisation

4.5.1 Basename of the files used for the foot bibliography

\footbibliographyname The basename of the .aux and .bbl files is produced by the command \fb@bibname

which is redefined by a call to \footbibliographyname in the preamble.

\footbibliographyname first checks that its argument is different from \jobname. Since the characters in \jobname have catcode 12 (other), the first two commands below yield the argument of \footbibliographyname also with catcodes 12 so that it may be compared to \jobname.

140 \newcommand*\footbibliographyname[1]{%
141 \edef\@tempa{#1}%
142 \edef\@tempa{\expandafter\strip@prefix\meaning\@tempa}%
143 \edef\@tempb{\jobname}%
144 \ifx\@tempa\@tempb
145  \PackageError{footbib}{Bad argument `#1'\on@line}%
146  {The name supplied to `\string\footbibliographyname' must be
147  different from the name\MessageBreak
148  of the current document to avoid conflicts with the standard
149  bibliography.\MessageBreak\MessageBreak
150  Type \space X <return> \space to quit.\MessageBreak}%
151 \else
152  \xdef\fb@bibname{#1}%
153 \fi}
154 \@onlypreamble\footbibliographyname
155 \footbibliographyname{\jobname.fb}

4.5.2 Layout of the list of citations in the text

\footcitelabel \putfootcitelabel \footcitelistformat \fb@putfootcitelabel \fb@citestart \fb@citesep \fb@citeend Here we define the layout parameters for the list of citations in the text.

We define an additional macro \fb@putfootcitelabel which is essentially

\putfootcitelabel. Only \scriptspace and \mathsurround are set to 0 pt

in case \putfootcitelabel involves some math. The modified version is applied to all components of the citation list but \fb@citeend to which the standard version is applied. This avoids unwanted spacing inside the list while allowing some additional spacing after it. The macro \footcitelistformat defines the macros

\fb@citestart, \fb@citesep and \fb@citeend used by \fb@cite to build the

list of citations in the text.

156 \newcommand*\footcitelabel[1]{#1}
157 \newcommand*\putfootcitelabel[1]{\textsuperscript{\normalfont#1}}
158 \newcommand*\fb@putfootcitelabel[1]{%
159 {\m@th\scriptspace\z@\putfootcitelabel{#1}}}
160 \newcommand*\footcitelistformat[4]{%
161 \def\fb@citestart{\fb@putfootcitelabel{#1}}%
162 \def\fb@citesep{\fb@putfootcitelabel{#2}#3}%
163 \def\fb@citeend{\putfootcitelabel{#4}}}%
164 \footcitelistformat[,{\penalty\@m}]

4.5.3 Appearance of the foot bibliography

\footbibskip \footbibrule \footrefstyle \footreflabel \footxref \fb@ins Here are defined all the layout parameters for the foot bibliography. \fb@ins is the

insertion number for the foot bibliography. It is not really the right place for its declaration but it is needed to define the user definable parameter \footbibskip. By the way we set all the parameters for these insertions: 1 to 1 magnification and no limit on the height of the foot bibliography.

165 \newinsert\fb@ins
166 \count\fb@ins=1000
167 \AtBeginDocument{\dimen\fb@ins=\textheight}
168 \newcommand\footbibskip{\skip\fb@ins}
169 \footbibskip=\bigskipamount
170 \newcommand\footbibrule{\kern-3\p@\hrule\kern 2.6\p@}% \hrule is .4pt high
171 \newcommand\footrefstyle{\normalfont\footnotesize}
172 \newcommand*\footreflabel[1]{[#1]}
173 \newcommand*\footxref[2]{See~#1~on page~#2.}

4.6 Some useful definitions

\fb@vedef \fb@doactive The keys of the references must be read and written more or less verbatim. Since some packages make some characters permanently active, the catcodes should be changed before reading or writing a key or a list of keys and reset afterward. Unfortunately, in some situations this is not possible because the catcodes have already been attached to the characters. One solution is to scan the key and replace each active character with its non-active equivalent but this is fairly costly and does not work if some active character have been let equal to a non-active one or is hidden in a command occuring in the (list of) key(s). Another solution is to use \meaning to get a verbatim copy of the keys but this does not allow them to contain commands like in \foocite{\mylistofcitations} The method used here consists in redefining the active characters so that their expansion produces the same character with a catcode 12 (other). Then an expansion of the key yields a verbatim copy of it. This mechanism allows the list of keys to contain itself commands which expand in the normal way. All characters which may both be active in the document and appear in the key of a reference must be treated in this way. Since BibTEX allows almost any character in a key, it is safer to consider all characters which may be active in a document. No matter that they indeed are. The command \dospecials usually contains, among other, all such characters, each one escaped and preceded by \do. The L^{A}TEX 2ε kernel defines \dospecials as

   \def\dospecials{\do\␣\do\\\do\{\do\}\do\$\do\&\do\#\do\^\do\_\do\%\do\~}

Any package which define new special characters should add them to this list.

An active character is needed to start with. Since ~ was made active at the beginning of the package, it may be safely used for this purpose.

174 \newcommand*\fb@doactive[1]{\lccode`~=`#1\lowercase{\def~{\string~}}}
175 \newcommand*\fb@vedef[2]{%
176 \begingroup
177  \let\do\fb@doactive \dospecials
178  \edef\@tempa{\endgroup\def\noexpand#1{#2}}%
179 \@tempa}
\fb@namexdef  \fb@namexdef is similar to the \@namedef command of L^{A}TEX but uses \xdef

instead of \def

180 \newcommand*\fb@namexdef[1]{\expandafter\xdef\csname#1\endcsname}

\fb@auxout \fb@writeaux \fb@auxout is the auxiliary file used to record information about citations and as

input to BibTEX. The commands \footbibliographystyle and \footbibliography

do an immediate \write to this file. However, since these commands may be used in the preamble, this file might not yet be open for writing at the time they are used. We must wait until the end of the preamble before opening the auxiliary file to give the user a chance to define its name with \footbibliographyname. Therefore, we define the macro \fb@writeaux which postpones the write until the beginning of the document. It is somehow a delayed immediate write which means that the write will be performed as soon as possible, i.e. as soon as the auxiliary file is open for writing. This definition is temporary and will be changed to a true immediate write by \AtBeginDocument.

181 \newwrite\fb@auxout
182 \newcommand*\fb@writeaux[2]{%
183 \AtBeginDocument{%
184  \if@filesw
185  \immediate\write\fb@auxout{\string#1{#2}}%
186  \fi}}

4.7 Units handling

\fb@numunit \fb@citeunit \fb@xrefunit We handle 3 counters: the numbering unit counter (\fb@numunit), the citation unit counter (\fb@citeunit) and the cross-referencing unit counter (\fb@xrefunit). This last counter is meaningful only if a citeonce* option was used. It essentially counts pages in oneside mode and double pages in twoside mode. However, if the citation unit is a chapter (resp. a part), each \chapter (resp. \part) command also increments this counter.

187 \newcount\fb@numunit  \fb@numunit\@ne
188 \newcount\fb@citeunit \fb@citeunit\@ne
189 \newcount\fb@xrefunit \fb@xrefunit\@ne
\fb@refciteunit \fb@refxrefunit \fb@refnumunit \fb@refpage \fb@theunits \fb@getunits \fb@get@units The macros \fb@ref. . . unit and \fb@refpage hold the units and the page of the

current citation.

190 \newcommand\fb@theunits{%
191 {\the\fb@citeunit}{\the\fb@xrefunit}{\the\fb@numunit}{\thepage}}
192 \newcommand*\fb@getunits[1]{%
193 \ifx#1\relax
194  \xdef#1{{\fb@key}\fb@theunits}%
195 \fi
196 \expandafter\fb@get@units#1}
197 \newcommand*\fb@get@units[5]{%
198 \def\fb@refciteunit{#2}%
199 \def\fb@refxrefunit{#3}%
200 \def\fb@refnumunit{#4}%
201 \def\fb@refpage{#5}}%
\fb@newciteunit \fb@newnumunit The macros \fb@newciteunit and \fb@newnumunit are called by the patched

versions of \part or \chapter to start a new citation or numbering unit. The patched sectioning unit also forces a page break so that a unit always starts at the top of a page.

202 \newcommand\fb@newciteunit{%
203 \global\advance\fb@citeunit\@ne
204 \global\advance\fb@xrefunit\@ne}
205 \newcommand\fb@newnumunit{\global\advance\fb@numunit\@ne}

\fb@checkpage \fb@prevpage Each time the page counter is incremented, i.e. at the top of a new page, the macro \fb@checkpage updates the units counters if necessary. We first check whether the current page is a right page. In oneside mode, it is never the case. In twoside mode, it is the case if its number is \fb@prevpage + 1 and is odd, where \fb@prevpage is a counter which holds the number of the last shiped out page. If the number of the current page is not \fb@prevpage + 1, it means that either the user has manually changed the page counter or the page numbering has changed. In both case, we consider the current page as a left page. If the current page is a right page, we do nothing. Otherwise, it may start a new unit^{2} and we update the unit counters.

206 \newcount\fb@prevpage \fb@prevpage\@ne
207 \newcommand*\fb@checkpage{%
208 \@tempswatrue
209 \iffb@twoside
210  \global\advance\fb@prevpage\@ne
211  \ifnum\fb@prevpage=\c@page
212  \ifodd\c@page
213  \@tempswafalse
214  \fi
215  \fi
216 \fi
217 \if@tempswa

2In fact, a right page may also start a new unit if the user used for instance the firstcite(chapter) option and the current page starts a new chapter. But in this case, the units are updated by the \chapter command.

The counter \fb@numunit is incremented if the switch \iffb@pagenum is true, i.e. the option firstcite(page) was used.

218  \iffb@pagenum
219  \global\advance\fb@numunit\@ne
220  \fi

The switch \iffb@citeonce is true iff a citeonce or citeonce* option was used. In this case, the \fb@citeunit counter is incremented by the \chapter or \part command. We just increment \fb@xrefunit in case citeonce* was used. If \iffb@citeonce is false, the citation unit is the (double) page and we increment \fb@citeunit. Since no citeonce* option was used, we do not need to handle

\fb@xrefunit.
221  \iffb@citeonce
222  \global\advance\fb@xrefunit\@ne
223  \else
224  \global\advance\fb@citeunit\@ne
225  \fi
226 \fi
227 \global\fb@prevpage\c@page}

\c@fb%checkpage The next definition is a trick to make the macro \fb@checkpage execute each time the page counter is incremented. Each counter ⟨cnt⟩ declared by

\@addtoreset{⟨cnt⟩}{page} is reset to 0 by \global\c@⟨cnt⟩\z@ when the

counter page is incremented. We define a macro \c@xxx which looks like a counter and we say \@addtoreset{xxx}{page}. To be sure that the user will never define a counter named xxx, we name our macro \c@fb%checkpage. The name of the associated pseudo counter is fb%checkpage that the user may normally not type. Each time the page counter is incremented, \global\c@fb%checkpage\z@ is executed. The macro \c@fb%checkpage starts with an assignment (\count@\z@) which uses the \global and ends with a counter (\count@) which gobbles the following \z@. Since we change the catcode of %, it may not be used for comments below.

228 \catcode`\%=11
229 \newcommand\c@fb%checkpage{\count@\z@
230 \fb@checkpage
231 \count@}
232 \@addtoreset{fb%checkpage}{page}
233 \catcode`\%=14

5 Commands to handle the references

\fb@refcount The counter \fb@refcount holds the number of the last numbered reference. It is reset to 0 at the beginning of each numbering unit.

234 \newcount\fb@refcount

\fb@lbl \fb@txt The token registers \fb@lbl and \fb@txt always holds the label and the text of the current reference.

235 \newtoks\fb@lbl
236 \newtoks\fb@txt

\fb@setref ; \fb@getref ; \fb@r.⟨key ⟩ \fb@setref stores the current value of the token registers \fb@lbl and \fb@txt

in the macro \fb@r.⟨key⟩ where ⟨key⟩ is the key of the current reference. This key is always stored in the macro \fb@key. \fb@setref is called each time a component of a reference changes: when it is first read at the beginning of the document, and when the dynamic label or the text of the reference has been updated. \fb@getref does the converse: given a key, it updates \fb@lbl and

\fb@txt from \fb@r.⟨key⟩.
237 \newcommand\fb@setref{%
238 \fb@namexdef{fb@r.\fb@key}{{\the\fb@lbl}{\the\fb@txt}}}
239 \newcommand\fb@getref{\afterassignment\fb@txt\fb@lbl}

\fb@setlbl \fb@getlbl \fb@setlbl updates the dynamic label of a reference. \fb@getlbl gets the label after calling \fb@setlbl if necessary to update it.

240 \newcommand\fb@setlbl{%
241 \global\advance\fb@refcount\@ne
242 \edef\@tempa{{\fb@refnumunit}{\the\fb@refcount}}%
243 \global\fb@lbl\expandafter{\expandafter\fb@getlbl\@tempa}%
244 \fb@setref
245 \the\fb@refcount}
246 \newcommand*\fb@getlbl[2]{\ifnum\fb@refnumunit=#1{#2}\else\fb@setlbl\fi}
\fb@settxt \fb@gettxt  \fb@settxt and \fb@gettxt are similar to \fb@setlbl and \fb@getlbl but up-

date the text of the reference instead of the label. When \fb@settxt is called, the label must have been expanded just before so that it has been updated if necessary. Then \fb@lbl has either the form {⟨static label⟩} the form \fb@getlbl{⟨current numunit⟩}{⟨dynamic label⟩}. In the later case, the test at the beginning of \fb@getlbl must succeed so that in both cases, the first command in \fb@settxt below assigns the label to \toks@.

247 \newcommand\fb@settxt[1]{%
248 \toks@=\the\fb@lbl
249 \toks@\expandafter\expandafter\expandafter{\expandafter
250  \footreflabel\expandafter{\the\toks@}}%
251 \edef\@tempa{{\fb@refciteunit}{\the\toks@}{\fb@refpage}}%
252 \global\fb@txt\expandafter{\expandafter\fb@gettxt\@tempa{#1}}%
253 \fb@setref
254 #1}
255 \newcommand\fb@gettxt[4]{%
256 \ifnum\fb@refciteunit=#1\relax
257  \footxref{#2}{#3}%
258 \else
259  \fb@settxt{#4}%
260 \fi}

5.1 Commands to handle the foot bibliography

\footbibliography \footbibliographystyle  \footbibliography and \footbibliographystyle are the commands which de-

fine the bibliography file and the bibliography style. They just write their argument to the auxiliary file. If they are used in the preamble, the \fb@writeaux macro in use is the delayed one. The write will actually take place at the beginning of the document.

261 \newcommand\footbibliography{\fb@writeaux\bibdata}
262 \newcommand\footbibliographystyle{\fb@writeaux\bibstyle}

\fb@refnotfound When a reference is not found by L^{A}TEX, it is replaced by a default one generated by the command \fb@refnotfound which takes the key of the reference as an argument and expands to the default label and the default text.

263 \newcommand*\fb@refnotfound[1]{%
264 {?}{*** ERROR: citation `{\normalfont\bfseries#1}' undefined ***}}

5.1.1 Creation of the foot references

\footcite \footcite* \footnocite \fb@@cite \fb@optlbl \iffb@lbl \iffb@txt All 3 citation commands \footcite, \footcite* and \footnocite actually call

the same macro \fb@cite. Before this call, they just set the flags \iffb@lbl and \iffb@txt according to whether the label and the text of the reference are requested. The settings are as follows:

                              \iffb@lbl  \iffb@txt
                 \footcite  true  true
                 \footcite*  true  false
                 \footnocite  false  true

In addition, \footcite calls \fb@@cite to get the optional argument which is put

in \fb@optlbl.
265 \newif\iffb@lbl
266 \newif\iffb@txt
267 \DeclareRobustCommand\footcite{%
268 \fb@lbltrue\@ifstar{\fb@txtfalse\fb@@cite}{\fb@txttrue\fb@@cite}}
269 \newcommand\footnocite{\fb@lblfalse\fb@txttrue\fb@cite}
270 \newcommand*\fb@@cite[1][\@nil]{%
271 \def\fb@optlbl{#1}%
272 \ifx\fb@optlbl\@nnil
273  \let\fb@optlbl\relax
274 \else
275  \def\fb@optlbl{\fb@putfootcitelabel{, #1}}%
276 \fi
277 \fb@cite}

\fb@cite \fb@cite is the macro which handles the list of citations. It calls \fb@xcite to produce the actual label and insert the text of each individual reference.

278 \newcommand*\fb@cite[1]{%
279 \fb@vedef\fb@keys{#1}%
280 \iffb@lbl
281  \fb@citestart
282  \def\fb@citea{\let\fb@citea\fb@citesep}%
283 \fi

If the list of citation is empty, the \@for loop is not entered and no warning is issued. Therefore, we check for this now.

284 \ifx\fb@keys\@empty
285  \PackageWarning{footbib}{Empty citation on page \thepage}%
286 \fi
287 \@for\fb@key:=\fb@keys\do{%
288  \iffb@lbl\fb@citea\fi
289  \fb@xcite
290  \ifx\fb@deferredcite\@empty\else
291  \begingroup

292  \fb@lblfalse
293  \expandafter\fb@xnocite\fb@deferredcite\@nil
294  \endgroup
295  \fi}%
296 \iffb@lbl\fb@optlbl\fb@citeend\fi}
\fb@xfootcite \fb@deferredcite The macro \fb@xfootcite is a replacement for the \cite command of L^{A}TEX

inside a foot reference if the crossrefs or crossrefs* option was used. In

both cases, \fb@xfootcite performs a \footcite*. If the crossrefs option

was used, in addition, \fb@xfootcite adds globally the list of citation keys to the list \fb@deferredcite. After the insertion of the current reference has been completed, a \footnocite will be performed for each key in the list. The format of this list is ⟨key⟩,…,⟨key⟩, (the trailing comma makes it easier to handle than ⟨key⟩,…,⟨key⟩ and allows to distinguish between an empty list and a list containing only an empty element). This list is initially empty.

297 \newcommand\fb@xfootcite[2][\@nil]{%
298 \footcite*[#1]{#2}%
299 \iffb@xcrossrefs
300  \fb@vedef\fb@keys{#2}%
301  \xdef\fb@deferredcite{\fb@keys,\fb@deferredcite}%
302 \fi}
303 \let\fb@deferredcite\@empty

\fb@xnocite After the insertion of the current reference has been completed, if some deferred cross-references are present, the macro \fb@xnocite is called. It calls \fb@xcite with \iffb@lbl=false to insert the text of the cross-references if necessary. This might produce more deferred cross-references which will be added to

\fb@deferredcite.
304 \def\fb@xnocite#1,#2\@nil{%
305 \gdef\fb@deferredcite{#2}%
306 \def\fb@key{#1}%
307 \fb@xcite
308 \ifx\fb@deferredcite\@empty
309  \let\@tempa\@gobble
310 \else
311  \let\@tempa\fb@xnocite
312 \fi
313 \expandafter\@tempa\fb@deferredcite\@nil}
\fb@xcite The macro \fb@xcite is called both by \fb@cite and \fb@xnocite to handle

each individual citation. It writes to the auxiliary file the information about the citation, puts the label in the text if requested and put the text of the reference on the page if necessary. If the reference is not found, it issues a warning.

The first command in \fb@xcite removes any space in front of the key. \@empty is inserted after the key to prevent an error in case it is empty.

If the key is empty or the reference is undefined, the L^{A}TEX command

\G@refundefinedtrue is used to set the switch \if@refundefined which indi-

cates that some reference was undefined.

314 \newcommand\fb@xcite{%
315 \edef\fb@key{\expandafter\@firstofone\fb@key\@empty}%
316 \ifx\fb@key\@empty
317  \PackageWarning{footbib}{Empty citation on page \thepage}%

318  \G@refundefinedtrue
319 \else
320  \@ifundefined{fb@r.\fb@key}%
321  {\G@refundefinedtrue
322  \PackageWarning{footbib}{%
323  Citation `\fb@key' on page \thepage \space undefined}%
324  \fb@getref\fb@refnotfound\fb@key\fb@setref}%
325  {\fb@getref\@nameuse{fb@r.\fb@key}}%
326  \fb@bibcite
327  \iffb@lbl\fb@putfootcitelabel{\footcitelabel{\the\fb@lbl}}\fi

The text of the reference is inserted if requested (\iffb@txt=true) and either it has not yet been inserted in the current citation unit, or a citeonce* option was used and the last citation was on another (double) page.

328  \iffb@txt
329  \expandafter\let\expandafter\@tempa\csname
330  fb@fn\fb@key.\fb@refciteunit\endcsname
331  \@tempswatrue
332  \ifx\@tempa\relax\else
333  \iffb@xref
334  \ifx\@tempa\fb@refxrefunit
335  \@tempswafalse
336  \fi
337  \else
338  \@tempswafalse
339  \fi
340  \fi
341  \if@tempswa
342  \fb@namexdef{fb@fn\fb@key.\fb@refciteunit}{\fb@refxrefunit}%
343  \fb@citefn
344  \fi
345  \fi
346 \fi}

\fb@bibcite \fb@lastrefnumunit \fb@citecount The command \fb@bibcite writes to the auxiliary file all the informations about the current citation: the key, the units, and the page. It also resets to 0 the counter \fb@refcount if the numbering unit changed between the last reference and the current one. This counter is used to number the references. The counter \fb@lastrefnumunit holds the numbering unit of the last reference. The counter \fb@citecount holds the number of the current citation.

347 \newcount\fb@citecount
348 \newcount\fb@lastrefnumunit \fb@lastrefnumunit\m@ne
349 \newcommand\fb@bibcite{%
350 \fb@writeaux\citation\fb@key
351 \global\advance\fb@citecount\@ne
352 \expandafter\fb@getunits\csname fb@c.\the\fb@citecount\endcsname
353 \ifnum\fb@refnumunit=\fb@lastrefnumunit\else
354  \global\fb@lastrefnumunit\fb@refnumunit\relax
355  \global\fb@refcount\z@
356 \fi
357 \if@filesw
358  \write\fb@auxout\expandafter{\expandafter\string\expandafter
359  \bibcite\expandafter{\fb@key}\fb@theunits}%
360 \fi}

\fb@citefn \fb@citefn inserts the text of the foot reference. It is called only if the reference was not already cited in the same citation unit or a citeonce* option was used. The code is mainly borrowed from the footnotes handling in L^{A}TEX.

361 \newcommand\fb@citefn{%
362 \insert\fb@ins{%
363  \color@begingroup
364  \reset@font\footrefstyle
365  \interlinepenalty\iffb@nosplit\@M\else\interfootnotelinepenalty\fi
366  \splittopskip 1.2\ht\strutbox
367  \splitmaxdepth \dp\strutbox
368  \floatingpenalty \@MM
369  \hsize\columnwidth
370  \@parboxrestore
371  \ifx\newblock\@undefined\let\newblock\relax\fi
372  \iffb@crossrefs\let\cite\fb@xfootcite\fi
373  \@tempdima\fb@lblwidth
374  \advance\@tempdima\labelsep
375  \leftskip\@tempdima
376  \setbox\@tempboxa\hbox{\footreflabel{\the\fb@lbl}}%
377  \hskip-\@tempdima
378  \ifdim\wd\@tempboxa<\fb@lblwidth
379  \hbox to\fb@lblwidth{\unhbox\@tempboxa\hfil}%
380  \else
381  \box\@tempboxa
382  \fi
383  \hskip\labelsep
384  \rule\z@{1.2\ht\strutbox}\ignorespaces\the\fb@txt\@finalstrut\strutbox
385  \color@endgroup}}

5.2 AtBeginDocument, AtEndDocument

At the beginning of the document, we read the bibliography file and record all the references. This is memory consuming but the only alternative is to read again the bibliography file for each \footcite command which would be much slower. We must wait until the beginning of the document to give the user a chance to redefine \fb@bibname through \footbibliographyname. The preamble of the bibliography is executed once for all when the bibliography is read. After recording the bibliography, we read the .aux file (if it exists) and record the parameters (citation and numbering unit, page, etc.) of all citations as determined during the previous run. The parameters of the n^{th} citation are recorded in the macro

\fb@c.⟨n⟩.
386 \AtBeginDocument{%

Save the current value of \thebibliography and redefine it

387 \let\fb@savethebibliography\thebibliography
388 \let\thebibliography\fb@thebibliography
389 \let\fb@thebibliography\@undefined

Read the bbl file. This executes the preamble, and if a thebibliography environment is found, sets \fb@lblwidth to the length of the longest label and records all references. \fb@lblwidth is initialised with a negative value which allows us to detect afterward whether a thebibliography environment was present.

390 \global\fb@lblwidth=-\maxdimen

391 \fb@refcount\z@
392 \@input{\fb@bibname.bbl}%

Restore the standard value of \thebibliography

393 \let\thebibliography\fb@savethebibliography
394 \let\fb@savethebibliography\@undefined

Assign a default value to \fb@lblwidth in case the bbl file was not found or contained no thebibliography environment.

395 \ifdim\fb@lblwidth<\z@
396  \settowidth\fb@lblwidth
397  {\footrefstyle\footreflabel{\expandafter\@firstoftwo\fb@refnotfound{?}}}%
398 \fi

\bibcite ; \fb@c.⟨num ⟩ Then read the auxiliary file and record the parameters of each citation

399 \fb@citecount\z@
400 \begingroup
401  \let\citation\@gobble \let\bibstyle\@gobble \let\bibdata\@gobble
402  \def\bibcite#1#2#3#4#5{%
403  \advance\fb@citecount\@ne
404  \fb@vedef\fb@key{#1}%
405  \fb@namexdef{fb@c.\the\fb@citecount}{{\fb@key}{#2}{#3}{#4}{#5}}}%
406  \@input{\fb@bibname.aux}%
407 \endgroup

\fb@auxout Prepare the auxiliary file for writing

408 \if@filesw
409  \immediate\openout\fb@auxout=\fb@bibname.aux
410  \immediate\write\fb@auxout{\relax}%
411 \fi

\fb@writeaux Finally, define a non delayed version of \fb@writeaux.

412 \renewcommand*\fb@writeaux[2]{%
413  \if@filesw
414  \immediate\write\fb@auxout{\string#1{#2}}%
415  \fi}%

416 }

\fb@thebibliography \fb@lblwidth The macro \fb@thebibliography records the length of the longest label in the

⟨dimen⟩ register \fb@lblwidth and then scans the bibliography and stores each reference in a global macro \fb@r.⟨key⟩ where ⟨key⟩ is the key of the reference. The references are read one token at a time so that we may detect \verb commands even if they are hidden in groups.

417 \newdimen\fb@lblwidth
418 \newcommand*\fb@thebibliography[1]{%

We open still a new group to prevent our definitions to conflict with macros that

 might be used by \end{thebibliography}. We let \endthebibliography equal

to \endgroup so that it closes this group.

419 \begingroup
420 \let\endthebibliography\endgroup

Record the size of the longest label

421 \settowidth\dimen@{\footrefstyle\footreflabel{#1}}%
422 \ifdim\dimen@>\fb@lblwidth\global\fb@lblwidth=\dimen@\fi

\@bracelevel \@bgrouplineno \@on@line \@eat Some definitions necessary to read the bibliography entries. All these definitions are local since the command \begin{thebibliography} opened a new group. They will be cancelled when \end{thebibliography} is executed. The names of global definitions have the form \fb@… while the names of local definitions simply start with \@… We reuse as much as possible existing global names so that we do not use memory unnecessarily. the \@bracelevel counter keeps track of groups nesting while reading the bibliography. The \@bgrouplineno counter holds the number of the input line where the current group started. It is used for error messages. \@on@line is similar to the \on@line command of the L^{A}TEX 2ε kernel but also shows the name of the current file.

423 \newcount\@bracelevel
424 \newcount\@bgrouplineno
425 \def\@on@line{\on@line\space of \fb@bibname.bbl}%
426 \def\@eat{\let\@tempa= }%

\@bgroup \@egroup \bgroup \egroup \bgroup and \egroup are redefined so that we may distinguish between explicit and implicit begin or end group characters.

427 \let\@bgroup{%
428 \let\@egroup}%
429 \let\bgroup\relax
430 \let\egroup\relax

\@actlet \@actlet\⟨char⟩⟨cmd⟩ makes ⟨char⟩ active and let it equal to ⟨cmd⟩.

431 \def\@actlet##1{%
432  \catcode`##1=\active
433  \begingroup\lccode`~=`##1\lowercase{\endgroup\let~}}%
\@noitemerror  \@noitemerror is called to raise an error if anything is seen between \begin{thebibliography}

and the first \bibitem. If the user types ⟨return⟩ at the prompt, the next token is swallowed and the processing goes on.

434 \def\@noitemerr{%
435  \PackageError{footbib}{Missing \string\bibitem\@on@line}\@empty
436  \afterassignment\@readbib\@eat}%
\@errifbraces  \@errifbraces⟨cmp⟩ compares \@bracelevel with 0 using ⟨cmp⟩ (= or >) and

raises an error if the test succeeds.

437 \def\@errifbraces##1{%
438  \ifnum\@bracelevel##1\z@
439  {\ifx##1>\let\inputlineno\@bgrouplineno\fi
440  \PackageError{footbib}{%
441  \ifx##1>Unmatched begin\else Extra end\fi-group
442  character\@on@line}\@empty}%
443  \fi}%

Now come all the commands which read and handle the tokens.

\@readbib \@xreadbib These macros read the next token and take the appropriate action.

444 \def\@readbib{\futurelet\@tok\@xreadbib}%
445 \def\@xreadbib{%
446  \ifx\@tok\@sptoken\let\@tempa\@readsp
447  \else\ifx\@tok\par\let\@tempa\@readpar
448  \else\ifx\@tok\bibitem\let\@tempa\@endbibitem

449  \else\ifx\@tok\end\let\@tempa\@checkendbib
450  \else\if@newlist\let\@tempa\@noitemerr
451  \else\ifx\@tok\@bgroup\let\@tempa\@eat\afterassignment\@begingroup
452  \else\ifx\@tok\@egroup\let\@tempa\@eat\afterassignment\@endgroup
453  \else\ifx\@tok\verb\let\@tempa\relax
454  \else\let\@tempa\@addtotxt
455  \fi\fi\fi\fi\fi\fi\fi\fi\@tempa}%
\bibitem \@bibitem \@lbibitem The macro \bibitem is called if the next token is \bibitem. It calls \@lbibitem

or \@bibitem depending on whether a label is provided or not. If no label is provided, \@bibitem provides one. The definition of this macro depends on the switch \iffb@firstcite which is true iff a firstcite option was used. If so, a dynamic label is provided. Otherwise, a static label is provided which is the current value of the counter \fb@refcount.

456 \def\bibitem{%
457  \@errifbraces>%
458  \@newlistfalse
459  \@ifnextchar[\@lbibitem\@bibitem}%
460 \iffb@firstcite
461  \def\@bibitem{\@lbibitem[\fb@setlbl]}%
462 \else
463  \def\@bibitem{%
464  \advance\fb@refcount\@ne
465  \expandafter\@lbibitem\expandafter[\the\fb@refcount]}%
466 \fi
467 \def\@lbibitem[##1]##2{%
468  \fb@lbl{{##1}}%
469  \fb@vedef\fb@key{##2}%
470  \fb@txt{}%
471  \let\@lastsptok\@empty
472  \@inlabeltrue
473  \@readbib}%

\@checkendbib The macro \@checkendbib is called when the next token is \end. It reads the argument of \end and checks whether it is thebibliography. If so it calls \@endbibitem to terminate the current reference (if any) and reinserts \end{thebibliography} which will terminate the bibliography.

474 \def\@checkendbib\end##1{%
475  \def\@tempa{##1}\def\@tempb{thebibliography}%
476  \ifx\@tempa\@tempb
477  \def\@tempa{\@endbibitem\end{##1}}%
478  \else
479  \if@newlist
480  \let\@tempa\@noitemerr
481  \else
482  \def\@tempa{\@addtotxt{\end{##1}}}%
483  \fi
484  \fi\@tempa}%

\@endbibitem The macro \@endbibitem terminates the current reference (if any) and calls \fb@setref which stores it in a macro. If the switch \iffb@xref is true, i.e a citeonce* option was used, \@endbibitem adds to the text of the reference the command \fb@settxt which will modify it dynamically.

485 \def\@endbibitem{%
486  \if@newlist\else
487  \@errifbraces>%
488  \iffb@xref
489  \fb@txt\expandafter{\expandafter\fb@settxt\expandafter{\the\fb@txt}}%
490  \fi
491  \fb@setref
492  \fi}%

\@addtotxt The macro \@addtotxt adds to the text of the reference so far, first the last space token (⟨space⟩ or \par) and then its argument.

493 \long\def\@addtotxt##1{%
494  \fb@txt\expandafter\expandafter\expandafter
495  {\expandafter\the\expandafter\fb@txt\@lastsptok##1}%
496  \let\@lastsptok\@empty
497  \@inlabelfalse
498  \@readbib}%

\@readsp \@readpar \@lastsptok The space tokens ⟨space⟩ and \par are handled in a delayed way. They are first recorded in a single place (\@lastsptok), so that each one overrides the previous one. The most recent one is added to the text of the reference each time \@addtotxt is called. This mechanism discards any space preceding a \par token and also the \par which occurs generally at the end of each reference.

499 \expandafter\def\expandafter\@readsp\space{%
500  \if@inlabel\else\let\@lastsptok\space\fi
501  \@readbib}%
502 \def\@readpar\par{%
503  \if@inlabel\else\def\@lastsptok{\par}\fi
504  \@readbib}%
\@begingroup \@endgroup The macros \@begingroup and \@endgroup are called when a begin- or end-group

character is seen. \@begingroup opens a new group and increments the counter \@bracelevel. It also records the number of the input line which may be used later for error reporting. \@endgroup closes the group, which restores the previous value of \@bracelevel, and calls \@addtotxt to add the group to the text of the reference so far.

505 \def\@begingroup{%
506  \@bgroup
507  \advance\@bracelevel\@ne
508  \@bgrouplineno=\inputlineno
509  \fb@txt{}%
510  \let\@lastsptok\@empty
511  \@readbib}%
512 \def\@endgroup{%
513  \@errifbraces=%
514  \edef\@tempa{\@egroup\noexpand\@addtotxt{{\the\fb@txt\@lastsptok}}}%
515  \@tempa}%

\verb \@sverb We provide special support for the \verb command. The following code is essentially borrowed from the L^{A}TEX 2ε kernel. Just we let the active characters equal to \relax so that they are not expanded.

516 \def\verb{%
517  \begingroup

First make all special characters ‘other’

518  \let\do\@makeother \dospecials

Avoid ligatures

519  \def\do####1{\@actlet####1\relax}\verbatim@nolig@list

An end of line character in the argument of \verb is an error.

520  \@actlet\^^M\verb@eol@error
521  \@ifstar{\@sverb*}{\@actlet\ \relax\@sverb\@empty}}%
522 \def\@sverb##1##2{%
523  \@actlet##2\verb@egroup

Read the argument of \verb.

524  \edef\@tempa{\noexpand\verb##1\noexpand~\iffalse}\fi}%

\verb@egroup Normal termination of \verb. The ~ must be protected against expansion because we are still inside the \edef started by \@sverb.

525 \def\verb@egroup{%
526  \noexpand~\iffalse{\fi}%
527  \expandafter\endgroup\expandafter\@addtotxt\expandafter{\@tempa}}%

\verb@eol@error The macro \verb@eol@error is called if an end of line character occurs before the normal termination of \verb. Unlike it is done in the L^{A}TEX 2ε kernel, we do not terminate the \verb because the most frequent case is when BibTEX breaks the argument of \verb because the line is too long. The closing delimiter will generally be found on the next line.

528 \def\verb@eol@error{\iffalse{\fi}%
529  \GenericError\@empty{LaTeX Error:
530  \noexpand\verb ended by end of line\@on@line}\@gobble%
531  {The argument of \string\verb\@on@line\space contains
532  an end of line.\MessageBreak
533  Type \space X <return> \space to quit.\MessageBreak}%

We try to recover from error in case the user types ⟨return⟩ at the prompt. We where defining \@tempa which contains now \verb?~… where ? stands for * or nothing.

534  \toks@\expandafter{\@tempa}%
535  \edef\@tempa{\the\toks@\iffalse}\fi}%

Some initialisation before starting to read the bibliography.

536 \@bracelevel\z@
537 \@newlisttrue
538 \@inlabeltrue

And finally start to read the bibliography. This is the end of \fb@thebibliography

539 \@readbib}

At the end of the document, we first do a \clearpage to be sure that all the writes have been performed. Then we close the auxiliary file and finally read it to check whether any change occured between the previous run and the current one. If so, we issue a warning.

540 \AtEndDocument{%
541 \clearpage
542 \if@filesw

543  \immediate\closeout\fb@auxout
544  \begingroup
545  \let\citation\@gobble \let\bibstyle\@gobble \let\bibdata\@gobble
546  \def\bibcite#1#2#3#4#5{%
547  \advance\fb@citecount\@ne
548  \fb@vedef\@tempa{{#1}{#2}{#3}{#4}{#5}}%
549  \expandafter\ifx\csname fb@c.\the\fb@citecount\endcsname
550  \@tempa\else\@tempswatrue\fi}%
551  \fb@citecount\z@
552  \@tempswafalse
553  \input\fb@bibname.aux
554  \if@tempswa
555  \PackageWarning{footbib}{Bibliography not yet stable. Rerun
556  LaTeX\@gobble}%
557  \fi
558  \endgroup
559 \fi}

5.3 Output routine

 We redefine the macros \@specialoutput, \@doclearpage, \@makecol and

\@reinserts used by the output routine of L^{A}TEX so that we may insert the foot bibliography. The code is just a patch to the macros defined in the L^{A}TEX 2ε kernel.

\@specialoutput If a foot bibliography is present, \@specialoutput must add to the height of the page the height plus depth of the foot bibliography and the length of the skip above it.

560 \def\@specialoutput{%
561 \ifnum \outputpenalty>-\@Mii
562  \@doclearpage
563 \else
564  \ifnum \outputpenalty<-\@Miii
565  \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi
566  \global \setbox\@holdpg \vbox {\unvbox\@cclv}%
567  \else
568  \global \setbox\@holdpg \vbox{%
569  \unvbox\@holdpg
570  \unvbox\@cclv
571  \setbox\@tempboxa \lastbox
572  \unskip}%
573  \@pagedp \dp\@holdpg
574  \@pageht \ht\@holdpg
575  \unvbox \@holdpg
576  \@next\@currbox\@currlist{%
577  \ifnum \count\@currbox>\z@
578  \advance \@pageht \@pagedp
579  \ifvoid\footins \else
580  \advance \@pageht \ht\footins
581  \advance \@pageht \skip\footins
582  \advance \@pageht \dp\footins
583  \fi

footbib addition

584  \ifvoid\fb@ins\else
585  \advance\@pageht\ht\fb@ins
586  \advance\@pageht\skip\fb@ins
587  \advance\@pageht\dp\fb@ins
588  \fi

589  \ifvbox \@kludgeins
590  \ifdim \wd\@kludgeins=\z@
591  \advance \@pageht \ht\@kludgeins
592  \fi
593  \fi
594  \@reinserts
595  \@addtocurcol
596  \else
597  \@reinserts
598  \@addmarginpar
599  \fi}%
600  \@latexbug
601  \ifnum \outputpenalty<\z@
602  \if@nobreak
603  \nobreak
604  \else
605  \addpenalty \interlinepenalty
606  \fi
607  \fi
608  \fi
609 \fi}

\@doclearpage The test at the beginning of \@doclearpage has been modified so that it checks that both footnotes and the foot bibliography are empty.

610 \def \@doclearpage {%

footbib modification

611 %  \ifvoid\footins
612 \@tempswatrue
613 \ifvoid\footins\else\@tempswafalse\fi
614 \ifvoid\fb@ins\else\@tempswafalse\fi
615 \if@tempswa

616  \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
617  \setbox\@tempboxa\box\@cclv
618  \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
619  \global \let \@toplist \@empty
620  \global \let \@botlist \@empty
621  \global \@colroom \@colht
622  \ifx \@currlist\@empty
623  \else
624  \@latexerr{Float(s) lost}\@ehb
625  \global \let \@currlist \@empty
626  \fi
627  \@makefcolumn\@deferlist
628  \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
629  \if@twocolumn

630  \if@firstcolumn
631  \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
632  \global \let \@dbltoplist \@empty
633  \global \@colht \textheight
634  \begingroup
635  \@dblfloatplacement
636  \@makefcolumn\@dbldeferlist
637  \@whilesw\if@fcolmade \fi{\@outputpage\@makefcolumn\@dbldeferlist}%
638  \endgroup
639  \else
640  \vbox{}\clearpage
641  \fi
642  \fi
643 \else
644  \setbox\@cclv\vbox{\box\@cclv\vfil}%
645  \@makecol\@opcol
646  \clearpage
647 \fi}

\@makecol In addition to footnotes (if any), \@makecol must add the foot bibliography to the page. It is added immediately below the footnotes. The test at the beginning of \@makecol has been modified in the same way as in \@doclearpage

648 \def \@makecol {%

footbib modification

649 %  \ifvoid\footins
650 \@tempswatrue
651 \ifvoid\footins\else\@tempswafalse\fi
652 \ifvoid\fb@ins\else\@tempswafalse\fi
653 \if@tempswa

654  \setbox\@outputbox \box\@cclv
655 \else
656  \setbox\@outputbox \vbox {%
657  \boxmaxdepth \@maxdepth
658  \@tempdima\dp\@cclv
659  \unvbox \@cclv
660  \vskip-\@tempdima

footbib addition

661  \ifvoid\footins \else

662  \vskip \skip\footins
663  \color@begingroup
664  \normalcolor
665  \footnoterule
666  \unvbox \footins
667  \color@endgroup

footbib addition

668  \fi
669  \ifvoid\fb@ins\else
670  \vskip\skip\fb@ins
671  \color@begingroup

672  \normalcolor
673  \footbibrule
674  \unvbox\fb@ins
675  \color@endgroup
676  \fi

677 }%

678 \fi
679 \xdef\@freelist{\@freelist\@midlist}%
680 \global \let \@midlist \@empty
681 \@combinefloats
682 \ifvbox\@kludgeins
683  \@makespecialcolbox
684 \else
685  \setbox\@outputbox \vbox to\@colht {%
686  \@texttop
687  \dimen@ \dp\@outputbox
688  \unvbox \@outputbox
689  \vskip -\dimen@
690  \@textbottom}%
691 \fi
692 \global \maxdepth \@maxdepth}

\@reinserts The macro \@reinsert was modified to reinsert also the foot bibliography after float processing.

693 \def\@reinserts{%
694 \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi

footbib addition

695 \ifvoid\fb@ins\else\insert\fb@ins{\unvbox\fb@ins}\fi

696 \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi}
697 \endinput

698 ⟨/package⟩

Index

Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code lines where the entry is used.

Symbols

\@actlet . . . . . . . . . \underline{431}

 \@addtotxt . . . . . . . \underline{493}
 \@begingroup . . . . . . \underline{505}

\@bgroup . . . . . . . . . \underline{427}

 \@bgrouplineno . . . . \underline{423}

\@bibitem . . . . . . . . \underline{456}

 \@bracelevel . . . . . . \underline{423}
 \@checkendbib . . . . . \underline{474}
 \@doclearpage . . . . . \underline{610}

\@eat . . . . . . . . . . . . \underline{423}
\@egroup . . . . . . . . . \underline{427}

                           \@endbibitem . . . . . . \underline{485}
                           \@endgroup . . . . . . . \underline{505}
                           \@errifbraces . . . . . \underline{437}
                           \@lastsptok . . . . . . . \underline{499}
                           \@lbibitem . . . . . . . \underline{456}

\@makecol . . . . . . . . \underline{648}

                           \@noitemerror . . . . . \underline{434}

\@on@line . . . . . . . . \underline{423}

\@readbib . . . . . . . . \underline{444}
\@readpar . . . . . . . . \underline{499}
\@readsp . . . . . . . . . \underline{499}

                                                    \@reinserts . . . . . . . \underline{693}
                                                    \@specialoutput . . . \underline{560}

\@sverb . . . . . . . . . . \underline{516}

                                                    \@xreadbib . . . . . . . \underline{444}

B \bgroup . . . . . . . . . . \underline{427} \bibcite . . . . . . . . . \underline{399} \bibitem . . . . . . . . . \underline{456}

C

\c@fb%checkpage . . . \underline{228}

\chapter . . . . . . . . . \underline{125} citation unit … 1, 2, 13 citeonce (option) …

. . . . . . . 2, 14, \underline{93} citeonce* (option) . .

2, 6, 14, 19, 23, \underline{93}

cross-referencing unit 13 crossrefs (option) . .

. . . . . . . 3, 17, \underline{106}

crossrefs* (option) .

. . . . . . . 3, 17, \underline{106}

D

\dospecials . . . . . . . 12

dynamic label . . 3, 16, 22

E

\egroup . . . . . . . . . . \underline{427} environments:filecontents

filecontents . . . . 2

environments:thebibliography

thebibliography . 2

environments:verbatim

verbatim . . . . . . . 7

F

\fb@@cite . . . . . . . . \underline{265}

\fb@auxout . . . \underline{181}, \underline{408}
\fb@bibcite . . . . . . . \underline{347}

\fb@c.⟨num⟩ 352, \underline{399}, 549

\fb@chaptercite . . . \underline{64}
\fb@chapternum . . . . \underline{64}
\fb@checkpage . . . . . \underline{206}
\fb@checksec . . . . . . \underline{77}

\fb@cite . . . . . . . . . \underline{278}

\fb@citecount . . . . . \underline{347}
\fb@citeend . . . . . . . \underline{156}
\fb@citefn . . . . . . . \underline{361}
\fb@citesep . . . . . . . \underline{156}
\fb@citestart . . . . . \underline{156}
\fb@citeunit . . . . . . \underline{187}
\fb@deferredcite . . \underline{297}
\fb@doactive . . . . . . \underline{174}

\fb@fn⟨key⟩.⟨num⟩ . .

. . . . . . . . 330, \underline{342}

\fb@get@units . . . . . \underline{190}
\fb@getlbl . . . . . . . \underline{240}
\fb@getref . . . . . . . \underline{237}

\fb@gettxt . . . . . . . \underline{247}
\fb@getunits . . . . . . \underline{190}

\fb@ins . . . . . . . . . . \underline{165}

\fb@lastrefnumunit . \underline{347}

\fb@lbl . . . . . . . . . . \underline{235}

\fb@lblwidth . . . . . . \underline{417}
\fb@namexdef . . . . . . \underline{180}
\fb@newciteunit . . . \underline{202}
\fb@newnumunit . . . . \underline{202}
\fb@numunit . . . . . . . \underline{187}
\fb@optlbl . . . . . . . \underline{265}
\fb@partcite . . . . . . \underline{64}
\fb@partnum . . . . . . . \underline{64}
\fb@prevpage . . . . . . \underline{206}
\fb@putfootcitelabel

. . . . . . . . . . . \underline{156}

\fb@r.⟨key⟩ \underline{237}, 320, 325

\fb@refciteunit . . . \underline{190}
\fb@refcount . . . . . . \underline{234}
\fb@refnotfound . . . \underline{263}
\fb@refnumunit . . . . \underline{190}
\fb@refpage . . . . . . . \underline{190}
\fb@refxrefunit . . . \underline{190}
\fb@setlbl . . . . . . . \underline{240}
\fb@setref . . . . . . . \underline{237}
\fb@settxt . . . . . . . \underline{247}
\fb@thebibliography  \underline{417}
\fb@theunits . . . . . . \underline{190}

\fb@txt . . . . . . . . . . \underline{235} \fb@vedef . . . . . . . . \underline{174}

\fb@writeaux . . \underline{181}, \underline{412}

\fb@xcite . . . . . . . . \underline{314}

\fb@xfootcite . . . . . \underline{297}
\fb@xnocite . . . . . . . \underline{304}
\fb@xrefunit . . . . . . \underline{187}
filecontents (environ-

ment) . . . . . . . . 2 firstcite (option) . .

. . . . . 3, 14, 22, \underline{86} floatflt (package) … 6

\footbibliography 4, \underline{261}
\footbibliographyname

. . . . . . . . . 4, \underline{140}

\footbibliographystyle

. . . . . . . . . 4, \underline{261}

\footbibrule . . . . 6, \underline{165}
\footbibskip . . . . 6, \underline{165}

\footcite . . . . . . 4, \underline{265}

\footcite* . . . . . 4, \underline{265}
\footcitelabel . . 4, \underline{156}
\footcitelistformat

. . . . . . . . . 4, \underline{156}

\footnocite . . 4, 17, \underline{265}
\footreflabel . . . 6, \underline{165}

                          \footrefstyle . . . 6, \underline{165}

\footxref . . . . . . 6, \underline{165} ftnright (package) … 6

I

                          \iffb@citeonce . . . . \underline{64}
                          \iffb@crossrefs . . . \underline{64}
                          \iffb@firstcite . . . \underline{64}

\iffb@lbl . . . . . . . . \underline{265}

                          \iffb@nosplit . . . . . \underline{64}
                          \iffb@pagecite . . . . \underline{64}
                          \iffb@pagenum . . . . . \underline{64}
                          \iffb@twoside . . . . . \underline{64}

\iffb@txt . . . . . . . . \underline{265}

                          \iffb@xcrossrefs . . \underline{64}
                          \iffb@xref . . . . . . . \underline{64}

L

label dynamic . 3, 16, 22 static …. 3, 15, 22

M multicol (package) … 6

N

                          nocrossrefs (option)

. . . . . . . . . 3, \underline{106} nosplit (option) . . 3, \underline{109} numbering unit . 1, 3, 13

O oneside (option) … 2, \underline{84} options:

                             citeonce* . . . . . .

. 2, 6, \underline{9}, 14, 19, 23

                             citeonce . . 2, \underline{9}, 14
                             crossrefs* . 3, \underline{10}, 17
                             crossrefs . . 3, \underline{10}, 17
                             firstcite 3, \underline{9}, 14, 22
                             nocrossrefs . . . 3, \underline{10}

nosplit . . . . . . 3, \underline{10} oneside . . . . . . 2, \underline{9} split . . . . . . . . 3, \underline{10} twoside …. 2, \underline{9}, 9

P

packages:

                             floatflt . . . . . . . 6
                             ftnright . . . . . . . 6
                             multicol . . . . . . . 6

wrapfig . . . . . . . . 6 \part . . . . . . . . . . . . \underline{125}

                          \putfootcitelabel 4, \underline{156}

S

split (option) … 3, \underline{109} static label …. 3, 15, 22

T

thebibliography (envi-

ronment) . . . . . 2 twoside (option) . 2, 9, \underline{84}

U

unit citation . . 1, 2, 13 cross-referencing 13 numbering 1, 3, 13

V \verb . . . . . . . . . . 7, \underline{516}

                                                   \verb@egroup . . . . . . \underline{525}
                                                   \verb@eol@error . . . \underline{528}

verbatim (environment) . . . . . . . . 7

W wrapfig (package) … 6