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

Annotation of mandoc/mdoc.7, Revision 1.100

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

CVSweb