1 .\" $Id: roff.7,v 1.77 2017/05/05 02:31:35 schwarze Exp $
3 .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010, 2011, 2013-2015 Ingo Schwarze <schwarze@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: May 5 2017 $
23 .Nd roff language reference for mandoc
27 language is a general purpose text formatting language.
28 Since traditional implementations of the
32 manual formatting languages are based on it,
33 many real-world manuals use small numbers of
35 requests and escape sequences intermixed with their
40 To properly format such manuals, the
42 utility supports a tiny subset of
45 Only these requests and escapes supported by
47 are documented in the present manual,
48 together with the basic language syntax shared by
59 Input lines beginning with the control character
61 are parsed for requests and macros.
67 Requests change the processing state and manipulate the formatting;
68 some macros also define the document structure and produce formatted
72 is accepted as an alternative control character,
78 Lines not beginning with control characters are called
80 They provide free-form text to be printed; the formatting of the text
81 depends on the respective processing context.
84 documents may contain only graphable 7-bit ASCII characters, the space
85 character, and, in certain circumstances, the tab character.
86 The backslash character
88 indicates the start of an escape sequence, used for example for
90 .Sx Special Characters ,
91 .Sx Predefined Strings ,
93 user-defined strings defined using the
96 For a listing of escape sequences, consult the
97 .Sx ESCAPE SEQUENCE REFERENCE
100 Text following an escaped double-quote
102 whether in a request, macro, or text line, is ignored to the end of the line.
103 A request line beginning with a control character and comment escape
106 Furthermore, request lines with only a control character and optional
107 trailing whitespace are stripped from input.
110 .Bd -literal -offset indent -compact
111 \&.\e\(dq This is a comment line.
112 \&.\e\(dq The next line is ignored:
114 \&.Sh EXAMPLES \e\(dq This is a comment, too.
115 \&example text \e\(dq And so is this.
117 .Ss Special Characters
118 Special characters are used to encode special glyphs and are rendered
119 differently across output media.
120 They may occur in request, macro, and text lines.
121 Sequences begin with the escape character
123 followed by either an open-parenthesis
125 for two-character sequences; an open-bracket
127 for n-character sequences (terminated at a close-bracket
129 or a single one character sequence.
132 .Bl -tag -width Ds -offset indent -compact
134 Two-letter em dash escape.
136 One-letter backslash escape.
143 Terms may be text-decorated using the
145 escape followed by an indicator: B (bold), I (italic), R (regular), or P
146 (revert to previous mode).
147 A numerical representation 3, 2, or 1 (bold, italic, and regular,
148 respectively) may be used instead.
149 The indicator or numerical representative may be preceded by C
150 (constant-width), which is ignored.
152 The two-character indicator
154 requests a font that is both bold and italic.
155 It may not be portable to old roff implementations.
158 .Bl -tag -width Ds -offset indent -compact
160 Write in \fBbold\fP, then switch to regular font mode.
161 .It Li \efIitalic\efP
162 Write in \fIitalic\fP, then return to previous font mode.
163 .It Li \ef(BIbold italic\efP
164 Write in \f(BIbold italic\fP, then return to previous font mode.
171 which encourages semantic annotation.
172 .Ss Predefined Strings
173 Predefined strings, like
174 .Sx Special Characters ,
175 mark special output glyphs.
176 Predefined strings are escaped with the slash-asterisk,
186 .Bl -tag -width Ds -offset indent -compact
188 Two-letter ampersand predefined string.
190 One-letter double-quote predefined string.
193 Predefined strings are not recommended for use,
194 as they differ across implementations.
199 Manuals using these predefined strings are almost certainly not portable.
201 Whitespace consists of the space character.
202 In text lines, whitespace is preserved within a line.
203 In request and macro lines, whitespace delimits arguments and is discarded.
205 Unescaped trailing spaces are stripped from text line input unless in a
207 In general, trailing whitespace on any input line is discouraged for
208 reasons of portability.
209 In the rare case that a blank character is needed at the end of an
210 input line, it may be forced by
213 Literal space characters can be produced in the output
214 using escape sequences.
215 In macro lines, they can also be included in arguments using quotation; see
219 Blank text lines, which may include whitespace, are only permitted
220 within literal contexts.
221 If the first character of a text line is a space, that line is printed
222 with a leading newline.
224 Many requests and macros support scaled widths for their arguments.
225 The syntax for a scaled width is
226 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
227 where a decimal must be preceded or followed by at least one digit.
228 Negative numbers, while accepted, are truncated to zero.
230 The following scaling units are accepted:
232 .Bl -tag -width Ds -offset indent -compact
246 default vertical span
258 default horizontal span for the terminal
263 Using anything other than
268 is necessarily non-portable across output media.
272 If a scaling unit is not provided, the numerical value is interpreted
273 under the default rules of
275 for vertical spaces and
280 .Bl -tag -width ".Bl -tag -width 2i" -offset indent -compact
281 .It Li \&.Bl -tag -width 2i
282 two-inch tagged list indentation in
285 two-inch tagged list indentation in
291 Each sentence should terminate at the end of an input line.
292 By doing this, a formatter will be able to apply the proper amount of
293 spacing after the end of sentence (unescaped) period, exclamation mark,
294 or question mark followed by zero or more non-sentence closing
303 The proper spacing is also intelligently preserved if a sentence ends at
304 the boundary of a macro line.
307 .Bd -literal -offset indent -compact
308 Do not end sentences mid-line like this. Instead,
309 end a sentence like this.
310 A macro would end like this:
314 A request or macro line consists of:
318 the control character
322 at the beginning of the line,
324 optionally an arbitrary amount of whitespace,
326 the name of the request or the macro, which is one word of arbitrary
327 length, terminated by whitespace,
329 and zero or more arguments delimited by whitespace.
332 Thus, the following request lines are all equivalent:
333 .Bd -literal -offset indent
339 Macros are provided by the
343 languages and can be defined by the
346 When called, they follow the same syntax as requests, except that
347 macro arguments may optionally be quoted by enclosing them
348 in double quote characters
350 Quoted text, even if it contains whitespace or would cause
351 a macro invocation when unquoted, is always considered literal text.
352 Inside quoted text, pairs of double quote characters
354 resolve to single double quote characters.
356 To be recognised as the beginning of a quoted argument, the opening
357 quote character must be preceded by a space character.
358 A quoted argument extends to the next double quote character that is not
359 part of a pair, or to the end of the input line, whichever comes earlier.
360 Leaving out the terminating double quote character at the end of the line
362 For clarity, if more arguments follow on the same input line,
363 it is recommended to follow the terminating double quote character
364 by a space character; in case the next character after the terminating
365 double quote character is anything else, it is regarded as the beginning
366 of the next, unquoted argument.
368 Both in quoted and unquoted arguments, pairs of backslashes
370 resolve to single backslashes.
371 In unquoted arguments, space characters can alternatively be included
372 by preceding them with a backslash
374 but quoting is usually better for clarity.
377 .Bl -tag -width Ds -offset indent -compact
378 .It Li .Fn strlen \(dqconst char *s\(dq
381 into one function argument.
387 would be considered separate arguments.
388 .It Li .Op \(dqFl a\(dq
391 as literal text instead of a flag macro.
393 .Sh REQUEST REFERENCE
397 parser recognises the following requests.
398 For requests marked as "ignored" or "unsupported", any arguments are
399 ignored, and the number of arguments is not checked.
402 Currently unsupported.
404 Set line adjustment mode.
405 It takes one argument to select normal, left, right,
406 or center adjustment for subsequent text.
409 Assign an output format to a number register.
412 Create an alias for a number register.
413 Currently unsupported.
415 Create an alias for a request, string, macro, or diversion.
416 Currently unsupported.
418 Append to a macro definition.
419 The syntax of this request is the same as that of
422 Append to a macro definition, switching roff compatibility mode off
423 during macro execution (groff extension).
424 The syntax of this request is the same as that of
430 compatibility mode at all, it handles this request as an alias for
433 Append to a macro definition, specifying the macro name indirectly
435 The syntax of this request is the same as that of
438 Append to a macro definition, specifying the macro name indirectly
439 and switching roff compatibility mode off during macro execution
441 The syntax of this request is the same as that of
447 compatibility mode at all, it handles this request as an alias for
450 Append to a user-defined string.
451 The syntax of this request is the same as that of
453 If a user-defined string with the specified name does not yet exist,
454 it is set to the empty string before appending.
456 Append to a user-defined string, switching roff compatibility mode off
457 during macro execution (groff extension).
458 The syntax of this request is the same as that of
464 compatibility mode at all, it handles this request as an alias for
467 Fully unformat a diversion.
468 Currently unsupported.
470 Print a backtrace of the input stack.
471 This is a groff extension and currently ignored.
473 Artificially embolden by repeated printing with small shifts.
476 Set the BleedBox page parameter for PDF generation.
477 This is a Heirloom extension and currently ignored.
479 Set a blank line trap.
480 Currently unsupported.
482 Begin a diversion without including a partially filled line.
483 Currently unsupported.
485 Add to a diversion without including a partially filled line.
486 Currently unsupported.
491 Define a frame and place a picture in it.
492 This is a Heirloom extension and currently unsupported.
494 Break the output line.
499 Currently unsupported.
501 Optional line break characters.
502 This is a Heirloom extension and currently ignored.
504 Break output line after next N input lines.
505 This is a Heirloom extension and currently ignored.
507 Break and spread output line.
508 Currently, this is implemented as an alias for
511 Break and spread output line after next N input lines.
512 This is a Heirloom extension and currently ignored.
514 Change the no-break control character.
515 Currently unsupported.
517 Change the control character.
518 Its syntax is as follows:
519 .Bd -literal -offset indent
520 .Pf . Cm \&cc Op Ar c
525 is not specified, the control character is reset to
527 Trailing characters are ignored.
530 It takes one integer argument, specifying how many lines to center.
533 Output the contents of a file.
534 Ignored because insecure.
537 This is a groff extension and currently ignored.
539 Change a trap location.
543 Currently unsupported.
545 Remove the last character from a macro, string, or diversion.
546 Currently unsupported.
548 Define a character class.
549 This is a groff extension and currently ignored.
552 Ignored because insecure.
555 This is a Heirloom extension and currently unsupported.
557 Activate or deactivate colors.
558 This is a groff extension and currently ignored.
560 Define a name component for composite glyph names.
561 This is a groff extension and currently unsupported.
563 Immediately start the next iteration of a
566 Currently unsupported.
570 compatibility mode on or off.
573 Set the CropBox page parameter for PDF generation.
574 This is a Heirloom extension and currently ignored.
576 Constant character spacing mode.
579 Underline including whitespace.
582 Append to a diversion.
583 Currently unsupported.
585 Change a trap location in the current diversion.
586 This is a Heirloom extension and currently unsupported.
591 Its syntax can be either
592 .Bd -literal -offset indent
593 .Pf . Cm \&de Ar name
599 .Bd -literal -offset indent
600 .Pf . Cm \&de Ar name Ar end
605 Both forms define or redefine the macro
608 .Ar macro definition ,
609 which may consist of one or more input lines, including the newline
610 characters terminating each line, optionally containing calls to
614 macros or high-level macros like
618 macros, whichever applies to the document in question.
622 macro works in the same way as for
627 .Ar macro definition ,
628 and after that, it is also evaluated as a
632 macro, but not as a high-level macro.
634 The macro can be invoked later using the syntax
636 .D1 Pf . Ar name Op Ar argument Op Ar argument ...
638 Regarding argument parsing, see
642 The line invoking the macro will be replaced
643 in the input stream by the
644 .Ar macro definition ,
645 replacing all occurrences of
650 .Ar N Ns th Ar argument .
652 .Bd -literal -offset indent
654 \efI\e^\e\e$1\e^\efP\e\e$2
661 .D1 \efI\e^XtFree\e^\efP.
663 in the input stream, and thus in the output: \fI\^XtFree\^\fP.
664 Each occurrence of \e\e$* is replaced with all the arguments,
665 joined together with single blank characters.
667 Since macros and user-defined strings share a common string table,
670 clobbers the user-defined string
674 can also be printed using the
676 string interpolation syntax described below
678 but this is rarely useful because every macro definition contains at least
679 one explicit newline character.
681 In order to prevent endless recursion, both groff and
683 limit the stack depth for expanding macros and strings
684 to a large, but finite number, and
686 also limits the length of the expanded input line.
687 Do not rely on the exact values of these limits.
691 macro that will be executed with
693 compatibility mode switched off during macro execution.
694 This is a groff extension.
699 compatibility mode at all, it handles this request as an alias for
703 This is a groff extension and currently ignored.
707 macro, specifying the macro name indirectly (groff extension).
708 The syntax of this request is the same as that of
712 .D1 Pf . Cm \&dei Ar name Op Ar end
714 has the same effect as:
716 .D1 Pf . Cm \&de No \e* Ns Bo Ar name Bc Op \e* Ns Bq Ar end
720 macro that will be executed with
722 compatibility mode switched off during macro execution,
723 specifying the macro name indirectly (groff extension).
728 compatibility mode at all, it handles this request as an alias for
731 This request only makes sense with the groff-specific intermediate
732 output format and is unsupported.
734 This request only makes sense with the groff-specific intermediate
735 output format and is unsupported.
738 Currently unsupported.
742 request or macro line with compatibility mode disabled.
743 Currently unsupported.
745 Define a user-defined string.
746 Its syntax is as follows:
748 .D1 Pf . Cm \&ds Ar name Oo \(dq Oc Ns Ar string
754 arguments are space-separated.
757 begins with a double-quote character, that character will not be part
759 All remaining characters on the input line form the
761 including whitespace and double-quote characters, even trailing ones.
765 can be interpolated into subsequent text by using
766 .No \e* Ns Bq Ar name
769 of arbitrary length, or \e*(NN or \e*N if the length of
771 is two or one characters, respectively.
772 Interpolation can be prevented by escaping the leading backslash;
773 that is, an asterisk preceded by an even number of backslashes
774 does not trigger string interpolation.
776 Since user-defined strings and macros share a common string table,
783 used for defining a string can also be invoked as a macro,
784 in which case the following input line will be appended to the
786 forming a new input line passed to the
790 .Bd -literal -offset indent
801 Such abuse is of course strongly discouraged.
803 Define a user-defined string that will be expanded with
805 compatibility mode switched off during string expansion.
806 This is a groff extension.
811 compatibility mode at all, it handles this request as an alias for
814 Set a location trap in the current diversion.
815 This is a Heirloom extension and currently unsupported.
817 Set a trap within a diversion.
818 Currently unsupported.
820 Change the escape character.
821 Currently unsupported.
823 Restore the escape character.
824 Currently unsupported.
826 Save the escape character.
827 Currently unsupported.
831 half of an if/else conditional.
832 Pops a result off the stack of conditional evaluations pushed by
834 and uses it as its conditional.
835 If no stack entries are present (e.g., due to no prior
838 then false is assumed.
839 The syntax of this request is similar to
841 except that the conditional is missing.
843 Set a trap at the end of input.
844 Currently unsupported.
846 End an equation block.
850 Disable the escape mechanism completely.
851 Currently unsupported.
853 End a picture started by
855 This is a Heirloom extension and currently unsupported.
857 Begin an equation block.
860 for a description of the equation language.
862 Print a string like an error message.
863 This is a Heirloom extension and currently ignored.
865 Switch to another environment.
866 Currently unsupported.
868 Copy an environment into the current environment.
869 Currently unsupported.
871 Abort processing and exit.
872 Currently unsupported.
874 Select the fallback sequence for a font.
875 This is a Heirloom extension and currently ignored.
877 Change the font family.
878 Takes one argument specifying the font family to be selected.
879 It is a groff extension and currently ignored.
881 Define a delimiting and a padding character for fields.
882 Currently unsupported.
884 Define a fallback glyph.
885 Currently unsupported.
887 Set the fill color for \eD objects.
888 This is a groff extension and currently ignored.
890 Defer ligature building.
891 This is a Heirloom extension and currently ignored.
893 Enable or disable an OpenType feature.
894 This is a Heirloom extension and currently ignored.
902 Control the use of kerning tables for a font.
903 This is a Heirloom extension and currently ignored.
909 This is a Heirloom extension and currently ignored.
911 Assign font position.
914 Mount a font with a special character map.
915 This is a Heirloom extension and currently ignored.
917 Define a font-specific fallback glyph.
918 This is a groff extension and currently unsupported.
920 Set a font-specific width for the space character.
921 This is a Heirloom extension and currently ignored.
923 Conditionally define a special font.
924 This is a groff extension and currently ignored.
927 Its syntax is as follows:
929 .D1 Pf . Cm \&ft Op Ar font
933 arguments are supported:
934 .Bl -tag -width 4n -offset indent
935 .It Cm B , BI , 3 , 4
944 switches to normal font
945 .It Cm P No "or no argument"
946 switches back to the previous font
949 This request takes effect only locally and may be overridden
950 by macros and escape sequences.
953 This is a groff extension and currently ignored.
959 This is a groff extension and currently ignored.
961 Set the hyphenation character.
964 Set hyphenation codes of characters.
967 Hide characters in a font.
968 This is a Heirloom extension and currently ignored.
970 Set hyphenation language.
971 This is a groff extension and currently ignored.
973 Set maximum number of consecutive hyphenated lines.
976 Load hyphenation pattern file.
977 This is a groff extension and currently ignored.
979 Load hyphenation pattern file, appending to the current patterns.
980 This is a groff extension and currently ignored.
982 Define mapping values for character codes in hyphenation patterns.
983 This is a groff extension and currently ignored.
985 Specify hyphenation points in words.
988 Set automatic hyphenation mode.
991 Set hyphenation language.
992 This is a Heirloom extension and currently ignored.
994 Minimum word length for hyphenation.
995 This is a Heirloom extension and currently ignored.
997 Set hyphenation margin.
998 This is a groff extension and currently ignored.
1000 Define hyphenation penalties.
1001 This is a Heirloom extension and currently ignored.
1003 Set hyphenation space.
1004 This is a groff extension and currently ignored.
1008 half of an if/else conditional.
1009 The result of the conditional is pushed into a stack used by subsequent
1012 which may be separated by any intervening input (or not exist at all).
1013 Its syntax is equivalent to
1016 Begins a conditional.
1017 This request has the following syntax:
1018 .Bd -literal -offset indent
1021 .Bd -literal -offset indent
1025 .Bd -literal -offset indent
1031 COND is a conditional statement.
1034 supports the following subset of roff conditionals:
1039 is prefixed to COND, the condition is logically inverted.
1041 If the first character of COND is
1047 COND evaluates to true.
1049 If the first character of COND is
1051 .Pq character available ,
1053 .Pq string defined ,
1061 COND evaluates to false.
1063 If the first character of COND is
1065 it evaluates to true if the rest of COND is the name of an existing
1066 number register; otherwise, it evaluates to false.
1068 If COND starts with a parenthesis or with an optionally signed
1069 integer number, it is evaluated according to the rules of
1070 .Sx Numerical expressions
1072 It evaluates to true if the result is positive,
1073 or to false if the result is zero or negative.
1075 Otherwise, the first character of COND is regarded as a delimiter
1076 and COND evaluates to true if the string extending from its first
1077 to its second occurrence is equal to the string extending from its
1078 second to its third occurrence.
1080 If COND cannot be parsed, it evaluates to false.
1083 If a conditional is false, its children are not processed, but are
1084 syntactically interpreted to preserve the integrity of the input
1092 which may lead to interesting results, but
1094 .D1 \&.if t .if t \e{\e
1096 will continue to syntactically interpret to the block close of the final
1098 Sub-conditionals, in this case, obviously inherit the truth value of
1101 If the BODY section is begun by an escaped brace
1103 scope continues until the end of the input line containing the
1104 matching closing-brace escape sequence
1106 If the BODY is not enclosed in braces, scope continues until
1107 the end of the line.
1108 If the COND is followed by a BODY on the same line, whether after a
1109 brace or not, then requests and macros
1111 begin with a control character.
1112 It is generally more intuitive, in this case, to write
1113 .Bd -literal -offset indent
1120 than having the request or macro follow as
1122 .D1 \&.if COND \e{ .foo
1124 The scope of a conditional is always parsed, but only executed if the
1125 conditional evaluates to true.
1129 is converted into a zero-width escape sequence if not passed as a
1138 being considered an argument of the
1143 Its syntax can be either
1144 .Bd -literal -offset indent
1151 .Bd -literal -offset indent
1152 .Pf . Cm \&ig Ar end
1157 In the first case, input is ignored until a
1159 request is encountered on its own line.
1160 In the second case, input is ignored until the specified
1162 macro is encountered.
1163 Do not use the escape character
1165 anywhere in the definition of
1167 it would cause very strange behaviour.
1171 macro is a roff request or a roff macro, like in
1175 the subsequent invocation of
1177 will first terminate the
1179 then be invoked as usual.
1180 Otherwise, it only terminates the
1182 and arguments following it or the
1184 request are discarded.
1192 Find a substring in a string.
1193 This is a Heirloom extension and currently unsupported.
1195 Set an input line trap.
1196 Its syntax is as follows:
1198 .D1 Pf . Cm it Ar expression macro
1202 will be invoked after processing the number of input text lines
1203 specified by the numerical
1205 While evaluating the
1207 the unit suffixes described below
1211 Set an input line trap, not counting lines ending with \ec.
1212 Currently unsupported.
1214 To support the generation of a table of contents,
1216 emits this user-defined macro, usually without defining it.
1217 To avoid reporting large numbers of spurious errors,
1221 Switch kerning on or off.
1224 Increase kerning after some characters.
1225 This is a Heirloom extension and currently ignored.
1227 Increase kerning before some characters.
1228 This is a Heirloom extension and currently ignored.
1230 Add a kerning pair to the kerning table.
1231 This is a Heirloom extension and currently ignored.
1233 Define a leader repetition character.
1234 Currently unsupported.
1239 This is a Heirloom extension and currently unsupported.
1241 Define a local string.
1242 This is a Heirloom extension and currently unsupported.
1244 Count the number of input characters in a user-defined string.
1245 Currently unsupported.
1247 Dynamic letter spacing and reshaping.
1248 This is a Heirloom extension and currently ignored.
1250 Change the line number for error messages.
1251 Ignored because insecure.
1253 Switch the ligature mechanism on or off.
1256 Hang characters at left margin.
1257 This is a Heirloom extension and currently ignored.
1259 Enable or disable line-tabs mode.
1260 This is a groff extension and currently unsupported.
1262 Change the output line length.
1263 Its syntax is as follows:
1265 .D1 Pf . Cm \&ll Op Oo +|- Oc Ns Ar width
1269 argument is omitted, the line length is reset to its previous value.
1270 The default setting for terminal output is 78n.
1271 If a sign is given, the line length is added to or subtracted from;
1272 otherwise, it is set to the provided value.
1273 Using this request in new manuals is discouraged for several reasons,
1274 among others because it overrides the
1277 command line option.
1279 Set local number register.
1280 This is a Heirloom extension and currently unsupported.
1282 Set local floating-point register.
1283 This is a Heirloom extension and currently unsupported.
1286 This is a Heirloom extension and currently unsupported.
1289 It takes one integer argument specifying the vertical distance of
1290 subsequent output text lines measured in v units.
1293 Set a leading spaces trap.
1294 This is a groff extension and currently unsupported.
1296 Set title line length.
1299 Print margin character in the right margin.
1302 Set the device media size.
1303 This is a Heirloom extension and currently ignored.
1305 Set minimum word space.
1306 This is a Heirloom extension and currently ignored.
1308 Mark vertical position.
1312 Ignored because insecure.
1314 Disable adjusting without changing the adjustment mode.
1317 Declare the need for the specified minimum vertical space
1318 before the next trap or the bottom of the page.
1321 Switch to no-fill mode.
1327 Turn off automatic hyphenation mode.
1330 Define hyphenation-inhibiting characters.
1331 This is a Heirloom extension and currently ignored.
1334 Currently unsupported.
1336 Temporarily turn off line numbering.
1337 Currently unsupported.
1339 Execute the rest of the input line as a request or macro line.
1340 Currently unsupported.
1342 Define or change a register.
1343 A register is an arbitrary string value that defines some sort of state,
1344 which influences parsing and/or formatting.
1345 Its syntax is as follows:
1347 .D1 Pf \. Cm \&nr Ar name Oo +|- Oc Ns Ar expression
1352 .Sx Numerical expressions
1354 If it is prefixed by a sign, the register will be
1355 incremented or decremented instead of assigned to.
1357 The following register
1359 is handled specially:
1362 If set to a positive integer value, certain
1364 macros will behave in the same way as in the
1367 If set to 0, these macros will behave in the same way as outside the
1369 section, even when called within the
1372 Note that starting a new
1376 macro will reset this register.
1379 Define or change a floating-point register.
1380 This is a Heirloom extension and currently unsupported.
1383 This is a groff extension and currently ignored.
1385 Turn on no-space mode.
1388 Abort processing of the current input file and process another one.
1389 Ignored because insecure.
1391 Open a file for writing.
1392 Ignored because insecure.
1394 Open a file for appending.
1395 Ignored because insecure.
1397 Output saved vertical space.
1400 Output directly to intermediate output.
1403 Globally control paragraph-at-once adjustment.
1404 This is a Heirloom extension and currently ignored.
1407 This is a Heirloom extension and currently ignored.
1409 Change the page number character.
1413 This is a groff extension and currently ignored.
1415 Pipe output to a shell command.
1416 Ignored because insecure.
1418 Low-level request used by
1420 This is a Heirloom extension and currently unsupported.
1423 Takes one height argument.
1426 Print names and sizes of macros, strings, and diversions.
1429 Change page number of the next page.
1432 Print all number registers.
1435 Set horizontal page offset.
1439 Takes one numerical argument.
1442 Retrieve the bounding box of a PostScript file.
1443 Currently unsupported.
1445 Set a special shape for the current paragraph.
1446 This is a Heirloom extension and currently unsupported.
1448 Include output of a shell command.
1449 Ignored because insecure.
1451 Print the names and positions of all traps.
1452 This is a groff extension and currently ignored.
1454 Change post-vertical spacing.
1455 This is a groff extension and currently ignored.
1457 Remove glyph definitions.
1458 Currently unsupported.
1460 Read from standard input.
1462 .Ss \&recursionlimit
1463 Set the maximum stack depth for recursive macros.
1464 This is a Heirloom extension and currently ignored.
1466 Exit a macro and return to the caller.
1467 Currently unsupported.
1469 Remove font-specific fallback glyph definitions.
1470 Currently unsupported.
1472 Hang characters at right margin.
1473 This is a Heirloom extension and currently ignored.
1475 Justify unfilled text to the right margin.
1478 Remove a request, macro or string.
1479 Its syntax is as follows:
1481 .D1 Pf \. Cm \&rm Ar name
1483 Rename a request, macro, diversion, or string.
1484 Currently unsupported.
1486 Rename a number register.
1487 Currently unsupported.
1490 Its syntax is as follows:
1492 .D1 Pf \. Cm \&rr Ar name
1497 Return to marked vertical position.
1500 Define global fallback glyph.
1501 This is a groff extension and currently unsupported.
1503 Define sentence-ending characters.
1504 This is a Heirloom extension and currently ignored.
1506 Change the soft hyphen character.
1509 Shift macro arguments.
1510 Currently unsupported.
1512 Define permissible point sizes.
1513 This is a groff extension and currently ignored.
1515 Include a source file.
1516 Its syntax is as follows:
1518 .D1 Pf \. Cm \&so Ar file
1522 will be read and its contents processed as input in place of the
1525 To avoid inadvertent inclusion of unrelated files,
1527 only accepts relative paths not containing the strings
1532 This request requires
1534 to change to the right directory before calling
1536 per convention to the root of the manual tree.
1537 Typical usage looks like:
1539 .Dl \&.so man3/Xcursor.3
1541 As the whole concept is rather fragile, the use of
1548 Set the space width from the font metrics file.
1549 This is a Heirloom extension and currently ignored.
1551 Define a special font.
1552 This is a groff extension and currently ignored.
1554 Warn about wide spacing between words.
1557 Set space character size.
1560 Associate style with a font position.
1561 This is a groff extension and currently ignored.
1563 Replace a user-defined string with a substring.
1564 Currently unsupported.
1566 Save vertical space.
1569 Execute shell command.
1570 Ignored because insecure.
1572 Re-start a table layout, retaining the options of the prior table
1578 Takes an arbitrary number of arguments.
1579 Currently unsupported.
1581 Change tab repetition character.
1582 Currently unsupported.
1584 End a table context.
1589 Currently unsupported.
1591 Enable track kerning for a font.
1595 Currently unsupported.
1597 Print to standard error output.
1600 Print to standard error output, allowing leading blanks.
1601 This is a groff extension and currently ignored.
1603 Print to standard error output without a trailing newline.
1604 This is a groff extension and currently ignored.
1606 Output character translation.
1607 Its syntax is as follows:
1609 .D1 Pf \. Cm \&tr Ar [ab]+
1613 characters are replaced
1617 Replacement (or origin) characters may also be character escapes; thus,
1621 replaces all invocations of \e(xx with \e(yy.
1623 Static letter space tracking.
1624 This is a Heirloom extension and currently ignored.
1626 Define transparent characters for sentence-ending.
1627 This is a Heirloom extension and currently ignored.
1629 Output the contents of a file, disallowing invalid characters.
1630 This is a groff extension and ignored because insecure.
1632 Set the TrimBox page parameter for PDF generation.
1633 This is a Heirloom extension and currently ignored.
1635 Output character translation, ignored by
1637 Currently unsupported.
1639 Output character translation, ignored by \e!.
1640 Currently unsupported.
1643 This is a groff extension and currently ignored.
1645 Begin a table, which formats input in aligned rows and columns.
1648 for a description of the tbl language.
1650 Globally set the underline font.
1656 Unformat spaces and tabs in a diversion.
1657 Currently unsupported.
1659 Disable notification for string or macro.
1660 This is a Heirloom extension and currently ignored.
1662 Disable notification for register.
1663 This is a Heirloom extension and currently ignored.
1665 Enable or disable vertical position traps.
1666 This is a groff extension and currently ignored.
1668 Change vertical spacing.
1674 Set the scaling indicator used in warnings.
1675 This is a groff extension and currently ignored.
1677 Notify on change of string or macro.
1678 This is a Heirloom extension and currently ignored.
1680 On change, report the contents of macros and strings
1681 up to the specified length.
1682 This is a Heirloom extension and currently ignored.
1684 Notify on change of register.
1685 This is a Heirloom extension and currently ignored.
1687 Set a page location trap.
1688 Currently unsupported.
1690 Repeated execution while a condition is true.
1691 Currently unsupported.
1693 Write to an open file.
1694 Ignored because insecure.
1696 Write to an open file without appending a newline.
1697 Ignored because insecure.
1699 Write macro or string to an open file.
1700 Ignored because insecure.
1702 Set the extension level.
1703 This is a Heirloom extension and currently ignored.
1704 .Ss Numerical expressions
1710 requests accept integer numerical expressions as arguments.
1711 These are always evaluated using the C
1713 type; integer overflow works the same way as in the C language.
1714 Numbers consist of an arbitrary number of digits
1718 prefixed by an optional sign
1722 Each number may be followed by one optional scaling unit described below
1723 .Sx Scaling Widths .
1724 The following equations hold:
1725 .Bd -literal -offset indent
1726 1i = 6v = 6P = 10m = 10n = 72p = 1000M = 240u = 240
1727 254c = 100i = 24000u = 24000
1731 The following binary operators are implemented.
1732 Unless otherwise stated, they behave as in the C language:
1734 .Bl -tag -width 2n -compact
1744 remainder of division
1752 equal to, same effect as
1754 (this differs from C)
1756 less than or equal to
1758 greater than or equal to
1760 not equal to (corresponds to C
1762 this one is of limited portability, it is supported by Heirloom roff,
1765 logical and (corresponds to C
1768 logical or (corresponds to C
1771 minimum (not available in C)
1773 maximum (not available in C)
1776 There is no concept of precedence; evaluation proceeds from left to right,
1777 except when subexpressions are enclosed in parentheses.
1778 Inside parentheses, whitespace is ignored.
1779 .Sh ESCAPE SEQUENCE REFERENCE
1783 parser recognises the following escape sequences.
1786 language defines more escape sequences not implemented in
1792 documents, using escape sequences is discouraged except for those
1797 A backslash followed by any character not listed here
1798 simply prints that character itself.
1800 A backslash at the end of an input line can be used to continue the
1801 logical input line on the next physical input line, joining the text
1802 on both lines together as if it were on a single input line.
1804 The escape sequence backslash-space
1806 is an unpaddable space-sized non-breaking space character; see
1809 The rest of the input line is treated as
1812 Hyphenation allowed at this point of the word; ignored by
1815 Non-printing zero-width character; see
1818 Acute accent special character; use
1822 .Sx Special Characters
1823 with two-letter names, see
1825 .Ss \e*[ Ns Ar name ]
1826 Interpolate the string with the
1829 .Sx Predefined Strings
1832 For short names, there are variants
1837 Left italic correction (groff extension); ignored by
1841 .Dq mathematical minus sign .
1843 Right italic correction (groff extension); ignored by
1845 .Ss \e[ Ns Ar name ]
1846 .Sx Special Characters
1847 with names of arbitrary length, see
1850 One-twelfth em half-narrow space character, effectively zero-width in
1853 Grave accent special character; use
1857 Begin conditional input; see
1860 One-sixth em narrow space character, effectively zero-width in
1863 End conditional input; see
1866 Paddable non-breaking space character.
1868 Digit width space character.
1869 .Ss \eA\(aq Ns Ar string Ns \(aq
1870 Anchor definition; ignored by
1872 .Ss \eB\(aq Ns Ar string Ns \(aq
1877 conforms to the syntax of
1878 .Sx Numerical expressions
1882 .Ss \eb\(aq Ns Ar string Ns \(aq
1883 Bracket building function; ignored by
1885 .Ss \eC\(aq Ns Ar name Ns \(aq
1886 .Sx Special Characters
1887 with names of arbitrary length.
1889 When encountered at the end of an input text line,
1890 the next input text line is considered to continue that line,
1891 even if there are request or macro lines in between.
1892 No whitespace is inserted.
1893 .Ss \eD\(aq Ns Ar string Ns \(aq
1894 Draw graphics function; ignored by
1897 Move down by half a line; ignored by
1900 Backslash special character.
1901 .Ss \eF[ Ns Ar name ]
1902 Switch font family (groff extension); ignored by
1904 For short names, there are variants
1908 .Ss \ef[ Ns Ar name ]
1912 .Sx Text Decoration .
1913 For short names, there are variants
1917 .Ss \eg[ Ns Ar name ]
1918 Interpolate the format of a number register; ignored by
1920 For short names, there are variants
1924 .Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1925 Set the height of the current font; ignored by
1927 .Ss \eh\(aq Ns Ar number Ns \(aq
1928 Horizontal motion; ignored by
1930 .Ss \ek[ Ns Ar name ]
1931 Mark horizontal input place in register; ignored by
1933 For short names, there are variants
1937 .Ss \eL\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1938 Vertical line drawing function; ignored by
1940 .Ss \el\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1941 Horizontal line drawing function; ignored by
1943 .Ss \eM[ Ns Ar name ]
1944 Set fill (background) color (groff extension); ignored by
1946 For short names, there are variants
1950 .Ss \em[ Ns Ar name ]
1951 Set glyph drawing color (groff extension); ignored by
1953 For short names, there are variants
1957 .Ss \eN\(aq Ns Ar number Ns \(aq
1960 on the current font.
1961 .Ss \en[ Ns Ar name ]
1962 Interpolate the number register
1964 For short names, there are variants
1968 .Ss \eo\(aq Ns Ar string Ns \(aq
1969 Overstrike, writing all the characters contained in the
1971 to the same output position.
1972 In terminal and HTML output modes,
1973 only the last one of the characters is visible.
1974 .Ss \eR\(aq Ns Ar name Oo +|- Oc Ns Ar number Ns \(aq
1975 Set number register; ignored by
1977 .Ss \eS\(aq Ns Ar number Ns \(aq
1978 Slant output; ignored by
1980 .Ss \es\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1981 Change point size; ignored by
1984 .No \es Ns Oo +|- Oc Ns Ar n ,
1985 .No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq ,
1986 .No \es Ns [ Oo +|- Oc Ns Ar number ] ,
1988 .No \es Ns Oo +|- Oc Ns [ Ar number Ns ]
1989 are also parsed and ignored.
1991 Horizontal tab; ignored by
1994 Move up by half a line; ignored by
1996 .Ss \eV[ Ns Ar name ]
1997 Interpolate an environment variable; ignored by
1999 For short names, there are variants
2003 .Ss \ev\(aq Ns Ar number Ns \(aq
2004 Vertical motion; ignored by
2006 .Ss \ew\(aq Ns Ar string Ns \(aq
2007 Interpolate the width of the
2011 implementation assumes that after expansion of user-defined strings, the
2013 only contains normal characters, no escape sequences, and that each
2014 character has a width of 24 basic units.
2015 .Ss \eX\(aq Ns Ar string Ns \(aq
2018 as device control function; ignored in nroff mode and by
2020 .Ss \ex\(aq Ns Ar number Ns \(aq
2021 Extra line space function; ignored by
2023 .Ss \eY[ Ns Ar name ]
2024 Output a string as a device control function; ignored in nroff mode and by
2026 For short names, there are variants
2030 .Ss \eZ\(aq Ns Ar string Ns \(aq
2033 with zero width and height; ignored by
2036 Output the next character without advancing the cursor position.
2040 implementation of the
2042 language is intentionally incomplete.
2043 Unimplemented features include:
2047 For security reasons,
2049 never reads or writes external files except via
2051 requests with safe relative paths.
2053 There is no automatic hyphenation, no adjustment to the right margin,
2054 and no centering; the output is always set flush-left.
2056 Support for setting tabulator positions
2057 and tabulator and leader characters is missing,
2058 and support for manually changing indentation is limited.
2062 scaling unit is the default terminal unit.
2063 In traditional troff systems, this unit changes depending on the
2066 Width measurements are implemented in a crude way
2067 and often yield wrong results.
2068 Explicit movement requests and escapes are ignored.
2070 There is no concept of output pages, no support for floats,
2071 graphics drawing, and picture inclusion;
2072 terminal output is always continuous.
2074 Requests regarding color, font families, and glyph manipulation
2076 Font support is very limited.
2077 Kerning is not implemented, and no ligatures are produced.
2081 macro control character does not suppress output line breaks.
2083 Diversions are not implemented,
2084 and support for traps is very incomplete.
2086 While recursion is supported,
2091 The special semantics of the
2093 number register is an idiosyncracy of
2095 manuals and not supported by other
2106 .%A Joseph F. Ossanna
2107 .%A Brian W. Kernighan
2108 .%I AT&T Bell Laboratories
2109 .%T Troff User's Manual
2110 .%R Computing Science Technical Report
2112 .%C Murray Hill, New Jersey
2114 .%U http://www.kohala.com/start/troff/cstr54.ps
2117 .%A Joseph F. Ossanna
2118 .%A Brian W. Kernighan
2120 .%T Heirloom Documentation Tools Nroff/Troff User's Manual
2121 .%D September 17, 2007
2122 .%U http://heirloom.sourceforge.net/doctools/troff.pdf
2125 The RUNOFF typesetting system, whose input forms the basis for
2127 was written in MAD and FAP for the CTSS operating system by Jerome E.
2129 Doug McIlroy rewrote it in BCPL in 1969, renaming it
2131 Dennis M. Ritchie rewrote McIlroy's
2133 in PDP-11 assembly for
2135 Joseph F. Ossanna improved roff and renamed it nroff
2138 then ported nroff to C as troff, which Brian W. Kernighan released with
2140 In 1989, James Clarke re-implemented troff in C++, naming it groff.
2145 reference was written by
2146 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
2148 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .