[BACK]Return to mdoc.7 CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/mdoc.7, Revision 1.95

1.95    ! kristaps    1: .\"    $Id: mdoc.7,v 1.94 2010/04/13 05:26:49 kristaps Exp $
1.1       kristaps    2: .\"
1.94      kristaps    3: .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@bsd.lv>
1.1       kristaps    4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
1.22      kristaps    6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
1.1       kristaps    8: .\"
1.22      kristaps    9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.50      kristaps   16: .\"
1.95    ! kristaps   17: .Dd $Mdocdate: April 13 2010 $
1.20      kristaps   18: .Dt MDOC 7
1.1       kristaps   19: .Os
                     20: .Sh NAME
1.57      kristaps   21: .Nm mdoc
                     22: .Nd mdoc language reference
1.1       kristaps   23: .Sh DESCRIPTION
                     24: The
1.57      kristaps   25: .Nm mdoc
1.50      kristaps   26: language is used to format
1.57      kristaps   27: .Bx
                     28: .Ux
1.43      kristaps   29: manuals.  In this reference document, we describe its syntax, structure,
1.93      kristaps   30: and usage.  Our reference implementation is mandoc; the
1.57      kristaps   31: .Sx COMPATIBILITY
1.93      kristaps   32: section describes compatibility with other troff \-mdoc implementations.
1.57      kristaps   33: .Pp
1.13      kristaps   34: An
1.57      kristaps   35: .Nm
1.1       kristaps   36: document follows simple rules:  lines beginning with the control
1.50      kristaps   37: character
1.57      kristaps   38: .Sq \.
1.1       kristaps   39: are parsed for macros.  Other lines are interpreted within the scope of
1.13      kristaps   40: prior macros:
1.57      kristaps   41: .Bd -literal -offset indent
1.13      kristaps   42: \&.Sh Macro lines change control state.
                     43: Other lines are interpreted within the current state.
1.57      kristaps   44: .Ed
1.46      kristaps   45: .Sh LANGUAGE SYNTAX
1.57      kristaps   46: .Nm
1.13      kristaps   47: documents may contain only graphable 7-bit ASCII characters, the space
1.43      kristaps   48: character, and, in certain circumstances, the tab character.  All
                     49: manuals must have
1.57      kristaps   50: .Ux
1.50      kristaps   51: line terminators.
1.57      kristaps   52: .Ss Comments
1.43      kristaps   53: Text following a
1.57      kristaps   54: .Sq \e" ,
1.43      kristaps   55: whether in a macro or free-form text line, is ignored to the end of
                     56: line.  A macro line with only a control character and comment escape,
1.57      kristaps   57: .Sq \&.\e" ,
1.58      kristaps   58: is also ignored.  Macro lines with only a control charater and optionally
                     59: whitespace are stripped from input.
1.57      kristaps   60: .Ss Reserved Characters
1.2       kristaps   61: Within a macro line, the following characters are reserved:
1.61      kristaps   62: .Pp
1.57      kristaps   63: .Bl -tag -width Ds -offset indent -compact
                     64: .It \&.
                     65: .Pq period
                     66: .It \&,
                     67: .Pq comma
                     68: .It \&:
                     69: .Pq colon
                     70: .It \&;
                     71: .Pq semicolon
                     72: .It \&(
                     73: .Pq left-parenthesis
                     74: .It \&)
                     75: .Pq right-parenthesis
                     76: .It \&[
                     77: .Pq left-bracket
                     78: .It \&]
                     79: .Pq right-bracket
                     80: .It \&?
                     81: .Pq question
                     82: .It \&!
                     83: .Pq exclamation
                     84: .It \&|
                     85: .Pq vertical bar
                     86: .El
                     87: .Pp
1.5       kristaps   88: Use of reserved characters is described in
1.57      kristaps   89: .Sx MACRO SYNTAX .
1.43      kristaps   90: For general use in macro lines, these characters must either be escaped
                     91: with a non-breaking space
1.57      kristaps   92: .Pq Sq \e&
1.50      kristaps   93: or, if applicable, an appropriate escape sequence used.
1.57      kristaps   94: .Ss Special Characters
1.43      kristaps   95: Special characters may occur in both macro and free-form lines.
                     96: Sequences begin with the escape character
