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