A refer Macro Package
refer is a preprocessor for the nroff/troff
text formatter found on most UNIX systems. It is used
to cite bibliographic
references -- including journals, books, reports, and
of publication -- in documents. On AIX 3.2, however,
package dealing with the refer output is not available
This article presents a macro package (see Listing 1),
based on the
macro package, that processes the output produced by
refer scans its input for keywords surrounded by brackets,
refer searches its database for an entry which
contains the keyword and replaces the three lines with
a label. The
label is generated by refer and a set of nroff/troff
string and macro definitions. When invoked with flag
refer replaces the above three lines with the label
and appends all bibliographic data to the end of its
input, to be
printed at the end of the document. If refer encounters
keyword sequences without any intervening text, it generates
comprising the entire bibliography.
The database used by refer for keyword lookup is an
file. Each line contains a key-letter preceeded by a
(%) and its associated data (see Figure 1).
Only relevant key-letters should be supplied and all
%A should be supplied just once.
refer places the string definitions and macro invocations
shown in Figure 2 in its output. If these macros are
the output generated by refer is completely ignored.
The package uses the register "r?" to distinguish
list mode, where all references are printed at the end
of the document,
and footnote mode, where all references are printed
The file biblio (Figure 3) contains the database refer
uses when processing the sample input file text in Figure
4. The formatting
command is shown in Figure 5. In the command the "-p"
specifies the database file name and the "-l"
refer to generate labels from the author's last name
of publication. The resultant output is shown in Figure
(Listing 1) contains the string and macro definitions.
IBM88a. IBM. Text Formatting Guide (IBM RT
PC). SC23-0810-0, 1988.
IBM93a. IBM. Text Formatting Reference (IBM
RISC System/6000). SC23-2453-00, 1993.
About the Author
Thomas Richter has studied mathematics and Computer
at the University of Ulm, Germany. He has worked on
various UNIX platforms
as a software developer and C/C++ as main programming
projects include compiler construction, device drivers,
programming. He has also administered various UNIX machines
last 8 years. He has worked for IBM UK since January
He can be reached at email@example.com.