BSD 4_3_Reno release
[unix-history] / usr / src / share / doc / usd / 29.refer / refer.bib
CommitLineData
b0f148cf
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)refer.bib 6.1 (Berkeley) 6/2/86
b0f148cf 6.\"
eac78bb3
KM
7.EH 'USD:29-%''Refer \(em A Bibliography System'
8.OH 'Refer \(em A Bibliography System''USD:29-%'
b0f148cf
KM
9.if t .nr PD .5v
10.nr LL 6.5i
11.nr FL 6i
12. \" AP - abstract paragraph
13.de AP
14.sp \\n(PDu
15.ti +\\n(PIu
16..
eac78bb3 17.\".RP
b0f148cf
KM
18.TL
19Refer \(em A Bibliography System
20.AU
21Bill Tuthill
22.AI
23Computing Services
24University of California
25Berkeley, CA 94720
26.AB
27\fBRefer\fP is a bibliography system that supports data entry,
28indexing, retrieval, sorting, runoff, convenient citations,
29and footnote or endnote numbering.
30This document assumes you know how to use some Unix editor,
31and that you are familiar with the \fBnroff/troff\fP text formatters.
32.AP
33The \fBrefer\fP program is a preprocessor for \fBnroff/troff,\fP
34like \fBeqn\fP and \fBtbl,\fP
35except that it is used for literature citations,
36rather than for equations and tables.
37Given incomplete but sufficiently precise citations,
38\fBrefer\fP finds references in a bibliographic database.
39The complete references are formatted as footnotes,
40numbered, and placed either at the bottom of the page,
41or at the end of a chapter.
42.AP
43A number of ancillary programs make \fBrefer\fP easier to use.
44The \fBaddbib\fP program is for creating and extending
45the bibliographic database;
46\fBsortbib\fP sorts the bibliography by author and date,
47or other selected criteria;
48and \fBroffbib\fP runs off the entire database,
49formatting it not as footnotes,
50but as a bibliography or annotated bibliography.
51.AP
52Once a full bibliography has been created,
53access time can be improved by making an index
54to the references with \fBindxbib\fP.
55Then, the \fBlookbib\fP program can be used to quickly retrieve
56individual citations or groups of citations.
57Creating this inverted index will speed up \fBrefer,\fP
58and \fBlookbib\fP will allow you to verify that a citation
59is sufficiently precise to deliver just one reference.
60.AE
61.\"end cover
62.SH
63Introduction
64.XS
65Introduction
66.XE
67.PP
68Taken together, the \fBrefer\fP programs constitute
69a database system for use with variable-length information.
70To distinguish various types of bibliographic material,
71the system uses labels composed of upper case letters,
72preceded by a percent sign and followed by a space.
73For example, one document might be given this entry:
74.DS
75%A Joel Kies
76%T Document Formatting on Unix Using the -ms Macros
77%I Computing Services
78%C Berkeley
79%D 1980
80.DE
81Each line is called a field,
82and lines grouped together are called a record;
83records are separated from each other by a blank line.
84Bibliographic information follows the labels,
85containing data to be used by the \fBrefer\fP system.
86The order of fields is not important,
87except that authors should be entered
88in the same order as they are listed on the document.
89Fields can be as long as necessary,
90and may even be continued on the following line(s).
91.PP
92The labels are meaningful to \fBnroff/troff\fP macros,
93and, with a few exceptions,
94the \fBrefer\fP program itself does not pay attention to them.
95This implies that you can change the label codes,
96if you also change the macros used by \fBnroff/troff\fP\|.
97The macro package takes care of details like proper ordering,
98underlining the book title or journal name,
99and quoting the article's title.
100Here are the labels used by \fBrefer,\fP
101with an indication of what they represent:
102.DS
103%H Header commentary, printed before reference
104%A Author's name
105%Q Corporate or foreign author (unreversed)
106%T Title of article or book
107%S Series title
108%J Journal containing article
109%B Book containing article
110%R Report, paper, or thesis (for unpublished material)
111%V Volume
112%N Number within volume
113%E Editor of book containing article
114%P Page number(s)
115%I Issuer (publisher)
116%C City where published
117%D Date of publication
118%O Other commentary, printed at end of reference
119%K Keywords used to locate reference
120%L Label used by \-k option of \fBrefer\fP
121%X Abstract (used by \fBroffbib,\fP not by \fBrefer\fP)
122.DE
123Only relevant fields should be supplied.
124Except for %A, each field should be given only once;
125in the case of multiple authors,
126the senior author should come first.
127The %Q is for organizational authors,
128or authors with Japanese or Arabic names,
129in which cases the order of names should be preserved.
130Books should be labeled with the %T, not with the %B,
131which is reserved for books containing articles.
132The %J and %B fields should never appear together,
133although if they do, the %J will override the %B.
134If there is no author, just an editor,
135it is best to type the editor in the %A field,
136as in this example:
137.DS
138%A Bertrand Bronson, ed.
139.DE
140The %E field is used for the editor of a book (%B)
141containing an article, which has its own author.
142For unpublished material such as theses, use the %R field;
143the title in the %T field will be quoted,
144but the contents of the %R field will not be underlined.
145Unlike other fields, %H, %O, and %X should contain their own punctuation.
146Here is a modest example:
147.DS
148%A Mike E. Lesk
149%T Some Applications of Inverted Indexes on the Unix System
150%B Unix Programmer's Manual
151%I Bell Laboratories
152%C Murray Hill, NJ
153%D 1978
154%V 2a
155%K refer mkey inv hunt
156%X Difficult to read paper that dwells on indexing strategies,
157giving little practical advice about using \efBrefer\efP.
158.DE
159Note that the author's name is given in normal order,
160without inverting the surname;
161inversion is done automatically,
162except when %Q is used instead of %A.
163We use %X rather than %O for the commentary
164because we do not want the comment printed all the time.
165The %O and %H fields are printed by both \fBrefer\fP and \fBroffbib;\fP
166the %X field is printed only by \fBroffbib,\fP
167as a detached annotation paragraph.
168.SH
169Data Entry with Addbib
170.XS
171Data Entry with Addbib
172.XE
173.PP
174The \fBaddbib\fP program is for creating
175and extending bibliographic databases.
176You must give it the filename of your bibliography:
177.DS
178% \fBaddbib database\fP
179.DE
180Every time you enter \fBaddbib\fP, it asks if you want instructions.
181To get them, type \fBy\fP\|; to skip them, type \s-2RETURN\s0.
182\fBAddbib\fP prompts for various fields, reads from the keyboard,
183and writes records containing the \fBrefer\fP codes to the database.
184After finishing a field entry,
185you should end it by typing \s-2RETURN\s0.
186If a field is too long to fit on a line,
187type a backslash (\e) at the end of the line,
188and you will be able to continue on the following line.
189Note: the backslash works in this capacity only inside \fBaddbib\fP.
190.PP
191A field will not be written to the database
192if nothing is entered into it.
193Typing a minus sign as the first character of any field
194will cause \fBaddbib\fP to back up one field at a time.
195Backing up is the best way to add multiple authors,
196and it really helps if you forget to add something important.
197Fields not contained in the prompting skeleton may be entered
198by typing a backslash as the last character before \s-2RETURN\s0.
199The following line will be sent verbatim to the database
200and \fBaddbib\fP will resume with the next field.
201This is identical to the procedure for dealing with long fields,
202but with new fields, don't forget the % key-letter.
203.PP
204Finally, you will be asked for an abstract (or annotation),
205which will be preserved as the %X field.
206Type in as many lines as you need, and end with a control-D
207(hold down the \s-2CTRL\s0 button, then press the \*Qd\*U key).
208This prompting for an abstract can be suppressed
209with the \fB\-a\fP command line option.
210.PP
211After one bibliographic record has been completed,
212\fBaddbib\fP will ask if you want to continue.
213If you do, type \s-2RETURN\s0\|;
214to quit, type \fBq\fP or \fBn\fP (quit or no).
215It is also possible to use one of the system editors
216to correct mistakes made while entering data.
217After the \*QContinue?\*U prompt, type any of the following:
218\fBedit, ex, vi,\fP or \fBed\fP \*-
219you will be placed inside the corresponding editor,
220and returned to \fBaddbib\fP afterwards,
221from where you can either quit or add more data.
222.PP
223If the prompts normally supplied by \fBaddbib\fP are not enough,
224are in the wrong order, or are too numerous,
225you can redefine the skeleton by constructing a promptfile.
226Create some file, to be named after the \-p command line option.
227Place the prompts you want on the left side,
228followed by a single \s-2TAB\s0 (control-I), then the \fBrefer\fP code
229that is to appear in the bibliographic database.
230\fBAddbib\fP will send the left side to the screen,
231and the right side, along with data entered, to the database.
232.SH
233Printing the Bibliography
234.XS
235Printing the Bibliography
236.XE
237.PP
238\fBSortbib\fP is for sorting the bibliography
239by author (%A) and date (%D), or by data in other fields.
240It is quite useful for producing bibliographies
241and annotated bibliographies,
242which are seldom entered in strict alphabetical order.
243It takes as arguments the names of up to 16 bibliography files,
244and sends the sorted records to standard output (the terminal screen),
245which may be redirected through a pipe or into a file.
246.PP
247The \-s\fIKEYS\fP\| flag to \fBsortbib\fP will sort by fields
248whose key-letters are in the \fIKEYS\fP\| string,
249rather than merely by author and date.
250Key-letters in \fIKEYS\fP\| may be followed by a `+'
251to indicate that all such fields are to be used.
252The default is to sort by senior author and date
253(printing the senior author last name first),
254but \-sA+D will sort by all authors and then date,
255and \-sATD will sort on senior author, then title, and then date.
256.PP
257\fBRoffbib\fP is for running off the (probably sorted) bibliography.
258It can handle annotated bibliographies \*-
259annotations are entered in the %X (abstract) field.
260\fBRoffbib\fP is a shell script that calls
261\fBrefer\0\-B\fP and \fBnroff\0\-mbib\fP\|.
262It uses the macro definitions that reside in /usr/lib/tmac/tmac.bib,
263which you can redefine if you know \fBnroff\fP and \fBtroff\fP.
264Note that \fBrefer\fP will print the %H and %O commentaries,
265but will ignore abstracts in the %X field;
266\fBroffbib\fP will print both fields,
267unless annotations are suppressed with the \-x option.
268.PP
269The following command sequence will lineprint the entire bibliography,
270organized alphabetically by author and date:
271.DS
272% \fBsortbib database | roffbib | lpr\fP
273.DE
274This is a good way to proofread the bibliography,
275or to produce a stand-alone bibliography at the end of a paper.
276Incidentally, \fBroffbib\fP accepts all flags used with \fBnroff\fP.
277For example:
278.DS
279% \fBsortbib database | roffbib \-Tdtc \-s1\fP
280.DE
281will make accent marks work on a DTC daisy-wheel printer,
282and stop at the bottom of every page for changing paper.
283The \-n and \-o flags may also be quite useful,
284to start page numbering at a selected point,
285or to produce only specific pages.
286.PP
287\fBRoffbib\fP understands four command-line number registers,
288which are something like the two-letter number registers in \-ms.
289The \-rN1 argument will number references beginning at one (1);
290use another number to start somewhere besides one.
291The \-rV2 flag will double-space the entire bibliography,
292while \-rV1 will double-space the references,
293but single-space the annotation paragraphs.
294Finally, specifying \-rL6i changes the line length
295from 6.5 inches to 6 inches,
296and saying \-rO1i sets the page offset
297to one inch, instead of zero.
298(That's a capital O after \-r, not a zero.)
299.SH
300Citing Papers with Refer
301.XS
302Citing Papers with Refer
303.XE
304.PP
305The \fBrefer\fP program normally copies input to output,
306except when it encounters an item of the form:
307.DS
308\&.[
309partial citation
310\&.]
311.DE
312The partial citation may be just an author's name and a date,
313or perhaps a title and a keyword, or maybe just a document number.
314\fBRefer\fP looks up the citation in the bibliographic database,
315and transforms it into a full, properly formatted reference.
316If the partial citation does not correctly identify a single work
317(either finding nothing, or more than one reference),
318a diagnostic message is given.
319If nothing is found, it will say \*QNo such paper.\*U
320If more than one reference is found,
321it will say \*QToo many hits.\*U
322Other diagnostic messages can be quite cryptic;
323if you are in doubt, use \fBchecknr\fP to verify
324that all your .['s have matching .]'s.
325.PP
326When everything goes well,
327the reference will be brought in from the database,
328numbered, and placed at the bottom of the page.
329This citation,
330.[
331lesk inverted indexes
332.]
333for example, was produced by:
334.DS
335This citation,
336\&.[
337lesk inverted indexes
338\&.]
339for example, was produced by
340.DE
341The .[ and .] markers, in essence,
342replace the .FS and .FE of the \-ms macros,
343and also provide a numbering mechanism.
344Footnote numbers will be bracketed on the the lineprinter,
345but superscripted on daisy-wheel terminals and in \fBtroff\fP\|.
346In the reference itself, articles will be quoted,
347and books and journals will be underlined in \fBnroff,\fP
348and italicized in \fBtroff.\fP
349.PP
350Sometimes you need to cite a specific page number
351along with more general bibliographic material.
352You may have, for instance,
353a single document that you refer to several times,
354each time giving a different page citation.
355This is how you could get \*Qp.\010\*U in the reference:
356.DS
357\&.[
358kies document formatting
359%P 10
360\&.]
361.DE
362The first line, a partial citation,
363will find the reference in your bibliography.
364The second line will insert the page number into the final citation.
365Ranges of pages may be specified as \*Q%P\056-78\*U.
366.PP
367When the time comes to run off a paper,
368you will need to have two files:
369the bibliographic database, and the paper to format.
370Use a command line something like one of these:
371.DS
372% \fBrefer \-p database paper | nroff \-ms\fP
373% \fBrefer \-p database paper | tbl | nroff \-ms\fP
374% \fBrefer \-p database paper | tbl | neqn | nroff \-ms\fP
375.DE
376If other preprocessors are used,
377\fBrefer\fP should precede \fBtbl,\fP
378which must in turn precede \fBeqn\fP or \fBneqn\fP\|.
379The \-p option specifies a \*Qprivate\*U database,
380which most bibliographies are.
381.SH
382Refer's Command-line Options
383.XS
384Refer's Command-line Options
385.XE
386.PP
387Many people like to place references at the end of a chapter,
388rather than at the bottom of the page.
389The \-e option will accumulate references
390until a macro sequence of the form
391.DS
392\&.[
393$LIST$
394\&.]
395.DE
396is encountered (or until the end of file).
397\fBRefer\fP will then write out all references collected
398up to that point, collapsing identical references.
399Warning: there is a limit (currently 200)
400on the number of references that can be accumulated at one time.
401.PP
402It is also possible to sort references that appear at the end of text.
403The \-s\fIKEYS\fP flag will sort references by fields
404whose key-letters are in the \fIKEYS\fP string,
405and permute reference numbers in the text accordingly.
406It is unnecessary to use \-e with it, since \-s implies \-e.
407Key-letters in \fIKEYS\fP may be followed by a `+'
408to indicate that all such fields are to be used.
409The default is to sort by senior author and date,
410but \-sA+D will sort on all authors and then date,
411and \-sA+T will sort by authors and then title.
412.PP
413\fBRefer\fP can also make citations in what is known as
414the Social or Natural Sciences format.
415Instead of numbering references, the \-l (letter ell) flag makes labels
416from the senior author's last name and the year of publication.
417For example, a reference to the paper on Inverted Indexes
418cited above might appear as [Lesk1978a].
419It is possible to control the number of characters in the last name,
420and the number of digits in the date.
421For instance, the command line argument \-l6,2 might
422produce a reference such as [Kernig78c].
423.PP
424Some bibliography standards shun both footnote numbers
425and labels composed of author and date,
426requiring some keyword to identify the reference.
427The \-k flag indicates that, instead of numbering references,
428key labels specified on the %L line should be used to mark references.
429.PP
430The \-n flag means to not search the default reference file,
431located in /usr/dict/papers/Rv7man.
432Using this flag may make \fBrefer\fP marginally faster.
433The \-a\fIn\fP flag will reverse the first \fIn\fP author names,
434printing Jones, J. A. instead of J. A. Jones.
435Often \-a1 is enough; this will reverse the names of only the senior author.
436In some versions of \fBrefer\fP there is also the \-f flag
437to set the footnote number to some predetermined value;
438for example, \-f23 would start numbering with footnote 23.
439.SH
440Making an Index
441.XS
442Making an Index
443.XE
444.PP
445Once your database is large and relatively stable,
446it is a good idea to make an index to it,
447so that references can be found quickly and efficiently.
448The \fBindxbib\fP program makes an inverted index
449to the bibliographic database
450(this program is called \fBpubindex\fP in the Bell Labs manual).
451An inverted index could be compared to
452the thumb cuts of a dictionary \*-
453instead of going all the way through your bibliography,
454programs can move to the exact location where a citation is found.
455.PP
456\fBIndxbib\fP itself takes a while to run,
457and you will need sufficient disk space to store the indexes.
458But once it has been run, access time will improve dramatically.
459Furthermore, large databases of several million characters
460can be indexed with no problem.
461The program is exceedingly simple to use:
462.DS
463% \fBindxbib database\fP
464.DE
465Be aware that changing your database will require
466that you run \fBindxbib\fP over again.
467If you don't, you may fail to find a reference
468that really is in the database.
469.PP
470Once you have built an inverted index,
471you can use \fBlookbib\fP to find references in the database.
472\fBLookbib\fP cannot be used until you have run \fBindxbib\fP\|.
473When editing a paper, \fBlookbib\fP is very useful
474to make sure that a citation can be found as specified.
475It takes one argument, the name of the bibliography,
476and then reads partial citations from the terminal,
477returning references that match, or nothing if none match.
478Its prompt is the greater-than sign.
479.DS
480% \fBlookbib database\fP
481> \fBlesk inverted indexes\fP
482%A Mike E. Lesk
483%T Some Applications of Inverted Indexes on the Unix System
484%J Unix Programmer's Manual
485%I Bell Laboratories
486%C Murray Hill, NJ
487%D 1978
488%V 2a
489%X Difficult to read paper that dwells on indexing strategies,
490giving little practical advice about using \efBrefer\efP.
491>
492.DE
493If more than one reference comes back,
494you will have to give a more precise citation for \fBrefer\fP\|.
495Experiment until you find something that works;
496remember that it is harmless to overspecify.
497To get out of the \fBlookbib\fP program,
498type a control-D alone on a line;
499\fBlookbib\fP then exits with an ``EOT'' message.
500.PP
501\fBLookbib\fP can also be used to extract groups of related citations.
502For example, to find all the papers by Brian Kernighan
503found in the system database, and send the output to a file, type:
504.DS
505% \fBlookbib /usr/dict/papers/Ind > kern.refs\fP
506> \fBkernighan\fP
507> EOT
508% \fBcat kern.refs\fP
509.DE
510Your file, \*Qkern.refs\*U, will be full of references.
511A similar procedure can be used
512to pull out all papers of some date,
513all papers from a given journal,
514all papers containing a certain group of keywords, etc.
515.SH
516Refer Bugs and Some Solutions
517.XS
518Refer Bugs and Some Solutions
519.XE
520.PP
521The \fBrefer\fP program will mess up if there are blanks
522at the end of lines, especially the %A author line.
523\fBAddbib\fP carefully removes trailing blanks,
524but they may creep in again during editing.
525Use an editor command \*-
526.if n g/ *$/s/// \*-
527.if t g/\0\0\(**$/s/// \*-
528to remove trailing blanks from your bibliography.
529.PP
530Having bibliographic fields passed through as string definitions
531implies that interpolated strings (such as accent marks)
532must have two backslashes, so they can pass through copy mode intact.
533For instance, the word \*Qt\o'e\(aa'l\o'e\(aa'phone\*U
534would have to be represented:
535.DS
536te\e\e\(**\'le\e\e\(**\'phone
537.DE
538in order to come out correctly.
539In the %X field, by contrast,
540you will have to use single backslashes instead.
541This is because the %X field is not passed through as a string,
542but as the body of a paragraph macro.
543.PP
544Another problem arises from authors with foreign names.
545When a name like \*QVal\o"e\(aa"ry Giscard d'Estaing\*U
546is turned around by the \-a option of \fBrefer,\fP
547it will appear as \*Qd'Estaing, Val\o"e\(aa"ry Giscard,\*U
548rather than as \*QGiscard d'Estaing, Val\o"e\(aa"ry.\*U
549To prevent this, enter names as follows:
550.DS
551%A Vale\e\e\(**\'ry Giscard\e0d'Estaing
552%A Alexander Csoma\e0de\e0Ko\e\e\(**:ro\e\e\(**:s
553.DE
554(The second is the name of a famous Hungarian linguist.)
555The backslash-zero is an \fBnroff/troff\fP request
556meaning to insert a digit-width space.
557It will protect against faulty name reversal,
558and also against mis-sorting.
559.PP
560Footnote numbers are placed at the end of the line before the .[ macro.
561This line should be a line of text, not a macro.
562As an example, if the line before the .[ is a .R macro,
563then the .R will eat the footnote number.
564(The .R is an \-ms request meaning change to Roman font.)
565In cases where the font needs changing,
566it is necessary to do the following:
567.DS
568\efIet al.\efR
569\&.[
570awk aho kernighan weinberger
571\&.]
572.DE
573Now the reference will be to Aho \fIet al\fR.
574.[
575awk aho kernighan
576.]
577The \efI changes to italics, and the \efR changes back to Roman font.
578Both these requests are \fBnroff/troff\fP requests, not part of \-ms.
579If and when a footnote number is added after this sequence,
580it will indeed appear in the output.
581.SH
582Internal Details of Refer
583.XS
584Internal Details of Refer
585.XE
586.PP
587You have already read everything you need to know
588in order to use the \fBrefer\fP bibliography system.
589The remaining sections are provided only for extra information,
590and in case you need to change the way \fBrefer\fP works.
591.PP
592The output of \fBrefer\fP is a stream of string definitions,
593one for each field in a reference.
594To create string names,
595percent signs are simply changed to an open bracket,
596and an [F string is added, containing the footnote number.
597The %X, %Y and %Z fields are ignored;
598however, the \fBannobib\fP program changes the %X
599to an .AP (annotation paragraph) macro.
600The citation used above yields this intermediate output:
601.DS
602.ta \w'.ds\0'u +\w'[D\0'u
603\&.ds [F 1
604\&.]-
605\&.ds [A Mike E. Lesk
606\&.ds [T Some Applications of Inverted Indexes on the Unix System
607\&.ds [J Unix Programmer's Manual
608\&.ds [I Bell Laboratories
609\&.ds [C Murray Hill, NJ
610\&.ds [D 1978
611\&.ds [V 2a
612\&.nr [T 0
613\&.nr [A 0
614\&.nr [O 0
615\&.][ 1 journal-article
616.DE
617These string definitions are sent to \fBnroff\fP,
618which can use the \-ms macros defined in /usr/lib/mx/tmac.xref
619to take care of formatting things properly.
620The initializing macro \fB.]\-\fP precedes the string definitions,
621and the labeled macro \fB.][\fP follows.
622These are changed from the input \fB.[\fP and \fB.]\fP so that
623running a file twice through \fBrefer\fP is harmless.
624.PP
625The \fB.][\fP macro, used to print the reference,
626is given a type-number argument, which is a numeric label
627indicating the type of reference involved.
628Here is a list of the various kinds of references:
629.DS
630.ta \w'Field\0\0\0'u +\w'Value\0\0'u
631Field Value Kind of Reference
632\l'\w'Field\0\0\0Value\0\0Kind of Reference\0'u'
633%J 1 Journal Article
634%B 3 Article in Book
635%R %G 4 Report, Government Report
636%I 2 Book
637%M 5 Bell Labs Memorandum (undefined)
638none 0 Other
639.DE
640The order listed above is indicative of the precedence
641of the various fields.
642In other words, a reference that has both the %J and %B fields
643will be classified as a journal article.
644If none of the fields listed is present,
645then the reference will be classified as \*Qother.\*U
646.PP
647The footnote number is flagged in the text with the following sequence,
648where \fInumber\fP is the footnote number:
649.DS
650\e*([.\fInumber\fP\e*(.]
651.DE
652The \e*([. and \e*(.] stand for bracketing or superscripting.
653In \fBnroff\fP with low-resolution devices such as the lpr and a crt,
654footnote numbers will be bracketed.
655In \fBtroff,\fP or on daisy-wheel printers,
656footnote numbers will be superscripted.
657Punctuation normally comes before the reference number;
658this can be changed by using the \-P (postpunctuation)
659option of \fBrefer\fP.
660.PP
661In some cases, it is necessary to override
662certain fields in a reference.
663For instance, each time a work is cited,
664you may want to specify different page numbers,
665and you may want to change certain fields.
666This citation will find the Lesk reference,
667but will add specific page numbers to the output,
668even though no page numbers appeared in the original reference.
669.DS
670\&.[
671lesk inverted indexes
672%P 7-13
673%I Computing Services
674%O UNX 12.2.2.
675\&.]
676.DE
677The %I line will also override any previous publisher information,
678and the %O line will append some commentary.
679The \fBrefer\fP program simply adds
680the new %P, %I, and %O strings to the output,
681and later strings definitions cancel earlier ones.
682.PP
683It is also possible to insert an entire citation
684that does not appear in the bibliographic database.
685This reference, for example, could be added as follows:
686.DS
687\&.[
688%A Brian Kernighan
689%T A Troff Tutorial
690%I Bell Laboratories
691%D 1978
692\&.]
693.DE
694This will cause \fBrefer\fP to interpret the fields exactly as given,
695without searching the bibliographic database.
696This practice is not recommended, however, because it's better
697to add new references to the database, so they can be used again later.
698.PP
699If you want to change the way footnote numbers are printed,
700signals can be given on the \fB.[\fP and \fB.]\fP lines.
701For example, to say \*QSee reference (2),\*U
702the citation should appear as:
703.DS
704See reference
705\&.[(
706partial citation
707\&.]),
708.DE
709Note that blanks are significant on these signal lines.
710If a permanent change in the footnote format is desired,
711it's best to redefine the \fB[.\fP and \fB.]\fP strings.
712.SH
713Changing the Refer Macros
714.XS
715Changing the Refer Macros
716.XE
717.PP
718This section is provided for those who wish to rewrite
719or modify the \fBrefer\fP macros.
720This is necessary in order to make output correspond
721to specific journal requirements, or departmental standards.
722First there is an explanation of how new macros
723can be substituted for the old ones.
724Then several alterations are given as examples.
725Finally, there is an annotated copy of
726the \fBrefer\fP macros used by \fBroffbib\fP\|.
727.PP
728The \fBrefer\fP macros for \fBnroff/troff\fP supplied by
729the \-ms macro package reside in /usr/lib/mx/tmac.xref;
730they are reference macros, for producing footnotes or endnotes.
731The \fBrefer\fP macros used by \fBroffbib,\fP
732on the other hand, reside in /usr/lib/tmac/tmac.bib;
733they are for producing a stand-alone bibliography.
734.PP
735To change the macros used by \fBroffbib,\fP
736you will need to get your own version of this shell script
737into the directory where you are working.
738These two commands will get you a copy of \fBroffbib\fP
739and the macros it uses: \(dg
740.DS
741% \fBcp /usr/lib/tmac/tmac.bib bibmac\fP
742.DE
743You can proceed to change bibmac as much as you like.
744Then when you use \fBroffbib\fP,
745you should specify your own version of the macros,
746which will be substituted for the normal ones
747.DS
748% \fBroffbib \-m bibmac\fR \fIfilename\fP
749.DE
750where \fIfilename\fP is the name of your bibliography file.
751Make sure there's a space between \-m and \fBbibmac\fP.
752.PP
753If you want to modify the \fBrefer\fP macros
754for use with \fBnroff\fP and the \-ms macros,
755you will need to get a copy of \*Qtmac.xref\*U:
756.DS
757% \fBcp /usr/lib/ms/s.ref refmac\fP
758.DE
759These macros are much like \*Qbibmac\*U,
760except they have .FS and .FE requests,
761to be used in conjunction with the \-ms macros,
762rather than independently defined .XP and .AP requests.
763Now you can put this line at the top of the paper to be formatted:
764.DS
765\&.so refmac
766.DE
767Your new \fBrefer\fP macros will override the definitions
768previously read in by the \-ms package.
769This method works only if \*Qrefmac\*U is in the working directory.
770.PP
771Suppose you didn't like the way dates are printed,
772and wanted them to be parenthesized, with no comma before.
773There are five identical lines you will have to change.
774The first line below is the old way,
775while the second is the new way:
776.DS
777\&.if !"\e\e*([D"" , \e\e*([D\ec
778\&.if !"\e\e*([D"" \e& (\e\e*([D)\ec
779.DE
780In the first line, there is a comma and a space, but no parentheses.
781The \*Q\ec\*U at the end of each line
782indicates to \fBnroff\fP that it should continue,
783leaving no extra space in the output.
784The \*Q\e&\*U in the second line is the do-nothing character;
785when followed by a space, a space is sent to the output.
786.PP
787If you need to format a reference in the style
788favored by the Modern Language Association
789or Chicago University Press,
790in the form (city: publisher, date),
791then you will have to change the middle of
792the book macro [2 as follows:
793.DS
794\e& (\ec
795\&.if !"\e\e*([C"" \e\e*([C:
796\e\e*([I\ec
797\&.if !"\e\e*([D"" , \e\e*([D\ec
798)\ec
799.DE
800This would print (Berkeley: Computing Services, 1982)
801if all three strings were present.
802The first line prints a space and a parenthesis;
803the second prints the city (and a colon) if present;
804the third always prints the publisher
805(books must have a publisher, or else they're classified as other);
806the fourth line prints a comma and the date if present;
807and the fifth line closes the parentheses.
808You would need to make similar changes to the other macros as well.
809.SH
810Acknowledgements
811.XS
812Acknowledgements
813.XE
814.PP
815Mike Lesk of Bell Laboratories wrote the original \fBrefer\fP software,
816including the indexing programs.
817Al Stangenberger of the Forestry Department
818wrote the first version of \fBaddbib\fP, then called \fBbibin\fP.
819Greg Shenaut of the Linguistics Department
820wrote the original versions of \fBsortbib\fP and \fBroffbib\fP.
821All these contributions are greatly appreciated.
822.nr Pg \n(PN+1
823.XS \n(Pg
824Commented Refer Macros
825.XE
826.nr LL 6i
827.TC