]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Implement font-switching for PostScript. -Tps now supports
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.124 2010/06/07 12:20:07 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate: June 7 2010 $
18 .Dt MDOC 7
19 .Os
20 .Sh NAME
21 .Nm mdoc
22 .Nd mdoc language reference
23 .Sh DESCRIPTION
24 The
25 .Nm mdoc
26 language is used to format
27 .Bx
28 .Ux
29 manuals. In this reference document, we describe its syntax, structure,
30 and usage. Our reference implementation is mandoc; the
31 .Sx COMPATIBILITY
32 section describes compatibility with other troff \-mdoc implementations.
33 .Pp
34 An
35 .Nm
36 document follows simple rules: lines beginning with the control
37 character
38 .Sq \.
39 are parsed for macros. Other lines are interpreted within the scope of
40 prior macros:
41 .Bd -literal -offset indent
42 \&.Sh Macro lines change control state.
43 Other lines are interpreted within the current state.
44 .Ed
45 .Sh LANGUAGE SYNTAX
46 .Nm
47 documents may contain only graphable 7-bit ASCII characters, the space
48 character, and, in certain circumstances, the tab character. All
49 manuals must have
50 .Ux
51 line terminators.
52 .Ss Comments
53 Text following a
54 .Sq \e" ,
55 whether in a macro or free-form text line, is ignored to the end of
56 line. A macro line with only a control character and comment escape,
57 .Sq \&.\e" ,
58 is also ignored. Macro lines with only a control character and optionally
59 whitespace are stripped from input.
60 .Ss Reserved Characters
61 Within a macro line, the following characters are reserved:
62 .Pp
63 .Bl -tag -width Ds -offset indent -compact
64 .It \&.
65 .Pq period
66 .It \&,
67 .Pq comma
68 .It \&:
69 .Pq colon
70 .It \&;
71 .Pq semicolon
72 .It \&(
73 .Pq left-parenthesis
74 .It \&)
75 .Pq right-parenthesis
76 .It \&[
77 .Pq left-bracket
78 .It \&]
79 .Pq right-bracket
80 .It \&?
81 .Pq question
82 .It \&!
83 .Pq exclamation
84 .It \&|
85 .Pq vertical bar
86 .El
87 .Pp
88 Use of reserved characters is described in
89 .Sx MACRO SYNTAX .
90 For general use in macro lines, these characters must either be escaped
91 with a non-breaking space
92 .Pq Sq \e&
93 or, if applicable, an appropriate escape sequence used.
94 .Ss Special Characters
95 Special characters may occur in both macro and free-form lines.
96 Sequences begin with the escape character
97 .Sq \e
98 followed by either an open-parenthesis
99 .Sq \&(
100 for two-character sequences; an open-bracket
101 .Sq \&[
102 for n-character sequences (terminated at a close-bracket
103 .Sq \&] ) ;
104 or a single one-character sequence.
105 See
106 .Xr mandoc_char 7
107 for a complete list.
108 Examples include
109 .Sq \e(em
110 .Pq em-dash
111 and
112 .Sq \ee
113 .Pq back-slash .
114 .Ss Text Decoration
115 Terms may be text-decorated using the
116 .Sq \ef
117 escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
118 (revert to previous mode):
119 .Pp
120 .D1 \efBbold\efR \efIitalic\efP
121 .Pp
122 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
123 respectively) may be used instead.
124 A text decoration is valid within
125 the current font scope only: if a macro opens a font scope alongside
126 its own scope, such as
127 .Sx \&Bf
128 .Cm \&Sy ,
129 in-scope invocations of
130 .Sq \ef
131 are only valid within the font scope of the macro.
132 If
133 .Sq \ef
134 is specified outside of any font scope, such as in unenclosed, free-form
135 text, it will affect the remainder of the document.
136 .Pp
137 Text may also be sized with the
138 .Sq \es
139 escape, whose syntax is one of
140 .Sq \es+-n
141 for one-digit numerals;
142 .Sq \es(+-nn
143 or
144 .Sq \es+-(nn
145 for two-digit numerals; and
146 .Sq \es[+-N] ,
147 .Sq \es+-[N] ,
148 .Sq \es'+-N' ,
149 or
150 .Sq \es+-'N'
151 for arbitrary-digit numerals:
152 .Pp
153 .D1 \es+1bigger\es-1
154 .D1 \es[+10]much bigger\es[-10]
155 .D1 \es+(10much bigger\es-(10
156 .D1 \es+'100'much much bigger\es-'100'
157 .Pp
158 Note these forms are
159 .Em not
160 recommended for
161 .Nm ,
162 which encourages semantic annotation.
163 .Ss Predefined Strings
164 Historically,
165 .Xr groff 1
166 also defined a set of package-specific
167 .Dq predefined strings ,
168 which, like
169 .Sx Special Characters ,
170 mark special output characters and strings by way of input codes.
171 Predefined strings are escaped with the slash-asterisk,
172 .Sq \e* :
173 single-character
174 .Sq \e*X ,
175 two-character
176 .Sq \e*(XX ,
177 and N-character
178 .Sq \e*[N] .
179 See
180 .Xr mandoc_char 7
181 for a complete list.
182 Examples include
183 .Sq \e*(Am
184 .Pq ampersand
185 and
186 .Sq \e*(Ba
187 .Pq vertical bar .
188 .Ss Whitespace
189 Whitespace consists of the space character.
190 In free-form lines, whitespace is preserved within a line; un-escaped
191 trailing spaces are stripped from input (unless in a literal context).
192 Blank free-form lines, which may include whitespace, are only permitted
193 within literal contexts.
194 .Pp
195 In macro lines, whitespace delimits arguments and is discarded.
196 If arguments are quoted, whitespace within the quotes is retained.
197 .Ss Quotation
198 Macro arguments may be quoted with a double-quote to group
199 space-delimited terms or to retain blocks of whitespace.
200 A quoted argument begins with a double-quote preceded by whitespace.
201 The next double-quote not pair-wise adjacent to another double-quote
202 terminates the literal, regardless of surrounding whitespace.
203 .Pp
204 This produces tokens
205 .Sq a" ,
206 .Sq b c ,
207 .Sq de ,
208 and
209 .Sq fg" .
210 Note that any quoted term, be it argument or macro, is indiscriminately
211 considered literal text.
212 Thus, the following produces
213 .Sq \&Em a :
214 .Bd -literal -offset indent
215 \&.Em "Em a"
216 .Ed
217 .Pp
218 In free-form mode, quotes are regarded as opaque text.
219 .Ss Dates
220 There are several macros in
221 .Nm
222 that require a date argument.
223 The canonical form for dates is the American format:
224 .Pp
225 .D1 Cm Month Day , Year
226 .Pp
227 The
228 .Cm Day
229 value is an optionally zero-padded numeral.
230 The
231 .Cm Month
232 value is the full month name.
233 The
234 .Cm Year
235 value is the full four-digit year.
236 .Pp
237 Reduced form dates are broken-down canonical form dates:
238 .Pp
239 .D1 Cm Month , Year
240 .D1 Cm Year
241 .Pp
242 Some examples of valid dates follow:
243 .Pp
244 .D1 "May, 2009" Pq reduced form
245 .D1 "2009" Pq reduced form
246 .D1 "May 20, 2009" Pq canonical form
247 .Ss Scaling Widths
248 Many macros support scaled widths for their arguments, such as
249 stipulating a two-inch list indentation with the following:
250 .Bd -literal -offset indent
251 \&.Bl -tag -width 2i
252 .Ed
253 .Pp
254 The syntax for scaled widths is
255 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
256 where a decimal must be preceded or proceeded by at least one digit.
257 Negative numbers, while accepted, are truncated to zero.
258 The following scaling units are accepted:
259 .Pp
260 .Bl -tag -width Ds -offset indent -compact
261 .It c
262 centimetre
263 .It i
264 inch
265 .It P
266 pica (~1/6 inch)
267 .It p
268 point (~1/72 inch)
269 .It f
270 synonym for
271 .Sq u
272 .It v
273 default vertical span
274 .It m
275 width of rendered
276 .Sq m
277 .Pq em
278 character
279 .It n
280 width of rendered
281 .Sq n
282 .Pq en
283 character
284 .It u
285 default horizontal span
286 .It M
287 mini-em (~1/100 em)
288 .El
289 .Pp
290 Using anything other than
291 .Sq m ,
292 .Sq n ,
293 .Sq u ,
294 or
295 .Sq v
296 is necessarily non-portable across output media.
297 See
298 .Sx COMPATIBILITY .
299 .Ss Sentence Spacing
300 When composing a manual, make sure that your sentences end at the end of
301 a line.
302 By doing so, front-ends will be able to apply the proper amount of
303 spacing after the end of sentence (unescaped) period, exclamation mark,
304 or question mark followed by zero or more non-sentence closing
305 delimiters (
306 .Ns Sq \&) ,
307 .Sq \&] ,
308 .Sq \&' ,
309 .Sq \&" ) .
310 .Pp
311 The proper spacing is also intelligently preserved if a sentence ends at
312 the boundary of a macro line, e.g.,
313 .Pp
314 .D1 \&Xr mandoc 1 \.
315 .D1 \&Fl T \&Ns \&Cm ascii \.
316 .Sh MANUAL STRUCTURE
317 A well-formed
318 .Nm
319 document consists of a document prologue followed by one or more
320 sections.
321 .Pp
322 The prologue, which consists of (in order) the
323 .Sx \&Dd ,
324 .Sx \&Dt ,
325 and
326 .Sx \&Os
327 macros, is required for every document.
328 .Pp
329 The first section (sections are denoted by
330 .Sx \&Sh )
331 must be the NAME section, consisting of at least one
332 .Sx \&Nm
333 followed by
334 .Sx \&Nd .
335 .Pp
336 Following that, convention dictates specifying at least the
337 .Em SYNOPSIS
338 and
339 .Em DESCRIPTION
340 sections, although this varies between manual sections.
341 .Pp
342 The following is a well-formed skeleton
343 .Nm
344 file:
345 .Bd -literal -offset indent
346 \&.Dd $\&Mdocdate$
347 \&.Dt mdoc 7
348 \&.Os
349 \&.Sh NAME
350 \&.Nm foo
351 \&.Nd a description goes here
352 \&.\e\*q The next is for sections 2, 3, & 9 only.
353 \&.\e\*q .Sh LIBRARY
354 \&.Sh SYNOPSIS
355 \&.Nm foo
356 \&.Op Fl options
357 \&.Ar
358 \&.Sh DESCRIPTION
359 The
360 \&.Nm
361 utility processes files ...
362 \&.\e\*q .Sh IMPLEMENTATION NOTES
363 \&.\e\*q The next is for sections 2, 3, & 9 only.
364 \&.\e\*q .Sh RETURN VALUES
365 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
366 \&.\e\*q .Sh ENVIRONMENT
367 \&.\e\*q .Sh FILES
368 \&.\e\*q The next is for sections 1 & 8 only.
369 \&.\e\*q .Sh EXIT STATUS
370 \&.\e\*q .Sh EXAMPLES
371 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
372 \&.\e\*q .Sh DIAGNOSTICS
373 \&.\e\*q The next is for sections 2, 3, & 9 only.
374 \&.\e\*q .Sh ERRORS
375 \&.\e\*q .Sh SEE ALSO
376 \&.\e\*q .Xr foobar 1
377 \&.\e\*q .Sh STANDARDS
378 \&.\e\*q .Sh HISTORY
379 \&.\e\*q .Sh AUTHORS
380 \&.\e\*q .Sh CAVEATS
381 \&.\e\*q .Sh BUGS
382 \&.\e\*q .Sh SECURITY CONSIDERATIONS
383 .Ed
384 .Pp
385 The sections in a
386 .Nm
387 document are conventionally ordered as they appear above.
388 Sections should be composed as follows:
389 .Bl -ohang -offset Ds
390 .It Em NAME
391 The name(s) and a short description of the documented material.
392 The syntax for this as follows:
393 .Bd -literal -offset indent
394 \&.Nm name0
395 \&.Nm name1
396 \&.Nm name2
397 \&.Nd a short description
398 .Ed
399 .Pp
400 The
401 .Sx \&Nm
402 macro(s) must precede the
403 .Sx \&Nd
404 macro.
405 .Pp
406 See
407 .Sx \&Nm
408 and
409 .Sx \&Nd .
410 .It Em LIBRARY
411 The name of the library containing the documented material, which is
412 assumed to be a function in a section 2, 3, or 9 manual.
413 The syntax for this is as follows:
414 .Bd -literal -offset indent
415 \&.Lb libarm
416 .Ed
417 .Pp
418 See
419 .Sx \&Lb .
420 .It Em SYNOPSIS
421 Documents the utility invocation syntax, function call syntax, or device
422 configuration.
423 .Pp
424 For the first, utilities (sections 1, 6, and 8), this is
425 generally structured as follows:
426 .Bd -literal -offset indent
427 \&.Nm foo
428 \&.Op Fl v
429 \&.Op Fl o Ar file
430 \&.Op Ar
431 \&.Nm bar
432 \&.Op Fl v
433 \&.Op Fl o Ar file
434 \&.Op Ar
435 .Ed
436 .Pp
437 For the second, function calls (sections 2, 3, 9):
438 .Bd -literal -offset indent
439 \&.Vt extern const char *global;
440 \&.In header.h
441 \&.Ft "char *"
442 \&.Fn foo "const char *src"
443 \&.Ft "char *"
444 \&.Fn bar "const char *src"
445 .Ed
446 .Pp
447 And for the third, configurations (section 4):
448 .Bd -literal -offset indent
449 \&.Cd \*qit* at isa? port 0x2e\*q
450 \&.Cd \*qit* at isa? port 0x4e\*q
451 .Ed
452 .Pp
453 Manuals not in these sections generally don't need a
454 .Em SYNOPSIS .
455 .Pp
456 Some macros are displayed differently in the
457 .Em SYNOPSIS
458 section, particularly
459 .Sx \&Nm ,
460 .Sx \&Cd ,
461 .Sx \&Fd ,
462 .Sx \&Fn ,
463 .Sx \&Fo ,
464 .Sx \&In ,
465 .Sx \&Vt ,
466 and
467 .Sx \&Ft .
468 All of these macros are output on their own line. If two such
469 dissimilar macros are pair-wise invoked (except for
470 .Sx \&Ft
471 before
472 .Sx \&Fo
473 or
474 .Sx \&Fn ) ,
475 they are separated by a vertical space, unless in the case of
476 .Sx \&Fo ,
477 .Sx \&Fn ,
478 and
479 .Sx \&Ft ,
480 which are always separated by vertical space.
481 .It Em DESCRIPTION
482 This expands upon the brief, one-line description in
483 .Em NAME .
484 It usually contains a break-down of the options (if documenting a
485 command), such as:
486 .Bd -literal -offset indent
487 The arguments are as follows:
488 \&.Bl \-tag \-width Ds
489 \&.It Fl v
490 Print verbose information.
491 \&.El
492 .Ed
493 .Pp
494 Manuals not documenting a command won't include the above fragment.
495 .It Em IMPLEMENTATION NOTES
496 Implementation-specific notes should be kept here.
497 This is useful when implementing standard functions that may have side
498 effects or notable algorithmic implications.
499 .It Em RETURN VALUES
500 This section is the dual of
501 .Em EXIT STATUS ,
502 which is used for commands.
503 It documents the return values of functions in sections 2, 3, and 9.
504 .Pp
505 See
506 .Sx \&Rv .
507 .It Em ENVIRONMENT
508 Documents any usages of environment variables, e.g.,
509 .Xr environ 7 .
510 .Pp
511 See
512 .Sx \&Ev .
513 .It Em FILES
514 Documents files used.
515 It's helpful to document both the file and a short description of how
516 the file is used (created, modified, etc.).
517 .Pp
518 See
519 .Sx \&Pa .
520 .It Em EXIT STATUS
521 Command exit status for section 1, 6, and 8 manuals.
522 This section is the dual of
523 .Em RETURN VALUES ,
524 which is used for functions.
525 Historically, this information was described in
526 .Em DIAGNOSTICS ,
527 a practise that is now discouraged.
528 .Pp
529 See
530 .Sx \&Ex .
531 .It Em EXAMPLES
532 Example usages.
533 This often contains snippets of well-formed, well-tested invocations.
534 Make doubly sure that your examples work properly!
535 .It Em DIAGNOSTICS
536 Documents error conditions.
537 This is most useful in section 4 manuals.
538 Historically, this section was used in place of
539 .Em EXIT STATUS
540 for manuals in sections 1, 6, and 8; however, this practise is
541 discouraged.
542 .Pp
543 See
544 .Sx \&Bl
545 .Fl diag .
546 .It Em ERRORS
547 Documents error handling in sections 2, 3, and 9.
548 .Pp
549 See
550 .Sx \&Er .
551 .It Em SEE ALSO
552 References other manuals with related topics.
553 This section should exist for most manuals.
554 Cross-references should conventionally be ordered first by section, then
555 alphabetically.
556 .Pp
557 See
558 .Sx \&Xr .
559 .It Em STANDARDS
560 References any standards implemented or used.
561 If not adhering to any standards, the
562 .Em HISTORY
563 section should be used instead.
564 .Pp
565 See
566 .Sx \&St .
567 .It Em HISTORY
568 The history of any manual without a
569 .Em STANDARDS
570 section should be described in this section.
571 .It Em AUTHORS
572 Credits to authors, if applicable, should appear in this section.
573 Authors should generally be noted by both name and an e-mail address.
574 .Pp
575 See
576 .Sx \&An .
577 .It Em CAVEATS
578 Explanations of common misuses and misunderstandings should be explained
579 in this section.
580 .It Em BUGS
581 Extant bugs should be described in this section.
582 .It Em SECURITY CONSIDERATIONS
583 Documents any security precautions that operators should consider.
584 .El
585 .Sh MACRO SYNTAX
586 Macros are one to three three characters in length and begin with a
587 control character ,
588 .Sq \&. ,
589 at the beginning of the line.
590 An arbitrary amount of whitespace may sit between the control character
591 and the macro name.
592 Thus, the following are equivalent:
593 .Bd -literal -offset indent
594 \&.Pp
595 \&.\ \ \ \&Pp
596 .Ed
597 .Pp
598 The syntax of a macro depends on its classification.
599 In this section,
600 .Sq \-arg
601 refers to macro arguments, which may be followed by zero or more
602 .Sq parm
603 parameters;
604 .Sq \&Yo
605 opens the scope of a macro; and if specified,
606 .Sq \&Yc
607 closes it out.
608 .Pp
609 The
610 .Em Callable
611 column indicates that the macro may be called subsequent to the initial
612 line-macro.
613 If a macro is not callable, then its invocation after the initial line
614 macro is interpreted as opaque text, such that
615 .Sq \&.Fl \&Sh
616 produces
617 .Sq Fl \&Sh .
618 .Pp
619 The
620 .Em Parsable
621 column indicates whether the macro may be followed by further
622 (ostensibly callable) macros.
623 If a macro is not parsable, subsequent macro invocations on the line
624 will be interpreted as opaque text.
625 .Pp
626 The
627 .Em Scope
628 column, if applicable, describes closure rules.
629 .Ss Block full-explicit
630 Multi-line scope closed by an explicit closing macro.
631 All macros contains bodies; only
632 .Sx \&Bf
633 contains a head.
634 .Bd -literal -offset indent
635 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
636 \(lBbody...\(rB
637 \&.Yc
638 .Ed
639 .Pp
640 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
641 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
642 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
643 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
644 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
645 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
646 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
647 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
648 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
649 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
650 .El
651 .Ss Block full-implicit
652 Multi-line scope closed by end-of-file or implicitly by another macro.
653 All macros have bodies; some
654 .Po
655 .Sx \&It Fl bullet ,
656 .Fl hyphen ,
657 .Fl dash ,
658 .Fl enum ,
659 .Fl item
660 .Pc
661 don't have heads; only one
662 .Po
663 .Sx \&It Fl column
664 .Pc
665 has multiple heads.
666 .Bd -literal -offset indent
667 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
668 \(lBbody...\(rB
669 .Ed
670 .Pp
671 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
672 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
673 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
674 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
675 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
676 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
677 .El
678 .Ss Block partial-explicit
679 Like block full-explicit, but also with single-line scope.
680 Each has at least a body and, in limited circumstances, a head
681 .Po
682 .Sx \&Fo ,
683 .Sx \&Eo
684 .Pc
685 and/or tail
686 .Pq Sx \&Ec .
687 .Bd -literal -offset indent
688 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
689 \(lBbody...\(rB
690 \&.Yc \(lBtail...\(rB
691
692 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
693 \(lBbody...\(rB \&Yc \(lBtail...\(rB
694 .Ed
695 .Pp
696 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
697 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
698 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
699 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
700 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
701 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
702 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
703 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
704 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
705 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
706 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
707 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
708 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
709 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
710 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
711 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
712 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
713 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
714 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
715 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
716 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
717 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
718 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
719 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
720 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
721 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
722 .El
723 .Ss Block partial-implicit
724 Like block full-implicit, but with single-line scope closed by
725 .Sx Reserved Characters
726 or end of line.
727 .Bd -literal -offset indent
728 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
729 .Ed
730 .Pp
731 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
732 .It Em Macro Ta Em Callable Ta Em Parsable
733 .It Sx \&Aq Ta Yes Ta Yes
734 .It Sx \&Bq Ta Yes Ta Yes
735 .It Sx \&Brq Ta Yes Ta Yes
736 .It Sx \&D1 Ta \&No Ta \&Yes
737 .It Sx \&Dl Ta \&No Ta Yes
738 .It Sx \&Dq Ta Yes Ta Yes
739 .It Sx \&Op Ta Yes Ta Yes
740 .It Sx \&Pq Ta Yes Ta Yes
741 .It Sx \&Ql Ta Yes Ta Yes
742 .It Sx \&Qq Ta Yes Ta Yes
743 .It Sx \&Sq Ta Yes Ta Yes
744 .It Sx \&Vt Ta Yes Ta Yes
745 .El
746 .Pp
747 Note that the
748 .Sx \&Vt
749 macro is a
750 .Sx Block partial-implicit
751 only when invoked as the first macro
752 in a
753 .Em SYNOPSIS
754 section line, else it is
755 .Sx In-line .
756 .Ss In-line
757 Closed by
758 .Sx Reserved Characters ,
759 end of line, fixed argument lengths, and/or subsequent macros.
760 In-line macros have only text children.
761 If a number (or inequality) of arguments is
762 .Pq n ,
763 then the macro accepts an arbitrary number of arguments.
764 .Bd -literal -offset indent
765 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
766
767 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
768
769 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
770 .Ed
771 .Pp
772 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
773 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
774 .It Sx \&%A Ta \&No Ta \&No Ta >0
775 .It Sx \&%B Ta \&No Ta \&No Ta >0
776 .It Sx \&%C Ta \&No Ta \&No Ta >0
777 .It Sx \&%D Ta \&No Ta \&No Ta >0
778 .It Sx \&%I Ta \&No Ta \&No Ta >0
779 .It Sx \&%J Ta \&No Ta \&No Ta >0
780 .It Sx \&%N Ta \&No Ta \&No Ta >0
781 .It Sx \&%O Ta \&No Ta \&No Ta >0
782 .It Sx \&%P Ta \&No Ta \&No Ta >0
783 .It Sx \&%Q Ta \&No Ta \&No Ta >0
784 .It Sx \&%R Ta \&No Ta \&No Ta >0
785 .It Sx \&%T Ta \&No Ta \&No Ta >0
786 .It Sx \&%U Ta \&No Ta \&No Ta >0
787 .It Sx \&%V Ta \&No Ta \&No Ta >0
788 .It Sx \&Ad Ta Yes Ta Yes Ta n
789 .It Sx \&An Ta Yes Ta Yes Ta n
790 .It Sx \&Ap Ta Yes Ta Yes Ta 0
791 .It Sx \&Ar Ta Yes Ta Yes Ta n
792 .It Sx \&At Ta Yes Ta Yes Ta 1
793 .It Sx \&Bsx Ta Yes Ta Yes Ta n
794 .It Sx \&Bt Ta \&No Ta \&No Ta 0
795 .It Sx \&Bx Ta Yes Ta Yes Ta n
796 .It Sx \&Cd Ta Yes Ta Yes Ta >0
797 .It Sx \&Cm Ta Yes Ta Yes Ta n
798 .It Sx \&Db Ta \&No Ta \&No Ta 1
799 .It Sx \&Dd Ta \&No Ta \&No Ta >0
800 .It Sx \&Dt Ta \&No Ta \&No Ta n
801 .It Sx \&Dv Ta Yes Ta Yes Ta n
802 .It Sx \&Dx Ta Yes Ta Yes Ta n
803 .It Sx \&Em Ta Yes Ta Yes Ta >0
804 .It Sx \&En Ta \&No Ta \&No Ta 0
805 .It Sx \&Er Ta Yes Ta Yes Ta >0
806 .It Sx \&Es Ta \&No Ta \&No Ta 0
807 .It Sx \&Ev Ta Yes Ta Yes Ta n
808 .It Sx \&Ex Ta \&No Ta \&No Ta n
809 .It Sx \&Fa Ta Yes Ta Yes Ta n
810 .It Sx \&Fd Ta \&No Ta \&No Ta >0
811 .It Sx \&Fl Ta Yes Ta Yes Ta n
812 .It Sx \&Fn Ta Yes Ta Yes Ta >0
813 .It Sx \&Fr Ta \&No Ta \&No Ta n
814 .It Sx \&Ft Ta Yes Ta Yes Ta n
815 .It Sx \&Fx Ta Yes Ta Yes Ta n
816 .It Sx \&Hf Ta \&No Ta \&No Ta n
817 .It Sx \&Ic Ta Yes Ta Yes Ta >0
818 .It Sx \&In Ta \&No Ta \&No Ta n
819 .It Sx \&Lb Ta \&No Ta \&No Ta 1
820 .It Sx \&Li Ta Yes Ta Yes Ta n
821 .It Sx \&Lk Ta Yes Ta Yes Ta n
822 .It Sx \&Lp Ta \&No Ta \&No Ta 0
823 .It Sx \&Ms Ta Yes Ta Yes Ta >0
824 .It Sx \&Mt Ta Yes Ta Yes Ta >0
825 .It Sx \&Nm Ta Yes Ta Yes Ta n
826 .It Sx \&No Ta Yes Ta Yes Ta 0
827 .It Sx \&Ns Ta Yes Ta Yes Ta 0
828 .It Sx \&Nx Ta Yes Ta Yes Ta n
829 .It Sx \&Os Ta \&No Ta \&No Ta n
830 .It Sx \&Ot Ta \&No Ta \&No Ta n
831 .It Sx \&Ox Ta Yes Ta Yes Ta n
832 .It Sx \&Pa Ta Yes Ta Yes Ta n
833 .It Sx \&Pf Ta Yes Ta Yes Ta 1
834 .It Sx \&Pp Ta \&No Ta \&No Ta 0
835 .It Sx \&Rv Ta \&No Ta \&No Ta n
836 .It Sx \&Sm Ta \&No Ta \&No Ta 1
837 .It Sx \&St Ta \&No Ta Yes Ta 1
838 .It Sx \&Sx Ta Yes Ta Yes Ta >0
839 .It Sx \&Sy Ta Yes Ta Yes Ta >0
840 .It Sx \&Tn Ta Yes Ta Yes Ta >0
841 .It Sx \&Ud Ta \&No Ta \&No Ta 0
842 .It Sx \&Ux Ta Yes Ta Yes Ta n
843 .It Sx \&Va Ta Yes Ta Yes Ta n
844 .It Sx \&Vt Ta Yes Ta Yes Ta >0
845 .It Sx \&Xr Ta Yes Ta Yes Ta >0
846 .It Sx \&br Ta \&No Ta \&No Ta 0
847 .It Sx \&sp Ta \&No Ta \&No Ta 1
848 .El
849 .Sh REFERENCE
850 This section is a canonical reference of all macros, arranged
851 alphabetically.
852 For the scoping of individual macros, see
853 .Sx MACRO SYNTAX .
854 .Ss \&%A
855 Author name of an
856 .Sx \&Rs
857 block. Multiple authors should each be accorded their own
858 .Sx \%%A
859 line. Author names should be ordered with full or abbreviated
860 forename(s) first, then full surname.
861 .Ss \&%B
862 Book title of an
863 .Sx \&Rs
864 block. This macro may also be used in a non-bibliographic context when
865 referring to book titles.
866 .Ss \&%C
867 Publication city or location of an
868 .Sx \&Rs
869 block.
870 .Pp
871 .Em Remarks :
872 this macro is not implemented in
873 .Xr groff 1 .
874 .Ss \&%D
875 Publication date of an
876 .Sx \&Rs
877 block. This should follow the reduced or canonical form syntax
878 described in
879 .Sx Dates .
880 .Ss \&%I
881 Publisher or issuer name of an
882 .Sx \&Rs
883 block.
884 .Ss \&%J
885 Journal name of an
886 .Sx \&Rs
887 block.
888 .Ss \&%N
889 Issue number (usually for journals) of an
890 .Sx \&Rs
891 block.
892 .Ss \&%O
893 Optional information of an
894 .Sx \&Rs
895 block.
896 .Ss \&%P
897 Book or journal page number of an
898 .Sx \&Rs
899 block.
900 .Ss \&%Q
901 Institutional author (school, government, etc.) of an
902 .Sx \&Rs
903 block. Multiple institutional authors should each be accorded their own
904 .Sx \&%Q
905 line.
906 .Ss \&%R
907 Technical report name of an
908 .Sx \&Rs
909 block.
910 .Ss \&%T
911 Article title of an
912 .Sx \&Rs
913 block. This macro may also be used in a non-bibliographical context
914 when referring to article titles.
915 .Ss \&%U
916 URI of reference document.
917 .Ss \&%V
918 Volume number of an
919 .Sx \&Rs
920 block.
921 .Ss \&Ac
922 Closes an
923 .Sx \&Ao
924 block. Does not have any tail arguments.
925 .Ss \&Ad
926 Address construct: usually in the context of an computational address in
927 memory, not a physical (post) address.
928 .Pp
929 Examples:
930 .D1 \&.Ad [0,$]
931 .D1 \&.Ad 0x00000000
932 .Ss \&An
933 Author name.
934 This macro may alternatively accepts the following arguments, although
935 these may not be specified along with a parameter:
936 .Bl -tag -width 12n -offset indent
937 .It Fl split
938 Renders a line break before each author listing.
939 .It Fl nosplit
940 The opposite of
941 .Fl split .
942 .El
943 .Pp
944 In the AUTHORS section, the default is not to split the first author
945 listing, but all subsequent author listings, whether or not they're
946 interspersed by other macros or text, are split.
947 Thus, specifying
948 .Fl split
949 will cause the first listing also to be split.
950 If not in the AUTHORS section, the default is not to split.
951 .Pp
952 Examples:
953 .D1 \&.An -nosplit
954 .D1 \&.An J. D. Ullman .
955 .Pp
956 .Em Remarks :
957 the effects of
958 .Fl split
959 or
960 .Fl nosplit
961 are re-set when entering the AUTHORS section, so if one specifies
962 .Sx \&An Fl nosplit
963 in the general document body, it must be re-specified in the AUTHORS
964 section.
965 .Ss \&Ao
966 Begins a block enclosed by angled brackets.
967 Does not have any head arguments.
968 .Pp
969 Examples:
970 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
971 .Pp
972 See also
973 .Sx \&Aq .
974 .Ss \&Ap
975 Inserts an apostrophe without any surrounding white-space.
976 This is generally used as a grammatical device when referring to the verb
977 form of a function:
978 .Bd -literal -offset indent
979 \&.Fn execve Ap d
980 .Ed
981 .Ss \&Aq
982 Encloses its arguments in angled brackets.
983 .Pp
984 Examples:
985 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
986 .Pp
987 .Em Remarks :
988 this macro is often abused for rendering URIs, which should instead use
989 .Sx \&Lk
990 or
991 .Sx \&Mt ,
992 or to note pre-processor
993 .Dq Li #include
994 statements, which should use
995 .Sx \&In .
996 .Pp
997 See also
998 .Sx \&Ao .
999 .Ss \&Ar
1000 Command arguments.
1001 If an argument is not provided, the string
1002 .Dq file ...
1003 is used as a default.
1004 .Pp
1005 Examples:
1006 .D1 \&.Fl o \&Ns \&Ar file1
1007 .D1 \&.Ar
1008 .D1 \&.Ar arg1 , arg2 .
1009 .Ss \&At
1010 Formats an AT&T version.
1011 Accepts at most one parameter:
1012 .Bl -tag -width 12n -offset indent
1013 .It Cm v[1-7] | 32v
1014 A version of
1015 .At .
1016 .It Cm V[.[1-4]]?
1017 A system version of
1018 .At .
1019 .El
1020 .Pp
1021 Note that these parameters do not begin with a hyphen.
1022 .Pp
1023 Examples:
1024 .D1 \&.At
1025 .D1 \&.At V.1
1026 .Pp
1027 See also
1028 .Sx \&Bsx ,
1029 .Sx \&Bx ,
1030 .Sx \&Dx ,
1031 .Sx \&Fx ,
1032 .Sx \&Nx ,
1033 .Sx \&Ox ,
1034 and
1035 .Sx \&Ux .
1036 .Ss \&Bc
1037 Closes a
1038 .Sx \&Bo
1039 block. Does not have any tail arguments.
1040 .Ss \&Bd
1041 Begins a display block.
1042 A display is collection of macros or text which may be collectively
1043 offset or justified in a manner different from that
1044 of the enclosing context.
1045 By default, the block is preceded by a vertical space.
1046 .Pp
1047 Each display is associated with a type, which must be one of the
1048 following arguments:
1049 .Bl -tag -width 12n -offset indent
1050 .It Fl ragged
1051 Only left-justify the block.
1052 .It Fl unfilled
1053 Do not justify the block at all.
1054 .It Fl filled
1055 Left- and right-justify the block.
1056 .It Fl literal
1057 Alias for
1058 .Fl unfilled .
1059 .It Fl centered
1060 Centre-justify each line.
1061 .El
1062 .Pp
1063 The type must be provided first.
1064 Secondary arguments are as follows:
1065 .Bl -tag -width 12n -offset indent
1066 .It Fl offset Ar width
1067 Offset by the value of
1068 .Ar width ,
1069 which is interpreted as one of the following, specified in order:
1070 .Bl -item
1071 .It
1072 As one of the pre-defined strings
1073 .Ar indent ,
1074 the width of standard indentation;
1075 .Ar indent-two ,
1076 twice
1077 .Ar indent ;
1078 .Ar left ,
1079 which has no effect ;
1080 .Ar right ,
1081 which justifies to the right margin; and
1082 .Ar center ,
1083 which aligns around an imagined centre axis.
1084 .It
1085 As a precalculated width for a named macro.
1086 The most popular is the imaginary macro
1087 .Ar \&Ds ,
1088 which resolves to
1089 .Ar 6n .
1090 .It
1091 As a scaling unit following the syntax described in
1092 .Sx Scaling Widths .
1093 .It
1094 As the calculated string length of the opaque string.
1095 .El
1096 .Pp
1097 If unset, it will revert to the value of
1098 .Ar 8n
1099 as described in
1100 .Sx Scaling Widths .
1101 .It Fl compact
1102 Do not assert a vertical space before the block.
1103 .It Fl file Ar file
1104 Prepend the file
1105 .Ar file
1106 before any text or macros within the block.
1107 .El
1108 .Pp
1109 Examples:
1110 .Bd -literal -offset indent
1111 \&.Bd \-unfilled \-offset two-indent \-compact
1112 Hello world.
1113 \&.Ed
1114 .Ed
1115 .Pp
1116 See also
1117 .Sx \&D1
1118 and
1119 .Sx \&Dl .
1120 .Ss \&Bf
1121 .Ss \&Bk
1122 .Ss \&Bl
1123 Begins a list composed of one or more list entries.
1124 A list is associated with a type, which is a required argument.
1125 Other arguments are
1126 .Fl width ,
1127 defined per-type as accepting a literal or
1128 .Sx Scaling Widths
1129 value;
1130 .Fl offset ,
1131 also accepting a literal or
1132 .Sx Scaling Widths
1133 value setting the list's global offset; and
1134 .Fl compact ,
1135 suppressing the default vertical space printed before each list entry.
1136 A list entry is specified by the
1137 .Sx \&It
1138 macro, which consists of a head and optional body (depending on the list
1139 type).
1140 A list must specify one of the following list types:
1141 .Bl -tag -width 12n -offset indent
1142 .It Fl bullet
1143 A list offset by a bullet.
1144 The head of list entries must be empty.
1145 List entry bodies are positioned after the bullet.
1146 The
1147 .Fl width
1148 argument varies the width of list bodies' left-margins.
1149 .It Fl column
1150 A columnated list.
1151 The
1152 .Fl width
1153 argument has no effect.
1154 The number of columns is specified as parameters to the
1155 .Sx \&Bl
1156 macro.
1157 These dictate the width of columns either as
1158 .Sx Scaling Widths
1159 or literal text.
1160 If the initial macro of a
1161 .Fl column
1162 list is not an
1163 .Sx \&It ,
1164 an
1165 .Sx \&It
1166 context spanning each line is implied until an
1167 .Sx \&It
1168 line macro is encountered, at which point list bodies are interpreted as
1169 described in the
1170 .Sx \&It
1171 documentation.
1172 .It Fl dash
1173 A list offset by a dash (hyphen).
1174 The head of list entries must be empty.
1175 List entry bodies are positioned past the dash.
1176 The
1177 .Fl width
1178 argument varies the width of list bodies' left-margins.
1179 .It Fl diag
1180 Like
1181 .Fl inset ,
1182 but with additional formatting to the head.
1183 The
1184 .Fl width
1185 argument varies the width of list bodies' left-margins.
1186 .It Fl enum
1187 An enumerated list offset by the enumeration from 1.
1188 The head of list entries must be empty.
1189 List entry bodies are positioned after the enumeration.
1190 The
1191 .Fl width
1192 argument varies the width of list bodies' left-margins.
1193 .It Fl hang
1194 Like
1195 .Fl tag ,
1196 but instead of list bodies positioned after the head, they trail the
1197 head text.
1198 The
1199 .Fl width
1200 argument varies the width of list bodies' left-margins.
1201 .It Fl hyphen
1202 Synonym for
1203 .Fl dash .
1204 .It Fl inset
1205 List bodies follow the list head.
1206 The
1207 .Fl width
1208 argument is ignored.
1209 .It Fl item
1210 This produces blocks of text.
1211 The head of list entries must be empty.
1212 The
1213 .Fl width
1214 argument is ignored.
1215 .It Fl ohang
1216 List bodies are positioned on the line following the head.
1217 The
1218 .Fl width
1219 argument is ignored.
1220 .It Fl tag
1221 A list offset by list entry heads. List entry bodies are positioned
1222 after the head as specified by the
1223 .Fl width
1224 argument.
1225 .El
1226 .Pp
1227 See also
1228 .Sx \&It .
1229 .Ss \&Bo
1230 Begins a block enclosed by square brackets.
1231 Does not have any head arguments.
1232 .Pp
1233 Examples:
1234 .Bd -literal -offset indent
1235 \&.Bo 1 ,
1236 \&.Dv BUFSIZ \&Bc
1237 .Ed
1238 .Pp
1239 See also
1240 .Sx \&Bq .
1241 .Ss \&Bq
1242 Encloses its arguments in square brackets.
1243 .Pp
1244 Examples:
1245 .D1 \&.Bq 1 , \&Dv BUFSIZ
1246 .Pp
1247 .Em Remarks :
1248 this macro is sometimes abused to emulate optional arguments for
1249 commands; the correct macros to use for this purpose are
1250 .Sx \&Op ,
1251 .Sx \&Oo ,
1252 and
1253 .Sx \&Oc .
1254 .Pp
1255 See also
1256 .Sx \&Bo .
1257 .Ss \&Brc
1258 Closes a
1259 .Sx \&Bro
1260 block. Does not have any tail arguments.
1261 .Ss \&Bro
1262 Begins a block enclosed by curly braces.
1263 Does not have any head arguments.
1264 .Pp
1265 Examples:
1266 .Bd -literal -offset indent
1267 \&.Bro 1 , ... ,
1268 \&.Va n \&Brc
1269 .Ed
1270 .Pp
1271 See also
1272 .Sx \&Brq .
1273 .Ss \&Brq
1274 Encloses its arguments in curly braces.
1275 .Pp
1276 Examples:
1277 .D1 \&.Brq 1 , ... , \&Va n
1278 .Pp
1279 See also
1280 .Sx \&Bro .
1281 .Ss \&Bsx
1282 Format the BSD/OS version provided as an argument, or a default value if
1283 no argument is provided.
1284 .Pp
1285 Examples:
1286 .D1 \&.Bsx 1.0
1287 .D1 \&.Bsx
1288 .Pp
1289 See also
1290 .Sx \&At ,
1291 .Sx \&Bx ,
1292 .Sx \&Dx ,
1293 .Sx \&Fx ,
1294 .Sx \&Nx ,
1295 .Sx \&Ox ,
1296 and
1297 .Sx \&Ux .
1298 .Ss \&Bt
1299 Prints
1300 .Dq is currently in beta test.
1301 .Ss \&Bx
1302 Format the BSD version provided as an argument, or a default value if no
1303 argument is provided.
1304 .Pp
1305 Examples:
1306 .D1 \&.Bx 4.4
1307 .D1 \&.Bx
1308 .Pp
1309 See also
1310 .Sx \&At ,
1311 .Sx \&Bsx ,
1312 .Sx \&Dx ,
1313 .Sx \&Fx ,
1314 .Sx \&Nx ,
1315 .Sx \&Ox ,
1316 and
1317 .Sx \&Ux .
1318 .Ss \&Cd
1319 Configuration declaration.
1320 This denotes strings accepted by
1321 .Xr config 8 .
1322 .Pp
1323 Examples:
1324 .D1 \&.Cd device le0 at scode?
1325 .Pp
1326 .Em Remarks :
1327 this macro is commonly abused by using quoted literals to retain
1328 white-space and align consecutive
1329 .Sx \&Cd
1330 declarations.
1331 This practise is discouraged.
1332 .Ss \&Cm
1333 Command modifiers.
1334 Useful when specifying configuration options or keys.
1335 .Pp
1336 Examples:
1337 .D1 \&.Cm ControlPath
1338 .D1 \&.Cm ControlMaster
1339 .Pp
1340 See also
1341 .Sx \&Fl .
1342 .Ss \&D1
1343 One-line indented display.
1344 This is formatted by the default rules and is useful for simple indented
1345 statements.
1346 It is followed by a newline.
1347 .Pp
1348 Examples:
1349 .D1 \&.D1 \&Fl abcdefgh
1350 .Pp
1351 See also
1352 .Sx \&Bd
1353 and
1354 .Sx \&Dl .
1355 .Ss \&Db
1356 Start a debugging context.
1357 This macro is parsed, but generally ignored.
1358 Its syntax is as follows:
1359 .Pp
1360 .D1 Pf \. Sx \&Db Cm on | off
1361 .Ss \&Dc
1362 Closes a
1363 .Sx \&Do
1364 block. Does not have any tail arguments.
1365 .Ss \&Dd
1366 Document date.
1367 This is the mandatory first macro of any
1368 .Nm
1369 manual.
1370 Its syntax is as follows:
1371 .Pp
1372 .D1 Pf \. Sx \&Dd Cm date
1373 .Pp
1374 The
1375 .Cm date
1376 field may be either
1377 .Ar $\&Mdocdate$ ,
1378 which signifies the current manual revision date dictated by
1379 .Xr cvs 1 ,
1380 or instead a valid canonical date as specified by
1381 .Sx Dates .
1382 If a date does not conform, the current date is used instead.
1383 .Pp
1384 Examples:
1385 .D1 \&.Dd $\&Mdocdate$
1386 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1387 .D1 \&.Dd July 21, 2007
1388 .Pp
1389 See also
1390 .Sx \&Dt
1391 and
1392 .Sx \&Os .
1393 .Ss \&Dl
1394 One-line intended display.
1395 This is formatted as literal text and is useful for commands and
1396 invocations.
1397 It is followed by a newline.
1398 .Pp
1399 Examples:
1400 .D1 \&.Dl % mandoc mdoc.7 | less
1401 .Pp
1402 See also
1403 .Sx \&Bd
1404 and
1405 .Sx \&D1 .
1406 .Ss \&Do
1407 Begins a block enclosed by double quotes. Does not have any head
1408 arguments.
1409 .Pp
1410 Examples:
1411 .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1412 .Pp
1413 See also
1414 .Sx \&Dq .
1415 .Ss \&Dq
1416 Encloses its arguments in double quotes.
1417 .Pp
1418 Examples:
1419 .Bd -literal -offset indent -compact
1420 \&.Dq April is the cruellest month
1421 \e(em T.S. Eliot
1422 .Ed
1423 .Pp
1424 See also
1425 .Sx \&Do .
1426 .Ss \&Dt
1427 Document title.
1428 This is the mandatory second macro of any
1429 .Nm
1430 file.
1431 Its syntax is as follows:
1432 .Bd -ragged -offset indent
1433 .Pf \. Sx \&Dt
1434 .Oo
1435 .Cm title
1436 .Oo
1437 .Cm section
1438 .Op Cm volume | arch
1439 .Oc
1440 .Oc
1441 .Ed
1442 .Pp
1443 Its arguments are as follows:
1444 .Bl -tag -width Ds -offset Ds
1445 .It Cm title
1446 The document's title (name), defaulting to
1447 .Qq UNKNOWN
1448 if unspecified.
1449 It should be capitalised.
1450 .It Cm section
1451 The manual section.
1452 This may be one of
1453 .Ar 1
1454 .Pq utilities ,
1455 .Ar 2
1456 .Pq system calls ,
1457 .Ar 3
1458 .Pq libraries ,
1459 .Ar 3p
1460 .Pq Perl libraries ,
1461 .Ar 4
1462 .Pq devices ,
1463 .Ar 5
1464 .Pq file formats ,
1465 .Ar 6
1466 .Pq games ,
1467 .Ar 7
1468 .Pq miscellaneous ,
1469 .Ar 8
1470 .Pq system utilities ,
1471 .Ar 9
1472 .Pq kernel functions ,
1473 .Ar X11
1474 .Pq X Window System ,
1475 .Ar X11R6
1476 .Pq X Window System ,
1477 .Ar unass
1478 .Pq unassociated ,
1479 .Ar local
1480 .Pq local system ,
1481 .Ar draft
1482 .Pq draft manual ,
1483 or
1484 .Ar paper
1485 .Pq paper .
1486 It should correspond to the manual's filename suffix and defaults to
1487 .Qq 1
1488 if unspecified.
1489 .It Cm volume
1490 This overrides the volume inferred from
1491 .Ar section .
1492 This field is optional, and if specified, must be one of
1493 .Ar USD
1494 .Pq users' supplementary documents ,
1495 .Ar PS1
1496 .Pq programmers' supplementary documents ,
1497 .Ar AMD
1498 .Pq administrators' supplementary documents ,
1499 .Ar SMM
1500 .Pq system managers' manuals ,
1501 .Ar URM
1502 .Pq users' reference manuals ,
1503 .Ar PRM
1504 .Pq programmers' reference manuals ,
1505 .Ar KM
1506 .Pq kernel manuals ,
1507 .Ar IND
1508 .Pq master index ,
1509 .Ar MMI
1510 .Pq master index ,
1511 .Ar LOCAL
1512 .Pq local manuals ,
1513 .Ar LOC
1514 .Pq local manuals ,
1515 or
1516 .Ar CON
1517 .Pq contributed manuals .
1518 .It Cm arch
1519 This specifies a specific relevant architecture.
1520 If
1521 .Cm volume
1522 is not provided, it may be used in its place, else it may be used
1523 subsequent that.
1524 It, too, is optional.
1525 It must be one of
1526 .Ar alpha ,
1527 .Ar amd64 ,
1528 .Ar amiga ,
1529 .Ar arc ,
1530 .Ar arm ,
1531 .Ar armish ,
1532 .Ar aviion ,
1533 .Ar hp300 ,
1534 .Ar hppa ,
1535 .Ar hppa64 ,
1536 .Ar i386 ,
1537 .Ar landisk ,
1538 .Ar loongson ,
1539 .Ar luna88k ,
1540 .Ar mac68k ,
1541 .Ar macppc ,
1542 .Ar mvme68k ,
1543 .Ar mvme88k ,
1544 .Ar mvmeppc ,
1545 .Ar pmax ,
1546 .Ar sgi ,
1547 .Ar socppc ,
1548 .Ar sparc ,
1549 .Ar sparc64 ,
1550 .Ar sun3 ,
1551 .Ar vax ,
1552 or
1553 .Ar zaurus .
1554 .El
1555 .Pp
1556 Examples:
1557 .D1 \&.Dt FOO 1
1558 .D1 \&.Dt FOO 4 KM
1559 .D1 \&.Dt FOO 9 i386
1560 .Pp
1561 See also
1562 .Sx \&Dd
1563 and
1564 .Sx \&Os .
1565 .Ss \&Dv
1566 Defined variables such as preprocessor constants.
1567 .Pp
1568 Examples:
1569 .D1 \&.Dv BUFSIZ
1570 .D1 \&.Dv STDOUT_FILENO
1571 .Pp
1572 See also
1573 .Sx \&Er .
1574 .Ss \&Dx
1575 Format the DragonFly BSD version provided as an argument, or a default
1576 value if no argument is provided.
1577 .Pp
1578 Examples:
1579 .D1 \&.Dx 2.4.1
1580 .D1 \&.Dx
1581 .Pp
1582 See also
1583 .Sx \&At ,
1584 .Sx \&Bsx ,
1585 .Sx \&Bx ,
1586 .Sx \&Fx ,
1587 .Sx \&Nx ,
1588 .Sx \&Ox ,
1589 and
1590 .Sx \&Ux .
1591 .Ss \&Ec
1592 .Ss \&Ed
1593 .Ss \&Ef
1594 .Ss \&Ek
1595 .Ss \&El
1596 Ends a list context started by
1597 .Sx \&Bl .
1598 .Pp
1599 See also
1600 .Sx \&Bl
1601 and
1602 .Sx \&It .
1603 .Ss \&Em
1604 Denotes text that should be emphasised.
1605 Note that this is a presentation term and should not be used for
1606 stylistically decorating technical terms.
1607 .Pp
1608 Examples:
1609 .D1 \&.Em Warnings!
1610 .D1 \&.Em Remarks :
1611 .Ss \&En
1612 .Ss \&Eo
1613 .Ss \&Er
1614 Display error constants.
1615 .Pp
1616 Examples:
1617 .D1 \&.Er EPERM
1618 .D1 \&.Er ENOENT
1619 .Pp
1620 See also
1621 .Sx \&Dv .
1622 .Ss \&Es
1623 .Ss \&Ev
1624 Environmental variables such as those specified in
1625 .Xr environ 7 .
1626 .Pp
1627 Examples:
1628 .D1 \&.Ev DISPLAY
1629 .D1 \&.Ev PATH
1630 .Ss \&Ex
1631 Inserts text regarding a utility's exit values.
1632 This macro must have first the
1633 .Fl std
1634 argument specified, then an optional
1635 .Ar utility .
1636 If
1637 .Ar utility
1638 is not provided, the document's name as stipulated in
1639 .Sx \&Nm
1640 is provided.
1641 .Ss \&Fa
1642 Function argument.
1643 Its syntax is as follows:
1644 .Bd -ragged -offset indent
1645 .Pf \. Sx \&Fa
1646 .Op Cm argtype
1647 .Cm argname
1648 .Ed
1649 .Pp
1650 This may be invoked for names with or without the corresponding type.
1651 It is also used to specify the field name of a structure.
1652 Most often, the
1653 .Sx \&Fa
1654 macro is used in the
1655 .Em SYNOPSIS
1656 within
1657 .Sx \&Fo
1658 section when documenting multi-line function prototypes.
1659 If invoked with multiple arguments, the arguments are separated by a
1660 comma.
1661 Furthermore, if the following macro is another
1662 .Sx \&Fa ,
1663 the last argument will also have a trailing comma.
1664 .Pp
1665 Examples:
1666 .D1 \&.Fa \(dqconst char *p\(dq
1667 .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1668 .D1 \&.Fa foo
1669 .Pp
1670 See also
1671 .Sx \&Fo .
1672 .Ss \&Fc
1673 .Ss \&Fd
1674 Historically used to document include files.
1675 This usage has been deprecated in favour of
1676 .Sx \&In .
1677 Do not use this macro.
1678 .Pp
1679 See also
1680 .Sx MANUAL STRUCTURE
1681 and
1682 .Sx \&In .
1683 .Ss \&Fl
1684 Command-line flag.
1685 Used when listing arguments to command-line utilities.
1686 Prints a fixed-width hyphen
1687 .Sq \-
1688 directly followed by each argument.
1689 If no arguments are provided, a hyphen is printed followed by a space.
1690 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1691 output.
1692 .Pp
1693 Examples:
1694 .D1 \&.Fl a b c
1695 .D1 \&.Fl \&Pf a b
1696 .D1 \&.Fl
1697 .D1 \&.Op \&Fl o \&Ns \&Ar file
1698 .Pp
1699 See also
1700 .Sx \&Cm .
1701 .Ss \&Fn
1702 A function name.
1703 Its syntax is as follows:
1704 .Bd -ragged -offset indent
1705 .Pf \. Ns Sx \&Fn
1706 .Op Cm functype
1707 .Cm funcname
1708 .Op Oo Cm argtype Oc Cm argname
1709 .Ed
1710 .Pp
1711 Function arguments are surrounded in parenthesis and
1712 are delimited by commas.
1713 If no arguments are specified, blank parenthesis are output.
1714 .Pp
1715 Examples:
1716 .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1717 .D1 \&.Fn funcname "int arg0"
1718 .D1 \&.Fn funcname arg0
1719 .Bd -literal -offset indent -compact
1720 \&.Ft functype
1721 \&.Fn funcname
1722 .Ed
1723 .Pp
1724 See also
1725 .Sx MANUAL STRUCTURE
1726 and
1727 .Sx \&Ft .
1728 .Ss \&Fo
1729 Begin a function block.
1730 This is a multi-line version of
1731 .Sx \&Fn .
1732 Its syntax is as follows:
1733 .Pp
1734 .D1 Pf \. Sx \&Fo Cm funcname
1735 .Pp
1736 Invocations usually occur in the following context:
1737 .Bd -ragged -offset indent
1738 .Pf \. Sx \&Ft Cm functype
1739 .br
1740 .Pf \. Sx \&Fo Cm funcname
1741 .br
1742 .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1743 .br
1744 \.\.\.
1745 .br
1746 .Pf \. Sx \&Fc
1747 .Ed
1748 .Pp
1749 A
1750 .Sx \&Fo
1751 scope is closed by
1752 .Pp
1753 See also
1754 .Sx MANUAL STRUCTURE ,
1755 .Sx \&Fa ,
1756 .Sx \&Fc ,
1757 and
1758 .Ss \&Ft
1759 A function type.
1760 Its syntax is as follows:
1761 .Pp
1762 .D1 Pf \. Sx \&Ft Cm functype
1763 .Pp
1764 Examples:
1765 .D1 \&.Ft int
1766 .Bd -literal -offset indent -compact
1767 \&.Ft functype
1768 \&.Fn funcname
1769 .Ed
1770 .Pp
1771 See also
1772 .Sx MANUAL STRUCTURE ,
1773 .Sx \&Fn ,
1774 and
1775 .Sx \&Fo .
1776 .Ss \&Fx
1777 Format the FreeBSD version provided as an argument, or a default value
1778 if no argument is provided.
1779 .Pp
1780 Examples:
1781 .D1 \&.Fx 7.1
1782 .D1 \&.Fx
1783 .Pp
1784 See also
1785 .Sx \&At ,
1786 .Sx \&Bsx ,
1787 .Sx \&Bx ,
1788 .Sx \&Dx ,
1789 .Sx \&Nx ,
1790 .Sx \&Ox ,
1791 and
1792 .Sx \&Ux .
1793 .Ss \&Hf
1794 .Ss \&Ic
1795 .Ss \&In
1796 An
1797 .Qq include
1798 file.
1799 In the
1800 .Em SYNOPSIS
1801 section (only if invoked as the line macro), the first argument is
1802 preceded by
1803 .Qq #include ,
1804 the arguments is enclosed in angled braces.
1805 .Pp
1806 Examples:
1807 .D1 \&.In sys/types
1808 .Pp
1809 See also
1810 .Sx MANUAL STRUCTURE .
1811 .Ss \&It
1812 A list item.
1813 The syntax of this macro depends on the list type.
1814 .Pp
1815 Lists
1816 of type
1817 .Fl hang ,
1818 .Fl ohang ,
1819 .Fl inset ,
1820 and
1821 .Fl diag
1822 have the following syntax:
1823 .Pp
1824 .D1 Pf \. Sx \&It Cm args
1825 .Pp
1826 Lists of type
1827 .Fl bullet ,
1828 .Fl dash ,
1829 .Fl enum ,
1830 .Fl hyphen
1831 and
1832 .Fl item
1833 have the following syntax:
1834 .Pp
1835 .D1 Pf \. Sx \&It
1836 .Pp
1837 with subsequent lines interpreted within the scope of the
1838 .Sx \&It
1839 until either a closing
1840 .Sx \&El
1841 or another
1842 .Sx \&It .
1843 .Pp
1844 The
1845 .Fl tag
1846 list has the following syntax:
1847 .Pp
1848 .D1 Pf \. Sx \&It Op Cm args
1849 .Pp
1850 Subsequent lines are interpreted as with
1851 .Fl bullet
1852 and family.
1853 The line arguments correspond to the list's left-hand side; body
1854 arguments correspond to the list's contents.
1855 .Pp
1856 The
1857 .Fl column
1858 list is the most complicated.
1859 Its syntax is as follows:
1860 .Pp
1861 .D1 Pf \. Sx \&It Op Cm args
1862 .Pp
1863 The
1864 .Cm args
1865 are phrases, a mix of macros and text corresponding to a line column,
1866 delimited by tabs or the special
1867 .Sq \&Ta
1868 pseudo-macro.
1869 Lines subsequent the
1870 .Sx \&It
1871 are interpreted within the scope of the last phrase.
1872 Calling the pseudo-macro
1873 .Sq \&Ta
1874 will open a new phrase scope (this must occur on a macro line to be
1875 interpreted as a macro). Note that the tab phrase delimiter may only be
1876 used within the
1877 .Sx \&It
1878 line itself.
1879 Subsequent this, only the
1880 .Sq \&Ta
1881 pseudo-macro may be used to delimit phrases.
1882 Furthermore, note that quoted sections propagate over tab-delimited
1883 phrases on an
1884 .Sx \&It ,
1885 for example,
1886 .Pp
1887 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1888 .Pp
1889 will preserve the semicolon whitespace except for the last.
1890 .Pp
1891 See also
1892 .Sx \&Bl .
1893 .Ss \&Lb
1894 Specify a library.
1895 The syntax is as follows:
1896 .Pp
1897 .D1 Pf \. Sx \&Lb Cm library
1898 .Pp
1899 The
1900 .Cm library
1901 parameter may be a system library, such as
1902 .Cm libz
1903 or
1904 .Cm libpam ,
1905 in which case a small library description is printed next to the linker
1906 invocation; or a custom library, in which case the library name is
1907 printed in quotes.
1908 This is most commonly used in the
1909 .Em SYNOPSIS
1910 section as described in
1911 .Sx MANUAL STRUCTURE .
1912 .Pp
1913 Examples:
1914 .D1 \&.Lb libz
1915 .D1 \&.Lb mdoc
1916 .Ss \&Li
1917 .Ss \&Lk
1918 Format a hyperlink.
1919 Its syntax is as follows:
1920 .Pp
1921 .D1 Pf \. Sx \&Lk Cm uri Op Cm name
1922 .Pp
1923 Examples:
1924 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
1925 .D1 \&.Lk http://bsd.lv
1926 .Pp
1927 See also
1928 .Sx \&Mt .
1929 .Ss \&Lp
1930 .Ss \&Ms
1931 .Ss \&Mt
1932 Format a
1933 .Qq mailto:
1934 hyperlink.
1935 Its syntax is as follows:
1936 .Pp
1937 .D1 Pf \. Sx \&Mt Cm address
1938 .Pp
1939 Examples:
1940 .D1 \&.Mt discuss@manpages.bsd.lv
1941 .Ss \&Nd
1942 .Ss \&Nm
1943 .Ss \&No
1944 .Ss \&Ns
1945 .Ss \&Nx
1946 Format the NetBSD version provided as an argument, or a default value if
1947 no argument is provided.
1948 .Pp
1949 Examples:
1950 .D1 \&.Nx 5.01
1951 .D1 \&.Nx
1952 .Pp
1953 See also
1954 .Sx \&At ,
1955 .Sx \&Bsx ,
1956 .Sx \&Bx ,
1957 .Sx \&Dx ,
1958 .Sx \&Fx ,
1959 .Sx \&Ox ,
1960 and
1961 .Sx \&Ux .
1962 .Ss \&Oc
1963 .Ss \&Oo
1964 .Ss \&Op
1965 .Ss \&Os
1966 Document operating system version.
1967 This is the mandatory third macro of
1968 any
1969 .Nm
1970 file.
1971 Its syntax is as follows:
1972 .Pp
1973 .D1 Pf \. Sx \&Os Op Cm system
1974 .Pp
1975 The optional
1976 .Cm system
1977 parameter specifies the relevant operating system or environment.
1978 Left unspecified, it defaults to the local operating system version.
1979 This is the suggested form.
1980 .Pp
1981 Examples:
1982 .D1 \&.Os
1983 .D1 \&.Os KTH/CSC/TCS
1984 .D1 \&.Os BSD 4.3
1985 .Pp
1986 See also
1987 .Sx \&Dd
1988 and
1989 .Sx \&Dt .
1990 .Ss \&Ot
1991 Unknown usage.
1992 .Pp
1993 .Em Remarks :
1994 this macro has been deprecated.
1995 .Ss \&Ox
1996 Format the OpenBSD version provided as an argument, or a default value
1997 if no argument is provided.
1998 .Pp
1999 Examples:
2000 .D1 \&.Ox 4.5
2001 .D1 \&.Ox
2002 .Pp
2003 See also
2004 .Sx \&At ,
2005 .Sx \&Bsx ,
2006 .Sx \&Bx ,
2007 .Sx \&Dx ,
2008 .Sx \&Fx ,
2009 .Sx \&Nx ,
2010 and
2011 .Sx \&Ux .
2012 .Ss \&Pa
2013 .Ss \&Pc
2014 .Ss \&Pf
2015 .Ss \&Po
2016 .Ss \&Pp
2017 .Ss \&Pq
2018 .Ss \&Qc
2019 .Ss \&Ql
2020 .Ss \&Qo
2021 .Ss \&Qq
2022 .Ss \&Re
2023 Closes a
2024 .Sx \&Rs
2025 block.
2026 Does not have any tail arguments.
2027 .Ss \&Rs
2028 Begins a bibliographic
2029 .Pq Dq reference
2030 block.
2031 Does not have any head arguments.
2032 The block macro may only contain
2033 .Sx \&%A ,
2034 .Sx \&%B ,
2035 .Sx \&%C ,
2036 .Sx \&%D ,
2037 .Sx \&%I ,
2038 .Sx \&%J ,
2039 .Sx \&%N ,
2040 .Sx \&%O ,
2041 .Sx \&%P ,
2042 .Sx \&%Q ,
2043 .Sx \&%R ,
2044 .Sx \&%T ,
2045 .Sx \&%U ,
2046 and
2047 .Sx \&%V
2048 child macros (at least one must be specified).
2049 .Pp
2050 Examples:
2051 .Bd -literal -offset indent -compact
2052 \&.Rs
2053 \&.%A J. E. Hopcroft
2054 \&.%A J. D. Ullman
2055 \&.%B Introduction to Automata Theory, Languages, and Computation
2056 \&.%I Addison-Wesley
2057 \&.%C Reading, Massachusettes
2058 \&.%D 1979
2059 \&.Re
2060 .Ed
2061 .Pp
2062 If an
2063 .Sx \&Rs
2064 block is used within a SEE ALSO section, a vertical space is asserted
2065 before the rendered output, else the block continues on the current
2066 line.
2067 .Ss \&Rv
2068 .Ss \&Sc
2069 .Ss \&Sh
2070 .Ss \&Sm
2071 .Ss \&So
2072 .Ss \&Sq
2073 .Ss \&Ss
2074 .Ss \&St
2075 .Ss \&Sx
2076 .Ss \&Sy
2077 .Ss \&Tn
2078 .Ss \&Ud
2079 Prints out
2080 .Dq currently under development.
2081 .Ss \&Ux
2082 Format the UNIX name.
2083 Accepts no argument.
2084 .Pp
2085 Examples:
2086 .D1 \&.Ux
2087 .Pp
2088 See also
2089 .Sx \&At ,
2090 .Sx \&Bsx ,
2091 .Sx \&Bx ,
2092 .Sx \&Dx ,
2093 .Sx \&Fx ,
2094 .Sx \&Nx ,
2095 and
2096 .Sx \&Ox .
2097 .Ss \&Va
2098 .Ss \&Vt
2099 A variable type.
2100 This is also used for indicating global variables in the
2101 .Em SYNOPSIS
2102 section, in which case a variable name is also specified.
2103 Note that it accepts
2104 .Sx Block partial-implicit
2105 syntax when invoked as the first macro in the
2106 .Em SYNOPSIS
2107 section, else it accepts ordinary
2108 .Sx In-line
2109 syntax.
2110 .Pp
2111 Note that this should not be confused with
2112 .Sx \&Ft ,
2113 which is used for function return types.
2114 .Pp
2115 Examples:
2116 .D1 \&.Vt unsigned char
2117 .D1 \&.Vt extern const char * const sys_signame[] \&;
2118 .Pp
2119 See also
2120 .Sx MANUAL STRUCTURE
2121 and
2122 .Sx \&Va .
2123 .Ss \&Xc
2124 Close a scope opened by
2125 .Sx \&Xo .
2126 .Ss \&Xo
2127 Open an extension scope.
2128 This macro originally existed to extend the 9-argument limit of troff;
2129 since this limit has been lifted, the macro has been deprecated.
2130 .Ss \&Xr
2131 Link to another manual
2132 .Pq Qq cross-reference .
2133 Its syntax is as follows:
2134 .Pp
2135 .D1 Pf \. Sx \&Xr Cm name section
2136 .Pp
2137 The
2138 .Cm name
2139 and
2140 .Cm section
2141 are the name and section of the linked manual.
2142 If
2143 .Cm section
2144 is followed by non-punctuation, an
2145 .Sx \&Ns
2146 is inserted into the token stream.
2147 This behaviour is for compatibility with
2148 .Xr groff 1 .
2149 .Pp
2150 Examples:
2151 .D1 \&.Xr mandoc 1
2152 .D1 \&.Xr mandoc 1 \&;
2153 .D1 \&.Xr mandoc 1 \&Ns s behaviour
2154 .Ss \&br
2155 .Ss \&sp
2156 .Sh COMPATIBILITY
2157 This section documents compatibility between mandoc and other other
2158 troff implementations, at this time limited to GNU troff
2159 .Pq Qq groff .
2160 The term
2161 .Qq historic groff
2162 refers to groff versions before the
2163 .Pa doc.tmac
2164 file re-write
2165 .Pq somewhere between 1.15 and 1.19 .
2166 .Pp
2167 Heirloom troff, the other significant troff implementation accepting
2168 \-mdoc, is similar to historic groff.
2169 .Pp
2170 .Bl -dash -compact
2171 .It
2172 groff behaves inconsistently when encountering
2173 .Pf non- Sx \&Fa
2174 children of
2175 .Sx \&Fo
2176 regarding spacing between arguments.
2177 In mandoc, this is not the case: each argument is consistently followed
2178 by a single space and the trailing
2179 .Sq \&)
2180 suppresses prior spacing.
2181 .It
2182 groff behaves inconsistently when encountering
2183 .Sx \&Ft
2184 and
2185 .Sx \&Fn
2186 in the
2187 .Em SYNOPSIS :
2188 at times newline(s) are suppressed depending on whether a prior
2189 .Sx \&Fn
2190 has been invoked.
2191 In mandoc, this is not the case.
2192 See
2193 .Sx \&Ft
2194 and
2195 .Sx \&Fn
2196 for the normalised behaviour.
2197 .It
2198 Historic groff does not break before an
2199 .Sx \&Fn
2200 when not invoked as the line macro in the
2201 .Em SYNOPSIS
2202 section.
2203 .It
2204 Historic groff formats the
2205 .Sx \&In
2206 badly: trailing arguments are trashed and
2207 .Em SYNOPSIS
2208 is not specially treated.
2209 .It
2210 groff does not accept the
2211 .Sq \&Ta
2212 pseudo-macro as a line macro.
2213 mandoc does.
2214 .It
2215 The comment syntax
2216 .Sq \e."
2217 is no longer accepted.
2218 .It
2219 In groff, the
2220 .Sx \&Pa
2221 macro does not format its arguments when used in the FILES section under
2222 certain list types.
2223 mandoc does.
2224 .It
2225 Historic groff does not print a dash for empty
2226 .Sx \&Fl
2227 arguments.
2228 mandoc and newer groff implementations do.
2229 .It
2230 groff behaves irregularly when specifying
2231 .Sq \ef
2232 .Sx Text Decoration
2233 within line-macro scopes.
2234 mandoc follows a consistent system.
2235 .It
2236 In mandoc, negative scaling units are truncated to zero; groff would
2237 move to prior lines.
2238 Furthermore, the
2239 .Sq f
2240 scaling unit, while accepted, is rendered as the default unit.
2241 .It
2242 In quoted literals, groff allowed pair-wise double-quotes to produce a
2243 standalone double-quote in formatted output.
2244 This idiosyncratic behaviour is not applicable in mandoc.
2245 .It
2246 Display types
2247 .Sx \&Bd
2248 .Fl center
2249 and
2250 .Fl right
2251 are aliases for
2252 .Fl left
2253 in mandoc. Furthermore, the
2254 .Fl file Ar file
2255 argument is ignored.
2256 Lastly, since text is not right-justified in mandoc (or even groff),
2257 .Fl ragged
2258 and
2259 .Fl filled
2260 are aliases, as are
2261 .Fl literal
2262 and
2263 .Fl unfilled .
2264 .It
2265 Historic groff has many un-callable macros.
2266 Most of these (excluding some block-level macros) are now callable.
2267 .It
2268 The vertical bar
2269 .Sq \(ba
2270 made historic groff
2271 .Qq go orbital
2272 but has been a proper delimiter since then.
2273 .It
2274 .Sx \&It Fl nested
2275 is assumed for all lists (it wasn't in historic groff): any list may be
2276 nested and
2277 .Fl enum
2278 lists will restart the sequence only for the sub-list.
2279 .It
2280 Some manuals use
2281 .Sx \&Li
2282 incorrectly by following it with a reserved character and expecting the
2283 delimiter to render.
2284 This is not supported in mandoc.
2285 .It
2286 In groff, the
2287 .Sx \&Cd ,
2288 .Sx \&Er ,
2289 .Sx \&Ex ,
2290 and
2291 .Sx \&Rv
2292 macros were stipulated only to occur in certain manual sections.
2293 mandoc does not have these restrictions.
2294 .It
2295 Newer groff and mandoc print
2296 .Qq AT&T UNIX
2297 prior to unknown arguments of
2298 .Sx \&At ;
2299 older groff did nothing.
2300 .El
2301 .Sh SEE ALSO
2302 .Xr mandoc 1 ,
2303 .Xr mandoc_char 7
2304 .Sh AUTHORS
2305 The
2306 .Nm
2307 reference was written by
2308 .An Kristaps Dzonsons Aq kristaps@bsd.lv .
2309 .\"
2310 .\" XXX: this really isn't the place for these caveats.
2311 .\" .
2312 .\" .
2313 .\" .Sh CAVEATS
2314 .\" There are many ambiguous parts of mdoc.
2315 .\" .
2316 .\" .Pp
2317 .\" .Bl -dash -compact
2318 .\" .It
2319 .\" .Sq \&Fa
2320 .\" should be
2321 .\" .Sq \&Va
2322 .\" as function arguments are variables.
2323 .\" .It
2324 .\" .Sq \&Ft
2325 .\" should be
2326 .\" .Sq \&Vt
2327 .\" as function return types are still types. Furthermore, the
2328 .\" .Sq \&Ft
2329 .\" should be removed and
2330 .\" .Sq \&Fo ,
2331 .\" which ostensibly follows it, should follow the same convention as
2332 .\" .Sq \&Va .
2333 .\" .It
2334 .\" .Sq \&Va
2335 .\" should formalise that only one or two arguments are acceptable: a
2336 .\" variable name and optional, preceding type.
2337 .\" .It
2338 .\" .Sq \&Fd
2339 .\" is ambiguous. It's commonly used to indicate an include file in the
2340 .\" synopsis section.
2341 .\" .Sq \&In
2342 .\" should be used, instead.
2343 .\" .It
2344 .\" Only the
2345 .\" .Sq \-literal
2346 .\" argument to
2347 .\" .Sq \&Bd
2348 .\" makes sense. The remaining ones should be removed.
2349 .\" .It
2350 .\" The
2351 .\" .Sq \&Xo
2352 .\" and
2353 .\" .Sq \&Xc
2354 .\" macros should be deprecated.
2355 .\" .It
2356 .\" The
2357 .\" .Sq \&Dt
2358 .\" macro lacks clarity. It should be absolutely clear which title will
2359 .\" render when formatting the manual page.
2360 .\" .It
2361 .\" A
2362 .\" .Sq \&Lx
2363 .\" should be provided for Linux (\(`a la
2364 .\" .Sq \&Ox ,
2365 .\" .Sq \&Nx
2366 .\" etc.).
2367 .\" .It
2368 .\" There's no way to refer to references in
2369 .\" .Sq \&Rs/Re
2370 .\" blocks.
2371 .\" .It
2372 .\" The \-split and \-nosplit dictates via
2373 .\" .Sq \&An
2374 .\" are re-set when entering and leaving the AUTHORS section.
2375 .\" .El
2376 .\" .