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