Imported Upstream version 1.22.3
[platform/upstream/groff.git] / src / preproc / refer / refer.man
1 .TH @G@REFER @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
2 .SH NAME
3 @g@refer \- preprocess bibliographic references for groff
4 .
5 .
6 .\" --------------------------------------------------------------------
7 .\" Legalese
8 .\" --------------------------------------------------------------------
9 .
10 .de co
11 Copyright \[co] 1989-2014 Free Software Foundation, Inc.
12
13 Permission is granted to make and distribute verbatim copies of
14 this manual provided the copyright notice and this permission notice
15 are preserved on all copies.
16
17 Permission is granted to copy and distribute modified versions of this
18 manual under the conditions for verbatim copying, provided that the
19 entire resulting derived work is distributed under the terms of a
20 permission notice identical to this one.
21
22 Permission is granted to copy and distribute translations of this
23 manual into another language, under the above conditions for modified
24 versions, except that this permission notice may be included in
25 translations approved by the Free Software Foundation instead of in
26 the original English.
27 ..
28 .
29 .\" --------------------------------------------------------------------
30 .\" Macro Definitions
31 .\" --------------------------------------------------------------------
32 .
33 .de TQ
34 .  br
35 .  ns
36 .  TP \\$1
37 ..
38 .
39 .\" Like TP, but if specified indent is more than half
40 .\" the current line-length - indent, use the default indent.
41 .de Tp
42 .  ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
43 .  el .TP "\\$1"
44 ..
45 .
46 .\" The BSD man macros can't handle " in arguments to font change macros,
47 .\" so use \(ts instead of ".
48 .tr \(ts"\""
49 .
50 .
51 .\" --------------------------------------------------------------------
52 .SH SYNOPSIS
53 .\" --------------------------------------------------------------------
54 .
55 .nr a \n(.j
56 .ad l
57 .nr i \n(.i
58 .in +\w'\fB@g@refer 'u
59 .ti \niu
60 .B @g@refer
61 .
62 .de OP
63 .  ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
64 .  el .RB "[\ " "\\$1" "\ ]"
65 ..
66 .
67 .OP \-benvCPRS
68 .OP \-a n
69 .OP \-c fields
70 .OP \-f n
71 .OP \-i fields
72 .OP \-k field
73 .OP \-l m,n
74 .OP \-p \%filename
75 .OP \-s fields
76 .OP \-t n
77 .OP \-B field.macro
78 .RI [\  \%filename \|.\|.\|.\ ]
79 .br
80 .ad \na
81 .
82 .
83 \" --------------------------------------------------------------------
84 .SH DESCRIPTION
85 .\" --------------------------------------------------------------------
86 .
87 This file documents the GNU version of
88 .BR refer ,
89 which is part of the groff document formatting system.
90 .
91 .B refer
92 copies the contents of
93 .IR filename \|.\|.\|.\&
94 to the standard output,
95 except that lines between
96 .B .[
97 and
98 .B .]\&
99 are interpreted as citations,
100 and lines between
101 .B .R1
102 and
103 .B .R2
104 are interpreted as commands about how citations are to be processed.
105 .
106 .
107 .LP
108 Each citation specifies a reference.
109 .
110 The citation can specify a reference that is contained in
111 a bibliographic database by giving a set of keywords
112 that only that reference contains.
113 .
114 Alternatively it can specify a reference by supplying a database
115 record in the citation.
116 .
117 A combination of these alternatives is also possible.
118 .
119 .
120 .LP
121 For each citation,
122 .B refer
123 can produce a mark in the text.
124 .
125 This mark consists of some label which can be separated from
126 the text and from other labels in various ways.
127 .
128 For each reference it also outputs
129 .B groff
130 commands that can be used by a macro package to produce a formatted
131 reference for each citation.
132 .
133 The output of
134 .B refer
135 must therefore be processed using a suitable macro package.
136 .
137 The
138 .B \-ms
139 and
140 .B \-me
141 macros are both suitable.
142 .
143 The commands to format a citation's reference can be output immediately after
144 the citation,
145 or the references may be accumulated,
146 and the commands output at some later point.
147 .
148 If the references are accumulated, then multiple citations of the same
149 reference will produce a single formatted reference.
150 .
151 .
152 .LP
153 The interpretation of lines between
154 .B .R1
155 and
156 .B .R2
157 as commands is a new feature of GNU
158 .BR refer .
159 .
160 Documents making use of this feature can still be processed by
161 Unix refer just by adding the lines
162 .
163 .RS
164 .LP
165 .nf
166 .ft B
167 \&.de R1
168 \&.ig R2
169 \&..
170 .ft
171 .fi
172 .RE
173 .
174 to the beginning of the document.
175 .
176 This will cause
177 .B troff
178 to ignore everything between
179 .B .R1
180 and
181 .BR .R2 .
182 .
183 The effect of some commands can also be achieved by options.
184 .
185 These options are supported mainly for compatibility with Unix refer.
186 .
187 It is usually more convenient to use commands.
188 .
189 .
190 .LP
191 .B refer
192 generates
193 .B .lf
194 lines so that filenames and line numbers in messages produced
195 by commands that read
196 .B refer
197 output will be correct;
198 it also interprets lines beginning with
199 .B .lf
200 so that filenames and line numbers in the messages and
201 .B .lf
202 lines that it produces will be accurate even if the input has been
203 preprocessed by a command such as
204 .BR @g@soelim (@MAN1EXT@).
205 .
206 .
207 .\" --------------------------------------------------------------------
208 .SH OPTIONS
209 .\" --------------------------------------------------------------------
210 .
211 It is possible to have whitespace between a command line option and its
212 parameter.
213 .
214 .
215 .LP
216 Most options are equivalent to commands
217 (for a description of these commands see the
218 .B Commands
219 subsection):
220 .
221 .
222 .nr a \n(.j
223 .ad l
224 .TP
225 .B \-b
226 .B "no-label-in-text; no-label-in-reference"
227 .
228 .
229 .TP
230 .B \-e
231 .B accumulate
232 .
233 .
234 .TP
235 .B \-n
236 .B no-default-database
237 .
238 .
239 .TP
240 .B \-C
241 .B compatible
242 .
243 .
244 .TP
245 .B \-P
246 .B move-punctuation
247 .
248 .
249 .TP
250 .B \-S
251 .B
252 label\ "(A.n|Q)\ ',\ '\ (D.y|D)"; \%bracket-label\ "\ ("\ )\ ";\ "
253 .
254 .
255 .TP
256 .BI \-a n
257 .B reverse
258 .BI A n
259 .
260 .
261 .TP
262 .BI \-c fields
263 .B capitalize
264 .I fields
265 .
266 .
267 .TP
268 .BI \-f n
269 .B label
270 .BI % n
271 .
272 .
273 .TP
274 .BI \-i fields
275 .B search-ignore
276 .I fields
277 .
278 .
279 .TP
280 .B \-k
281 .B label
282 .B L\(ti%a
283 .
284 .
285 .TP
286 .BI \-k field
287 .B label
288 .IB field \(ti%a
289 .
290 .
291 .TP
292 .B \-l
293 .B label
294 .BI A.nD.y%a
295 .
296 .
297 .TP
298 .BI \-l m
299 .B label
300 .BI A.n+ m D.y%a
301 .
302 .
303 .TP
304 .BI \-l, n
305 .B label
306 .BI A.nD.y\- n %a
307 .
308 .
309 .TP
310 .BI \-l m , n
311 .B label
312 .BI A.n+ m D.y\- n %a
313 .
314 .
315 .TP
316 .BI \-p filename
317 .B database
318 .I filename
319 .
320 .
321 .TP
322 .BI \-s spec
323 .B sort
324 .I spec
325 .
326 .
327 .TP
328 .BI \-t n
329 .B search-truncate
330 .I n
331 .ad \na
332 .
333 .
334 .LP
335 These options are equivalent to the following commands with the
336 addition that the filenames specified on the command line are
337 processed as if they were arguments to the
338 .B bibliography
339 command instead of in the normal way:
340 .
341 .
342 .TP
343 .B \-B
344 .B "annotate X AP; no-label-in-reference"
345 .
346 .
347 .TP
348 .BI \-B field . macro
349 .B annotate
350 .I field
351 .IB macro ;
352 .B no-label-in-reference
353 .
354 .
355 .LP
356 The following options have no equivalent commands:
357 .
358 .
359 .TP
360 .B \-v
361 Print the version number.
362 .
363 .
364 .TP
365 .B \-R
366 Don't recognize lines beginning with
367 .BR .R1 / .R2 .
368 .
369 .
370 .\" --------------------------------------------------------------------
371 .SH USAGE
372 .\" --------------------------------------------------------------------
373 .
374 .\" --------------------------------------------------------------------
375 .SS Bibliographic databases
376 .\" --------------------------------------------------------------------
377 .
378 The bibliographic database is a text file consisting of records
379 separated by one or more blank lines.
380 .
381 Within each record fields start with a
382 .B %
383 at the beginning of a line.
384 .
385 Each field has a one character name that immediately follows the
386 .BR % .
387 It is best to use only upper and lower case letters for the names
388 of fields.
389 .
390 The name of the field should be followed by exactly one space,
391 and then by the contents of the field.
392 .
393 Empty fields are ignored.
394 .
395 The conventional meaning of each field is as follows:
396 .
397 .
398 .TP
399 .B %A
400 The name of an author.
401 .
402 If the name contains a title such as
403 .B Jr.\&
404 at the end,
405 it should be separated from the last name by a comma.
406 .
407 There can be multiple occurrences of the
408 .B %A
409 field.
410 .
411 The order is significant.
412 .
413 It is a good idea always to supply an
414 .B %A
415 field or a
416 .B %Q
417 field.
418 .
419 .
420 .TP
421 .B %B
422 For an article that is part of a book, the title of the book.
423 .
424 .
425 .TP
426 .B %C
427 The place (city) of publication.
428 .
429 .
430 .TP
431 .B %D
432 The date of publication.
433 .
434 The year should be specified in full.
435 .
436 If the month is specified, the name rather than the number of the month
437 should be used, but only the first three letters are required.
438 .
439 It is a good idea always to supply a
440 .B %D
441 field;
442 if the date is unknown, a value such as
443 .B in press
444 or
445 .B unknown
446 can be used.
447 .
448 .
449 .TP
450 .B %E
451 For an article that is part of a book, the name of an editor of the book.
452 .
453 Where the work has editors and no authors,
454 the names of the editors should be given as
455 .B %A
456 fields and
457 .B ,\ (ed)
458 or
459 .B ,\ (eds)
460 should be appended to the last author.
461 .
462 .
463 .TP
464 .B %G
465 US Government ordering number.
466 .
467 .
468 .TP
469 .B %I
470 The publisher (issuer).
471 .
472 .
473 .TP
474 .B %J
475 For an article in a journal,
476 the name of the journal.
477 .
478 .
479 .TP
480 .B %K
481 Keywords to be used for searching.
482 .
483 .
484 .TP
485 .B %L
486 Label.
487 .
488 .
489 .TP
490 .B %N
491 Journal issue number.
492 .
493 .
494 .TP
495 .B %O
496 Other information.
497 .
498 This is usually printed at the end of the reference.
499 .
500 .
501 .TP
502 .B %P
503 Page number.
504 A range of pages can be specified as
505 .IB m \- n\fR.
506 .
507 .
508 .TP
509 .B %Q
510 The name of the author, if the author is not a person.
511 .
512 This will only be used if there are no
513 .B %A
514 fields.
515 .
516 There can only be one
517 .B %Q
518 field.
519 .
520 .
521 .TP
522 .B %R
523 Technical report number.
524 .
525 .
526 .TP
527 .B %S
528 Series name.
529 .
530 .
531 .TP
532 .B %T
533 Title.
534 .
535 For an article in a book or journal,
536 this should be the title of the article.
537 .
538 .
539 .TP
540 .B %V
541 Volume number of the journal or book.
542 .
543 .
544 .TP
545 .B %X
546 Annotation.
547 .
548 .
549 .LP
550 For all fields except
551 .B %A
552 and
553 .BR %E ,
554 if there is more than one occurrence of a particular field in a record,
555 only the last such field will be used.
556 .
557 .
558 .LP
559 If accent strings are used, they should follow the character to be accented.
560 This means that the
561 .B AM
562 macro must be used with the
563 .B \-ms
564 macros.
565 .
566 Accent strings should not be quoted:
567 use one
568 .B \e
569 rather than two.
570 .
571 .
572 .\" --------------------------------------------------------------------
573 .SS Citations
574 .\" --------------------------------------------------------------------
575 .
576 The format of a citation is
577 .
578 .RS
579 .BI .[ opening-text
580 .br
581 .I "flags keywords"
582 .br
583 .I fields
584 .br
585 .BI .] closing-text
586 .RE
587 .
588 .
589 .LP
590 The
591 .IR opening-text ,
592 .IR closing-text
593 and
594 .I flags
595 components are optional.
596 .
597 Only one of the
598 .I keywords
599 and
600 .I fields
601 components need be specified.
602 .
603 .
604 .LP
605 The
606 .I keywords
607 component says to search the bibliographic databases for a reference
608 that contains all the words in
609 .IR keywords .
610 .
611 It is an error if more than one reference if found.
612 .
613 .
614 .LP
615 The
616 .I fields
617 components specifies additional fields to replace or supplement
618 those specified in the reference.
619 .
620 When references are being accumulated and the
621 .I keywords
622 component is non-empty,
623 then additional fields should be specified only on the first
624 occasion that a particular reference is cited,
625 and will apply to all citations of that reference.
626 .
627 .
628 .LP
629 The
630 .I opening-text
631 and
632 .I closing-text
633 component specifies strings to be used to bracket the label instead
634 of the strings specified in the
635 .B bracket-label
636 command.
637 .
638 If either of these components is non-empty,
639 the strings specified in the
640 .B bracket-label
641 command will not be used;
642 this behaviour can be altered using the
643 .B [
644 and
645 .B ]
646 flags.
647 Note that leading and trailing spaces are significant for these components.
648 .
649 .
650 .LP
651 The
652 .I flags
653 component is a list of
654 non-alphanumeric characters each of which modifies the treatment
655 of this particular citation.
656 .
657 Unix refer will treat these flags as part of the keywords and
658 so will ignore them since they are non-alphanumeric.
659 .
660 The following flags are currently recognized:
661 .
662 .
663 .TP
664 .B #
665 This says to use the label specified by the
666 .B short-label
667 command,
668 instead of that specified by the
669 .B label
670 command.
671 .
672 If no short label has been specified, the normal label will be used.
673 .
674 Typically the short label is used with author-date labels
675 and consists of only the date and possibly a disambiguating letter;
676 the
677 .B #
678 is supposed to be suggestive of a numeric type of label.
679 .
680 .
681 .TP
682 .B [
683 Precede
684 .I opening-text
685 with the first string specified in the
686 .B bracket-label
687 command.
688 .
689 .
690 .TP
691 .B ]
692 Follow
693 .I closing-text
694 with the second string specified in the
695 .B bracket-label
696 command.
697 .
698 .
699 .LP
700 One advantages of using the
701 .B [
702 and
703 .B ]
704 flags rather than including the brackets in
705 .I opening-text
706 and
707 .I closing-text
708 is that
709 you can change the style of bracket used in the document just by changing the
710 .B bracket-label
711 command.
712 .
713 Another advantage is that sorting and merging of citations
714 will not necessarily be inhibited if the flags are used.
715 .
716 .
717 .LP
718 If a label is to be inserted into the text,
719 it will be attached to the line preceding the
720 .B .[
721 line.
722 .
723 If there is no such line, then an extra line will be inserted before the
724 .B .[
725 line and a warning will be given.
726 .
727 .
728 .LP
729 There is no special notation for making a citation to multiple references.
730 Just use a sequence of citations, one for each reference.
731 .
732 Don't put anything between the citations.
733 .
734 The labels for all the citations will be attached to the line preceding
735 the first citation.
736 .
737 The labels may also be sorted or merged.
738 .
739 See the description of the
740 .B <>
741 label expression, and of the
742 .B sort-adjacent-labels
743 and
744 .B abbreviate-label-ranges
745 command.
746 A label will not be merged if its citation has a non-empty
747 .I opening-text
748 or
749 .IR closing-text .
750 .
751 However,
752 the labels for a citation using the
753 .B ]
754 flag and without any
755 .I closing-text
756 immediately followed by a citation using the
757 .B [
758 flag and without any
759 .I opening-text
760 may be sorted and merged
761 even though the first citation's
762 .I opening-text
763 or the second citation's
764 .I closing-text
765 is non-empty.
766 .
767 (If you wish to prevent this just make the first citation's
768 .I closing-text
769 .BR \e& .)
770 .
771 .
772 .\" --------------------------------------------------------------------
773 .SS Commands
774 .\" --------------------------------------------------------------------
775 .
776 Commands are contained between lines starting with
777 .B .R1
778 and
779 .BR .R2 .
780 .
781 Recognition of these lines can be prevented by the
782 .B \-R
783 option.
784 .
785 When a
786 .B .R1
787 line is recognized any accumulated references are flushed out.
788 .
789 Neither
790 .B .R1
791 nor
792 .B .R2
793 lines,
794 nor anything between them
795 is output.
796 .
797 .
798 .LP
799 Commands are separated by newlines or
800 .BR ; s.
801 .B #
802 introduces a comment that extends to the end of the line
803 (but does not conceal the newline).
804 .
805 Each command is broken up into words.
806 .
807 Words are separated by spaces or tabs.
808 .
809 A word that begins with
810 .B \(ts
811 extends to the next
812 .B \(ts
813 that is not followed by another
814 .BR \(ts .
815 .
816 If there is no such
817 .B \(ts
818 the word extends to the end of the line.
819 .
820 Pairs of
821 .B \(ts
822 in a word beginning with
823 .B \(ts
824 collapse to a single
825 .BR \(ts .
826 .
827 Neither
828 .B #
829 nor
830 .B ;
831 are recognized inside
832 .BR \(ts s.
833 .
834 A line can be continued by ending it with
835 .BR \e ;
836 this works everywhere except after a
837 .BR # .
838 .
839 .
840 .LP
841 .ds n \fR*
842 Each command
843 .I name
844 that is marked with \*n has an associated negative command
845 .BI no- name
846 that undoes the effect of
847 .IR name .
848 .
849 For example, the
850 .B no-sort
851 command specifies that references should not be sorted.
852 .
853 The negative commands take no arguments.
854 .
855 .
856 .LP
857 In the following description each argument must be a single word;
858 .I field
859 is used for a single upper or lower case letter naming a field;
860 .I fields
861 is used for a sequence of such letters;
862 .I m
863 and
864 .I n
865 are used for a non-negative numbers;
866 .I string
867 is used for an arbitrary string;
868 .I filename
869 is used for the name of a file.
870 .
871 .
872 .Tp \w'\fBabbreviate-label-ranges'u+2n
873 .BI abbreviate\*n\  fields\ string1\ string2\ string3\ string4
874 Abbreviate the first names of
875 .IR fields .
876 .
877 An initial letter will be separated from another initial letter by
878 .IR string1 ,
879 from the last name by
880 .IR string2 ,
881 and from anything else
882 (such as a
883 .B von
884 or
885 .BR de )
886 by
887 .IR string3 .
888 .
889 These default to a period followed by a space.
890 .
891 In a hyphenated first name,
892 the initial of the first part of the name will be separated from the
893 hyphen by
894 .IR string4 ;
895 this defaults to a period.
896 .
897 No attempt is made to handle any ambiguities that might
898 result from abbreviation.
899 .
900 Names are abbreviated before sorting and before label construction.
901 .
902 .
903 .TP
904 .BI abbreviate-label-ranges\*n\  string
905 .
906 Three or more adjacent labels that refer to consecutive references
907 will be abbreviated to a label consisting of the first label,
908 followed by
909 .I string
910 followed by the last label.
911 .
912 This is mainly useful with numeric labels.
913 .
914 If
915 .I string
916 is omitted it defaults to
917 .BR \- .
918 .
919 .
920 .TP
921 .B accumulate\*n
922 Accumulate references instead of writing out each reference
923 as it is encountered.
924 .
925 Accumulated references will be written out whenever a reference
926 of the form
927 .
928 .RS
929 .IP
930 .B .[
931 .br
932 .B $LIST$
933 .br
934 .B .]
935 .
936 .
937 .LP
938 is encountered,
939 after all input files have been processed,
940 and whenever
941 .B .R1
942 line is recognized.
943 .RE
944 .
945 .
946 .TP
947 .BI annotate\*n\  field\ string
948 .I field
949 is an annotation;
950 print it at the end of the reference as a paragraph preceded by the line
951 .
952 .RS
953 .IP
954 .BI . string
955 .
956 .
957 .LP
958 If
959 .I string
960 is omitted it will default to
961 .BR AP ;
962 if
963 .I field
964 is also omitted it will default to
965 .BR X .
966 .
967 Only one field can be an annotation.
968 .RE
969 .
970 .
971 .TP
972 .BI articles\  string \fR\|.\|.\|.
973 .IR string \|.\|.\|.\&
974 are definite or indefinite articles, and should be ignored at the beginning of
975 .B T
976 fields when sorting.
977 .
978 Initially,
979 .BR the ,
980 .B a
981 and
982 .B an
983 are recognized as articles.
984 .
985 .
986 .TP
987 .BI bibliography\  filename \fR\|.\|.\|.
988 .
989 Write out all the references contained in the bibliographic databases
990 .IR filename \|.\|.\|.
991 .
992 This command should come last in a
993 .BR .R1 / .R2
994 block.
995 .
996 .
997 .TP
998 .BI bracket-label\  string1\ string2\ string3
999 In the text, bracket each label
1000 with
1001 .I string1
1002 and
1003 .IR string2 .
1004 .
1005 An occurrence of
1006 .I string2
1007 immediately followed by
1008 .I string1
1009 will be turned into
1010 .IR string3 .
1011 .
1012 The default behaviour is
1013 .
1014 .RS
1015 .IP
1016 .B
1017 bracket-label \e*([. \e*(.] ", "
1018 .RE
1019 .
1020 .
1021 .TP
1022 .BI capitalize\  fields
1023 Convert
1024 .I fields
1025 to caps and small caps.
1026 .
1027 .
1028 .TP
1029 .B compatible\*n
1030 Recognize
1031 .B .R1
1032 and
1033 .B .R2
1034 even when followed by a character other than space or newline.
1035 .
1036 .
1037 .TP
1038 .BI database\  filename \fR\|.\|.\|.
1039 Search the bibliographic databases
1040 .IR filename \|.\|.\|.
1041 .
1042 For each
1043 .I filename
1044 if an index
1045 .IB filename @INDEX_SUFFIX@
1046 created by
1047 .BR @g@indxbib (@MAN1EXT@)
1048 exists, then it will be searched instead;
1049 each index can cover multiple databases.
1050 .
1051 .
1052 .TP
1053 .BI date-as-label\*n\  string
1054 .I string
1055 is a label expression that specifies a string with which to replace the
1056 .B D
1057 field after constructing the label.
1058 .
1059 See the
1060 .B "Label expressions"
1061 subsection for a description of label expressions.
1062 .
1063 This command is useful if you do not want explicit labels in the
1064 reference list,
1065 but instead want to handle any necessary disambiguation by qualifying
1066 the date in some way.
1067 .
1068 The label used in the text would typically be some combination of the
1069 author and date.
1070 .
1071 In most cases you should also use the
1072 .B no-label-in-reference
1073 command.
1074 For example,
1075 .
1076 .RS
1077 .IP
1078 .B "date-as-label D.+yD.y%a*D.-y"
1079 .
1080 .
1081 .LP
1082 would attach a disambiguating letter to the year part of the
1083 .B D
1084 field in the reference.
1085 .RE
1086 .
1087 .
1088 .TP
1089 .B default-database\*n
1090 The default database should be searched.
1091 .
1092 This is the default behaviour,
1093 so the negative version of this command is more useful.
1094 .
1095 .B refer
1096 determines whether the default database should be searched
1097 on the first occasion that it needs to do a search.
1098 .
1099 Thus a
1100 .B no-default-database
1101 command must be given before then,
1102 in order to be effective.
1103 .
1104 .
1105 .TP
1106 .BI discard\*n\  fields
1107 When the reference is read,
1108 .I fields
1109 should be discarded;
1110 no string definitions for
1111 .I fields
1112 will be output.
1113 .
1114 Initially,
1115 .I fields
1116 are
1117 .BR XYZ .
1118 .
1119 .
1120 .TP
1121 .BI et-al\*n\  string\ m\ n
1122 Control use of
1123 .B "et al"
1124 in the evaluation of
1125 .B @
1126 expressions in label expressions.
1127 .
1128 If the number of authors needed to make the author sequence
1129 unambiguous is
1130 .I u
1131 and the total number of authors is
1132 .I t
1133 then the last
1134 .IR t \|\-\| u
1135 authors will be replaced by
1136 .I string
1137 provided that
1138 .IR t \|\-\| u
1139 is not less than
1140 .I m
1141 and
1142 .I t
1143 is not less than
1144 .IR n .
1145 .
1146 The default behaviour is
1147 .
1148 .RS
1149 .IP
1150 .B
1151 et-al " et al" 2 3
1152 .RE
1153 .
1154 .
1155 .TP
1156 .BI include\  filename
1157 Include
1158 .I filename
1159 and interpret the contents as commands.
1160 .
1161 .
1162 .TP
1163 .BI join-authors\  string1\ string2\ string3
1164 This says how authors should be joined together.
1165 .
1166 When there are exactly two authors, they will be joined with
1167 .IR string1 .
1168 .
1169 When there are more than two authors,
1170 all but the last two will be joined with
1171 .IR string2 ,
1172 and the last two authors will be joined with
1173 .IR string3 .
1174 .
1175 If
1176 .I string3
1177 is omitted,
1178 it will default to
1179 .IR string1 ;
1180 if
1181 .I string2
1182 is also omitted it will also default to
1183 .IR string1 .
1184 .
1185 For example,
1186 .
1187 .RS
1188 .IP
1189 .B
1190 join-authors " and " ", " ", and "
1191 .
1192 .
1193 .LP
1194 will restore the default method for joining authors.
1195 .RE
1196 .
1197 .
1198 .TP
1199 .B label-in-reference\*n
1200 When outputting the reference,
1201 define the string
1202 .B [F
1203 to be the reference's label.
1204 .
1205 This is the default behaviour; so the negative version
1206 of this command is more useful.
1207 .
1208 .
1209 .TP
1210 .B label-in-text\*n
1211 For each reference output a label in the text.
1212 .
1213 The label will be separated from the surrounding text as described in the
1214 .B bracket-label
1215 command.
1216 .
1217 This is the default behaviour; so the negative version
1218 of this command is more useful.
1219 .
1220 .
1221 .TP
1222 .BI label\  string
1223 .I string
1224 is a label expression describing how to label each reference.
1225 .
1226 .
1227 .TP
1228 .BI separate-label-second-parts\  string
1229 When merging two-part labels, separate the second part of the second
1230 label from the first label with
1231 .IR string .
1232 .
1233 See the description of the
1234 .B <>
1235 label expression.
1236 .
1237 .
1238 .TP
1239 .B move-punctuation\*n
1240 In the text,
1241 move any punctuation at the end of line past the label.
1242 .
1243 It is usually a good idea to give this command unless you are using
1244 superscripted numbers as labels.
1245 .
1246 .
1247 .TP
1248 .BI reverse\*n\  string
1249 Reverse the fields whose names
1250 are in
1251 .IR string .
1252 .
1253 Each field name can be followed by a number which says
1254 how many such fields should be reversed.
1255 .
1256 If no number is given for a field, all such fields will be reversed.
1257 .
1258 .
1259 .TP
1260 .BI search-ignore\*n\  fields
1261 While searching for keys in databases for which no index exists,
1262 ignore the contents of
1263 .IR fields .
1264 .
1265 Initially, fields
1266 .B XYZ
1267 are ignored.
1268 .
1269 .
1270 .TP
1271 .BI search-truncate\*n\  n
1272 Only require the first
1273 .I n
1274 characters of keys to be given.
1275 .
1276 In effect when searching for a given key words in the database are
1277 truncated to the maximum of
1278 .I n
1279 and the length of the key.
1280 .
1281 Initially
1282 .I n
1283 is\ 6.
1284 .
1285 .
1286 .TP
1287 .BI short-label\*n\  string
1288 .I string
1289 is a label expression that specifies an alternative (usually shorter)
1290 style of label.
1291 .
1292 This is used when the
1293 .B #
1294 flag is given in the citation.
1295 .
1296 When using author-date style labels, the identity of the author
1297 or authors is sometimes clear from the context, and so it
1298 may be desirable to omit the author or authors from the label.
1299 .
1300 The
1301 .B short-label
1302 command will typically be used to specify a label containing just
1303 a date and possibly a disambiguating letter.
1304 .
1305 .
1306 .TP
1307 .BI sort\*n\  string
1308 Sort references according to
1309 .BR string .
1310 .
1311 References will automatically be accumulated.
1312 .
1313 .I string
1314 should be a list of field names,
1315 each followed by a number,
1316 indicating how many fields with the name should be used for sorting.
1317 .
1318 .B +
1319 can be used to indicate that all the fields with the name should be used.
1320 .
1321 Also
1322 .B .\&
1323 can be used to indicate the references should be sorted using the
1324 (tentative) label.
1325 .
1326 (The
1327 .B "Label expressions"
1328 subsection describes the concept of a tentative label.)
1329 .
1330 .
1331 .TP
1332 .B sort-adjacent-labels\*n
1333 Sort labels that are adjacent in the text according to their position
1334 in the reference list.
1335 .
1336 This command should usually be given if the
1337 .B abbreviate-label-ranges
1338 command has been given,
1339 or if the label expression contains a
1340 .B <>
1341 expression.
1342 .
1343 This will have no effect unless references are being accumulated.
1344 .
1345 .
1346 .\" --------------------------------------------------------------------
1347 .SS Label expressions
1348 .\" --------------------------------------------------------------------
1349 .
1350 Label expressions can be evaluated both normally and tentatively.
1351 .
1352 The result of normal evaluation is used for output.
1353 .
1354 The result of tentative evaluation, called the
1355 .IR "tentative label" ,
1356 is used to gather the information that normal evaluation needs to
1357 disambiguate the label.
1358 .
1359 Label expressions specified by the
1360 .B date-as-label
1361 and
1362 .B short-label
1363 commands are not evaluated tentatively.
1364 .
1365 Normal and tentative evaluation are the same for all types of
1366 expression other than
1367 .BR @ ,
1368 .BR * ,
1369 and
1370 .B %
1371 expressions.
1372 .
1373 The description below applies to normal evaluation,
1374 except where otherwise specified.
1375 .
1376 .
1377 .TP
1378 .I field
1379 .TQ
1380 .I field\ n
1381 The
1382 .IR n -th
1383 part of
1384 .IR field .
1385 .
1386 If
1387 .I n
1388 is omitted, it defaults to\ 1.
1389 .
1390 .
1391 .TP
1392 .BI ' string '
1393 The characters in
1394 .I string
1395 literally.
1396 .
1397 .
1398 .TP
1399 .B @
1400 All the authors joined as specified by the
1401 .B join-authors
1402 command.
1403 .
1404 The whole of each author's name will be used.
1405 .
1406 However, if the references are sorted by author (that is the sort
1407 specification starts with
1408 .BR A+ ),
1409 then authors last names will be used instead,
1410 provided that this does not introduce ambiguity,
1411 and also an initial subsequence of the authors may be used instead of
1412 all the authors,
1413 again provided that this does not introduce ambiguity.
1414 .
1415 The use of only the last name for the
1416 .IR i -th
1417 author of some reference
1418 is considered to be ambiguous if
1419 there is some other reference,
1420 such that the first
1421 .IR i \|\-\|1
1422 authors of the references are the same,
1423 the
1424 .IR i -th
1425 authors are not the same,
1426 but the
1427 .IR i -th
1428 authors last names are the same.
1429 .
1430 A proper initial subsequence of the sequence of authors for some
1431 reference is considered to be ambiguous if there is a reference with
1432 some other sequence of authors which also has that subsequence as a
1433 proper initial subsequence.
1434 .
1435 When an initial subsequence of authors is used, the remaining authors
1436 are replaced by the string specified by the
1437 .B et-al
1438 command;
1439 this command may also specify additional requirements that must be
1440 met before an initial subsequence can be used.
1441 .
1442 .B @
1443 tentatively evaluates to a canonical representation of the authors,
1444 such that authors that compare equally for sorting purpose will have
1445 the same representation.
1446 .
1447 .
1448 .TP
1449 .BI % n
1450 .TQ
1451 .B %a
1452 .TQ
1453 .B %A
1454 .TQ
1455 .B %i
1456 .TQ
1457 .B %I
1458 The serial number of the reference formatted according to the
1459 character following the
1460 .BR % .
1461 The serial number of a reference is\ 1 plus the number of earlier
1462 references with same tentative label as this reference.
1463 .
1464 These expressions tentatively evaluate to an empty string.
1465 .
1466 .TP
1467 .IB expr *
1468 If there is another reference with the same tentative label as this
1469 reference,
1470 then
1471 .IR expr ,
1472 otherwise an empty string.
1473 .
1474 It tentatively evaluates to an empty string.
1475 .
1476 .
1477 .TP
1478 .IB expr + n
1479 .TQ
1480 .IB expr \- n
1481 The first
1482 .RB ( + )
1483 or last
1484 .RB ( \- )
1485 .I n
1486 upper or lower case letters or digits of
1487 .IR expr .
1488 .
1489 Troff special characters (such as
1490 .BR \e('a )
1491 count as a single letter.
1492 .
1493 Accent strings are retained but do not count towards the total.
1494 .
1495 .
1496 .TP
1497 .IB expr .l
1498 .I expr
1499 converted to lowercase.
1500 .
1501 .
1502 .TP
1503 .IB expr .u
1504 .I expr
1505 converted to uppercase.
1506 .
1507 .
1508 .TP
1509 .IB expr .c
1510 .I expr
1511 converted to caps and small caps.
1512 .
1513 .
1514 .TP
1515 .IB expr .r
1516 .I expr
1517 reversed so that the last name is first.
1518 .
1519 .
1520 .TP
1521 .IB expr .a
1522 .I expr
1523 with first names abbreviated.
1524 .
1525 Note that fields specified in the
1526 .B abbreviate
1527 command are abbreviated before any labels are evaluated.
1528 .
1529 Thus
1530 .B .a
1531 is useful only when you want a field to be abbreviated in a label
1532 but not in a reference.
1533 .
1534 .
1535 .TP
1536 .IB expr .y
1537 The year part of
1538 .IR expr .
1539 .
1540 .
1541 .TP
1542 .IB expr .+y
1543 The part of
1544 .I expr
1545 before the year,
1546 or the whole of
1547 .I expr
1548 if it does not contain a year.
1549 .
1550 .
1551 .TP
1552 .IB expr .\-y
1553 The part of
1554 .I expr
1555 after the year,
1556 or an empty string if
1557 .I expr
1558 does not contain a year.
1559 .
1560 .
1561 .TP
1562 .IB expr .n
1563 The last name part of
1564 .IR expr .
1565 .
1566 .
1567 .TP
1568 .IB expr1 \(ti expr2
1569 .I expr1
1570 except that if the last character of
1571 .I expr1
1572 is
1573 .B \-
1574 then it will be replaced by
1575 .IR expr2 .
1576 .
1577 .
1578 .TP
1579 .I expr1\ expr2
1580 The concatenation of
1581 .I expr1
1582 and
1583 .IR expr2 .
1584 .
1585 .
1586 .TP
1587 .IB expr1 | expr2
1588 If
1589 .I expr1
1590 is non-empty then
1591 .I expr1
1592 otherwise
1593 .IR expr2 .
1594 .
1595 .
1596 .TP
1597 .IB expr1 & expr2
1598 If
1599 .I expr1
1600 is non-empty
1601 then
1602 .I expr2
1603 otherwise an empty string.
1604 .
1605 .
1606 .TP
1607 .IB expr1 ? expr2 : expr3
1608 If
1609 .I expr1
1610 is non-empty
1611 then
1612 .I expr2
1613 otherwise
1614 .IR expr3 .
1615 .
1616 .
1617 .TP
1618 .BI < expr >
1619 The label is in two parts, which are separated by
1620 .IR expr .
1621 .
1622 Two adjacent two-part labels which have the same first part will be
1623 merged by appending the second part of the second label onto the first
1624 label separated by the string specified in the
1625 .B separate-label-second-parts
1626 command (initially,
1627 a comma followed by a space);
1628 the resulting label will also be a two-part label with the same first
1629 part as before merging,
1630 and so additional labels can be merged into it.
1631 .
1632 Note that it is permissible for the first part to be empty;
1633 this maybe desirable for expressions used in the
1634 .B short-label
1635 command.
1636 .
1637 .
1638 .TP
1639 .BI ( expr )
1640 The same as
1641 .IR expr .
1642 .
1643 Used for grouping.
1644 .
1645 .
1646 .LP
1647 The above expressions are listed in order of precedence
1648 (highest first);
1649 .B &
1650 and
1651 .B |
1652 have the same precedence.
1653 .
1654 .
1655 .\" --------------------------------------------------------------------
1656 .SS Macro interface
1657 .\" --------------------------------------------------------------------
1658 .
1659 Each reference starts with a call to the macro
1660 .BR ]- .
1661 .
1662 The string
1663 .B [F
1664 will be defined to be the label for this reference,
1665 unless the
1666 .B no-label-in-reference
1667 command has been given.
1668 .
1669 There then follows a series of string definitions,
1670 one for each field:
1671 string
1672 .BI [ X
1673 corresponds to field
1674 .IR X .
1675 .
1676 The number register
1677 .B [P
1678 is set to\ 1 if the
1679 .B P
1680 field contains a range of pages.
1681 .
1682 The
1683 .BR [T ,
1684 .B [A
1685 and
1686 .B [O
1687 number registers are set to\ 1 according as the
1688 .BR T ,
1689 .B A
1690 and
1691 .B O
1692 fields end with one of the characters
1693 .BR .?! .
1694 .
1695 The
1696 .B [E
1697 number register will be set to\ 1 if the
1698 .B [E
1699 string contains more than one name.
1700 .
1701 The reference is followed by a call to the
1702 .B ][
1703 macro.
1704 .
1705 The first argument to this macro gives a number representing
1706 the type of the reference.
1707 .
1708 If a reference contains a
1709 .B J
1710 field, it will be classified as type\ 1,
1711 otherwise if it contains a
1712 .B B
1713 field, it will type\ 3,
1714 otherwise if it contains a
1715 .B G
1716 or
1717 .B R
1718 field it will be type\ 4,
1719 otherwise if contains a
1720 .B I
1721 field it will be type\ 2,
1722 otherwise it will be type\ 0.
1723 .
1724 The second argument is a symbolic name for the type:
1725 .BR other ,
1726 .BR journal-article ,
1727 .BR book ,
1728 .B article-in-book
1729 or
1730 .BR tech-report .
1731 .
1732 Groups of references that have been accumulated or are produced by the
1733 .B bibliography
1734 command are preceded by a call to the
1735 .B ]<
1736 macro and followed by a call to the
1737 .B ]>
1738 macro.
1739 .
1740 .
1741 .\" --------------------------------------------------------------------
1742 .SH FILES
1743 .\" --------------------------------------------------------------------
1744 .
1745 .Tp \w'\fB@DEFAULT_INDEX@'u+2n
1746 .B @DEFAULT_INDEX@
1747 Default database.
1748 .
1749 .
1750 .TP
1751 .IB file @INDEX_SUFFIX@
1752 Index files.
1753 .
1754 .
1755 .LP
1756 .B refer
1757 uses temporary files.
1758 .
1759 See the
1760 .BR groff (@MAN1EXT@)
1761 man page for details where such files are created.
1762 .
1763 .
1764 .\" --------------------------------------------------------------------
1765 .SH ENVIRONMENT
1766 .\" --------------------------------------------------------------------
1767 .
1768 .Tp \w'\fBREFER'u+2n
1769 .B REFER
1770 If set, overrides the default database.
1771 .
1772 .
1773 .\" --------------------------------------------------------------------
1774 .SH "SEE ALSO"
1775 .\" --------------------------------------------------------------------
1776 .
1777 .BR @g@indxbib (@MAN1EXT@),
1778 .BR @g@lookbib (@MAN1EXT@),
1779 .BR lkbib (@MAN1EXT@)
1780 .br
1781 .
1782 .
1783 .\" --------------------------------------------------------------------
1784 .SH BUGS
1785 .\" --------------------------------------------------------------------
1786 .
1787 In label expressions,
1788 .B <>
1789 expressions are ignored inside
1790 .BI . char
1791 expressions.
1792 .
1793 .
1794 .\" --------------------------------------------------------------------
1795 .SH COPYING
1796 .\" --------------------------------------------------------------------
1797 .co
1798 .
1799 .
1800 .\" Local Variables:
1801 .\" mode: nroff
1802 .\" End: