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