1 .\" $Id: roff.7,v 1.70 2015/02/17 17:16:52 schwarze Exp $
3 .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010, 2011, 2013, 2014 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: February 17 2015 $
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.
503 Currently unsupported.
505 Optional line break characters.
506 This is a Heirloom extension and currently ignored.
508 Break output line after next N input lines.
509 This is a Heirloom extension and currently ignored.
511 Break and spread output line.
512 Currently, this is implemented as an alias for
515 Break and spread output line after next N input lines.
516 This is a Heirloom extension and currently ignored.
518 Change the no-break control character.
519 Currently unsupported.
521 Change the control character.
522 Its syntax is as follows:
523 .Bd -literal -offset indent
524 .Pf . Cm \&cc Op Ar c
529 is not specified, the control character is reset to
531 Trailing characters are ignored.
534 It takes one integer argument, specifying how many lines to center.
537 Output the contents of a file.
538 Ignored because insecure.
541 This is a groff extension and currently ignored.
543 Change a trap location.
547 Currently unsupported.
549 Remove the last character from a macro, string, or diversion.
550 Currently unsupported.
552 Define a character class.
553 This is a groff extension and currently ignored.
556 Ignored because insecure.
559 This is a Heirloom extension and currently unsupported.
561 Activate or deactivate colors.
562 This is a groff extension and currently ignored.
564 Define a name component for composite glyph names.
565 This is a groff extension and currently unsupported.
567 Immediately start the next iteration of a
570 Currently unsupported.
574 compatibility mode on or off.
577 Set the CropBox page parameter for PDF generation.
578 This is a Heirloom extension and currently ignored.
580 Constant character spacing mode.
583 Underline including whitespace.
586 Append to a diversion.
587 Currently unsupported.
589 Change a trap location in the current diversion.
590 This is a Heirloom extension and currently unsupported.
595 Its syntax can be either
596 .Bd -literal -offset indent
597 .Pf . Cm \&de Ar name
603 .Bd -literal -offset indent
604 .Pf . Cm \&de Ar name Ar end
609 Both forms define or redefine the macro
612 .Ar macro definition ,
613 which may consist of one or more input lines, including the newline
614 characters terminating each line, optionally containing calls to
618 macros or high-level macros like
622 macros, whichever applies to the document in question.
626 macro works in the same way as for
631 .Ar macro definition ,
632 and after that, it is also evaluated as a
636 macro, but not as a high-level macro.
638 The macro can be invoked later using the syntax
640 .D1 Pf . Ar name Op Ar argument Op Ar argument ...
642 Regarding argument parsing, see
646 The line invoking the macro will be replaced
647 in the input stream by the
648 .Ar macro definition ,
649 replacing all occurrences of
654 .Ar N Ns th Ar argument .
656 .Bd -literal -offset indent
658 \efI\e^\e\e$1\e^\efP\e\e$2
665 .D1 \efI\e^XtFree\e^\efP.
667 in the input stream, and thus in the output: \fI\^XtFree\^\fP.
669 Since macros and user-defined strings share a common string table,
672 clobbers the user-defined string
676 can also be printed using the
678 string interpolation syntax described below
680 but this is rarely useful because every macro definition contains at least
681 one explicit newline character.
683 In order to prevent endless recursion, both groff and
685 limit the stack depth for expanding macros and strings
686 to a large, but finite number, and
688 also limits the length of the expanded input line.
689 Do not rely on the exact values of these limits.
693 macro that will be executed with
695 compatibility mode switched off during macro execution.
696 This is a groff extension.
701 compatibility mode at all, it handles this request as an alias for
705 This is a groff extension and currently ignored.
709 macro, specifying the macro name indirectly (groff extension).
710 The syntax of this request is the same as that of
714 .D1 Pf . Cm \&dei Ar name Op Ar end
716 has the same effect as:
718 .D1 Pf . Cm \&de No \e* Ns Bo Ar name Bc Op \e* Ns Bq Ar end
722 macro that will be executed with
724 compatibility mode switched off during macro execution,
725 specifying the macro name indirectly (groff extension).
730 compatibility mode at all, it handles this request as an alias for
733 This request only makes sense with the groff-specific intermediate
734 output format and is unsupported.
736 This request only makes sense with the groff-specific intermediate
737 output format and is unsupported.
740 Currently unsupported.
744 request or macro line with compatibility mode disabled.
745 Currently unsupported.
747 Define a user-defined string.
748 Its syntax is as follows:
750 .D1 Pf . Cm \&ds Ar name Oo \(dq Oc Ns Ar string
756 arguments are space-separated.
759 begins with a double-quote character, that character will not be part
761 All remaining characters on the input line form the
763 including whitespace and double-quote characters, even trailing ones.
767 can be interpolated into subsequent text by using
768 .No \e* Ns Bq Ar name
771 of arbitrary length, or \e*(NN or \e*N if the length of
773 is two or one characters, respectively.
774 Interpolation can be prevented by escaping the leading backslash;
775 that is, an asterisk preceded by an even number of backslashes
776 does not trigger string interpolation.
778 Since user-defined strings and macros share a common string table,
785 used for defining a string can also be invoked as a macro,
786 in which case the following input line will be appended to the
788 forming a new input line passed to the
792 .Bd -literal -offset indent
803 Such abuse is of course strongly discouraged.
805 Define a user-defined string that will be expanded with
807 compatibility mode switched off during string expansion.
808 This is a groff extension.
813 compatibility mode at all, it handles this request as an alias for
816 Set a location trap in the current diversion.
817 This is a Heirloom extension and currently unsupported.
819 Set a trap within a diversion.
820 Currently unsupported.
822 Change the escape character.
823 Currently unsupported.
825 Restore the escape character.
826 Currently unsupported.
828 Save the escape character.
829 Currently unsupported.
833 half of an if/else conditional.
834 Pops a result off the stack of conditional evaluations pushed by
836 and uses it as its conditional.
837 If no stack entries are present (e.g., due to no prior
840 then false is assumed.
841 The syntax of this request is similar to
843 except that the conditional is missing.
845 Set a trap at the end of input.
846 Currently unsupported.
848 End an equation block.
852 Disable the escape mechanism completely.
853 Currently unsupported.
855 End a picture started by
857 This is a Heirloom extension and currently unsupported.
859 Begin an equation block.
862 for a description of the equation language.
864 Print a string like an error message.
865 This is a Heirloom extension and currently ignored.
867 Switch to another environment.
868 Currently unsupported.
870 Copy an environment into the current environment.
871 Currently unsupported.
873 Abort processing and exit.
874 Currently unsupported.
876 Select the fallback sequence for a font.
877 This is a Heirloom extension and currently ignored.
879 Change the font family.
880 Takes one argument specifying the font family to be selected.
881 It is a groff extension and currently ignored.
883 Define a delimiting and a padding character for fields.
884 Currently unsupported.
886 Define a fallback glyph.
887 Currently unsupported.
889 Set the fill color for \eD objects.
890 This is a groff extension and currently ignored.
892 Defer ligature building.
893 This is a Heirloom extension and currently ignored.
895 Enable or disable an OpenType feature.
896 This is a Heirloom extension and currently ignored.
904 Control the use of kerning tables for a font.
905 This is a Heirloom extension and currently ignored.
911 This is a Heirloom extension and currently ignored.
913 Assign font position.
916 Mount a font with a special character map.
917 This is a Heirloom extension and currently ignored.
919 Define a font-specific fallback glyph.
920 This is a groff extension and currently unsupported.
922 Set a font-specific width for the space character.
923 This is a Heirloom extension and currently ignored.
925 Conditionally define a special font.
926 This is a groff extension and currently ignored.
929 Its syntax is as follows:
931 .D1 Pf . Cm \&ft Op Ar font
935 arguments are supported:
936 .Bl -tag -width 4n -offset indent
937 .It Cm B , BI , 3 , 4
946 switches to normal font
947 .It Cm P No "or no argument"
948 switches back to the previous font
951 This request takes effect only locally, may be overridden by macros
952 and escape sequences, and is only supported in
957 This is a groff extension and currently ignored.
963 This is a groff extension and currently ignored.
965 Set the hyphenation character.
968 Set hyphenation codes of characters.
971 Hide characters in a font.
972 This is a Heirloom extension and currently ignored.
974 Set hyphenation language.
975 This is a groff extension and currently ignored.
977 Set maximum number of consecutive hyphenated lines.
980 Load hyphenation pattern file.
981 This is a groff extension and currently ignored.
983 Load hyphenation pattern file, appending to the current patterns.
984 This is a groff extension and currently ignored.
986 Define mapping values for character codes in hyphenation patterns.
987 This is a groff extension and currently ignored.
989 Specify hyphenation points in words.
992 Set automatic hyphenation mode.
995 Set hyphenation language.
996 This is a Heirloom extension and currently ignored.
998 Minimum word length for hyphenation.
999 This is a Heirloom extension and currently ignored.
1001 Set hyphenation margin.
1002 This is a groff extension and currently ignored.
1004 Define hyphenation penalties.
1005 This is a Heirloom extension and currently ignored.
1007 Set hyphenation space.
1008 This is a groff extension and currently ignored.
1012 half of an if/else conditional.
1013 The result of the conditional is pushed into a stack used by subsequent
1016 which may be separated by any intervening input (or not exist at all).
1017 Its syntax is equivalent to
1020 Begins a conditional.
1021 This request has the following syntax:
1022 .Bd -literal -offset indent
1025 .Bd -literal -offset indent
1029 .Bd -literal -offset indent
1035 COND is a conditional statement.
1038 supports the following subset of roff conditionals:
1043 is prefixed to COND, the condition is logically inverted.
1045 If the first character of COND is
1051 COND evaluates to true.
1053 If the first character of COND is
1055 .Pq character available ,
1057 .Pq string defined ,
1061 .Pq register accessed ,
1067 COND evaluates to false.
1069 If COND starts with a parenthesis or with an optionally signed
1070 integer number, it is evaluated according to the rules of
1071 .Sx Numerical expressions
1073 It evaluates to true if the result is positive,
1074 or to false if the result is zero or negative.
1076 Otherwise, the first character of COND is regarded as a delimiter
1077 and COND evaluates to true if the string extending from its first
1078 to its second occurrence is equal to the string extending from its
1079 second to its third occurrence.
1081 If COND cannot be parsed, it evaluates to false.
1084 If a conditional is false, its children are not processed, but are
1085 syntactically interpreted to preserve the integrity of the input
1093 which may lead to interesting results, but
1095 .D1 \&.if t .if t \e{\e
1097 will continue to syntactically interpret to the block close of the final
1099 Sub-conditionals, in this case, obviously inherit the truth value of
1102 If the BODY section is begun by an escaped brace
1104 scope continues until the end of the input line containing the
1105 matching closing-brace escape sequence
1107 If the BODY is not enclosed in braces, scope continues until
1108 the end of the line.
1109 If the COND is followed by a BODY on the same line, whether after a
1110 brace or not, then requests and macros
1112 begin with a control character.
1113 It is generally more intuitive, in this case, to write
1114 .Bd -literal -offset indent
1121 than having the request or macro follow as
1123 .D1 \&.if COND \e{ .foo
1125 The scope of a conditional is always parsed, but only executed if the
1126 conditional evaluates to true.
1130 is converted into a zero-width escape sequence if not passed as a
1139 being considered an argument of the
1144 Its syntax can be either
1145 .Bd -literal -offset indent
1152 .Bd -literal -offset indent
1153 .Pf . Cm \&ig Ar end
1158 In the first case, input is ignored until a
1160 request is encountered on its own line.
1161 In the second case, input is ignored until the specified
1163 macro is encountered.
1164 Do not use the escape character
1166 anywhere in the definition of
1168 it would cause very strange behaviour.
1172 macro is a roff request or a roff macro, like in
1176 the subsequent invocation of
1178 will first terminate the
1180 then be invoked as usual.
1181 Otherwise, it only terminates the
1183 and arguments following it or the
1185 request are discarded.
1193 Find a substring in a string.
1194 This is a Heirloom extension and currently unsupported.
1196 Set an input line trap.
1197 Its syntax is as follows:
1199 .D1 Pf . Cm it Ar expression macro
1203 will be invoked after processing the number of input text lines
1204 specified by the numerical
1206 While evaluating the
1208 the unit suffixes described below
1212 Set an input line trap, not counting lines ending with \ec.
1213 Currently unsupported.
1215 To support the generation of a table of contents,
1217 emits this user-defined macro, usually without defining it.
1218 To avoid reporting large numbers of spurious errors,
1222 Switch kerning on or off.
1225 Increase kerning after some characters.
1226 This is a Heirloom extension and currently ignored.
1228 Increase kerning before some characters.
1229 This is a Heirloom extension and currently ignored.
1231 Add a kerning pair to the kerning table.
1232 This is a Heirloom extension and currently ignored.
1234 Define a leader repetition character.
1235 Currently unsupported.
1240 This is a Heirloom extension and currently unsupported.
1242 Define a local string.
1243 This is a Heirloom extension and currently unsupported.
1245 Count the number of input characters in a user-defined string.
1246 Currently unsupported.
1248 Dynamic letter spacing and reshaping.
1249 This is a Heirloom extension and currently ignored.
1251 Change the line number for error messages.
1252 Ignored because insecure.
1254 Switch the ligature mechanism on or off.
1257 Hang characters at left margin.
1258 This is a Heirloom extension and currently ignored.
1260 Enable or disable line-tabs mode.
1261 This is a groff extension and currently unsupported.
1263 Change the output line length.
1264 Its syntax is as follows:
1266 .D1 Pf . Cm \&ll Op Oo +|- Oc Ns Ar width
1270 argument is omitted, the line length is reset to its previous value.
1271 The default setting for terminal output is 78n.
1272 If a sign is given, the line length is added to or subtracted from;
1273 otherwise, it is set to the provided value.
1274 Using this request in new manuals is discouraged for several reasons,
1275 among others because it overrides the
1278 command line option.
1280 Set local number register.
1281 This is a Heirloom extension and currently unsupported.
1283 Set local floating-point register.
1284 This is a Heirloom extension and currently unsupported.
1287 This is a Heirloom extension and currently unsupported.
1290 It takes one integer argument specifying the vertical distance of
1291 subsequent output text lines measured in v units.
1294 Set a leading spaces trap.
1295 This is a groff extension and currently unsupported.
1297 Set title line length.
1300 Print margin character in the right margin.
1303 Set the device media size.
1304 This is a Heirloom extension and currently ignored.
1306 Set minimum word space.
1307 This is a Heirloom extension and currently ignored.
1309 Mark vertical position.
1313 Ignored because insecure.
1315 Disable adjusting without changing the adjustment mode.
1318 Declare the need for the specified minimum vertical space
1319 before the next trap or the bottom of the page.
1322 Switch to no-fill mode.
1328 Turn off automatic hyphenation mode.
1331 Define hyphenation-inhibiting characters.
1332 This is a Heirloom extension and currently ignored.
1335 Currently unsupported.
1337 Temporarily turn off line numbering.
1338 Currently unsupported.
1340 Exexute the rest of the input line as a request or macro line.
1341 Currently unsupported.
1343 Define or change a register.
1344 A register is an arbitrary string value that defines some sort of state,
1345 which influences parsing and/or formatting.
1346 Its syntax is as follows:
1348 .D1 Pf \. Cm \&nr Ar name Oo +|- Oc Ns Ar expression
1353 .Sx Numerical expressions
1355 If it is prefixed by a sign, the register will be
1356 incremented or decremented instead of assigned to.
1358 The following register
1360 is handled specially:
1363 If set to a positive integer value, certain
1365 macros will behave in the same way as in the
1368 If set to 0, these macros will behave in the same way as outside the
1370 section, even when called within the
1373 Note that starting a new
1377 macro will reset this register.
1380 Define or change a floating-point register.
1381 This is a Heirloom extension and currently unsupported.
1384 This is a groff extension and currently ignored.
1386 Turn on no-space mode.
1389 Abort processing of the current input file and process another one.
1390 Ignored because insecure.
1392 Open a file for writing.
1393 Ignored because insecure.
1395 Open a file for appending.
1396 Ignored because insecure.
1398 Output saved vertical space.
1401 Output directly to intermediate output.
1404 Globally control paragraph-at-once adjustment.
1405 This is a Heirloom extension and currently ignored.
1408 This is a Heirloom extension and currently ignored.
1410 Change the page number character.
1414 This is a groff extension and currently ignored.
1416 Pipe output to a shell command.
1417 Ignored because insecure.
1419 Low-level request used by
1421 This is a Heirloom extension and currently unsupported.
1424 Takes one height argument.
1427 Print names and sizes of macros, strings, and diversions.
1430 Change page number of the next page.
1433 Print all number registers.
1436 Set horizontal page offset.
1440 Takes one numerical argument.
1443 Retrieve the bounding box of a PostScript file.
1444 Currently unsupported.
1446 Set a special shape for the current paragraph.
1447 This is a Heirloom extension and currently unsupported.
1449 Include output of a shell command.
1450 Ignored because insecure.
1452 Print the names and positions of all traps.
1453 This is a groff extension and currently ignored.
1455 Change post-vertical spacing.
1456 This is a groff extension and currently ignored.
1458 Remove glyph definitions.
1459 Currently unsupported.
1461 Read from standard input.
1463 .Ss \&recursionlimit
1464 Set the maximum stack depth for recursive macros.
1465 This is a Heirloom extension and currently ignored.
1467 Exit a macro and return to the caller.
1468 Currently unsupported.
1470 Remove font-specific fallback glyph definitions.
1471 Currently unsupported.
1473 Hang characters at right margin.
1474 This is a Heirloom extension and currently ignored.
1476 Justify unfilled text to the right margin.
1479 Remove a request, macro or string.
1480 Its syntax is as follows:
1482 .D1 Pf \. Cm \&rm Ar name
1484 Rename a request, macro, diversion, or string.
1485 Currently unsupported.
1487 Rename a number register.
1488 Currently unsupported.
1491 Its syntax is as follows:
1493 .D1 Pf \. Cm \&rr Ar name
1498 Return to marked vertical position.
1501 Define global fallback glyph.
1502 This is a groff extension and currently unsupported.
1504 Define sentence-ending characters.
1505 This is a Heirloom extension and currently ignored.
1507 Change the soft hyphen character.
1510 Shift macro arguments.
1511 Currently unsupported.
1513 Define permissible point sizes.
1514 This is a groff extension and currently ignored.
1516 Include a source file.
1517 Its syntax is as follows:
1519 .D1 Pf \. Cm \&so Ar file
1523 will be read and its contents processed as input in place of the
1526 To avoid inadvertent inclusion of unrelated files,
1528 only accepts relative paths not containing the strings
1533 This request requires
1535 to change to the right directory before calling
1537 per convention to the root of the manual tree.
1538 Typical usage looks like:
1540 .Dl \&.so man3/Xcursor.3
1542 As the whole concept is rather fragile, the use of
1549 Set the space width from the font metrics file.
1550 This is a Heirloom extension and currently ignored.
1552 Define a special font.
1553 This is a groff extension and currently ignored.
1555 Warn about wide spacing between words.
1558 Set space character size.
1561 Associate style with a font position.
1562 This is a groff extension and currently ignored.
1564 Replace a user-defined string with a substring.
1565 Currently unsupported.
1567 Save vertical space.
1570 Execute shell command.
1571 Ignored because insecure.
1573 Re-start a table layout, retaining the options of the prior table
1579 Takes an arbitrary number of arguments.
1580 Currently unsupported.
1582 Change tab repetion character.
1583 Currently unsupported.
1585 End a table context.
1590 Currently unsupported.
1592 Enable track kerning for a font.
1596 Currently unsupported.
1598 Print to standard error output.
1601 Print to standard error output, allowing leading blanks.
1602 This is a groff extension and currently ignored.
1604 Print to standard error output without a trailing newline.
1605 This is a groff extension and currently ignored.
1607 Output character translation.
1608 Its syntax is as follows:
1610 .D1 Pf \. Cm \&tr Ar [ab]+
1614 characters are replaced
1618 Replacement (or origin) characters may also be character escapes; thus,
1622 replaces all invocations of \e(xx with \e(yy.
1624 Static letter space tracking.
1625 This is a Heirloom extension and currently ignored.
1627 Define transparent characters for sentence-ending.
1628 This is a Heirloom extension and currently ignored.
1630 Output the contents of a file, disallowing invalid characters.
1631 This is a groff extension and ignored because insecure.
1633 Set the TrimBox page parameter for PDF generation.
1634 This is a Heirloom extension and currently ignored.
1636 Output character translation, ignored by
1638 Currently unsupported.
1640 Output character translation, ignored by \e!.
1641 Currently unsupported.
1644 This is a groff extension and currently ignored.
1646 Begin a table, which formats input in aligned rows and columns.
1649 for a description of the tbl language.
1651 Globally set the underline font.
1657 Unformat spaces and tabs in a diversion.
1658 Currently unsupported.
1660 Disable notification for string or macro.
1661 This is a Heirloom extension and currently ignored.
1663 Disable notification for register.
1664 This is a Heirloom extension and currently ignored.
1666 Enable or disable vertical position traps.
1667 This is a groff extension and currently ignored.
1669 Change vertical spacing.
1675 Set the scaling indicator used in warnings.
1676 This is a groff extension and currently ignored.
1678 Notify on change of string or macro.
1679 This is a Heirloom extension and currently ignored.
1681 On change, report the contents of macros and strings
1682 up to the sepcified length.
1683 This is a Heirloom extension and currently ignored.
1685 Notify on change of register.
1686 This is a Heirloom extension and currently ignored.
1688 Set a page location trap.
1689 Currently unsupported.
1691 Repeated execution while a condition is true.
1692 Currently unsupported.
1694 Write to an open file.
1695 Ignored because insecure.
1697 Write to an open file without appending a newline.
1698 Ignored because insecure.
1700 Write macro or string to an open file.
1701 Ignored because insecure.
1703 Set the extension level.
1704 This is a Heirloom extension and currently ignored.
1705 .Ss Numerical expressions
1711 requests accept integer numerical expressions as arguments.
1712 These are always evaluated using the C
1714 type; integer overflow works the same way as in the C language.
1715 Numbers consist of an arbitrary number of digits
1719 prefixed by an optional sign
1723 Each number may be followed by one optional scaling unit described below
1724 .Sx Scaling Widths .
1725 The following equations hold:
1726 .Bd -literal -offset indent
1727 1i = 6v = 6P = 10m = 10n = 72p = 1000M = 240u = 240
1728 254c = 100i = 24000u = 24000
1732 The following binary operators are implemented.
1733 Unless otherwise stated, they behave as in the C language:
1735 .Bl -tag -width 2n -compact
1745 remainder of division
1753 equal to, same effect as
1755 (this differs from C)
1757 less than or equal to
1759 greater than or equal to
1761 not equal to (corresponds to C
1763 this one is of limited portability, it is supported by Heirloom roff,
1766 logical and (corresponds to C
1769 logical or (corresponds to C
1772 minimum (not available in C)
1774 maximum (not available in C)
1777 There is no concept of precendence; evaluation proceeds from left to right,
1778 except when subexpressions are enclosed in parantheses.
1779 Inside parentheses, whitespace is ignored.
1780 .Sh ESCAPE SEQUENCE REFERENCE
1784 parser recognises the following escape sequences.
1787 language defines more escape sequences not implemented in
1793 documents, using escape sequences is discouraged except for those
1798 A backslash followed by any character not listed here
1799 simply prints that character itself.
1801 A backslash at the end of an input line can be used to continue the
1802 logical input line on the next physical input line, joining the text
1803 on both lines together as if it were on a single input line.
1805 The escape sequence backslash-space
1807 is an unpaddable space-sized non-breaking space character; see
1810 The rest of the input line is treated as
1813 Hyphenation allowed at this point of the word; ignored by
1816 Non-printing zero-width character; see
1819 Acute accent special character; use
1823 .Sx Special Characters
1824 with two-letter names, see
1826 .Ss \e*[ Ns Ar name ]
1827 Interpolate the string with the
1830 .Sx Predefined Strings
1833 For short names, there are variants
1839 .Dq mathematical minus sign .
1840 .Ss \e[ Ns Ar name ]
1841 .Sx Special Characters
1842 with names of arbitrary length, see
1845 One-twelfth em half-narrow space character, effectively zero-width in
1848 Grave accent special character; use
1852 Begin conditional input; see
1855 One-sixth em narrow space character, effectively zero-width in
1858 End conditional input; see
1861 Paddable non-breaking space character.
1863 Digit width space character.
1864 .Ss \eA\(aq Ns Ar string Ns \(aq
1865 Anchor definition; ignored by
1867 .Ss \eB\(aq Ns Ar string Ns \(aq
1872 conforms to the syntax of
1873 .Sx Numerical expressions
1877 .Ss \eb\(aq Ns Ar string Ns \(aq
1878 Bracket building function; ignored by
1880 .Ss \eC\(aq Ns Ar name Ns \(aq
1881 .Sx Special Characters
1882 with names of arbitrary length.
1884 When encountered at the end of an input text line,
1885 the next input text line is considered to continue that line,
1886 even if there are request or macro lines in between.
1887 No whitespace is inserted.
1888 .Ss \eD\(aq Ns Ar string Ns \(aq
1889 Draw graphics function; ignored by
1892 Move down by half a line; ignored by
1895 Backslash special character.
1896 .Ss \eF[ Ns Ar name ]
1897 Switch font family (groff extension); ignored by
1899 For short names, there are variants
1903 .Ss \ef[ Ns Ar name ]
1907 .Sx Text Decoration .
1908 For short names, there are variants
1912 .Ss \eg[ Ns Ar name ]
1913 Interpolate the format of a number register; ignored by
1915 For short names, there are variants
1919 .Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1920 Set the height of the current font; ignored by
1922 .Ss \eh\(aq Ns Ar number Ns \(aq
1923 Horizontal motion; ignored by
1925 .Ss \ek[ Ns Ar name ]
1926 Mark horizontal input place in register; ignored by
1928 For short names, there are variants
1932 .Ss \eL\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1933 Vertical line drawing function; ignored by
1935 .Ss \el\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1936 Horizontal line drawing function; ignored by
1938 .Ss \eM[ Ns Ar name ]
1939 Set fill (background) color (groff extension); ignored by
1941 For short names, there are variants
1945 .Ss \em[ Ns Ar name ]
1946 Set glyph drawing color (groff extension); ignored by
1948 For short names, there are variants
1952 .Ss \eN\(aq Ns Ar number Ns \(aq
1955 on the current font.
1956 .Ss \en[ Ns Ar name ]
1957 Interpolate the number register
1959 For short names, there are variants
1963 .Ss \eo\(aq Ns Ar string Ns \(aq
1964 Overstrike, writing all the characters contained in the
1966 to the same output position.
1967 In terminal and HTML output modes,
1968 only the last one of the characters is visible.
1969 .Ss \eR\(aq Ns Ar name Oo +|- Oc Ns Ar number Ns \(aq
1970 Set number register; ignored by
1972 .Ss \eS\(aq Ns Ar number Ns \(aq
1973 Slant output; ignored by
1975 .Ss \es\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1976 Change point size; ignored by
1979 .No \es Ns Oo +|- Oc Ns Ar n ,
1980 .No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq ,
1981 .No \es Ns [ Oo +|- Oc Ns Ar number ] ,
1983 .No \es Ns Oo +|- Oc Ns [ Ar number Ns ]
1984 are also parsed and ignored.
1986 Horizontal tab; ignored by
1989 Move up by half a line; ignored by
1991 .Ss \eV[ Ns Ar name ]
1992 Interpolate an environment variable; ignored by
1994 For short names, there are variants
1998 .Ss \ev\(aq Ns Ar number Ns \(aq
1999 Vertical motion; ignored by
2001 .Ss \ew\(aq Ns Ar string Ns \(aq
2002 Interpolate the width of the
2006 implementation assumes that after expansion of user-defined strings, the
2008 only contains normal characters, no escape sequences, and that each
2009 character has a width of 24 basic units.
2010 .Ss \eX\(aq Ns Ar string Ns \(aq
2013 as device control function; ignored in nroff mode and by
2015 .Ss \ex\(aq Ns Ar number Ns \(aq
2016 Extra line space function; ignored by
2018 .Ss \eY[ Ns Ar name ]
2019 Output a string as a device control function; ignored in nroff mode and by
2021 For short names, there are variants
2025 .Ss \eZ\(aq Ns Ar string Ns \(aq
2028 with zero width and height; ignored by
2031 Output the next character without advancing the cursor position;
2034 by simply skipping the next character.
2038 implementation of the
2040 language is intentionally incomplete.
2041 Unimplemented features include:
2045 For security reasons,
2047 never reads or writes external files except via
2049 requests with safe relative paths.
2051 There is no automatic hyphenation, no adjustment to the right margin,
2052 and no centering; the output is always set flush-left.
2054 Support for setting tabulator positions
2055 and tabulator and leader characters is missing,
2056 and support for manually changing indentation is limited.
2060 scaling unit is the default terminal unit.
2061 In traditional troff systems, this unit changes depending on the
2064 Width measurements are implemented in a crude way
2065 and often yield wrong results.
2066 Explicit movement requests and escapes are ignored.
2068 There is no concept of output pages, no support for floats,
2069 graphics drawing, and picture inclusion;
2070 terminal output is always continuous.
2072 Requests regarding color, font families, and glyph manipulation
2074 Font support is very limited.
2075 Kerning is not implemented, and no ligatures are produced.
2079 macro control character does not suppress output line breaks.
2081 Diversions are not implemented,
2082 and support for traps is very incomplete.
2084 While recursion is supported,
2089 The special semantics of the
2091 number register is an idiosyncracy of
2093 manuals and not supported by other
2104 .%A Joseph F. Ossanna
2105 .%A Brian W. Kernighan
2106 .%I AT&T Bell Laboratories
2107 .%T Troff User's Manual
2108 .%R Computing Science Technical Report
2110 .%C Murray Hill, New Jersey
2112 .%U http://www.kohala.com/start/troff/cstr54.ps
2115 .%A Joseph F. Ossanna
2116 .%A Brian W. Kernighan
2118 .%T Heirloom Documentation Tools Nroff/Troff User's Manual
2119 .%D September 17, 2007
2120 .%U http://heirloom.sourceforge.net/doctools/troff.pdf
2123 The RUNOFF typesetting system, whose input forms the basis for
2125 was written in MAD and FAP for the CTSS operating system by Jerome E.
2127 Doug McIlroy rewrote it in BCPL in 1969, renaming it
2129 Dennis M. Ritchie rewrote McIlroy's
2131 in PDP-11 assembly for
2133 Joseph F. Ossanna improved roff and renamed it nroff
2136 then ported nroff to C as troff, which Brian W. Kernighan released with
2138 In 1989, James Clarke re-implemented troff in C++, naming it groff.
2143 reference was written by
2144 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
2146 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .