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