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