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