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