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