Update to groff 1.19.2.
[dragonfly.git] / contrib / groff-1.19 / tmac / groff_ms.man
1 '\" t
2 .ig
3 Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2005
4   Free Software Foundation, Inc.
5
6 Permission is granted to make and distribute verbatim copies of
7 this manual provided the copyright notice and this permission notice
8 are preserved on all copies.
9
10 Permission is granted to copy and distribute modified versions of this
11 manual under the conditions for verbatim copying, provided that the
12 entire resulting derived work is distributed under the terms of a
13 permission notice identical to this one.
14
15 Permission is granted to copy and distribute translations of this
16 manual into another language, under the above conditions for modified
17 versions, except that this permission notice may be included in
18 translations approved by the Free Software Foundation instead of in
19 the original English.
20 ..
21 .
22 .do nr groff_ms_C \n[.C]
23 .cp 0
24 .
25 .TH GROFF_MS @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
26 .
27 .
28 .
29 .SH NAME
30 .
31 groff_ms \- groff ms macros
32 .
33 .
34 .
35 .SH SYNOPSIS
36 .
37 .B groff
38 .B \-ms
39 [
40 .IR options .\|.\|.\&
41 ]
42 [
43 .IR files .\|.\|.\&
44 ]
45 .br
46 .B groff
47 .B \-m\ ms
48 [
49 .IR options .\|.\|.\&
50 ]
51 [
52 .IR files .\|.\|.\&
53 ]
54 .
55 .
56 .
57 .SH DESCRIPTION
58 .
59 This manual page describes the GNU version of the
60 .I ms
61 macros,
62 part of the
63 .I groff
64 typesetting system.
65 The
66 .I ms
67 macros are mostly compatible with the
68 documented behavior of the 4.3
69 .SM BSD
70 Unix
71 .I ms
72 macros (see
73 .I Differences from troff ms
74 below for details).
75 The
76 .I ms
77 macros are suitable for reports, letters, books, and
78 technical documentation.
79 .
80 .
81 .
82 .SH USAGE
83 .
84 The
85 .I ms
86 macro package expects files to have
87 a certain amount of structure.
88 The simplest documents can begin with a paragraph macro
89 and consist of text separated by paragraph macros
90 or even blank lines.
91 Longer documents have a structure as follows:
92 .
93 .TP
94 .B "Document type"
95 If you use the
96 .B RP
97 (report) macro at the beginning of the document,
98 .I groff
99 prints the cover page information on its own page;
100 otherwise it prints the information on the
101 first page with your document text immediately following.
102 Other document formats found in AT&T
103 .I troff
104 are specific to AT&T
105 or Berkeley, and are not supported in
106 .IR "groff ms" .
107 .
108 .TP
109 .B "Format and layout"
110 By setting number registers,
111 you can change your document's type (font and size),
112 margins, spacing, headers and footers, and footnotes.
113 See 
114 .I "Document control registers"
115 below for more details.
116 .
117 .TP
118 .B "Cover page"
119 A cover page consists of a title,
120 and optionally the author's name and institution,
121 an abstract, and the date.
122 See
123 .I "Cover page macros"
124 below for more details.
125 .
126 .TP
127 .B "Body"
128 Following the cover page is your document.
129 It consists of paragraphs, headings, and lists.
130 .
131 .TP
132 .B "Table of contents"
133 Longer documents usually include a table of contents,
134 which you can add by placing the
135 .B TC
136 macro at the end of your document.
137 .
138 .
139 .SS "Document control registers"
140 .
141 The following table lists the document control
142 number registers.
143 For the sake of consistency,
144 set registers related to margins at the beginning of your document,
145 or just after the
146 .B RP
147 macro.
148 .
149 .LP
150 .ne 12
151 .B Margin settings
152 .RS
153 .na
154 .TS
155 cb   s cb s s cb s cb s
156 afCW s l  s s l  s l  s.
157 Reg.    Definition      Effective       Default
158 _
159 PO      T{
160 Page offset (left margin)
161 T}      T{
162 next page
163 T}      1i
164 LL      T{
165 Line length
166 T}      next para.      6i
167 LT      T{
168 Header/footer length
169 T}      next para.      6i
170 HM      T{
171 Top (header) margin
172 T}      next page       1i
173 FM      T{
174 Bottom (footer) margin
175 T}      next page       1i
176 _
177 .TE
178 .RE
179 .
180 .LP
181 .ne 12
182 .B Text settings
183 .RS
184 .TS
185 cb   s cb s s cb s cb s
186 afCW s l  s s l  s l  s.
187 Reg.    Definition      Effective       Default
188 _
189 PS      T{
190 Point size
191 T}      next para.      10p
192 VS      T{
193 Line spacing (leading)
194 T}      next para.      12p
195 PSINCR  T{
196 Point size increment
197 for section headings of
198 increasing importance
199 T}      next heading    1p
200 GROWPS  T{
201 Heading level
202 beyond which PSINCR
203 is ignored
204 T}      next heading    0
205 _
206 .TE
207 .RE
208 .
209 .LP
210 .ne 11
211 .B Paragraph settings
212 .RS
213 .TS
214 cb cb s cb cb
215 afCW l s l l .
216 Reg.    Definition      Effective       Default
217 _
218 PI      T{
219 Initial indent
220 T}      next para.      5n
221 PD      T{
222 Space between paragraphs
223 T}      next para.      0.3v
224 QI      T{
225 Quoted paragraph indent
226 T}      next para.      5n
227 PORPHANS        T{
228 Number of initial lines
229 to be kept together
230 T}      next para.      1
231 HORPHANS        T{
232 Number of initial lines
233 to be kept with heading
234 T}      next heading    1
235 _
236 .TE
237 .RE
238 .
239 .LP
240 .ne 7
241 .B Footnote settings
242 .RS
243 .TS
244 cb cb cb cb
245 afCW l l l .
246 Reg.    Definition      Effective       Default
247 _
248 FL      Footnote length next footnote   \[rs]n[LL]*5/6
249 FI      Footnote indent next footnote   2n
250 FF      Footnote format next footnote   0
251 FPS     Point size      next footnote   \[rs]n[PS]-2
252 FVS     Vert. spacing   next footnote   \[rs]n[FPS]+2
253 FPD     Para. spacing   next footnote   \[rs]n[PD]/2
254 _
255 .TE
256 .RE
257 .
258 .LP
259 .ne 6
260 .B Other settings
261 .RS
262 .TS
263 cb   s cb s s cb s cb s
264 afCW s l  s s l  s l  s.
265 Reg.    Definition      Effective       Default
266 _
267 MINGW   T{
268 Minimum width between columns
269 T}      next page       2n
270 _
271 .TE
272 .ad
273 .RE
274 .
275 .
276 .SS "Cover page macros"
277 .
278 Use the following macros to create a cover page for your document
279 in the order shown.
280 .
281 .TP
282 .B .RP [no]
283 Specifies the report format for your document.
284 The report format creates a separate cover page.
285 With no
286 .B RP
287 macro,
288 .I groff
289 prints a subset of the
290 cover page on page\~1 of your document.
291 .
292 .IP
293 If you use the optional
294 .B no
295 argument,
296 .I groff
297 prints a title page but
298 does not repeat any of the title page information
299 (title, author, abstract, etc.\&)
300 on page\~1 of the document.
301 .
302 .TP
303 .B .P1 
304 (P-one) Prints the header on page\~1.
305 The default is to suppress the header.
306 .
307 .TP
308 .BI ".DA [" xxx ]
309 (optional) Print the current date,
310 or the arguments to the macro if any,
311 on the title page (if specified)
312 and in the footers.
313 This is the default for
314 .IR nroff .
315 .
316 .TP
317 .BI ".ND [" xxx ]
318 (optional) Print the current date,
319 or the arguments to the macro if any,
320 on the title page (if specified)
321 but not in the footers.
322 This is the default for
323 .IR troff .
324 .
325 .TP
326 .B .TL
327 Specifies the document title.
328 .I Groff
329 collects text following the
330 .B TL
331 macro into the title, until reaching the author name or abstract.
332 .
333 .TP
334 .B .AU
335 Specifies the author's name.
336 You can specify multiple authors by using an
337 .B AU
338 macro for each author.
339 .
340 .TP
341 .B .AI
342 Specifies the author's institution.
343 You can specify multiple institutions.
344 .
345 .TP
346 .B .AB [no]
347 Begins the abstract.
348 The default is to print the word
349 .BR ABSTRACT ,
350 centered and in italics, above the text of the abstract.
351 The option
352 .B no
353 suppresses this heading.
354 .
355 .TP
356 .B .AE
357 End the abstract.
358 .
359 .
360 .SS Paragraphs
361 .
362 Use the
363 .B PP
364 macro to create indented paragraphs,
365 and the
366 .B LP
367 macro to create paragraphs with no initial indent.
368 .
369 .PP
370 The
371 .B QP
372 macro indents all text at both left and right margins.
373 The effect is identical to the HTML
374 .B <BLOCKQUOTE>
375 element.
376 The next paragraph or heading
377 returns margins to normal.
378 .
379 .PP
380 The
381 .B XP
382 macro produces an exdented paragraph.
383 The first line of the paragraph begins at
384 the left margin,
385 and subsequent lines are indented
386 (the opposite of
387 .BR PP ).
388 .
389 .PP
390 For each of the above paragraph types,
391 and also for any list entry introduced by the
392 .B IP
393 macro
394 (described later),
395 the document control register
396 .BR PORPHANS ,
397 sets the
398 .I minimum
399 number of lines which must be printed,
400 after the start of the paragraph,
401 and before any page break occurs.
402 If there is insufficient space remaining on the current page
403 to accommodate this number of lines,
404 then a page break is forced
405 .I before
406 the first line of the paragraph is printed.
407 .
408 .PP
409 Similarly,
410 when a section heading
411 (see subsection
412 .I Headings
413 below)
414 preceeds any of these paragraph types,
415 the
416 .B HORPHANS
417 document control register specifies the
418 .I minimum
419 number of lines of the paragraph
420 which must be kept on the same page as the heading.
421 If insufficient space remains on the current page
422 to accommodate the heading and this number of lines of paragraph text,
423 then a page break is forced
424 .I before
425 the heading is printed.
426 .
427 .
428 .SS Headings
429 .
430 Use headings to create a hierarchical structure
431 for your document.
432 By default,
433 the
434 .I ms
435 macros print headings in
436 .B bold
437 using the same font family and point size as the body text.
438 For output devices which support scalable fonts,
439 this behaviour may be modified,
440 by defining the document control registers,
441 .B GROWPS
442 and
443 .BR PSINCR .
444 .
445 .PP
446 The following heading macros are available:
447 .
448 .TP
449 .BI .NH\  xx
450 Numbered heading.
451 The argument
452 .I xx
453 is either a numeric argument to indicate the
454 level of the heading, or
455 .I S\ xx\ xx\ \c
456 ".\|.\|."
457 to set the section number explicitly.
458 If you specify heading levels out of sequence,
459 such as invoking
460 .B ".NH\ 3"
461 after
462 .BR ".NH\ 1" ,
463 .I groff
464 prints a warning on standard error.
465 .
466 .IP
467 If the
468 .B GROWPS
469 register is set to a value
470 greater than the level of the heading,
471 then the point size of the heading will be increased by
472 .B PSINCR
473 units over the text size specified by the
474 .B PS
475 register,
476 for each level by which the heading level is less than
477 the value of
478 .BR GROWPS .
479 For example,
480 the sequence:
481 .
482 .RS
483 .ne 12
484 .nf
485 .IP
486 \&.nr PS 10
487 \&.nr GROWPS 3
488 \&.nr PSINCR 1.5p
489 \&.
490 \&.NH 1
491 Top Level Heading
492 \&.
493 \&.NH 2
494 Second Level Heading
495 \&.
496 \&.NH 3
497 Third Level Heading
498 .fi
499 .RE
500 .
501 .IP
502 will cause
503 .RI \*(lq 1.\ Top\ Level\ Heading \*(rq
504 to be printed in 13pt
505 .B bold
506 text, followed by
507 .RI \*(lq 1.1.\ Second\ Level\ Heading \*(rq
508 in 11.5pt
509 .B bold
510 text, while
511 .RI \*(lq 1.1.1.\ Third\ Level\ Heading \*(rq,
512 and all more deeply nested heading levels,
513 will remain in the 10pt
514 .B bold
515 text which is specified by the
516 .B PS
517 register.
518 .
519 .IP
520 Note that the value stored in
521 .B PSINCR
522 is interpreted in
523 .I groff
524 basic units;
525 the
526 .I p
527 scaling factor should be employed,
528 when assigning a value specified in points.
529 .
530 .IP
531 After invoking
532 .BR .NH ,
533 the assigned heading number is available in the strings
534 .B SN-DOT
535 (exactly as it appears in the formatted heading),
536 and
537 .B SN-NO-DOT
538 (with its final period omitted).
539 The string
540 .B SN
541 is also defined,
542 as an alias for
543 .BR SN-DOT ;
544 if preferred,
545 the user may redefine it as an alias for
546 .BR SN-NO-DOT ,
547 'ne 10
548 by including the initialisation:
549 .
550 .RS
551 .nf
552 .IP
553 \&.ds SN-NO-DOT
554 \&.als SN SN-NO-DOT
555 .fi
556 .RE
557 .
558 .IP
559 .I before
560 the first use of
561 .BR .NH ,
562 or simply:
563 .
564 .RS
565 .nf
566 .IP
567 \&.als SN SN-NO-DOT
568 .fi
569 .RE
570 .
571 .IP
572 .I after
573 the first use of
574 .BR .NH .
575 .
576 .TP
577 .BI .SH\ [ xx ]
578 Unnumbered subheading.
579 The use of the optional
580 .I xx
581 argument is a GNU extension,
582 which adjusts the point size of the unnumbered subheading
583 to match that of a numbered heading,
584 introduced using
585 .BI .NH\  xx
586 with the same value of
587 .IR xx .
588 For example,
589 given the same settings for
590 .BR PS ,
591 .B GROWPS
592 and
593 .BR PSINCR ,
594 as used in the preceeding
595 .B .NH
596 example,
597 the sequence:
598 .
599 .RS
600 .ne
601 .nf
602 .IP
603 \&.SH 2
604 An Unnumbered Subheading
605 .fi
606 .RE
607 .
608 .IP
609 will print
610 .RI \*(lq "An Unnumbered Subheading" \*(rq
611 in 11.5pt
612 .B bold
613 text.
614 .
615 .
616 .SS Highlighting
617 .
618 The
619 .I ms
620 macros provide a variety of methods to highlight
621 or emphasize text:
622 .
623 .TP
624 .B ".B [\fItxt\fP [\fIpost\fP [\fIpre\fP]]]"
625 Sets its first argument in
626 .BR "bold type" .
627 If you specify a second argument,
628 .I groff
629 prints it in the previous font after
630 the bold text, with no intervening space
631 (this allows you to set punctuation after
632 the highlighted text without highlighting
633 the punctuation).
634 Similarly, it prints the third argument (if any)
635 in the previous font
636 .B before
637 the first argument.
638 For example,
639 .RS
640 .
641 .IP
642 \&.B foo ) (
643 .RE
644 .
645 .IP
646 prints
647 .RB ( foo ).
648 .
649 .IP
650 If you give this macro no arguments,
651 .I groff
652 prints all text following in bold until
653 the next highlighting, paragraph, or heading macro.
654 .
655 .TP
656 .B ".R [\fItxt\fP [\fIpost\fP [\fIpre\fP]]]"
657 Sets its first argument in
658 roman (or regular) type.
659 It operates similarly to the
660 .B B
661 macro otherwise.
662 .
663 .TP
664 .B ".I [\fItxt\fP [\fIpost\fP [\fIpre\fP]]]"
665 Sets its first argument in
666 .IR "italic type" .
667 It operates similarly to the
668 .B B
669 macro otherwise.
670 .
671 .TP
672 .B ".CW [\fItxt\fP [\fIpost\fP [\fIpre\fP]]]"
673 Sets its first argument in a constant width face.
674 It operates similarly to the
675 .B B
676 macro otherwise.
677 .
678 .TP
679 .B ".BI [\fItxt\fP [\fIpost\fP [\fIpre\fP]]]"
680 Sets its first argument in bold italic type.
681 It operates similarly to the
682 .B B
683 macro otherwise.
684 .
685 .TP
686 .BI ".BX [" txt ]
687 Prints its argument and draws a box around it.
688 If you want to box a string that contains spaces,
689 use a digit-width space (\[rs]0).
690 .
691 .TP
692 .BI ".UL [" txt " [" post ]]
693 Prints its first argument with an underline.
694 If you specify a second argument,
695 .I groff
696 prints it in the previous font after
697 the underlined text, with no intervening space.
698 .
699 .TP
700 .B .LG
701 Prints all text following in larger type
702 (2\~points larger than the current point size) until
703 the next font size, highlighting, paragraph, or heading macro.
704 You can specify this macro multiple times
705 to enlarge the point size as needed.
706 .
707 .TP
708 .B .SM
709 Prints all text following in
710 smaller type
711 (2\~points smaller than the current point size) until
712 the next type size, highlighting, paragraph, or heading macro.
713 You can specify this macro multiple times
714 to reduce the point size as needed.
715 .
716 .TP
717 .B .NL
718 Prints all text following in
719 the normal point size
720 (that is, the value of the
721 .B PS
722 register).
723 .
724 .TP
725 .BI \[rs]*{ text \[rs]*}
726 Print the enclosed
727 .I text
728 as a superscript.
729 .
730 .
731 .SS Indents
732 .
733 You may need to indent sections of text.
734 A typical use for indents is to create nested lists and sublists.
735 .
736 .PP
737 Use the
738 .B RS
739 and
740 .B RE
741 macros to start and end a section of indented text, respectively.
742 The
743 .B PI
744 register controls the amount of indent.
745 .
746 .PP
747 You can nest indented sections as deeply as needed by
748 using multiple, nested pairs of
749 .B RS
750 and
751 .BR RE .
752 .
753 .
754 .SS Lists
755 .
756 The
757 .B IP
758 macro handles duties for all lists.
759 Its syntax is as follows:
760 .
761 .TP
762 .BI ".IP [" marker " [" width ]]
763 .
764 .IP
765 The
766 .I marker
767 is usually a bullet character
768 .B \[rs](bu
769 for unordered lists,
770 a number (or auto-incrementing number register) for numbered lists,
771 or a word or phrase for indented (glossary-style) lists.
772 .
773 .IP
774 The
775 .I width
776 specifies the indent for the body of each list item.
777 Once specified, the indent remains the same for all
778 list items in the document until specified again.
779 .\" -----
780 .br
781 .ne 15
782 .
783 .
784 .SS "Tab stops"
785 .
786 Use the
787 .B ta
788 request to set tab stops as needed.
789 Use the
790 .B TA
791 macro to reset tabs to the default (every 5n).
792 You can redefine the
793 .B TA
794 macro to create a different set of default tab stops.
795 .
796 .
797 .SS "Displays and keeps"
798 .
799 Use displays to show text-based examples or figures
800 (such as code listings).
801 Displays turn off filling, so lines of code can be
802 displayed as-is without inserting
803 .B br
804 requests in between each line.
805 Displays can be 
806 .I kept
807 on a single page, or allowed to break across pages.
808 The following table shows the display types available.
809 .RS
810 .ne 11
811 .na
812 .TS
813 cb   s s    s cbt s s
814 cb   s cb   s ^   s s
815 lfCW s lfCW s l   s s.
816 Display macro   Type of display
817 With keep       No keep
818 _
819 \&.DS L \&.LD   Left-justified.
820 \&.DS I [\fIindent\fP]  \&.ID   T{
821 Indented (default indent in the \fBDI\fP register).
822 T}
823 \&.DS B \&.BD   T{
824 Block-centered (left-justified, longest line centered).
825 T}
826 \&.DS C \&.CD   Centered.
827 \&.DS R \&.RD   Right-justified.
828 _
829 .TE
830 .RE
831 .ad
832 .
833 .LP
834 Use the
835 .B DE
836 macro to end any display type.
837 The macros
838 .B Ds
839 and
840 .B De
841 were formerly provided as aliases for
842 .B DS
843 and
844 .BR DE ,
845 respectively, but they have been removed, and should no longer be used.
846 X11 documents which actually use
847 .B Ds
848 and
849 .B De
850 always load a specific macro file from the X11 distribution (macros.t)
851 which provides proper definitions for the two macros.
852 .PP
853 To
854 .I keep
855 text together on a page,
856 such as
857 a paragraph that refers to a table (or list, or other item)
858 immediately following, use the
859 .B KS
860 and
861 .B KE
862 macros.
863 The
864 .B KS
865 macro begins a block of text to be kept on a single page,
866 and the
867 .B KE
868 macro ends the block.
869 .
870 .PP
871 You can specify a
872 .I "floating keep"
873 using the
874 .B KF
875 and
876 .B KE
877 macros.
878 If the keep cannot fit on the current page,
879 .I groff
880 holds the contents of the keep and allows text following
881 the keep (in the source file) to fill in the remainder of
882 the current page.
883 When the page breaks,
884 whether by an explicit
885 .B bp
886 request or by reaching the end of the page,
887 .I groff
888 prints the floating keep at the top of the new page.
889 This is useful for printing large graphics or tables
890 that do not need to appear exactly where specified.
891 .
892 .PP
893 The macros
894 .B B1
895 and
896 .B B2
897 can be used to enclose a text within a box;
898 .B .B1
899 begins the box, and
900 .B .B2
901 ends it.
902 Text in the box is automatically placed in a diversion
903 (keep).
904 .
905 .
906 .SS "Tables, figures, equations, and references"
907 .
908 The
909 .I -ms
910 macros support the standard
911 .I groff
912 preprocessors:
913 .IR tbl ,
914 .IR pic ,
915 .IR eqn ,
916 and
917 .IR refer .
918 Mark text meant for preprocessors by enclosing it
919 in pairs of tags as follows:
920 .
921 .TP
922 .BR ".TS [H]" " and " .TE
923 Denotes a table, to be processed by the
924 .I tbl
925 preprocessor.
926 The optional
927 .BR H "\~argument"
928 instructs
929 .I groff
930 to create a running header with the information
931 up to the
932 .B TH
933 macro.
934 .I Groff
935 prints the header at the beginning of the table;
936 if the table runs onto another page,
937 .I groff
938 prints the header on the next page as well.
939 .
940 .TP
941 .BR .PS " and " .PE
942 Denotes a graphic, to be processed by the
943 .I pic
944 preprocessor.
945 You can create a
946 .I pic
947 file by hand, using the
948 AT&T
949 .I pic
950 manual available on the Web as a reference,
951 or by using a graphics program such as
952 .IR xfig .
953 .
954 .TP
955 .BR ".EQ [\fI\,align\/\fP]" " and " .EN
956 Denotes an equation, to be processed by the
957 .I eqn
958 preprocessor.
959 The optional
960 .I align
961 argument can be
962 .BR C ,
963 .BR L ,
964 or\~\c
965 .B I
966 to center (the default), left-justify, or indent
967 the equation.
968 .
969 .TP
970 .BR .[ " and " .]
971 Denotes a reference, to be processed by the
972 .I refer
973 preprocessor.
974 The GNU
975 .IR @g@refer (@MAN1EXT@)
976 manual page provides a comprehensive reference
977 to the preprocessor and the format of the
978 bibliographic database.
979 .
980 .
981 .SS Footnotes
982 .
983 The
984 .I ms
985 macros provide a flexible footnote system.
986 You can specify a numbered footnote by using the
987 .B \[rs]**
988 escape, followed by the text of the footnote
989 enclosed by
990 .B FS
991 and
992 .B FE
993 macros.
994 .
995 .PP
996 You can specify symbolic footnotes
997 by placing the mark character (such as
998 .B \[rs](dg
999 for the dagger character) in the body text,
1000 followed by the text of the footnote
1001 enclosed by
1002 .B FS\ \[rs](dg
1003 and
1004 .B FE
1005 macros.
1006 .
1007 .PP
1008 You can control how
1009 .I groff
1010 prints footnote numbers by changing the value of the
1011 .B FF
1012 register as follows:
1013 .RS
1014 .ne 7
1015 .
1016 .TP
1017 0
1018 Prints the footnote number as a superscript; indents the footnote (default).
1019 .
1020 .TP
1021 1
1022 Prints the number followed by a period (like\~1.\&)
1023 and indents the footnote.
1024 .
1025 .TP
1026 2
1027 Like\~1, without an indent.
1028 .
1029 .TP
1030 3
1031 Like\~1, but prints the footnote number as a hanging paragraph.
1032 .
1033 .LP
1034 .RE
1035 You can use footnotes safely within keeps and displays,
1036 but avoid using numbered footnotes within floating keeps.
1037 You can set a second
1038 .B \[rs]**
1039 between a
1040 .B \[rs]**
1041 and its corresponding
1042 .BR .FS ;
1043 as long as each
1044 .B .FS
1045 occurs
1046 .I after
1047 the corresponding
1048 .B \[rs]**
1049 and the occurrences of
1050 .B .FS
1051 are in the same order as the corresponding occurrences of
1052 .BR \[rs]** .
1053 .
1054 .
1055 .SS "Headers and footers"
1056 .
1057 There are two ways to define headers and footers:
1058 .
1059 .IP \(bu 3n
1060 Use the strings
1061 .BR LH ,
1062 .BR CH ,
1063 and
1064 .B RH
1065 to set the left, center, and right headers; use
1066 .BR LF ,
1067 .BR CF ,
1068 and
1069 .B RF
1070 to set the left, center, and right footers.
1071 This works best for documents that do not distinguish
1072 between odd and even pages.
1073 .
1074 .IP \(bu
1075 Use the
1076 .B OH
1077 and
1078 .B EH
1079 macros to define headers for the odd and even pages; and
1080 .B OF
1081 and
1082 .B EF
1083 macros to define footers for the odd and even pages.
1084 This is more flexible than defining the individual strings.
1085 The syntax for these macros is as follows:
1086 .RS
1087 .
1088 .IP
1089 .B ".OH '\fIleft\fP'\fIcenter\fP'\fIright\fP'"
1090 .RE
1091 .
1092 .IP
1093 You can replace the quote (') marks with any character not
1094 appearing in the header or footer text.
1095 .
1096 .
1097 .SS Margins
1098 .
1099 You control margins using a set of number registers.
1100 The following table lists the register names and defaults:
1101 .RS
1102 .ne 8
1103 .na
1104 .TS
1105 cb   s cb s s cb s cb s
1106 afCW s l  s s l  s l  s.
1107 Reg.    Definition      Effective       Default
1108 _
1109 PO      T{
1110 Page offset (left margin)
1111 T}      next page       1i
1112 LL      T{
1113 Line length
1114 T}      next para.      6i
1115 LT      T{
1116 Header/footer length
1117 T}      next para.      6i
1118 HM      T{
1119 Top (header) margin
1120 T}      next page       1i
1121 FM      T{
1122 Bottom (footer) margin
1123 T}      next page       1i
1124 _
1125 .TE
1126 .RE
1127 .ad
1128 .
1129 .PP
1130 Note that there is no right margin setting.
1131 The combination of page offset and line length
1132 provide the information necessary to
1133 derive the right margin.
1134 .
1135 .
1136 .SS "Multiple columns"
1137 .
1138 The
1139 .I ms
1140 macros can set text in as many columns as will reasonably
1141 fit on the page.
1142 The following macros are available.
1143 All of them force a page break if a multi-column mode is already set.
1144 However, if the current mode is single-column, starting a multi-column
1145 mode does
1146 .I not
1147 force a page break.
1148 .
1149 .TP
1150 .B .1C
1151 Single-column mode.
1152 .
1153 .TP
1154 .B .2C
1155 Two-column mode.
1156 .
1157 .TP
1158 .BI ".MC [" width " [" gutter ]]
1159 Multi-column mode.
1160 If you specify no arguments, it is equivalent to the
1161 .B 2C
1162 macro.
1163 Otherwise,
1164 .I width
1165 is the width of each column and
1166 .I gutter
1167 is the space between columns.
1168 The
1169 .B MINGW
1170 number register is the default gutter width.
1171 .
1172 .
1173 .SS "Creating a table of contents"
1174 .
1175 Wrap text that you want to appear in the
1176 table of contents in
1177 .B XS
1178 and
1179 .B XE
1180 macros.
1181 Use the
1182 .B TC
1183 macro to print the table of contents at the end of the document,
1184 resetting the page number to\~\c
1185 .B i
1186 (Roman numeral\~1).
1187 .
1188 .PP
1189 You can manually create a table of contents
1190 by specifying a page number as the first argument to
1191 .BR XS .
1192 Add subsequent entries using the
1193 .B XA
1194 macro.
1195 For example:
1196 .RS
1197 .
1198 .PP
1199 .ne 8
1200 .nf
1201 \&.XS 1
1202 Introduction
1203 \&.XA 2
1204 A Brief History of the Universe
1205 \&.XA 729
1206 Details of Galactic Formation
1207 \&.\|.\|.
1208 \&.XE
1209 .fi
1210 .RE  
1211 .
1212 .LP  
1213 Use the
1214 .B PX  
1215 macro to print a manually-generated table of contents
1216 without resetting the page number.
1217 .
1218 .PP
1219 If you give the argument
1220 .B no
1221 to either
1222 .B PX
1223 or   
1224 .BR TC ,
1225 .I groff
1226 suppresses printing the title
1227 specified by the
1228 .B \[rs]*[TOC]  
1229 string.
1230 .
1231 .
1232 .SS "Fractional point sizes"
1233 .
1234 Traditionally, the
1235 .I ms
1236 macros only support integer values for the document's font size and
1237 vertical spacing.
1238 To overcome this restriction, values larger than or equal to 1000 are taken
1239 as fractional values, multiplied by 1000.
1240 For example, `.nr\~PS\~10250' sets the font size to 10.25 points.
1241 .
1242 .LP
1243 The following four registers accept fractional point sizes:
1244 .BR PS ,
1245 .BR VS ,
1246 .BR FPS ,
1247 and
1248 .BR FVS .
1249 .
1250 .LP
1251 Due to backwards compatibility, the value of
1252 .B VS
1253 must be smaller than 40000 (this is 40.0 points).
1254 .
1255 .
1256 .
1257 .SH "DIFFERENCES FROM troff ms"
1258 .
1259 The
1260 .I "groff ms"
1261 macros are a complete re-implementation,
1262 using no original AT&T code.
1263 Since they take advantage of the extended features in
1264 .IR groff ,
1265 they cannot be used with AT&T
1266 .IR troff .
1267 Other differences include:
1268 .
1269 .IP \(bu 3n
1270 The internals of
1271 .I "groff ms"
1272 differ from the internals of Unix
1273 .IR ms . 
1274 Documents that depend upon implementation details of Unix
1275 .I ms
1276 may not format properly with
1277 .IR "groff ms" .
1278 .
1279 .IP \(bu
1280 The error-handling policy of
1281 .I "groff ms"
1282 is to detect and report errors,
1283 rather than silently to ignore them.
1284 .
1285 .IP \(bu
1286 Bell Labs localisms are not implemented.
1287 .
1288 .IP \(bu
1289 Berkeley localisms, in particular the
1290 .B TM
1291 and
1292 .B CT
1293 macros,
1294 are not implemented.
1295 .
1296 .IP \(bu
1297 .I "Groff ms"
1298 does not work in compatibility mode (e.g., with the
1299 .B \-C
1300 option).
1301 .
1302 .IP \(bu
1303 There is no support for typewriter-like devices.
1304 .
1305 .IP \(bu
1306 .I "Groff ms"
1307 does not provide cut marks.
1308 .
1309 .IP \(bu
1310 Multiple line spacing is not supported
1311 (use a larger vertical spacing instead).
1312 .
1313 .IP \(bu
1314 Some Unix
1315 .I ms
1316 documentation says that the
1317 .B CW
1318 and
1319 .B GW
1320 number registers can be used to control the column width and
1321 gutter width, respectively.
1322 These number registers are not used in
1323 .IR "groff ms" .
1324 .
1325 .IP \(bu
1326 Macros that cause a reset
1327 (paragraphs, headings, etc.\&)
1328 may change the indent.
1329 Macros that change the indent do not increment or decrement
1330 the indent, but rather set it absolutely.
1331 This can cause problems for documents that define
1332 additional macros of their own.
1333 The solution is to use not the
1334 .B in
1335 request but instead the
1336 .B RS
1337 and
1338 .B RE
1339 macros.
1340 .
1341 .IP \(bu
1342 The number register
1343 .B GS
1344 is set to\~1 by the
1345 .I "groff ms"
1346 macros,
1347 but is not used by the Unix
1348 .I ms
1349 macros.
1350 Documents that need to determine whether
1351 they are being formatted with Unix
1352 .I ms
1353 or
1354 .I "groff ms"
1355 should use this number register.
1356 .
1357 .IP \(bu
1358 To make
1359 .I "groff ms"
1360 use the default page offset (which also specifies the left margin),
1361 the
1362 .B PO
1363 number register must stay undefined until the first
1364 .B ms
1365 macro is evaluated.
1366 This implies that
1367 .B PO
1368 should not be used early in the document, unless it is changed also:
1369 Remember that accessing an undefined register automatically defines it.
1370 .br
1371 .ne 23
1372 .
1373 .
1374 .SS Strings
1375 .
1376 You can redefine the following strings to adapt the
1377 .I "groff ms"
1378 macros to languages other than English:
1379 .TS
1380 center;
1381 cb cb
1382 afCW l .
1383 String  Default Value
1384 _
1385 REFERENCES      References
1386 ABSTRACT        ABSTRACT
1387 TOC     Table of Contents
1388 MONTH1  January
1389 MONTH2  February
1390 MONTH3  March
1391 MONTH4  April
1392 MONTH5  May
1393 MONTH6  June
1394 MONTH7  July
1395 MONTH8  August
1396 MONTH9  September
1397 MONTH10 October
1398 MONTH11 November
1399 MONTH12 December
1400 _
1401 .TE
1402 .
1403 .PP
1404 The
1405 .B \[rs]*-
1406 string produces an em dash \[em] like this.
1407 .
1408 .PP
1409 Use
1410 .B \[rs]*Q
1411 and
1412 .B \[rs]*U
1413 to get a left and right typographer's quote,
1414 respectively, in
1415 .I troff
1416 (and plain quotes in
1417 .IR nroff ).
1418
1419 .
1420 .
1421 .SS Text Settings
1422 .
1423 The
1424 .B FAM
1425 string sets the default font family.
1426 If this string is undefined at initialization,
1427 it is set to Times.
1428 .
1429 .LP
1430 The point size, vertical spacing, and inter-paragraph spacing for footnotes
1431 are controlled by the number registers
1432 .BR FPS ,
1433 .BR FVS ,
1434 and
1435 .BR FPD ;
1436 at initialization these are set to
1437 .BR \[rs]n(PS-2 ,
1438 .BR \[rs]n[FPS]+2 ,
1439 and
1440 .BR \[rs]n(PD/2 ,
1441 respectively.
1442 If any of these registers are defined before initialization,
1443 the initialization macro does not change them.
1444 .
1445 .LP
1446 The hyphenation flags (as set by the
1447 .B hy
1448 request) are set from the
1449 .B HY
1450 register;
1451 the default is\~14.
1452 .
1453 .PP
1454 Improved accent marks
1455 (as originally defined in Berkeley's
1456 .I ms
1457 version)
1458 are available by specifying the
1459 .B AM
1460 macro at the beginning of your document.
1461 You can place an accent over most characters
1462 by specifying the string defining the accent
1463 directly after the character.
1464 For example,
1465 .B n\[rs]*~ 
1466 produces an n with a tilde over it.
1467 .
1468 .
1469 .
1470 .SH "NAMING CONVENTIONS"
1471 .
1472 .
1473 .LP
1474 The following conventions are used for names of macros, strings and
1475 number registers.
1476 External names available to documents that use the
1477 .I "groff ms"
1478 macros contain only uppercase letters and digits.
1479 .
1480 .LP
1481 Internally the macros are divided into modules;
1482 naming conventions are as follows:
1483 .
1484 .IP \(bu 3n
1485 Names used only within one module are of the form
1486 .IB \%module * name\fR.
1487 .
1488 .IP \(bu
1489 Names used outside the module in which they are defined are of the form
1490 .IB \%module @ name\fR.
1491 .
1492 .IP \(bu
1493 Names associated with a particular environment are of the form
1494 .IB \%environment : name\fR;
1495 these are used only within the
1496 .B par
1497 module.
1498 .
1499 .IP \(bu
1500 .I name
1501 does not have a module prefix.
1502 .
1503 .IP \(bu
1504 Constructed names used to implement arrays are of the form
1505 .IB \%array ! index\fR.
1506 .
1507 .PP
1508 Thus the groff ms macros reserve the following names:
1509 .
1510 .IP \(bu 3n
1511 Names containing the characters
1512 .BR * ,
1513 .BR @ ,
1514 and\~\c
1515 .BR : .
1516 .
1517 .IP \(bu
1518 Names containing only uppercase letters and digits.
1519 .
1520 .
1521 .
1522 .SH FILES
1523 .
1524 .B @MACRODIR@/ms.tmac
1525 (a wrapper file for
1526 .BR s.tmac )
1527 .br
1528 .B @MACRODIR@/s.tmac
1529 .
1530 .
1531 .
1532 .SH "SEE ALSO"
1533 .
1534 .BR groff (@MAN1EXT@),
1535 .BR @g@troff (@MAN1EXT@),
1536 .BR @g@tbl (@MAN1EXT@),
1537 .BR @g@pic (@MAN1EXT@),
1538 .BR @g@eqn (@MAN1EXT@),
1539 .BR @g@refer (@MAN1EXT@),
1540 .I Groff: The GNU Implementation of troff
1541 by Trent Fisher and Werner Lemberg.
1542 .
1543 .
1544 .
1545 .SH AUTHOR
1546 .
1547 Original manual page by James Clark
1548 .IR "et al" ;
1549 rewritten by Larry Kollar
1550 (\fIlkollar@despammed.com\fR).
1551 .
1552 .cp \n[groff_ms_C]
1553 .
1554 .\" Local Variables:
1555 .\" mode: nroff
1556 .\" End: