1ROFF(7) BSD Miscellaneous Information Manual ROFF(7)
2
4 roff — roff language reference for mandoc
5
7 The roff language is a general purpose text formatting language. Since
8 traditional implementations of the mdoc(7) and man(7) manual formatting
9 languages are based on it, many real-world manuals use small numbers of
10 roff requests and escape sequences intermixed with their mdoc(7) or
11 man(7) code. To properly format such manuals, the mandoc(1) utility sup‐
12 ports a subset of roff requests and escapes. Even though this manual
13 page lists all roff requests and escape sequences, it only contains par‐
14 tial information about requests not supported by mandoc(1) and about lan‐
15 guage features that do not matter for manual pages. For complete roff
16 manuals, consult the SEE ALSO section.
17
18 Input lines beginning with the control character ‘.’ are parsed for re‐
19 quests and macros. Such lines are called “request lines” or “macro
20 lines”, respectively. Requests change the processing state and manipu‐
21 late the formatting; some macros also define the document structure and
22 produce formatted output. The single quote ("'") is accepted as an al‐
23 ternative control character, treated by mandoc(1) just like ‘.’
24
25 Lines not beginning with control characters are called “text lines”.
26 They provide free-form text to be printed; the formatting of the text de‐
27 pends on the respective processing context.
28
30 roff documents may contain only graphable 7-bit ASCII characters, the
31 space character, and, in certain circumstances, the tab character. The
32 backslash character ‘\’ indicates the start of an escape sequence, used
33 for example for Comments and Special Characters. For a complete listing
34 of escape sequences, consult the ESCAPE SEQUENCE REFERENCE below.
35
36 Comments
37 Text following an escaped double-quote ‘\"’, whether in a request, macro,
38 or text line, is ignored to the end of the line. A request line begin‐
39 ning with a control character and comment escape ‘.\"’ is also ignored.
40 Furthermore, request lines with only a control character and optional
41 trailing whitespace are stripped from input.
42
43 Examples:
44 .\" This is a comment line.
45 .\" The next line is ignored:
46 .
47 .Sh EXAMPLES \" This is a comment, too.
48 example text \" And so is this.
49
50 Special Characters
51 Special characters are used to encode special glyphs and are rendered
52 differently across output media. They may occur in request, macro, and
53 text lines. Sequences begin with the escape character ‘\’ followed by
54 either an open-parenthesis ‘(’ for two-character sequences; an open-
55 bracket ‘[’ for n-character sequences (terminated at a close-bracket
56 ‘]’); or a single one character sequence.
57
58 Examples:
59 \(em Two-letter em dash escape.
60 \e One-letter backslash escape.
61
62 See mandoc_char(7) for a complete list.
63
64 Font Selection
65 In mdoc(7) and man(7) documents, fonts are usually selected with macros.
66 The \f escape sequence and the ft request can be used to manually change
67 the font, but this is not recommended in mdoc(7) documents. Such manual
68 font changes are overridden by many subsequent macros.
69
70 The following fonts are supported:
71
72 B Bold font.
73 BI A font that is both bold and italic.
74 CB Bold constant width font. Same as B in terminal output.
75 CI Italic constant width font. Same as I in terminal output.
76 CR Regular constant width font. Same as R in terminal output.
77 CW An alias for CR.
78 I Italic font.
79 P Return to the previous font. If a macro caused a font change
80 since the last \f eascape sequence or ft request, this returns
81 to the font before the last font change in the macro rather
82 than to the font before the last manual font change.
83 R Roman font. This is the default font.
84 1 An alias for R.
85 2 An alias for I.
86 3 An alias for B.
87 4 An alias for BI.
88
89 Examples:
90 \fBbold\fR
91 Write in bold, then switch to regular font mode.
92 \fIitalic\fP
93 Write in italic, then return to previous font mode.
94 \f(BIbold italic\fP
95 Write in bold italic, then return to previous font mode.
96
97 Whitespace
98 Whitespace consists of the space character. In text lines, whitespace is
99 preserved within a line. In request and macro lines, whitespace delimits
100 arguments and is discarded.
101
102 Unescaped trailing spaces are stripped from text line input unless in a
103 literal context. In general, trailing whitespace on any input line is
104 discouraged for reasons of portability. In the rare case that a space
105 character is needed at the end of an input line, it may be forced by
106 ‘\ \&’.
107
108 Literal space characters can be produced in the output using escape se‐
109 quences. In macro lines, they can also be included in arguments using
110 quotation; see MACRO SYNTAX for details.
111
112 Blank text lines, which may include whitespace, are only permitted within
113 literal contexts. If the first character of a text line is a space, that
114 line is printed with a leading newline.
115
116 Scaling Widths
117 Many requests and macros support scaled widths for their arguments. The
118 syntax for a scaled width is ‘[+-]?[0-9]*.[0-9]*[:unit:]’, where a deci‐
119 mal must be preceded or followed by at least one digit.
120
121 The following scaling units are accepted:
122
123 c centimetre
124 i inch
125 P pica (1/6 inch)
126 p point (1/72 inch)
127 f scale ‘u’ by 65536
128 v default vertical span
129 m width of rendered ‘m’ (em) character
130 n width of rendered ‘n’ (en) character
131 u default horizontal span for the terminal
132 M mini-em (1/100 em)
133
134 Using anything other than ‘m’, ‘n’, or ‘v’ is necessarily non-portable
135 across output media. See COMPATIBILITY.
136
137 If a scaling unit is not provided, the numerical value is interpreted un‐
138 der the default rules of ‘v’ for vertical spaces and ‘u’ for horizontal
139 ones.
140
141 Examples:
142 .Bl -tag -width 2i
143 two-inch tagged list indentation in mdoc(7)
144 .HP 2i
145 two-inch tagged list indentation in man(7)
146 .sp 2v
147 two vertical spaces
148
149 Sentence Spacing
150 Each sentence should terminate at the end of an input line. By doing
151 this, a formatter will be able to apply the proper amount of spacing af‐
152 ter the end of sentence (unescaped) period, exclamation mark, or question
153 mark followed by zero or more non-sentence closing delimiters (‘)’, ‘]’,
154 ‘'’, ‘"’).
155
156 The proper spacing is also intelligently preserved if a sentence ends at
157 the boundary of a macro line.
158
159 If an input line happens to end with a period, exclamation or question
160 mark that isn't the end of a sentence, append a zero-width space (‘\&’).
161
162 Examples:
163 Do not end sentences mid-line like this. Instead,
164 end a sentence like this.
165 A macro would end like this:
166 .Xr mandoc 1 .
167 An abbreviation at the end of an input line needs escaping, e.g.\&
168 like this.
169
171 A request or macro line consists of:
172
173 1. the control character ‘.’ or ‘'’ at the beginning of the line,
174 2. optionally an arbitrary amount of whitespace,
175 3. the name of the request or the macro, which is one word of arbitrary
176 length, terminated by whitespace,
177 4. and zero or more arguments delimited by whitespace.
178
179 Thus, the following request lines are all equivalent:
180
181 .ig end
182 .ig end
183 . ig end
184
186 Macros are provided by the mdoc(7) and man(7) languages and can be de‐
187 fined by the de request. When called, they follow the same syntax as re‐
188 quests, except that macro arguments may optionally be quoted by enclosing
189 them in double quote characters (‘"’). Quoted text, even if it contains
190 whitespace or would cause a macro invocation when unquoted, is always
191 considered literal text. Inside quoted text, pairs of double quote char‐
192 acters (‘""’) resolve to single double quote characters.
193
194 To be recognised as the beginning of a quoted argument, the opening quote
195 character must be preceded by a space character. A quoted argument ex‐
196 tends to the next double quote character that is not part of a pair, or
197 to the end of the input line, whichever comes earlier. Leaving out the
198 terminating double quote character at the end of the line is discouraged.
199 For clarity, if more arguments follow on the same input line, it is rec‐
200 ommended to follow the terminating double quote character by a space
201 character; in case the next character after the terminating double quote
202 character is anything else, it is regarded as the beginning of the next,
203 unquoted argument.
204
205 Both in quoted and unquoted arguments, pairs of backslashes (‘\\’) re‐
206 solve to single backslashes. In unquoted arguments, space characters can
207 alternatively be included by preceding them with a backslash (‘\ ’), but
208 quoting is usually better for clarity.
209
210 Examples:
211 .Fn strlen "const char *s"
212 Group arguments "const char *s" into one function argument.
213 If unspecified, "const", "char", and "*s" would be consid‐
214 ered separate arguments.
215 .Op "Fl a"
216 Consider "Fl a" as literal text instead of a flag macro.
217
219 The mandoc(1) roff parser recognises the following requests. For re‐
220 quests marked as "ignored" or "unsupported", any arguments are ignored,
221 and the number of arguments is not checked.
222
223 ab [message]
224 Abort processing. Currently unsupported.
225
226 ad [b | c | l | n | r]
227 Set line adjustment mode for subsequent text. Currently ignored.
228
229 af registername format
230 Assign an output format to a number register. Currently ignored.
231
232 aln newname oldname
233 Create an alias for a number register. Currently unsupported.
234
235 als newname oldname
236 Create an alias for a request, string, macro, or diversion.
237
238 am macroname [endmacro]
239 Append to a macro definition. The syntax of this request is the
240 same as that of de.
241
242 am1 macroname [endmacro]
243 Append to a macro definition, switching roff compatibility mode
244 off during macro execution (groff extension). The syntax of this
245 request is the same as that of de1. Since mandoc(1) does not im‐
246 plement roff compatibility mode at all, it handles this request
247 as an alias for am.
248
249 ami macrostring [endstring]
250 Append to a macro definition, specifying the macro name indi‐
251 rectly (groff extension). The syntax of this request is the same
252 as that of dei.
253
254 ami1 macrostring [endstring]
255 Append to a macro definition, specifying the macro name indi‐
256 rectly and switching roff compatibility mode off during macro ex‐
257 ecution (groff extension). The syntax of this request is the
258 same as that of dei1. Since mandoc(1) does not implement roff
259 compatibility mode at all, it handles this request as an alias
260 for ami.
261
262 as stringname [string]
263 Append to a user-defined string. The syntax of this request is
264 the same as that of ds. If a user-defined string with the speci‐
265 fied name does not yet exist, it is set to the empty string be‐
266 fore appending.
267
268 as1 stringname [string]
269 Append to a user-defined string, switching roff compatibility
270 mode off during macro execution (groff extension). The syntax of
271 this request is the same as that of ds1. Since mandoc(1) does
272 not implement roff compatibility mode at all, it handles this re‐
273 quest as an alias for as.
274
275 asciify divname
276 Fully unformat a diversion. Currently unsupported.
277
278 backtrace
279 Print a backtrace of the input stack. This is a groff extension
280 and currently ignored.
281
282 bd font [curfont] [offset]
283 Artificially embolden by repeated printing with small shifts.
284 Currently ignored.
285
286 bleedat left top width height
287 Set the BleedBox page parameter for PDF generation. This is a
288 Heirloom extension and currently ignored.
289
290 blm macroname
291 Set a blank line trap. Currently unsupported.
292
293 box divname
294 Begin a diversion without including a partially filled line.
295 Currently unsupported.
296
297 boxa divname
298 Add to a diversion without including a partially filled line.
299 Currently unsupported.
300
301 bp [+|-]pagenumber
302 Begin a new page. Currently ignored.
303
304 BP source height width position offset flags label
305 Define a frame and place a picture in it. This is a Heirloom ex‐
306 tension and currently unsupported.
307
308 br Break the output line.
309
310 break Break out of the innermost while loop.
311
312 breakchar char ...
313 Optional line break characters. This is a Heirloom extension and
314 currently ignored.
315
316 brnl N Break output line after the next N input lines. This is a Heir‐
317 loom extension and currently ignored.
318
319 brp Break and spread output line. Currently, this is implemented as
320 an alias for br.
321
322 brpnl N
323 Break and spread output line after the next N input lines. This
324 is a Heirloom extension and currently ignored.
325
326 c2 [char]
327 Change the no-break control character. Currently unsupported.
328
329 cc [char]
330 Change the control character. If char is not specified, the con‐
331 trol character is reset to ‘.’. Trailing characters are ignored.
332
333 ce [N] Center the next N input lines without filling. N defaults to 1.
334 An argument of 0 or less ends centering. Currently, high level
335 macros abort centering.
336
337 cf filename
338 Output the contents of a file. Ignored because insecure.
339
340 cflags flags char ...
341 Set character flags. This is a groff extension and currently ig‐
342 nored.
343
344 ch macroname [dist]
345 Change a trap location. Currently ignored.
346
347 char glyph [string]
348 Define or redefine the ASCII character or character escape se‐
349 quence glyph to be rendered as string, which can be empty. Only
350 partially supported in mandoc(1); may interact incorrectly with
351 tr.
352
353 chop stringname
354 Remove the last character from a macro, string, or diversion.
355 Currently unsupported.
356
357 class classname char ...
358 Define a character class. This is a groff extension and cur‐
359 rently ignored.
360
361 close streamname
362 Close an open file. Ignored because insecure.
363
364 CL color text
365 Print text in color. This is a Heirloom extension and currently
366 unsupported.
367
368 color [1 | 0]
369 Activate or deactivate colors. This is a groff extension and
370 currently ignored.
371
372 composite from to
373 Define a name component for composite glyph names. This is a
374 groff extension and currently unsupported.
375
376 continue
377 Immediately start the next iteration of a while loop. Currently
378 unsupported.
379
380 cp [1 | 0]
381 Switch roff compatibility mode on or off. Currently ignored.
382
383 cropat left top width height
384 Set the CropBox page parameter for PDF generation. This is a
385 Heirloom extension and currently ignored.
386
387 cs font [width [emsize]]
388 Constant character spacing mode. Currently ignored.
389
390 cu [N] Underline next N input lines including whitespace. Currently ig‐
391 nored.
392
393 da divname
394 Append to a diversion. Currently unsupported.
395
396 dch macroname [dist]
397 Change a trap location in the current diversion. This is a Heir‐
398 loom extension and currently unsupported.
399
400 de macroname [endmacro]
401 Define a roff macro. Its syntax can be either
402
403 .de macroname
404 definition
405 ..
406
407 or
408
409 .de macroname endmacro
410 definition
411 .endmacro
412
413 Both forms define or redefine the macro macroname to represent
414 the definition, which may consist of one or more input lines, in‐
415 cluding the newline characters terminating each line, optionally
416 containing calls to roff requests, roff macros or high-level
417 macros like man(7) or mdoc(7) macros, whichever applies to the
418 document in question.
419
420 Specifying a custom endmacro works in the same way as for ig;
421 namely, the call to ‘.endmacro’ first ends the definition, and
422 after that, it is also evaluated as a roff request or roff macro,
423 but not as a high-level macro.
424
425 The macro can be invoked later using the syntax
426
427 .macroname [argument [argument ...]]
428
429 Regarding argument parsing, see MACRO SYNTAX above.
430
431 The line invoking the macro will be replaced in the input stream
432 by the definition, replacing all occurrences of \\$N, where N is
433 a digit, by the Nth argument. For example,
434
435 .de ZN
436 \fI\^\\$1\^\fP\\$2
437 ..
438 .ZN XtFree .
439
440 produces
441
442 \fI\^XtFree\^\fP.
443
444 in the input stream, and thus in the output: XtFree. Each occur‐
445 rence of \\$* is replaced with all the arguments, joined together
446 with single space characters. The variant \\$@ is similar, ex‐
447 cept that each argument is individually quoted.
448
449 Since macros and user-defined strings share a common string ta‐
450 ble, defining a macro macroname clobbers the user-defined string
451 macroname, and the definition can also be printed using the ‘\*’
452 string interpolation syntax described below ds, but this is
453 rarely useful because every macro definition contains at least
454 one explicit newline character.
455
456 In order to prevent endless recursion, both groff and mandoc(1)
457 limit the stack depth for expanding macros and strings to a
458 large, but finite number, and mandoc(1) also limits the length of
459 the expanded input line. Do not rely on the exact values of
460 these limits.
461
462 de1 macroname [endmacro]
463 Define a roff macro that will be executed with roff compatibility
464 mode switched off during macro execution. This is a groff exten‐
465 sion. Since mandoc(1) does not implement roff compatibility mode
466 at all, it handles this request as an alias for de.
467
468 defcolor newname scheme component ...
469 Define a color name. This is a groff extension and currently ig‐
470 nored.
471
472 dei macrostring [endstring]
473 Define a roff macro, specifying the macro name indirectly (groff
474 extension). The syntax of this request is the same as that of
475 de. The effect is the same as:
476
477 .de \*[macrostring] [\*[endstring]]
478
479 dei1 macrostring [endstring]
480 Define a roff macro that will be executed with roff compatibility
481 mode switched off during macro execution, specifying the macro
482 name indirectly (groff extension). Since mandoc(1) does not im‐
483 plement roff compatibility mode at all, it handles this request
484 as an alias for dei.
485
486 device string ...
487
488 devicem stringname
489 These two requests only make sense with the groff-specific inter‐
490 mediate output format and are unsupported.
491
492 di divname
493 Begin a diversion. Currently unsupported.
494
495 do command [argument ...]
496 Execute roff request or macro line with compatibility mode dis‐
497 abled. Currently unsupported.
498
499 ds stringname [["]string]
500 Define a user-defined string. The stringname and string argu‐
501 ments are space-separated. If the string begins with a double-
502 quote character, that character will not be part of the string.
503 All remaining characters on the input line form the string, in‐
504 cluding whitespace and double-quote characters, even trailing
505 ones.
506
507 The string can be interpolated into subsequent text by using
508 \*[stringname] for a stringname of arbitrary length, or \*(NN or
509 \*N if the length of stringname is two or one characters, respec‐
510 tively. Interpolation can be prevented by escaping the leading
511 backslash; that is, an asterisk preceded by an even number of
512 backslashes does not trigger string interpolation.
513
514 Since user-defined strings and macros share a common string ta‐
515 ble, defining a string stringname clobbers the macro stringname,
516 and the stringname used for defining a string can also be invoked
517 as a macro, in which case the following input line will be ap‐
518 pended to the string, forming a new input line passed to the roff
519 parser. For example,
520
521 .ds badidea .S
522 .badidea
523 H SYNOPSIS
524
525 invokes the SH macro when used in a man(7) document. Such abuse
526 is of course strongly discouraged.
527
528 ds1 stringname [["]string]
529 Define a user-defined string that will be expanded with roff com‐
530 patibility mode switched off during string expansion. This is a
531 groff extension. Since mandoc(1) does not implement roff compat‐
532 ibility mode at all, it handles this request as an alias for ds.
533
534 dwh dist macroname
535 Set a location trap in the current diversion. This is a Heirloom
536 extension and currently unsupported.
537
538 dt [dist macroname]
539 Set a trap within a diversion. Currently unsupported.
540
541 ec [char]
542 Enable the escape mechanism and change the escape character. The
543 char argument defaults to the backslash (‘\’).
544
545 ecr Restore the escape character. Currently unsupported.
546
547 ecs Save the escape character. Currently unsupported.
548
549 el body
550 The “else” half of an if/else conditional. Pops a result off the
551 stack of conditional evaluations pushed by ie and uses it as its
552 conditional. If no stack entries are present (e.g., due to no
553 prior ie calls) then false is assumed. The syntax of this re‐
554 quest is similar to if except that the conditional is missing.
555
556 em macroname
557 Set a trap at the end of input. Currently unsupported.
558
559 EN End an equation block. See EQ.
560
561 eo Disable the escape mechanism completely.
562
563 EP End a picture started by BP. This is a Heirloom extension and
564 currently unsupported.
565
566 EQ Begin an equation block. See eqn(7) for a description of the
567 equation language.
568
569 errprint message
570 Print a string like an error message. This is a Heirloom exten‐
571 sion and currently ignored.
572
573 ev [envname]
574 Switch to another environment. Currently unsupported.
575
576 evc [envname]
577 Copy an environment into the current environment. Currently un‐
578 supported.
579
580 ex Abort processing and exit. Currently unsupported.
581
582 fallback curfont font ...
583 Select the fallback sequence for a font. This is a Heirloom ex‐
584 tension and currently ignored.
585
586 fam [familyname]
587 Change the font family. This is a groff extension and currently
588 ignored.
589
590 fc [delimchar [padchar]]
591 Define a delimiting and a padding character for fields. Cur‐
592 rently unsupported.
593
594 fchar glyphname [string]
595 Define a fallback glyph. Currently unsupported.
596
597 fcolor colorname
598 Set the fill color for \D objects. This is a groff extension and
599 currently ignored.
600
601 fdeferlig font string ...
602 Defer ligature building. This is a Heirloom extension and cur‐
603 rently ignored.
604
605 feature +|-name
606 Enable or disable an OpenType feature. This is a Heirloom exten‐
607 sion and currently ignored.
608
609 fi Break the output line and switch to fill mode, which is active by
610 default but can be ended with the nf request. In fill mode, in‐
611 put from subsequent input lines is added to the same output line
612 until the next word no longer fits, at which point the output
613 line is broken. This request is implied by the mdoc(7) Sh macro
614 and by the man(7) SH, SS, and EE macros.
615
616 fkern font minkern
617 Control the use of kerning tables for a font. This is a Heirloom
618 extension and currently ignored.
619
620 fl Flush output. Currently ignored.
621
622 flig font string char ...
623 Define ligatures. This is a Heirloom extension and currently ig‐
624 nored.
625
626 fp position font [filename]
627 Assign font position. Currently ignored.
628
629 fps mapname ...
630 Mount a font with a special character map. This is a Heirloom
631 extension and currently ignored.
632
633 fschar font glyphname [string]
634 Define a font-specific fallback glyph. This is a groff extension
635 and currently unsupported.
636
637 fspacewidth font [afmunits]
638 Set a font-specific width for the space character. This is a
639 Heirloom extension and currently ignored.
640
641 fspecial curfont [font ...]
642 Conditionally define a special font. This is a groff extension
643 and currently ignored.
644
645 ft [font]
646 Change the font; see Font Selection. The font argument defaults
647 to P.
648
649 ftr newname [oldname]
650 Translate font name. This is a groff extension and currently ig‐
651 nored.
652
653 fzoom font [permille]
654 Zoom font size. Currently ignored.
655
656 gcolor [colorname]
657 Set glyph color. This is a groff extension and currently ig‐
658 nored.
659
660 hc [char]
661 Set the hyphenation character. Currently ignored.
662
663 hcode char code ...
664 Set hyphenation codes of characters. Currently ignored.
665
666 hidechar font char ...
667 Hide characters in a font. This is a Heirloom extension and cur‐
668 rently ignored.
669
670 hla language
671 Set hyphenation language. This is a groff extension and cur‐
672 rently ignored.
673
674 hlm [number]
675 Set maximum number of consecutive hyphenated lines. Currently
676 ignored.
677
678 hpf filename
679 Load hyphenation pattern file. This is a groff extension and
680 currently ignored.
681
682 hpfa filename
683 Load hyphenation pattern file, appending to the current patterns.
684 This is a groff extension and currently ignored.
685
686 hpfcode code code ...
687 Define mapping values for character codes in hyphenation pat‐
688 terns. This is a groff extension and currently ignored.
689
690 hw word ...
691 Specify hyphenation points in words. Currently ignored.
692
693 hy [mode]
694 Set automatic hyphenation mode. Currently ignored.
695
696 hylang language
697 Set hyphenation language. This is a Heirloom extension and cur‐
698 rently ignored.
699
700 hylen nchar
701 Minimum word length for hyphenation. This is a Heirloom exten‐
702 sion and currently ignored.
703
704 hym [length]
705 Set hyphenation margin. This is a groff extension and currently
706 ignored.
707
708 hypp penalty ...
709 Define hyphenation penalties. This is a Heirloom extension and
710 currently ignored.
711
712 hys [length]
713 Set hyphenation space. This is a groff extension and currently
714 ignored.
715
716 ie condition body
717 The “if” half of an if/else conditional. The result of the con‐
718 ditional is pushed into a stack used by subsequent invocations of
719 el, which may be separated by any intervening input (or not exist
720 at all). Its syntax is equivalent to if.
721
722 if condition body
723 Begin a conditional. This request can also be written as fol‐
724 lows:
725
726 .if condition \{body
727 body ...\}
728
729 .if condition \{\
730 body ...
731 .\}
732
733 The condition is a boolean expression. Currently, mandoc(1) sup‐
734 ports the following subset of roff conditionals:
735
736 • If ‘!’ is prefixed to condition, it is logically inverted.
737
738 • If the first character of condition is ‘n’ (nroff mode) or
739 ‘o’ (odd page), it evaluates to true, and the body starts
740 with the next character.
741
742 • If the first character of condition is ‘e’ (even page), ‘t’
743 (troff mode), or ‘v’ (vroff mode), it evaluates to false, and
744 the body starts with the next character.
745
746 • If the first character of condition is ‘c’ (character
747 available), it evaluates to true if the following character
748 is an ASCII character or a valid character escape sequence,
749 or to false otherwise. The body starts with the character
750 following that next character.
751
752 • If the first character of condition is ‘d’, it evaluates to
753 true if the rest of condition is the name of an existing user
754 defined macro or string; otherwise, it evaluates to false.
755
756 • If the first character of condition is ‘r’, it evaluates to
757 true if the rest of condition is the name of an existing num‐
758 ber register; otherwise, it evaluates to false.
759
760 • If the condition starts with a parenthesis or with an option‐
761 ally signed integer number, it is evaluated according to the
762 rules of Numerical expressions explained below. It evaluates
763 to true if the result is positive, or to false if the result
764 is zero or negative.
765
766 • Otherwise, the first character of condition is regarded as a
767 delimiter and it evaluates to true if the string extending
768 from its first to its second occurrence is equal to the
769 string extending from its second to its third occurrence.
770
771 • If condition cannot be parsed, it evaluates to false.
772
773 If a conditional is false, its children are not processed, but
774 are syntactically interpreted to preserve the integrity of the
775 input document. Thus,
776
777 .if t .ig
778
779 will discard the ‘.ig’, which may lead to interesting results,
780 but
781
782 .if t .if t \{\
783
784 will continue to syntactically interpret to the block close of
785 the final conditional. Sub-conditionals, in this case, obviously
786 inherit the truth value of the parent.
787
788 If the body section is begun by an escaped brace ‘\{’, scope con‐
789 tinues until the end of the input line containing the matching
790 closing-brace escape sequence ‘\}’. If the body is not enclosed
791 in braces, scope continues until the end of the line. If the
792 condition is followed by a body on the same line, whether after a
793 brace or not, then requests and macros must begin with a control
794 character. It is generally more intuitive, in this case, to
795 write
796
797 .if condition \{\
798 .request
799 .\}
800
801 than having the request or macro follow as
802
803 .if condition \{.request
804
805 The scope of a conditional is always parsed, but only executed if
806 the conditional evaluates to true.
807
808 Note that the ‘\}’ is converted into a zero-width escape sequence
809 if not passed as a standalone macro ‘.\}’. For example,
810
811 .Fl a \} b
812
813 will result in ‘\}’ being considered an argument of the ‘Fl’
814 macro.
815
816 ig [endmacro]
817 Ignore input. Its syntax can be either
818
819 .ig
820 ignored text
821 ..
822
823 or
824
825 .ig endmacro
826 ignored text
827 .endmacro
828
829 In the first case, input is ignored until a ‘..’ request is en‐
830 countered on its own line. In the second case, input is ignored
831 until the specified ‘.endmacro’ is encountered. Do not use the
832 escape character ‘\’ anywhere in the definition of endmacro; it
833 would cause very strange behaviour.
834
835 When the endmacro is a roff request or a roff macro, like in
836
837 .ig if
838
839 the subsequent invocation of if will first terminate the ignored
840 text, then be invoked as usual. Otherwise, it only terminates
841 the ignored text, and arguments following it or the ‘..’ request
842 are discarded.
843
844 in [[+|-]width]
845 Change indentation. See man(7). Ignored in mdoc(7).
846
847 index register stringname substring
848 Find a substring in a string. This is a Heirloom extension and
849 currently unsupported.
850
851 it expression macro
852 Set an input line trap. The named macro will be invoked after
853 processing the number of input text lines specified by the numer‐
854 ical expression. While evaluating the expression, the unit suf‐
855 fixes described below Scaling Widths are ignored.
856
857 itc expression macro
858 Set an input line trap, not counting lines ending with \c. Cur‐
859 rently unsupported.
860
861 IX class keystring
862 To support the generation of a table of contents, pod2man(1)
863 emits this user-defined macro, usually without defining it. To
864 avoid reporting large numbers of spurious errors, mandoc(1) ig‐
865 nores it.
866
867 kern [1 | 0]
868 Switch kerning on or off. Currently ignored.
869
870 kernafter font char ... afmunits ...
871 Increase kerning after some characters. This is a Heirloom ex‐
872 tension and currently ignored.
873
874 kernbefore font char ... afmunits ...
875 Increase kerning before some characters. This is a Heirloom ex‐
876 tension and currently ignored.
877
878 kernpair font char ... font char ... afmunits
879 Add a kerning pair to the kerning table. This is a Heirloom ex‐
880 tension and currently ignored.
881
882 lc [glyph]
883 Define a leader repetition character. Currently unsupported.
884
885 lc_ctype localename
886 Set the LC_CTYPE locale. This is a Heirloom extension and cur‐
887 rently unsupported.
888
889 lds macroname string
890 Define a local string. This is a Heirloom extension and cur‐
891 rently unsupported.
892
893 length register string
894 Count the number of input characters in a string. Currently un‐
895 supported.
896
897 letadj lspmin lshmin letss lspmax lshmax
898 Dynamic letter spacing and reshaping. This is a Heirloom exten‐
899 sion and currently ignored.
900
901 lf lineno [filename]
902 Change the line number for error messages. Ignored because inse‐
903 cure.
904
905 lg [1 | 0]
906 Switch the ligature mechanism on or off. Currently ignored.
907
908 lhang font char ... afmunits
909 Hang characters at left margin. This is a Heirloom extension and
910 currently ignored.
911
912 linetabs [1 | 0]
913 Enable or disable line-tabs mode. This is a groff extension and
914 currently unsupported.
915
916 ll [[+|-]width]
917 Change the output line length. If the width argument is omitted,
918 the line length is reset to its previous value. The default set‐
919 ting for terminal output is 78n. If a sign is given, the line
920 length is added to or subtracted from; otherwise, it is set to
921 the provided value. Using this request in new manuals is dis‐
922 couraged for several reasons, among others because it overrides
923 the mandoc(1) -O width command line option.
924
925 lnr register [+|-]value [increment]
926 Set local number register. This is a Heirloom extension and cur‐
927 rently unsupported.
928
929 lnrf register [+|-]value [increment]
930 Set local floating-point register. This is a Heirloom extension
931 and currently unsupported.
932
933 lpfx string
934 Set a line prefix. This is a Heirloom extension and currently
935 unsupported.
936
937 ls [factor]
938 Set line spacing. It takes one integer argument specifying the
939 vertical distance of subsequent output text lines measured in v
940 units. Currently ignored.
941
942 lsm macroname
943 Set a leading spaces trap. This is a groff extension and cur‐
944 rently unsupported.
945
946 lt [[+|-]width]
947 Set title line length. Currently ignored.
948
949 mc glyph [dist]
950 Print margin character in the right margin. The dist is cur‐
951 rently ignored; instead, 1n is used.
952
953 mediasize media
954 Set the device media size. This is a Heirloom extension and cur‐
955 rently ignored.
956
957 minss width
958 Set minimum word space. This is a Heirloom extension and cur‐
959 rently ignored.
960
961 mk [register]
962 Mark vertical position. Currently ignored.
963
964 mso filename
965 Load a macro file using the search path. Ignored because inse‐
966 cure.
967
968 na Disable adjusting without changing the adjustment mode. Cur‐
969 rently ignored.
970
971 ne [height]
972 Declare the need for the specified minimum vertical space before
973 the next trap or the bottom of the page. Currently ignored.
974
975 nf Break the output line and switch to no-fill mode. Subsequent in‐
976 put lines are kept together on the same output line even when ex‐
977 ceeding the right margin, and line breaks in subsequent input
978 cause output line breaks. This request is implied by the mdoc(7)
979 Bd -unfilled and Bd -literal macros and by the man(7) EX macro.
980 The fi request switches back to the default fill mode.
981
982 nh Turn off automatic hyphenation mode. Currently ignored.
983
984 nhychar char ...
985 Define hyphenation-inhibiting characters. This is a Heirloom ex‐
986 tension and currently ignored.
987
988 nm [start [inc [space [indent]]]]
989 Print line numbers. Currently unsupported.
990
991 nn [number]
992 Temporarily turn off line numbering. Currently unsupported.
993
994 nop body
995 Execute the rest of the input line as a request, macro, or text
996 line, skipping the nop request and any space characters immedi‐
997 ately following it. This is mostly used to indent text lines in‐
998 side macro definitions.
999
1000 nr register [+|-]expression [stepsize]
1001 Define or change a register. A register is an arbitrary string
1002 value that defines some sort of state, which influences parsing
1003 and/or formatting. For the syntax of expression, see Numerical
1004 expressions below. If it is prefixed by a sign, the register
1005 will be incremented or decremented instead of assigned to.
1006
1007 The stepsize is used by the \n+ auto-increment feature. It re‐
1008 mains unchanged when omitted while changing an existing register,
1009 and it defaults to 0 when defining a new register.
1010
1011 The following register is handled specially:
1012
1013 nS If set to a positive integer value, certain mdoc(7)
1014 macros will behave in the same way as in the SYNOPSIS
1015 section. If set to 0, these macros will behave in the
1016 same way as outside the SYNOPSIS section, even when
1017 called within the SYNOPSIS section itself. Note that
1018 starting a new mdoc(7) section with the Sh macro will re‐
1019 set this register.
1020
1021 nrf register [+|-]expression [increment]
1022 Define or change a floating-point register. This is a Heirloom
1023 extension and currently unsupported.
1024
1025 nroff Force nroff mode. This is a groff extension and currently ig‐
1026 nored.
1027
1028 ns Turn on no-space mode. Currently ignored.
1029
1030 nx [filename]
1031 Abort processing of the current input file and process another
1032 one. Ignored because insecure.
1033
1034 open stream file
1035 Open a file for writing. Ignored because insecure.
1036
1037 opena stream file
1038 Open a file for appending. Ignored because insecure.
1039
1040 os Output saved vertical space. Currently ignored.
1041
1042 output string
1043 Output directly to intermediate output. Not supported.
1044
1045 padj [1 | 0]
1046 Globally control paragraph-at-once adjustment. This is a Heir‐
1047 loom extension and currently ignored.
1048
1049 papersize media
1050 Set the paper size. This is a Heirloom extension and currently
1051 ignored.
1052
1053 pc [char]
1054 Change the page number character. Currently ignored.
1055
1056 pev Print environments. This is a groff extension and currently ig‐
1057 nored.
1058
1059 pi command
1060 Pipe output to a shell command. Ignored because insecure.
1061
1062 PI Low-level request used by BP. This is a Heirloom extension and
1063 currently unsupported.
1064
1065 pl [[+|-]height]
1066 Change page length. Currently ignored.
1067
1068 pm Print names and sizes of macros, strings, and diversions to stan‐
1069 dard error output. Currently ignored.
1070
1071 pn [+|-]number
1072 Change the page number of the next page. Currently ignored.
1073
1074 pnr Print all number registers on standard error output. Currently
1075 ignored.
1076
1077 po [[+|-]offset]
1078 Set a horizontal page offset. If no argument is specified, the
1079 page offset is reverted to its previous value. If a sign is
1080 specified, the new page offset is calculated relative to the cur‐
1081 rent one; otherwise, it is absolute. The argument follows the
1082 syntax of Scaling Widths and the default scaling unit is m.
1083
1084 ps [[+|-]size]
1085 Change point size. Currently ignored.
1086
1087 psbb filename
1088 Retrieve the bounding box of a PostScript file. Currently unsup‐
1089 ported.
1090
1091 pshape indent length ...
1092 Set a special shape for the current paragraph. This is a Heir‐
1093 loom extension and currently unsupported.
1094
1095 pso command
1096 Include output of a shell command. Ignored because insecure.
1097
1098 ptr Print the names and positions of all traps on standard error out‐
1099 put. This is a groff extension and currently ignored.
1100
1101 pvs [[+|-]height]
1102 Change post-vertical spacing. This is a groff extension and cur‐
1103 rently ignored.
1104
1105 rchar glyph ...
1106 Remove glyph definitions. Currently unsupported.
1107
1108 rd [prompt [argument ...]]
1109 Read from standard input. Currently ignored.
1110
1111 recursionlimit maxrec maxtail
1112 Set the maximum stack depth for recursive macros. This is a
1113 Heirloom extension and currently ignored.
1114
1115 return [twice]
1116 Exit the presently executed macro and return to the caller. The
1117 argument is currently ignored.
1118
1119 rfschar font glyph ...
1120 Remove font-specific fallback glyph definitions. Currently un‐
1121 supported.
1122
1123 rhang font char ... afmunits
1124 Hang characters at right margin. This is a Heirloom extension
1125 and currently ignored.
1126
1127 rj [N] Justify the next N input lines to the right margin without fill‐
1128 ing. N defaults to 1. An argument of 0 or less ends right ad‐
1129 justment.
1130
1131 rm macroname
1132 Remove a request, macro or string.
1133
1134 rn oldname newname
1135 Rename a request, macro, diversion, or string. In mandoc(1),
1136 user-defined macros, mdoc(7) and man(7) macros, and user-defined
1137 strings can be renamed, but renaming of predefined strings and of
1138 roff requests is not supported, and diversions are not imple‐
1139 mented at all.
1140
1141 rnn oldname newname
1142 Rename a number register. Currently unsupported.
1143
1144 rr register
1145 Remove a register.
1146
1147 rs End no-space mode. Currently ignored.
1148
1149 rt [dist]
1150 Return to marked vertical position. Currently ignored.
1151
1152 schar glyph [string]
1153 Define global fallback glyph. This is a groff extension and cur‐
1154 rently unsupported.
1155
1156 sentchar char ...
1157 Define sentence-ending characters. This is a Heirloom extension
1158 and currently ignored.
1159
1160 shc [glyph]
1161 Change the soft hyphen character. Currently ignored.
1162
1163 shift [number]
1164 Shift macro arguments number times, by default once: \\$i becomes
1165 what \\$i+number was. Also decrement \n(.$ by number.
1166
1167 sizes size ...
1168 Define permissible point sizes. This is a groff extension and
1169 currently ignored.
1170
1171 so filename
1172 Include a source file. The file is read and its contents pro‐
1173 cessed as input in place of the so request line. To avoid inad‐
1174 vertent inclusion of unrelated files, mandoc(1) only accepts rel‐
1175 ative paths not containing the strings "../" and "/..".
1176
1177 This request requires man(1) to change to the right directory be‐
1178 fore calling mandoc(1), per convention to the root of the manual
1179 tree. Typical usage looks like:
1180
1181 .so man3/Xcursor.3
1182
1183 As the whole concept is rather fragile, the use of so is discour‐
1184 aged. Use ln(1) instead.
1185
1186 sp [height]
1187 Break the output line and emit vertical space. The argument fol‐
1188 lows the syntax of Scaling Widths and defaults to one blank line
1189 (1v).
1190
1191 spacewidth [1 | 0]
1192 Set the space width from the font metrics file. This is a Heir‐
1193 loom extension and currently ignored.
1194
1195 special [font ...]
1196 Define a special font. This is a groff extension and currently
1197 ignored.
1198
1199 spreadwarn [width]
1200 Warn about wide spacing between words. Currently ignored.
1201
1202 ss wordspace [sentencespace]
1203 Set space character size. Currently ignored.
1204
1205 sty position style
1206 Associate style with a font position. This is a groff extension
1207 and currently ignored.
1208
1209 substring stringname startpos [endpos]
1210 Replace a user-defined string with a substring. Currently unsup‐
1211 ported.
1212
1213 sv [height]
1214 Save vertical space. Currently ignored.
1215
1216 sy command
1217 Execute shell command. Ignored because insecure.
1218
1219 T& Re-start a table layout, retaining the options of the prior table
1220 invocation. See TS.
1221
1222 ta [width ... [T width ...]]
1223 Set tab stops. Each width argument follows the syntax of Scaling
1224 Widths. If prefixed by a plus sign, it is relative to the previ‐
1225 ous tab stop. The arguments after the T marker are used repeat‐
1226 edly as often as needed; for each reuse, they are taken relative
1227 to the last previously established tab stop. When ta is called
1228 without arguments, all tab stops are cleared.
1229
1230 tc [glyph]
1231 Change tab repetition character. Currently unsupported.
1232
1233 TE End a table context. See TS.
1234
1235 ti [+|-]width
1236 Break the output line and indent the next output line by width.
1237 If a sign is specified, the temporary indentation is calculated
1238 relative to the current indentation; otherwise, it is absolute.
1239 The argument follows the syntax of Scaling Widths and the default
1240 scaling unit is m.
1241
1242 tkf font minps width1 maxps width2
1243 Enable track kerning for a font. Currently ignored.
1244
1245 tl 'left'center'right'
1246 Print a title line. Currently unsupported.
1247
1248 tm string
1249 Print to standard error output. Currently ignored.
1250
1251 tm1 string
1252 Print to standard error output, allowing leading blanks. This is
1253 a groff extension and currently ignored.
1254
1255 tmc string
1256 Print to standard error output without a trailing newline. This
1257 is a groff extension and currently ignored.
1258
1259 tr glyph glyph ...
1260 Output character translation. The first glyph in each pair is
1261 replaced by the second one. Character escapes can be used; for
1262 example,
1263
1264 tr \(xx\(yy
1265
1266 replaces all invocations of \(xx with \(yy.
1267
1268 track font minps width1 maxps width2
1269 Static letter space tracking. This is a Heirloom extension and
1270 currently ignored.
1271
1272 transchar char ...
1273 Define transparent characters for sentence-ending. This is a
1274 Heirloom extension and currently ignored.
1275
1276 trf filename
1277 Output the contents of a file, disallowing invalid characters.
1278 This is a groff extension and ignored because insecure.
1279
1280 trimat left top width height
1281 Set the TrimBox page parameter for PDF generation. This is a
1282 Heirloom extension and currently ignored.
1283
1284 trin glyph glyph ...
1285 Output character translation, ignored by asciify. Currently un‐
1286 supported.
1287
1288 trnt glyph glyph ...
1289 Output character translation, ignored by \!. Currently unsup‐
1290 ported.
1291
1292 troff Force troff mode. This is a groff extension and currently ig‐
1293 nored.
1294
1295 TS Begin a table, which formats input in aligned rows and columns.
1296 See tbl(7) for a description of the tbl language.
1297
1298 uf font
1299 Globally set the underline font. Currently ignored.
1300
1301 ul [N] Underline next N input lines. Currently ignored.
1302
1303 unformat divname
1304 Unformat spaces and tabs in a diversion. Currently unsupported.
1305
1306 unwatch macroname
1307 Disable notification for string or macro. This is a Heirloom ex‐
1308 tension and currently ignored.
1309
1310 unwatchn register
1311 Disable notification for register. This is a Heirloom extension
1312 and currently ignored.
1313
1314 vpt [1 | 0]
1315 Enable or disable vertical position traps. This is a groff ex‐
1316 tension and currently ignored.
1317
1318 vs [[+|-]height]
1319 Change vertical spacing. Currently ignored.
1320
1321 warn flags
1322 Set warning level. Currently ignored.
1323
1324 warnscale si
1325 Set the scaling indicator used in warnings. This is a groff ex‐
1326 tension and currently ignored.
1327
1328 watch macroname
1329 Notify on change of string or macro. This is a Heirloom exten‐
1330 sion and currently ignored.
1331
1332 watchlength maxlength
1333 On change, report the contents of macros and strings up to the
1334 specified length. This is a Heirloom extension and currently ig‐
1335 nored.
1336
1337 watchn register
1338 Notify on change of register. This is a Heirloom extension and
1339 currently ignored.
1340
1341 wh dist [macroname]
1342 Set a page location trap. Currently unsupported.
1343
1344 while condition body
1345 Repeated execution while a condition is true, with syntax similar
1346 to if. Currently implemented with two restrictions: cannot nest,
1347 and each loop must start and end in the same scope.
1348
1349 write ["]string
1350 Write to an open file. Ignored because insecure.
1351
1352 writec ["]string
1353 Write to an open file without appending a newline. Ignored be‐
1354 cause insecure.
1355
1356 writem macroname
1357 Write macro or string to an open file. Ignored because insecure.
1358
1359 xflag level
1360 Set the extension level. This is a Heirloom extension and cur‐
1361 rently ignored.
1362
1363 Numerical expressions
1364 The nr, if, and ie requests accept integer numerical expressions as argu‐
1365 ments. These are always evaluated using the C int type; integer overflow
1366 works the same way as in the C language. Numbers consist of an arbitrary
1367 number of digits ‘0’ to ‘9’ prefixed by an optional sign ‘+’ or ‘-’.
1368 Each number may be followed by one optional scaling unit described below
1369 Scaling Widths. The following equations hold:
1370
1371 1i = 6v = 6P = 10m = 10n = 72p = 1000M = 240u = 240
1372 254c = 100i = 24000u = 24000
1373 1f = 65536u = 65536
1374
1375 The following binary operators are implemented. Unless otherwise stated,
1376 they behave as in the C language:
1377
1378 + addition
1379 - subtraction
1380 * multiplication
1381 / division
1382 % remainder of division
1383 < less than
1384 > greater than
1385 == equal to
1386 = equal to, same effect as == (this differs from C)
1387 <= less than or equal to
1388 >= greater than or equal to
1389 <> not equal to (corresponds to C !=; this one is of limited portabil‐
1390 ity, it is supported by Heirloom roff, but not by groff)
1391 & logical and (corresponds to C &&)
1392 : logical or (corresponds to C ||)
1393 <? minimum (not available in C)
1394 >? maximum (not available in C)
1395
1396 There is no concept of precedence; evaluation proceeds from left to
1397 right, except when subexpressions are enclosed in parentheses. Inside
1398 parentheses, whitespace is ignored.
1399
1401 The mandoc(1) roff parser recognises the following escape sequences. In
1402 mdoc(7) and man(7) documents, using escape sequences is discouraged ex‐
1403 cept for those described in the LANGUAGE SYNTAX section above.
1404
1405 A backslash followed by any character not listed here simply prints that
1406 character itself.
1407
1408 \<newline>
1409 A backslash at the end of an input line can be used to continue
1410 the logical input line on the next physical input line, joining
1411 the text on both lines together as if it were on a single input
1412 line.
1413
1414 \<space>
1415 The escape sequence backslash-space (‘\ ’) is an unpaddable
1416 space-sized non-breaking space character; see Whitespace and
1417 mandoc_char(7).
1418
1419 \! Embed text up to and including the end of the input line into the
1420 current diversion or into intermediate output without interpret‐
1421 ing requests, macros, and escapes. Currently unsupported.
1422
1423 \" The rest of the input line is treated as Comments.
1424
1425 \# Line continuation with comment. Discard the rest of the physical
1426 input line and continue the logical input line on the next physi‐
1427 cal input line, joining the text on both lines together as if it
1428 were on a single input line. This is a groff extension.
1429
1430 \$arg Macro argument expansion, see de.
1431
1432 \% Hyphenation allowed at this point of the word; ignored by
1433 mandoc(1).
1434
1435 \& Non-printing zero-width character, often used for various kinds
1436 of escaping; see Whitespace, mandoc_char(7), and the “MACRO
1437 SYNTAX” and “Delimiters” sections in mdoc(7).
1438
1439 \' Acute accent special character; use \(aa instead.
1440
1441 \(cc Special Characters with two-letter names, see mandoc_char(7).
1442
1443 \) Zero-width space transparent to end-of-sentence detection; ig‐
1444 nored by mandoc(1).
1445
1446 \*[name]
1447 Interpolate the string with the name. For short names, there are
1448 variants \*c and \*(cc.
1449
1450 One string is predefined on the roff language level: \*(.T ex‐
1451 pands to the name of the output device, for example ascii, utf8,
1452 ps, pdf, html, or markdown.
1453
1454 Macro sets traditionally predefine additional strings which are
1455 not portable and differ across implementations. Those supported
1456 by mandoc(1) are listed in mandoc_char(7).
1457
1458 Strings can be defined, changed, and deleted with the ds, as, and
1459 rm requests.
1460
1461 \, Left italic correction (groff extension); ignored by mandoc(1).
1462
1463 \- Special character “mathematical minus sign”; see mandoc_char(7)
1464 for details.
1465
1466 \/ Right italic correction (groff extension); ignored by mandoc(1).
1467
1468 \: Breaking the line is allowed at this point of the word without
1469 inserting a hyphen.
1470
1471 \? Embed the text up to the next \? into the current diversion with‐
1472 out interpreting requests, macros, and escapes. This is a groff
1473 extension and currently unsupported.
1474
1475 \[name]
1476 Special Characters with names of arbitrary length, see
1477 mandoc_char(7).
1478
1479 \^ One-twelfth em half-narrow space character, effectively zero-
1480 width in mandoc(1).
1481
1482 \_ Underline special character; use \(ul instead.
1483
1484 \` Grave accent special character; use \(ga instead.
1485
1486 \{ Begin conditional input; see if.
1487
1488 \| One-sixth em narrow space character, effectively zero-width in
1489 mandoc(1).
1490
1491 \} End conditional input; see if.
1492
1493 \~ Paddable non-breaking space character.
1494
1495 \0 Digit width space character.
1496
1497 \A'string'
1498 Anchor definition; ignored by mandoc(1).
1499
1500 \a Leader character; ignored by mandoc(1).
1501
1502 \B'string'
1503 Interpolate ‘1’ if string conforms to the syntax of Numerical
1504 expressions explained above or ‘0’ otherwise.
1505
1506 \b'string'
1507 Bracket building function; ignored by mandoc(1).
1508
1509 \C'name'
1510 Special Characters with names of arbitrary length.
1511
1512 \c When encountered at the end of an input text line, the next input
1513 text line is considered to continue that line, even if there are
1514 request or macro lines in between. No whitespace is inserted.
1515
1516 \D'string'
1517 Draw graphics function; ignored by mandoc(1).
1518
1519 \d Move down by half a line; ignored by mandoc(1).
1520
1521 \E Escape character intended to not be interpreted in copy mode. In
1522 mandoc(1), it currently does the same as \ itself.
1523
1524 \e Backslash special character.
1525
1526 \F[name]
1527 Switch font family (groff extension); ignored by mandoc(1). For
1528 short names, there are variants \Fc and \F(cc.
1529
1530 \f[name]
1531 Switch to the font name, see Font Selection. For short names,
1532 there are variants \fc and \f(cc. An empty name \f[] defaults to
1533 \fP.
1534
1535 \g[name]
1536 Interpolate the format of a number register; ignored by
1537 mandoc(1). For short names, there are variants \gc and \g(cc.
1538
1539 \H'[+|-]number'
1540 Set the height of the current font; ignored by mandoc(1).
1541
1542 \h'[|]width'
1543 Horizontal motion. If the vertical bar is given, the motion is
1544 relative to the current indentation. Otherwise, it is relative
1545 to the current position. The default scaling unit is m.
1546
1547 \k[name]
1548 Mark horizontal input place in register; ignored by mandoc(1).
1549 For short names, there are variants \kc and \k(cc.
1550
1551 \L'number[c]'
1552 Vertical line drawing function; ignored by mandoc(1).
1553
1554 \l'width[c]'
1555 Draw a horizontal line of width using the glyph c.
1556
1557 \M[name]
1558 Set fill (background) color (groff extension); ignored by
1559 mandoc(1). For short names, there are variants \Mc and \M(cc.
1560
1561 \m[name]
1562 Set glyph drawing color (groff extension); ignored by mandoc(1).
1563 For short names, there are variants \mc and \m(cc.
1564
1565 \N'number'
1566 Character number on the current font.
1567
1568 \n[+|-][name]
1569 Interpolate the number register name. For short names, there are
1570 variants \nc and \n(cc. If the optional sign is specified, the
1571 register is first incremented or decremented by the stepsize that
1572 was specified in the relevant nr request, and the changed value
1573 is interpolated.
1574
1575 \Odigit, \O[5arguments]
1576 Suppress output. This is a groff extension and currently unsup‐
1577 ported. With an argument of 1, 2, 3, or 4, it is ignored.
1578
1579 \o'string'
1580 Overstrike, writing all the characters contained in the string to
1581 the same output position. In terminal and HTML output modes,
1582 only the last one of the characters is visible.
1583
1584 \p Break the output line at the end of the current word.
1585
1586 \R'name [+|-]number'
1587 Set number register; ignored by mandoc(1).
1588
1589 \r Move up by one line; ignored by mandoc(1).
1590
1591 \S'number'
1592 Slant output; ignored by mandoc(1).
1593
1594 \s'[+|-]number'
1595 Change point size; ignored by mandoc(1). Alternative forms
1596 \s[+|-]n, \s[+|-]'number', \s[[+|-]number], and \s[+|-][number]
1597 are also parsed and ignored.
1598
1599 \t Horizontal tab; ignored by mandoc(1).
1600
1601 \u Move up by half a line; ignored by mandoc(1).
1602
1603 \V[name]
1604 Interpolate an environment variable; ignored by mandoc(1). For
1605 short names, there are variants \Vc and \V(cc.
1606
1607 \v'number'
1608 Vertical motion; ignored by mandoc(1).
1609
1610 \w'string'
1611 Interpolate the width of the string. The mandoc(1) implementa‐
1612 tion assumes that after expansion of user-defined strings, the
1613 string only contains normal characters, no escape sequences, and
1614 that each character has a width of 24 basic units.
1615
1616 \X'string'
1617 Output string as device control function; ignored in nroff mode
1618 and by mandoc(1).
1619
1620 \x'number'
1621 Extra line space function; ignored by mandoc(1).
1622
1623 \Y[name]
1624 Output a string as a device control function; ignored in nroff
1625 mode and by mandoc(1). For short names, there are variants \Yc
1626 and \Y(cc.
1627
1628 \Z'string'
1629 Print string with zero width and height; ignored by mandoc(1).
1630
1631 \z Output the next character without advancing the cursor position.
1632
1634 The mandoc(1) implementation of the roff language is incomplete. Major
1635 unimplemented features include:
1636
1637 - For security reasons, mandoc(1) never reads or writes external files
1638 except via so requests with safe relative paths.
1639 - There is no automatic hyphenation, no adjustment to the right margin,
1640 and very limited support for centering; the output is always set
1641 flush-left.
1642 - Support for setting tabulator and leader characters is missing, and
1643 support for manually changing indentation is limited.
1644 - The ‘u’ scaling unit is the default terminal unit. In traditional
1645 troff systems, this unit changes depending on the output media.
1646 - Width measurements are implemented in a crude way and often yield
1647 wrong results. Support for explicit movement requests and escapes is
1648 limited.
1649 - There is no concept of output pages, no support for floats, graphics
1650 drawing, and picture inclusion; terminal output is always continuous.
1651 - Requests regarding color, font families, font sizes, and glyph manip‐
1652 ulation are ignored. Font support is very limited. Kerning is not
1653 implemented, and no ligatures are produced.
1654 - The "'" macro control character does not suppress output line breaks.
1655 - Diversions and environments are not implemented, and support for
1656 traps is very incomplete.
1657 - Use of macros is not supported inside tbl(7) code.
1658
1659 The special semantics of the nS number register is an idiosyncrasy of
1660 OpenBSD manuals and not supported by other mdoc(7) implementations.
1661
1663 mandoc(1), eqn(7), man(7), mandoc_char(7), mdoc(7), tbl(7)
1664
1665 Joseph F. Ossanna and Brian W. Kernighan, Troff User's Manual, AT&T Bell
1666 Laboratories, Computing Science Technical Report, 54,
1667 http://www.kohala.com/start/troff/cstr54.ps, Murray Hill, New Jersey,
1668 1976 and 1992.
1669
1670 Joseph F. Ossanna, Brian W. Kernighan, and Gunnar Ritter, Heirloom
1671 Documentation Tools Nroff/Troff User's Manual,
1672 http://heirloom.sourceforge.net/doctools/troff.pdf, September 17, 2007.
1673
1675 The RUNOFF typesetting system, whose input forms the basis for roff, was
1676 written in MAD and FAP for the CTSS operating system by Jerome E.
1677 Saltzer in 1964. Doug McIlroy rewrote it in BCPL in 1969, renaming it
1678 roff. Dennis M. Ritchie rewrote McIlroy's roff in PDP-11 assembly for
1679 Version 1 AT&T UNIX, Joseph F. Ossanna improved roff and renamed it nroff
1680 for Version 2 AT&T UNIX, then ported nroff to C as troff, which Brian W.
1681 Kernighan released with Version 7 AT&T UNIX. In 1989, James Clark re-im‐
1682 plemented troff in C++, naming it groff.
1683
1685 This roff reference was written by Kristaps Dzonsons <kristaps@bsd.lv>
1686 and Ingo Schwarze <schwarze@openbsd.org>.
1687
1688BSD September 18, 2021 BSD