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

Annotation of mandoc/mdoc.7, Revision 1.101

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

CVSweb