1GROFF_MS(7) Miscellaneous Information Manual GROFF_MS(7)
2
3
4
6 groff_ms - groff ms macros
7
9 groff -ms [ options... ] [ files... ]
10 groff -m ms [ options... ] [ files... ]
11
13 This manual page describes the GNU version of the ms macros, part of
14 the groff typesetting system. The ms macros are mostly compatible with
15 the documented behavior of the 4.3 BSD Unix ms macros (see Differences
16 from troff ms below for details). The ms macros are suitable for
17 reports, letters, books, and technical documentation.
18
20 The ms macro package expects files to have a certain amount of struc‐
21 ture. The simplest documents can begin with a paragraph macro and con‐
22 sist of text separated by paragraph macros or even blank lines. Longer
23 documents have a structure as follows:
24
25 Document type
26 If you use the RP (report) macro at the beginning of the docu‐
27 ment, groff prints the cover page information on its own page;
28 otherwise it prints the information on the first page with your
29 document text immediately following. Other document formats
30 found in AT&T troff are specific to AT&T or Berkeley, and are
31 not supported in groff ms.
32
33 Format and layout
34 By setting number registers, you can change your document's type
35 (font and size), margins, spacing, headers and footers, and
36 footnotes. See Document control registers below for more
37 details.
38
39 Cover page
40 A cover page consists of a title, and optionally the author's
41 name and institution, an abstract, and the date. See Cover page
42 macros below for more details.
43
44 Body Following the cover page is your document. It consists of para‐
45 graphs, headings, and lists.
46
47 Table of contents
48 Longer documents usually include a table of contents, which you
49 can add by placing the TC macro at the end of your document.
50
51 Document control registers
52 The following table lists the document control number registers. For
53 the sake of consistency, set registers related to margins at the begin‐
54 ning of your document, or just after the RP macro.
55
56 Margin settings
57
58 Reg. Definition Effective Default
59 ──────────────────────────────────────────────────────
60 PO Page offset (left mar‐ next page 1i
61 gin)
62 LL Line length next para. 6i
63 LT Header/footer length next para. 6i
64 HM Top (header) margin next page 1i
65
66
67 FM Bottom (footer) margin next page 1i
68 ──────────────────────────────────────────────────────
69
70 Text settings
71
72 Reg. Definition Effective Default
73 ──────────────────────────────────────────────────────
74 PS Point size next para. 10p
75 VS Line spacing (leading) next para. 12p
76 ──────────────────────────────────────────────────────
77
78 Paragraph settings
79
80 Reg. Definition Effective Default
81 ───────────────────────────────────────────────────────
82 PI Initial indent next para. 5n
83 PD Space between paragraphs next para. 0.3v
84 QI Quoted paragraph indent next para. 5n
85 ───────────────────────────────────────────────────────
86
87 Footnote settings
88
89 Reg. Definition Effective Default
90 ─────────────────────────────────────────────────
91 FL Footnote length next footnote LL*5/6
92 FI Footnote indent next footnote 2n
93 FF Footnote format next footnote 0
94 ─────────────────────────────────────────────────
95
96 Other settings
97
98 Reg. Definition Effective Default
99 ──────────────────────────────────────────────────────
100 MINGW Minimum width between next page 2n
101 columns
102 ──────────────────────────────────────────────────────
103
104 Cover page macros
105 Use the following macros to create a cover page for your document in
106 the order shown.
107
108 .RP [no]
109 Specifies the report format for your document. The report for‐
110 mat creates a separate cover page. With no RP macro, groff
111 prints a subset of the cover page on page 1 of your document.
112
113 If you use the optional no argument, groff prints a title page
114 but does not repeat any of the title page information (title,
115 author, abstract, etc.) on page 1 of the document.
116
117 .P1 (P-one) Prints the header on page 1. The default is to suppress
118 the header.
119
120 .DA [xxx]
121 (optional) Print the current date, or the arguments to the macro
122 if any, on the title page (if specified) and in the footers.
123 This is the default for nroff.
124
125 .ND [xxx]
126 (optional) Print the current date, or the arguments to the macro
127 if any, on the title page (if specified) but not in the footers.
128 This is the default for troff.
129
130 .TL Specifies the document title. Groff collects text following the
131 TL macro into the title, until reaching the author name or
132 abstract.
133
134 .AU Specifies the author's name. You can specify multiple authors
135 by using an AU macro for each author.
136
137 .AI Specifies the author's institution. You can specify multiple
138 institutions.
139
140 .AB [no]
141 Begins the abstract. The default is to print the word ABSTRACT,
142 centered and in italics, above the text of the abstract. The
143 option no suppresses this heading.
144
145 .AE End the abstract.
146
147 Paragraphs
148 Use the PP macro to create indented paragraphs, and the LP macro to
149 create paragraphs with no initial indent.
150
151 The QP macro indents all text at both left and right margins. The
152 effect is identical to the HTML <BLOCKQUOTE> element. The next para‐
153 graph or heading returns margins to normal.
154
155 The XP macro produces an exdented paragraph. The first line of the
156 paragraph begins at the left margin, and subsequent lines are indented
157 (the opposite of PP).
158
159 Headings
160 Use headings to create a hierarchical structure for your document. The
161 ms macros print headings in bold using the same font family and point
162 size as the body text.
163
164 The following heading macros are available:
165
166 .NH xx Numbered heading. The argument xx is either a numeric argument
167 to indicate the level of the heading, or S xx xx "..." to set
168 the section number explicitly. If you specify heading levels
169 out of sequence, such as invoking .NH 3 after .NH 1, groff
170 prints a warning on standard error.
171
172 .SH Unnumbered subheading.
173
174 Highlighting
175 The ms macros provide a variety of methods to highlight or emphasize
176 text:
177
178 .B [txt [post [pre]]]
179 Sets its first argument in bold type. If you specify a second
180 argument, groff prints it in the previous font after the bold
181 text, with no intervening space (this allows you to set punctua‐
182 tion after the highlighted text without highlighting the punctu‐
183 ation). Similarly, it prints the third argument (if any) in the
184 previous font before the first argument. For example,
185
186 .B foo ) (
187
188 prints (foo).
189
190 If you give this macro no arguments, groff prints all text fol‐
191 lowing in bold until the next highlighting, paragraph, or head‐
192 ing macro.
193
194 .R [txt [post [pre]]]
195 Sets its first argument in roman (or regular) type. It operates
196 similarly to the B macro otherwise.
197
198 .I [txt [post [pre]]]
199 Sets its first argument in italic type. It operates similarly
200 to the B macro otherwise.
201
202 .CW [txt [post [pre]]]
203 Sets its first argument in a constant width face. It operates
204 similarly to the B macro otherwise.
205
206 .BI [txt [post [pre]]]
207 Sets its first argument in bold italic type. It operates simi‐
208 larly to the B macro otherwise.
209
210 .BX [txt]
211 Prints its argument and draws a box around it. If you want to
212 box a string that contains spaces, use a digit-width space (\0).
213
214 .UL [txt [post]]
215 Prints its first argument with an underline. If you specify a
216 second argument, groff prints it in the previous font after the
217 underlined text, with no intervening space.
218
219 .LG Prints all text following in larger type (2 points larger than
220 the current point size) until the next font size, highlighting,
221 paragraph, or heading macro. You can specify this macro multi‐
222 ple times to enlarge the point size as needed.
223
224 .SM Prints all text following in smaller type (2 points smaller than
225 the current point size) until the next type size, highlighting,
226 paragraph, or heading macro. You can specify this macro multi‐
227 ple times to reduce the point size as needed.
228
229 .NL Prints all text following in the normal point size (that is, the
230 value of the PS register).
231
232 \*{text\*}
233 Print the enclosed text as a superscript.
234
235 Indents
236 You may need to indent sections of text. A typical use for indents is
237 to create nested lists and sublists.
238
239 Use the RS and RE macros to start and end a section of indented text,
240 respectively. The PI register controls the amount of indent.
241
242 You can nest indented sections as deeply as needed by using multiple,
243 nested pairs of RS and RE.
244
245 Lists
246 The IP macro handles duties for all lists. Its syntax is as follows:
247
248 .IP [marker [width]]
249
250 The marker is usually a bullet character \(bu for unordered
251 lists, a number (or auto-incrementing number register) for num‐
252 bered lists, or a word or phrase for indented (glossary-style)
253 lists.
254
255 The width specifies the indent for the body of each list item.
256 Once specified, the indent remains the same for all list items
257 in the document until specified again.
258
259 Tab stops
260 Use the ta request to set tab stops as needed. Use the TA macro to
261 reset tabs to the default (every 5n). You can redefine the TA macro to
262 create a different set of default tab stops.
263
264 Displays and keeps
265 Use displays to show text-based examples or figures (such as code list‐
266 ings). Displays turn off filling, so lines of code can be displayed
267 as-is without inserting br requests in between each line. Displays can
268 be kept on a single page, or allowed to break across pages. The fol‐
269 lowing table shows the display types available.
270
271 Display macro Type of display
272 With keep No keep
273 ─────────────────────────────────────────────────────────
274 .DS L .LD Left-justified.
275 .DS I [indent] .ID Indented (default indent in
276 the DI register).
277 .DS B .BD Block-centered (left-justi‐
278 fied, longest line centered).
279 .DS C .CD Centered.
280
281
282 .DS R .RD Right-justified.
283 ─────────────────────────────────────────────────────────
284
285 Use the DE macro to end any display type.
286
287 To keep text together on a page, such as a paragraph that refers to a
288 table (or list, or other item) immediately following, use the KS and KE
289 macros. The KS macro begins a block of text to be kept on a single
290 page, and the KE macro ends the block.
291
292 You can specify a floating keep using the KF and KE macros. If the
293 keep cannot fit on the current page, groff holds the contents of the
294 keep and allows text following the keep (in the source file) to fill in
295 the remainder of the current page. When the page breaks, whether by an
296 explicit bp request or by reaching the end of the page, groff prints
297 the floating keep at the top of the new page. This is useful for
298 printing large graphics or tables that do not need to appear exactly
299 where specified.
300
301 Tables, figures, equations, and references
302 The -ms macros support the standard groff preprocessors: tbl, pic, eqn,
303 and refer. Mark text meant for preprocessors by enclosing it in pairs
304 of tags as follows:
305
306 .TS [H] and .TE
307 Denotes a table, to be processed by the tbl preprocessor. The
308 optional H argument instructs groff to create a running header
309 with the information up to the TH macro. Groff prints the
310 header at the beginning of the table; if the table runs onto
311 another page, groff prints the header on the next page as well.
312
313 .PS and .PE
314 Denotes a graphic, to be processed by the pic preprocessor. You
315 can create a pic file by hand, using the AT&T pic manual avail‐
316 able on the Web as a reference, or by using a graphics program
317 such as xfig.
318
319 .EQ [align] and .EN
320 Denotes an equation, to be processed by the eqn preprocessor.
321 The optional align argument can be C, L, or I to center (the
322 default), left-justify, or indent the equation.
323
324 .[ and .]
325 Denotes a reference, to be processed by the refer preprocessor.
326 The GNU refer(1) manual page provides a comprehensive reference
327 to the preprocessor and the format of the bibliographic data‐
328 base.
329
330 Footnotes
331 The ms macros provide a flexible footnote system. You can specify a
332 numbered footnote by using the \** escape, followed by the text of the
333 footnote enclosed by FS and FE macros.
334
335 You can specify symbolic footnotes by placing the mark character (such
336 as \(dg for the dagger character) in the body text, followed by the
337 text of the footnote enclosed by FS \(dg and FE macros.
338
339 You can control how groff prints footnote numbers by changing the value
340 of the FF register as follows:
341
342 0 Prints the footnote number as a superscript; indents the
343 footnote (default).
344
345 1 Prints the number followed by a period (like 1.) and
346 indents the footnote.
347
348 2 Like 1, without an indent.
349
350 3 Like 1, but prints the footnote number as a hanging para‐
351 graph.
352
353 You can use footnotes safely within keeps and displays, but avoid using
354 numbered footnotes within floating keeps. You can set a second \**
355 between a \** and its corresponding .FS; as long as each .FS occurs
356 after the corresponding \** and the occurrences of .FS are in the same
357 order as the corresponding occurrences of \**.
358
359 Headers and footers
360 There are two ways to define headers and footers:
361
362 · Use the strings LH, CH, and RH to set the left, center, and right
363 headers; use LF, CF, and RF to set the left, center, and right foot‐
364 ers. This works best for documents that do not distinguish between
365 odd and even pages.
366
367 · Use the OH and EH macros to define headers for the odd and even
368 pages; and OF and EF macros to define footers for the odd and even
369 pages. This is more flexible than defining the individual strings.
370 The syntax for these macros is as follows:
371
372 .OH 'left'center'right'
373
374 You can replace the quote (') marks with any character not appearing
375 in the header or footer text.
376
377 Margins
378 You control margins using a set of number registers. The following ta‐
379 ble lists the register names and defaults:
380
381 Reg. Definition Effective Default
382 ──────────────────────────────────────────────────────
383 PO Page offset (left mar‐ next page 1i
384 gin)
385 LL Line length next para. 6i
386 LT Header/footer length next para. 6i
387 HM Top (header) margin next page 1i
388 FM Bottom (footer) margin next page 1i
389 ──────────────────────────────────────────────────────
390
391 Note that there is no right margin setting. The combination of page
392 offset and line length provide the information necessary to derive the
393 right margin.
394
395 Multiple columns
396 The ms macros can set text in as many columns as will reasonably fit on
397 the page. The following macros are available. All of them force a
398 page break if a multi-column mode is already set. However, if the cur‐
399 rent mode is single-column, starting a multi-column mode does not force
400 a page break.
401
402 .1C Single-column mode.
403
404 .2C Two-column mode.
405
406 .MC [width [gutter]]
407 Multi-column mode. If you specify no arguments, it is equiva‐
408 lent to the 2C macro. Otherwise, width is the width of each
409 column and gutter is the space between columns. The MINGW num‐
410 ber register is the default gutter width.
411
412 Creating a table of contents
413 Wrap text that you want to appear in the table of contents in XS and XE
414 macros. Use the TC macro to print the table of contents at the end of
415 the document, resetting the page number to i (Roman numeral 1).
416
417 You can manually create a table of contents by specifying a page number
418 as the first argument to XS. Add subsequent entries using the XA
419 macro. For example:
420
421 .XS 1
422 Introduction
423 .XA 2
424 A Brief History of the Universe
425 .XA 729
426 Details of Galactic Formation
427 ...
428 .XE
429
430 Use the PX macro to print a manually-generated table of contents with‐
431 out resetting the page number.
432
433 If you give the argument no to either PX or TC, groff suppresses print‐
434 ing the title specified by the \*[TOC] string.
435
437 The groff ms macros are a complete re-implementation, using no original
438 AT&T code. Since they take advantage of the extended features in
439 groff, they cannot be used with AT&T troff. Other differences include:
440
441 · The internals of groff ms differ from the internals of Unix ms.
442 Documents that depend upon implementation details of Unix ms may not
443 format properly with groff ms.
444
445 · The error-handling policy of groff ms is to detect and report
446 errors, rather than silently to ignore them.
447
448 · Bell Labs localisms are not implemented.
449
450 · Berkeley localisms, in particular the TM and CT macros, are not
451 implemented.
452
453 · Groff ms does not work in compatibility mode (e.g. with the -C
454 option).
455
456 · There is no support for typewriter-like devices.
457
458 · Groff ms does not provide cut marks.
459
460 · Multiple line spacing is not supported (use a larger vertical spac‐
461 ing instead).
462
463 · Some Unix ms documentation says that the CW and GW number registers
464 can be used to control the column width and gutter width respec‐
465 tively. These number registers are not used in groff ms.
466
467 · Macros that cause a reset (paragraphs, headings, etc.) may change
468 the indent. Macros that change the indent do not increment or
469 decrement the indent, but rather set it absolutely. This can cause
470 problems for documents that define additional macros of their own.
471 The solution is to use not the in request but instead the RS and RE
472 macros.
473
474 · The number register GS is set to 1 by the groff ms macros, but is
475 not used by the Unix ms macros. Documents that need to determine
476 whether they are being formatted with Unix ms or groff ms should use
477 this number register.
478
479 Strings
480 You can redefine the following strings to adapt the groff ms macros to
481 languages other than English:
482
483 String Default Value
484 ─────────────────────────────────
485 REFERENCES References
486 ABSTRACT ABSTRACT
487 TOC Table of Contents
488 MONTH1 January
489 MONTH2 February
490 MONTH3 March
491 MONTH4 April
492 MONTH5 May
493 MONTH6 June
494 MONTH7 July
495 MONTH8 August
496 MONTH9 September
497 MONTH10 October
498 MONTH11 November
499 MONTH12 December
500 ─────────────────────────────────
501
502 The \*- string produces an em dash — like this.
503
504 Text Settings
505 The FAM string sets the default font family. If this string is unde‐
506 fined at initialization, it is set to Times.
507
508 The point size, vertical spacing, and inter-paragraph spacing for foot‐
509 notes are controlled by the number registers FPS, FVS, and FPD; at ini‐
510 tialization these are set to \n(PS-2, \n[FPS]+2, and \n(PD/2 respec‐
511 tively. If any of these registers are defined before initialization,
512 the initialization macro does not change them.
513
514 The hyphenation flags (as set by the hy request) are set from the HY
515 register; the default is 14.
516
517 Improved accent marks (as originally defined in Berkeley's ms version)
518 are available by specifying the AM macro at the beginning of your docu‐
519 ment. You can place an accent over most characters by specifying the
520 string defining the accent directly after the character. For example,
521 n\*~ produces an n with a tilde over it.
522
524 The following conventions are used for names of macros, strings and
525 number registers. External names available to documents that use the
526 groff ms macros contain only uppercase letters and digits.
527
528 Internally the macros are divided into modules; naming conventions are
529 as follows:
530
531 · Names used only within one module are of the form module*name.
532
533 · Names used outside the module in which they are defined are of the
534 form module@name.
535
536 · Names associated with a particular environment are of the form
537 environment:name; these are used only within the par module.
538
539 · name does not have a module prefix.
540
541 · Constructed names used to implement arrays are of the form
542 array!index.
543
544 Thus the groff ms macros reserve the following names:
545
546 · Names containing the characters *, @, and :.
547
548 · Names containing only uppercase letters and digits.
549
551 /usr/share/groff/1.18.1.4/tmac/ms.tmac (a wrapper file for s.tmac)
552 /usr/share/groff/1.18.1.4/tmac/s.tmac
553
555 groff(1), troff(1), tbl(1), pic(1), eqn(1), refer(1), Groff: The GNU
556 Implementation of troff by Trent Fisher and Werner Lemberg.
557
559 Original manual page by James Clark et al; rewritten by Larry Kollar
560 (lkollar@despammed.com).
561
562
563
564Groff Version 1.18.1.4 09 March 2002 GROFF_MS(7)