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