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