xref: /openbsd/share/man/man7/mdoc.7 (revision 998de4a5)
1.\"	$OpenBSD: mdoc.7,v 1.142 2016/08/10 17:37:01 jmc 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: August 10 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 armv7 ,
1355.Cm hppa ,
1356.Cm i386 ,
1357.Cm landisk ,
1358.Cm loongson ,
1359.Cm luna88k ,
1360.Cm macppc ,
1361.Cm mips64 ,
1362.Cm octeon ,
1363.Cm sgi ,
1364.Cm socppc ,
1365.Cm sparc ,
1366.Cm sparc64 ,
1367and
1368.Cm zaurus .
1369.El
1370.Pp
1371Examples:
1372.Dl \&.Dt FOO 1
1373.Dl \&.Dt FOO 9 i386
1374.Pp
1375See also
1376.Sx \&Dd
1377and
1378.Sx \&Os .
1379.Ss \&Dv
1380Defined variables such as preprocessor constants, constant symbols,
1381enumeration values, and so on.
1382.Pp
1383Examples:
1384.Dl \&.Dv NULL
1385.Dl \&.Dv BUFSIZ
1386.Dl \&.Dv STDOUT_FILENO
1387.Pp
1388See also
1389.Sx \&Er
1390and
1391.Sx \&Ev
1392for special-purpose constants,
1393.Sx \&Va
1394for variable symbols, and
1395.Sx \&Fd
1396for listing preprocessor variable definitions in the
1397.Em SYNOPSIS .
1398.Ss \&Dx
1399Format the
1400.Dx
1401version provided as an argument, or a default
1402value if no argument is provided.
1403.Pp
1404Examples:
1405.Dl \&.Dx 2.4.1
1406.Dl \&.Dx
1407.Pp
1408See also
1409.Sx \&At ,
1410.Sx \&Bsx ,
1411.Sx \&Bx ,
1412.Sx \&Fx ,
1413.Sx \&Nx ,
1414and
1415.Sx \&Ox .
1416.Ss \&Ec
1417Close a scope started by
1418.Sx \&Eo .
1419Its syntax is as follows:
1420.Pp
1421.D1 Pf \. Sx \&Ec Op Ar TERM
1422.Pp
1423The
1424.Ar TERM
1425argument is used as the enclosure tail, for example, specifying \e(rq
1426will emulate
1427.Sx \&Dc .
1428.Ss \&Ed
1429End a display context started by
1430.Sx \&Bd .
1431.Ss \&Ef
1432End a font mode context started by
1433.Sx \&Bf .
1434.Ss \&Ek
1435End a keep context started by
1436.Sx \&Bk .
1437.Ss \&El
1438End a list context started by
1439.Sx \&Bl .
1440.Pp
1441See also
1442.Sx \&Bl
1443and
1444.Sx \&It .
1445.Ss \&Em
1446Request an italic font.
1447If the output device does not provide that, underline.
1448.Pp
1449This is most often used for stress emphasis (not to be confused with
1450importance, see
1451.Sx \&Sy ) .
1452In the rare cases where none of the semantic markup macros fit,
1453it can also be used for technical terms and placeholders, except
1454that for syntax elements,
1455.Sx \&Sy
1456and
1457.Sx \&Ar
1458are preferred, respectively.
1459.Pp
1460Examples:
1461.Bd -literal -compact -offset indent
1462Selected lines are those
1463\&.Em not
1464matching any of the specified patterns.
1465Some of the functions use a
1466\&.Em hold space
1467to save the pattern space for subsequent retrieval.
1468.Ed
1469.Pp
1470See also
1471.Sx \&Bf ,
1472.Sx \&Li ,
1473.Sx \&No ,
1474and
1475.Sx \&Sy .
1476.Ss \&En
1477This macro is obsolete.
1478Use
1479.Sx \&Eo
1480or any of the other enclosure macros.
1481.Pp
1482It encloses its argument in the delimiters specified by the last
1483.Sx \&Es
1484macro.
1485.Ss \&Eo
1486An arbitrary enclosure.
1487Its syntax is as follows:
1488.Pp
1489.D1 Pf \. Sx \&Eo Op Ar TERM
1490.Pp
1491The
1492.Ar TERM
1493argument is used as the enclosure head, for example, specifying \e(lq
1494will emulate
1495.Sx \&Do .
1496.Ss \&Er
1497Error constants for definitions of the
1498.Va errno
1499libc global variable.
1500This is most often used in section 2 and 3 manual pages.
1501.Pp
1502Examples:
1503.Dl \&.Er EPERM
1504.Dl \&.Er ENOENT
1505.Pp
1506See also
1507.Sx \&Dv
1508for general constants.
1509.Ss \&Es
1510This macro is obsolete.
1511Use
1512.Sx \&Eo
1513or any of the other enclosure macros.
1514.Pp
1515It takes two arguments, defining the delimiters to be used by subsequent
1516.Sx \&En
1517macros.
1518.Ss \&Ev
1519Environmental variables such as those specified in
1520.Xr environ 7 .
1521.Pp
1522Examples:
1523.Dl \&.Ev DISPLAY
1524.Dl \&.Ev PATH
1525.Pp
1526See also
1527.Sx \&Dv
1528for general constants.
1529.Ss \&Ex
1530Insert a standard sentence regarding command exit values of 0 on success
1531and >0 on failure.
1532This is most often used in section 1, 6, and 8 manual pages.
1533Its syntax is as follows:
1534.Pp
1535.D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
1536.Pp
1537If
1538.Ar utility
1539is not specified, the document's name set by
1540.Sx \&Nm
1541is used.
1542Multiple
1543.Ar utility
1544arguments are treated as separate utilities.
1545.Pp
1546See also
1547.Sx \&Rv .
1548.Ss \&Fa
1549Function argument or parameter.
1550Its syntax is as follows:
1551.Bd -ragged -offset indent
1552.Pf \. Sx \&Fa
1553.Qo
1554.Op Ar argtype
1555.Op Ar argname
1556.Qc Ar \&...
1557.Ed
1558.Pp
1559Each argument may be a name and a type (recommended for the
1560.Em SYNOPSIS
1561section), a name alone (for function invocations),
1562or a type alone (for function prototypes).
1563If both a type and a name are given or if the type consists of multiple
1564words, all words belonging to the same function argument have to be
1565given in a single argument to the
1566.Sx \&Fa
1567macro.
1568.Pp
1569This macro is also used to specify the field name of a structure.
1570.Pp
1571Most often, the
1572.Sx \&Fa
1573macro is used in the
1574.Em SYNOPSIS
1575within
1576.Sx \&Fo
1577blocks when documenting multi-line function prototypes.
1578If invoked with multiple arguments, the arguments are separated by a
1579comma.
1580Furthermore, if the following macro is another
1581.Sx \&Fa ,
1582the last argument will also have a trailing comma.
1583.Pp
1584Examples:
1585.Dl \&.Fa \(dqconst char *p\(dq
1586.Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1587.Dl \&.Fa \(dqchar *\(dq size_t
1588.Pp
1589See also
1590.Sx \&Fo .
1591.Ss \&Fc
1592End a function context started by
1593.Sx \&Fo .
1594.Ss \&Fd
1595Preprocessor directive, in particular for listing it in the
1596.Em SYNOPSIS .
1597Historically, it was also used to document include files.
1598The latter usage has been deprecated in favour of
1599.Sx \&In .
1600.Pp
1601Its syntax is as follows:
1602.Bd -ragged -offset indent
1603.Pf \. Sx \&Fd
1604.Li # Ns Ar directive
1605.Op Ar argument ...
1606.Ed
1607.Pp
1608Examples:
1609.Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler
1610.Dl \&.Fd #define SIO_MAXNFDS
1611.Dl \&.Fd #ifdef FS_DEBUG
1612.Dl \&.Ft void
1613.Dl \&.Fn dbg_open \(dqconst char *\(dq
1614.Dl \&.Fd #endif
1615.Pp
1616See also
1617.Sx MANUAL STRUCTURE ,
1618.Sx \&In ,
1619and
1620.Sx \&Dv .
1621.Ss \&Fl
1622Command-line flag or option.
1623Used when listing arguments to command-line utilities.
1624Prints a fixed-width hyphen
1625.Sq \-
1626directly followed by each argument.
1627If no arguments are provided, a hyphen is printed followed by a space.
1628If the argument is a macro, a hyphen is prefixed to the subsequent macro
1629output.
1630.Pp
1631Examples:
1632.Dl ".Fl R Op Fl H | L | P"
1633.Dl ".Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux"
1634.Dl ".Fl type Cm d Fl name Pa CVS"
1635.Dl ".Fl Ar signal_number"
1636.Dl ".Fl o Fl"
1637.Pp
1638See also
1639.Sx \&Cm .
1640.Ss \&Fn
1641A function name.
1642Its syntax is as follows:
1643.Bd -ragged -offset indent
1644.Pf . Sx \&Fn
1645.Op Ar functype
1646.Ar funcname
1647.Op Oo Ar argtype Oc Ar argname
1648.Ed
1649.Pp
1650Function arguments are surrounded in parenthesis and
1651are delimited by commas.
1652If no arguments are specified, blank parenthesis are output.
1653In the
1654.Em SYNOPSIS
1655section, this macro starts a new output line,
1656and a blank line is automatically inserted between function definitions.
1657.Pp
1658Examples:
1659.Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq
1660.Dl \&.Fn funcname \(dqint arg0\(dq
1661.Dl \&.Fn funcname arg0
1662.Pp
1663.Bd -literal -offset indent -compact
1664\&.Ft functype
1665\&.Fn funcname
1666.Ed
1667.Pp
1668When referring to a function documented in another manual page, use
1669.Sx \&Xr
1670instead.
1671See also
1672.Sx MANUAL STRUCTURE ,
1673.Sx \&Fo ,
1674and
1675.Sx \&Ft .
1676.Ss \&Fo
1677Begin a function block.
1678This is a multi-line version of
1679.Sx \&Fn .
1680Its syntax is as follows:
1681.Pp
1682.D1 Pf \. Sx \&Fo Ar funcname
1683.Pp
1684Invocations usually occur in the following context:
1685.Bd -ragged -offset indent
1686.Pf \. Sx \&Ft Ar functype
1687.br
1688.Pf \. Sx \&Fo Ar funcname
1689.br
1690.Pf \. Sx \&Fa Qq Ar argtype Ar argname
1691.br
1692\&.\.\.
1693.br
1694.Pf \. Sx \&Fc
1695.Ed
1696.Pp
1697A
1698.Sx \&Fo
1699scope is closed by
1700.Sx \&Fc .
1701.Pp
1702See also
1703.Sx MANUAL STRUCTURE ,
1704.Sx \&Fa ,
1705.Sx \&Fc ,
1706and
1707.Sx \&Ft .
1708.Ss \&Fr
1709This macro is obsolete.
1710No replacement markup is needed.
1711.Pp
1712It was used to show numerical function return values in an italic font.
1713.Ss \&Ft
1714A function type.
1715Its syntax is as follows:
1716.Pp
1717.D1 Pf \. Sx \&Ft Ar functype
1718.Pp
1719In the
1720.Em SYNOPSIS
1721section, a new output line is started after this macro.
1722.Pp
1723Examples:
1724.Dl \&.Ft int
1725.Bd -literal -offset indent -compact
1726\&.Ft functype
1727\&.Fn funcname
1728.Ed
1729.Pp
1730See also
1731.Sx MANUAL STRUCTURE ,
1732.Sx \&Fn ,
1733and
1734.Sx \&Fo .
1735.Ss \&Fx
1736Format the
1737.Fx
1738version provided as an argument, or a default value
1739if no argument is provided.
1740.Pp
1741Examples:
1742.Dl \&.Fx 7.1
1743.Dl \&.Fx
1744.Pp
1745See also
1746.Sx \&At ,
1747.Sx \&Bsx ,
1748.Sx \&Bx ,
1749.Sx \&Dx ,
1750.Sx \&Nx ,
1751and
1752.Sx \&Ox .
1753.Ss \&Hf
1754This macro is not implemented in
1755.Xr mandoc 1 .
1756.Pp
1757It was used to include the contents of a (header) file literally.
1758The syntax was:
1759.Pp
1760.Dl Pf . Sx \&Hf Ar filename
1761.Ss \&Ic
1762Designate an internal or interactive command.
1763This is similar to
1764.Sx \&Cm
1765but used for instructions rather than values.
1766.Pp
1767Examples:
1768.Dl \&.Ic :wq
1769.Dl \&.Ic hash
1770.Dl \&.Ic alias
1771.Pp
1772Note that using
1773.Sx \&Bd Fl literal
1774or
1775.Sx \&D1
1776is preferred for displaying code; the
1777.Sx \&Ic
1778macro is used when referring to specific instructions.
1779.Ss \&In
1780The name of an include file.
1781This macro is most often used in section 2, 3, and 9 manual pages.
1782.Pp
1783When invoked as the first macro on an input line in the
1784.Em SYNOPSIS
1785section, the argument is displayed in angle brackets
1786and preceded by
1787.Qq #include ,
1788and a blank line is inserted in front if there is a preceding
1789function declaration.
1790In other sections, it only encloses its argument in angle brackets
1791and causes no line break.
1792.Pp
1793Examples:
1794.Dl \&.In sys/types.h
1795.Pp
1796See also
1797.Sx MANUAL STRUCTURE .
1798.Ss \&It
1799A list item.
1800The syntax of this macro depends on the list type.
1801.Pp
1802Lists
1803of type
1804.Fl hang ,
1805.Fl ohang ,
1806.Fl inset ,
1807and
1808.Fl diag
1809have the following syntax:
1810.Pp
1811.D1 Pf \. Sx \&It Ar args
1812.Pp
1813Lists of type
1814.Fl bullet ,
1815.Fl dash ,
1816.Fl enum ,
1817.Fl hyphen
1818and
1819.Fl item
1820have the following syntax:
1821.Pp
1822.D1 Pf \. Sx \&It
1823.Pp
1824with subsequent lines interpreted within the scope of the
1825.Sx \&It
1826until either a closing
1827.Sx \&El
1828or another
1829.Sx \&It .
1830.Pp
1831The
1832.Fl tag
1833list has the following syntax:
1834.Pp
1835.D1 Pf \. Sx \&It Op Cm args
1836.Pp
1837Subsequent lines are interpreted as with
1838.Fl bullet
1839and family.
1840The line arguments correspond to the list's left-hand side; body
1841arguments correspond to the list's contents.
1842.Pp
1843The
1844.Fl column
1845list is the most complicated.
1846Its syntax is as follows:
1847.Pp
1848.D1 Pf \. Sx \&It Ar cell Op <TAB> Ar cell ...
1849.D1 Pf \. Sx \&It Ar cell Op Sx \&Ta Ar cell ...
1850.Pp
1851The arguments consist of one or more lines of text and macros
1852representing a complete table line.
1853Cells within the line are delimited by tabs or by the special
1854.Sx \&Ta
1855block macro.
1856The tab cell delimiter may only be used within the
1857.Sx \&It
1858line itself; on following lines, only the
1859.Sx \&Ta
1860macro can be used to delimit cells, and
1861.Sx \&Ta
1862is only recognised as a macro when called by other macros,
1863not as the first macro on a line.
1864.Pp
1865Note that quoted strings may span tab-delimited cells on an
1866.Sx \&It
1867line.
1868For example,
1869.Pp
1870.Dl .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
1871.Pp
1872will preserve the semicolon whitespace except for the last.
1873.Pp
1874See also
1875.Sx \&Bl .
1876.Ss \&Lb
1877Specify a library.
1878The syntax is as follows:
1879.Pp
1880.D1 Pf \. Sx \&Lb Ar library
1881.Pp
1882The
1883.Ar library
1884parameter may be a system library, such as
1885.Cm libz
1886or
1887.Cm libpam ,
1888in which case a small library description is printed next to the linker
1889invocation; or a custom library, in which case the library name is
1890printed in quotes.
1891This is most commonly used in the
1892.Em SYNOPSIS
1893section as described in
1894.Sx MANUAL STRUCTURE .
1895.Pp
1896Examples:
1897.Dl \&.Lb libz
1898.Dl \&.Lb libmandoc
1899.Ss \&Li
1900Denotes text that should be in a
1901.Li literal
1902font mode.
1903Note that this is a presentation term and should not be used for
1904stylistically decorating technical terms.
1905.Pp
1906On terminal output devices, this is often indistinguishable from
1907normal text.
1908.Pp
1909See also
1910.Sx \&Bf ,
1911.Sx \&Em ,
1912.Sx \&No ,
1913and
1914.Sx \&Sy .
1915.Ss \&Lk
1916Format a hyperlink.
1917Its syntax is as follows:
1918.Pp
1919.D1 Pf \. Sx \&Lk Ar uri Op Ar name
1920.Pp
1921Examples:
1922.Dl \&.Lk http://bsd.lv \(dqThe BSD.lv Project\(dq
1923.Dl \&.Lk http://bsd.lv
1924.Pp
1925See also
1926.Sx \&Mt .
1927.Ss \&Lp
1928Synonym for
1929.Sx \&Pp .
1930.Ss \&Ms
1931Display a mathematical symbol.
1932Its syntax is as follows:
1933.Pp
1934.D1 Pf \. Sx \&Ms Ar symbol
1935.Pp
1936Examples:
1937.Dl \&.Ms sigma
1938.Dl \&.Ms aleph
1939.Ss \&Mt
1940Format a
1941.Dq mailto:
1942hyperlink.
1943Its syntax is as follows:
1944.Pp
1945.D1 Pf \. Sx \&Mt Ar address
1946.Pp
1947Examples:
1948.Dl \&.Mt discuss@manpages.bsd.lv
1949.Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv
1950.Ss \&Nd
1951A one line description of the manual's content.
1952This is the mandatory last macro of the
1953.Em NAME
1954section and not appropriate for other sections.
1955.Pp
1956Examples:
1957.Dl Pf . Sx \&Nd mdoc language reference
1958.Dl Pf . Sx \&Nd format and display UNIX manuals
1959.Pp
1960The
1961.Sx \&Nd
1962macro technically accepts child macros and terminates with a subsequent
1963.Sx \&Sh
1964invocation.
1965Do not assume this behaviour: some
1966.Xr whatis 1
1967database generators are not smart enough to parse more than the line
1968arguments and will display macros verbatim.
1969.Pp
1970See also
1971.Sx \&Nm .
1972.Ss \&Nm
1973The name of the manual page, or \(em in particular in section 1, 6,
1974and 8 pages \(em of an additional command or feature documented in
1975the manual page.
1976When first invoked, the
1977.Sx \&Nm
1978macro expects a single argument, the name of the manual page.
1979Usually, the first invocation happens in the
1980.Em NAME
1981section of the page.
1982The specified name will be remembered and used whenever the macro is
1983called again without arguments later in the page.
1984The
1985.Sx \&Nm
1986macro uses
1987.Sx Block full-implicit
1988semantics when invoked as the first macro on an input line in the
1989.Em SYNOPSIS
1990section; otherwise, it uses ordinary
1991.Sx In-line
1992semantics.
1993.Pp
1994Examples:
1995.Bd -literal -offset indent
1996\&.Sh SYNOPSIS
1997\&.Nm cat
1998\&.Op Fl benstuv
1999\&.Op Ar
2000.Ed
2001.Pp
2002In the
2003.Em SYNOPSIS
2004of section 2, 3 and 9 manual pages, use the
2005.Sx \&Fn
2006macro rather than
2007.Sx \&Nm
2008to mark up the name of the manual page.
2009.Ss \&No
2010Normal text.
2011Closes the scope of any preceding in-line macro.
2012When used after physical formatting macros like
2013.Sx \&Em
2014or
2015.Sx \&Sy ,
2016switches back to the standard font face and weight.
2017Can also be used to embed plain text strings in macro lines
2018using semantic annotation macros.
2019.Pp
2020Examples:
2021.Dl ".Em italic , Sy bold , No and roman"
2022.Pp
2023.Bd -literal -offset indent -compact
2024\&.Sm off
2025\&.Cm :C No / Ar pattern No / Ar replacement No /
2026\&.Sm on
2027.Ed
2028.Pp
2029See also
2030.Sx \&Em ,
2031.Sx \&Li ,
2032and
2033.Sx \&Sy .
2034.Ss \&Ns
2035Suppress a space between the output of the preceding macro
2036and the following text or macro.
2037Following invocation, input is interpreted as normal text
2038just like after an
2039.Sx \&No
2040macro.
2041.Pp
2042This has no effect when invoked at the start of a macro line.
2043.Pp
2044Examples:
2045.Dl ".Ar name Ns = Ns Ar value"
2046.Dl ".Cm :M Ns Ar pattern"
2047.Dl ".Fl o Ns Ar output"
2048.Pp
2049See also
2050.Sx \&No
2051and
2052.Sx \&Sm .
2053.Ss \&Nx
2054Format the
2055.Nx
2056version provided as an argument, or a default value if
2057no argument is provided.
2058.Pp
2059Examples:
2060.Dl \&.Nx 5.01
2061.Dl \&.Nx
2062.Pp
2063See also
2064.Sx \&At ,
2065.Sx \&Bsx ,
2066.Sx \&Bx ,
2067.Sx \&Dx ,
2068.Sx \&Fx ,
2069and
2070.Sx \&Ox .
2071.Ss \&Oc
2072Close multi-line
2073.Sx \&Oo
2074context.
2075.Ss \&Oo
2076Multi-line version of
2077.Sx \&Op .
2078.Pp
2079Examples:
2080.Bd -literal -offset indent -compact
2081\&.Oo
2082\&.Op Fl flag Ns Ar value
2083\&.Oc
2084.Ed
2085.Ss \&Op
2086Optional part of a command line.
2087Prints the argument(s) in brackets.
2088This is most often used in the
2089.Em SYNOPSIS
2090section of section 1 and 8 manual pages.
2091.Pp
2092Examples:
2093.Dl \&.Op \&Fl a \&Ar b
2094.Dl \&.Op \&Ar a | b
2095.Pp
2096See also
2097.Sx \&Oo .
2098.Ss \&Os
2099Operating system version for display in the page footer.
2100This is the mandatory third macro of
2101any
2102.Nm
2103file.
2104Its syntax is as follows:
2105.Pp
2106.D1 Pf \. Sx \&Os Op Ar system Op Ar version
2107.Pp
2108The optional
2109.Ar system
2110parameter specifies the relevant operating system or environment.
2111It is suggested to leave it unspecified, in which case
2112.Xr mandoc 1
2113uses its
2114.Fl Ios
2115argument or, if that isn't specified either,
2116.Fa sysname
2117and
2118.Fa release
2119as returned by
2120.Xr uname 3 .
2121.Pp
2122Examples:
2123.Dl \&.Os
2124.Dl \&.Os KTH/CSC/TCS
2125.Dl \&.Os BSD 4.3
2126.Pp
2127See also
2128.Sx \&Dd
2129and
2130.Sx \&Dt .
2131.Ss \&Ot
2132This macro is obsolete.
2133Use
2134.Sx \&Ft
2135instead; with
2136.Xr mandoc 1 ,
2137both have the same effect.
2138.Pp
2139Historical
2140.Nm
2141packages described it as
2142.Dq "old function type (FORTRAN)" .
2143.Ss \&Ox
2144Format the
2145.Ox
2146version provided as an argument, or a default value
2147if no argument is provided.
2148.Pp
2149Examples:
2150.Dl \&.Ox 4.5
2151.Dl \&.Ox
2152.Pp
2153See also
2154.Sx \&At ,
2155.Sx \&Bsx ,
2156.Sx \&Bx ,
2157.Sx \&Dx ,
2158.Sx \&Fx ,
2159and
2160.Sx \&Nx .
2161.Ss \&Pa
2162An absolute or relative file system path, or a file or directory name.
2163If an argument is not provided, the character
2164.Sq \(ti
2165is used as a default.
2166.Pp
2167Examples:
2168.Dl \&.Pa /usr/bin/mandoc
2169.Dl \&.Pa /usr/share/man/man7/mdoc.7
2170.Pp
2171See also
2172.Sx \&Lk .
2173.Ss \&Pc
2174Close parenthesised context opened by
2175.Sx \&Po .
2176.Ss \&Pf
2177Removes the space between its argument and the following macro.
2178Its syntax is as follows:
2179.Pp
2180.D1 .Pf Ar prefix macro arguments ...
2181.Pp
2182This is equivalent to:
2183.Pp
2184.D1 .No \e& Ns Ar prefix No \&Ns Ar macro arguments ...
2185.Pp
2186The
2187.Ar prefix
2188argument is not parsed for macro names or delimiters,
2189but used verbatim as if it were escaped.
2190.Pp
2191Examples:
2192.Dl ".Pf $ Ar variable_name"
2193.Dl ".Pf . Ar macro_name"
2194.Dl ".Pf 0x Ar hex_digits"
2195.Pp
2196See also
2197.Sx \&Ns
2198and
2199.Sx \&Sm .
2200.Ss \&Po
2201Multi-line version of
2202.Sx \&Pq .
2203.Ss \&Pp
2204Break a paragraph.
2205This will assert vertical space between prior and subsequent macros
2206and/or text.
2207.Pp
2208Paragraph breaks are not needed before or after
2209.Sx \&Sh
2210or
2211.Sx \&Ss
2212macros or before displays
2213.Pq Sx \&Bd
2214or lists
2215.Pq Sx \&Bl
2216unless the
2217.Fl compact
2218flag is given.
2219.Ss \&Pq
2220Parenthesised enclosure.
2221.Pp
2222See also
2223.Sx \&Po .
2224.Ss \&Qc
2225Close quoted context opened by
2226.Sx \&Qo .
2227.Ss \&Ql
2228In-line literal display.
2229This can for example be used for complete command invocations and
2230for multi-word code fragments when more specific markup is not
2231appropriate and an indented display is not desired.
2232While
2233.Xr mandoc 1
2234always encloses the arguments in single quotes, other formatters
2235usually omit the quotes on non-terminal output devices when the
2236arguments have three or more characters.
2237.Pp
2238See also
2239.Sx \&Dl
2240and
2241.Sx \&Bd
2242.Fl literal .
2243.Ss \&Qo
2244Multi-line version of
2245.Sx \&Qq .
2246.Ss \&Qq
2247Encloses its arguments in
2248.Qq typewriter
2249double-quotes.
2250Consider using
2251.Sx \&Dq .
2252.Pp
2253See also
2254.Sx \&Dq ,
2255.Sx \&Sq ,
2256and
2257.Sx \&Qo .
2258.Ss \&Re
2259Close an
2260.Sx \&Rs
2261block.
2262Does not have any tail arguments.
2263.Ss \&Rs
2264Begin a bibliographic
2265.Pq Dq reference
2266block.
2267Does not have any head arguments.
2268The block macro may only contain
2269.Sx \&%A ,
2270.Sx \&%B ,
2271.Sx \&%C ,
2272.Sx \&%D ,
2273.Sx \&%I ,
2274.Sx \&%J ,
2275.Sx \&%N ,
2276.Sx \&%O ,
2277.Sx \&%P ,
2278.Sx \&%Q ,
2279.Sx \&%R ,
2280.Sx \&%T ,
2281.Sx \&%U ,
2282and
2283.Sx \&%V
2284child macros (at least one must be specified).
2285.Pp
2286Examples:
2287.Bd -literal -offset indent -compact
2288\&.Rs
2289\&.%A J. E. Hopcroft
2290\&.%A J. D. Ullman
2291\&.%B Introduction to Automata Theory, Languages, and Computation
2292\&.%I Addison-Wesley
2293\&.%C Reading, Massachusetts
2294\&.%D 1979
2295\&.Re
2296.Ed
2297.Pp
2298If an
2299.Sx \&Rs
2300block is used within a SEE ALSO section, a vertical space is asserted
2301before the rendered output, else the block continues on the current
2302line.
2303.Ss \&Rv
2304Insert a standard sentence regarding a function call's return value of 0
2305on success and \-1 on error, with the
2306.Va errno
2307libc global variable set on error.
2308Its syntax is as follows:
2309.Pp
2310.D1 Pf \. Sx \&Rv Fl std Op Ar function ...
2311.Pp
2312If
2313.Ar function
2314is not specified, the document's name set by
2315.Sx \&Nm
2316is used.
2317Multiple
2318.Ar function
2319arguments are treated as separate functions.
2320.Pp
2321See also
2322.Sx \&Ex .
2323.Ss \&Sc
2324Close single-quoted context opened by
2325.Sx \&So .
2326.Ss \&Sh
2327Begin a new section.
2328For a list of conventional manual sections, see
2329.Sx MANUAL STRUCTURE .
2330These sections should be used unless it's absolutely necessary that
2331custom sections be used.
2332.Pp
2333Section names should be unique so that they may be keyed by
2334.Sx \&Sx .
2335Although this macro is parsed, it should not consist of child node or it
2336may not be linked with
2337.Sx \&Sx .
2338.Pp
2339See also
2340.Sx \&Pp ,
2341.Sx \&Ss ,
2342and
2343.Sx \&Sx .
2344.Ss \&Sm
2345Switches the spacing mode for output generated from macros.
2346Its syntax is as follows:
2347.Pp
2348.D1 Pf \. Sx \&Sm Op Cm on | off
2349.Pp
2350By default, spacing is
2351.Cm on .
2352When switched
2353.Cm off ,
2354no white space is inserted between macro arguments and between the
2355output generated from adjacent macros, but text lines
2356still get normal spacing between words and sentences.
2357.Pp
2358When called without an argument, the
2359.Sx \&Sm
2360macro toggles the spacing mode.
2361Using this is not recommended because it makes the code harder to read.
2362.Ss \&So
2363Multi-line version of
2364.Sx \&Sq .
2365.Ss \&Sq
2366Encloses its arguments in
2367.Sq typewriter
2368single-quotes.
2369.Pp
2370See also
2371.Sx \&Dq ,
2372.Sx \&Qq ,
2373and
2374.Sx \&So .
2375.Ss \&Ss
2376Begin a new subsection.
2377Unlike with
2378.Sx \&Sh ,
2379there is no convention for the naming of subsections.
2380Except
2381.Em DESCRIPTION ,
2382the conventional sections described in
2383.Sx MANUAL STRUCTURE
2384rarely have subsections.
2385.Pp
2386Sub-section names should be unique so that they may be keyed by
2387.Sx \&Sx .
2388Although this macro is parsed, it should not consist of child node or it
2389may not be linked with
2390.Sx \&Sx .
2391.Pp
2392See also
2393.Sx \&Pp ,
2394.Sx \&Sh ,
2395and
2396.Sx \&Sx .
2397.Ss \&St
2398Replace an abbreviation for a standard with the full form.
2399The following standards are recognised.
2400Where multiple lines are given without a blank line in between,
2401they all refer to the same standard, and using the first form
2402is recommended.
2403.Bl -tag -width 1n
2404.It C language standards
2405.Pp
2406.Bl -tag -width "-p1003.1g-2000" -compact
2407.It \-ansiC
2408.St -ansiC
2409.It \-ansiC-89
2410.St -ansiC-89
2411.It \-isoC
2412.St -isoC
2413.It \-isoC-90
2414.St -isoC-90
2415.br
2416The original C standard.
2417.Pp
2418.It \-isoC-amd1
2419.St -isoC-amd1
2420.Pp
2421.It \-isoC-tcor1
2422.St -isoC-tcor1
2423.Pp
2424.It \-isoC-tcor2
2425.St -isoC-tcor2
2426.Pp
2427.It \-isoC-99
2428.St -isoC-99
2429.br
2430The second major version of the C language standard.
2431.Pp
2432.It \-isoC-2011
2433.St -isoC-2011
2434.br
2435The third major version of the C language standard.
2436.El
2437.It POSIX.1 before the Single UNIX Specification
2438.Pp
2439.Bl -tag -width "-p1003.1g-2000" -compact
2440.It \-p1003.1-88
2441.St -p1003.1-88
2442.It \-p1003.1
2443.St -p1003.1
2444.br
2445The original POSIX standard, based on ANSI C.
2446.Pp
2447.It \-p1003.1-90
2448.St -p1003.1-90
2449.It \-iso9945-1-90
2450.St -iso9945-1-90
2451.br
2452The first update of POSIX.1.
2453.Pp
2454.It \-p1003.1b-93
2455.St -p1003.1b-93
2456.It \-p1003.1b
2457.St -p1003.1b
2458.br
2459Real-time extensions.
2460.Pp
2461.It \-p1003.1c-95
2462.St -p1003.1c-95
2463.br
2464POSIX thread interfaces.
2465.Pp
2466.It \-p1003.1i-95
2467.St -p1003.1i-95
2468.br
2469Technical Corrigendum.
2470.Pp
2471.It \-p1003.1-96
2472.St -p1003.1-96
2473.It \-iso9945-1-96
2474.St -iso9945-1-96
2475.br
2476Includes POSIX.1-1990, 1b, 1c, and 1i.
2477.El
2478.It X/Open Portability Guide version 4 and related standards
2479.Pp
2480.Bl -tag -width "-p1003.1g-2000" -compact
2481.It \-xpg3
2482.St -xpg3
2483.br
2484An XPG4 precursor, published in 1989.
2485.Pp
2486.It \-p1003.2
2487.St -p1003.2
2488.It \-p1003.2-92
2489.St -p1003.2-92
2490.It \-iso9945-2-93
2491.St -iso9945-2-93
2492.br
2493An XCU4 precursor.
2494.Pp
2495.It \-p1003.2a-92
2496.St -p1003.2a-92
2497.br
2498Updates to POSIX.2.
2499.Pp
2500.It \-xpg4
2501.St -xpg4
2502.br
2503Based on POSIX.1 and POSIX.2, published in 1992.
2504.El
2505.It Single UNIX Specification version 1 and related standards
2506.Pp
2507.Bl -tag -width "-p1003.1g-2000" -compact
2508.It \-susv1
2509.St -susv1
2510.It \-xpg4.2
2511.St -xpg4.2
2512.br
2513This standard was published in 1994.
2514It was used as the basis for UNIX 95 certification.
2515The following three refer to parts of it.
2516.Pp
2517.It \-xsh4.2
2518.St -xsh4.2
2519.Pp
2520.It \-xcurses4.2
2521.St -xcurses4.2
2522.Pp
2523.It \-p1003.1g-2000
2524.St -p1003.1g-2000
2525.br
2526Networking APIs, including sockets.
2527.Pp
2528.It \-svid4
2529.St -svid4 ,
2530.br
2531Published in 1995.
2532.El
2533.It Single UNIX Specification version 2 and related standards
2534.Pp
2535.Bl -tag -width "-p1003.1g-2000" -compact
2536.It \-susv2
2537.St -susv2
2538This Standard was published in 1997
2539and is also called X/Open Portability Guide version 5.
2540It was used as the basis for UNIX 98 certification.
2541The following refer to parts of it.
2542.Pp
2543.It \-xbd5
2544.St -xbd5
2545.Pp
2546.It \-xsh5
2547.St -xsh5
2548.Pp
2549.It \-xcu5
2550.St -xcu5
2551.Pp
2552.It \-xns5
2553.St -xns5
2554.It \-xns5.2
2555.St -xns5.2
2556.El
2557.It Single UNIX Specification version 3
2558.Pp
2559.Bl -tag -width "-p1003.1-2001" -compact
2560.It \-p1003.1-2001
2561.St -p1003.1-2001
2562.It \-susv3
2563.St -susv3
2564.br
2565This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j.
2566It is also called X/Open Portability Guide version 6.
2567It is used as the basis for UNIX 03 certification.
2568.Pp
2569.It \-p1003.1-2004
2570.St -p1003.1-2004
2571.br
2572The second and last Technical Corrigendum.
2573.El
2574.It Single UNIX Specification version 4
2575.Pp
2576.Bl -tag -width "-p1003.1g-2000" -compact
2577.It \-p1003.1-2008
2578.St -p1003.1-2008
2579.It \-susv4
2580.St -susv4
2581.br
2582This standard is also called
2583X/Open Portability Guide version 7.
2584.Pp
2585.It \-p1003.1-2013
2586.St -p1003.1-2013
2587.br
2588This is the first Technical Corrigendum.
2589.El
2590.It Other standards
2591.Pp
2592.Bl -tag -width "-p1003.1g-2000" -compact
2593.It \-ieee754
2594.St -ieee754
2595.br
2596Floating-point arithmetic.
2597.Pp
2598.It \-iso8601
2599.St -iso8601
2600.br
2601Representation of dates and times, published in 1988.
2602.Pp
2603.It \-iso8802-3
2604.St -iso8802-3
2605.br
2606Ethernet local area networks.
2607.Pp
2608.It \-ieee1275-94
2609.St -ieee1275-94
2610.El
2611.El
2612.Ss \&Sx
2613Reference a section or subsection in the same manual page.
2614The referenced section or subsection name must be identical to the
2615enclosed argument, including whitespace.
2616.Pp
2617Examples:
2618.Dl \&.Sx MANUAL STRUCTURE
2619.Pp
2620See also
2621.Sx \&Sh
2622and
2623.Sx \&Ss .
2624.Ss \&Sy
2625Request a boldface font.
2626.Pp
2627This is most often used to indicate importance or seriousness (not to be
2628confused with stress emphasis, see
2629.Sx \&Em ) .
2630When none of the semantic macros fit, it is also adequate for syntax
2631elements that have to be given or that appear verbatim.
2632.Pp
2633Examples:
2634.Bd -literal -compact -offset indent
2635\&.Sy Warning :
2636If
2637\&.Sy s
2638appears in the owner permissions, set-user-ID mode is set.
2639This utility replaces the former
2640\&.Sy dumpdir
2641program.
2642.Ed
2643.Pp
2644See also
2645.Sx \&Bf ,
2646.Sx \&Em ,
2647.Sx \&Li ,
2648and
2649.Sx \&No .
2650.Ss \&Ta
2651Table cell separator in
2652.Sx \&Bl Fl column
2653lists; can only be used below
2654.Sx \&It .
2655.Ss \&Tn
2656Supported only for compatibility, do not use this in new manuals.
2657Even though the macro name
2658.Pq Dq tradename
2659suggests a semantic function, historic usage is inconsistent, mostly
2660using it as a presentation-level macro to request a small caps font.
2661.Ss \&Ud
2662Supported only for compatibility, do not use this in new manuals.
2663Prints out
2664.Dq currently under development.
2665.Ss \&Ux
2666Supported only for compatibility, do not use this in new manuals.
2667Prints out
2668.Dq Ux .
2669.Ss \&Va
2670A variable name.
2671.Pp
2672Examples:
2673.Dl \&.Va foo
2674.Dl \&.Va const char *bar ;
2675.Pp
2676For function arguments and parameters, use
2677.Sx \&Fa
2678instead.
2679For declarations of global variables in the
2680.Em SYNOPSIS
2681section, use
2682.Sx \&Vt .
2683.Ss \&Vt
2684A variable type.
2685.Pp
2686This is also used for indicating global variables in the
2687.Em SYNOPSIS
2688section, in which case a variable name is also specified.
2689Note that it accepts
2690.Sx Block partial-implicit
2691syntax when invoked as the first macro on an input line in the
2692.Em SYNOPSIS
2693section, else it accepts ordinary
2694.Sx In-line
2695syntax.
2696In the former case, this macro starts a new output line,
2697and a blank line is inserted in front if there is a preceding
2698function definition or include directive.
2699.Pp
2700Examples:
2701.Dl \&.Vt unsigned char
2702.Dl \&.Vt extern const char * const sys_signame[] \&;
2703.Pp
2704For parameters in function prototypes, use
2705.Sx \&Fa
2706instead, for function return types
2707.Sx \&Ft ,
2708and for variable names outside the
2709.Em SYNOPSIS
2710section
2711.Sx \&Va ,
2712even when including a type with the name.
2713See also
2714.Sx MANUAL STRUCTURE .
2715.Ss \&Xc
2716Close a scope opened by
2717.Sx \&Xo .
2718.Ss \&Xo
2719Extend the header of an
2720.Sx \&It
2721macro or the body of a partial-implicit block macro
2722beyond the end of the input line.
2723This macro originally existed to work around the 9-argument limit
2724of historic
2725.Xr roff 7 .
2726.Ss \&Xr
2727Link to another manual
2728.Pq Qq cross-reference .
2729Its syntax is as follows:
2730.Pp
2731.D1 Pf \. Sx \&Xr Ar name Op section
2732.Pp
2733Cross reference the
2734.Ar name
2735and
2736.Ar section
2737number of another man page;
2738omitting the section number is rarely useful.
2739.Pp
2740Examples:
2741.Dl \&.Xr mandoc 1
2742.Dl \&.Xr mandoc 1 \&;
2743.Dl \&.Xr mandoc 1 \&Ns s behaviour
2744.Ss \&br
2745Emits a line-break.
2746This macro should not be used; it is implemented for compatibility with
2747historical manuals.
2748.Pp
2749Consider using
2750.Sx \&Pp
2751in the event of natural paragraph breaks.
2752.Ss \&sp
2753Emits vertical space.
2754This macro should not be used; it is implemented for compatibility with
2755historical manuals.
2756Its syntax is as follows:
2757.Pp
2758.D1 Pf \. Sx \&sp Op Ar height
2759.Pp
2760The
2761.Ar height
2762argument is a scaling width as described in
2763.Xr roff 7 .
2764If unspecified,
2765.Sx \&sp
2766asserts a single vertical space.
2767.Sh MACRO SYNTAX
2768The syntax of a macro depends on its classification.
2769In this section,
2770.Sq \-arg
2771refers to macro arguments, which may be followed by zero or more
2772.Sq parm
2773parameters;
2774.Sq \&Yo
2775opens the scope of a macro; and if specified,
2776.Sq \&Yc
2777closes it out.
2778.Pp
2779The
2780.Em Callable
2781column indicates that the macro may also be called by passing its name
2782as an argument to another macro.
2783For example,
2784.Sq \&.Op \&Fl O \&Ar file
2785produces
2786.Sq Op Fl O Ar file .
2787To prevent a macro call and render the macro name literally,
2788escape it by prepending a zero-width space,
2789.Sq \e& .
2790For example,
2791.Sq \&Op \e&Fl O
2792produces
2793.Sq Op \&Fl O .
2794If a macro is not callable but its name appears as an argument
2795to another macro, it is interpreted as opaque text.
2796For example,
2797.Sq \&.Fl \&Sh
2798produces
2799.Sq Fl \&Sh .
2800.Pp
2801The
2802.Em Parsed
2803column indicates whether the macro may call other macros by receiving
2804their names as arguments.
2805If a macro is not parsed but the name of another macro appears
2806as an argument, it is interpreted as opaque text.
2807.Pp
2808The
2809.Em Scope
2810column, if applicable, describes closure rules.
2811.Ss Block full-explicit
2812Multi-line scope closed by an explicit closing macro.
2813All macros contains bodies; only
2814.Sx \&Bf
2815and
2816.Pq optionally
2817.Sx \&Bl
2818contain a head.
2819.Bd -literal -offset indent
2820\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2821\(lBbody...\(rB
2822\&.Yc
2823.Ed
2824.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent
2825.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2826.It Sx \&Bd  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ed
2827.It Sx \&Bf  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ef
2828.It Sx \&Bk  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ek
2829.It Sx \&Bl  Ta    \&No     Ta    \&No     Ta    closed by Sx \&El
2830.It Sx \&Ed  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bd
2831.It Sx \&Ef  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bf
2832.It Sx \&Ek  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bk
2833.It Sx \&El  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bl
2834.El
2835.Ss Block full-implicit
2836Multi-line scope closed by end-of-file or implicitly by another macro.
2837All macros have bodies; some
2838.Po
2839.Sx \&It Fl bullet ,
2840.Fl hyphen ,
2841.Fl dash ,
2842.Fl enum ,
2843.Fl item
2844.Pc
2845don't have heads; only one
2846.Po
2847.Sx \&It
2848in
2849.Sx \&Bl Fl column
2850.Pc
2851has multiple heads.
2852.Bd -literal -offset indent
2853\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
2854\(lBbody...\(rB
2855.Ed
2856.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent
2857.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2858.It Sx \&It Ta \&No Ta Yes  Ta closed by Sx \&It , Sx \&El
2859.It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
2860.It Sx \&Nm Ta \&No Ta Yes  Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
2861.It Sx \&Sh Ta \&No Ta Yes  Ta closed by Sx \&Sh
2862.It Sx \&Ss Ta \&No Ta Yes  Ta closed by Sx \&Sh , Sx \&Ss
2863.El
2864.Pp
2865Note that the
2866.Sx \&Nm
2867macro is a
2868.Sx Block full-implicit
2869macro only when invoked as the first macro
2870in a
2871.Em SYNOPSIS
2872section line, else it is
2873.Sx In-line .
2874.Ss Block partial-explicit
2875Like block full-explicit, but also with single-line scope.
2876Each has at least a body and, in limited circumstances, a head
2877.Po
2878.Sx \&Fo ,
2879.Sx \&Eo
2880.Pc
2881and/or tail
2882.Pq Sx \&Ec .
2883.Bd -literal -offset indent
2884\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
2885\(lBbody...\(rB
2886\&.Yc \(lBtail...\(rB
2887
2888\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
2889\(lBbody...\(rB \&Yc \(lBtail...\(rB
2890.Ed
2891.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
2892.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2893.It Sx \&Ac  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Ao
2894.It Sx \&Ao  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ac
2895.It Sx \&Bc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Bo
2896.It Sx \&Bo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bc
2897.It Sx \&Brc Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bro
2898.It Sx \&Bro Ta    Yes      Ta    Yes      Ta    closed by Sx \&Brc
2899.It Sx \&Dc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Do
2900.It Sx \&Do  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Dc
2901.It Sx \&Ec  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Eo
2902.It Sx \&Eo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ec
2903.It Sx \&Fc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Fo
2904.It Sx \&Fo  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Fc
2905.It Sx \&Oc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oo
2906.It Sx \&Oo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oc
2907.It Sx \&Pc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Po
2908.It Sx \&Po  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Pc
2909.It Sx \&Qc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oo
2910.It Sx \&Qo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oc
2911.It Sx \&Re  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Rs
2912.It Sx \&Rs  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Re
2913.It Sx \&Sc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&So
2914.It Sx \&So  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Sc
2915.It Sx \&Xc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Xo
2916.It Sx \&Xo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Xc
2917.El
2918.Ss Block partial-implicit
2919Like block full-implicit, but with single-line scope closed by the
2920end of the line.
2921.Bd -literal -offset indent
2922\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
2923.Ed
2924.Bl -column "MacroX" "CallableX" "ParsedX" -offset indent
2925.It Em Macro Ta Em Callable Ta Em Parsed
2926.It Sx \&Aq  Ta    Yes      Ta    Yes
2927.It Sx \&Bq  Ta    Yes      Ta    Yes
2928.It Sx \&Brq Ta    Yes      Ta    Yes
2929.It Sx \&D1  Ta    \&No     Ta    \&Yes
2930.It Sx \&Dl  Ta    \&No     Ta    Yes
2931.It Sx \&Dq  Ta    Yes      Ta    Yes
2932.It Sx \&En  Ta    Yes      Ta    Yes
2933.It Sx \&Op  Ta    Yes      Ta    Yes
2934.It Sx \&Pq  Ta    Yes      Ta    Yes
2935.It Sx \&Ql  Ta    Yes      Ta    Yes
2936.It Sx \&Qq  Ta    Yes      Ta    Yes
2937.It Sx \&Sq  Ta    Yes      Ta    Yes
2938.It Sx \&Vt  Ta    Yes      Ta    Yes
2939.El
2940.Pp
2941Note that the
2942.Sx \&Vt
2943macro is a
2944.Sx Block partial-implicit
2945only when invoked as the first macro
2946in a
2947.Em SYNOPSIS
2948section line, else it is
2949.Sx In-line .
2950.Ss Special block macro
2951The
2952.Sx \&Ta
2953macro can only be used below
2954.Sx \&It
2955in
2956.Sx \&Bl Fl column
2957lists.
2958It delimits blocks representing table cells;
2959these blocks have bodies, but no heads.
2960.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent
2961.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
2962.It Sx \&Ta  Ta    Yes      Ta    Yes    Ta closed by Sx \&Ta , Sx \&It
2963.El
2964.Ss In-line
2965Closed by the end of the line, fixed argument lengths,
2966and/or subsequent macros.
2967In-line macros have only text children.
2968If a number (or inequality) of arguments is
2969.Pq n ,
2970then the macro accepts an arbitrary number of arguments.
2971.Bd -literal -offset indent
2972\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
2973
2974\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
2975
2976\&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
2977.Ed
2978.Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent
2979.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
2980.It Sx \&%A  Ta    \&No     Ta    \&No     Ta    >0
2981.It Sx \&%B  Ta    \&No     Ta    \&No     Ta    >0
2982.It Sx \&%C  Ta    \&No     Ta    \&No     Ta    >0
2983.It Sx \&%D  Ta    \&No     Ta    \&No     Ta    >0
2984.It Sx \&%I  Ta    \&No     Ta    \&No     Ta    >0
2985.It Sx \&%J  Ta    \&No     Ta    \&No     Ta    >0
2986.It Sx \&%N  Ta    \&No     Ta    \&No     Ta    >0
2987.It Sx \&%O  Ta    \&No     Ta    \&No     Ta    >0
2988.It Sx \&%P  Ta    \&No     Ta    \&No     Ta    >0
2989.It Sx \&%Q  Ta    \&No     Ta    \&No     Ta    >0
2990.It Sx \&%R  Ta    \&No     Ta    \&No     Ta    >0
2991.It Sx \&%T  Ta    \&No     Ta    \&No     Ta    >0
2992.It Sx \&%U  Ta    \&No     Ta    \&No     Ta    >0
2993.It Sx \&%V  Ta    \&No     Ta    \&No     Ta    >0
2994.It Sx \&Ad  Ta    Yes      Ta    Yes      Ta    >0
2995.It Sx \&An  Ta    Yes      Ta    Yes      Ta    >0
2996.It Sx \&Ap  Ta    Yes      Ta    Yes      Ta    0
2997.It Sx \&Ar  Ta    Yes      Ta    Yes      Ta    n
2998.It Sx \&At  Ta    Yes      Ta    Yes      Ta    1
2999.It Sx \&Bsx Ta    Yes      Ta    Yes      Ta    n
3000.It Sx \&Bt  Ta    \&No     Ta    \&No     Ta    0
3001.It Sx \&Bx  Ta    Yes      Ta    Yes      Ta    n
3002.It Sx \&Cd  Ta    Yes      Ta    Yes      Ta    >0
3003.It Sx \&Cm  Ta    Yes      Ta    Yes      Ta    >0
3004.It Sx \&Db  Ta    \&No     Ta    \&No     Ta    1
3005.It Sx \&Dd  Ta    \&No     Ta    \&No     Ta    n
3006.It Sx \&Dt  Ta    \&No     Ta    \&No     Ta    n
3007.It Sx \&Dv  Ta    Yes      Ta    Yes      Ta    >0
3008.It Sx \&Dx  Ta    Yes      Ta    Yes      Ta    n
3009.It Sx \&Em  Ta    Yes      Ta    Yes      Ta    >0
3010.It Sx \&Er  Ta    Yes      Ta    Yes      Ta    >0
3011.It Sx \&Es  Ta    Yes      Ta    Yes      Ta    2
3012.It Sx \&Ev  Ta    Yes      Ta    Yes      Ta    >0
3013.It Sx \&Ex  Ta    \&No     Ta    \&No     Ta    n
3014.It Sx \&Fa  Ta    Yes      Ta    Yes      Ta    >0
3015.It Sx \&Fd  Ta    \&No     Ta    \&No     Ta    >0
3016.It Sx \&Fl  Ta    Yes      Ta    Yes      Ta    n
3017.It Sx \&Fn  Ta    Yes      Ta    Yes      Ta    >0
3018.It Sx \&Fr  Ta    Yes      Ta    Yes      Ta    >0
3019.It Sx \&Ft  Ta    Yes      Ta    Yes      Ta    >0
3020.It Sx \&Fx  Ta    Yes      Ta    Yes      Ta    n
3021.It Sx \&Hf  Ta    \&No     Ta    \&No     Ta    n
3022.It Sx \&Ic  Ta    Yes      Ta    Yes      Ta    >0
3023.It Sx \&In  Ta    \&No     Ta    \&No     Ta    1
3024.It Sx \&Lb  Ta    \&No     Ta    \&No     Ta    1
3025.It Sx \&Li  Ta    Yes      Ta    Yes      Ta    >0
3026.It Sx \&Lk  Ta    Yes      Ta    Yes      Ta    >0
3027.It Sx \&Lp  Ta    \&No     Ta    \&No     Ta    0
3028.It Sx \&Ms  Ta    Yes      Ta    Yes      Ta    >0
3029.It Sx \&Mt  Ta    Yes      Ta    Yes      Ta    >0
3030.It Sx \&Nm  Ta    Yes      Ta    Yes      Ta    n
3031.It Sx \&No  Ta    Yes      Ta    Yes      Ta    0
3032.It Sx \&Ns  Ta    Yes      Ta    Yes      Ta    0
3033.It Sx \&Nx  Ta    Yes      Ta    Yes      Ta    n
3034.It Sx \&Os  Ta    \&No     Ta    \&No     Ta    n
3035.It Sx \&Ot  Ta    Yes      Ta    Yes      Ta    >0
3036.It Sx \&Ox  Ta    Yes      Ta    Yes      Ta    n
3037.It Sx \&Pa  Ta    Yes      Ta    Yes      Ta    n
3038.It Sx \&Pf  Ta    Yes      Ta    Yes      Ta    1
3039.It Sx \&Pp  Ta    \&No     Ta    \&No     Ta    0
3040.It Sx \&Rv  Ta    \&No     Ta    \&No     Ta    n
3041.It Sx \&Sm  Ta    \&No     Ta    \&No     Ta    <2
3042.It Sx \&St  Ta    \&No     Ta    Yes      Ta    1
3043.It Sx \&Sx  Ta    Yes      Ta    Yes      Ta    >0
3044.It Sx \&Sy  Ta    Yes      Ta    Yes      Ta    >0
3045.It Sx \&Tn  Ta    Yes      Ta    Yes      Ta    >0
3046.It Sx \&Ud  Ta    \&No     Ta    \&No     Ta    0
3047.It Sx \&Ux  Ta    Yes      Ta    Yes      Ta    n
3048.It Sx \&Va  Ta    Yes      Ta    Yes      Ta    n
3049.It Sx \&Vt  Ta    Yes      Ta    Yes      Ta    >0
3050.It Sx \&Xr  Ta    Yes      Ta    Yes      Ta    >0
3051.It Sx \&br  Ta    \&No     Ta    \&No     Ta    0
3052.It Sx \&sp  Ta    \&No     Ta    \&No     Ta    1
3053.El
3054.Ss Delimiters
3055When a macro argument consists of one single input character
3056considered as a delimiter, the argument gets special handling.
3057This does not apply when delimiters appear in arguments containing
3058more than one character.
3059Consequently, to prevent special handling and just handle it
3060like any other argument, a delimiter can be escaped by prepending
3061a zero-width space
3062.Pq Sq \e& .
3063In text lines, delimiters never need escaping, but may be used
3064as normal punctuation.
3065.Pp
3066For many macros, when the leading arguments are opening delimiters,
3067these delimiters are put before the macro scope,
3068and when the trailing arguments are closing delimiters,
3069these delimiters are put after the macro scope.
3070For example,
3071.Pp
3072.D1 Pf \. \&Aq "( [ word ] ) ."
3073.Pp
3074renders as:
3075.Pp
3076.D1 Aq ( [ word ] ) .
3077.Pp
3078Opening delimiters are:
3079.Pp
3080.Bl -tag -width Ds -offset indent -compact
3081.It \&(
3082left parenthesis
3083.It \&[
3084left bracket
3085.El
3086.Pp
3087Closing delimiters are:
3088.Pp
3089.Bl -tag -width Ds -offset indent -compact
3090.It \&.
3091period
3092.It \&,
3093comma
3094.It \&:
3095colon
3096.It \&;
3097semicolon
3098.It \&)
3099right parenthesis
3100.It \&]
3101right bracket
3102.It \&?
3103question mark
3104.It \&!
3105exclamation mark
3106.El
3107.Pp
3108Note that even a period preceded by a backslash
3109.Pq Sq \e.\&
3110gets this special handling; use
3111.Sq \e&.
3112to prevent that.
3113.Pp
3114Many in-line macros interrupt their scope when they encounter
3115delimiters, and resume their scope when more arguments follow that
3116are not delimiters.
3117For example,
3118.Pp
3119.D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e"
3120.Pp
3121renders as:
3122.Pp
3123.D1 Fl a ( b | c \*(Ba d ) e
3124.Pp
3125This applies to both opening and closing delimiters,
3126and also to the middle delimiter:
3127.Pp
3128.Bl -tag -width Ds -offset indent -compact
3129.It \&|
3130vertical bar
3131.El
3132.Pp
3133As a special case, the predefined string \e*(Ba is handled and rendered
3134in the same way as a plain
3135.Sq \&|
3136character.
3137Using this predefined string is not recommended in new manuals.
3138.Ss Font handling
3139In
3140.Nm
3141documents, usage of semantic markup is recommended in order to have
3142proper fonts automatically selected; only when no fitting semantic markup
3143is available, consider falling back to
3144.Sx Physical markup
3145macros.
3146Whenever any
3147.Nm
3148macro switches the
3149.Xr roff 7
3150font mode, it will automatically restore the previous font when exiting
3151its scope.
3152Manually switching the font using the
3153.Xr roff 7
3154.Ql \ef
3155font escape sequences is never required.
3156.Sh COMPATIBILITY
3157This section provides an incomplete list of compatibility issues
3158between mandoc and GNU troff
3159.Pq Qq groff .
3160.Pp
3161The following problematic behaviour is found in groff:
3162.Pp
3163.Bl -dash -compact
3164.It
3165.Sx \&Dd
3166with non-standard arguments behaves very strangely.
3167When there are three arguments, they are printed verbatim.
3168Any other number of arguments is replaced by the current date,
3169but without any arguments the string
3170.Dq Epoch
3171is printed.
3172.It
3173.Sx \&Lk
3174only accepts a single link-name argument; the remainder is misformatted.
3175.It
3176.Sx \&Pa
3177does not format its arguments when used in the FILES section under
3178certain list types.
3179.It
3180.Sx \&Ta
3181can only be called by other macros, but not at the beginning of a line.
3182.It
3183.Sx \&%C
3184is not implemented (up to and including groff-1.22.2).
3185.It
3186.Sq \ef
3187.Pq font face
3188and
3189.Sq \eF
3190.Pq font family face
3191.Sx Text Decoration
3192escapes behave irregularly when specified within line-macro scopes.
3193.It
3194Negative scaling units return to prior lines.
3195Instead, mandoc truncates them to zero.
3196.El
3197.Pp
3198The following features are unimplemented in mandoc:
3199.Pp
3200.Bl -dash -compact
3201.It
3202.Sx \&Bd
3203.Fl file Ar file
3204is unsupported for security reasons.
3205.It
3206.Sx \&Bd
3207.Fl filled
3208does not adjust the right margin, but is an alias for
3209.Sx \&Bd
3210.Fl ragged .
3211.It
3212.Sx \&Bd
3213.Fl literal
3214does not use a literal font, but is an alias for
3215.Sx \&Bd
3216.Fl unfilled .
3217.It
3218.Sx \&Bd
3219.Fl offset Cm center
3220and
3221.Fl offset Cm right
3222don't work.
3223Groff does not implement centered and flush-right rendering either,
3224but produces large indentations.
3225.El
3226.Sh SEE ALSO
3227.Xr man 1 ,
3228.Xr mandoc 1 ,
3229.Xr eqn 7 ,
3230.Xr man 7 ,
3231.Xr mandoc_char 7 ,
3232.Xr roff 7 ,
3233.Xr tbl 7
3234.Sh HISTORY
3235The
3236.Nm
3237language first appeared as a troff macro package in
3238.Bx 4.4 .
3239It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3240in groff-1.17.
3241The standalone implementation that is part of the
3242.Xr mandoc 1
3243utility written by Kristaps Dzonsons appeared in
3244.Ox 4.6 .
3245.Sh AUTHORS
3246The
3247.Nm
3248reference was written by
3249.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
3250