xref: /titanic_51/usr/src/man/man5/mdoc.5 (revision 260e9a87725c090ba5835b1f9f0b62fa2f96036f)
1 .\"	$Id: mdoc.7,v 1.252 2015/02/23 13:31:04 schwarze Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010, 2011, 2013 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 .\"
19 .\" Copyright 2014 Garrett D'Amore <garrett@dmaore.org>
20 .\" Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
21 .\"
22 .Dd Oct 18, 2015
23 .Dt MDOC 5
24 .Os
25 .Sh NAME
26 .Nm mdoc
27 .Nd semantic markup language for formatting manual pages
28 .Sh DESCRIPTION
29 The
30 .Nm mdoc
31 language supports authoring of manual pages for the
32 .Xr man 1
33 utility by allowing semantic annotations of words, phrases,
34 page sections and complete manual pages.
35 Such annotations are used by formatting tools to achieve a uniform
36 presentation across all manuals written in
37 .Nm ,
38 and to support hyperlinking if supported by the output medium.
39 .Pp
40 This reference document describes the structure of manual pages
41 and the syntax and usage of the
42 .Nm
43 language.
44 The reference implementation of a parsing and formatting tool is
45 .Xr mandoc 1 ;
46 the
47 .Sx COMPATIBILITY
48 section describes compatibility with other implementations.
49 .Pp
50 In an
51 .Nm
52 document, lines beginning with the control character
53 .Sq \&.
54 are called
55 .Dq macro lines .
56 The first word is the macro name.
57 It consists of two or three letters.
58 Most macro names begin with a capital letter.
59 For a list of available macros, see
60 .Sx MACRO OVERVIEW .
61 The words following the macro name are arguments to the macro, optionally
62 including the names of other, callable macros; see
63 .Sx MACRO SYNTAX
64 for details.
65 .Pp
66 Lines not beginning with the control character are called
67 .Dq text lines .
68 They provide free-form text to be printed; the formatting of the text
69 depends on the respective processing context:
70 .Bd -literal -offset indent
71 \&.Sh Macro lines change control state.
72 Text lines are interpreted within the current state.
73 .Ed
74 .Pp
75 Many aspects of the basic syntax of the
76 .Nm
77 language are based on the
78 .Xr mandoc_roff 5
79 language; see the
80 .Em LANGUAGE SYNTAX
81 and
82 .Em MACRO SYNTAX
83 sections in the
84 .Xr mandoc_roff 5
85 manual for details, in particular regarding
86 comments, escape sequences, whitespace, and quoting.
87 However, using
88 .Xr mandoc_roff 5
89 requests in
90 .Nm
91 documents is discouraged;
92 .Xr mandoc 1
93 supports some of them merely for backward compatibility.
94 .Sh MANUAL STRUCTURE
95 A well-formed
96 .Nm
97 document consists of a document prologue followed by one or more
98 sections.
99 .Pp
100 The prologue, which consists of the
101 .Sx \&Dd ,
102 .Sx \&Dt ,
103 and
104 .Sx \&Os
105 macros in that order, is required for every document.
106 .Pp
107 The first section (sections are denoted by
108 .Sx \&Sh )
109 must be the NAME section, consisting of at least one
110 .Sx \&Nm
111 followed by
112 .Sx \&Nd .
113 .Pp
114 Following that, convention dictates specifying at least the
115 .Em SYNOPSIS
116 and
117 .Em DESCRIPTION
118 sections, although this varies between manual sections.
119 .Pp
120 The following is a well-formed skeleton
121 .Nm
122 file for a utility
123 .Qq progname :
124 .Bd -literal -offset indent
125 \&.Dd Jan 1, 1970
126 \&.Dt PROGNAME section
127 \&.Os
128 \&.Sh NAME
129 \&.Nm progname
130 \&.Nd one line about what it does
131 \&.\e\(dq .Sh LIBRARY
132 \&.\e\(dq For sections 2, 3, and 9 only.
133 \&.Sh SYNOPSIS
134 \&.Nm progname
135 \&.Op Fl options
136 \&.Ar
137 \&.Sh DESCRIPTION
138 The
139 \&.Nm
140 utility processes files ...
141 \&.\e\(dq .Sh IMPLEMENTATION NOTES
142 \&.\e\(dq .Sh RETURN VALUES
143 \&.\e\(dq For sections 2, 3, and 9 only.
144 \&.\e\(dq .Sh CONTEXT
145 \&.\e\(dq For section 9 functions only.
146 \&.\e\(dq .Sh ENVIRONMENT
147 \&.\e\(dq For sections 1, 1M, and 5.
148 \&.\e\(dq .Sh FILES
149 \&.\e\(dq .Sh EXIT STATUS
150 \&.\e\(dq For sections 1, 1M, and 5.
151 \&.\e\(dq .Sh EXAMPLES
152 \&.\e\(dq .Sh DIAGNOSTICS
153 \&.\e\(dq .Sh ERRORS
154 \&.\e\(dq For sections 2, 3, and 9 only.
155 \&.\e\(dq .Sh ARCHITECTURE
156 \&.\e\(dq .Sh CODE SET INDEPENDENCE
157 \&.\e\(dq For sections 1, 1M, and 3 only.
158 \&.\e\(dq .Sh INTERFACE STABILITY
159 \&.\e\(dq .Sh MT-LEVEL
160 \&.\e\(dq For sections 2 and 3 only.
161 \&.\e\(dq .Sh SECURITY
162 \&.\e\(dq .Sh SEE ALSO
163 \&.\e\(dq .Xr foobar 1
164 \&.\e\(dq .Sh STANDARDS
165 \&.\e\(dq .Sh HISTORY
166 \&.\e\(dq .Sh AUTHORS
167 \&.\e\(dq .Sh CAVEATS
168 \&.\e\(dq .Sh BUGS
169 .Ed
170 .Pp
171 The sections in an
172 .Nm
173 document are conventionally ordered as they appear above.
174 Sections should be composed as follows:
175 .Bl -ohang -offset Ds
176 .It Em NAME
177 The name(s) and a one line description of the documented material.
178 The syntax for this as follows:
179 .Bd -literal -offset indent
180 \&.Nm name0 ,
181 \&.Nm name1 ,
182 \&.Nm name2
183 \&.Nd a one line description
184 .Ed
185 .Pp
186 Multiple
187 .Sq \&Nm
188 names should be separated by commas.
189 .Pp
190 The
191 .Sx \&Nm
192 macro(s) must precede the
193 .Sx \&Nd
194 macro.
195 .Pp
196 See
197 .Sx \&Nm
198 and
199 .Sx \&Nd .
200 .It Em LIBRARY
201 The name of the library containing the documented material, which is
202 assumed to be a function in a section 2, 3, or 9 manual.
203 The syntax for this is as follows:
204 .Bd -literal -offset indent
205 \&.Lb libarm
206 .Ed
207 .Pp
208 See
209 .Sx \&Lb .
210 .It Em SYNOPSIS
211 Documents the utility invocation syntax, function call syntax, or device
212 configuration.
213 .Pp
214 For the first, utilities (sections 1 and 1M), this is
215 generally structured as follows:
216 .Bd -literal -offset indent
217 \&.Nm bar
218 \&.Op Fl v
219 \&.Op Fl o Ar file
220 \&.Op Ar
221 \&.Nm foo
222 \&.Op Fl v
223 \&.Op Fl o Ar file
224 \&.Op Ar
225 .Ed
226 .Pp
227 Commands should be ordered alphabetically.
228 .Pp
229 For the second, function calls (sections 2, 3, 7I, 7P, 9):
230 .Bd -literal -offset indent
231 \&.In header.h
232 \&.Vt extern const char *global;
233 \&.Ft "char *"
234 \&.Fn foo "const char *src"
235 \&.Ft "char *"
236 \&.Fn bar "const char *src"
237 .Ed
238 .Pp
239 Ordering of
240 .Sx \&In ,
241 .Sx \&Vt ,
242 .Sx \&Fn ,
243 and
244 .Sx \&Fo
245 macros should follow C header-file conventions.
246 .Pp
247 And for the third, configurations (section 7D):
248 .Bd -literal -offset indent
249 \&.Pa /dev/device_node
250 .Ed
251 .Pp
252 Manuals not in these sections generally don't need a
253 .Em SYNOPSIS .
254 .Pp
255 Some macros are displayed differently in the
256 .Em SYNOPSIS
257 section, particularly
258 .Sx \&Nm ,
259 .Sx \&Cd ,
260 .Sx \&Fd ,
261 .Sx \&Fn ,
262 .Sx \&Fo ,
263 .Sx \&In ,
264 .Sx \&Vt ,
265 and
266 .Sx \&Ft .
267 All of these macros are output on their own line.
268 If two such dissimilar macros are pairwise invoked (except for
269 .Sx \&Ft
270 before
271 .Sx \&Fo
272 or
273 .Sx \&Fn ) ,
274 they are separated by a vertical space, unless in the case of
275 .Sx \&Fo ,
276 .Sx \&Fn ,
277 and
278 .Sx \&Ft ,
279 which are always separated by vertical space.
280 .Pp
281 When text and macros following an
282 .Sx \&Nm
283 macro starting an input line span multiple output lines,
284 all output lines but the first will be indented to align
285 with the text immediately following the
286 .Sx \&Nm
287 macro, up to the next
288 .Sx \&Nm ,
289 .Sx \&Sh ,
290 or
291 .Sx \&Ss
292 macro or the end of an enclosing block, whichever comes first.
293 .It Em DESCRIPTION
294 This begins with an expansion of the brief, one line description in
295 .Em NAME :
296 .Bd -literal -offset indent
297 The
298 \&.Nm
299 utility does this, that, and the other.
300 .Ed
301 .Pp
302 It usually follows with a breakdown of the options (if documenting a
303 command), such as:
304 .Bd -literal -offset indent
305 The arguments are as follows:
306 \&.Bl \-tag \-width Ds
307 \&.It Fl v
308 Print verbose information.
309 \&.El
310 .Ed
311 .Pp
312 Manuals not documenting a command won't include the above fragment.
313 .Pp
314 Since the
315 .Em DESCRIPTION
316 section usually contains most of the text of a manual, longer manuals
317 often use the
318 .Sx \&Ss
319 macro to form subsections.
320 In very long manuals, the
321 .Em DESCRIPTION
322 may be split into multiple sections, each started by an
323 .Sx \&Sh
324 macro followed by a non-standard section name, and each having
325 several subsections, like in the present
326 .Nm
327 manual.
328 .It Em IMPLEMENTATION NOTES
329 Implementation-specific notes should be kept here.
330 This is useful when implementing standard functions that may have side
331 effects or notable algorithmic implications.
332 .It Em RETURN VALUES
333 This section documents the
334 return values of functions in sections 2, 3, and 9.
335 .Pp
336 See
337 .Sx \&Rv .
338 .It Em CONTEXT
339 This section lists the contexts in which functions can be called in section 9.
340 The contexts are user, kernel, or interrupt.
341 .It Em ENVIRONMENT
342 Lists the environment variables used by the utility,
343 and explains the syntax and semantics of their values.
344 The
345 .Xr environ 5
346 manual provides examples of typical content and formatting.
347 .Pp
348 See
349 .Sx \&Ev .
350 .It Em FILES
351 Documents files used.
352 It's helpful to document both the file name and a short description of how
353 the file is used (created, modified, etc.).
354 .Pp
355 See
356 .Sx \&Pa .
357 .It Em EXIT STATUS
358 This section documents the
359 command exit status for sections 1 and 1M.
360 Historically, this information was described in
361 .Em DIAGNOSTICS ,
362 a practise that is now discouraged.
363 .Pp
364 See
365 .Sx \&Ex .
366 .It Em EXAMPLES
367 Example usages.
368 This often contains snippets of well-formed, well-tested invocations.
369 Make sure that examples work properly!
370 .It Em DIAGNOSTICS
371 Documents error and diagnostic messages displayed to the user or
372 sent to logs. Note that exit
373 status and return values should be documented in the
374 .Em EXIT STATUS
375 and
376 .Em RETURN VALUES
377 sections.
378 .Pp
379 See
380 .Sx \&Bl
381 .Fl diag .
382 .It Em ERRORS
383 Documents error handling in sections 2, 3, and 9.
384 .Pp
385 See
386 .Sx \&Er .
387 .It Em ARCHITECTURE
388 This section is usually absent, but will be present when the
389 interface is specific to one or more architectures.
390 .It Em CODE SET INDEPENDENCE
391 Indicates whether the interface operates correctly with various different
392 code sets.  True independent code sets will support not only ASCII and
393 Extended UNIX Codesets (EUC), but also other multi-byte encodings such as
394 UTF-8 and GB2312.
395 .Pp
396 Generally there will be some limitations that are fairly standard.  See
397 .Xr standards 5 for more information about some of these.  Most interfaces
398 should support at least UTF-8 in addition to ASCII.
399 .It Em INTERFACE STABILITY
400 Indicates the level of commitment to the interface. Interfaces can be described
401 with in the following ways:
402 .Bl -tag -width Ds
403 .It Nm Standard
404 Indicates that the interface is defined by one or more standards bodies.
405 Generally, changes to the interface will be carefully managed to conform
406 to the relevant standards.  These interfaces are generally the most suitable
407 for use in portable programs.
408 .It Nm Committed
409 Indicates that the interface is intended to be preserved for the long-haul, and
410 will rarely, if ever change, and never without notification (barring
411 extraordinary and extenuating circumstances). These interfaces are
412 preferred over other interfaces with the exeception of
413 .Nm Standard
414 interfaces.
415 .It Nm Uncommitted
416 Indicates that the interface may change.  Generally, changes to these interfaces
417 should be infrequent, and some effort will be made to address compatibility
418 considerations when changing or removing such interfaces.  However, there is
419 no firm commitment to the preservation of the interface.  Most often this
420 is applied to interfaces where operational experience with the interface
421 is still limited and some need to change may be anticipated.
422 .Pp
423 Consumers should expect to revalidate any
424 .Nm Uncommitted
425 interfaces when crossing release boundaries.  Products intended for
426 use on many releases or intended to support compatibility with future
427 releases should avoid these interfaces.
428 .It Nm Volatile
429 The interface can change at any time for any reason. Often this relates to
430 interfaces that are part of external software components that are still evolving
431 rapidly.  Consumers should not expect that the interface (either binary or
432 source level) will be unchanged from one release to the next.
433 .It Nm Not-an-Interface
434 Describes something that is specifically not intended for programmatic
435 consumption.  For example, specific human-readable output, or the layout
436 of graphical items on a user interface, may be described this way.  Generally
437 programmatic alternatives to these will be available, and should be used
438 when programmatic consumption is needed.
439 .It Nm Private
440 This is an internal interface.  Generally these interfaces should only be
441 used within the project, and should not be used by other programs or modules.
442 The interface can and will change without notice as the project needs, at
443 any time.
444 .Pp
445 Most often, Private interfaces will lack any documentation whatsoever, and
446 generally any undocumented interface can be assumed to be Private.
447 .It Nm Obsolete
448 The interface is not intended for use in new projects or programs, and may
449 be removed at a future date.  The
450 .Nm Obsolete
451 word is a modifier that can
452 be applied to other commitment levels. For example an
453 .Nm Obsolete Committed
454 interface is unlikely to be removed or changed, but nonetheless new use
455 is discouraged (perhaps a better newer alternative is present).
456 .El
457 .It Em MT-LEVEL
458 This section describes considerations for the interface when used within
459 programs that use multiple threads.  More discussion of these considerations
460 is made in the MT-Level section of
461 .Xr attributes 5 .
462 The interface can be described in the following ways.
463 .Bl -tag -width Ds
464 .It Nm Safe
465 Indicates the interface is safe for use within multiple threads.  There
466 may be additional caveats that apply, in which case those will be
467 described.  Note that some interfaces have semantics which may affect
468 other threads, but these should be an intrinsic part of the interface
469 rather than an unexpected side effect.  For example, closing a file in
470 one thread will cause that file to be closed in all threads.
471 .It Nm Unsafe
472 Indicates the interface is unsuitable for concurrent use within multiple
473 threads.  A threaded application may still make use of the interface, but
474 will be required to provide external synchronization means to ensure that
475 only a single thread calls the interface at a time.
476 .It Nm MT-Safe
477 Indicates that the interface is not only safe for concurrent use, but is
478 designed for such use.  For example, a
479 .Nm Safe
480 interface may make use of a global lock to provide safety, but at reduced
481 internal concurrency, whereas an
482 .Nm MT-Safe
483 interface will be designed to be efficient even when used concurrently.
484 .It Nm Async-Signal-Safe
485 Indicates that the library is safe for use within a signal handler.  An
486 .Nm MT-Safe
487 interface can be made
488 .Nm Async-Signal-Safe
489 by ensuring that it blocks signals when acquiring locks.
490 .It Nm Safe with Exections
491 As for
492 .Nm Safe
493 but with specific exceptions noted.
494 .It Nm MT-Safe with Exections
495 As for
496 .Nm MT-Safe
497 but with specific exceptions noted.
498 .El
499 .It Em SECURITY
500 Documents any security precautions that operators should consider.
501 .It Em SEE ALSO
502 References other manuals with related topics.
503 This section should exist for most manuals.
504 Cross-references should conventionally be ordered first by section, then
505 alphabetically (ignoring case).
506 .Pp
507 References to other documentation concerning the topic of the manual page,
508 for example authoritative books or journal articles, may also be
509 provided in this section.
510 .Pp
511 See
512 .Sx \&Rs
513 and
514 .Sx \&Xr .
515 .It Em STANDARDS
516 References any standards implemented or used.
517 If not adhering to any standards, the
518 .Em HISTORY
519 section should be used instead.
520 .Pp
521 See
522 .Sx \&St .
523 .It Em HISTORY
524 A brief history of the subject, including where it was first implemented,
525 and when it was ported to or reimplemented for the operating system at hand.
526 .It Em AUTHORS
527 Credits to the person or persons who wrote the code and/or documentation.
528 Authors should generally be noted by both name and email address.
529 .Pp
530 See
531 .Sx \&An .
532 .It Em CAVEATS
533 Common misuses and misunderstandings should be explained
534 in this section.
535 .It Em BUGS
536 Known bugs, limitations, and work-arounds should be described
537 in this section.
538 .El
539 .Sh MACRO OVERVIEW
540 This overview is sorted such that macros of similar purpose are listed
541 together, to help find the best macro for any given purpose.
542 Deprecated macros are not included in the overview, but can be found below
543 in the alphabetical
544 .Sx MACRO REFERENCE .
545 .Ss Document preamble and NAME section macros
546 .Bl -column "Brq, Bro, Brc" description
547 .It Sx \&Dd Ta document date: Ar month day , year
548 .It Sx \&Dt Ta document title: Ar TITLE SECTION Op Ar arch
549 .It Sx \&Os Ta operating system version: Op Ar system Op Ar version
550 .It Sx \&Nm Ta document name (one argument)
551 .It Sx \&Nd Ta document description (one line)
552 .El
553 .Ss Sections and cross references
554 .Bl -column "Brq, Bro, Brc" description
555 .It Sx \&Sh Ta section header (one line)
556 .It Sx \&Ss Ta subsection header (one line)
557 .It Sx \&Sx Ta internal cross reference to a section or subsection
558 .It Sx \&Xr Ta cross reference to another manual page: Ar name section
559 .It Sx \&Pp , \&Lp Ta start a text paragraph (no arguments)
560 .El
561 .Ss Displays and lists
562 .Bl -column "Brq, Bro, Brc" description
563 .It Sx \&Bd , \&Ed Ta display block:
564 .Fl Ar type
565 .Op Fl offset Ar width
566 .Op Fl compact
567 .It Sx \&D1 Ta indented display (one line)
568 .It Sx \&Dl Ta indented literal display (one line)
569 .It Sx \&Ql Ta in-line literal display: Ql text
570 .It Sx \&Bl , \&El Ta list block:
571 .Fl Ar type
572 .Op Fl width Ar val
573 .Op Fl offset Ar val
574 .Op Fl compact
575 .It Sx \&It Ta list item (syntax depends on Fl Ar type )
576 .It Sx \&Ta Ta table cell separator in Sx \&Bl Fl column No lists
577 .It Sx \&Rs , \&%* , \&Re Ta bibliographic block (references)
578 .El
579 .Ss Spacing control
580 .Bl -column "Brq, Bro, Brc" description
581 .It Sx \&Pf Ta prefix, no following horizontal space (one argument)
582 .It Sx \&Ns Ta roman font, no preceding horizontal space (no arguments)
583 .It Sx \&Ap Ta apostrophe without surrounding whitespace (no arguments)
584 .It Sx \&Sm Ta switch horizontal spacing mode: Op Cm on | off
585 .It Sx \&Bk , \&Ek Ta keep block: Fl words
586 .It Sx \&br Ta force output line break in text mode (no arguments)
587 .It Sx \&sp Ta force vertical space: Op Ar height
588 .El
589 .Ss Semantic markup for command line utilities:
590 .Bl -column "Brq, Bro, Brc" description
591 .It Sx \&Nm Ta start a SYNOPSIS block with the name of a utility
592 .It Sx \&Fl Ta command line options (flags) (>=0 arguments)
593 .It Sx \&Cm Ta command modifier (>0 arguments)
594 .It Sx \&Ar Ta command arguments (>=0 arguments)
595 .It Sx \&Op , \&Oo , \&Oc Ta optional syntax elements (enclosure)
596 .It Sx \&Ic Ta internal or interactive command (>0 arguments)
597 .It Sx \&Ev Ta environmental variable (>0 arguments)
598 .It Sx \&Pa Ta file system path (>=0 arguments)
599 .El
600 .Ss Semantic markup for function libraries:
601 .Bl -column "Brq, Bro, Brc" description
602 .It Sx \&Lb Ta function library (one argument)
603 .It Sx \&In Ta include file (one argument)
604 .It Sx \&Fd Ta other preprocessor directive (>0 arguments)
605 .It Sx \&Ft Ta function type (>0 arguments)
606 .It Sx \&Fo , \&Fc Ta function block: Ar funcname
607 .It Sx \&Fn Ta function name:
608 .Op Ar functype
609 .Ar funcname
610 .Oo
611 .Op Ar argtype
612 .Ar argname
613 .Oc
614 .It Sx \&Fa Ta function argument (>0 arguments)
615 .It Sx \&Vt Ta variable type (>0 arguments)
616 .It Sx \&Va Ta variable name (>0 arguments)
617 .It Sx \&Dv Ta defined variable or preprocessor constant (>0 arguments)
618 .It Sx \&Er Ta error constant (>0 arguments)
619 .It Sx \&Ev Ta environmental variable (>0 arguments)
620 .El
621 .Ss Various semantic markup:
622 .Bl -column "Brq, Bro, Brc" description
623 .It Sx \&An Ta author name (>0 arguments)
624 .It Sx \&Lk Ta hyperlink: Ar uri Op Ar name
625 .It Sx \&Mt Ta Do mailto Dc hyperlink: Ar address
626 .It Sx \&Cd Ta kernel configuration declaration (>0 arguments)
627 .It Sx \&Ad Ta memory address (>0 arguments)
628 .It Sx \&Ms Ta mathematical symbol (>0 arguments)
629 .El
630 .Ss Physical markup
631 .Bl -column "Brq, Bro, Brc" description
632 .It Sx \&Em Ta italic font or underline (emphasis) (>0 arguments)
633 .It Sx \&Sy Ta boldface font (symbolic) (>0 arguments)
634 .It Sx \&Li Ta typewriter font (literal) (>0 arguments)
635 .It Sx \&No Ta return to roman font (normal) (no arguments)
636 .It Sx \&Bf , \&Ef Ta font block:
637 .Op Fl Ar type | Cm \&Em | \&Li | \&Sy
638 .El
639 .Ss Physical enclosures
640 .Bl -column "Brq, Bro, Brc" description
641 .It Sx \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text
642 .It Sx \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text
643 .It Sx \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text
644 .It Sx \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text
645 .It Sx \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text
646 .It Sx \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text
647 .It Sx \&Aq , \&Ao , \&Ac Ta enclose in angle brackets: Aq text
648 .It Sx \&Eo , \&Ec Ta generic enclosure
649 .El
650 .Ss Text production
651 .Bl -column "Brq, Bro, Brc" description
652 .It Sx \&Ex Fl std Ta standard command exit values: Op Ar utility ...
653 .It Sx \&Rv Fl std Ta standard function return values: Op Ar function ...
654 .It Sx \&St Ta reference to a standards document (one argument)
655 .It Sx \&At Ta At
656 .It Sx \&Bx Ta Bx
657 .It Sx \&Bsx Ta Bsx
658 .It Sx \&Nx Ta Nx
659 .It Sx \&Fx Ta Fx
660 .It Sx \&Ox Ta Ox
661 .It Sx \&Dx Ta Dx
662 .El
663 .Sh MACRO REFERENCE
664 This section is a canonical reference of all macros, arranged
665 alphabetically.
666 For the scoping of individual macros, see
667 .Sx MACRO SYNTAX .
668 .Ss \&%A
669 Author name of an
670 .Sx \&Rs
671 block.
672 Multiple authors should each be accorded their own
673 .Sx \%%A
674 line.
675 Author names should be ordered with full or abbreviated forename(s)
676 first, then full surname.
677 .Ss \&%B
678 Book title of an
679 .Sx \&Rs
680 block.
681 This macro may also be used in a non-bibliographic context when
682 referring to book titles.
683 .Ss \&%C
684 Publication city or location of an
685 .Sx \&Rs
686 block.
687 .Ss \&%D
688 Publication date of an
689 .Sx \&Rs
690 block.
691 Recommended formats of arguments are
692 .Ar month day , year
693 or just
694 .Ar year .
695 .Ss \&%I
696 Publisher or issuer name of an
697 .Sx \&Rs
698 block.
699 .Ss \&%J
700 Journal name of an
701 .Sx \&Rs
702 block.
703 .Ss \&%N
704 Issue number (usually for journals) of an
705 .Sx \&Rs
706 block.
707 .Ss \&%O
708 Optional information of an
709 .Sx \&Rs
710 block.
711 .Ss \&%P
712 Book or journal page number of an
713 .Sx \&Rs
714 block.
715 .Ss \&%Q
716 Institutional author (school, government, etc.) of an
717 .Sx \&Rs
718 block.
719 Multiple institutional authors should each be accorded their own
720 .Sx \&%Q
721 line.
722 .Ss \&%R
723 Technical report name of an
724 .Sx \&Rs
725 block.
726 .Ss \&%T
727 Article title of an
728 .Sx \&Rs
729 block.
730 This macro may also be used in a non-bibliographical context when
731 referring to article titles.
732 .Ss \&%U
733 URI of reference document.
734 .Ss \&%V
735 Volume number of an
736 .Sx \&Rs
737 block.
738 .Ss \&Ac
739 Close an
740 .Sx \&Ao
741 block.
742 Does not have any tail arguments.
743 .Ss \&Ad
744 Memory address.
745 Do not use this for postal addresses.
746 .Pp
747 Examples:
748 .Dl \&.Ad [0,$]
749 .Dl \&.Ad 0x00000000
750 .Ss \&An
751 Author name.
752 Can be used both for the authors of the program, function, or driver
753 documented in the manual, or for the authors of the manual itself.
754 Requires either the name of an author or one of the following arguments:
755 .Pp
756 .Bl -tag -width "-nosplitX" -offset indent -compact
757 .It Fl split
758 Start a new output line before each subsequent invocation of
759 .Sx \&An .
760 .It Fl nosplit
761 The opposite of
762 .Fl split .
763 .El
764 .Pp
765 The default is
766 .Fl nosplit .
767 The effect of selecting either of the
768 .Fl split
769 modes ends at the beginning of the
770 .Em AUTHORS
771 section.
772 In the
773 .Em AUTHORS
774 section, the default is
775 .Fl nosplit
776 for the first author listing and
777 .Fl split
778 for all other author listings.
779 .Pp
780 Examples:
781 .Dl \&.An -nosplit
782 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
783 .Ss \&Ao
784 Begin a block enclosed by angle brackets.
785 Does not have any head arguments.
786 .Pp
787 Examples:
788 .Dl \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
789 .Pp
790 See also
791 .Sx \&Aq .
792 .Ss \&Ap
793 Inserts an apostrophe without any surrounding whitespace.
794 This is generally used as a grammatical device when referring to the verb
795 form of a function.
796 .Pp
797 Examples:
798 .Dl \&.Fn execve \&Ap d
799 .Ss \&Aq
800 Encloses its arguments in angle brackets.
801 .Pp
802 Examples:
803 .Dl \&.Fl -key= \&Ns \&Aq \&Ar val
804 .Pp
805 .Em Remarks :
806 this macro is often abused for rendering URIs, which should instead use
807 .Sx \&Lk
808 or
809 .Sx \&Mt ,
810 or to note pre-processor
811 .Dq Li #include
812 statements, which should use
813 .Sx \&In .
814 .Pp
815 See also
816 .Sx \&Ao .
817 .Ss \&Ar
818 Command arguments.
819 If an argument is not provided, the string
820 .Dq file ...\&
821 is used as a default.
822 .Pp
823 Examples:
824 .Dl ".Fl o Ar file"
825 .Dl ".Ar"
826 .Dl ".Ar arg1 , arg2 ."
827 .Pp
828 The arguments to the
829 .Sx \&Ar
830 macro are names and placeholders for command arguments;
831 for fixed strings to be passed verbatim as arguments, use
832 .Sx \&Fl
833 or
834 .Sx \&Cm .
835 .Ss \&At
836 Formats an
837 .At
838 version.
839 Accepts one optional argument:
840 .Pp
841 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
842 .It Cm v[1-7] | 32v
843 A version of
844 .At .
845 .It Cm III
846 .At III .
847 .It Cm V[.[1-4]]?
848 A version of
849 .At V .
850 .El
851 .Pp
852 Note that these arguments do not begin with a hyphen.
853 .Pp
854 Examples:
855 .Dl \&.At
856 .Dl \&.At III
857 .Dl \&.At V.1
858 .Pp
859 See also
860 .Sx \&Bsx ,
861 .Sx \&Bx ,
862 .Sx \&Dx ,
863 .Sx \&Fx ,
864 .Sx \&Nx ,
865 and
866 .Sx \&Ox .
867 .Ss \&Bc
868 Close a
869 .Sx \&Bo
870 block.
871 Does not have any tail arguments.
872 .Ss \&Bd
873 Begin a display block.
874 Its syntax is as follows:
875 .Bd -ragged -offset indent
876 .Pf \. Sx \&Bd
877 .Fl Ns Ar type
878 .Op Fl offset Ar width
879 .Op Fl compact
880 .Ed
881 .Pp
882 Display blocks are used to select a different indentation and
883 justification than the one used by the surrounding text.
884 They may contain both macro lines and text lines.
885 By default, a display block is preceded by a vertical space.
886 .Pp
887 The
888 .Ar type
889 must be one of the following:
890 .Bl -tag -width 13n -offset indent
891 .It Fl centered
892 Produce one output line from each input line, and center-justify each line.
893 Using this display type is not recommended; many
894 .Nm
895 implementations render it poorly.
896 .It Fl filled
897 Change the positions of line breaks to fill each line, and left- and
898 right-justify the resulting block.
899 .It Fl literal
900 Produce one output line from each input line,
901 and do not justify the block at all.
902 Preserve white space as it appears in the input.
903 Always use a constant-width font.
904 Use this for displaying source code.
905 .It Fl ragged
906 Change the positions of line breaks to fill each line, and left-justify
907 the resulting block.
908 .It Fl unfilled
909 The same as
910 .Fl literal ,
911 but using the same font as for normal text, which is a variable width font
912 if supported by the output device.
913 .El
914 .Pp
915 The
916 .Ar type
917 must be provided first.
918 Additional arguments may follow:
919 .Bl -tag -width 13n -offset indent
920 .It Fl offset Ar width
921 Indent the display by the
922 .Ar width ,
923 which may be one of the following:
924 .Bl -item
925 .It
926 One of the pre-defined strings
927 .Cm indent ,
928 the width of a standard indentation (six constant width characters);
929 .Cm indent-two ,
930 twice
931 .Cm indent ;
932 .Cm left ,
933 which has no effect;
934 .Cm right ,
935 which justifies to the right margin; or
936 .Cm center ,
937 which aligns around an imagined center axis.
938 .It
939 A macro invocation, which selects a predefined width
940 associated with that macro.
941 The most popular is the imaginary macro
942 .Ar \&Ds ,
943 which resolves to
944 .Sy 6n .
945 .It
946 A scaling width as described in
947 .Xr mandoc_roff 5 .
948 .It
949 An arbitrary string, which indents by the length of this string.
950 .El
951 .Pp
952 When the argument is missing,
953 .Fl offset
954 is ignored.
955 .It Fl compact
956 Do not assert vertical space before the display.
957 .El
958 .Pp
959 Examples:
960 .Bd -literal -offset indent
961 \&.Bd \-literal \-offset indent \-compact
962    Hello       world.
963 \&.Ed
964 .Ed
965 .Pp
966 See also
967 .Sx \&D1
968 and
969 .Sx \&Dl .
970 .Ss \&Bf
971 Change the font mode for a scoped block of text.
972 Its syntax is as follows:
973 .Bd -ragged -offset indent
974 .Pf \. Sx \&Bf
975 .Oo
976 .Fl emphasis | literal | symbolic |
977 .Cm \&Em | \&Li | \&Sy
978 .Oc
979 .Ed
980 .Pp
981 The
982 .Fl emphasis
983 and
984 .Cm \&Em
985 argument are equivalent, as are
986 .Fl symbolic
987 and
988 .Cm \&Sy ,
989 and
990 .Fl literal
991 and
992 .Cm \&Li .
993 Without an argument, this macro does nothing.
994 The font mode continues until broken by a new font mode in a nested
995 scope or
996 .Sx \&Ef
997 is encountered.
998 .Pp
999 See also
1000 .Sx \&Li ,
1001 .Sx \&Ef ,
1002 .Sx \&Em ,
1003 and
1004 .Sx \&Sy .
1005 .Ss \&Bk
1006 For each macro, keep its output together on the same output line,
1007 until the end of the macro or the end of the input line is reached,
1008 whichever comes first.
1009 Line breaks in text lines are unaffected.
1010 The syntax is as follows:
1011 .Pp
1012 .D1 Pf \. Sx \&Bk Fl words
1013 .Pp
1014 The
1015 .Fl words
1016 argument is required; additional arguments are ignored.
1017 .Pp
1018 The following example will not break within each
1019 .Sx \&Op
1020 macro line:
1021 .Bd -literal -offset indent
1022 \&.Bk \-words
1023 \&.Op Fl f Ar flags
1024 \&.Op Fl o Ar output
1025 \&.Ek
1026 .Ed
1027 .Pp
1028 Be careful in using over-long lines within a keep block!
1029 Doing so will clobber the right margin.
1030 .Ss \&Bl
1031 Begin a list.
1032 Lists consist of items specified using the
1033 .Sx \&It
1034 macro, containing a head or a body or both.
1035 The list syntax is as follows:
1036 .Bd -ragged -offset indent
1037 .Pf \. Sx \&Bl
1038 .Fl Ns Ar type
1039 .Op Fl width Ar val
1040 .Op Fl offset Ar val
1041 .Op Fl compact
1042 .Op HEAD ...
1043 .Ed
1044 .Pp
1045 The list
1046 .Ar type
1047 is mandatory and must be specified first.
1048 The
1049 .Fl width
1050 and
1051 .Fl offset
1052 arguments accept macro names as described for
1053 .Sx \&Bd
1054 .Fl offset ,
1055 scaling widths as described in
1056 .Xr mandoc_roff 5 ,
1057 or use the length of the given string.
1058 The
1059 .Fl offset
1060 is a global indentation for the whole list, affecting both item heads
1061 and bodies.
1062 For those list types supporting it, the
1063 .Fl width
1064 argument requests an additional indentation of item bodies,
1065 to be added to the
1066 .Fl offset .
1067 Unless the
1068 .Fl compact
1069 argument is specified, list entries are separated by vertical space.
1070 .Pp
1071 A list must specify one of the following list types:
1072 .Bl -tag -width 12n -offset indent
1073 .It Fl bullet
1074 No item heads can be specified, but a bullet will be printed at the head
1075 of each item.
1076 Item bodies start on the same output line as the bullet
1077 and are indented according to the
1078 .Fl width
1079 argument.
1080 .It Fl column
1081 A columnated list.
1082 The
1083 .Fl width
1084 argument has no effect; instead, each argument specifies the width
1085 of one column, using either the scaling width syntax described in
1086 .Xr mandoc_roff 5
1087 or the string length of the argument.
1088 If the first line of the body of a
1089 .Fl column
1090 list is not an
1091 .Sx \&It
1092 macro line,
1093 .Sx \&It
1094 contexts spanning one input line each are implied until an
1095 .Sx \&It
1096 macro line is encountered, at which point items start being interpreted as
1097 described in the
1098 .Sx \&It
1099 documentation.
1100 .It Fl dash
1101 Like
1102 .Fl bullet ,
1103 except that dashes are used in place of bullets.
1104 .It Fl diag
1105 Like
1106 .Fl inset ,
1107 except that item heads are not parsed for macro invocations.
1108 Most often used in the
1109 .Em DIAGNOSTICS
1110 section with error constants in the item heads.
1111 .It Fl enum
1112 A numbered list.
1113 No item heads can be specified.
1114 Formatted like
1115 .Fl bullet ,
1116 except that cardinal numbers are used in place of bullets,
1117 starting at 1.
1118 .It Fl hang
1119 Like
1120 .Fl tag ,
1121 except that the first lines of item bodies are not indented, but follow
1122 the item heads like in
1123 .Fl inset
1124 lists.
1125 .It Fl hyphen
1126 Synonym for
1127 .Fl dash .
1128 .It Fl inset
1129 Item bodies follow items heads on the same line, using normal inter-word
1130 spacing.
1131 Bodies are not indented, and the
1132 .Fl width
1133 argument is ignored.
1134 .It Fl item
1135 No item heads can be specified, and none are printed.
1136 Bodies are not indented, and the
1137 .Fl width
1138 argument is ignored.
1139 .It Fl ohang
1140 Item bodies start on the line following item heads and are not indented.
1141 The
1142 .Fl width
1143 argument is ignored.
1144 .It Fl tag
1145 Item bodies are indented according to the
1146 .Fl width
1147 argument.
1148 When an item head fits inside the indentation, the item body follows
1149 this head on the same output line.
1150 Otherwise, the body starts on the output line following the head.
1151 .El
1152 .Pp
1153 Lists may be nested within lists and displays.
1154 Nesting of
1155 .Fl column
1156 and
1157 .Fl enum
1158 lists may not be portable.
1159 .Pp
1160 See also
1161 .Sx \&El
1162 and
1163 .Sx \&It .
1164 .Ss \&Bo
1165 Begin a block enclosed by square brackets.
1166 Does not have any head arguments.
1167 .Pp
1168 Examples:
1169 .Bd -literal -offset indent -compact
1170 \&.Bo 1 ,
1171 \&.Dv BUFSIZ \&Bc
1172 .Ed
1173 .Pp
1174 See also
1175 .Sx \&Bq .
1176 .Ss \&Bq
1177 Encloses its arguments in square brackets.
1178 .Pp
1179 Examples:
1180 .Dl \&.Bq 1 , \&Dv BUFSIZ
1181 .Pp
1182 .Em Remarks :
1183 this macro is sometimes abused to emulate optional arguments for
1184 commands; the correct macros to use for this purpose are
1185 .Sx \&Op ,
1186 .Sx \&Oo ,
1187 and
1188 .Sx \&Oc .
1189 .Pp
1190 See also
1191 .Sx \&Bo .
1192 .Ss \&Brc
1193 Close a
1194 .Sx \&Bro
1195 block.
1196 Does not have any tail arguments.
1197 .Ss \&Bro
1198 Begin a block enclosed by curly braces.
1199 Does not have any head arguments.
1200 .Pp
1201 Examples:
1202 .Bd -literal -offset indent -compact
1203 \&.Bro 1 , ... ,
1204 \&.Va n \&Brc
1205 .Ed
1206 .Pp
1207 See also
1208 .Sx \&Brq .
1209 .Ss \&Brq
1210 Encloses its arguments in curly braces.
1211 .Pp
1212 Examples:
1213 .Dl \&.Brq 1 , ... , \&Va n
1214 .Pp
1215 See also
1216 .Sx \&Bro .
1217 .Ss \&Bsx
1218 Format the
1219 .Bsx
1220 version provided as an argument, or a default value if
1221 no argument is provided.
1222 .Pp
1223 Examples:
1224 .Dl \&.Bsx 1.0
1225 .Dl \&.Bsx
1226 .Pp
1227 See also
1228 .Sx \&At ,
1229 .Sx \&Bx ,
1230 .Sx \&Dx ,
1231 .Sx \&Fx ,
1232 .Sx \&Nx ,
1233 and
1234 .Sx \&Ox .
1235 .Ss \&Bt
1236 Supported only for compatibility, do not use this in new manuals.
1237 Prints
1238 .Dq is currently in beta test.
1239 .Ss \&Bx
1240 Format the
1241 .Bx
1242 version provided as an argument, or a default value if no
1243 argument is provided.
1244 .Pp
1245 Examples:
1246 .Dl \&.Bx 4.3 Tahoe
1247 .Dl \&.Bx 4.4
1248 .Dl \&.Bx
1249 .Pp
1250 See also
1251 .Sx \&At ,
1252 .Sx \&Bsx ,
1253 .Sx \&Dx ,
1254 .Sx \&Fx ,
1255 .Sx \&Nx ,
1256 and
1257 .Sx \&Ox .
1258 .Ss \&Cd
1259 Kernel configuration declaration.  It is found in pages for
1260 .Bx
1261 and not used here.
1262 .Pp
1263 Examples:
1264 .Dl \&.Cd device le0 at scode?
1265 .Pp
1266 .Em Remarks :
1267 this macro is commonly abused by using quoted literals to retain
1268 whitespace and align consecutive
1269 .Sx \&Cd
1270 declarations.
1271 This practise is discouraged.
1272 .Ss \&Cm
1273 Command modifiers.
1274 Typically used for fixed strings passed as arguments, unless
1275 .Sx \&Fl
1276 is more appropriate.
1277 Also useful when specifying configuration options or keys.
1278 .Pp
1279 Examples:
1280 .Dl ".Nm mt Fl f Ar device Cm rewind"
1281 .Dl ".Nm ps Fl o Cm pid , Ns Cm command"
1282 .Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2"
1283 .Dl ".Cm IdentityFile Pa ~/.ssh/id_rsa"
1284 .Dl ".Cm LogLevel Dv DEBUG"
1285 .Ss \&D1
1286 One-line indented display.
1287 This is formatted by the default rules and is useful for simple indented
1288 statements.
1289 It is followed by a newline.
1290 .Pp
1291 Examples:
1292 .Dl \&.D1 \&Fl abcdefgh
1293 .Pp
1294 See also
1295 .Sx \&Bd
1296 and
1297 .Sx \&Dl .
1298 .Ss \&Db
1299 This macro is obsolete.
1300 No replacement is needed.
1301 It is ignored by
1302 .Xr mandoc 1
1303 and groff including its arguments.
1304 It was formerly used to toggle a debugging mode.
1305 .Ss \&Dc
1306 Close a
1307 .Sx \&Do
1308 block.
1309 Does not have any tail arguments.
1310 .Ss \&Dd
1311 Document date for display in the page footer.
1312 This is the mandatory first macro of any
1313 .Nm
1314 manual.
1315 Its syntax is as follows:
1316 .Pp
1317 .D1 Pf \. Sx \&Dd Ar month day , year
1318 .Pp
1319 The
1320 .Ar month
1321 is the full English month name, the
1322 .Ar day
1323 is an optionally zero-padded numeral, and the
1324 .Ar year
1325 is the full four-digit year.
1326 .Pp
1327 Other arguments are not portable; the
1328 .Xr mandoc 1
1329 utility handles them as follows:
1330 .Bl -dash -offset 3n -compact
1331 .It
1332 To have the date automatically filled in by the
1333 .Ox
1334 version of
1335 .Xr cvs 1 ,
1336 the special string
1337 .Dq $\&Mdocdate$
1338 can be given as an argument.
1339 .It
1340 The traditional, purely numeric
1341 .Xr man 5
1342 format
1343 .Ar year Ns \(en Ns Ar month Ns \(en Ns Ar day
1344 is accepted, too.
1345 .It
1346 If a date string cannot be parsed, it is used verbatim.
1347 .It
1348 If no date string is given, the current date is used.
1349 .El
1350 .Pp
1351 Examples:
1352 .Dl \&.Dd $\&Mdocdate$
1353 .Dl \&.Dd $\&Mdocdate: July 21 2007$
1354 .Dl \&.Dd July 21, 2007
1355 .Pp
1356 See also
1357 .Sx \&Dt
1358 and
1359 .Sx \&Os .
1360 .Ss \&Dl
1361 One-line indented display.
1362 This is formatted as literal text and is useful for commands and
1363 invocations.
1364 It is followed by a newline.
1365 .Pp
1366 Examples:
1367 .Dl \&.Dl % mandoc mdoc.5 \e(ba less
1368 .Pp
1369 See also
1370 .Sx \&Ql ,
1371 .Sx \&Bd
1372 .Fl literal ,
1373 and
1374 .Sx \&D1 .
1375 .Ss \&Do
1376 Begin a block enclosed by double quotes.
1377 Does not have any head arguments.
1378 .Pp
1379 Examples:
1380 .Bd -literal -offset indent -compact
1381 \&.Do
1382 April is the cruellest month
1383 \&.Dc
1384 \e(em T.S. Eliot
1385 .Ed
1386 .Pp
1387 See also
1388 .Sx \&Dq .
1389 .Ss \&Dq
1390 Encloses its arguments in
1391 .Dq typographic
1392 double-quotes.
1393 .Pp
1394 Examples:
1395 .Bd -literal -offset indent -compact
1396 \&.Dq April is the cruellest month
1397 \e(em T.S. Eliot
1398 .Ed
1399 .Pp
1400 See also
1401 .Sx \&Qq ,
1402 .Sx \&Sq ,
1403 and
1404 .Sx \&Do .
1405 .Ss \&Dt
1406 Document title for display in the page header.
1407 This is the mandatory second macro of any
1408 .Nm
1409 file.
1410 Its syntax is as follows:
1411 .Bd -ragged -offset indent
1412 .Pf \. Sx \&Dt
1413 .Ar TITLE
1414 .Ar section
1415 .Op Ar arch
1416 .Ed
1417 .Pp
1418 Its arguments are as follows:
1419 .Bl -tag -width section -offset 2n
1420 .It Ar TITLE
1421 The document's title (name), defaulting to
1422 .Dq UNTITLED
1423 if unspecified.
1424 To achieve a uniform appearance of page header lines,
1425 it should by convention be all caps.
1426 .It Ar SECTION
1427 The manual section.
1428 It should correspond to the manual's filename suffix and defaults to
1429 the empty string if unspecified.
1430 This field is optional.
1431 To achieve a uniform appearance of page header lines,
1432 it should by convention be all caps.
1433 .It Ar arch
1434 This specifies the machine architecture a manual page applies to,
1435 where relevant.
1436 .El
1437 .Ss \&Dv
1438 Defined variables such as preprocessor constants, constant symbols,
1439 enumeration values, and so on.
1440 .Pp
1441 Examples:
1442 .Dl \&.Dv NULL
1443 .Dl \&.Dv BUFSIZ
1444 .Dl \&.Dv STDOUT_FILENO
1445 .Pp
1446 See also
1447 .Sx \&Er
1448 and
1449 .Sx \&Ev
1450 for special-purpose constants,
1451 .Sx \&Va
1452 for variable symbols, and
1453 .Sx \&Fd
1454 for listing preprocessor variable definitions in the
1455 .Em SYNOPSIS .
1456 .Ss \&Dx
1457 Format the
1458 .Dx
1459 version provided as an argument, or a default
1460 value if no argument is provided.
1461 .Pp
1462 Examples:
1463 .Dl \&.Dx 2.4.1
1464 .Dl \&.Dx
1465 .Pp
1466 See also
1467 .Sx \&At ,
1468 .Sx \&Bsx ,
1469 .Sx \&Bx ,
1470 .Sx \&Fx ,
1471 .Sx \&Nx ,
1472 and
1473 .Sx \&Ox .
1474 .Ss \&Ec
1475 Close a scope started by
1476 .Sx \&Eo .
1477 Its syntax is as follows:
1478 .Pp
1479 .D1 Pf \. Sx \&Ec Op Ar TERM
1480 .Pp
1481 The
1482 .Ar TERM
1483 argument is used as the enclosure tail, for example, specifying \e(rq
1484 will emulate
1485 .Sx \&Dc .
1486 .Ss \&Ed
1487 End a display context started by
1488 .Sx \&Bd .
1489 .Ss \&Ef
1490 End a font mode context started by
1491 .Sx \&Bf .
1492 .Ss \&Ek
1493 End a keep context started by
1494 .Sx \&Bk .
1495 .Ss \&El
1496 End a list context started by
1497 .Sx \&Bl .
1498 .Pp
1499 See also
1500 .Sx \&Bl
1501 and
1502 .Sx \&It .
1503 .Ss \&Em
1504 Request an italic font.
1505 If the output device does not provide that, underline.
1506 .Pp
1507 This is most often used for stress emphasis (not to be confused with
1508 importance, see
1509 .Sx \&Sy ) .
1510 In the rare cases where none of the semantic markup macros fit,
1511 it can also be used for technical terms and placeholders, except
1512 that for syntax elements,
1513 .Sx \&Sy
1514 and
1515 .Sx \&Ar
1516 are preferred, respectively.
1517 .Pp
1518 Examples:
1519 .Bd -literal -compact -offset indent
1520 Selected lines are those
1521 \&.Em not
1522 matching any of the specified patterns.
1523 Some of the functions use a
1524 \&.Em hold space
1525 to save the pattern space for subsequent retrieval.
1526 .Ed
1527 .Pp
1528 See also
1529 .Sx \&Bf ,
1530 .Sx \&Li ,
1531 .Sx \&No ,
1532 and
1533 .Sx \&Sy .
1534 .Ss \&En
1535 This macro is obsolete.
1536 Use
1537 .Sx \&Eo
1538 or any of the other enclosure macros.
1539 .Pp
1540 It encloses its argument in the delimiters specified by the last
1541 .Sx \&Es
1542 macro.
1543 .Ss \&Eo
1544 An arbitrary enclosure.
1545 Its syntax is as follows:
1546 .Pp
1547 .D1 Pf \. Sx \&Eo Op Ar TERM
1548 .Pp
1549 The
1550 .Ar TERM
1551 argument is used as the enclosure head, for example, specifying \e(lq
1552 will emulate
1553 .Sx \&Do .
1554 .Ss \&Er
1555 Error constants for definitions of the
1556 .Va errno
1557 libc global variable.
1558 This is most often used in section 2 and 3 manual pages.
1559 .Pp
1560 Examples:
1561 .Dl \&.Er EPERM
1562 .Dl \&.Er ENOENT
1563 .Pp
1564 See also
1565 .Sx \&Dv
1566 for general constants.
1567 .Ss \&Es
1568 This macro is obsolete.
1569 Use
1570 .Sx \&Eo
1571 or any of the other enclosure macros.
1572 .Pp
1573 It takes two arguments, defining the delimiters to be used by subsequent
1574 .Sx \&En
1575 macros.
1576 .Ss \&Ev
1577 Environmental variables such as those specified in
1578 .Xr environ 5 .
1579 .Pp
1580 Examples:
1581 .Dl \&.Ev DISPLAY
1582 .Dl \&.Ev PATH
1583 .Pp
1584 See also
1585 .Sx \&Dv
1586 for general constants.
1587 .Ss \&Ex
1588 Insert a standard sentence regarding command exit values of 0 on success
1589 and >0 on failure.
1590 This is most often used in section 1 and 1M manual pages.
1591 Its syntax is as follows:
1592 .Pp
1593 .D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
1594 .Pp
1595 If
1596 .Ar utility
1597 is not specified, the document's name set by
1598 .Sx \&Nm
1599 is used.
1600 Multiple
1601 .Ar utility
1602 arguments are treated as separate utilities.
1603 .Pp
1604 See also
1605 .Sx \&Rv .
1606 .Ss \&Fa
1607 Function argument or parameter.
1608 Its syntax is as follows:
1609 .Bd -ragged -offset indent
1610 .Pf \. Sx \&Fa
1611 .Qo
1612 .Op Ar argtype
1613 .Op Ar argname
1614 .Qc Ar \&...
1615 .Ed
1616 .Pp
1617 Each argument may be a name and a type (recommended for the
1618 .Em SYNOPSIS
1619 section), a name alone (for function invocations),
1620 or a type alone (for function prototypes).
1621 If both a type and a name are given or if the type consists of multiple
1622 words, all words belonging to the same function argument have to be
1623 given in a single argument to the
1624 .Sx \&Fa
1625 macro.
1626 .Pp
1627 This macro is also used to specify the field name of a structure.
1628 .Pp
1629 Most often, the
1630 .Sx \&Fa
1631 macro is used in the
1632 .Em SYNOPSIS
1633 within
1634 .Sx \&Fo
1635 blocks when documenting multi-line function prototypes.
1636 If invoked with multiple arguments, the arguments are separated by a
1637 comma.
1638 Furthermore, if the following macro is another
1639 .Sx \&Fa ,
1640 the last argument will also have a trailing comma.
1641 .Pp
1642 Examples:
1643 .Dl \&.Fa \(dqconst char *p\(dq
1644 .Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1645 .Dl \&.Fa \(dqchar *\(dq size_t
1646 .Pp
1647 See also
1648 .Sx \&Fo .
1649 .Ss \&Fc
1650 End a function context started by
1651 .Sx \&Fo .
1652 .Ss \&Fd
1653 Preprocessor directive, in particular for listing it in the
1654 .Em SYNOPSIS .
1655 Historically, it was also used to document include files.
1656 The latter usage has been deprecated in favour of
1657 .Sx \&In .
1658 .Pp
1659 Its syntax is as follows:
1660 .Bd -ragged -offset indent
1661 .Pf \. Sx \&Fd
1662 .Li # Ns Ar directive
1663 .Op Ar argument ...
1664 .Ed
1665 .Pp
1666 Examples:
1667 .Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler
1668 .Dl \&.Fd #define SIO_MAXNFDS
1669 .Dl \&.Fd #ifdef FS_DEBUG
1670 .Dl \&.Ft void
1671 .Dl \&.Fn dbg_open \(dqconst char *\(dq
1672 .Dl \&.Fd #endif
1673 .Pp
1674 See also
1675 .Sx MANUAL STRUCTURE ,
1676 .Sx \&In ,
1677 and
1678 .Sx \&Dv .
1679 .Ss \&Fl
1680 Command-line flag or option.
1681 Used when listing arguments to command-line utilities.
1682 Prints a fixed-width hyphen
1683 .Sq \-
1684 directly followed by each argument.
1685 If no arguments are provided, a hyphen is printed followed by a space.
1686 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1687 output.
1688 .Pp
1689 Examples:
1690 .Dl ".Fl R Op Fl H | L | P"
1691 .Dl ".Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux"
1692 .Dl ".Fl type Cm d Fl name Pa CVS"
1693 .Dl ".Fl Ar signal_number"
1694 .Dl ".Fl o Fl"
1695 .Pp
1696 See also
1697 .Sx \&Cm .
1698 .Ss \&Fn
1699 A function name.
1700 Its syntax is as follows:
1701 .Bd -ragged -offset indent
1702 .Pf \. Ns Sx \&Fn
1703 .Op Ar functype
1704 .Ar funcname
1705 .Op Oo Ar argtype Oc Ar argname
1706 .Ed
1707 .Pp
1708 Function arguments are surrounded in parenthesis and
1709 are delimited by commas.
1710 If no arguments are specified, blank parenthesis are output.
1711 In the
1712 .Em SYNOPSIS
1713 section, this macro starts a new output line,
1714 and a blank line is automatically inserted between function definitions.
1715 .Pp
1716 Examples:
1717 .Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq
1718 .Dl \&.Fn funcname \(dqint arg0\(dq
1719 .Dl \&.Fn funcname arg0
1720 .Pp
1721 .Bd -literal -offset indent -compact
1722 \&.Ft functype
1723 \&.Fn funcname
1724 .Ed
1725 .Pp
1726 When referring to a function documented in another manual page, use
1727 .Sx \&Xr
1728 instead.
1729 See also
1730 .Sx MANUAL STRUCTURE ,
1731 .Sx \&Fo ,
1732 and
1733 .Sx \&Ft .
1734 .Ss \&Fo
1735 Begin a function block.
1736 This is a multi-line version of
1737 .Sx \&Fn .
1738 Its syntax is as follows:
1739 .Pp
1740 .D1 Pf \. Sx \&Fo Ar funcname
1741 .Pp
1742 Invocations usually occur in the following context:
1743 .Bd -ragged -offset indent
1744 .Pf \. Sx \&Ft Ar functype
1745 .br
1746 .Pf \. Sx \&Fo Ar funcname
1747 .br
1748 .Pf \. Sx \&Fa Qq Ar argtype Ar argname
1749 .br
1750 \&.\.\.
1751 .br
1752 .Pf \. Sx \&Fc
1753 .Ed
1754 .Pp
1755 A
1756 .Sx \&Fo
1757 scope is closed by
1758 .Sx \&Fc .
1759 .Pp
1760 See also
1761 .Sx MANUAL STRUCTURE ,
1762 .Sx \&Fa ,
1763 .Sx \&Fc ,
1764 and
1765 .Sx \&Ft .
1766 .Ss \&Fr
1767 This macro is obsolete.
1768 No replacement markup is needed.
1769 .Pp
1770 It was used to show numerical function return values in an italic font.
1771 .Ss \&Ft
1772 A function type.
1773 Its syntax is as follows:
1774 .Pp
1775 .D1 Pf \. Sx \&Ft Ar functype
1776 .Pp
1777 In the
1778 .Em SYNOPSIS
1779 section, a new output line is started after this macro.
1780 .Pp
1781 Examples:
1782 .Dl \&.Ft int
1783 .Bd -literal -offset indent -compact
1784 \&.Ft functype
1785 \&.Fn funcname
1786 .Ed
1787 .Pp
1788 See also
1789 .Sx MANUAL STRUCTURE ,
1790 .Sx \&Fn ,
1791 and
1792 .Sx \&Fo .
1793 .Ss \&Fx
1794 Format the
1795 .Fx
1796 version provided as an argument, or a default value
1797 if no argument is provided.
1798 .Pp
1799 Examples:
1800 .Dl \&.Fx 7.1
1801 .Dl \&.Fx
1802 .Pp
1803 See also
1804 .Sx \&At ,
1805 .Sx \&Bsx ,
1806 .Sx \&Bx ,
1807 .Sx \&Dx ,
1808 .Sx \&Nx ,
1809 and
1810 .Sx \&Ox .
1811 .Ss \&Hf
1812 This macro is not implemented in
1813 .Xr mandoc 1 .
1814 .Pp
1815 It was used to include the contents of a (header) file literally.
1816 The syntax was:
1817 .Pp
1818 .Dl Pf . Sx \&Hf Ar filename
1819 .Ss \&Ic
1820 Designate an internal or interactive command.
1821 This is similar to
1822 .Sx \&Cm
1823 but used for instructions rather than values.
1824 .Pp
1825 Examples:
1826 .Dl \&.Ic :wq
1827 .Dl \&.Ic hash
1828 .Dl \&.Ic alias
1829 .Pp
1830 Note that using
1831 .Sx \&Bd Fl literal
1832 or
1833 .Sx \&D1
1834 is preferred for displaying code; the
1835 .Sx \&Ic
1836 macro is used when referring to specific instructions.
1837 .Ss \&In
1838 The name of an include file.
1839 This macro is most often used in section 2, 3, and 9 manual pages.
1840 .Pp
1841 When invoked as the first macro on an input line in the
1842 .Em SYNOPSIS
1843 section, the argument is displayed in angle brackets
1844 and preceded by
1845 .Qq #include ,
1846 and a blank line is inserted in front if there is a preceding
1847 function declaration.
1848 In other sections, it only encloses its argument in angle brackets
1849 and causes no line break.
1850 .Pp
1851 Examples:
1852 .Dl \&.In sys/types.h
1853 .Pp
1854 See also
1855 .Sx MANUAL STRUCTURE .
1856 .Ss \&It
1857 A list item.
1858 The syntax of this macro depends on the list type.
1859 .Pp
1860 Lists
1861 of type
1862 .Fl hang ,
1863 .Fl ohang ,
1864 .Fl inset ,
1865 and
1866 .Fl diag
1867 have the following syntax:
1868 .Pp
1869 .D1 Pf \. Sx \&It Ar args
1870 .Pp
1871 Lists of type
1872 .Fl bullet ,
1873 .Fl dash ,
1874 .Fl enum ,
1875 .Fl hyphen
1876 and
1877 .Fl item
1878 have the following syntax:
1879 .Pp
1880 .D1 Pf \. Sx \&It
1881 .Pp
1882 with subsequent lines interpreted within the scope of the
1883 .Sx \&It
1884 until either a closing
1885 .Sx \&El
1886 or another
1887 .Sx \&It .
1888 .Pp
1889 The
1890 .Fl tag
1891 list has the following syntax:
1892 .Pp
1893 .D1 Pf \. Sx \&It Op Cm args
1894 .Pp
1895 Subsequent lines are interpreted as with
1896 .Fl bullet
1897 and family.
1898 The line arguments correspond to the list's left-hand side; body
1899 arguments correspond to the list's contents.
1900 .Pp
1901 The
1902 .Fl column
1903 list is the most complicated.
1904 Its syntax is as follows:
1905 .Pp
1906 .D1 Pf \. Sx \&It Ar cell Op <TAB> Ar cell ...
1907 .D1 Pf \. Sx \&It Ar cell Op Sx \&Ta Ar cell ...
1908 .Pp
1909 The arguments consist of one or more lines of text and macros
1910 representing a complete table line.
1911 Cells within the line are delimited by tabs or by the special
1912 .Sx \&Ta
1913 block macro.
1914 The tab cell delimiter may only be used within the
1915 .Sx \&It
1916 line itself; on following lines, only the
1917 .Sx \&Ta
1918 macro can be used to delimit cells, and
1919 .Sx \&Ta
1920 is only recognised as a macro when called by other macros,
1921 not as the first macro on a line.
1922 .Pp
1923 Note that quoted strings may span tab-delimited cells on an
1924 .Sx \&It
1925 line.
1926 For example,
1927 .Pp
1928 .Dl .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1929 .Pp
1930 will preserve the semicolon whitespace except for the last.
1931 .Pp
1932 See also
1933 .Sx \&Bl .
1934 .Ss \&Lb
1935 Specify a library.
1936 The syntax is as follows:
1937 .Pp
1938 .D1 Pf \. Sx \&Lb Ar library
1939 .Pp
1940 The
1941 .Ar library
1942 parameter may be a system library, such as
1943 .Cm libz
1944 or
1945 .Cm libpam ,
1946 in which case a small library description is printed next to the linker
1947 invocation; or a custom library, in which case the library name is
1948 printed in quotes.
1949 This is most commonly used in the
1950 .Em SYNOPSIS
1951 section as described in
1952 .Sx MANUAL STRUCTURE .
1953 .Pp
1954 Examples:
1955 .Dl \&.Lb libz
1956 .Dl \&.Lb mdoc
1957 .Ss \&Li
1958 Denotes text that should be in a
1959 .Li literal
1960 font mode.
1961 Note that this is a presentation term and should not be used for
1962 stylistically decorating technical terms.
1963 .Pp
1964 On terminal output devices, this is often indistinguishable from
1965 normal text.
1966 .Pp
1967 See also
1968 .Sx \&Bf ,
1969 .Sx \&Em ,
1970 .Sx \&No ,
1971 and
1972 .Sx \&Sy .
1973 .Ss \&Lk
1974 Format a hyperlink.
1975 Its syntax is as follows:
1976 .Pp
1977 .D1 Pf \. Sx \&Lk Ar uri Op Ar name
1978 .Pp
1979 Examples:
1980 .Dl \&.Lk http://bsd.lv \(dqThe BSD.lv Project\(dq
1981 .Dl \&.Lk http://bsd.lv
1982 .Pp
1983 See also
1984 .Sx \&Mt .
1985 .Ss \&Lp
1986 Synonym for
1987 .Sx \&Pp .
1988 .Ss \&Ms
1989 Display a mathematical symbol.
1990 Its syntax is as follows:
1991 .Pp
1992 .D1 Pf \. Sx \&Ms Ar symbol
1993 .Pp
1994 Examples:
1995 .Dl \&.Ms sigma
1996 .Dl \&.Ms aleph
1997 .Ss \&Mt
1998 Format a
1999 .Dq mailto:
2000 hyperlink.
2001 Its syntax is as follows:
2002 .Pp
2003 .D1 Pf \. Sx \&Mt Ar address
2004 .Pp
2005 Examples:
2006 .Dl \&.Mt discuss@manpages.bsd.lv
2007 .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
2008 .Ss \&Nd
2009 A one line description of the manual's content.
2010 This is the mandatory last macro of the
2011 .Em NAME
2012 section and not appropriate for other sections.
2013 .Pp
2014 Examples:
2015 .Dl Pf . Sx \&Nd mdoc language reference
2016 .Dl Pf . Sx \&Nd format and display UNIX manuals
2017 .Pp
2018 The
2019 .Sx \&Nd
2020 macro technically accepts child macros and terminates with a subsequent
2021 .Sx \&Sh
2022 invocation.
2023 Do not assume this behaviour: some
2024 .Xr whatis 1
2025 database generators are not smart enough to parse more than the line
2026 arguments and will display macros verbatim.
2027 .Pp
2028 See also
2029 .Sx \&Nm .
2030 .Ss \&Nm
2031 The name of the manual page, or \(em in particular in section 1
2032 pages \(em of an additional command or feature documented in
2033 the manual page.
2034 When first invoked, the
2035 .Sx \&Nm
2036 macro expects a single argument, the name of the manual page.
2037 Usually, the first invocation happens in the
2038 .Em NAME
2039 section of the page.
2040 The specified name will be remembered and used whenever the macro is
2041 called again without arguments later in the page.
2042 The
2043 .Sx \&Nm
2044 macro uses
2045 .Sx Block full-implicit
2046 semantics when invoked as the first macro on an input line in the
2047 .Em SYNOPSIS
2048 section; otherwise, it uses ordinary
2049 .Sx In-line
2050 semantics.
2051 .Pp
2052 Examples:
2053 .Bd -literal -offset indent
2054 \&.Sh SYNOPSIS
2055 \&.Nm cat
2056 \&.Op Fl benstuv
2057 \&.Op Ar
2058 .Ed
2059 .Pp
2060 In the
2061 .Em SYNOPSIS
2062 of section 2, 3 and 9 manual pages, use the
2063 .Sx \&Fn
2064 macro rather than
2065 .Sx \&Nm
2066 to mark up the name of the manual page.
2067 .Ss \&No
2068 Normal text.
2069 Closes the scope of any preceding in-line macro.
2070 When used after physical formatting macros like
2071 .Sx \&Em
2072 or
2073 .Sx \&Sy ,
2074 switches back to the standard font face and weight.
2075 Can also be used to embed plain text strings in macro lines
2076 using semantic annotation macros.
2077 .Pp
2078 Examples:
2079 .Dl ".Em italic , Sy bold , No and roman"
2080 .Pp
2081 .Bd -literal -offset indent -compact
2082 \&.Sm off
2083 \&.Cm :C No / Ar pattern No / Ar replacement No /
2084 \&.Sm on
2085 .Ed
2086 .Pp
2087 See also
2088 .Sx \&Em ,
2089 .Sx \&Li ,
2090 and
2091 .Sx \&Sy .
2092 .Ss \&Ns
2093 Suppress a space between the output of the preceding macro
2094 and the following text or macro.
2095 Following invocation, input is interpreted as normal text
2096 just like after an
2097 .Sx \&No
2098 macro.
2099 .Pp
2100 This has no effect when invoked at the start of a macro line.
2101 .Pp
2102 Examples:
2103 .Dl ".Ar name Ns = Ns Ar value"
2104 .Dl ".Cm :M Ns Ar pattern"
2105 .Dl ".Fl o Ns Ar output"
2106 .Pp
2107 See also
2108 .Sx \&No
2109 and
2110 .Sx \&Sm .
2111 .Ss \&Nx
2112 Format the
2113 .Nx
2114 version provided as an argument, or a default value if
2115 no argument is provided.
2116 .Pp
2117 Examples:
2118 .Dl \&.Nx 5.01
2119 .Dl \&.Nx
2120 .Pp
2121 See also
2122 .Sx \&At ,
2123 .Sx \&Bsx ,
2124 .Sx \&Bx ,
2125 .Sx \&Dx ,
2126 .Sx \&Fx ,
2127 and
2128 .Sx \&Ox .
2129 .Ss \&Oc
2130 Close multi-line
2131 .Sx \&Oo
2132 context.
2133 .Ss \&Oo
2134 Multi-line version of
2135 .Sx \&Op .
2136 .Pp
2137 Examples:
2138 .Bd -literal -offset indent -compact
2139 \&.Oo
2140 \&.Op Fl flag Ns Ar value
2141 \&.Oc
2142 .Ed
2143 .Ss \&Op
2144 Optional part of a command line.
2145 Prints the argument(s) in brackets.
2146 This is most often used in the
2147 .Em SYNOPSIS
2148 section of section 1 and 1M manual pages.
2149 .Pp
2150 Examples:
2151 .Dl \&.Op \&Fl a \&Ar b
2152 .Dl \&.Op \&Ar a | b
2153 .Pp
2154 See also
2155 .Sx \&Oo .
2156 .Ss \&Os
2157 Operating system version for display in the page footer.
2158 This is the mandatory third macro of
2159 any
2160 .Nm
2161 file.
2162 Its syntax is as follows:
2163 .Pp
2164 .D1 Pf \. Sx \&Os Op Ar system Op Ar version
2165 .Pp
2166 The optional
2167 .Ar system
2168 parameter specifies the relevant operating system or environment.
2169 It is suggested to leave it unspecified, in which case
2170 .Xr mandoc 1
2171 uses its
2172 .Fl Ios
2173 argument, or, if that isn't specified either,
2174 .Fa sysname
2175 and
2176 .Fa release
2177 as returned by
2178 .Xr uname 3 .
2179 .Pp
2180 Examples:
2181 .Dl \&.Os
2182 .Dl \&.Os KTH/CSC/TCS
2183 .Dl \&.Os BSD 4.3
2184 .Pp
2185 See also
2186 .Sx \&Dd
2187 and
2188 .Sx \&Dt .
2189 .Ss \&Ot
2190 This macro is obsolete.
2191 Use
2192 .Sx \&Ft
2193 instead; with
2194 .Xr mandoc 1 ,
2195 both have the same effect.
2196 .Pp
2197 Historical
2198 .Nm
2199 packages described it as
2200 .Dq "old function type (FORTRAN)" .
2201 .Ss \&Ox
2202 Format the
2203 .Ox
2204 version provided as an argument, or a default value
2205 if no argument is provided.
2206 .Pp
2207 Examples:
2208 .Dl \&.Ox 4.5
2209 .Dl \&.Ox
2210 .Pp
2211 See also
2212 .Sx \&At ,
2213 .Sx \&Bsx ,
2214 .Sx \&Bx ,
2215 .Sx \&Dx ,
2216 .Sx \&Fx ,
2217 and
2218 .Sx \&Nx .
2219 .Ss \&Pa
2220 An absolute or relative file system path, or a file or directory name.
2221 If an argument is not provided, the character
2222 .Sq \(ti
2223 is used as a default.
2224 .Pp
2225 Examples:
2226 .Dl \&.Pa /usr/bin/mandoc
2227 .Dl \&.Pa /usr/share/man/man5/mdoc.5
2228 .Pp
2229 See also
2230 .Sx \&Lk .
2231 .Ss \&Pc
2232 Close parenthesised context opened by
2233 .Sx \&Po .
2234 .Ss \&Pf
2235 Removes the space between its argument
2236 .Pq Dq prefix
2237 and the following macro.
2238 Its syntax is as follows:
2239 .Pp
2240 .D1 .Pf Ar prefix macro arguments ...
2241 .Pp
2242 This is equivalent to:
2243 .Pp
2244 .D1 .No Ar prefix No \&Ns Ar macro arguments ...
2245 .Pp
2246 Examples:
2247 .Dl ".Pf $ Ar variable_name"
2248 .Dl ".Pf 0x Ar hex_digits"
2249 .Pp
2250 See also
2251 .Sx \&Ns
2252 and
2253 .Sx \&Sm .
2254 .Ss \&Po
2255 Multi-line version of
2256 .Sx \&Pq .
2257 .Ss \&Pp
2258 Break a paragraph.
2259 This will assert vertical space between prior and subsequent macros
2260 and/or text.
2261 .Pp
2262 Paragraph breaks are not needed before or after
2263 .Sx \&Sh
2264 or
2265 .Sx \&Ss
2266 macros or before displays
2267 .Pq Sx \&Bd
2268 or lists
2269 .Pq Sx \&Bl
2270 unless the
2271 .Fl compact
2272 flag is given.
2273 .Ss \&Pq
2274 Parenthesised enclosure.
2275 .Pp
2276 See also
2277 .Sx \&Po .
2278 .Ss \&Qc
2279 Close quoted context opened by
2280 .Sx \&Qo .
2281 .Ss \&Ql
2282 In-line literal display.
2283 This can for example be used for complete command invocations and
2284 for multi-word code fragments when more specific markup is not
2285 appropriate and an indented display is not desired.
2286 While
2287 .Xr mandoc 1
2288 always encloses the arguments in single quotes, other formatters
2289 usually omit the quotes on non-terminal output devices when the
2290 arguments have three or more characters.
2291 .Pp
2292 See also
2293 .Sx \&Dl
2294 and
2295 .Sx \&Bd
2296 .Fl literal .
2297 .Ss \&Qo
2298 Multi-line version of
2299 .Sx \&Qq .
2300 .Ss \&Qq
2301 Encloses its arguments in
2302 .Qq typewriter
2303 double-quotes.
2304 Consider using
2305 .Sx \&Dq .
2306 .Pp
2307 See also
2308 .Sx \&Dq ,
2309 .Sx \&Sq ,
2310 and
2311 .Sx \&Qo .
2312 .Ss \&Re
2313 Close an
2314 .Sx \&Rs
2315 block.
2316 Does not have any tail arguments.
2317 .Ss \&Rs
2318 Begin a bibliographic
2319 .Pq Dq reference
2320 block.
2321 Does not have any head arguments.
2322 The block macro may only contain
2323 .Sx \&%A ,
2324 .Sx \&%B ,
2325 .Sx \&%C ,
2326 .Sx \&%D ,
2327 .Sx \&%I ,
2328 .Sx \&%J ,
2329 .Sx \&%N ,
2330 .Sx \&%O ,
2331 .Sx \&%P ,
2332 .Sx \&%Q ,
2333 .Sx \&%R ,
2334 .Sx \&%T ,
2335 .Sx \&%U ,
2336 and
2337 .Sx \&%V
2338 child macros (at least one must be specified).
2339 .Pp
2340 Examples:
2341 .Bd -literal -offset indent -compact
2342 \&.Rs
2343 \&.%A J. E. Hopcroft
2344 \&.%A J. D. Ullman
2345 \&.%B Introduction to Automata Theory, Languages, and Computation
2346 \&.%I Addison-Wesley
2347 \&.%C Reading, Massachusettes
2348 \&.%D 1979
2349 \&.Re
2350 .Ed
2351 .Pp
2352 If an
2353 .Sx \&Rs
2354 block is used within a SEE ALSO section, a vertical space is asserted
2355 before the rendered output, else the block continues on the current
2356 line.
2357 .Ss \&Rv
2358 Insert a standard sentence regarding a function call's return value of 0
2359 on success and \-1 on error, with the
2360 .Va errno
2361 libc global variable set on error.
2362 Its syntax is as follows:
2363 .Pp
2364 .D1 Pf \. Sx \&Rv Fl std Op Ar function ...
2365 .Pp
2366 If
2367 .Ar function
2368 is not specified, the document's name set by
2369 .Sx \&Nm
2370 is used.
2371 Multiple
2372 .Ar function
2373 arguments are treated as separate functions.
2374 .Pp
2375 See also
2376 .Sx \&Ex .
2377 .Ss \&Sc
2378 Close single-quoted context opened by
2379 .Sx \&So .
2380 .Ss \&Sh
2381 Begin a new section.
2382 For a list of conventional manual sections, see
2383 .Sx MANUAL STRUCTURE .
2384 These sections should be used unless it's absolutely necessary that
2385 custom sections be used.
2386 .Pp
2387 Section names should be unique so that they may be keyed by
2388 .Sx \&Sx .
2389 Although this macro is parsed, it should not consist of child node or it
2390 may not be linked with
2391 .Sx \&Sx .
2392 .Pp
2393 See also
2394 .Sx \&Pp ,
2395 .Sx \&Ss ,
2396 and
2397 .Sx \&Sx .
2398 .Ss \&Sm
2399 Switches the spacing mode for output generated from macros.
2400 Its syntax is as follows:
2401 .Pp
2402 .D1 Pf \. Sx \&Sm Op Cm on | off
2403 .Pp
2404 By default, spacing is
2405 .Cm on .
2406 When switched
2407 .Cm off ,
2408 no white space is inserted between macro arguments and between the
2409 output generated from adjacent macros, but text lines
2410 still get normal spacing between words and sentences.
2411 .Pp
2412 When called without an argument, the
2413 .Sx \&Sm
2414 macro toggles the spacing mode.
2415 Using this is not recommended because it makes the code harder to read.
2416 .Ss \&So
2417 Multi-line version of
2418 .Sx \&Sq .
2419 .Ss \&Sq
2420 Encloses its arguments in
2421 .Sq typewriter
2422 single-quotes.
2423 .Pp
2424 See also
2425 .Sx \&Dq ,
2426 .Sx \&Qq ,
2427 and
2428 .Sx \&So .
2429 .Ss \&Ss
2430 Begin a new subsection.
2431 Unlike with
2432 .Sx \&Sh ,
2433 there is no convention for the naming of subsections.
2434 Except
2435 .Em DESCRIPTION ,
2436 the conventional sections described in
2437 .Sx MANUAL STRUCTURE
2438 rarely have subsections.
2439 .Pp
2440 Sub-section names should be unique so that they may be keyed by
2441 .Sx \&Sx .
2442 Although this macro is parsed, it should not consist of child node or it
2443 may not be linked with
2444 .Sx \&Sx .
2445 .Pp
2446 See also
2447 .Sx \&Pp ,
2448 .Sx \&Sh ,
2449 and
2450 .Sx \&Sx .
2451 .Ss \&St
2452 Replace an abbreviation for a standard with the full form.
2453 The following standards are recognised.
2454 Where multiple lines are given without a blank line in between,
2455 they all refer to the same standard, and using the first form
2456 is recommended.
2457 .Bl -tag -width 1n
2458 .It C language standards
2459 .Pp
2460 .Bl -tag -width "-p1003.1g-2000" -compact
2461 .It \-ansiC
2462 .St -ansiC
2463 .It \-ansiC-89
2464 .St -ansiC-89
2465 .It \-isoC
2466 .St -isoC
2467 .It \-isoC-90
2468 .St -isoC-90
2469 .br
2470 The original C standard.
2471 .Pp
2472 .It \-isoC-amd1
2473 .St -isoC-amd1
2474 .Pp
2475 .It \-isoC-tcor1
2476 .St -isoC-tcor1
2477 .Pp
2478 .It \-isoC-tcor2
2479 .St -isoC-tcor2
2480 .Pp
2481 .It \-isoC-99
2482 .St -isoC-99
2483 .br
2484 The second major version of the C language standard.
2485 .Pp
2486 .It \-isoC-2011
2487 .St -isoC-2011
2488 .br
2489 The third major version of the C language standard.
2490 .El
2491 .It POSIX.1 before the Single UNIX Specification
2492 .Pp
2493 .Bl -tag -width "-p1003.1g-2000" -compact
2494 .It \-p1003.1-88
2495 .St -p1003.1-88
2496 .It \-p1003.1
2497 .St -p1003.1
2498 .br
2499 The original POSIX standard, based on ANSI C.
2500 .Pp
2501 .It \-p1003.1-90
2502 .St -p1003.1-90
2503 .It \-iso9945-1-90
2504 .St -iso9945-1-90
2505 .br
2506 The first update of POSIX.1.
2507 .Pp
2508 .It \-p1003.1b-93
2509 .St -p1003.1b-93
2510 .It \-p1003.1b
2511 .St -p1003.1b
2512 .br
2513 Real-time extensions.
2514 .Pp
2515 .It \-p1003.1c-95
2516 .St -p1003.1c-95
2517 .br
2518 POSIX thread interfaces.
2519 .Pp
2520 .It \-p1003.1i-95
2521 .St -p1003.1i-95
2522 .br
2523 Technical Corrigendum.
2524 .Pp
2525 .It \-p1003.1-96
2526 .St -p1003.1-96
2527 .It \-iso9945-1-96
2528 .St -iso9945-1-96
2529 .br
2530 Includes POSIX.1-1990, 1b, 1c, and 1i.
2531 .El
2532 .It X/Open Portability Guide version 4 and related standards
2533 .Pp
2534 .Bl -tag -width "-p1003.1g-2000" -compact
2535 .It \-xpg3
2536 .St -xpg3
2537 .br
2538 An XPG4 precursor, published in 1989.
2539 .Pp
2540 .It \-p1003.2
2541 .St -p1003.2
2542 .It \-p1003.2-92
2543 .St -p1003.2-92
2544 .It \-iso9945-2-93
2545 .St -iso9945-2-93
2546 .br
2547 An XCU4 precursor.
2548 .Pp
2549 .It \-p1003.2a-92
2550 .St -p1003.2a-92
2551 .br
2552 Updates to POSIX.2.
2553 .Pp
2554 .It \-xpg4
2555 .St -xpg4
2556 .br
2557 Based on POSIX.1 and POSIX.2, published in 1992.
2558 .El
2559 .It Single UNIX Specification version 1 and related standards
2560 .Pp
2561 .Bl -tag -width "-p1003.1g-2000" -compact
2562 .It \-susv1
2563 .St -susv1
2564 .It \-xpg4.2
2565 .St -xpg4.2
2566 .br
2567 This standard was published in 1994.
2568 It was used as the basis for UNIX 95 certification.
2569 The following three refer to parts of it.
2570 .Pp
2571 .It \-xsh4.2
2572 .St -xsh4.2
2573 .Pp
2574 .It \-xcurses4.2
2575 .St -xcurses4.2
2576 .Pp
2577 .It \-p1003.1g-2000
2578 .St -p1003.1g-2000
2579 .br
2580 Networking APIs, including sockets.
2581 .Pp
2582 .It \-svid4
2583 .St -svid4 ,
2584 .br
2585 Published in 1995.
2586 .El
2587 .It Single UNIX Specification version 2 and related standards
2588 .Pp
2589 .Bl -tag -width "-p1003.1g-2000" -compact
2590 .It \-susv2
2591 .St -susv2
2592 This Standard was published in 1997
2593 and is also called X/Open Portability Guide version 5.
2594 It was used as the basis for UNIX 98 certification.
2595 The following refer to parts of it.
2596 .Pp
2597 .It \-xbd5
2598 .St -xbd5
2599 .Pp
2600 .It \-xsh5
2601 .St -xsh5
2602 .Pp
2603 .It \-xcu5
2604 .St -xcu5
2605 .Pp
2606 .It \-xns5
2607 .St -xns5
2608 .It \-xns5.2
2609 .St -xns5.2
2610 .El
2611 .It Single UNIX Specification version 3
2612 .Pp
2613 .Bl -tag -width "-p1003.1-2001" -compact
2614 .It \-p1003.1-2001
2615 .St -p1003.1-2001
2616 .It \-susv3
2617 .St -susv3
2618 .br
2619 This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j.
2620 It is also called X/Open Portability Guide version 6.
2621 It is used as the basis for UNIX 03 certification.
2622 .Pp
2623 .It \-p1003.1-2004
2624 .St -p1003.1-2004
2625 .br
2626 The second and last Technical Corrigendum.
2627 .El
2628 .It Single UNIX Specification version 4
2629 .Pp
2630 .Bl -tag -width "-p1003.1g-2000" -compact
2631 .It \-p1003.1-2008
2632 .St -p1003.1-2008
2633 .It \-susv4
2634 .St -susv4
2635 .br
2636 This standard is also called
2637 X/Open Portability Guide version 7.
2638 .Pp
2639 .It \-p1003.1-2013
2640 .St -p1003.1-2013
2641 .br
2642 This is the first Technical Corrigendum.
2643 .El
2644 .It Other standards
2645 .Pp
2646 .Bl -tag -width "-p1003.1g-2000" -compact
2647 .It \-ieee754
2648 .St -ieee754
2649 .br
2650 Floating-point arithmetic.
2651 .Pp
2652 .It \-iso8601
2653 .St -iso8601
2654 .br
2655 Representation of dates and times, published in 1988.
2656 .Pp
2657 .It \-iso8802-3
2658 .St -iso8802-3
2659 .br
2660 Ethernet local area networks.
2661 .Pp
2662 .It \-ieee1275-94
2663 .St -ieee1275-94
2664 .El
2665 .El
2666 .Ss \&Sx
2667 Reference a section or subsection in the same manual page.
2668 The referenced section or subsection name must be identical to the
2669 enclosed argument, including whitespace.
2670 .Pp
2671 Examples:
2672 .Dl \&.Sx MANUAL STRUCTURE
2673 .Pp
2674 See also
2675 .Sx \&Sh
2676 and
2677 .Sx \&Ss .
2678 .Ss \&Sy
2679 Request a boldface font.
2680 .Pp
2681 This is most often used to indicate importance or seriousness (not to be
2682 confused with stress emphasis, see
2683 .Sx \&Em ) .
2684 When none of the semantic macros fit, it is also adequate for syntax
2685 elements that have to be given or that appear verbatim.
2686 .Pp
2687 Examples:
2688 .Bd -literal -compact -offset indent
2689 \&.Sy Warning :
2690 If
2691 \&.Sy s
2692 appears in the owner permissions, set-user-ID mode is set.
2693 This utility replaces the former
2694 \&.Sy dumpdir
2695 program.
2696 .Ed
2697 .Pp
2698 See also
2699 .Sx \&Bf ,
2700 .Sx \&Em ,
2701 .Sx \&Li ,
2702 and
2703 .Sx \&No .
2704 .Ss \&Ta
2705 Table cell separator in
2706 .Sx \&Bl Fl column
2707 lists; can only be used below
2708 .Sx \&It .
2709 .Ss \&Tn
2710 Supported only for compatibility, do not use this in new manuals.
2711 Even though the macro name
2712 .Pq Dq tradename
2713 suggests a semantic function, historic usage is inconsistent, mostly
2714 using it as a presentation-level macro to request a small caps font.
2715 .Ss \&Ud
2716 Supported only for compatibility, do not use this in new manuals.
2717 Prints out
2718 .Dq currently under development.
2719 .Ss \&Ux
2720 Supported only for compatibility, do not use this in new manuals.
2721 Prints out
2722 .Dq Ux .
2723 .Ss \&Va
2724 A variable name.
2725 .Pp
2726 Examples:
2727 .Dl \&.Va foo
2728 .Dl \&.Va const char *bar ;
2729 .Pp
2730 For function arguments and parameters, use
2731 .Sx \&Fa
2732 instead.
2733 For declarations of global variables in the
2734 .Em SYNOPSIS
2735 section, use
2736 .Sx \&Vt .
2737 .Ss \&Vt
2738 A variable type.
2739 .Pp
2740 This is also used for indicating global variables in the
2741 .Em SYNOPSIS
2742 section, in which case a variable name is also specified.
2743 Note that it accepts
2744 .Sx Block partial-implicit
2745 syntax when invoked as the first macro on an input line in the
2746 .Em SYNOPSIS
2747 section, else it accepts ordinary
2748 .Sx In-line
2749 syntax.
2750 In the former case, this macro starts a new output line,
2751 and a blank line is inserted in front if there is a preceding
2752 function definition or include directive.
2753 .Pp
2754 Examples:
2755 .Dl \&.Vt unsigned char
2756 .Dl \&.Vt extern const char * const sys_signame[] \&;
2757 .Pp
2758 For parameters in function prototypes, use
2759 .Sx \&Fa
2760 instead, for function return types
2761 .Sx \&Ft ,
2762 and for variable names outside the
2763 .Em SYNOPSIS
2764 section
2765 .Sx \&Va ,
2766 even when including a type with the name.
2767 See also
2768 .Sx MANUAL STRUCTURE .
2769 .Ss \&Xc
2770 Close a scope opened by
2771 .Sx \&Xo .
2772 .Ss \&Xo
2773 Extend the header of an
2774 .Sx \&It
2775 macro or the body of a partial-implicit block macro
2776 beyond the end of the input line.
2777 This macro originally existed to work around the 9-argument limit
2778 of historic
2779 .Xr mandoc_roff 5 .
2780 .Ss \&Xr
2781 Link to another manual
2782 .Pq Qq cross-reference .
2783 Its syntax is as follows:
2784 .Pp
2785 .D1 Pf \. Sx \&Xr Ar name Op section
2786 .Pp
2787 Cross reference the
2788 .Ar name
2789 and
2790 .Ar section
2791 number of another man page;
2792 omitting the section number is rarely useful.
2793 .Pp
2794 Examples:
2795 .Dl \&.Xr mandoc 1
2796 .Dl \&.Xr mandoc 1 \&;
2797 .Dl \&.Xr mandoc 1 \&Ns s behaviour
2798 .Ss \&br
2799 Emits a line-break.
2800 This macro should not be used; it is implemented for compatibility with
2801 historical manuals.
2802 .Pp
2803 Consider using
2804 .Sx \&Pp
2805 in the event of natural paragraph breaks.
2806 .Ss \&sp
2807 Emits vertical space.
2808 This macro should not be used; it is implemented for compatibility with
2809 historical manuals.
2810 Its syntax is as follows:
2811 .Pp
2812 .D1 Pf \. Sx \&sp Op Ar height
2813 .Pp
2814 The
2815 .Ar height
2816 argument is a scaling width as described in
2817 .Xr mandoc_roff 5 .
2818 If unspecified,
2819 .Sx \&sp
2820 asserts a single vertical space.
2821 .Sh MACRO SYNTAX
2822 The syntax of a macro depends on its classification.
2823 In this section,
2824 .Sq \-arg
2825 refers to macro arguments, which may be followed by zero or more
2826 .Sq parm
2827 parameters;
2828 .Sq \&Yo
2829 opens the scope of a macro; and if specified,
2830 .Sq \&Yc
2831 closes it out.
2832 .Pp
2833 The
2834 .Em Callable
2835 column indicates that the macro may also be called by passing its name
2836 as an argument to another macro.
2837 For example,
2838 .Sq \&.Op \&Fl O \&Ar file
2839 produces
2840 .Sq Op Fl O Ar file .
2841 To prevent a macro call and render the macro name literally,
2842 escape it by prepending a zero-width space,
2843 .Sq \e& .
2844 For example,
2845 .Sq \&Op \e&Fl O
2846 produces
2847 .Sq Op \&Fl O .
2848 If a macro is not callable but its name appears as an argument
2849 to another macro, it is interpreted as opaque text.
2850 For example,
2851 .Sq \&.Fl \&Sh
2852 produces
2853 .Sq Fl \&Sh .
2854 .Pp
2855 The
2856 .Em Parsed
2857 column indicates whether the macro may call other macros by receiving
2858 their names as arguments.
2859 If a macro is not parsed but the name of another macro appears
2860 as an argument, it is interpreted as opaque text.
2861 .Pp
2862 The
2863 .Em Scope
2864 column, if applicable, describes closure rules.
2865 .Ss Block full-explicit
2866 Multi-line scope closed by an explicit closing macro.
2867 All macros contains bodies; only
2868 .Sx \&Bf
2869 and
2870 .Pq optionally
2871 .Sx \&Bl
2872 contain a head.
2873 .Bd -literal -offset indent
2874 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2875 \(lBbody...\(rB
2876 \&.Yc
2877 .Ed
2878 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent
2879 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2880 .It Sx \&Bd  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ed
2881 .It Sx \&Bf  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ef
2882 .It Sx \&Bk  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ek
2883 .It Sx \&Bl  Ta    \&No     Ta    \&No     Ta    closed by Sx \&El
2884 .It Sx \&Ed  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bd
2885 .It Sx \&Ef  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bf
2886 .It Sx \&Ek  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bk
2887 .It Sx \&El  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bl
2888 .El
2889 .Ss Block full-implicit
2890 Multi-line scope closed by end-of-file or implicitly by another macro.
2891 All macros have bodies; some
2892 .Po
2893 .Sx \&It Fl bullet ,
2894 .Fl hyphen ,
2895 .Fl dash ,
2896 .Fl enum ,
2897 .Fl item
2898 .Pc
2899 don't have heads; only one
2900 .Po
2901 .Sx \&It
2902 in
2903 .Sx \&Bl Fl column
2904 .Pc
2905 has multiple heads.
2906 .Bd -literal -offset indent
2907 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
2908 \(lBbody...\(rB
2909 .Ed
2910 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent
2911 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2912 .It Sx \&It Ta \&No Ta Yes  Ta closed by Sx \&It , Sx \&El
2913 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
2914 .It Sx \&Nm Ta \&No Ta Yes  Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
2915 .It Sx \&Sh Ta \&No Ta Yes  Ta closed by Sx \&Sh
2916 .It Sx \&Ss Ta \&No Ta Yes  Ta closed by Sx \&Sh , Sx \&Ss
2917 .El
2918 .Pp
2919 Note that the
2920 .Sx \&Nm
2921 macro is a
2922 .Sx Block full-implicit
2923 macro only when invoked as the first macro
2924 in a
2925 .Em SYNOPSIS
2926 section line, else it is
2927 .Sx In-line .
2928 .Ss Block partial-explicit
2929 Like block full-explicit, but also with single-line scope.
2930 Each has at least a body and, in limited circumstances, a head
2931 .Po
2932 .Sx \&Fo ,
2933 .Sx \&Eo
2934 .Pc
2935 and/or tail
2936 .Pq Sx \&Ec .
2937 .Bd -literal -offset indent
2938 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2939 \(lBbody...\(rB
2940 \&.Yc \(lBtail...\(rB
2941 
2942 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
2943 \(lBbody...\(rB \&Yc \(lBtail...\(rB
2944 .Ed
2945 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
2946 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2947 .It Sx \&Ac  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Ao
2948 .It Sx \&Ao  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ac
2949 .It Sx \&Bc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Bo
2950 .It Sx \&Bo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bc
2951 .It Sx \&Brc Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bro
2952 .It Sx \&Bro Ta    Yes      Ta    Yes      Ta    closed by Sx \&Brc
2953 .It Sx \&Dc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Do
2954 .It Sx \&Do  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Dc
2955 .It Sx \&Ec  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Eo
2956 .It Sx \&Eo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ec
2957 .It Sx \&Fc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Fo
2958 .It Sx \&Fo  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Fc
2959 .It Sx \&Oc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oo
2960 .It Sx \&Oo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oc
2961 .It Sx \&Pc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Po
2962 .It Sx \&Po  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Pc
2963 .It Sx \&Qc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oo
2964 .It Sx \&Qo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oc
2965 .It Sx \&Re  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Rs
2966 .It Sx \&Rs  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Re
2967 .It Sx \&Sc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&So
2968 .It Sx \&So  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Sc
2969 .It Sx \&Xc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Xo
2970 .It Sx \&Xo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Xc
2971 .El
2972 .Ss Block partial-implicit
2973 Like block full-implicit, but with single-line scope closed by the
2974 end of the line.
2975 .Bd -literal -offset indent
2976 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
2977 .Ed
2978 .Bl -column "MacroX" "CallableX" "ParsedX" -offset indent
2979 .It Em Macro Ta Em Callable Ta Em Parsed
2980 .It Sx \&Aq  Ta    Yes      Ta    Yes
2981 .It Sx \&Bq  Ta    Yes      Ta    Yes
2982 .It Sx \&Brq Ta    Yes      Ta    Yes
2983 .It Sx \&D1  Ta    \&No     Ta    \&Yes
2984 .It Sx \&Dl  Ta    \&No     Ta    Yes
2985 .It Sx \&Dq  Ta    Yes      Ta    Yes
2986 .It Sx \&En  Ta    Yes      Ta    Yes
2987 .It Sx \&Op  Ta    Yes      Ta    Yes
2988 .It Sx \&Pq  Ta    Yes      Ta    Yes
2989 .It Sx \&Ql  Ta    Yes      Ta    Yes
2990 .It Sx \&Qq  Ta    Yes      Ta    Yes
2991 .It Sx \&Sq  Ta    Yes      Ta    Yes
2992 .It Sx \&Vt  Ta    Yes      Ta    Yes
2993 .El
2994 .Pp
2995 Note that the
2996 .Sx \&Vt
2997 macro is a
2998 .Sx Block partial-implicit
2999 only when invoked as the first macro
3000 in a
3001 .Em SYNOPSIS
3002 section line, else it is
3003 .Sx In-line .
3004 .Ss Special block macro
3005 The
3006 .Sx \&Ta
3007 macro can only be used below
3008 .Sx \&It
3009 in
3010 .Sx \&Bl Fl column
3011 lists.
3012 It delimits blocks representing table cells;
3013 these blocks have bodies, but no heads.
3014 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
3015 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
3016 .It Sx \&Ta  Ta    Yes      Ta    Yes    Ta closed by Sx \&Ta , Sx \&It
3017 .El
3018 .Ss In-line
3019 Closed by the end of the line, fixed argument lengths,
3020 and/or subsequent macros.
3021 In-line macros have only text children.
3022 If a number (or inequality) of arguments is
3023 .Pq n ,
3024 then the macro accepts an arbitrary number of arguments.
3025 .Bd -literal -offset indent
3026 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
3027 
3028 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
3029 
3030 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
3031 .Ed
3032 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent
3033 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
3034 .It Sx \&%A  Ta    \&No     Ta    \&No     Ta    >0
3035 .It Sx \&%B  Ta    \&No     Ta    \&No     Ta    >0
3036 .It Sx \&%C  Ta    \&No     Ta    \&No     Ta    >0
3037 .It Sx \&%D  Ta    \&No     Ta    \&No     Ta    >0
3038 .It Sx \&%I  Ta    \&No     Ta    \&No     Ta    >0
3039 .It Sx \&%J  Ta    \&No     Ta    \&No     Ta    >0
3040 .It Sx \&%N  Ta    \&No     Ta    \&No     Ta    >0
3041 .It Sx \&%O  Ta    \&No     Ta    \&No     Ta    >0
3042 .It Sx \&%P  Ta    \&No     Ta    \&No     Ta    >0
3043 .It Sx \&%Q  Ta    \&No     Ta    \&No     Ta    >0
3044 .It Sx \&%R  Ta    \&No     Ta    \&No     Ta    >0
3045 .It Sx \&%T  Ta    \&No     Ta    \&No     Ta    >0
3046 .It Sx \&%U  Ta    \&No     Ta    \&No     Ta    >0
3047 .It Sx \&%V  Ta    \&No     Ta    \&No     Ta    >0
3048 .It Sx \&Ad  Ta    Yes      Ta    Yes      Ta    >0
3049 .It Sx \&An  Ta    Yes      Ta    Yes      Ta    >0
3050 .It Sx \&Ap  Ta    Yes      Ta    Yes      Ta    0
3051 .It Sx \&Ar  Ta    Yes      Ta    Yes      Ta    n
3052 .It Sx \&At  Ta    Yes      Ta    Yes      Ta    1
3053 .It Sx \&Bsx Ta    Yes      Ta    Yes      Ta    n
3054 .It Sx \&Bt  Ta    \&No     Ta    \&No     Ta    0
3055 .It Sx \&Bx  Ta    Yes      Ta    Yes      Ta    n
3056 .It Sx \&Cd  Ta    Yes      Ta    Yes      Ta    >0
3057 .It Sx \&Cm  Ta    Yes      Ta    Yes      Ta    >0
3058 .It Sx \&Db  Ta    \&No     Ta    \&No     Ta    1
3059 .It Sx \&Dd  Ta    \&No     Ta    \&No     Ta    n
3060 .It Sx \&Dt  Ta    \&No     Ta    \&No     Ta    n
3061 .It Sx \&Dv  Ta    Yes      Ta    Yes      Ta    >0
3062 .It Sx \&Dx  Ta    Yes      Ta    Yes      Ta    n
3063 .It Sx \&Em  Ta    Yes      Ta    Yes      Ta    >0
3064 .It Sx \&Er  Ta    Yes      Ta    Yes      Ta    >0
3065 .It Sx \&Es  Ta    Yes      Ta    Yes      Ta    2
3066 .It Sx \&Ev  Ta    Yes      Ta    Yes      Ta    >0
3067 .It Sx \&Ex  Ta    \&No     Ta    \&No     Ta    n
3068 .It Sx \&Fa  Ta    Yes      Ta    Yes      Ta    >0
3069 .It Sx \&Fd  Ta    \&No     Ta    \&No     Ta    >0
3070 .It Sx \&Fl  Ta    Yes      Ta    Yes      Ta    n
3071 .It Sx \&Fn  Ta    Yes      Ta    Yes      Ta    >0
3072 .It Sx \&Fr  Ta    Yes      Ta    Yes      Ta    >0
3073 .It Sx \&Ft  Ta    Yes      Ta    Yes      Ta    >0
3074 .It Sx \&Fx  Ta    Yes      Ta    Yes      Ta    n
3075 .It Sx \&Hf  Ta    \&No     Ta    \&No     Ta    n
3076 .It Sx \&Ic  Ta    Yes      Ta    Yes      Ta    >0
3077 .It Sx \&In  Ta    \&No     Ta    \&No     Ta    1
3078 .It Sx \&Lb  Ta    \&No     Ta    \&No     Ta    1
3079 .It Sx \&Li  Ta    Yes      Ta    Yes      Ta    >0
3080 .It Sx \&Lk  Ta    Yes      Ta    Yes      Ta    >0
3081 .It Sx \&Lp  Ta    \&No     Ta    \&No     Ta    0
3082 .It Sx \&Ms  Ta    Yes      Ta    Yes      Ta    >0
3083 .It Sx \&Mt  Ta    Yes      Ta    Yes      Ta    >0
3084 .It Sx \&Nm  Ta    Yes      Ta    Yes      Ta    n
3085 .It Sx \&No  Ta    Yes      Ta    Yes      Ta    0
3086 .It Sx \&Ns  Ta    Yes      Ta    Yes      Ta    0
3087 .It Sx \&Nx  Ta    Yes      Ta    Yes      Ta    n
3088 .It Sx \&Os  Ta    \&No     Ta    \&No     Ta    n
3089 .It Sx \&Ot  Ta    Yes      Ta    Yes      Ta    >0
3090 .It Sx \&Ox  Ta    Yes      Ta    Yes      Ta    n
3091 .It Sx \&Pa  Ta    Yes      Ta    Yes      Ta    n
3092 .It Sx \&Pf  Ta    Yes      Ta    Yes      Ta    1
3093 .It Sx \&Pp  Ta    \&No     Ta    \&No     Ta    0
3094 .It Sx \&Rv  Ta    \&No     Ta    \&No     Ta    n
3095 .It Sx \&Sm  Ta    \&No     Ta    \&No     Ta    <2
3096 .It Sx \&St  Ta    \&No     Ta    Yes      Ta    1
3097 .It Sx \&Sx  Ta    Yes      Ta    Yes      Ta    >0
3098 .It Sx \&Sy  Ta    Yes      Ta    Yes      Ta    >0
3099 .It Sx \&Tn  Ta    Yes      Ta    Yes      Ta    >0
3100 .It Sx \&Ud  Ta    \&No     Ta    \&No     Ta    0
3101 .It Sx \&Ux  Ta    Yes      Ta    Yes      Ta    n
3102 .It Sx \&Va  Ta    Yes      Ta    Yes      Ta    n
3103 .It Sx \&Vt  Ta    Yes      Ta    Yes      Ta    >0
3104 .It Sx \&Xr  Ta    Yes      Ta    Yes      Ta    >0
3105 .It Sx \&br  Ta    \&No     Ta    \&No     Ta    0
3106 .It Sx \&sp  Ta    \&No     Ta    \&No     Ta    1
3107 .El
3108 .Ss Delimiters
3109 When a macro argument consists of one single input character
3110 considered as a delimiter, the argument gets special handling.
3111 This does not apply when delimiters appear in arguments containing
3112 more than one character.
3113 Consequently, to prevent special handling and just handle it
3114 like any other argument, a delimiter can be escaped by prepending
3115 a zero-width space
3116 .Pq Sq \e& .
3117 In text lines, delimiters never need escaping, but may be used
3118 as normal punctuation.
3119 .Pp
3120 For many macros, when the leading arguments are opening delimiters,
3121 these delimiters are put before the macro scope,
3122 and when the trailing arguments are closing delimiters,
3123 these delimiters are put after the macro scope.
3124 For example,
3125 .Pp
3126 .D1 Pf \. \&Aq "( [ word ] ) ."
3127 .Pp
3128 renders as:
3129 .Pp
3130 .D1 Aq ( [ word ] ) .
3131 .Pp
3132 Opening delimiters are:
3133 .Pp
3134 .Bl -tag -width Ds -offset indent -compact
3135 .It \&(
3136 left parenthesis
3137 .It \&[
3138 left bracket
3139 .El
3140 .Pp
3141 Closing delimiters are:
3142 .Pp
3143 .Bl -tag -width Ds -offset indent -compact
3144 .It \&.
3145 period
3146 .It \&,
3147 comma
3148 .It \&:
3149 colon
3150 .It \&;
3151 semicolon
3152 .It \&)
3153 right parenthesis
3154 .It \&]
3155 right bracket
3156 .It \&?
3157 question mark
3158 .It \&!
3159 exclamation mark
3160 .El
3161 .Pp
3162 Note that even a period preceded by a backslash
3163 .Pq Sq \e.\&
3164 gets this special handling; use
3165 .Sq \e&.
3166 to prevent that.
3167 .Pp
3168 Many in-line macros interrupt their scope when they encounter
3169 delimiters, and resume their scope when more arguments follow that
3170 are not delimiters.
3171 For example,
3172 .Pp
3173 .D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e"
3174 .Pp
3175 renders as:
3176 .Pp
3177 .D1 Fl a ( b | c \*(Ba d ) e
3178 .Pp
3179 This applies to both opening and closing delimiters,
3180 and also to the middle delimiter:
3181 .Pp
3182 .Bl -tag -width Ds -offset indent -compact
3183 .It \&|
3184 vertical bar
3185 .El
3186 .Pp
3187 As a special case, the predefined string \e*(Ba is handled and rendered
3188 in the same way as a plain
3189 .Sq \&|
3190 character.
3191 Using this predefined string is not recommended in new manuals.
3192 .Ss Font handling
3193 In
3194 .Nm
3195 documents, usage of semantic markup is recommended in order to have
3196 proper fonts automatically selected; only when no fitting semantic markup
3197 is available, consider falling back to
3198 .Sx Physical markup
3199 macros.
3200 Whenever any
3201 .Nm
3202 macro switches the
3203 .Xr mandoc_roff 5
3204 font mode, it will automatically restore the previous font when exiting
3205 its scope.
3206 Manually switching the font using the
3207 .Xr mandoc_roff 5
3208 .Ql \ef
3209 font escape sequences is never required.
3210 .Sh COMPATIBILITY
3211 This section provides an incomplete list of compatibility issues
3212 between mandoc and GNU troff
3213 .Pq Qq groff .
3214 .Pp
3215 The following problematic behaviour is found in groff:
3216 .Pp
3217 .Bl -dash -compact
3218 .It
3219 .Sx \&Dd
3220 with non-standard arguments behaves very strangely.
3221 When there are three arguments, they are printed verbatim.
3222 Any other number of arguments is replaced by the current date,
3223 but without any arguments the string
3224 .Dq Epoch
3225 is printed.
3226 .It
3227 .Sx \&Lk
3228 only accepts a single link-name argument; the remainder is misformatted.
3229 .It
3230 .Sx \&Pa
3231 does not format its arguments when used in the FILES section under
3232 certain list types.
3233 .It
3234 .Sx \&Ta
3235 can only be called by other macros, but not at the beginning of a line.
3236 .It
3237 .Sx \&%C
3238 is not implemented (up to and including groff-1.22.2).
3239 .It
3240 .Sq \ef
3241 .Pq font face
3242 and
3243 .Sq \eF
3244 .Pq font family face
3245 .Sx Text Decoration
3246 escapes behave irregularly when specified within line-macro scopes.
3247 .It
3248 Negative scaling units return to prior lines.
3249 Instead, mandoc truncates them to zero.
3250 .El
3251 .Pp
3252 The following features are unimplemented in mandoc:
3253 .Pp
3254 .Bl -dash -compact
3255 .It
3256 .Sx \&Bd
3257 .Fl file Ar file
3258 is unsupported for security reasons.
3259 .It
3260 .Sx \&Bd
3261 .Fl filled
3262 does not adjust the right margin, but is an alias for
3263 .Sx \&Bd
3264 .Fl ragged .
3265 .It
3266 .Sx \&Bd
3267 .Fl literal
3268 does not use a literal font, but is an alias for
3269 .Sx \&Bd
3270 .Fl unfilled .
3271 .It
3272 .Sx \&Bd
3273 .Fl offset Cm center
3274 and
3275 .Fl offset Cm right
3276 don't work.
3277 Groff does not implement centered and flush-right rendering either,
3278 but produces large indentations.
3279 .El
3280 .Sh SEE ALSO
3281 .Xr man 1 ,
3282 .Xr mandoc 1 ,
3283 .Xr eqn 5 ,
3284 .Xr man 5 ,
3285 .Xr mandoc_char 5 ,
3286 .Xr mandoc_roff 5 ,
3287 .Xr tbl 5
3288 .Sh HISTORY
3289 The
3290 .Nm
3291 language first appeared as a troff macro package in
3292 .Bx 4.4 .
3293 It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3294 in groff-1.17.
3295 The standalone implementation that is part of the
3296 .Xr mandoc 1
3297 utility written by Kristaps Dzonsons appeared in
3298 .Ox 4.6 .
3299 .Sh AUTHORS
3300 The
3301 .Nm
3302 reference was written by
3303 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
3304