1.57      kristaps   97: .Sq \e
1.50      kristaps   98: followed by either an open-parenthesis
1.57      kristaps   99: .Sq \&(
1.1       kristaps  100: for two-character sequences; an open-bracket
1.57      kristaps  101: .Sq \&[
1.1       kristaps  102: for n-character sequences (terminated at a close-bracket
1.57      kristaps  103: .Sq \&] ) ;
1.43      kristaps  104: or a single one-character sequence.  See
1.57      kristaps  105: .Xr mandoc_char 7
1.50      kristaps  106: for a complete list.  Examples include
1.57      kristaps  107: .Sq \e(em
                    108: .Pq em-dash
1.50      kristaps  109: and
1.57      kristaps  110: .Sq \ee
                    111: .Pq back-slash .
                    112: .Ss Text Decoration
1.54      kristaps  113: Terms may be text-decorated using the
1.57      kristaps  114: .Sq \ef
1.74      kristaps  115: escape followed by an indicator: B (bold), I, (italic), R (Roman), or P
1.82      kristaps  116: (revert to previous mode):
1.75      kristaps  117: .Pp
1.76      kristaps  118: .D1 \efBbold\efR \efIitalic\efP
                    119: .Pp
                    120: A numerical representation 3, 2, or 1 (bold, italic, and Roman,
1.77      kristaps  121: respectively) may be used instead.  A text decoration is valid within
                    122: the current font scope only:  if a macro opens a font scope alongside
                    123: its own scope, such as
1.78      kristaps  124: .Sx \&Bf
1.77      kristaps  125: .Cm \&Sy ,
                    126: in-scope invocations of
                    127: .Sq \ef
                    128: are only valid within the font scope of the macro.  If
                    129: .Sq \ef
                    130: is specified outside of any font scope, such as in unenclosed, free-form
                    131: text, it will affect the remainder of the document.
1.76      kristaps  132: .Pp
                    133: Text may also be sized with the
                    134: .Sq \es
                    135: escape, whose syntax is one of
                    136: .Sq \es+-n
                    137: for one-digit numerals;
                    138: .Sq \es(+-nn
                    139: or
                    140: .Sq \es+-(nn
                    141: for two-digit numerals; and
                    142: .Sq \es[+-N] ,
                    143: .Sq \es+-[N] ,
                    144: .Sq \es'+-N' ,
                    145: or
                    146: .Sq \es+-'N'
                    147: for arbitrary-digit numerals:
                    148: .Pp
                    149: .D1 \es+1bigger\es-1
                    150: .D1 \es[+10]much bigger\es[-10]
                    151: .D1 \es+(10much bigger\es-(10
                    152: .D1 \es+'100'much much bigger\es-'100'
                    153: .Pp
1.82      kristaps  154: Note these forms are
1.76      kristaps  155: .Em not
1.82      kristaps  156: recommended for
1.57      kristaps  157: .Nm ,
1.74      kristaps  158: which encourages semantic annotation.
1.57      kristaps  159: .Ss Predefined Strings
1.82      kristaps  160: Historically,
1.57      kristaps  161: .Xr groff 1
1.82      kristaps  162: also defined a set of package-specific
1.57      kristaps  163: .Dq predefined strings ,
1.82      kristaps  164: which, like
1.57      kristaps  165: .Sx Special Characters ,
1.54      kristaps  166: demark special output characters and strings by way of input codes.
                    167: Predefined strings are escaped with the slash-asterisk,
1.57      kristaps  168: .Sq \e* :
1.54      kristaps  169: single-character
1.57      kristaps  170: .Sq \e*X ,
1.54      kristaps  171: two-character
1.57      kristaps  172: .Sq \e*(XX ,
1.54      kristaps  173: and N-character
1.57      kristaps  174: .Sq \e*[N] .
1.54      kristaps  175: See
1.57      kristaps  176: .Xr mandoc_char 7
1.54      kristaps  177: for a complete list.  Examples include
1.57      kristaps  178: .Sq \e*(Am
                    179: .Pq ampersand
1.54      kristaps  180: and
1.57      kristaps  181: .Sq \e*(Ba
                    182: .Pq vertical bar .
                    183: .Ss Whitespace
1.46      kristaps  184: In non-literal free-form lines, consecutive blocks of whitespace are
                    185: pruned from input and added later in the output filter, if applicable:
1.57      kristaps  186: .Bd -literal -offset indent
1.46      kristaps  187: These     spaces   are    pruned       from    input.
1.50      kristaps  188: \&.Bd \-literal
1.46      kristaps  189: These         are              not.
                    190: \&.Ed
1.57      kristaps  191: .Ed
                    192: .Pp
1.46      kristaps  193: In macro lines, whitespace delimits arguments and is discarded.  If
1.47      kristaps  194: arguments are quoted, whitespace within the quotes is retained.
1.57      kristaps  195: .Pp
1.46      kristaps  196: Blank lines are only permitted within literal contexts, as are lines
                    197: containing only whitespace.  Tab characters are only acceptable when
1.50      kristaps  198: delimiting
1.57      kristaps  199: .Sq \&Bl \-column
1.46      kristaps  200: or when in a literal context.
1.57      kristaps  201: .Ss Quotation
1.46      kristaps  202: Macro arguments may be quoted with a double-quote to group
                    203: space-delimited terms or to retain blocks of whitespace.  A quoted
                    204: argument begins with a double-quote preceded by whitespace.  The next
1.48      kristaps  205: double-quote not pair-wise adjacent to another double-quote terminates
1.50      kristaps  206: the literal, regardless of surrounding whitespace.
1.57      kristaps  207: .Pp
1.50      kristaps  208: This produces tokens
1.57      kristaps  209: .Sq a" ,
                    210: .Sq b c ,
                    211: .Sq de ,
1.47      kristaps  212: and
1.57      kristaps  213: .Sq fg" .
1.47      kristaps  214: Note that any quoted term, be it argument or macro, is indiscriminately
1.50      kristaps  215: considered literal text.  Thus, the following produces
1.57      kristaps  216: .Sq \&Em a :
                    217: .Bd -literal -offset indent
1.47      kristaps  218: \&.Em "Em a"
1.57      kristaps  219: .Ed
                    220: .Pp
1.46      kristaps  221: In free-form mode, quotes are regarded as opaque text.
1.63      kristaps  222: .Ss Dates
1.66      kristaps  223: There are several macros in
                    224: .Nm
1.72      kristaps  225: that require a date argument.  The canonical form for dates is the
                    226: American format:
1.66      kristaps  227: .Pp
                    228: .D1 Cm Month Day , Year
                    229: .Pp
                    230: The
                    231: .Cm Day
                    232: value is an optionally zero-padded numeral.  The
                    233: .Cm Month
                    234: value is the full month name.  The
                    235: .Cm Year
                    236: value is the full four-digit year.
                    237: .Pp
1.72      kristaps  238: Reduced form dates are broken-down canonical form dates:
1.66      kristaps  239: .Pp
1.72      kristaps  240: .D1 Cm Month , Year
                    241: .D1 Cm Year
1.66      kristaps  242: .Pp
                    243: Some examples of valid dates follow:
                    244: .Pp
                    245: .D1 "May, 2009" Pq reduced form
                    246: .D1 "2009" Pq reduced form
                    247: .D1 "May 20, 2009" Pq canonical form
1.61      kristaps  248: .Ss Scaling Widths
                    249: Many macros support scaled widths for their arguments, such as
                    250: stipulating a two-inch list indentation with the following:
                    251: .Bd -literal -offset indent
                    252: \&.Bl -tag -width 2i
                    253: .Ed
                    254: .Pp
                    255: The syntax for scaled widths is
1.62      kristaps  256: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
1.61      kristaps  257: where a decimal must be preceded or proceeded by at least one digit.
                    258: Negative numbers, while accepted, are truncated to zero.  The following
                    259: scaling units are accepted:
                    260: .Pp
                    261: .Bl -tag -width Ds -offset indent -compact
                    262: .It c
                    263: centimetre
                    264: .It i
                    265: inch
                    266: .It P
                    267: pica (~1/6 inch)
                    268: .It p
                    269: point (~1/72 inch)
                    270: .It f
                    271: synonym for
                    272: .Sq u
                    273: .It v
                    274: default vertical span
                    275: .It m
                    276: width of rendered
                    277: .Sq m
                    278: .Pq em
                    279: character
                    280: .It n
                    281: width of rendered
                    282: .Sq n
                    283: .Pq en
                    284: character
                    285: .It u
                    286: default horizontal span
                    287: .It M
                    288: mini-em (~1/100 em)
                    289: .El
                    290: .Pp
                    291: Using anything other than
                    292: .Sq m ,
                    293: .Sq n ,
                    294: .Sq u ,
                    295: or
                    296: .Sq v
                    297: is necessarily non-portable across output media.  See
                    298: .Sx COMPATIBILITY .
1.43      kristaps  299: .Sh MANUAL STRUCTURE
1.66      kristaps  300: A well-formed
1.57      kristaps  301: .Nm
1.66      kristaps  302: document consists of a document prologue followed by one or more
                    303: sections.
                    304: .Pp
                    305: The prologue, which consists of (in order) the
1.64      kristaps  306: .Sx \&Dd ,
                    307: .Sx \&Dt ,
1.33      kristaps  308: and
1.66      kristaps  309: .Sx \&Os
                    310: macros, is required for every document.
                    311: .Pp
1.82      kristaps  312: The first section (sections are denoted by
1.66      kristaps  313: .Sx \&Sh )
                    314: must be the NAME section, consisting of at least one
1.64      kristaps  315: .Sx \&Nm
1.50      kristaps  316: followed by
1.66      kristaps  317: .Sx \&Nd .
                    318: .Pp
                    319: Following that, convention dictates specifying at least the SYNOPSIS and
                    320: DESCRIPTION sections, although this varies between manual sections.
                    321: .Pp
                    322: The following is a well-formed skeleton
                    323: .Nm
                    324: file:
1.57      kristaps  325: .Bd -literal -offset indent
1.43      kristaps  326: \&.Dd $\&Mdocdate$
                    327: \&.Dt mdoc 7
                    328: \&.Os
1.58      kristaps  329: \&.
1.43      kristaps  330: \&.Sh NAME
1.58      kristaps  331: \&.Nm foo
                    332: \&.Nd a description goes here
                    333: \&.\e\*q The next is for sections 2 & 3 only.
                    334: \&.\e\*q .Sh LIBRARY
                    335: \&.
                    336: \&.Sh SYNOPSIS
                    337: \&.Nm foo
                    338: \&.Op Fl options
                    339: \&.Ar
                    340: \&.
                    341: \&.Sh DESCRIPTION
                    342: The
                    343: \&.Nm
                    344: utility processes files ...
1.59      kristaps  345: \&.\e\*q .Sh IMPLEMENTATION NOTES
1.58      kristaps  346: \&.\e\*q The next is for sections 1 & 8 only.
                    347: \&.\e\*q .Sh EXIT STATUS
                    348: \&.\e\*q The next is for sections 2, 3, & 9 only.
                    349: \&.\e\*q .Sh RETURN VALUES
                    350: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
                    351: \&.\e\*q .Sh ENVIRONMENT
                    352: \&.\e\*q .Sh FILES
                    353: \&.\e\*q .Sh EXAMPLES
                    354: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
                    355: \&.\e\*q .Sh DIAGNOSTICS
                    356: \&.\e\*q The next is for sections 2, 3, & 9 only.
                    357: \&.\e\*q .Sh ERRORS
                    358: \&.\e\*q .Sh SEE ALSO
                    359: \&.\e\*q .Xr foobar 1
                    360: \&.\e\*q .Sh STANDARDS
                    361: \&.\e\*q .Sh HISTORY
                    362: \&.\e\*q .Sh AUTHORS
                    363: \&.\e\*q .Sh CAVEATS
                    364: \&.\e\*q .Sh BUGS
                    365: \&.\e\*q .Sh SECURITY CONSIDERATIONS
1.57      kristaps  366: .Ed
                    367: .Pp
1.66      kristaps  368: The sections in a
                    369: .Nm
                    370: document are conventionally ordered as they appear above.  Sections
                    371: should be composed as follows:
1.73      kristaps  372: .Bl -ohang -offset Ds
                    373: .It Em NAME
                    374: The name(s) and a short description of the documented material.  The
                    375: syntax for this as follows:
                    376: .Bd -literal -offset indent
                    377: \&.Nm name0
                    378: \&.Nm name1
                    379: \&.Nm name2
                    380: \&.Nd a short description
                    381: .Ed
                    382: .Pp
                    383: The
1.66      kristaps  384: .Sx \&Nm
1.73      kristaps  385: macro(s) must precede the
                    386: .Sx \&Nd
                    387: macro.
1.80      kristaps  388: .Pp
1.82      kristaps  389: See
1.80      kristaps  390: .Sx \&Nm
                    391: and
                    392: .Sx \&Nd .
1.73      kristaps  393: .It Em LIBRARY
                    394: The name of the library containing the documented material, which is
                    395: assumed to be a function in a section 2 or 3 manual.  The syntax for
                    396: this is as follows:
                    397: .Bd -literal -offset indent
                    398: \&.Lb libarm
                    399: .Ed
                    400: .Pp
                    401: See
1.80      kristaps  402: .Sx \&Lb .
1.73      kristaps  403: .It Em SYNOPSIS
                    404: Documents the utility invocation syntax, function call syntax, or device
1.82      kristaps  405: configuration.
1.73      kristaps  406: .Pp
                    407: For the first, utilities (sections 1, 6, and 8), this is
                    408: generally structured as follows:
                    409: .Bd -literal -offset indent
                    410: \&.Nm foo
                    411: \&.Op Fl v
                    412: \&.Op Fl o Ar file
                    413: \&.Op Ar
                    414: \&.Nm bar
                    415: \&.Op Fl v
                    416: \&.Op Fl o Ar file
                    417: \&.Op Ar
                    418: .Ed
                    419: .Pp
                    420: For the second, function calls (sections 2, 3, 9):
                    421: .Bd -literal -offset indent
                    422: \&.Vt extern const char *global;
                    423: \&.In header.h
                    424: \&.Ft "char *"
                    425: \&.Fn foo "const char *src"
                    426: \&.Ft "char *"
                    427: \&.Fn bar "const char *src"
                    428: .Ed
                    429: .Pp
                    430: And for the third, configurations (section 4):
                    431: .Bd -literal -offset indent
                    432: \&.Cd \*qit* at isa? port 0x2e\*q
                    433: \&.Cd \*qit* at isa? port 0x4e\*q
                    434: .Ed
                    435: .Pp
1.82      kristaps  436: Manuals not in these sections generally don't need a
1.73      kristaps  437: .Em SYNOPSIS .
1.80      kristaps  438: .Pp
1.82      kristaps  439: See
1.80      kristaps  440: .Sx \&Op ,
                    441: .Sx \&Cd ,
                    442: .Sx \&Fn ,
                    443: .Sx \&Ft ,
                    444: and
                    445: .Sx \&Vt .
1.73      kristaps  446: .It Em DESCRIPTION
1.82      kristaps  447: This expands upon the brief, one-line description in
1.73      kristaps  448: .Em NAME .
                    449: It usually contains a break-down of the options (if documenting a
                    450: command), such as:
                    451: .Bd -literal -offset indent
                    452: The arguments are as follows:
                    453: \&.Bl \-tag \-width Ds
                    454: \&.It Fl v
                    455: Print verbose information.
                    456: \&.El
                    457: .Ed
1.80      kristaps  458: .Pp
1.73      kristaps  459: Manuals not documenting a command won't include the above fragment.
                    460: .It Em IMPLEMENTATION NOTES
                    461: Implementation-specific notes should be kept here.  This is useful when
                    462: implementing standard functions that may have side effects or notable
                    463: algorithmic implications.
                    464: .It Em EXIT STATUS
                    465: Command exit status for section 1, 6, and 8 manuals.  This section is
                    466: the dual of
                    467: .Em RETURN VALUES ,
                    468: which is used for functions.  Historically, this information was
                    469: described in
                    470: .Em DIAGNOSTICS ,
                    471: a practise that is now discouraged.
                    472: .Pp
                    473: See
                    474: .Sx \&Ex .
                    475: .It Em RETURN VALUES
                    476: This section is the dual of
                    477: .Em EXIT STATUS ,
                    478: which is used for commands.  It documents the return values of functions
                    479: in sections 2, 3, and 9.
                    480: .Pp
                    481: See
                    482: .Sx \&Rv .
                    483: .It Em ENVIRONMENT
                    484: Documents any usages of environment variables, e.g.,
                    485: .Xr environ 7 .
                    486: .Pp
                    487: See
                    488: .Sx \&Ev .
                    489: .It Em FILES
                    490: Documents files used.  It's helpful to document both the file and a
                    491: short description of how the file is used (created, modified, etc.).
                    492: .Pp
                    493: See
                    494: .Sx \&Pa .
                    495: .It Em EXAMPLES
                    496: Example usages.  This often contains snippets of well-formed,
                    497: well-tested invocations.  Make doubly sure that your examples work
                    498: properly!
                    499: .It Em DIAGNOSTICS
                    500: Documents error conditions.  This is most useful in section 4 manuals.
                    501: Historically, this section was used in place of
                    502: .Em EXIT STATUS
                    503: for manuals in sections 1, 6, and 8; however, this practise is
                    504: discouraged.
                    505: .Pp
                    506: See
1.80      kristaps  507: .Sx \&Bl
                    508: .Fl diag .
1.73      kristaps  509: .It Em ERRORS
                    510: Documents error handling in sections 2, 3, and 9.
                    511: .Pp
                    512: See
                    513: .Sx \&Er .
                    514: .It Em SEE ALSO
                    515: References other manuals with related topics.  This section should exist
                    516: for most manuals.  Cross-references should conventionally be ordered
                    517: first by section, then alphabetically.
                    518: .Pp
                    519: See
                    520: .Sx \&Xr .
                    521: .It Em STANDARDS
                    522: References any standards implemented or used.  If not adhering to any
                    523: standards, the
                    524: .Em HISTORY
                    525: section should be used instead.
                    526: .Pp
                    527: See
                    528: .Sx \&St .
                    529: .It Em HISTORY
                    530: The history of any manual without a
                    531: .Em STANDARDS
                    532: section should be described in this section.
                    533: .It Em AUTHORS
                    534: Credits to authors, if applicable, should appear in this section.
                    535: Authors should generally be noted by both name and an e-mail address.
                    536: .Pp
                    537: See
                    538: .Sx \&An .
                    539: .It Em CAVEATS
                    540: Explanations of common misuses and misunderstandings should be explained
                    541: in this section.
                    542: .It Em BUGS
                    543: Extant bugs should be described in this section.
                    544: .It Em SECURITY CONSIDERATIONS
                    545: Documents any security precautions that operators should consider.
1.66      kristaps  546: .El
1.43      kristaps  547: .Sh MACRO SYNTAX
1.56      kristaps  548: Macros are one to three three characters in length and begin with a
                    549: control character ,
1.57      kristaps  550: .Sq \&. ,
1.56      kristaps  551: at the beginning of the line.  An arbitrary amount of whitespace may
1.64      kristaps  552: sit between the control character and the macro name.  Thus, the
                    553: following are equivalent:
                    554: .Bd -literal -offset indent
                    555: \&.Pp
                    556: \&.\ \ \ \&Pp
                    557: .Ed
1.57      kristaps  558: .Pp
1.46      kristaps  559: The syntax of a macro depends on its classification.  In this section,
1.57      kristaps  560: .Sq \-arg
1.43      kristaps  561: refers to macro arguments, which may be followed by zero or more
1.57      kristaps  562: .Sq parm
1.43      kristaps  563: parameters;
1.57      kristaps  564: .Sq \&Yo
1.43      kristaps  565: opens the scope of a macro; and if specified,
1.57      kristaps  566: .Sq \&Yc
1.43      kristaps  567: closes it out.
1.57      kristaps  568: .Pp
1.43      kristaps  569: The
1.57      kristaps  570: .Em Callable
1.43      kristaps  571: column indicates that the macro may be called subsequent to the initial
1.55      kristaps  572: line-macro.  If a macro is not callable, then its invocation after the
                    573: initial line macro is interpreted as opaque text, such that
1.60      kristaps  574: .Sq \&.Fl \&Sh
1.55      kristaps  575: produces
1.60      kristaps  576: .Sq Fl \&Sh .
1.57      kristaps  577: .Pp
1.55      kristaps  578: The
1.57      kristaps  579: .Em Parsable
1.43      kristaps  580: column indicates whether the macro may be followed by further
1.55      kristaps  581: (ostensibly callable) macros.  If a macro is not parsable, subsequent
                    582: macro invocations on the line will be interpreted as opaque text.
1.57      kristaps  583: .Pp
1.55      kristaps  584: The
1.57      kristaps  585: .Em Scope
1.43      kristaps  586: column, if applicable, describes closure rules.
1.57      kristaps  587: .Ss Block full-explicit
1.43      kristaps  588: Multi-line scope closed by an explicit closing macro.  All macros
                    589: contains bodies; only
1.64      kristaps  590: .Sx \&Bf
1.43      kristaps  591: contains a head.
1.57      kristaps  592: .Bd -literal -offset indent
1.50      kristaps  593: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
                    594: \(lBbody...\(rB
1.43      kristaps  595: \&.Yc
1.57      kristaps  596: .Ed
                    597: .Pp
                    598: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
                    599: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64      kristaps  600: .It Sx \&Bd  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ed
                    601: .It Sx \&Bf  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ef
                    602: .It Sx \&Bk  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Ek
                    603: .It Sx \&Bl  Ta    \&No     Ta    \&No     Ta    closed by Sx \&El
                    604: .It Sx \&Ed  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bd
                    605: .It Sx \&Ef  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bf
                    606: .It Sx \&Ek  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bk
                    607: .It Sx \&El  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Bl
1.57      kristaps  608: .El
                    609: .Ss Block full-implicit
1.43      kristaps  610: Multi-line scope closed by end-of-file or implicitly by another macro.
1.50      kristaps  611: All macros have bodies; some
1.57      kristaps  612: .Po
1.64      kristaps  613: .Sx \&It Fl bullet ,
                    614: .Fl hyphen ,
                    615: .Fl dash ,
                    616: .Fl enum ,
                    617: .Fl item
1.57      kristaps  618: .Pc
1.64      kristaps  619: don't have heads; only one
                    620: .Po
                    621: .Sx \&It Fl column
1.82      kristaps  622: .Pc
1.64      kristaps  623: has multiple heads.
1.57      kristaps  624: .Bd -literal -offset indent
1.50      kristaps  625: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
                    626: \(lBbody...\(rB
1.57      kristaps  627: .Ed
                    628: .Pp
                    629: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
                    630: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64      kristaps  631: .It Sx \&It  Ta    \&No     Ta    Yes      Ta    closed by Sx \&It , Sx \&El
                    632: .It Sx \&Nd  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Sh
                    633: .It Sx \&Sh  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Sh
                    634: .It Sx \&Ss  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Sh , Sx \&Ss
1.57      kristaps  635: .El
                    636: .Ss Block partial-explicit
1.43      kristaps  637: Like block full-explicit, but also with single-line scope.  Each
1.50      kristaps  638: has at least a body and, in limited circumstances, a head
1.64      kristaps  639: .Po
                    640: .Sx \&Fo ,
                    641: .Sx \&Eo
                    642: .Pc
1.50      kristaps  643: and/or tail
1.64      kristaps  644: .Pq Sx \&Ec .
1.57      kristaps  645: .Bd -literal -offset indent
1.50      kristaps  646: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
                    647: \(lBbody...\(rB
                    648: \&.Yc \(lBtail...\(rB
1.2       kristaps  649:
1.43      kristaps  650: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.50      kristaps  651: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.57      kristaps  652: .Ed
                    653: .Pp
                    654: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
                    655: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
1.64      kristaps  656: .It Sx \&Ac  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Ao
1.63      kristaps  657: .It Sx \&Ao  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ac
1.64      kristaps  658: .It Sx \&Bc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Bo
                    659: .It Sx \&Bo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bc
                    660: .It Sx \&Brc Ta    Yes      Ta    Yes      Ta    opened by Sx \&Bro
                    661: .It Sx \&Bro Ta    Yes      Ta    Yes      Ta    closed by Sx \&Brc
                    662: .It Sx \&Dc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Do
                    663: .It Sx \&Do  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Dc
                    664: .It Sx \&Ec  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Eo
                    665: .It Sx \&Eo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Ec
                    666: .It Sx \&Fc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Fo
                    667: .It Sx \&Fo  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Fc
                    668: .It Sx \&Oc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oo
                    669: .It Sx \&Oo  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oc
                    670: .It Sx \&Pc  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Po
                    671: .It Sx \&Po  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Pc
                    672: .It Sx \&Qc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Oo
                    673: .It Sx \&Qo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Oc
1.63      kristaps  674: .It Sx \&Re  Ta    \&No     Ta    \&No     Ta    opened by Sx \&Rs
                    675: .It Sx \&Rs  Ta    \&No     Ta    \&No     Ta    closed by Sx \&Re
1.64      kristaps  676: .It Sx \&Sc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&So
                    677: .It Sx \&So  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Sc
                    678: .It Sx \&Xc  Ta    Yes      Ta    Yes      Ta    opened by Sx \&Xo
                    679: .It Sx \&Xo  Ta    Yes      Ta    Yes      Ta    closed by Sx \&Xc
1.57      kristaps  680: .El
                    681: .Ss Block partial-implicit
1.50      kristaps  682: Like block full-implicit, but with single-line scope closed by
1.57      kristaps  683: .Sx Reserved Characters
1.43      kristaps  684: or end of line.
1.57      kristaps  685: .Bd -literal -offset indent
1.43      kristaps  686: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.57      kristaps  687: .Ed
                    688: .Pp
                    689: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
                    690: .It Em Macro Ta Em Callable Ta Em Parsable
1.64      kristaps  691: .It Sx \&Aq  Ta    Yes      Ta    Yes
                    692: .It Sx \&Bq  Ta    Yes      Ta    Yes
                    693: .It Sx \&Brq Ta    Yes      Ta    Yes
                    694: .It Sx \&D1  Ta    \&No     Ta    \&Yes
                    695: .It Sx \&Dl  Ta    \&No     Ta    Yes
                    696: .It Sx \&Dq  Ta    Yes      Ta    Yes
                    697: .It Sx \&Op  Ta    Yes      Ta    Yes
                    698: .It Sx \&Pq  Ta    Yes      Ta    Yes
                    699: .It Sx \&Ql  Ta    Yes      Ta    Yes
                    700: .It Sx \&Qq  Ta    Yes      Ta    Yes
                    701: .It Sx \&Sq  Ta    Yes      Ta    Yes
1.83      kristaps  702: .It Sx \&Vt  Ta    Yes      Ta    Yes
1.57      kristaps  703: .El
1.83      kristaps  704: .Pp
                    705: Note that the
                    706: .Sx \&Vt
                    707: macro is a
                    708: .Sx Block partial-implicit
                    709: only when invoked as the first macro
                    710: in a SYNOPSIS section line, else it is
                    711: .Sx In-line .
1.57      kristaps  712: .Ss In-line
1.50      kristaps  713: Closed by
1.57      kristaps  714: .Sx Reserved Characters ,
1.43      kristaps  715: end of line, fixed argument lengths, and/or subsequent macros.  In-line
                    716: macros have only text children.  If a number (or inequality) of
1.3       kristaps  717: arguments is
1.57      kristaps  718: .Pq n ,
1.3       kristaps  719: then the macro accepts an arbitrary number of arguments.
1.57      kristaps  720: .Bd -literal -offset indent
1.43      kristaps  721: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
                    722:
                    723: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
                    724:
                    725: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.57      kristaps  726: .Ed
                    727: .Pp
                    728: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
                    729: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
1.63      kristaps  730: .It Sx \&%A  Ta    \&No     Ta    \&No     Ta    >0
                    731: .It Sx \&%B  Ta    \&No     Ta    \&No     Ta    >0
                    732: .It Sx \&%C  Ta    \&No     Ta    \&No     Ta    >0
                    733: .It Sx \&%D  Ta    \&No     Ta    \&No     Ta    >0
                    734: .It Sx \&%I  Ta    \&No     Ta    \&No     Ta    >0
                    735: .It Sx \&%J  Ta    \&No     Ta    \&No     Ta    >0
                    736: .It Sx \&%N  Ta    \&No     Ta    \&No     Ta    >0
                    737: .It Sx \&%O  Ta    \&No     Ta    \&No     Ta    >0
                    738: .It Sx \&%P  Ta    \&No     Ta    \&No     Ta    >0
1.69      kristaps  739: .It Sx \&%Q  Ta    \&No     Ta    \&No     Ta    >0
1.63      kristaps  740: .It Sx \&%R  Ta    \&No     Ta    \&No     Ta    >0
                    741: .It Sx \&%T  Ta    \&No     Ta    \&No     Ta    >0
1.69      kristaps  742: .It Sx \&%U  Ta    \&No     Ta    \&No     Ta    >0
1.63      kristaps  743: .It Sx \&%V  Ta    \&No     Ta    \&No     Ta    >0
1.64      kristaps  744: .It Sx \&Ad  Ta    Yes      Ta    Yes      Ta    n
                    745: .It Sx \&An  Ta    Yes      Ta    Yes      Ta    n
                    746: .It Sx \&Ap  Ta    Yes      Ta    Yes      Ta    0
                    747: .It Sx \&Ar  Ta    Yes      Ta    Yes      Ta    n
                    748: .It Sx \&At  Ta    Yes      Ta    Yes      Ta    1
                    749: .It Sx \&Bsx Ta    Yes      Ta    Yes      Ta    n
                    750: .It Sx \&Bt  Ta    \&No     Ta    \&No     Ta    0
                    751: .It Sx \&Bx  Ta    Yes      Ta    Yes      Ta    n
                    752: .It Sx \&Cd  Ta    Yes      Ta    Yes      Ta    >0
                    753: .It Sx \&Cm  Ta    Yes      Ta    Yes      Ta    n
                    754: .It Sx \&Db  Ta    \&No     Ta    \&No     Ta    1
                    755: .It Sx \&Dd  Ta    \&No     Ta    \&No     Ta    >0
                    756: .It Sx \&Dt  Ta    \&No     Ta    \&No     Ta    n
                    757: .It Sx \&Dv  Ta    Yes      Ta    Yes      Ta    n
                    758: .It Sx \&Dx  Ta    Yes      Ta    Yes      Ta    n
                    759: .It Sx \&Em  Ta    Yes      Ta    Yes      Ta    >0
                    760: .It Sx \&En  Ta    \&No     Ta    \&No     Ta    0
                    761: .It Sx \&Er  Ta    Yes      Ta    Yes      Ta    >0
                    762: .It Sx \&Es  Ta    \&No     Ta    \&No     Ta    0
                    763: .It Sx \&Ev  Ta    Yes      Ta    Yes      Ta    n
                    764: .It Sx \&Ex  Ta    \&No     Ta    \&No     Ta    n
                    765: .It Sx \&Fa  Ta    Yes      Ta    Yes      Ta    n
                    766: .It Sx \&Fd  Ta    \&No     Ta    \&No     Ta    >0
                    767: .It Sx \&Fl  Ta    Yes      Ta    Yes      Ta    n
                    768: .It Sx \&Fn  Ta    Yes      Ta    Yes      Ta    >0
                    769: .It Sx \&Fr  Ta    \&No     Ta    \&No     Ta    n
                    770: .It Sx \&Ft  Ta    Yes      Ta    Yes      Ta    n
                    771: .It Sx \&Fx  Ta    Yes      Ta    Yes      Ta    n
                    772: .It Sx \&Hf  Ta    \&No     Ta    \&No     Ta    n
                    773: .It Sx \&Ic  Ta    Yes      Ta    Yes      Ta    >0
                    774: .It Sx \&In  Ta    \&No     Ta    \&No     Ta    n
                    775: .It Sx \&Lb  Ta    \&No     Ta    \&No     Ta    1
                    776: .It Sx \&Li  Ta    Yes      Ta    Yes      Ta    n
                    777: .It Sx \&Lk  Ta    Yes      Ta    Yes      Ta    n
                    778: .It Sx \&Lp  Ta    \&No     Ta    \&No     Ta    0
                    779: .It Sx \&Ms  Ta    Yes      Ta    Yes      Ta    >0
                    780: .It Sx \&Mt  Ta    Yes      Ta    Yes      Ta    >0
                    781: .It Sx \&Nm  Ta    Yes      Ta    Yes      Ta    n
                    782: .It Sx \&No  Ta    Yes      Ta    Yes      Ta    0
                    783: .It Sx \&Ns  Ta    Yes      Ta    Yes      Ta    0
                    784: .It Sx \&Nx  Ta    Yes      Ta    Yes      Ta    n
                    785: .It Sx \&Os  Ta    \&No     Ta    \&No     Ta    n
                    786: .It Sx \&Ot  Ta    \&No     Ta    \&No     Ta    n
                    787: .It Sx \&Ox  Ta    Yes      Ta    Yes      Ta    n
                    788: .It Sx \&Pa  Ta    Yes      Ta    Yes      Ta    n
1.88      kristaps  789: .It Sx \&Pf  Ta    Yes      Ta    Yes      Ta    1
1.64      kristaps  790: .It Sx \&Pp  Ta    \&No     Ta    \&No     Ta    0
                    791: .It Sx \&Rv  Ta    \&No     Ta    \&No     Ta    n
                    792: .It Sx \&Sm  Ta    \&No     Ta    \&No     Ta    1
                    793: .It Sx \&St  Ta    \&No     Ta    Yes      Ta    1
                    794: .It Sx \&Sx  Ta    Yes      Ta    Yes      Ta    >0
                    795: .It Sx \&Sy  Ta    Yes      Ta    Yes      Ta    >0
                    796: .It Sx \&Tn  Ta    Yes      Ta    Yes      Ta    >0
                    797: .It Sx \&Ud  Ta    \&No     Ta    \&No     Ta    0
                    798: .It Sx \&Ux  Ta    Yes      Ta    Yes      Ta    n
                    799: .It Sx \&Va  Ta    Yes      Ta    Yes      Ta    n
                    800: .It Sx \&Vt  Ta    Yes      Ta    Yes      Ta    >0
1.84      kristaps  801: .It Sx \&Xr  Ta    Yes      Ta    Yes      Ta    >0
1.64      kristaps  802: .It Sx \&br  Ta    \&No     Ta    \&No     Ta    0
                    803: .It Sx \&sp  Ta    \&No     Ta    \&No     Ta    1
1.82      kristaps  804: .El
1.63      kristaps  805: .Sh REFERENCE
                    806: This section is a canonical reference of all macros, arranged
                    807: alphabetically.  For the scoping of individual macros, see
                    808: .Sx MACRO SYNTAX .
                    809: .Ss \&%A
                    810: Author name of an
                    811: .Sx \&Rs
                    812: block.  Multiple authors should each be accorded their own
1.64      kristaps  813: .Sx \%%A
1.66      kristaps  814: line.  Author names should be ordered with full or abbreviated
                    815: forename(s) first, then full surname.
1.63      kristaps  816: .Ss \&%B
                    817: Book title of an
                    818: .Sx \&Rs
                    819: block.  This macro may also be used in a non-bibliographic context when
                    820: referring to book titles.
                    821: .Ss \&%C
                    822: Publication city or location of an
                    823: .Sx \&Rs
                    824: block.
                    825: .Pp
1.65      kristaps  826: .Em Remarks :
1.63      kristaps  827: this macro is not implemented in
                    828: .Xr groff 1 .
                    829: .Ss \&%D
                    830: Publication date of an
                    831: .Sx \&Rs
1.72      kristaps  832: block.  This should follow the reduced or canonical form syntax
                    833: described in
1.63      kristaps  834: .Sx Dates .
                    835: .Ss \&%I
                    836: Publisher or issuer name of an
                    837: .Sx \&Rs
                    838: block.
                    839: .Ss \&%J
                    840: Journal name of an
                    841: .Sx \&Rs
                    842: block.
                    843: .Ss \&%N
                    844: Issue number (usually for journals) of an
                    845: .Sx \&Rs
                    846: block.
                    847: .Ss \&%O
                    848: Optional information of an
                    849: .Sx \&Rs
                    850: block.
                    851: .Ss \&%P
                    852: Book or journal page number of an
                    853: .Sx \&Rs
                    854: block.
                    855: .Ss \&%Q
                    856: Institutional author (school, government, etc.) of an
                    857: .Sx \&Rs
                    858: block.  Multiple institutional authors should each be accorded their own
1.64      kristaps  859: .Sx \&%Q
1.63      kristaps  860: line.
                    861: .Ss \&%R
                    862: Technical report name of an
                    863: .Sx \&Rs
                    864: block.
                    865: .Ss \&%T
                    866: Article title of an
                    867: .Sx \&Rs
                    868: block.  This macro may also be used in a non-bibliographical context
                    869: when referring to article titles.
1.69      kristaps  870: .Ss \&%U
1.70      kristaps  871: URI of reference document.
1.63      kristaps  872: .Ss \&%V
                    873: Volume number of an
                    874: .Sx \&Rs
                    875: block.
                    876: .Ss \&Ac
                    877: Closes an
                    878: .Sx \&Ao
                    879: block.  Does not have any tail arguments.
                    880: .Ss \&Ad
                    881: Address construct: usually in the context of an computational address in
                    882: memory, not a physical (post) address.
                    883: .Pp
1.64      kristaps  884: Examples:
1.91      kristaps  885: .D1 \&.Ad [0,$]
                    886: .D1 \&.Ad 0x00000000
1.63      kristaps  887: .Ss \&An
1.64      kristaps  888: Author name.  This macro may alternatively accepts the following
                    889: arguments, although these may not be specified along with a parameter:
                    890: .Bl -tag -width 12n -offset indent
                    891: .It Fl split
1.66      kristaps  892: Renders a line break before each author listing.
1.64      kristaps  893: .It Fl nosplit
                    894: The opposite of
                    895: .Fl split .
                    896: .El
                    897: .Pp
                    898: In the AUTHORS section, the default is not to split the first author
                    899: listing, but all subsequent author listings, whether or not they're
                    900: interspersed by other macros or text, are split.  Thus, specifying
                    901: .Fl split
                    902: will cause the first listing also to be split.  If not in the AUTHORS
                    903: section, the default is not to split.
                    904: .Pp
                    905: Examples:
1.91      kristaps  906: .D1 \&.An -nosplit
                    907: .D1 \&.An J. D. Ullman .
1.64      kristaps  908: .Pp
                    909: .Em Remarks :
                    910: the effects of
                    911: .Fl split
                    912: or
                    913: .Fl nosplit
                    914: are re-set when entering the AUTHORS section, so if one specifies
                    915: .Sx \&An Fl nosplit
                    916: in the general document body, it must be re-specified in the AUTHORS
                    917: section.
1.63      kristaps  918: .Ss \&Ao
                    919: Begins a block enclosed by angled brackets.  Does not have any head
                    920: arguments.
                    921: .Pp
1.64      kristaps  922: Examples:
1.91      kristaps  923: .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
1.63      kristaps  924: .Pp
1.64      kristaps  925: See also
                    926: .Sx \&Aq .
1.63      kristaps  927: .Ss \&Ap
1.64      kristaps  928: Inserts an apostrophe without any surrounding white-space.  This is
                    929: generally used as a grammatic device when referring to the verb form of
                    930: a function:
                    931: .Bd -literal -offset indent
                    932: \&.Fn execve Ap d
                    933: .Ed
1.63      kristaps  934: .Ss \&Aq
1.82      kristaps  935: Encloses its arguments in angled brackets.
1.64      kristaps  936: .Pp
                    937: Examples:
1.91      kristaps  938: .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
1.64      kristaps  939: .Pp
                    940: .Em Remarks :
                    941: this macro is often abused for rendering URIs, which should instead use
                    942: .Sx \&Lk
                    943: or
                    944: .Sx \&Mt ,
                    945: or to note pre-processor
                    946: .Dq Li #include
                    947: statements, which should use
                    948: .Sx \&In .
                    949: .Pp
                    950: See also
                    951: .Sx \&Ao .
1.63      kristaps  952: .Ss \&Ar
1.66      kristaps  953: Command arguments.  If an argument is not provided, the string
1.64      kristaps  954: .Dq file ...
1.66      kristaps  955: is used as a default.
1.64      kristaps  956: .Pp
                    957: Examples:
1.91      kristaps  958: .D1 \&.Fl o \&Ns \&Ar file1
                    959: .D1 \&.Ar
                    960: .D1 \&.Ar arg1 , arg2 .
1.63      kristaps  961: .Ss \&At
1.64      kristaps  962: Formats an AT&T version.  Accepts at most one parameter:
                    963: .Bl -tag -width 12n -offset indent
                    964: .It Cm v[1-7] | 32v
                    965: A version of
                    966: .At .
                    967: .It Cm V[.[1-4]]?
                    968: A system version of
                    969: .At .
                    970: .El
                    971: .Pp
                    972: Note that these parameters do not begin with a hyphen.
                    973: .Pp
                    974: Examples:
1.91      kristaps  975: .D1 \&.At
                    976: .D1 \&.At V.1
1.65      kristaps  977: .Pp
                    978: See also
1.66      kristaps  979: .Sx \&Bsx ,
1.65      kristaps  980: .Sx \&Bx ,
1.66      kristaps  981: .Sx \&Dx ,
1.65      kristaps  982: .Sx \&Fx ,
                    983: .Sx \&Nx ,
                    984: .Sx \&Ox ,
                    985: and
                    986: .Sx \&Ux .
1.63      kristaps  987: .Ss \&Bc
1.64      kristaps  988: Closes a
                    989: .Sx \&Bo
                    990: block.  Does not have any tail arguments.
1.63      kristaps  991: .Ss \&Bd
1.64      kristaps  992: Begins a display block.  A display is collection of macros or text which
                    993: may be collectively offset or justified in a manner different from that
                    994: of the enclosing context.  By default, the block is preceded by a
                    995: vertical space.
                    996: .Pp
                    997: Each display is associated with a type, which must be one of the
                    998: following arguments:
                    999: .Bl -tag -width 12n -offset indent
                   1000: .It Fl ragged
                   1001: Only left-justify the block.
                   1002: .It Fl unfilled
                   1003: Do not justify the block at all.
                   1004: .It Fl filled
                   1005: Left- and right-justify the block.
                   1006: .It Fl literal
                   1007: Alias for
                   1008: .Fl unfilled .
                   1009: .It Fl centered
                   1010: Centre-justify each line.
                   1011: .El
                   1012: .Pp
                   1013: The type must be provided first.  Secondary arguments are as follows:
                   1014: .Bl -tag -width 12n -offset indent
                   1015: .It Fl offset Ar width
                   1016: Offset by the value of
                   1017: .Ar width ,
                   1018: which is interpreted as one of the following, specified in order:
                   1019: .Bl -item
                   1020: .It
                   1021: As one of the pre-defined strings
                   1022: .Ar indent ,
                   1023: the width of standard indentation;
                   1024: .Ar indent-two ,
                   1025: twice
                   1026: .Ar indent ;
                   1027: .Ar left ,
                   1028: which has no effect ;
                   1029: .Ar right ,
                   1030: which justifies to the right margin; and
                   1031: .Ar center ,
                   1032: which aligns around an imagined centre axis.
                   1033: .It
                   1034: As a precalculated width for a named macro.  The most popular is the
                   1035: imaginary macro
1.67      kristaps 1036: .Ar \&Ds ,
1.64      kristaps 1037: which resolves to
                   1038: .Ar 6n .
                   1039: .It
                   1040: As a scaling unit following the syntax described in
                   1041: .Sx Scaling Widths .
                   1042: .It
                   1043: As the calculated string length of the opaque string.
                   1044: .El
                   1045: .Pp
                   1046: If unset, it will revert to the value of
                   1047: .Ar 8n
                   1048: as described in
                   1049: .Sx Scaling Widths .
                   1050: .It Fl compact
                   1051: Do not assert a vertical space before the block.
                   1052: .It Fl file Ar file
                   1053: Prepend the file
                   1054: .Ar file
                   1055: before any text or macros within the block.
                   1056: .El
                   1057: .Pp
                   1058: Examples:
                   1059: .Bd -literal -offset indent
                   1060: \&.Bd \-unfilled \-offset two-indent \-compact
1.65      kristaps 1061:    Hello       world.
1.64      kristaps 1062: \&.Ed
                   1063: .Ed
1.66      kristaps 1064: .Pp
                   1065: See also
                   1066: .Sx \&D1
                   1067: and
                   1068: .Sx \&Dl .
1.63      kristaps 1069: .Ss \&Bf
                   1070: .Ss \&Bk
                   1071: .Ss \&Bl
1.80      kristaps 1072: .\" Begins a list composed of one or more list entries.  A list entry is
                   1073: .\" specified by the
                   1074: .\" .Sx \&It
                   1075: .\" macro, which consists of a head and optional body.  By default, a list
                   1076: .\" is preceded by a blank line.  A list must specify one of the following
                   1077: .\" list types:
                   1078: .\" .Bl -tag -width 12n
                   1079: .\" .It Fl bullet
                   1080: .\" A list offset by a bullet.  The head of list entries must be empty.
                   1081: .\" List entry bodies are justified after the bullet.
                   1082: .\" .It Fl column
                   1083: .\" A columnated list.  The number of columns is specified as arguments to
                   1084: .\" the
                   1085: .\" .Sx \&Bl
                   1086: .\" macro (the deprecated form of following the invocation of
                   1087: .\" .Fl column
                   1088: .\" is also accepted).  Arguments dictate the width of columns specified in
                   1089: .\" list entries.  List entry bodies must be left empty.  Columns specified
                   1090: .\" in the list entry head are justified to their position in the sequence
                   1091: .\" of columns.
                   1092: .\" .It Fl dash
                   1093: .\" A list offset by a dash (hyphen).  The head of list entries must be
                   1094: .\" empty.  List entry bodies are justified past the dash.
                   1095: .\" .It Fl diag
                   1096: .\" Like
                   1097: .\" .Fl inset
                   1098: .\" lists, but with additional formatting to the head.
                   1099: .\" .It Fl enum
                   1100: .\" A list offset by a number indicating list entry position.  The head of
                   1101: .\" list entries must be empty.  List entry bodies are justified past the
                   1102: .\" enumeration.
                   1103: .\" .It Fl hang
                   1104: .\" Like
                   1105: .\" .Fl tag ,
                   1106: .\" but instead of list bodies justifying to the head on the first line,
                   1107: .\" they trail the head text.
                   1108: .\" .It Fl hyphen
                   1109: .\" Synonym for
                   1110: .\" .Fl dash .
                   1111: .\" .It Fl inset
                   1112: .\" Like
                   1113: .\" .Fl tag ,
                   1114: .\" but list entry bodies aren't justified.
                   1115: .\" .It Fl item
                   1116: .\" An un-justified list.  This produces blocks of text.
                   1117: .\" .It Fl ohang
                   1118: .\" List bodies are placed on the line following the head.
                   1119: .\" .It Fl tag
                   1120: .\" A list offset by list entry heads.  List entry bodies are justified
                   1121: .\" after the head.
                   1122: .\" .El
                   1123: .\" .Pp
                   1124: .\" More...
                   1125: .\" .
1.63      kristaps 1126: .Ss \&Bo
1.65      kristaps 1127: Begins a block enclosed by square brackets.  Does not have any head
                   1128: arguments.
                   1129: .Pp
                   1130: Examples:
                   1131: .Bd -literal -offset indent
                   1132: \&.Bo 1 ,
1.91      kristaps 1133: \&.Dv BUFSIZ \&Bc
1.65      kristaps 1134: .Ed
                   1135: .Pp
                   1136: See also
                   1137: .Sx \&Bq .
1.63      kristaps 1138: .Ss \&Bq
1.82      kristaps 1139: Encloses its arguments in square brackets.
1.65      kristaps 1140: .Pp
                   1141: Examples:
1.91      kristaps 1142: .D1 \&.Bq 1 , \&Dv BUFSIZ
1.65      kristaps 1143: .Pp
                   1144: .Em Remarks :
                   1145: this macro is sometimes abused to emulate optional arguments for
                   1146: commands; the correct macros to use for this purpose are
                   1147: .Sx \&Op ,
                   1148: .Sx \&Oo ,
                   1149: and
                   1150: .Sx \&Oc .
                   1151: .Pp
                   1152: See also
                   1153: .Sx \&Bo .
1.63      kristaps 1154: .Ss \&Brc
1.65      kristaps 1155: Closes a
                   1156: .Sx \&Bro
                   1157: block.  Does not have any tail arguments.
1.63      kristaps 1158: .Ss \&Bro
1.65      kristaps 1159: Begins a block enclosed by curly braces.  Does not have any head
                   1160: arguments.
                   1161: .Pp
                   1162: Examples:
                   1163: .Bd -literal -offset indent
                   1164: \&.Bro 1 , ... ,
1.91      kristaps 1165: \&.Va n \&Brc
1.65      kristaps 1166: .Ed
                   1167: .Pp
                   1168: See also
                   1169: .Sx \&Brq .
1.63      kristaps 1170: .Ss \&Brq
1.65      kristaps 1171: Encloses its arguments in curly braces.
                   1172: .Pp
                   1173: Examples:
1.91      kristaps 1174: .D1 \&.Brq 1 , ... , \&Va n
1.65      kristaps 1175: .Pp
                   1176: See also
                   1177: .Sx \&Bro .
1.63      kristaps 1178: .Ss \&Bsx
1.65      kristaps 1179: Format the BSD/OS version provided as an argument, or a default value if
                   1180: no argument is provided.
                   1181: .Pp
                   1182: Examples:
1.91      kristaps 1183: .D1 \&.Bsx 1.0
                   1184: .D1 \&.Bsx
1.65      kristaps 1185: .Pp
                   1186: See also
                   1187: .Sx \&At ,
                   1188: .Sx \&Bx ,
1.66      kristaps 1189: .Sx \&Dx ,
1.65      kristaps 1190: .Sx \&Fx ,
                   1191: .Sx \&Nx ,
                   1192: .Sx \&Ox ,
                   1193: and
                   1194: .Sx \&Ux .
1.63      kristaps 1195: .Ss \&Bt
1.66      kristaps 1196: Prints
                   1197: .Dq is currently in beta test.
1.63      kristaps 1198: .Ss \&Bx
1.65      kristaps 1199: Format the BSD version provided as an argument, or a default value if no
                   1200: argument is provided.
                   1201: .Pp
                   1202: Examples:
1.91      kristaps 1203: .D1 \&.Bx 4.4
                   1204: .D1 \&.Bx
1.65      kristaps 1205: .Pp
                   1206: See also
                   1207: .Sx \&At ,
                   1208: .Sx \&Bsx ,
1.66      kristaps 1209: .Sx \&Dx ,
1.65      kristaps 1210: .Sx \&Fx ,
                   1211: .Sx \&Nx ,
                   1212: .Sx \&Ox ,
                   1213: and
                   1214: .Sx \&Ux .
1.63      kristaps 1215: .Ss \&Cd
1.93      kristaps 1216: Configuration declaration.  This denotes strings accepted by
1.66      kristaps 1217: .Xr config 8 .
                   1218: .Pp
                   1219: Examples:
1.91      kristaps 1220: .D1 \&.Cd device le0 at scode?
1.66      kristaps 1221: .Pp
                   1222: .Em Remarks :
                   1223: this macro is commonly abused by using quoted literals to retain
                   1224: white-space and align consecutive
                   1225: .Sx \&Cd
                   1226: declarations.  This practise is discouraged.
1.63      kristaps 1227: .Ss \&Cm
1.66      kristaps 1228: Command modifiers.  Useful when specifying configuration options or
                   1229: keys.
                   1230: .Pp
                   1231: Examples:
1.91      kristaps 1232: .D1 \&.Cm ControlPath
                   1233: .D1 \&.Cm ControlMaster
1.66      kristaps 1234: .Pp
                   1235: See also
                   1236: .Sx \&Fl .
1.63      kristaps 1237: .Ss \&D1
1.66      kristaps 1238: One-line indented display.  This is formatted by the default rules and
                   1239: is useful for simple indented statements.  It is followed by a newline.
                   1240: .Pp
                   1241: Examples:
1.91      kristaps 1242: .D1 \&.D1 \&Fl abcdefgh
1.66      kristaps 1243: .Pp
                   1244: See also
                   1245: .Sx \&Bd
                   1246: and
                   1247: .Sx \&Dl .
1.63      kristaps 1248: .Ss \&Db
                   1249: .Ss \&Dc
1.66      kristaps 1250: Closes a
                   1251: .Sx \&Do
                   1252: block.  Does not have any tail arguments.
1.63      kristaps 1253: .Ss \&Dd
1.66      kristaps 1254: Document date.  This is the mandatory first macro of any
                   1255: .Nm
                   1256: manual.  Its calling syntax is as follows:
                   1257: .Pp
                   1258: .D1 \. Ns Sx \&Dd Cm date
                   1259: .Pp
1.82      kristaps 1260: The
1.66      kristaps 1261: .Cm date
                   1262: field may be either
                   1263: .Ar $\&Mdocdate$ ,
                   1264: which signifies the current manual revision date dictated by
1.72      kristaps 1265: .Xr cvs 1 ,
1.66      kristaps 1266: or instead a valid canonical date as specified by
                   1267: .Sx Dates .
1.72      kristaps 1268: If a date does not conform, the current date is used instead.
1.66      kristaps 1269: .Pp
                   1270: Examples:
1.91      kristaps 1271: .D1 \&.Dd $\&Mdocdate$
                   1272: .D1 \&.Dd $\&Mdocdate: July 21 2007$
                   1273: .D1 \&.Dd July 21, 2007
1.66      kristaps 1274: .Pp
                   1275: See also
                   1276: .Sx \&Dt
                   1277: and
                   1278: .Sx \&Os .
1.63      kristaps 1279: .Ss \&Dl
1.66      kristaps 1280: One-line intended display.  This is formatted as literal text and is
                   1281: useful for commands and invocations.  It is followed by a newline.
                   1282: .Pp
                   1283: Examples:
1.91      kristaps 1284: .D1 \&.Dl % mandoc mdoc.7 | less
1.66      kristaps 1285: .Pp
                   1286: See also
                   1287: .Sx \&Bd
                   1288: and
                   1289: .Sx \&D1 .
1.63      kristaps 1290: .Ss \&Do
1.66      kristaps 1291: Begins a block enclosed by double quotes.  Does not have any head
                   1292: arguments.
                   1293: .Pp
                   1294: Examples:
1.91      kristaps 1295: .D1 \&.D1 \&Do April is the cruellest month \&Dc \e(em T.S. Eliot
1.66      kristaps 1296: .Pp
                   1297: See also
                   1298: .Sx \&Dq .
1.63      kristaps 1299: .Ss \&Dq
1.82      kristaps 1300: Encloses its arguments in double quotes.
1.66      kristaps 1301: .Pp
                   1302: Examples:
1.91      kristaps 1303: .Bd -literal -offset indent -compact
1.66      kristaps 1304: \&.Dq April is the cruellest month
                   1305: \e(em T.S. Eliot
                   1306: .Ed
                   1307: .Pp
                   1308: See also
                   1309: .Sx \&Do .
1.63      kristaps 1310: .Ss \&Dt
1.66      kristaps 1311: Document title.  This is the mandatory second macro of any
                   1312: .Nm
                   1313: file.  Its calling syntax is as follows:
                   1314: .Pp
                   1315: .D1 \. Ns Sx \&Dt Cm title section Op Cm volume | arch
                   1316: .Pp
                   1317: Its arguments are as follows:
                   1318: .Bl -tag -width Ds -offset Ds
                   1319: .It Cm title
                   1320: The document's title (name).  This should be capitalised and is
                   1321: required.
                   1322: .It Cm section
                   1323: The manual section.  This may be one of
                   1324: .Ar 1
                   1325: .Pq utilities ,
                   1326: .Ar 2
                   1327: .Pq system calls ,
                   1328: .Ar 3
                   1329: .Pq libraries ,
                   1330: .Ar 3p
                   1331: .Pq Perl libraries ,
                   1332: .Ar 4
                   1333: .Pq devices ,
                   1334: .Ar 5
                   1335: .Pq file formats ,
                   1336: .Ar 6
                   1337: .Pq games ,
                   1338: .Ar 7
                   1339: .Pq miscellaneous ,
                   1340: .Ar 8
                   1341: .Pq system utilities ,
                   1342: .Ar 9
                   1343: .Pq kernel functions ,
                   1344: .Ar X11
                   1345: .Pq X Window System ,
                   1346: .Ar X11R6
                   1347: .Pq X Window System ,
                   1348: .Ar unass
                   1349: .Pq unassociated ,
                   1350: .Ar local
                   1351: .Pq local system ,
                   1352: .Ar draft
                   1353: .Pq draft manual ,
                   1354: or
                   1355: .Ar paper
                   1356: .Pq paper .
                   1357: It is also required and should correspond to the manual's filename
                   1358: suffix.
                   1359: .It Cm volume
                   1360: This overrides the volume inferred from
                   1361: .Ar section .
                   1362: This field is optional, and if specified, must be one of
                   1363: .Ar USD
                   1364: .Pq users' supplementary documents ,
                   1365: .Ar PS1
                   1366: .Pq programmers' supplementary documents ,
                   1367: .Ar AMD
                   1368: .Pq administrators' supplementary documents ,
                   1369: .Ar SMM
                   1370: .Pq system managers' manuals ,
                   1371: .Ar URM
                   1372: .Pq users' reference manuals ,
                   1373: .Ar PRM
                   1374: .Pq programmers' reference manuals ,
                   1375: .Ar KM
                   1376: .Pq kernel manuals ,
                   1377: .Ar IND
                   1378: .Pq master index ,
                   1379: .Ar MMI
                   1380: .Pq master index ,
                   1381: .Ar LOCAL
                   1382: .Pq local manuals ,
                   1383: .Ar LOC
                   1384: .Pq local manuals ,
                   1385: or
                   1386: .Ar CON
                   1387: .Pq contributed manuals .
                   1388: .It Cm arch
                   1389: This specifies a specific relevant architecture.  If
                   1390: .Cm volume
                   1391: is not provided, it may be used in its place, else it may be used
                   1392: subsequent that.  It, too, is optional.  It must be one of
                   1393: .Ar alpha ,
                   1394: .Ar amd64 ,
                   1395: .Ar amiga ,
                   1396: .Ar arc ,
                   1397: .Ar arm ,
                   1398: .Ar armish ,
                   1399: .Ar aviion ,
                   1400: .Ar hp300 ,
                   1401: .Ar hppa ,
                   1402: .Ar hppa64 ,
                   1403: .Ar i386 ,
                   1404: .Ar landisk ,
1.86      kristaps 1405: .Ar loongson ,
1.66      kristaps 1406: .Ar luna88k ,
                   1407: .Ar mac68k ,
                   1408: .Ar macppc ,
                   1409: .Ar mvme68k ,
                   1410: .Ar mvme88k ,
                   1411: .Ar mvmeppc ,
                   1412: .Ar pmax ,
                   1413: .Ar sgi ,
                   1414: .Ar socppc ,
                   1415: .Ar sparc ,
                   1416: .Ar sparc64 ,
                   1417: .Ar sun3 ,
                   1418: .Ar vax ,
                   1419: or
                   1420: .Ar zaurus .
                   1421: .El
                   1422: .Pp
                   1423: Examples:
1.91      kristaps 1424: .D1 \&.Dt FOO 1
                   1425: .D1 \&.Dt FOO 4 KM
                   1426: .D1 \&.Dt FOO 9 i386
                   1427: .D1 \&.Dt FOO 9 KM i386
1.66      kristaps 1428: .Pp
                   1429: See also
                   1430: .Sx \&Dd
                   1431: and
                   1432: .Sx \&Os .
1.63      kristaps 1433: .Ss \&Dv
1.66      kristaps 1434: Defined variables such as preprocessor constants.
                   1435: .Pp
                   1436: Examples:
1.91      kristaps 1437: .D1 \&.Dv BUFSIZ
                   1438: .D1 \&.Dv STDOUT_FILENO
1.66      kristaps 1439: .Pp
                   1440: See also
                   1441: .Sx \&Er .
1.63      kristaps 1442: .Ss \&Dx
1.71      kristaps 1443: Format the DragonFly BSD version provided as an argument, or a default
1.66      kristaps 1444: value if no argument is provided.
                   1445: .Pp
                   1446: Examples:
1.91      kristaps 1447: .D1 \&.Dx 2.4.1
                   1448: .D1 \&.Dx
1.66      kristaps 1449: .Pp
                   1450: See also
                   1451: .Sx \&At ,
                   1452: .Sx \&Bsx ,
                   1453: .Sx \&Bx ,
                   1454: .Sx \&Fx ,
                   1455: .Sx \&Nx ,
                   1456: .Sx \&Ox ,
                   1457: and
                   1458: .Sx \&Ux .
1.63      kristaps 1459: .Ss \&Ec
                   1460: .Ss \&Ed
                   1461: .Ss \&Ef
                   1462: .Ss \&Ek
                   1463: .Ss \&El
                   1464: .Ss \&Em
1.66      kristaps 1465: Denotes text that should be emphasised.  Note that this is a
                   1466: presentation term and should not be used for stylistically decorating
                   1467: technical terms.
                   1468: .Pp
                   1469: Examples:
1.91      kristaps 1470: .D1 \&.Em Warnings!
                   1471: .D1 \&.Em Remarks :
1.63      kristaps 1472: .Ss \&En
                   1473: .Ss \&Eo
                   1474: .Ss \&Er
1.90      kristaps 1475: Display error constants.
1.66      kristaps 1476: .Pp
                   1477: Examples:
1.91      kristaps 1478: .D1 \&.Er EPERM
                   1479: .D1 \&.Er ENOENT
1.66      kristaps 1480: .Pp
                   1481: See also
                   1482: .Sx \&Dv .
1.63      kristaps 1483: .Ss \&Es
                   1484: .Ss \&Ev
1.66      kristaps 1485: Environmental variables such as those specified in
                   1486: .Xr environ 7 .
                   1487: .Pp
                   1488: Examples:
1.91      kristaps 1489: .D1 \&.Ev DISPLAY
                   1490: .D1 \&.Ev PATH
1.63      kristaps 1491: .Ss \&Ex
1.66      kristaps 1492: Inserts text regarding a utility's exit values.  This macro must have
                   1493: first the
                   1494: .Fl std
                   1495: argument specified, then an optional
                   1496: .Ar utility .
                   1497: If
                   1498: .Ar utility
                   1499: is not provided, the document's name as stipulated in
                   1500: .Sx \&Nm
                   1501: is provided.
1.63      kristaps 1502: .Ss \&Fa
                   1503: .Ss \&Fc
                   1504: .Ss \&Fd
                   1505: .Ss \&Fl
1.79      kristaps 1506: Command-line flag.  Used when listing arguments to command-line
                   1507: utilities.  Prints a fixed-width hyphen
                   1508: .Sq \-
1.89      kristaps 1509: directly followed by each argument.  If no arguments are provided, a hyphen is
                   1510: printed followed by a space.  If the argument is a macro, a hyphen is
                   1511: prefixed to the subsequent macro output.
1.79      kristaps 1512: .Pp
                   1513: Examples:
1.91      kristaps 1514: .D1 \&.Fl a b c
                   1515: .D1 \&.Fl \&Pf a b
                   1516: .D1 \&.Fl
                   1517: .D1 \&.Op \&Fl o \&Ns \&Ar file
1.79      kristaps 1518: .Pp
                   1519: See also
                   1520: .Sx \&Cm .
1.63      kristaps 1521: .Ss \&Fn
                   1522: .Ss \&Fo
                   1523: .Ss \&Fr
                   1524: .Ss \&Ft
                   1525: .Ss \&Fx
1.65      kristaps 1526: Format the FreeBSD version provided as an argument, or a default value
                   1527: if no argument is provided.
                   1528: .Pp
                   1529: Examples:
1.91      kristaps 1530: .D1 \&.Fx 7.1
                   1531: .D1 \&.Fx
1.65      kristaps 1532: .Pp
                   1533: See also
                   1534: .Sx \&At ,
1.66      kristaps 1535: .Sx \&Bsx ,
1.65      kristaps 1536: .Sx \&Bx ,
1.66      kristaps 1537: .Sx \&Dx ,
1.65      kristaps 1538: .Sx \&Nx ,
                   1539: .Sx \&Ox ,
                   1540: and
                   1541: .Sx \&Ux .
1.63      kristaps 1542: .Ss \&Hf
                   1543: .Ss \&Ic
                   1544: .Ss \&In
                   1545: .Ss \&It
                   1546: .Ss \&Lb
                   1547: .Ss \&Li
                   1548: .Ss \&Lk
1.70      kristaps 1549: Format a hyperlink.  The calling syntax is as follows:
                   1550: .Pp
                   1551: .D1 \. Ns Sx \&Lk Cm uri Op Cm name
                   1552: .Pp
                   1553: Examples:
1.91      kristaps 1554: .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
                   1555: .D1 \&.Lk http://bsd.lv
1.70      kristaps 1556: .Pp
                   1557: See also
                   1558: .Sx \&Mt .
1.63      kristaps 1559: .Ss \&Lp
                   1560: .Ss \&Ms
                   1561: .Ss \&Mt
                   1562: .Ss \&Nd
                   1563: .Ss \&Nm
                   1564: .Ss \&No
                   1565: .Ss \&Ns
                   1566: .Ss \&Nx
1.65      kristaps 1567: Format the NetBSD version provided as an argument, or a default value if
                   1568: no argument is provided.
                   1569: .Pp
                   1570: Examples:
1.91      kristaps 1571: .D1 \&.Nx 5.01
                   1572: .D1 \&.Nx
1.65      kristaps 1573: .Pp
                   1574: See also
                   1575: .Sx \&At ,
1.66      kristaps 1576: .Sx \&Bsx ,
1.65      kristaps 1577: .Sx \&Bx ,
1.66      kristaps 1578: .Sx \&Dx ,
1.65      kristaps 1579: .Sx \&Fx ,
                   1580: .Sx \&Ox ,
                   1581: and
                   1582: .Sx \&Ux .
1.63      kristaps 1583: .Ss \&Oc
                   1584: .Ss \&Oo
                   1585: .Ss \&Op
                   1586: .Ss \&Os
1.66      kristaps 1587: Document operating system version.  This is the mandatory third macro of
                   1588: any
                   1589: .Nm
                   1590: file.  Its calling syntax is as follows:
                   1591: .Pp
                   1592: .D1 \. Ns Sx \&Os Op Cm system
                   1593: .Pp
                   1594: The optional
                   1595: .Cm system
                   1596: parameter specifies the relevant operating system or environment.  Left
                   1597: unspecified, it defaults to the local operating system version.  This is
                   1598: the suggested form.
                   1599: .Pp
                   1600: Examples:
1.91      kristaps 1601: .D1 \&.Os
                   1602: .D1 \&.Os KTH/CSC/TCS
                   1603: .D1 \&.Os BSD 4.3
1.66      kristaps 1604: .Pp
                   1605: See also
                   1606: .Sx \&Dd
                   1607: and
                   1608: .Sx \&Dt .
1.63      kristaps 1609: .Ss \&Ot
1.66      kristaps 1610: Unknown usage.
                   1611: .Pp
                   1612: .Em Remarks :
                   1613: this macro has been deprecated.
1.63      kristaps 1614: .Ss \&Ox
1.65      kristaps 1615: Format the OpenBSD version provided as an argument, or a default value
                   1616: if no argument is provided.
                   1617: .Pp
                   1618: Examples:
1.91      kristaps 1619: .D1 \&.Ox 4.5
                   1620: .D1 \&.Ox
1.65      kristaps 1621: .Pp
                   1622: See also
                   1623: .Sx \&At ,
                   1624: .Sx \&Bsx ,
                   1625: .Sx \&Bx ,
1.66      kristaps 1626: .Sx \&Dx ,
1.65      kristaps 1627: .Sx \&Fx ,
                   1628: .Sx \&Nx ,
                   1629: and
                   1630: .Sx \&Ux .
1.63      kristaps 1631: .Ss \&Pa
                   1632: .Ss \&Pc
                   1633: .Ss \&Pf
                   1634: .Ss \&Po
                   1635: .Ss \&Pp
                   1636: .Ss \&Pq
                   1637: .Ss \&Qc
                   1638: .Ss \&Ql
                   1639: .Ss \&Qo
                   1640: .Ss \&Qq
                   1641: .Ss \&Re
                   1642: Closes a
                   1643: .Sx \&Rs
                   1644: block.  Does not have any tail arguments.
                   1645: .Ss \&Rs
                   1646: Begins a bibliographic
                   1647: .Pq Dq reference
1.68      kristaps 1648: block.  Does not have any head arguments.  The block macro may only
1.63      kristaps 1649: contain
                   1650: .Sx \&%A ,
                   1651: .Sx \&%B ,
                   1652: .Sx \&%C ,
                   1653: .Sx \&%D ,
                   1654: .Sx \&%I ,
                   1655: .Sx \&%J ,
                   1656: .Sx \&%N ,
                   1657: .Sx \&%O ,
                   1658: .Sx \&%P ,
                   1659: .Sx \&%Q ,
                   1660: .Sx \&%R ,
                   1661: .Sx \&%T ,
                   1662: and
                   1663: .Sx \&%V
                   1664: child macros (at least one must be specified).
                   1665: .Pp
1.64      kristaps 1666: Examples:
1.91      kristaps 1667: .Bd -literal -offset indent -compact
1.63      kristaps 1668: \&.Rs
                   1669: \&.%A J. E. Hopcroft
                   1670: \&.%A J. D. Ullman
                   1671: \&.%B Introduction to Automata Theory, Languages, and Computation
                   1672: \&.%I Addison-Wesley
                   1673: \&.%C Reading, Massachusettes
                   1674: \&.%D 1979
                   1675: \&.Re
                   1676: .Ed
                   1677: .Pp
                   1678: If an
                   1679: .Sx \&Rs
                   1680: block is used within a SEE ALSO section, a vertical space is asserted
                   1681: before the rendered output, else the block continues on the current
                   1682: line.
                   1683: .Ss \&Rv
                   1684: .Ss \&Sc
                   1685: .Ss \&Sh
                   1686: .Ss \&Sm
                   1687: .Ss \&So
                   1688: .Ss \&Sq
                   1689: .Ss \&Ss
                   1690: .Ss \&St
                   1691: .Ss \&Sx
                   1692: .Ss \&Sy
                   1693: .Ss \&Tn
                   1694: .Ss \&Ud
                   1695: .Ss \&Ux
1.65      kristaps 1696: Format the UNIX name.  Accepts no argument.
                   1697: .Pp
                   1698: Examples:
1.91      kristaps 1699: .D1 \&.Ux
1.65      kristaps 1700: .Pp
                   1701: See also
                   1702: .Sx \&At ,
1.66      kristaps 1703: .Sx \&Bsx ,
1.65      kristaps 1704: .Sx \&Bx ,
1.66      kristaps 1705: .Sx \&Dx ,
1.65      kristaps 1706: .Sx \&Fx ,
                   1707: .Sx \&Nx ,
                   1708: and
                   1709: .Sx \&Ox .
1.63      kristaps 1710: .Ss \&Va
                   1711: .Ss \&Vt
1.83      kristaps 1712: A variable type.  This is also used for indicating global variables in the
                   1713: SYNOPSIS section, in which case a variable name is also specified.  Note that
                   1714: it accepts
                   1715: .Sx Block partial-implicit
                   1716: syntax when invoked as the first macro in the SYNOPSIS section, else it
                   1717: accepts ordinary
                   1718: .Sx In-line
                   1719: syntax.
                   1720: .Pp
                   1721: Note that this should not be confused with
                   1722: .Sx \&Ft ,
                   1723: which is used for function return types.
                   1724: .Pp
                   1725: Examples:
1.91      kristaps 1726: .D1 \&.Vt unsigned char
                   1727: .D1 \&.Vt extern const char * const sys_signame[] ;
1.83      kristaps 1728: .Pp
                   1729: See also
                   1730: .Sx \&Ft
                   1731: and
                   1732: .Sx \&Va .
1.84      kristaps 1733: .Ss \&Xc
1.87      kristaps 1734: Close a scope opened by
                   1735: .Sx \&Xo .
1.84      kristaps 1736: .Ss \&Xo
1.87      kristaps 1737: Open an extension scope.  This macro originally existed to extend the
                   1738: 9-argument limit of troff; since this limit has been lifted, the macro
                   1739: has been deprecated.
1.84      kristaps 1740: .Ss \&Xr
                   1741: Link to another manual
                   1742: .Pq Qq cross-reference .
                   1743: Its calling syntax is
                   1744: .Pp
                   1745: .D1 \. Ns Sx \&Xr Cm name section
                   1746: .Pp
                   1747: The
                   1748: .Cm name
                   1749: and
                   1750: .Cm section
                   1751: are the name and section of the linked manual.  If
                   1752: .Cm section
                   1753: is followed by non-punctuation, an
                   1754: .Sx \&Ns
                   1755: is inserted into the token stream.  This behaviour is for compatibility
                   1756: with
                   1757: .Xr groff 1 .
                   1758: .Pp
                   1759: Examples:
1.91      kristaps 1760: .D1 \&.Xr mandoc 1
                   1761: .D1 \&.Xr mandoc 1 ;
                   1762: .D1 \&.Xr mandoc 1 \&Ns s behaviour
1.84      kristaps 1763: .Ss \&br
                   1764: .Ss \&sp
1.4       kristaps 1765: .Sh COMPATIBILITY
1.93      kristaps 1766: This section documents compatibility between mandoc and other other
                   1767: troff implementations, at this time limited to GNU troff
                   1768: .Pq Qq groff .
1.50      kristaps 1769: The term
1.57      kristaps 1770: .Qq historic groff
1.93      kristaps 1771: refers to groff versions before the
1.57      kristaps 1772: .Pa doc.tmac
1.50      kristaps 1773: file re-write
1.57      kristaps 1774: .Pq somewhere between 1.15 and 1.19 .
                   1775: .Pp
1.93      kristaps 1776: Heirloom troff, the other significant troff implementation accepting
                   1777: \-mdoc, is similar to historic groff.
                   1778: .Pp
1.57      kristaps 1779: .Bl -dash -compact
                   1780: .It
1.81      kristaps 1781: The comment syntax
                   1782: .Sq \e."
                   1783: is no longer accepted.
                   1784: .It
1.93      kristaps 1785: In groff, the
1.80      kristaps 1786: .Sx \&Pa
                   1787: macro does not format its arguments when used in the FILES section under
1.93      kristaps 1788: certain list types.  mandoc does.
1.80      kristaps 1789: .It
1.93      kristaps 1790: Historic groff does not print a dash for empty
1.79      kristaps 1791: .Sx \&Fl
1.93      kristaps 1792: arguments.  mandoc and newer groff implementations do.
1.79      kristaps 1793: .It
1.93      kristaps 1794: groff behaves irregularly when specifying
1.77      kristaps 1795: .Sq \ef
1.93      kristaps 1796: .Sx Text Decoration
                   1797: within line-macro scopes.  mandoc follows a consistent system.
1.77      kristaps 1798: .It
1.93      kristaps 1799: In mandoc, negative scaling units are truncated to zero; groff would
                   1800: move to prior lines.  Furthermore, the
1.61      kristaps 1801: .Sq f
                   1802: scaling unit, while accepted, is rendered as the default unit.
                   1803: .It
1.48      kristaps 1804: In quoted literals, groff allowed pair-wise double-quotes to produce a
                   1805: standalone double-quote in formatted output.  This idiosyncratic
1.93      kristaps 1806: behaviour is not applicable in mandoc.
1.57      kristaps 1807: .It
1.64      kristaps 1808: Display types
1.78      kristaps 1809: .Sx \&Bd
1.77      kristaps 1810: .Fl center
1.64      kristaps 1811: and
                   1812: .Fl right
                   1813: are aliases for
1.93      kristaps 1814: .Fl left
                   1815: in manodc.  Furthermore, the
1.64      kristaps 1816: .Fl file Ar file
1.93      kristaps 1817: argument is ignored.  Lastly, since text is not right-justified in
                   1818: mandoc (or even groff),
1.64      kristaps 1819: .Fl ragged
                   1820: and
                   1821: .Fl filled
                   1822: are aliases, as are
                   1823: .Fl literal
                   1824: and
                   1825: .Fl unfilled .
1.57      kristaps 1826: .It
1.28      kristaps 1827: Historic groff has many un-callable macros.  Most of these (excluding
1.93      kristaps 1828: some block-level macros) are now callable.
1.57      kristaps 1829: .It
1.50      kristaps 1830: The vertical bar
1.57      kristaps 1831: .Sq \(ba
1.28      kristaps 1832: made historic groff
1.57      kristaps 1833: .Qq go orbital
1.93      kristaps 1834: but has been a proper delimiter since then.
1.57      kristaps 1835: .It
1.93      kristaps 1836: .Sx \&It Fl nested
1.28      kristaps 1837: is assumed for all lists (it wasn't in historic groff): any list may be
                   1838: nested and
1.64      kristaps 1839: .Fl enum
1.4       kristaps 1840: lists will restart the sequence only for the sub-list.
1.57      kristaps 1841: .It
1.4       kristaps 1842: Some manuals use
1.64      kristaps 1843: .Sx \&Li
1.4       kristaps 1844: incorrectly by following it with a reserved character and expecting the
1.93      kristaps 1845: delimiter to render.  This is not supported in mandoc.
1.57      kristaps 1846: .It
1.50      kristaps 1847: In groff, the
1.64      kristaps 1848: .Sx \&Fo
1.93      kristaps 1849: macro only produces the first parameter.  This is not the case in
                   1850: mandoc.
                   1851: .It
                   1852: In groff, the
                   1853: .Sx \&Cd ,
                   1854: .Sx \&Er ,
                   1855: and
                   1856: .Sx \&Ex
                   1857: macros were stipulated only to occur in certain manual sections.  mandoc
                   1858: does not have these restrictions.
1.57      kristaps 1859: .El
1.2       kristaps 1860: .Sh SEE ALSO
1.57      kristaps 1861: .Xr mandoc 1 ,
                   1862: .Xr mandoc_char 7
1.2       kristaps 1863: .Sh AUTHORS
                   1864: The
1.57      kristaps 1865: .Nm
1.50      kristaps 1866: reference was written by
1.94      kristaps 1867: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1.64      kristaps 1868: .\"
                   1869: .\" XXX: this really isn't the place for these caveats.
                   1870: .\" .
                   1871: .\" .
                   1872: .\" .Sh CAVEATS
                   1873: .\" There are many ambiguous parts of mdoc.
                   1874: .\" .
                   1875: .\" .Pp
                   1876: .\" .Bl -dash -compact
                   1877: .\" .It
                   1878: .\" .Sq \&Fa
                   1879: .\" should be
                   1880: .\" .Sq \&Va
                   1881: .\" as function arguments are variables.
                   1882: .\" .It
                   1883: .\" .Sq \&Ft
                   1884: .\" should be
                   1885: .\" .Sq \&Vt
                   1886: .\" as function return types are still types.  Furthermore, the
                   1887: .\" .Sq \&Ft
                   1888: .\" should be removed and
                   1889: .\" .Sq \&Fo ,
                   1890: .\" which ostensibly follows it, should follow the same convention as
                   1891: .\" .Sq \&Va .
                   1892: .\" .It
                   1893: .\" .Sq \&Va
                   1894: .\" should formalise that only one or two arguments are acceptable: a
                   1895: .\" variable name and optional, preceding type.
                   1896: .\" .It
                   1897: .\" .Sq \&Fd
                   1898: .\" is ambiguous.  It's commonly used to indicate an include file in the
                   1899: .\" synopsis section.
                   1900: .\" .Sq \&In
                   1901: .\" should be used, instead.
                   1902: .\" .It
                   1903: .\" Only the
                   1904: .\" .Sq \-literal
                   1905: .\" argument to
                   1906: .\" .Sq \&Bd
                   1907: .\" makes sense.  The remaining ones should be removed.
                   1908: .\" .It
                   1909: .\" The
                   1910: .\" .Sq \&Xo
                   1911: .\" and
                   1912: .\" .Sq \&Xc
                   1913: .\" macros should be deprecated.
                   1914: .\" .It
                   1915: .\" The
                   1916: .\" .Sq \&Dt
                   1917: .\" macro lacks clarity.  It should be absolutely clear which title will
                   1918: .\" render when formatting the manual page.
                   1919: .\" .It
                   1920: .\" A
                   1921: .\" .Sq \&Lx
                   1922: .\" should be provided for Linux (\(`a la
                   1923: .\" .Sq \&Ox ,
                   1924: .\" .Sq \&Nx
                   1925: .\" etc.).
                   1926: .\" .It
                   1927: .\" There's no way to refer to references in
                   1928: .\" .Sq \&Rs/Re
                   1929: .\" blocks.
                   1930: .\" .It
                   1931: .\" The \-split and \-nosplit dictates via
                   1932: .\" .Sq \&An
                   1933: .\" are re-set when entering and leaving the AUTHORS section.
                   1934: .\" .El
                   1935: .\" .

CVSweb