]> git.cameronkatri.com Git - mandoc.git/blob - roff.7
Basic implementation of the roff(7) .ti (temporary indent) request.
[mandoc.git] / roff.7
1 .\" $Id: roff.7,v 1.80 2017/05/08 15:34:54 schwarze Exp $
2 .\"
3 .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010,2011,2013-2015,2017 Ingo Schwarze <schwarze@openbsd.org>
5 .\"
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.
9 .\"
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.
17 .\"
18 .Dd $Mdocdate: May 8 2017 $
19 .Dt ROFF 7
20 .Os
21 .Sh NAME
22 .Nm roff
23 .Nd roff language reference for mandoc
24 .Sh DESCRIPTION
25 The
26 .Nm roff
27 language is a general purpose text formatting language.
28 Since traditional implementations of the
29 .Xr mdoc 7
30 and
31 .Xr man 7
32 manual formatting languages are based on it,
33 many real-world manuals use small numbers of
34 .Nm
35 requests and escape sequences intermixed with their
36 .Xr mdoc 7
37 or
38 .Xr man 7
39 code.
40 To properly format such manuals, the
41 .Xr mandoc 1
42 utility supports a tiny subset of
43 .Nm
44 requests and escapes.
45 Only these requests and escapes supported by
46 .Xr mandoc 1
47 are documented in the present manual,
48 together with the basic language syntax shared by
49 .Nm ,
50 .Xr mdoc 7 ,
51 and
52 .Xr man 7 .
53 For complete
54 .Nm
55 manuals, consult the
56 .Sx SEE ALSO
57 section.
58 .Pp
59 Input lines beginning with the control character
60 .Sq \&.
61 are parsed for requests and macros.
62 Such lines are called
63 .Dq request lines
64 or
65 .Dq macro lines ,
66 respectively.
67 Requests change the processing state and manipulate the formatting;
68 some macros also define the document structure and produce formatted
69 output.
70 The single quote
71 .Pq Qq \(aq
72 is accepted as an alternative control character,
73 treated by
74 .Xr mandoc 1
75 just like
76 .Ql \&.
77 .Pp
78 Lines not beginning with control characters are called
79 .Dq text lines .
80 They provide free-form text to be printed; the formatting of the text
81 depends on the respective processing context.
82 .Sh LANGUAGE SYNTAX
83 .Nm
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
87 .Sq \e
88 indicates the start of an escape sequence, used for example for
89 .Sx Comments ,
90 .Sx Special Characters ,
91 .Sx Predefined Strings ,
92 and
93 user-defined strings defined using the
94 .Sx ds
95 request.
96 For a listing of escape sequences, consult the
97 .Sx ESCAPE SEQUENCE REFERENCE
98 below.
99 .Ss Comments
100 Text following an escaped double-quote
101 .Sq \e\(dq ,
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
104 .Sq \&.\e\(dq
105 is also ignored.
106 Furthermore, request lines with only a control character and optional
107 trailing whitespace are stripped from input.
108 .Pp
109 Examples:
110 .Bd -literal -offset indent -compact
111 \&.\e\(dq This is a comment line.
112 \&.\e\(dq The next line is ignored:
113 \&.
114 \&.Sh EXAMPLES \e\(dq This is a comment, too.
115 \&example text \e\(dq And so is this.
116 .Ed
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
122 .Sq \e
123 followed by either an open-parenthesis
124 .Sq \&(
125 for two-character sequences; an open-bracket
126 .Sq \&[
127 for n-character sequences (terminated at a close-bracket
128 .Sq \&] ) ;
129 or a single one character sequence.
130 .Pp
131 Examples:
132 .Bl -tag -width Ds -offset indent -compact
133 .It Li \e(em
134 Two-letter em dash escape.
135 .It Li \ee
136 One-letter backslash escape.
137 .El
138 .Pp
139 See
140 .Xr mandoc_char 7
141 for a complete list.
142 .Ss Text Decoration
143 Terms may be text-decorated using the
144 .Sq \ef
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.
151 .Pp
152 The two-character indicator
153 .Sq BI
154 requests a font that is both bold and italic.
155 It may not be portable to old roff implementations.
156 .Pp
157 Examples:
158 .Bl -tag -width Ds -offset indent -compact
159 .It Li \efBbold\efR
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.
165 .El
166 .Pp
167 Text decoration is
168 .Em not
169 recommended for
170 .Xr mdoc 7 ,
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,
177 .Sq \e* :
178 single-character
179 .Sq \e*X ,
180 two-character
181 .Sq \e*(XX ,
182 and N-character
183 .Sq \e*[N] .
184 .Pp
185 Examples:
186 .Bl -tag -width Ds -offset indent -compact
187 .It Li \e*(Am
188 Two-letter ampersand predefined string.
189 .It Li \e*q
190 One-letter double-quote predefined string.
191 .El
192 .Pp
193 Predefined strings are not recommended for use,
194 as they differ across implementations.
195 Those supported by
196 .Xr mandoc 1
197 are listed in
198 .Xr mandoc_char 7 .
199 Manuals using these predefined strings are almost certainly not portable.
200 .Ss Whitespace
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.
204 .Pp
205 Unescaped trailing spaces are stripped from text line input unless in a
206 literal context.
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
211 .Sq \e\ \e& .
212 .Pp
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
216 .Sx MACRO SYNTAX
217 for details.
218 .Pp
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.
223 .Ss Scaling Widths
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.
229 .Pp
230 The following scaling units are accepted:
231 .Pp
232 .Bl -tag -width Ds -offset indent -compact
233 .It c
234 centimetre
235 .It i
236 inch
237 .It P
238 pica (~1/6 inch)
239 .It p
240 point (~1/72 inch)
241 .It f
242 scale
243 .Sq u
244 by 65536
245 .It v
246 default vertical span
247 .It m
248 width of rendered
249 .Sq m
250 .Pq em
251 character
252 .It n
253 width of rendered
254 .Sq n
255 .Pq en
256 character
257 .It u
258 default horizontal span for the terminal
259 .It M
260 mini-em (~1/100 em)
261 .El
262 .Pp
263 Using anything other than
264 .Sq m ,
265 .Sq n ,
266 or
267 .Sq v
268 is necessarily non-portable across output media.
269 See
270 .Sx COMPATIBILITY .
271 .Pp
272 If a scaling unit is not provided, the numerical value is interpreted
273 under the default rules of
274 .Sq v
275 for vertical spaces and
276 .Sq u
277 for horizontal ones.
278 .Pp
279 Examples:
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
283 .Xr mdoc 7
284 .It Li \&.HP 2i
285 two-inch tagged list indentation in
286 .Xr man 7
287 .It Li \&.sp 2v
288 two vertical spaces
289 .El
290 .Ss Sentence Spacing
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
295 delimiters
296 .Po
297 .Sq \&) ,
298 .Sq \&] ,
299 .Sq \&' ,
300 .Sq \&"
301 .Pc .
302 .Pp
303 The proper spacing is also intelligently preserved if a sentence ends at
304 the boundary of a macro line.
305 .Pp
306 Examples:
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:
311 \&.Xr mandoc 1 \&.
312 .Ed
313 .Sh REQUEST SYNTAX
314 A request or macro line consists of:
315 .Pp
316 .Bl -enum -compact
317 .It
318 the control character
319 .Sq \&.
320 or
321 .Sq \(aq
322 at the beginning of the line,
323 .It
324 optionally an arbitrary amount of whitespace,
325 .It
326 the name of the request or the macro, which is one word of arbitrary
327 length, terminated by whitespace,
328 .It
329 and zero or more arguments delimited by whitespace.
330 .El
331 .Pp
332 Thus, the following request lines are all equivalent:
333 .Bd -literal -offset indent
334 \&.ig end
335 \&.ig end
336 \&. ig end
337 .Ed
338 .Sh MACRO SYNTAX
339 Macros are provided by the
340 .Xr mdoc 7
341 and
342 .Xr man 7
343 languages and can be defined by the
344 .Sx \&de
345 request.
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
349 .Pq Sq \(dq .
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
353 .Pq Sq Qq
354 resolve to single double quote characters.
355 .Pp
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
361 is discouraged.
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.
367 .Pp
368 Both in quoted and unquoted arguments, pairs of backslashes
369 .Pq Sq \e\e
370 resolve to single backslashes.
371 In unquoted arguments, space characters can alternatively be included
372 by preceding them with a backslash
373 .Pq Sq \e\~ ,
374 but quoting is usually better for clarity.
375 .Pp
376 Examples:
377 .Bl -tag -width Ds -offset indent -compact
378 .It Li .Fn strlen \(dqconst char *s\(dq
379 Group arguments
380 .Qq const char *s
381 into one function argument.
382 If unspecified,
383 .Qq const ,
384 .Qq char ,
385 and
386 .Qq *s
387 would be considered separate arguments.
388 .It Li .Op \(dqFl a\(dq
389 Consider
390 .Qq \&Fl a
391 as literal text instead of a flag macro.
392 .El
393 .Sh REQUEST REFERENCE
394 The
395 .Xr mandoc 1
396 .Nm
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.
400 .Bl -tag -width Ds
401 .It Ic \&ab Op Ar message
402 Abort processing.
403 Currently unsupported.
404 .It Ic \&ad Op Cm b | c | l | n | r
405 Set line adjustment mode for subsequent text.
406 Currently ignored.
407 .It Ic \&af Ar registername format
408 Assign an output format to a number register.
409 Currently ignored.
410 .It Ic \&aln Ar newname oldname
411 Create an alias for a number register.
412 Currently unsupported.
413 .It Ic \&als Ar newname oldname
414 Create an alias for a request, string, macro, or diversion.
415 Currently unsupported.
416 .It Ic \&am Ar macroname Op Ar endmacro
417 Append to a macro definition.
418 The syntax of this request is the same as that of
419 .Ic \&de .
420 .It Ic \&am1 Ar macroname Op Ar endmacro
421 Append to a macro definition, switching roff compatibility mode off
422 during macro execution (groff extension).
423 The syntax of this request is the same as that of
424 .Ic \&de1 .
425 Since
426 .Xr mandoc 1
427 does not implement
428 .Nm
429 compatibility mode at all, it handles this request as an alias for
430 .Ic \&am .
431 .It Ic \&ami Ar macrostring Op Ar endstring
432 Append to a macro definition, specifying the macro name indirectly
433 (groff extension).
434 The syntax of this request is the same as that of
435 .Ic \&dei .
436 .It Ic \&ami1 Ar macrostring Op Ar endstring
437 Append to a macro definition, specifying the macro name indirectly
438 and switching roff compatibility mode off during macro execution
439 (groff extension).
440 The syntax of this request is the same as that of
441 .Ic \&dei1 .
442 Since
443 .Xr mandoc 1
444 does not implement
445 .Nm
446 compatibility mode at all, it handles this request as an alias for
447 .Ic \&ami .
448 .It Ic \&as Ar stringname Op Ar string
449 Append to a user-defined string.
450 The syntax of this request is the same as that of
451 .Sx \&ds .
452 If a user-defined string with the specified name does not yet exist,
453 it is set to the empty string before appending.
454 .It Ic \&as1 Ar stringname Op Ar string
455 Append to a user-defined string, switching roff compatibility mode off
456 during macro execution (groff extension).
457 The syntax of this request is the same as that of
458 .Ic \&ds1 .
459 Since
460 .Xr mandoc 1
461 does not implement
462 .Nm
463 compatibility mode at all, it handles this request as an alias for
464 .Ic \&as .
465 .It Ic \&asciify Ar divname
466 Fully unformat a diversion.
467 Currently unsupported.
468 .It Ic \&backtrace
469 Print a backtrace of the input stack.
470 This is a groff extension and currently ignored.
471 .It Ic \&bd Ar font Oo Ar curfont Oc Op Ar offset
472 Artificially embolden by repeated printing with small shifts.
473 Currently ignored.
474 .It Ic \&bleedat Ar left top width height
475 Set the BleedBox page parameter for PDF generation.
476 This is a Heirloom extension and currently ignored.
477 .It Ic \&blm Ar macroname
478 Set a blank line trap.
479 Currently unsupported.
480 .It Ic \&box Ar divname
481 Begin a diversion without including a partially filled line.
482 Currently unsupported.
483 .It Ic \&boxa Ar divname
484 Add to a diversion without including a partially filled line.
485 Currently unsupported.
486 .It Ic \&bp Oo Cm + Ns | Ns Cm - Oc Ns Ar pagenumber
487 Begin a new page.
488 Currently ignored.
489 .It Ic \&BP Ar source height width position offset flags label
490 Define a frame and place a picture in it.
491 This is a Heirloom extension and currently unsupported.
492 .It Ic \&br
493 Break the output line.
494 .It Ic \&break
495 Break out of a
496 .Ic \&while
497 loop.
498 Currently unsupported.
499 .It Ic \&breakchar Ar char ...
500 Optional line break characters.
501 This is a Heirloom extension and currently ignored.
502 .It Ic \&brnl Ar N
503 Break output line after the next
504 .Ar N
505 input lines.
506 This is a Heirloom extension and currently ignored.
507 .It Ic \&brp
508 Break and spread output line.
509 Currently, this is implemented as an alias for
510 .Ic \&br .
511 .It Ic \&brpnl Ar N
512 Break and spread output line after the next
513 .Ar N
514 input lines.
515 This is a Heirloom extension and currently ignored.
516 .It Ic \&c2 Op Ar char
517 Change the no-break control character.
518 Currently unsupported.
519 .It Ic \&cc Op Ar char
520 Change the control character.
521 If
522 .Ar char
523 is not specified, the control character is reset to
524 .Sq \&. .
525 Trailing characters are ignored.
526 .It Ic \&ce Op Ar N
527 Center the next
528 .Ar N
529 input lines without filling.
530 Currently ignored.
531 .It Ic \&cf Ar filename
532 Output the contents of a file.
533 Ignored because insecure.
534 .It Ic \&cflags Ar flags char ...
535 Set character flags.
536 This is a groff extension and currently ignored.
537 .It Ic \&ch Ar macroname Op Ar dist
538 Change a trap location.
539 Currently ignored.
540 .It Ic \&char Ar glyphname Op Ar string
541 Define a new glyph.
542 Currently unsupported.
543 .It Ic \&chop Ar stringname
544 Remove the last character from a macro, string, or diversion.
545 Currently unsupported.
546 .It Ic \&class Ar classname char ...
547 Define a character class.
548 This is a groff extension and currently ignored.
549 .It Ic \&close Ar streamname
550 Close an open file.
551 Ignored because insecure.
552 .It Ic \&CL Ar color text
553 Print text in color.
554 This is a Heirloom extension and currently unsupported.
555 .It Ic \&color Op Cm 1 | 0
556 Activate or deactivate colors.
557 This is a groff extension and currently ignored.
558 .It Ic \&composite Ar from to
559 Define a name component for composite glyph names.
560 This is a groff extension and currently unsupported.
561 .It Ic \&continue
562 Immediately start the next iteration of a
563 .Ic \&while
564 loop.
565 Currently unsupported.
566 .It Ic \&cp Op Cm 1 | 0
567 Switch
568 .Nm
569 compatibility mode on or off.
570 Currently ignored.
571 .It Ic \&cropat Ar left top width height
572 Set the CropBox page parameter for PDF generation.
573 This is a Heirloom extension and currently ignored.
574 .It Ic \&cs Ar font Op Ar width Op Ar emsize
575 Constant character spacing mode.
576 Currently ignored.
577 .It Ic \&cu Op Ar N
578 Underline next
579 .Ar N
580 input lines including whitespace.
581 Currently ignored.
582 .It Ic \&da Ar divname
583 Append to a diversion.
584 Currently unsupported.
585 .It Ic \&dch Ar macroname Op Ar dist
586 Change a trap location in the current diversion.
587 This is a Heirloom extension and currently unsupported.
588 .It Ic \&de Ar macroname Op Ar endmacro
589 Define a
590 .Nm
591 macro.
592 Its syntax can be either
593 .Bd -literal -offset indent
594 .Pf . Ic \&de Ar macroname
595 .Ar definition
596 \&..
597 .Ed
598 .Pp
599 or
600 .Bd -literal -offset indent
601 .Pf . Ic \&de Ar macroname Ar endmacro
602 .Ar definition
603 .Pf . Ar endmacro
604 .Ed
605 .Pp
606 Both forms define or redefine the macro
607 .Ar macroname
608 to represent the
609 .Ar definition ,
610 which may consist of one or more input lines, including the newline
611 characters terminating each line, optionally containing calls to
612 .Nm
613 requests,
614 .Nm
615 macros or high-level macros like
616 .Xr man 7
617 or
618 .Xr mdoc 7
619 macros, whichever applies to the document in question.
620 .Pp
621 Specifying a custom
622 .Ar endmacro
623 macro works in the same way as for
624 .Ic \&ig ;
625 namely, the call to
626 .Sq Pf . Ar endmacro
627 first ends the
628 .Ar definition ,
629 and after that, it is also evaluated as a
630 .Nm
631 request or
632 .Nm
633 macro, but not as a high-level macro.
634 .Pp
635 The macro can be invoked later using the syntax
636 .Pp
637 .D1 Pf . Ar macroname Op Ar argument Op Ar argument ...
638 .Pp
639 Regarding argument parsing, see
640 .Sx MACRO SYNTAX
641 above.
642 .Pp
643 The line invoking the macro will be replaced
644 in the input stream by the
645 .Ar definition ,
646 replacing all occurrences of
647 .No \e\e$ Ns Ar N ,
648 where
649 .Ar N
650 is a digit, by the
651 .Ar N Ns th Ar argument .
652 For example,
653 .Bd -literal -offset indent
654 \&.de ZN
655 \efI\e^\e\e$1\e^\efP\e\e$2
656 \&..
657 \&.ZN XtFree .
658 .Ed
659 .Pp
660 produces
661 .Pp
662 .D1 \efI\e^XtFree\e^\efP.
663 .Pp
664 in the input stream, and thus in the output: \fI\^XtFree\^\fP.
665 Each occurrence of \e\e$* is replaced with all the arguments,
666 joined together with single blank characters.
667 .Pp
668 Since macros and user-defined strings share a common string table,
669 defining a macro
670 .Ar macroname
671 clobbers the user-defined string
672 .Ar macroname ,
673 and the
674 .Ar definition
675 can also be printed using the
676 .Sq \e*
677 string interpolation syntax described below
678 .Ic ds ,
679 but this is rarely useful because every macro definition contains at least
680 one explicit newline character.
681 .Pp
682 In order to prevent endless recursion, both groff and
683 .Xr mandoc 1
684 limit the stack depth for expanding macros and strings
685 to a large, but finite number, and
686 .Xr mandoc 1
687 also limits the length of the expanded input line.
688 Do not rely on the exact values of these limits.
689 .It Ic \&de1 Ar macroname Op Ar endmacro
690 Define a
691 .Nm
692 macro that will be executed with
693 .Nm
694 compatibility mode switched off during macro execution.
695 This is a groff extension.
696 Since
697 .Xr mandoc 1
698 does not implement
699 .Nm
700 compatibility mode at all, it handles this request as an alias for
701 .Ic \&de .
702 .It Ic \&defcolor Ar newname scheme component ...
703 Define a color name.
704 This is a groff extension and currently ignored.
705 .It Ic \&dei Ar macrostring Op Ar endstring
706 Define a
707 .Nm
708 macro, specifying the macro name indirectly (groff extension).
709 The syntax of this request is the same as that of
710 .Ic \&de .
711 The effect is the same as:
712 .Pp
713 .D1 Pf . Cm \&de No \e* Ns Bo Ar macrostring Bc Op \e* Ns Bq Ar endstring
714 .It Ic \&dei1 Ar macrostring Op Ar endstring
715 Define a
716 .Nm
717 macro that will be executed with
718 .Nm
719 compatibility mode switched off during macro execution,
720 specifying the macro name indirectly (groff extension).
721 Since
722 .Xr mandoc 1
723 does not implement
724 .Nm
725 compatibility mode at all, it handles this request as an alias for
726 .Ic \&dei .
727 .It Ic \&device Ar string ...
728 .It Ic \&devicem Ar stringname
729 These two requests only make sense with the groff-specific intermediate
730 output format and are unsupported.
731 .It Ic \&di Ar divname
732 Begin a diversion.
733 Currently unsupported.
734 .It Ic \&do Ar command Op Ar argument ...
735 Execute
736 .Nm
737 request or macro line with compatibility mode disabled.
738 Currently unsupported.
739 .It Ic \&ds Ar stringname Op Oo \(dq Oc Ns Ar string
740 Define a user-defined string.
741 The
742 .Ar stringname
743 and
744 .Ar string
745 arguments are space-separated.
746 If the
747 .Ar string
748 begins with a double-quote character, that character will not be part
749 of the string.
750 All remaining characters on the input line form the
751 .Ar string ,
752 including whitespace and double-quote characters, even trailing ones.
753 .Pp
754 The
755 .Ar string
756 can be interpolated into subsequent text by using
757 .No \e* Ns Bq Ar stringname
758 for a
759 .Ar stringname
760 of arbitrary length, or \e*(NN or \e*N if the length of
761 .Ar stringname
762 is two or one characters, respectively.
763 Interpolation can be prevented by escaping the leading backslash;
764 that is, an asterisk preceded by an even number of backslashes
765 does not trigger string interpolation.
766 .Pp
767 Since user-defined strings and macros share a common string table,
768 defining a string
769 .Ar stringname
770 clobbers the macro
771 .Ar stringname ,
772 and the
773 .Ar stringname
774 used for defining a string can also be invoked as a macro,
775 in which case the following input line will be appended to the
776 .Ar string ,
777 forming a new input line passed to the
778 .Nm
779 parser.
780 For example,
781 .Bd -literal -offset indent
782 \&.ds badidea .S
783 \&.badidea
784 H SYNOPSIS
785 .Ed
786 .Pp
787 invokes the
788 .Ic SH
789 macro when used in a
790 .Xr man 7
791 document.
792 Such abuse is of course strongly discouraged.
793 .It Ic \&ds1 Ar stringname Op Oo \(dq Oc Ns Ar string
794 Define a user-defined string that will be expanded with
795 .Nm
796 compatibility mode switched off during string expansion.
797 This is a groff extension.
798 Since
799 .Xr mandoc 1
800 does not implement
801 .Nm
802 compatibility mode at all, it handles this request as an alias for
803 .Ic \&ds .
804 .It Ic \&dwh Ar dist macroname
805 Set a location trap in the current diversion.
806 This is a Heirloom extension and currently unsupported.
807 .It Ic \&dt Op Ar dist macroname
808 Set a trap within a diversion.
809 Currently unsupported.
810 .It Ic \&ec Op Ar char
811 Change the escape character.
812 Currently unsupported.
813 .It Ic \&ecr
814 Restore the escape character.
815 Currently unsupported.
816 .It Ic \&ecs
817 Save the escape character.
818 Currently unsupported.
819 .It Ic \&el Ar body
820 The
821 .Dq else
822 half of an if/else conditional.
823 Pops a result off the stack of conditional evaluations pushed by
824 .Ic \&ie
825 and uses it as its conditional.
826 If no stack entries are present (e.g., due to no prior
827 .Ic \&ie
828 calls)
829 then false is assumed.
830 The syntax of this request is similar to
831 .Ic \&if
832 except that the conditional is missing.
833 .It Ic \&em Ar macroname
834 Set a trap at the end of input.
835 Currently unsupported.
836 .It Ic \&EN
837 End an equation block.
838 See
839 .Ic \&EQ .
840 .It Ic \&eo
841 Disable the escape mechanism completely.
842 Currently unsupported.
843 .It Ic \&EP
844 End a picture started by
845 .Ic \&BP .
846 This is a Heirloom extension and currently unsupported.
847 .It Ic \&EQ
848 Begin an equation block.
849 See
850 .Xr eqn 7
851 for a description of the equation language.
852 .It Ic \&errprint Ar message
853 Print a string like an error message.
854 This is a Heirloom extension and currently ignored.
855 .It Ic \&ev Op Ar envname
856 Switch to another environment.
857 Currently unsupported.
858 .It Ic \&evc Op Ar envname
859 Copy an environment into the current environment.
860 Currently unsupported.
861 .It Ic \&ex
862 Abort processing and exit.
863 Currently unsupported.
864 .It Ic \&fallback Ar curfont font ...
865 Select the fallback sequence for a font.
866 This is a Heirloom extension and currently ignored.
867 .It Ic \&fam Op Ar familyname
868 Change the font family.
869 This is a groff extension and currently ignored.
870 .It Ic \&fc Op Ar delimchar Op Ar padchar
871 Define a delimiting and a padding character for fields.
872 Currently unsupported.
873 .It Ic \&fchar Ar glyphname Op Ar string
874 Define a fallback glyph.
875 Currently unsupported.
876 .It Ic \&fcolor Ar colorname
877 Set the fill color for \eD objects.
878 This is a groff extension and currently ignored.
879 .It Ic \&fdeferlig Ar font string ...
880 Defer ligature building.
881 This is a Heirloom extension and currently ignored.
882 .It Ic \&feature Cm + Ns | Ns Cm - Ns Ar name
883 Enable or disable an OpenType feature.
884 This is a Heirloom extension and currently ignored.
885 .It Ic \&fi
886 Switch to fill mode.
887 See
888 .Xr man 7 .
889 Ignored in
890 .Xr mdoc 7 .
891 .It Ic \&fkern Ar font minkern
892 Control the use of kerning tables for a font.
893 This is a Heirloom extension and currently ignored.
894 .It Ic \&fl
895 Flush output.
896 Currently ignored.
897 .It Ic \&flig Ar font string char ...
898 Define ligatures.
899 This is a Heirloom extension and currently ignored.
900 .It Ic \&fp Ar position font Op Ar filename
901 Assign font position.
902 Currently ignored.
903 .It Ic \&fps Ar mapname ...
904 Mount a font with a special character map.
905 This is a Heirloom extension and currently ignored.
906 .It Ic \&fschar Ar font glyphname Op Ar string
907 Define a font-specific fallback glyph.
908 This is a groff extension and currently unsupported.
909 .It Ic \&fspacewidth Ar font Op Ar afmunits
910 Set a font-specific width for the space character.
911 This is a Heirloom extension and currently ignored.
912 .It Ic \&fspecial Ar curfont Op Ar font ...
913 Conditionally define a special font.
914 This is a groff extension and currently ignored.
915 .It Ic \&ft Op Ar font
916 Change the font.
917 The following
918 .Ar font
919 arguments are supported:
920 .Bl -tag -width 4n -offset indent
921 .It Cm B , BI , 3 , 4
922 switches to
923 .Sy bold
924 font
925 .It Cm I , 2
926 switches to
927 .Em underlined
928 font
929 .It Cm R , CW , 1
930 switches to normal font
931 .It Cm P No "or no argument"
932 switches back to the previous font
933 .El
934 .Pp
935 This request takes effect only locally and may be overridden
936 by macros and escape sequences.
937 .It Ic \&ftr Ar newname Op Ar oldname
938 Translate font name.
939 This is a groff extension and currently ignored.
940 .It Ic \&fzoom Ar font Op Ar permille
941 Zoom font size.
942 Currently ignored.
943 .It Ic \&gcolor Op Ar colorname
944 Set glyph color.
945 This is a groff extension and currently ignored.
946 .It Ic \&hc Op Ar char
947 Set the hyphenation character.
948 Currently ignored.
949 .It Ic \&hcode Ar char code ...
950 Set hyphenation codes of characters.
951 Currently ignored.
952 .It Ic \&hidechar Ar font char ...
953 Hide characters in a font.
954 This is a Heirloom extension and currently ignored.
955 .It Ic \&hla Ar language
956 Set hyphenation language.
957 This is a groff extension and currently ignored.
958 .It Ic \&hlm Op Ar number
959 Set maximum number of consecutive hyphenated lines.
960 Currently ignored.
961 .It Ic \&hpf Ar filename
962 Load hyphenation pattern file.
963 This is a groff extension and currently ignored.
964 .It Ic \&hpfa Ar filename
965 Load hyphenation pattern file, appending to the current patterns.
966 This is a groff extension and currently ignored.
967 .It Ic \&hpfcode Ar code code ...
968 Define mapping values for character codes in hyphenation patterns.
969 This is a groff extension and currently ignored.
970 .It Ic \&hw Ar word ...
971 Specify hyphenation points in words.
972 Currently ignored.
973 .It Ic \&hy Op Ar mode
974 Set automatic hyphenation mode.
975 Currently ignored.
976 .It Ic \&hylang Ar language
977 Set hyphenation language.
978 This is a Heirloom extension and currently ignored.
979 .It Ic \&hylen Ar nchar
980 Minimum word length for hyphenation.
981 This is a Heirloom extension and currently ignored.
982 .It Ic \&hym Op Ar length
983 Set hyphenation margin.
984 This is a groff extension and currently ignored.
985 .It Ic \&hypp Ar penalty ...
986 Define hyphenation penalties.
987 This is a Heirloom extension and currently ignored.
988 .It Ic \&hys Op Ar length
989 Set hyphenation space.
990 This is a groff extension and currently ignored.
991 .It Ic \&ie Ar condition body
992 The
993 .Dq if
994 half of an if/else conditional.
995 The result of the conditional is pushed into a stack used by subsequent
996 invocations of
997 .Ic \&el ,
998 which may be separated by any intervening input (or not exist at all).
999 Its syntax is equivalent to
1000 .Ic \&if .
1001 .It Ic \&if Ar condition body
1002 Begin a conditional.
1003 This request can also be written as follows:
1004 .Bd -unfilled -offset indent
1005 .Pf . Ic \&if Ar condition No \e{ Ns Ar body
1006 .Ar body ... Ns \e}
1007 .Ed
1008 .Bd -unfilled -offset indent
1009 .Pf . Ic \&if Ar condition No \e{\e
1010 .Ar body ...
1011 .Pf . No \e}
1012 .Ed
1013 .Pp
1014 The
1015 .Ar condition
1016 is a boolean expression.
1017 Currently,
1018 .Xr mandoc 1
1019 supports the following subset of roff conditionals:
1020 .Bl -bullet
1021 .It
1022 If
1023 .Sq \&!
1024 is prefixed to
1025 .Ar condition ,
1026 it is logically inverted.
1027 .It
1028 If the first character of
1029 .Ar condition
1030 is
1031 .Sq n
1032 .Pq nroff mode
1033 or
1034 .Sq o
1035 .Pq odd page ,
1036 it evaluates to true.
1037 .It
1038 If the first character of
1039 .Ar condition
1040 is
1041 .Sq c
1042 .Pq character available ,
1043 .Sq d
1044 .Pq string defined ,
1045 .Sq e
1046 .Pq even page ,
1047 .Sq t
1048 .Pq troff mode ,
1049 or
1050 .Sq v
1051 .Pq vroff mode ,
1052 it evaluates to false.
1053 .It
1054 If the first character of
1055 .Ar condition
1056 is
1057 .Sq r ,
1058 it evaluates to true if the rest of
1059 .Ar condition
1060 is the name of an existing number register;
1061 otherwise, it evaluates to false.
1062 .It
1063 If the
1064 .Ar condition
1065 starts with a parenthesis or with an optionally signed
1066 integer number, it is evaluated according to the rules of
1067 .Sx Numerical expressions
1068 explained below.
1069 It evaluates to true if the result is positive,
1070 or to false if the result is zero or negative.
1071 .It
1072 Otherwise, the first character of
1073 .Ar condition
1074 is regarded as a delimiter and it evaluates to true if the string
1075 extending from its first to its second occurrence is equal to the
1076 string extending from its second to its third occurrence.
1077 .It
1078 If
1079 .Ar condition
1080 cannot be parsed, it evaluates to false.
1081 .El
1082 .Pp
1083 If a conditional is false, its children are not processed, but are
1084 syntactically interpreted to preserve the integrity of the input
1085 document.
1086 Thus,
1087 .Pp
1088 .D1 \&.if t .ig
1089 .Pp
1090 will discard the
1091 .Sq \&.ig ,
1092 which may lead to interesting results, but
1093 .Pp
1094 .D1 \&.if t .if t \e{\e
1095 .Pp
1096 will continue to syntactically interpret to the block close of the final
1097 conditional.
1098 Sub-conditionals, in this case, obviously inherit the truth value of
1099 the parent.
1100 .Pp
1101 If the
1102 .Ar body
1103 section is begun by an escaped brace
1104 .Sq \e{ ,
1105 scope continues until the end of the input line containing the
1106 matching closing-brace escape sequence
1107 .Sq \e} .
1108 If the
1109 .Ar body
1110 is not enclosed in braces, scope continues until the end of the line.
1111 If the
1112 .Ar condition
1113 is followed by a
1114 .Ar body
1115 on the same line, whether after a brace or not, then requests and macros
1116 .Em must
1117 begin with a control character.
1118 It is generally more intuitive, in this case, to write
1119 .Bd -unfilled -offset indent
1120 .Pf . Ic \&if Ar condition No \e{\e
1121 .Pf . Ar request
1122 .Pf . No \e}
1123 .Ed
1124 .Pp
1125 than having the request or macro follow as
1126 .Pp
1127 .D1 Pf . Ic \&if Ar condition Pf \e{. Ar request
1128 .Pp
1129 The scope of a conditional is always parsed, but only executed if the
1130 conditional evaluates to true.
1131 .Pp
1132 Note that the
1133 .Sq \e}
1134 is converted into a zero-width escape sequence if not passed as a
1135 standalone macro
1136 .Sq \&.\e} .
1137 For example,
1138 .Pp
1139 .D1 \&.Fl a \e} b
1140 .Pp
1141 will result in
1142 .Sq \e}
1143 being considered an argument of the
1144 .Sq \&Fl
1145 macro.
1146 .It Ic \&ig Op Ar endmacro
1147 Ignore input.
1148 Its syntax can be either
1149 .Bd -literal -offset indent
1150 .Pf . Cm \&ig
1151 .Ar ignored text
1152 \&..
1153 .Ed
1154 .Pp
1155 or
1156 .Bd -literal -offset indent
1157 .Pf . Cm \&ig Ar endmacro
1158 .Ar ignored text
1159 .Pf . Ar endmacro
1160 .Ed
1161 .Pp
1162 In the first case, input is ignored until a
1163 .Sq \&..
1164 request is encountered on its own line.
1165 In the second case, input is ignored until the specified
1166 .Sq Pf . Ar endmacro
1167 is encountered.
1168 Do not use the escape character
1169 .Sq \e
1170 anywhere in the definition of
1171 .Ar endmacro ;
1172 it would cause very strange behaviour.
1173 .Pp
1174 When the
1175 .Ar endmacro
1176 is a roff request or a roff macro, like in
1177 .Pp
1178 .D1 \&.ig if
1179 .Pp
1180 the subsequent invocation of
1181 .Ic \&if
1182 will first terminate the
1183 .Ar ignored text ,
1184 then be invoked as usual.
1185 Otherwise, it only terminates the
1186 .Ar ignored text ,
1187 and arguments following it or the
1188 .Sq \&..
1189 request are discarded.
1190 .It Ic \&in Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width
1191 Change indentation.
1192 See
1193 .Xr man 7 .
1194 Ignored in
1195 .Xr mdoc 7 .
1196 .It Ic \&index Ar register stringname substring
1197 Find a substring in a string.
1198 This is a Heirloom extension and currently unsupported.
1199 .It Ic \&it Ar expression macro
1200 Set an input line trap.
1201 The named
1202 .Ar macro
1203 will be invoked after processing the number of input text lines
1204 specified by the numerical
1205 .Ar expression .
1206 While evaluating the
1207 .Ar expression ,
1208 the unit suffixes described below
1209 .Sx Scaling Widths
1210 are ignored.
1211 .It Ic \&it Ar expression macro
1212 Set an input line trap, not counting lines ending with \ec.
1213 Currently unsupported.
1214 .It Ic \&IX Ar class keystring
1215 To support the generation of a table of contents,
1216 .Xr pod2man 1
1217 emits this user-defined macro, usually without defining it.
1218 To avoid reporting large numbers of spurious errors,
1219 .Xr mandoc 1
1220 ignores it.
1221 .It Ic \&kern Op Cm 1 | 0
1222 Switch kerning on or off.
1223 Currently ignored.
1224 .It Ic \&kernafter Ar font char ... afmunits ...
1225 Increase kerning after some characters.
1226 This is a Heirloom extension and currently ignored.
1227 .It Ic \&kernbefore Ar font char ... afmunits ...
1228 Increase kerning before some characters.
1229 This is a Heirloom extension and currently ignored.
1230 .It Ic \&kernpair Ar font char ... font char ... afmunits
1231 Add a kerning pair to the kerning table.
1232 This is a Heirloom extension and currently ignored.
1233 .It Ic \&lc Op Ar glyph
1234 Define a leader repetition character.
1235 Currently unsupported.
1236 .It Ic \&lc_ctype Ar localename
1237 Set the
1238 .Dv LC_CTYPE
1239 locale.
1240 This is a Heirloom extension and currently unsupported.
1241 .It Ic \&lds Ar macroname string
1242 Define a local string.
1243 This is a Heirloom extension and currently unsupported.
1244 .It Ic \&length Ar register string
1245 Count the number of input characters in a string.
1246 Currently unsupported.
1247 .It Ic \&letadj Ar lspmin lshmin letss lspmax lshmax
1248 Dynamic letter spacing and reshaping.
1249 This is a Heirloom extension and currently ignored.
1250 .It Ic \&lf Ar lineno Op Ar filename
1251 Change the line number for error messages.
1252 Ignored because insecure.
1253 .It Ic \&lg Op Cm 1 | 0
1254 Switch the ligature mechanism on or off.
1255 Currently ignored.
1256 .It Ic \&lhang Ar font char ... afmunits
1257 Hang characters at left margin.
1258 This is a Heirloom extension and currently ignored.
1259 .It Ic \&linetabs Op Cm 1 | 0
1260 Enable or disable line-tabs mode.
1261 This is a groff extension and currently unsupported.
1262 .It Ic \&ll Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width
1263 Change the output line length.
1264 If the
1265 .Ar width
1266 argument is omitted, the line length is reset to its previous value.
1267 The default setting for terminal output is 78n.
1268 If a sign is given, the line length is added to or subtracted from;
1269 otherwise, it is set to the provided value.
1270 Using this request in new manuals is discouraged for several reasons,
1271 among others because it overrides the
1272 .Xr mandoc 1
1273 .Fl O Cm width
1274 command line option.
1275 .It Ic \&lnr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar value Op Ar increment
1276 Set local number register.
1277 This is a Heirloom extension and currently unsupported.
1278 .It Ic \&lnrf Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar value Op Ar increment
1279 Set local floating-point register.
1280 This is a Heirloom extension and currently unsupported.
1281 .It Ic \&lpfx Ar string
1282 Set a line prefix.
1283 This is a Heirloom extension and currently unsupported.
1284 .It Ic \&ls Op Ar factor
1285 Set line spacing.
1286 It takes one integer argument specifying the vertical distance of
1287 subsequent output text lines measured in v units.
1288 Currently ignored.
1289 .It Ic \&lsm Ar macroname
1290 Set a leading spaces trap.
1291 This is a groff extension and currently unsupported.
1292 .It Ic \&lt Op Oo Cm + Ns | Ns Cm - Oc Ns Ar width
1293 Set title line length.
1294 Currently ignored.
1295 .It Ic \&mc Ar glyph Op Ar dist
1296 Print margin character in the right margin.
1297 Currently ignored.
1298 .It Ic \&mediasize Ar media
1299 Set the device media size.
1300 This is a Heirloom extension and currently ignored.
1301 .It Ic \&minss Ar width
1302 Set minimum word space.
1303 This is a Heirloom extension and currently ignored.
1304 .It Ic \&mk Op Ar register
1305 Mark vertical position.
1306 Currently ignored.
1307 .It Ic \&mso Ar filename
1308 Load a macro file using the search path.
1309 Ignored because insecure.
1310 .It Ic \&na
1311 Disable adjusting without changing the adjustment mode.
1312 Currently ignored.
1313 .It Ic \&ne Op Ar height
1314 Declare the need for the specified minimum vertical space
1315 before the next trap or the bottom of the page.
1316 Currently ignored.
1317 .It Ic \&nf
1318 Switch to no-fill mode.
1319 See
1320 .Xr man 7 .
1321 Ignored by
1322 .Xr mdoc 7 .
1323 .It Ic \&nh
1324 Turn off automatic hyphenation mode.
1325 Currently ignored.
1326 .It Ic \&nhychar Ar char ...
1327 Define hyphenation-inhibiting characters.
1328 This is a Heirloom extension and currently ignored.
1329 .It Ic \&nm Op Ar start Op Ar inc Op Ar space Op Ar indent
1330 Print line numbers.
1331 Currently unsupported.
1332 .It Ic \&nn Op Ar number
1333 Temporarily turn off line numbering.
1334 Currently unsupported.
1335 .It Ic \&nop Ar body
1336 Execute the rest of the input line as a request or macro line.
1337 Currently unsupported.
1338 .It Ic \&nr Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression
1339 Define or change a register.
1340 A register is an arbitrary string value that defines some sort of state,
1341 which influences parsing and/or formatting.
1342 For the syntax of
1343 .Ar expression ,
1344 see
1345 .Sx Numerical expressions
1346 below.
1347 If it is prefixed by a sign, the register will be
1348 incremented or decremented instead of assigned to.
1349 .Pp
1350 The following
1351 .Ar register
1352 is handled specially:
1353 .Bl -tag -width Ds
1354 .It Cm nS
1355 If set to a positive integer value, certain
1356 .Xr mdoc 7
1357 macros will behave in the same way as in the
1358 .Em SYNOPSIS
1359 section.
1360 If set to 0, these macros will behave in the same way as outside the
1361 .Em SYNOPSIS
1362 section, even when called within the
1363 .Em SYNOPSIS
1364 section itself.
1365 Note that starting a new
1366 .Xr mdoc 7
1367 section with the
1368 .Ic \&Sh
1369 macro will reset this register.
1370 .El
1371 .It Xo
1372 .Ic \&nrf Ar register Oo Cm + Ns | Ns Cm - Oc Ns Ar expression
1373 .Op Ar increment
1374 .Xc
1375 Define or change a floating-point register.
1376 This is a Heirloom extension and currently unsupported.
1377 .It Ic \&nroff
1378 Force nroff mode.
1379 This is a groff extension and currently ignored.
1380 .It Ic \&ns
1381 Turn on no-space mode.
1382 Currently ignored.
1383 .It Ic \&nx Op Ar filename
1384 Abort processing of the current input file and process another one.
1385 Ignored because insecure.
1386 .It Ic \&open Ar stream file
1387 Open a file for writing.
1388 Ignored because insecure.
1389 .It Ic \&opena Ar stream file
1390 Open a file for appending.
1391 Ignored because insecure.
1392 .It Ic \&os
1393 Output saved vertical space.
1394 Currently ignored.
1395 .It Ic \&output Ar string
1396 Output directly to intermediate output.
1397 Not supported.
1398 .It Ic \&padj Op Cm 1 | 0
1399 Globally control paragraph-at-once adjustment.
1400 This is a Heirloom extension and currently ignored.
1401 .It Ic \&papersize Ar media
1402 Set the paper size.
1403 This is a Heirloom extension and currently ignored.
1404 .It Ic \&pc Op Ar char
1405 Change the page number character.
1406 Currently ignored.
1407 .It Ic \&pev
1408 Print environments.
1409 This is a groff extension and currently ignored.
1410 .It Ic \&pi Ar command
1411 Pipe output to a shell command.
1412 Ignored because insecure.
1413 .It Ic \&PI
1414 Low-level request used by
1415 .Ic \&BP .
1416 This is a Heirloom extension and currently unsupported.
1417 .It Ic \&pl Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height
1418 Change page length.
1419 Currently ignored.
1420 .It Ic \&pm
1421 Print names and sizes of macros, strings, and diversions
1422 to standard error output.
1423 Currently ignored.
1424 .It Ic \&pn Oo Cm + Ns | Ns Cm - Oc Ns Ar number
1425 Change the page number of the next page.
1426 Currently ignored.
1427 .It Ic \&pnr
1428 Print all number registers on standard error output.
1429 Currently ignored.
1430 .It Ic \&po Op Oo Cm + Ns | Ns Cm - Oc Ns Ar offset
1431 Set horizontal page offset.
1432 Currently ignored.
1433 .It Ic \&ps Op Oo Cm + Ns | Ns Cm - Oc Ns size
1434 Change point size.
1435 Currently ignored.
1436 .It Ic \&psbb Ar filename
1437 Retrieve the bounding box of a PostScript file.
1438 Currently unsupported.
1439 .It Ic \&pshape Ar indent length ...
1440 Set a special shape for the current paragraph.
1441 This is a Heirloom extension and currently unsupported.
1442 .It Ic \&pso Ar command
1443 Include output of a shell command.
1444 Ignored because insecure.
1445 .It Ic \&ptr
1446 Print the names and positions of all traps on standard error output.
1447 This is a groff extension and currently ignored.
1448 .It Ic \&pvs Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height
1449 Change post-vertical spacing.
1450 This is a groff extension and currently ignored.
1451 .It Ic \&rchar Ar glyph ...
1452 Remove glyph definitions.
1453 Currently unsupported.
1454 .It Ic \&rd Op Ar prompt Op Ar agument ...
1455 Read from standard input.
1456 Currently ignored.
1457 .It Ic \&recursionlimit Ar maxrec maxtail
1458 Set the maximum stack depth for recursive macros.
1459 This is a Heirloom extension and currently ignored.
1460 .It Ic \&return Op Ar twice
1461 Exit a macro and return to the caller.
1462 Currently unsupported.
1463 .It Ic \&rfschar Ar font glyph ...
1464 Remove font-specific fallback glyph definitions.
1465 Currently unsupported.
1466 .It Ic \&rhang Ar font char ... afmunits
1467 Hang characters at right margin.
1468 This is a Heirloom extension and currently ignored.
1469 .It Ic \&rj Op Ar N
1470 Justify the next
1471 .Ar N
1472 input lines to the right margin without filling.
1473 Currently ignored.
1474 .It Ic \&rm Ar macroname
1475 Remove a request, macro or string.
1476 .It Ic \&rn Ar oldname newname
1477 Rename a request, macro, diversion, or string.
1478 Currently unsupported.
1479 .It Ic \&rnn Ar oldname newname
1480 Rename a number register.
1481 Currently unsupported.
1482 .It Ic \&rr Ar register
1483 Remove a register.
1484 .It Ic \&rs
1485 End no-space mode.
1486 Currently ignored.
1487 .It Ic \&rt Op Ar dist
1488 Return to marked vertical position.
1489 Currently ignored.
1490 .It Ic \&schar Ar glyph Op Ar string
1491 Define global fallback glyph.
1492 This is a groff extension and currently unsupported.
1493 .It Ic \&sentchar Ar char ...
1494 Define sentence-ending characters.
1495 This is a Heirloom extension and currently ignored.
1496 .It Ic \&shc Op Ar glyph
1497 Change the soft hyphen character.
1498 Currently ignored.
1499 .It Ic \&shift Op Ar number
1500 Shift macro arguments.
1501 Currently unsupported.
1502 .It Ic \&sizes Ar size ...
1503 Define permissible point sizes.
1504 This is a groff extension and currently ignored.
1505 .It Ic \&so Ar filename
1506 Include a source file.
1507 The file is read and its contents processed as input in place of the
1508 .Ic \&so
1509 request line.
1510 To avoid inadvertent inclusion of unrelated files,
1511 .Xr mandoc 1
1512 only accepts relative paths not containing the strings
1513 .Qq ../
1514 and
1515 .Qq /.. .
1516 .Pp
1517 This request requires
1518 .Xr man 1
1519 to change to the right directory before calling
1520 .Xr mandoc 1 ,
1521 per convention to the root of the manual tree.
1522 Typical usage looks like:
1523 .Pp
1524 .Dl \&.so man3/Xcursor.3
1525 .Pp
1526 As the whole concept is rather fragile, the use of
1527 .Ic \&so
1528 is discouraged.
1529 Use
1530 .Xr ln 1
1531 instead.
1532 .It Ic \&sp Op Ar height
1533 Break the output line and emit vertical space.
1534 The argument follows the syntax of
1535 .Sx Scaling Widths
1536 and defaults to one blank line
1537 .Pq Li 1v .
1538 .It Ic \&spacewidth Op Cm 1 | 0
1539 Set the space width from the font metrics file.
1540 This is a Heirloom extension and currently ignored.
1541 .It Ic \&special Op Ar font ...
1542 Define a special font.
1543 This is a groff extension and currently ignored.
1544 .It Ic \&spreadwarn Op Ar width
1545 Warn about wide spacing between words.
1546 Currently ignored.
1547 .It Ic \&ss Ar wordspace Op Ar sentencespace
1548 Set space character size.
1549 Currently ignored.
1550 .It Ic \&sty Ar position style
1551 Associate style with a font position.
1552 This is a groff extension and currently ignored.
1553 .It Ic \&substring Ar stringname startpos Op Ar endpos
1554 Replace a user-defined string with a substring.
1555 Currently unsupported.
1556 .It Ic \&sv Op Ar height
1557 Save vertical space.
1558 Currently ignored.
1559 .It Ic \&sy Ar command
1560 Execute shell command.
1561 Ignored because insecure.
1562 .It Ic \&T&
1563 Re-start a table layout, retaining the options of the prior table
1564 invocation.
1565 See
1566 .Sx \&TS .
1567 .It Ic \&ta Op Ar width ... Op Cm T Ar width ...
1568 Set tab stops.
1569 Each
1570 .Ar width
1571 argument follows the syntax of
1572 .Sx Scaling Widths .
1573 If prefixed by a plus sign, it is relative to the previous tab stop.
1574 The arguments after the
1575 .Cm T
1576 marker are used repeatedly as often as needed; for each reuse,
1577 they are taken relative to the last previously established tab stop.
1578 When
1579 .Ic \&ta
1580 is called without arguments, all tab stops are cleared.
1581 .It Ic \&tc Op Ar glyph
1582 Change tab repetition character.
1583 Currently unsupported.
1584 .It Ic \&TE
1585 End a table context.
1586 See
1587 .Sx \&TS .
1588 .It Ic \&ti Oo Cm + Ns | Ns Cm - Oc Ns Ar width
1589 Break the output line and indent the next output line by
1590 .Ar width .
1591 If a sign is specified, the temporary indentation is calculated
1592 relative to the current indentation; otherwise, it is absolute.
1593 The argument follows the syntax of
1594 .Sx Scaling Widths
1595 and the default scaling unit is
1596 .Cm m .
1597 .It Ic \&tkf Ar font minps width1 maxps width2
1598 Enable track kerning for a font.
1599 Currently ignored.
1600 .It Ic \&tl No \& Ap Ar left Ap Ar center Ap Ar right Ap
1601 Print a title line.
1602 Currently unsupported.
1603 .It Ic \&tm Ar string
1604 Print to standard error output.
1605 Currently ignored.
1606 .It Ic \&tm1 Ar string
1607 Print to standard error output, allowing leading blanks.
1608 This is a groff extension and currently ignored.
1609 .It Ic \&tmc Ar string
1610 Print to standard error output without a trailing newline.
1611 This is a groff extension and currently ignored.
1612 .It Ic \&tr Ar glyph glyph ...
1613 Output character translation.
1614 The first glyph in each pair is replaced by the second one.
1615 Character escapes can be used; for example,
1616 .Pp
1617 .Dl tr \e(xx\e(yy
1618 .Pp
1619 replaces all invocations of \e(xx with \e(yy.
1620 .It Ic \&track Ar font minps width1 maxps width2
1621 Static letter space tracking.
1622 This is a Heirloom extension and currently ignored.
1623 .It Ic \&transchar Ar char ...
1624 Define transparent characters for sentence-ending.
1625 This is a Heirloom extension and currently ignored.
1626 .It Ic \&trf Ar filename
1627 Output the contents of a file, disallowing invalid characters.
1628 This is a groff extension and ignored because insecure.
1629 .It Ic \&trimat Ar left top width height
1630 Set the TrimBox page parameter for PDF generation.
1631 This is a Heirloom extension and currently ignored.
1632 .It Ic \&trin Ar glyph glyph ...
1633 Output character translation, ignored by
1634 .Ic \&asciify .
1635 Currently unsupported.
1636 .It Ic \&trnt Ar glyph glyph ...
1637 Output character translation, ignored by \e!.
1638 Currently unsupported.
1639 .It Ic \&troff
1640 Force troff mode.
1641 This is a groff extension and currently ignored.
1642 .It Ic \&TS
1643 Begin a table, which formats input in aligned rows and columns.
1644 See
1645 .Xr tbl 7
1646 for a description of the tbl language.
1647 .It Ic \&uf Ar font
1648 Globally set the underline font.
1649 Currently ignored.
1650 .It Ic \&ul Op Ar N
1651 Underline next
1652 .Ar N
1653 input lines.
1654 Currently ignored.
1655 .It Ic \&unformat Ar divname
1656 Unformat spaces and tabs in a diversion.
1657 Currently unsupported.
1658 .It Ic \&unwatch Ar macroname
1659 Disable notification for string or macro.
1660 This is a Heirloom extension and currently ignored.
1661 .It Ic \&unwatchn Ar register
1662 Disable notification for register.
1663 This is a Heirloom extension and currently ignored.
1664 .It Ic \&vpt Op Cm 1 | 0
1665 Enable or disable vertical position traps.
1666 This is a groff extension and currently ignored.
1667 .It Ic \&vs Op Oo Cm + Ns | Ns Cm - Oc Ns Ar height
1668 Change vertical spacing.
1669 Currently ignored.
1670 .It Ic \&warn Ar flags
1671 Set warning level.
1672 Currently ignored.
1673 .It Ic \&warnscale Ar si
1674 Set the scaling indicator used in warnings.
1675 This is a groff extension and currently ignored.
1676 .It Ic \&watch Ar macroname
1677 Notify on change of string or macro.
1678 This is a Heirloom extension and currently ignored.
1679 .It Ic \&watchlength Ar maxlength
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.
1683 .It Ic \&watchn Ar register
1684 Notify on change of register.
1685 This is a Heirloom extension and currently ignored.
1686 .It Ic \&wh Ar dist Op Ar macroname
1687 Set a page location trap.
1688 Currently unsupported.
1689 .It Ic \&while Ar condition body
1690 Repeated execution while a condition is true.
1691 Currently unsupported.
1692 .It Ic \&write Oo \(dq Oc Ns Ar string
1693 Write to an open file.
1694 Ignored because insecure.
1695 .It Ic \&writec Oo \(dq Oc Ns Ar string
1696 Write to an open file without appending a newline.
1697 Ignored because insecure.
1698 .It Ic \&writem Ar macroname
1699 Write macro or string to an open file.
1700 Ignored because insecure.
1701 .It Ic \&xflag Ar level
1702 Set the extension level.
1703 This is a Heirloom extension and currently ignored.
1704 .El
1705 .Ss Numerical expressions
1706 The
1707 .Sx \&nr ,
1708 .Sx \&if ,
1709 and
1710 .Sx \&ie
1711 requests accept integer numerical expressions as arguments.
1712 These are always evaluated using the C
1713 .Vt int
1714 type; integer overflow works the same way as in the C language.
1715 Numbers consist of an arbitrary number of digits
1716 .Sq 0
1717 to
1718 .Sq 9
1719 prefixed by an optional sign
1720 .Sq +
1721 or
1722 .Sq - .
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
1729 1f = 65536u = 65536
1730 .Ed
1731 .Pp
1732 The following binary operators are implemented.
1733 Unless otherwise stated, they behave as in the C language:
1734 .Pp
1735 .Bl -tag -width 2n -compact
1736 .It Ic +
1737 addition
1738 .It Ic -
1739 subtraction
1740 .It Ic *
1741 multiplication
1742 .It Ic /
1743 division
1744 .It Ic %
1745 remainder of division
1746 .It Ic <
1747 less than
1748 .It Ic >
1749 greater than
1750 .It Ic ==
1751 equal to
1752 .It Ic =
1753 equal to, same effect as
1754 .Ic ==
1755 (this differs from C)
1756 .It Ic <=
1757 less than or equal to
1758 .It Ic >=
1759 greater than or equal to
1760 .It Ic <>
1761 not equal to (corresponds to C
1762 .Ic != ;
1763 this one is of limited portability, it is supported by Heirloom roff,
1764 but not by groff)
1765 .It Ic &
1766 logical and (corresponds to C
1767 .Ic && )
1768 .It Ic \&:
1769 logical or (corresponds to C
1770 .Ic \&|| )
1771 .It Ic <?
1772 minimum (not available in C)
1773 .It Ic >?
1774 maximum (not available in C)
1775 .El
1776 .Pp
1777 There is no concept of precedence; evaluation proceeds from left to right,
1778 except when subexpressions are enclosed in parentheses.
1779 Inside parentheses, whitespace is ignored.
1780 .Sh ESCAPE SEQUENCE REFERENCE
1781 The
1782 .Xr mandoc 1
1783 .Nm
1784 parser recognises the following escape sequences.
1785 Note that the
1786 .Nm
1787 language defines more escape sequences not implemented in
1788 .Xr mandoc 1 .
1789 In
1790 .Xr mdoc 7
1791 and
1792 .Xr man 7
1793 documents, using escape sequences is discouraged except for those
1794 described in the
1795 .Sx LANGUAGE SYNTAX
1796 section above.
1797 .Pp
1798 A backslash followed by any character not listed here
1799 simply prints that character itself.
1800 .Ss \e<newline>
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.
1804 .Ss \e<space>
1805 The escape sequence backslash-space
1806 .Pq Sq \e\ \&
1807 is an unpaddable space-sized non-breaking space character; see
1808 .Sx Whitespace .
1809 .Ss \e\(dq
1810 The rest of the input line is treated as
1811 .Sx Comments .
1812 .Ss \e%
1813 Hyphenation allowed at this point of the word; ignored by
1814 .Xr mandoc 1 .
1815 .Ss \e&
1816 Non-printing zero-width character; see
1817 .Sx Whitespace .
1818 .Ss \e\(aq
1819 Acute accent special character; use
1820 .Sq \e(aa
1821 instead.
1822 .Ss \e( Ns Ar cc
1823 .Sx Special Characters
1824 with two-letter names, see
1825 .Xr mandoc_char 7 .
1826 .Ss \e*[ Ns Ar name ]
1827 Interpolate the string with the
1828 .Ar name ;
1829 see
1830 .Sx Predefined Strings
1831 and
1832 .Sx ds .
1833 For short names, there are variants
1834 .No \e* Ns Ar c
1835 and
1836 .No \e*( Ns Ar cc .
1837 .Ss \e,
1838 Left italic correction (groff extension); ignored by
1839 .Xr mandoc 1 .
1840 .Ss \e-
1841 Special character
1842 .Dq mathematical minus sign .
1843 .Ss \e/
1844 Right italic correction (groff extension); ignored by
1845 .Xr mandoc 1 .
1846 .Ss \e[ Ns Ar name ]
1847 .Sx Special Characters
1848 with names of arbitrary length, see
1849 .Xr mandoc_char 7 .
1850 .Ss \e^
1851 One-twelfth em half-narrow space character, effectively zero-width in
1852 .Xr mandoc 1 .
1853 .Ss \e`
1854 Grave accent special character; use
1855 .Sq \e(ga
1856 instead.
1857 .Ss \e{
1858 Begin conditional input; see
1859 .Sx if .
1860 .Ss \e\(ba
1861 One-sixth em narrow space character, effectively zero-width in
1862 .Xr mandoc 1 .
1863 .Ss \e}
1864 End conditional input; see
1865 .Sx if .
1866 .Ss \e~
1867 Paddable non-breaking space character.
1868 .Ss \e0
1869 Digit width space character.
1870 .Ss \eA\(aq Ns Ar string Ns \(aq
1871 Anchor definition; ignored by
1872 .Xr mandoc 1 .
1873 .Ss \eB\(aq Ns Ar string Ns \(aq
1874 Interpolate
1875 .Sq 1
1876 if
1877 .Ar string
1878 conforms to the syntax of
1879 .Sx Numerical expressions
1880 explained above and
1881 .Sq 0
1882 otherwise.
1883 .Ss \eb\(aq Ns Ar string Ns \(aq
1884 Bracket building function; ignored by
1885 .Xr mandoc 1 .
1886 .Ss \eC\(aq Ns Ar name Ns \(aq
1887 .Sx Special Characters
1888 with names of arbitrary length.
1889 .Ss \ec
1890 When encountered at the end of an input text line,
1891 the next input text line is considered to continue that line,
1892 even if there are request or macro lines in between.
1893 No whitespace is inserted.
1894 .Ss \eD\(aq Ns Ar string Ns \(aq
1895 Draw graphics function; ignored by
1896 .Xr mandoc 1 .
1897 .Ss \ed
1898 Move down by half a line; ignored by
1899 .Xr mandoc 1 .
1900 .Ss \ee
1901 Backslash special character.
1902 .Ss \eF[ Ns Ar name ]
1903 Switch font family (groff extension); ignored by
1904 .Xr mandoc 1 .
1905 For short names, there are variants
1906 .No \eF Ns Ar c
1907 and
1908 .No \eF( Ns Ar cc .
1909 .Ss \ef[ Ns Ar name ]
1910 Switch to the font
1911 .Ar name ,
1912 see
1913 .Sx Text Decoration .
1914 For short names, there are variants
1915 .No \ef Ns Ar c
1916 and
1917 .No \ef( Ns Ar cc .
1918 .Ss \eg[ Ns Ar name ]
1919 Interpolate the format of a number register; ignored by
1920 .Xr mandoc 1 .
1921 For short names, there are variants
1922 .No \eg Ns Ar c
1923 and
1924 .No \eg( Ns Ar cc .
1925 .Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1926 Set the height of the current font; ignored by
1927 .Xr mandoc 1 .
1928 .Ss \eh\(aq Ns Ar number Ns \(aq
1929 Horizontal motion; ignored by
1930 .Xr mandoc 1 .
1931 .Ss \ek[ Ns Ar name ]
1932 Mark horizontal input place in register; ignored by
1933 .Xr mandoc 1 .
1934 For short names, there are variants
1935 .No \ek Ns Ar c
1936 and
1937 .No \ek( Ns Ar cc .
1938 .Ss \eL\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1939 Vertical line drawing function; ignored by
1940 .Xr mandoc 1 .
1941 .Ss \el\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
1942 Horizontal line drawing function; ignored by
1943 .Xr mandoc 1 .
1944 .Ss \eM[ Ns Ar name ]
1945 Set fill (background) color (groff extension); ignored by
1946 .Xr mandoc 1 .
1947 For short names, there are variants
1948 .No \eM Ns Ar c
1949 and
1950 .No \eM( Ns Ar cc .
1951 .Ss \em[ Ns Ar name ]
1952 Set glyph drawing color (groff extension); ignored by
1953 .Xr mandoc 1 .
1954 For short names, there are variants
1955 .No \em Ns Ar c
1956 and
1957 .No \em( Ns Ar cc .
1958 .Ss \eN\(aq Ns Ar number Ns \(aq
1959 Character
1960 .Ar number
1961 on the current font.
1962 .Ss \en[ Ns Ar name ]
1963 Interpolate the number register
1964 .Ar name .
1965 For short names, there are variants
1966 .No \en Ns Ar c
1967 and
1968 .No \en( Ns Ar cc .
1969 .Ss \eo\(aq Ns Ar string Ns \(aq
1970 Overstrike, writing all the characters contained in the
1971 .Ar string
1972 to the same output position.
1973 In terminal and HTML output modes,
1974 only the last one of the characters is visible.
1975 .Ss \eR\(aq Ns Ar name Oo +|- Oc Ns Ar number Ns \(aq
1976 Set number register; ignored by
1977 .Xr mandoc 1 .
1978 .Ss \eS\(aq Ns Ar number Ns \(aq
1979 Slant output; ignored by
1980 .Xr mandoc 1 .
1981 .Ss \es\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
1982 Change point size; ignored by
1983 .Xr mandoc 1 .
1984 Alternative forms
1985 .No \es Ns Oo +|- Oc Ns Ar n ,
1986 .No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq ,
1987 .No \es Ns [ Oo +|- Oc Ns Ar number ] ,
1988 and
1989 .No \es Ns Oo +|- Oc Ns [ Ar number Ns ]
1990 are also parsed and ignored.
1991 .Ss \et
1992 Horizontal tab; ignored by
1993 .Xr mandoc 1 .
1994 .Ss \eu
1995 Move up by half a line; ignored by
1996 .Xr mandoc 1 .
1997 .Ss \eV[ Ns Ar name ]
1998 Interpolate an environment variable; ignored by
1999 .Xr mandoc 1 .
2000 For short names, there are variants
2001 .No \eV Ns Ar c
2002 and
2003 .No \eV( Ns Ar cc .
2004 .Ss \ev\(aq Ns Ar number Ns \(aq
2005 Vertical motion; ignored by
2006 .Xr mandoc 1 .
2007 .Ss \ew\(aq Ns Ar string Ns \(aq
2008 Interpolate the width of the
2009 .Ar string .
2010 The
2011 .Xr mandoc 1
2012 implementation assumes that after expansion of user-defined strings, the
2013 .Ar string
2014 only contains normal characters, no escape sequences, and that each
2015 character has a width of 24 basic units.
2016 .Ss \eX\(aq Ns Ar string Ns \(aq
2017 Output
2018 .Ar string
2019 as device control function; ignored in nroff mode and by
2020 .Xr mandoc 1 .
2021 .Ss \ex\(aq Ns Ar number Ns \(aq
2022 Extra line space function; ignored by
2023 .Xr mandoc 1 .
2024 .Ss \eY[ Ns Ar name ]
2025 Output a string as a device control function; ignored in nroff mode and by
2026 .Xr mandoc 1 .
2027 For short names, there are variants
2028 .No \eY Ns Ar c
2029 and
2030 .No \eY( Ns Ar cc .
2031 .Ss \eZ\(aq Ns Ar string Ns \(aq
2032 Print
2033 .Ar string
2034 with zero width and height; ignored by
2035 .Xr mandoc 1 .
2036 .Ss \ez
2037 Output the next character without advancing the cursor position.
2038 .Sh COMPATIBILITY
2039 The
2040 .Xr mandoc 1
2041 implementation of the
2042 .Nm
2043 language is intentionally incomplete.
2044 Unimplemented features include:
2045 .Pp
2046 .Bl -dash -compact
2047 .It
2048 For security reasons,
2049 .Xr mandoc 1
2050 never reads or writes external files except via
2051 .Sx \&so
2052 requests with safe relative paths.
2053 .It
2054 There is no automatic hyphenation, no adjustment to the right margin,
2055 and no centering; the output is always set flush-left.
2056 .It
2057 Support for setting tabulator positions
2058 and tabulator and leader characters is missing,
2059 and support for manually changing indentation is limited.
2060 .It
2061 The
2062 .Sq u
2063 scaling unit is the default terminal unit.
2064 In traditional troff systems, this unit changes depending on the
2065 output media.
2066 .It
2067 Width measurements are implemented in a crude way
2068 and often yield wrong results.
2069 Explicit movement requests and escapes are ignored.
2070 .It
2071 There is no concept of output pages, no support for floats,
2072 graphics drawing, and picture inclusion;
2073 terminal output is always continuous.
2074 .It
2075 Requests regarding color, font families, and glyph manipulation
2076 are ignored.
2077 Font support is very limited.
2078 Kerning is not implemented, and no ligatures are produced.
2079 .It
2080 The
2081 .Qq \(aq
2082 macro control character does not suppress output line breaks.
2083 .It
2084 Diversions are not implemented,
2085 and support for traps is very incomplete.
2086 .It
2087 While recursion is supported,
2088 .Sx \&while
2089 loops are not.
2090 .El
2091 .Pp
2092 The special semantics of the
2093 .Cm nS
2094 number register is an idiosyncracy of
2095 .Ox
2096 manuals and not supported by other
2097 .Xr mdoc 7
2098 implementations.
2099 .Sh SEE ALSO
2100 .Xr mandoc 1 ,
2101 .Xr eqn 7 ,
2102 .Xr man 7 ,
2103 .Xr mandoc_char 7 ,
2104 .Xr mdoc 7 ,
2105 .Xr tbl 7
2106 .Rs
2107 .%A Joseph F. Ossanna
2108 .%A Brian W. Kernighan
2109 .%I AT&T Bell Laboratories
2110 .%T Troff User's Manual
2111 .%R Computing Science Technical Report
2112 .%N 54
2113 .%C Murray Hill, New Jersey
2114 .%D 1976 and 1992
2115 .%U http://www.kohala.com/start/troff/cstr54.ps
2116 .Re
2117 .Rs
2118 .%A Joseph F. Ossanna
2119 .%A Brian W. Kernighan
2120 .%A Gunnar Ritter
2121 .%T Heirloom Documentation Tools Nroff/Troff User's Manual
2122 .%D September 17, 2007
2123 .%U http://heirloom.sourceforge.net/doctools/troff.pdf
2124 .Re
2125 .Sh HISTORY
2126 The RUNOFF typesetting system, whose input forms the basis for
2127 .Nm ,
2128 was written in MAD and FAP for the CTSS operating system by Jerome E.
2129 Saltzer in 1964.
2130 Doug McIlroy rewrote it in BCPL in 1969, renaming it
2131 .Nm .
2132 Dennis M. Ritchie rewrote McIlroy's
2133 .Nm
2134 in PDP-11 assembly for
2135 .At v1 ,
2136 Joseph F. Ossanna improved roff and renamed it nroff
2137 for
2138 .At v2 ,
2139 then ported nroff to C as troff, which Brian W. Kernighan released with
2140 .At v7 .
2141 In 1989, James Clarke re-implemented troff in C++, naming it groff.
2142 .Sh AUTHORS
2143 .An -nosplit
2144 This
2145 .Nm
2146 reference was written by
2147 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
2148 and
2149 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .