.\" Like TP, but if specified indent is more than half
.\" the current line-length - indent, use the default indent.
.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
.\" The BSD man macros can't handle " in arguments to font change macros,
.\" so use \(ts instead of ".
.TH REFER 1 "19 February 1993" "Groff Version 1.08"
refer \- preprocess bibliographic references for groff
.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
.el .RB "[\ " "\\$1" "\ ]"
.RI [\ filename \|.\|.\|.\ ]
This file documents the GNU version of
which is part of the groff document formatting system.
except that lines between
are interpreted as citations,
are interpreted as commands about how citations are to be processed.
Each citation specifies a reference.
The citation can specify a reference that is contained in
a bibliographic database by giving a set of keywords
that only that reference contains.
Alternatively it can specify a reference by supplying a database
A combination of these alternatives is also possible.
can produce a mark in the text.
This mark consists of some label which can be separated from
the text and from other labels in various ways.
For each reference it also outputs
commands that can be used by a macro package to produce a formatted
reference for each citation.
must therefore be processed using a suitable macro package.
macros are both suitable.
The commands to format a citation's reference can be output immediately after
or the references may be accumulated,
and the commands output at some later point.
If the references are accumulated, then multiple citations of the same
reference will produce a single formatted reference.
The interpretation of lines between
as commands is a new feature of GNU refer.
Documents making use of this feature can still be processed by
Unix refer just by adding the lines
to the beginning of the document.
to ignore everything between
The effect of some commands can also be achieved by options.
These options are supported mainly for compatibility with Unix refer.
It is usually more convenient to use commands.
lines so that filenames and line numbers in messages produced
it also interprets lines beginning with
so that filenames and line numbers in the messages and
lines that it produces will be accurate even if the input has been
preprocessed by a command such as
Most options are equivalent to commands
(for a description of these commands see the
no-label-in-text; no-label-in-reference
label "(A.n|Q) ', ' (D.y|D)"; bracket-label " (" ) "; "
These options are equivalent to the following commands with the
addition that the filenames specified on the command line are
processed as if they were arguments to the
command instead of in the normal way:
annotate X AP; no-label-in-reference
The following options have no equivalent commands:
Print the version number.
Don't recognize lines beginning with
.SS Bibliographic databases
The bibliographic database is a text file consisting of records
separated by one or more blank lines.
Within each record fields start with a
at the beginning of a line.
Each field has a one character name that immediately follows the
It is best to use only upper and lower case letters for the names
The name of the field should be followed by exactly one space,
and then by the contents of the field.
Empty fields are ignored.
The conventional meaning of each field is as follows:
If the name contains a title such as
it should be separated from the last name by a comma.
There can be multiple occurrences of the
The order is siginificant.
It is a good idea always to supply an
For an article that is part of a book, the title of the book
The place (city) of publication.
The year should be specified in full.
If the month is specified, the name rather than the number of the month
should be used, but only the first three letters are required.
It is a good idea always to supply a
if the date is unknown, a value such as
For an article that is part of a book, the name of an editor of the book.
Where the work has editors and no authors,
the names of the editors should be given as
should be appended to the last author.
US Government ordering number.
For an article in a journal, the name of the journal.
Keywords to be used for searching.
This is usually printed at the end of the reference.
A range of pages can be specified as
The name of the author, if the author is not a person.
This will only be used if there are no
For an article in a book or journal,
this should be the title of the article.
Volume number of the journal or book.
if there is more than one occurrence of a particular field in a record,
only the last such field will be used.
If accent strings are used, they should follow the charater to be accented.
macro must be used with the
Accent strings should not be quoted:
The format of a citation is
components need be specified.
component says to search the bibliographic databases for a reference
that contains all the words in
It is an error if more than one reference if found.
components specifies additional fields to replace or supplement
those specified in the reference.
When references are being accumulated and the
then additional fields should be specified only on the first
occasion that a particular reference is cited,
and will apply to all citations of that reference.
component specifies strings to be used to bracket the label instead
of the strings specified in the
If either of these components is non-empty,
the strings specified in the
command will not be used;
this behavior can be altered using the
Note that leading and trailing spaces are significant for these components.
non-alphanumeric characters each of which modifies the treatment
of this particular citation.
Unix refer will treat these flags as part of the keywords and
so will ignore them since they are non-alphanumeric.
The following flags are currently recognized:
This says to use the label specified by the
instead of that specified by the
If no short label has been specified, the normal label will be used.
Typically the short label is used with author-date labels
and consists of only the date and possibly a disambiguating letter;
is supposed to be suggestive of a numeric type of label.
with the first string specified in the
with the second string specified in the
One advantages of using the
flags rather than including the brackets in
you can change the style of bracket used in the document just by changing the
Another advantage is that sorting and merging of citations
will not necessarily be inhibited if the flags are used.
If a label is to be inserted into the text,
it will be attached to the line preceding the
If there is no such line, then an extra line will be inserted before the
line and a warning will be given.
There is no special notation for making a citation to multiple references.
Just use a sequence of citations, one for each reference.
Don't put anything between the citations.
The labels for all the citations will be attached to the line preceding
The labels may also be sorted or merged.
See the description of the
label expression, and of the
.B abbreviate-label-ranges
A label will not be merged if its citation has a non-empty
However, the labels for a citation using the
immediately followed by a citation using the
even though the first citation's
(If you wish to prevent this just make the first citation's
Commands are contained between lines starting with
Recognition of these lines can be prevented by the
line is recognized any accumulated references are flushed out.
nor anything between them
Commands are separated by newlines or
introduces a comment that extends to the end of the line
(but does not conceal the newline).
Each command is broken up into words.
Words are separated by spaces or tabs.
that is not followed by another
the word extends to the end of the line.
A line can be continued by ending it with
this works everywhere except after a
that is marked with \*n has an associated negative command
that undoes the effect of
command specifies that references should not be sorted.
The negative commands take no arguments.
In the following description each argument must be a single word;
is used for a single upper or lower case letter naming a field;
is used for a sequence of such letters;
are used for a non-negative numbers;
is used for an arbitrary string;
is used for the name of a file.
.Tp \w'\fBabbreviate-label-ranges'u+2n
.BI abbreviate\*n\ fields\ string1\ string2\ string3\ string4
Abbreviate the first names of
An initial letter will be separated from another initial letter by
These default to a period followed by a space.
In a hyphenated first name,
the initial of the first part of the name will be separated from the hyphen by
this defaults to a period.
No attempt is made to handle any ambiguities that might
result from abbreviation.
Names are abbreviated before sorting and before
.BI abbreviate-label-ranges\*n\ string
Three or more adjacent labels that refer to consecutive references
will be abbreviated to a label consisting
of the first label, followed by
followed by the last label.
This is mainly useful with numeric labels.
is omitted it defaults to
Accumulate references instead of writing out each reference
Accumulated references will be written out whenever a reference
after all input files hve been processed,
.BI annotate\*n\ field\ string
print it at the end of the reference as a paragraph preceded by the line
is omitted it will default to
is also omitted it will default to
Only one field can be an annotation.
.BI articles\ string \fR\|.\|.\|.
are definite or indefinite articles, and should be ignored at the beginning of
are recognized as articles.
.BI bibliography\ filename \fR\|.\|.\|.
Write out all the references contained in the bibliographic databases
.BI bracket-label\ string1\ string2\ string3
In the text, bracket each label
bracket-label \e*([. \e*(.] ", "
even when followed by a character other than space or newline.
.BI database\ filename \fR\|.\|.\|.
Search the bibligraphic databases
exists, then it will be searched instead;
each index can cover multiple databases.
.BI date-as-label\*n\ string
is a label expression that specifies a string with which to replace the
field after constructing the label.
subsection for a description of label expressions.
This command is useful if you do not want explicit labels in the
reference list, but instead want to handle any necessary
disambiguation by qualifying the date in some way.
The label used in the text would typically be some combination of the
In most cases you should also use the
date-as-label D.+yD.y%a*D.-y
would attach a disambiguating letter to the year part of the
The default database should be searched.
This is the default behavior, so the negative version of
this command is more useful.
refer determines whether the default database should be searched
on the first occasion that it needs to do a search.
command must be given before then,
in order to be effective.
When the reference is read,
no string definitions for
.BI et-al\*n\ string\ m\ n
expressions in label expressions.
If the number of authors needed to make the author sequence
and the total number of authors is
authors will be replaced by
and interpret the contents as commands.
.BI join-authors\ string1\ string2\ string3
This says how authors should be joined together.
When there are exactly two authors, they will be joined with
When there are more than two authors, all but the last two will
and the last two authors will be joined with
is also omitted it will also default to
join-authors " and " ", " ", and "
will restore the default method for joining authors.
When outputting the reference,
to be the reference's label.
This is the default behavior; so the negative version
of this command is more useful.
For each reference output a label in the text.
The label will be separated from the surrounding text as described in the
This is the default behavior; so the negative version
of this command is more useful.
is a label expression describing how to label each reference.
.BI separate-label-second-parts\ string
When merging two-part labels, separate the second part of the second
label from the first label with
See the description of the
In the text, move any punctuation at the end of line past the label.
It is usually a good idea to give this command unless you are using
superscripted numbers as labels.
Reverse the fields whose names
Each field name can be followed by a number which says
how many such fields should be reversed.
If no number is given for a field, all such fields will be reversed.
.BI search-ignore\*n\ fields
While searching for keys in databases for which no index exists,
.BI search-truncate\*n\ n
characters of keys to be given.
In effect when searching for a given key
words in the database are truncated to the maximum of
and the length of the key.
.BI short-label\*n\ string
is a label expression that specifies an alternative (usually shorter)
flag is given in the citation.
When using author-date style labels, the identity of the author
or authors is sometimes clear from the context, and so it
may be desirable to omit the author or authors from the label.
command will typically be used to specify a label containing just
a date and possibly a disambiguating letter.
Sort references according to
References will automatically be accumulated.
should be a list of field names, each followed by a number,
indicating how many fields with the name should be used for sorting.
can be used to indicate that all the fields with the name should be used.
can be used to indicate the references should be sorted using the
subsection describes the concept of a tentative label.)
.B sort-adjacent-labels\*n
Sort labels that are adjacent in the text according to their
position in the reference list.
This command should usually be given if the
.B abbreviate-label-ranges
or if the label expression contains a
This will have no effect unless references are being accumulated.
Label expressions can be evaluated both normally and tentatively.
The result of normal evaluation is used for output.
The result of tentative evaluation, called the
is used to gather the information
that normal evaluation needs to disambiguate the label.
Label expressions specified by the
commands are not evaluated tentatively.
Normal and tentative evaluation are the same for all types
The description below applies to normal evaluation,
except where otherwise specified.
is omitted, it defaults to 1.
All the authors joined as specified by the
The whole of each author's name will be used.
However, if the references are sorted by author
(that is the sort specification starts with
then authors' last names will be used instead, provided that this does
and also an initial subsequence of the authors may be used
instead of all the authors, again provided that this does not
The use of only the last name for the
is considered to be ambiguous if
there is some other reference,
authors of the references are the same,
authors are not the same,
authors' last names are the same.
A proper initial subsequence of the sequence
of authors for some reference is considered to be ambiguous if there is
a reference with some other sequence of authors which also has
that subsequence as a proper initial subsequence.
When an initial subsequence of authors is used, the remaining
authors are replaced by the string specified by the
this command may also specify additional requirements that must be
met before an initial subsequence can be used.
tentatively evaluates to a canonical representation of the authors,
such that authors that compare equally for sorting purpose
will have the same representation.
The serial number of the reference formatted according to the character
The serial number of a reference is 1 plus the number of earlier references
with same tentative label as this reference.
These expressions tentatively evaluate to an empty string.
If there is another reference with the same tentative label as
otherwise an empty string.
It tentatively evaluates to an empty string.
upper or lower case letters or digits of
Troff special characters (such as
count as a single letter.
Accent strings are retained but do not count towards the total.
converted to caps and small caps.
reversed so that the last name is first.
with first names abbreviated.
Note that fields specified in the
command are abbreviated before any labels are evaluated.
is useful only when you want a field to be abbreviated in a label
before the year, or the whole of
if it does not contain a year.
after the year, or an empty string if
except that if the last character of
then it will be replaced by
otherwise an empty string.
.IB expr1 ? expr2 : expr3
The label is in two parts, which are separated by
Two adjacent two-part labels which have the same first part will be
merged by appending the second part of the second label onto the first
label separated by the string specified in the
.B separate-label-second-parts
command (initially, a comma followed by a space); the resulting label
will also be a two-part label with the same first part as before
merging, and so additional labels can be merged into it.
Note that it is permissible for the first part to be empty;
this maybe desirable for expressions used in the
The above expressions are listed in order of precedence
have the same precedence.
Each reference starts with a call to the macro
will be defined to be the label for this reference,
There then follows a series of string definitions,
field contains a range of pages.
number registers are set to 1 according as the
fields end with one of the characters
number register will be set to 1 if the
string contains more than one name.
The reference is followed by a call to the
The first argument to this macro gives a number representing
the type of the reference.
If a reference contains a
field, it will be classified as type 1,
otherwise if it contains a
otherwise if it contains a
otherwise it will be type 0.
The second argument is a symbolic name for the type:
Groups of references that have been accumulated
command are preceded by a call to the
macro and followed by a call to the
.Tp \w'\fB/usr/share/dict/papers/Ind'u+2n
.B /usr/share/dict/papers/Ind
expressions are ignored inside