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

Annotation of mandoc/mdoc.7, Revision 1.62

1.62    ! kristaps    1: .\"    $Id: mdoc.7,v 1.61 2009/10/18 13:58:48 kristaps Exp $
1.1       kristaps    2: .\"
1.23      kristaps    3: .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
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.1       kristaps   17: .Dd $Mdocdate$
1.20      kristaps   18: .Dt MDOC 7
1.1       kristaps   19: .Os
1.56      kristaps   20: .
                     21: .
1.1       kristaps   22: .Sh NAME
1.57      kristaps   23: .Nm mdoc
                     24: .Nd mdoc language reference
1.56      kristaps   25: .
                     26: .
1.1       kristaps   27: .Sh DESCRIPTION
                     28: The
1.57      kristaps   29: .Nm mdoc
1.50      kristaps   30: language is used to format
1.57      kristaps   31: .Bx
                     32: .Ux
1.43      kristaps   33: manuals.  In this reference document, we describe its syntax, structure,
                     34: and usage.  Our reference implementation is
1.57      kristaps   35: .Xr mandoc 1 .
1.28      kristaps   36: The
1.57      kristaps   37: .Sx COMPATIBILITY
1.50      kristaps   38: section describes compatibility with
1.57      kristaps   39: .Xr groff 1 .
                     40: .
                     41: .Pp
1.13      kristaps   42: An
1.57      kristaps   43: .Nm
1.1       kristaps   44: document follows simple rules:  lines beginning with the control
1.50      kristaps   45: character
1.57      kristaps   46: .Sq \.
1.1       kristaps   47: are parsed for macros.  Other lines are interpreted within the scope of
1.13      kristaps   48: prior macros:
1.57      kristaps   49: .Bd -literal -offset indent
1.13      kristaps   50: \&.Sh Macro lines change control state.
                     51: Other lines are interpreted within the current state.
1.57      kristaps   52: .Ed
1.56      kristaps   53: .
                     54: .
1.46      kristaps   55: .Sh LANGUAGE SYNTAX
1.57      kristaps   56: .Nm
1.13      kristaps   57: documents may contain only graphable 7-bit ASCII characters, the space
1.43      kristaps   58: character, and, in certain circumstances, the tab character.  All
                     59: manuals must have
1.57      kristaps   60: .Ux
1.50      kristaps   61: line terminators.
1.56      kristaps   62: .
                     63: .
1.57      kristaps   64: .Ss Comments
1.43      kristaps   65: Text following a
1.57      kristaps   66: .Sq \e" ,
1.43      kristaps   67: whether in a macro or free-form text line, is ignored to the end of
                     68: line.  A macro line with only a control character and comment escape,
1.57      kristaps   69: .Sq \&.\e" ,
1.58      kristaps   70: is also ignored.  Macro lines with only a control charater and optionally
                     71: whitespace are stripped from input.
1.56      kristaps   72: .
                     73: .
1.57      kristaps   74: .Ss Reserved Characters
1.2       kristaps   75: Within a macro line, the following characters are reserved:
1.61      kristaps   76: .Pp
1.57      kristaps   77: .Bl -tag -width Ds -offset indent -compact
                     78: .It \&.
                     79: .Pq period
                     80: .It \&,
                     81: .Pq comma
                     82: .It \&:
                     83: .Pq colon
                     84: .It \&;
                     85: .Pq semicolon
                     86: .It \&(
                     87: .Pq left-parenthesis
                     88: .It \&)
                     89: .Pq right-parenthesis
                     90: .It \&[
                     91: .Pq left-bracket
                     92: .It \&]
                     93: .Pq right-bracket
                     94: .It \&?
                     95: .Pq question
                     96: .It \&!
                     97: .Pq exclamation
                     98: .It \&|
                     99: .Pq vertical bar
                    100: .El
                    101: .
                    102: .Pp
1.5       kristaps  103: Use of reserved characters is described in
1.57      kristaps  104: .Sx MACRO SYNTAX .
1.43      kristaps  105: For general use in macro lines, these characters must either be escaped
                    106: with a non-breaking space
1.57      kristaps  107: .Pq Sq \e&
1.50      kristaps  108: or, if applicable, an appropriate escape sequence used.
1.56      kristaps  109: .
                    110: .
1.57      kristaps  111: .Ss Special Characters
1.43      kristaps  112: Special characters may occur in both macro and free-form lines.
                    113: Sequences begin with the escape character
1.57      kristaps  114: .Sq \e
1.50      kristaps  115: followed by either an open-parenthesis
1.57      kristaps  116: .Sq \&(
1.1       kristaps  117: for two-character sequences; an open-bracket
1.57      kristaps  118: .Sq \&[
1.1       kristaps  119: for n-character sequences (terminated at a close-bracket
1.57      kristaps  120: .Sq \&] ) ;
1.43      kristaps  121: or a single one-character sequence.  See
1.57      kristaps  122: .Xr mandoc_char 7
1.50      kristaps  123: for a complete list.  Examples include
1.57      kristaps  124: .Sq \e(em
                    125: .Pq em-dash
1.50      kristaps  126: and
1.57      kristaps  127: .Sq \ee
                    128: .Pq back-slash .
1.56      kristaps  129: .
                    130: .
1.57      kristaps  131: .Ss Text Decoration
1.54      kristaps  132: Terms may be text-decorated using the
1.57      kristaps  133: .Sq \ef
1.43      kristaps  134: escape followed by an indicator: B (bold), I, (italic), or P and R
1.54      kristaps  135: (Roman, or reset).  This form is not recommended for
1.57      kristaps  136: .Nm ,
1.54      kristaps  137: which encourages semantic, not presentation, annotation.
1.56      kristaps  138: .
                    139: .
1.57      kristaps  140: .Ss Predefined Strings
1.54      kristaps  141: Historically,
1.57      kristaps  142: .Xr groff 1
1.54      kristaps  143: also defined a set of package-specific
1.57      kristaps  144: .Dq predefined strings ,
1.54      kristaps  145: which, like
1.57      kristaps  146: .Sx Special Characters ,
1.54      kristaps  147: demark special output characters and strings by way of input codes.
                    148: Predefined strings are escaped with the slash-asterisk,
1.57      kristaps  149: .Sq \e* :
1.54      kristaps  150: single-character
1.57      kristaps  151: .Sq \e*X ,
1.54      kristaps  152: two-character
1.57      kristaps  153: .Sq \e*(XX ,
1.54      kristaps  154: and N-character
1.57      kristaps  155: .Sq \e*[N] .
1.54      kristaps  156: See
1.57      kristaps  157: .Xr mandoc_char 7
1.54      kristaps  158: for a complete list.  Examples include
1.57      kristaps  159: .Sq \e*(Am
                    160: .Pq ampersand
1.54      kristaps  161: and
1.57      kristaps  162: .Sq \e*(Ba
                    163: .Pq vertical bar .
1.56      kristaps  164: .
                    165: .
1.57      kristaps  166: .Ss Whitespace
1.46      kristaps  167: In non-literal free-form lines, consecutive blocks of whitespace are
                    168: pruned from input and added later in the output filter, if applicable:
1.57      kristaps  169: .Bd -literal -offset indent
1.46      kristaps  170: These     spaces   are    pruned       from    input.
1.50      kristaps  171: \&.Bd \-literal
1.46      kristaps  172: These         are              not.
                    173: \&.Ed
1.57      kristaps  174: .Ed
                    175: .
                    176: .Pp
1.46      kristaps  177: In macro lines, whitespace delimits arguments and is discarded.  If
1.47      kristaps  178: arguments are quoted, whitespace within the quotes is retained.
1.57      kristaps  179: .
                    180: .Pp
1.46      kristaps  181: Blank lines are only permitted within literal contexts, as are lines
                    182: containing only whitespace.  Tab characters are only acceptable when
1.50      kristaps  183: delimiting
1.57      kristaps  184: .Sq \&Bl \-column
1.46      kristaps  185: or when in a literal context.
1.56      kristaps  186: .
                    187: .
1.57      kristaps  188: .Ss Quotation
1.46      kristaps  189: Macro arguments may be quoted with a double-quote to group
                    190: space-delimited terms or to retain blocks of whitespace.  A quoted
                    191: argument begins with a double-quote preceded by whitespace.  The next
1.48      kristaps  192: double-quote not pair-wise adjacent to another double-quote terminates
1.50      kristaps  193: the literal, regardless of surrounding whitespace.
1.57      kristaps  194: .
                    195: .Pp
1.50      kristaps  196: This produces tokens
1.57      kristaps  197: .Sq a" ,
                    198: .Sq b c ,
                    199: .Sq de ,
1.47      kristaps  200: and
1.57      kristaps  201: .Sq fg" .
1.47      kristaps  202: Note that any quoted term, be it argument or macro, is indiscriminately
1.50      kristaps  203: considered literal text.  Thus, the following produces
1.57      kristaps  204: .Sq \&Em a :
                    205: .Bd -literal -offset indent
1.47      kristaps  206: \&.Em "Em a"
1.57      kristaps  207: .Ed
                    208: .
                    209: .Pp
1.46      kristaps  210: In free-form mode, quotes are regarded as opaque text.
1.56      kristaps  211: .
1.61      kristaps  212: .Ss Scaling Widths
                    213: Many macros support scaled widths for their arguments, such as
                    214: stipulating a two-inch list indentation with the following:
                    215: .Bd -literal -offset indent
                    216: \&.Bl -tag -width 2i
                    217: .Ed
                    218: .
                    219: .Pp
                    220: The syntax for scaled widths is
1.62    ! kristaps  221: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
1.61      kristaps  222: where a decimal must be preceded or proceeded by at least one digit.
                    223: Negative numbers, while accepted, are truncated to zero.  The following
                    224: scaling units are accepted:
                    225: .Pp
                    226: .Bl -tag -width Ds -offset indent -compact
                    227: .It c
                    228: centimetre
                    229: .It i
                    230: inch
                    231: .It P
                    232: pica (~1/6 inch)
                    233: .It p
                    234: point (~1/72 inch)
                    235: .It f
                    236: synonym for
                    237: .Sq u
                    238: .It v
                    239: default vertical span
                    240: .It m
                    241: width of rendered
                    242: .Sq m
                    243: .Pq em
                    244: character
                    245: .It n
                    246: width of rendered
                    247: .Sq n
                    248: .Pq en
                    249: character
                    250: .It u
                    251: default horizontal span
                    252: .It M
                    253: mini-em (~1/100 em)
                    254: .El
                    255: .Pp
                    256: Using anything other than
                    257: .Sq m ,
                    258: .Sq n ,
                    259: .Sq u ,
                    260: or
                    261: .Sq v
                    262: is necessarily non-portable across output media.  See
                    263: .Sx COMPATIBILITY .
                    264: .
1.56      kristaps  265: .
1.43      kristaps  266: .Sh MANUAL STRUCTURE
1.33      kristaps  267: Each
1.57      kristaps  268: .Nm
1.50      kristaps  269: document must begin with a document prologue, containing, in order,
1.57      kristaps  270: .Sq \&Dd ,
                    271: .Sq \&Dt ,
1.33      kristaps  272: and
1.57      kristaps  273: .Sq \&Os ,
1.46      kristaps  274: then the NAME section containing at least one
1.57      kristaps  275: .Sq \&Nm
1.50      kristaps  276: followed by
1.57      kristaps  277: .Sq \&Nd :
                    278: .Bd -literal -offset indent
1.43      kristaps  279: \&.Dd $\&Mdocdate$
                    280: \&.Dt mdoc 7
                    281: \&.Os
1.58      kristaps  282: \&.
1.43      kristaps  283: \&.Sh NAME
1.58      kristaps  284: \&.Nm foo
                    285: \&.Nd a description goes here
                    286: \&.\e\*q The next is for sections 2 & 3 only.
                    287: \&.\e\*q .Sh LIBRARY
                    288: \&.
                    289: \&.Sh SYNOPSIS
                    290: \&.Nm foo
                    291: \&.Op Fl options
                    292: \&.Ar
                    293: \&.
                    294: \&.Sh DESCRIPTION
                    295: The
                    296: \&.Nm
                    297: utility processes files ...
1.59      kristaps  298: \&.\e\*q .Sh IMPLEMENTATION NOTES
1.58      kristaps  299: \&.\e\*q The next is for sections 1 & 8 only.
                    300: \&.\e\*q .Sh EXIT STATUS
                    301: \&.\e\*q The next is for sections 2, 3, & 9 only.
                    302: \&.\e\*q .Sh RETURN VALUES
                    303: \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
                    304: \&.\e\*q .Sh ENVIRONMENT
                    305: \&.\e\*q .Sh FILES
                    306: \&.\e\*q .Sh EXAMPLES
                    307: \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
                    308: \&.\e\*q .Sh DIAGNOSTICS
                    309: \&.\e\*q The next is for sections 2, 3, & 9 only.
                    310: \&.\e\*q .Sh ERRORS
                    311: \&.\e\*q .Sh SEE ALSO
                    312: \&.\e\*q .Xr foobar 1
                    313: \&.\e\*q .Sh STANDARDS
                    314: \&.\e\*q .Sh HISTORY
                    315: \&.\e\*q .Sh AUTHORS
                    316: \&.\e\*q .Sh CAVEATS
                    317: \&.\e\*q .Sh BUGS
                    318: \&.\e\*q .Sh SECURITY CONSIDERATIONS
1.57      kristaps  319: .Ed
                    320: .
                    321: .Pp
1.43      kristaps  322: Subsequent SYNOPSIS and DESCRIPTION sections are strongly encouraged,
1.50      kristaps  323: but non-compulsory.
1.56      kristaps  324: .
                    325: .
1.43      kristaps  326: .Sh MACRO SYNTAX
1.56      kristaps  327: Macros are one to three three characters in length and begin with a
                    328: control character ,
1.57      kristaps  329: .Sq \&. ,
1.56      kristaps  330: at the beginning of the line.  An arbitrary amount of whitespace may
                    331: sit between the control character and the macro name.  Thus,
1.57      kristaps  332: .Sq \&.Pp
1.56      kristaps  333: and
1.57      kristaps  334: .Sq \&.\ \ \ \&Pp
1.56      kristaps  335: are equivalent.  Macro names are two or three characters in length.
1.57      kristaps  336: .
                    337: .Pp
1.46      kristaps  338: The syntax of a macro depends on its classification.  In this section,
1.57      kristaps  339: .Sq \-arg
1.43      kristaps  340: refers to macro arguments, which may be followed by zero or more
1.57      kristaps  341: .Sq parm
1.43      kristaps  342: parameters;
1.57      kristaps  343: .Sq \&Yo
1.43      kristaps  344: opens the scope of a macro; and if specified,
1.57      kristaps  345: .Sq \&Yc
1.43      kristaps  346: closes it out.
1.57      kristaps  347: .
                    348: .Pp
1.43      kristaps  349: The
1.57      kristaps  350: .Em Callable
1.43      kristaps  351: column indicates that the macro may be called subsequent to the initial
1.55      kristaps  352: line-macro.  If a macro is not callable, then its invocation after the
                    353: initial line macro is interpreted as opaque text, such that
1.60      kristaps  354: .Sq \&.Fl \&Sh
1.55      kristaps  355: produces
1.60      kristaps  356: .Sq Fl \&Sh .
1.57      kristaps  357: .
                    358: .Pp
1.55      kristaps  359: The
1.57      kristaps  360: .Em Parsable
1.43      kristaps  361: column indicates whether the macro may be followed by further
1.55      kristaps  362: (ostensibly callable) macros.  If a macro is not parsable, subsequent
                    363: macro invocations on the line will be interpreted as opaque text.
1.57      kristaps  364: .
                    365: .Pp
1.55      kristaps  366: The
1.57      kristaps  367: .Em Scope
1.43      kristaps  368: column, if applicable, describes closure rules.
1.56      kristaps  369: .
                    370: .
1.57      kristaps  371: .Ss Block full-explicit
1.43      kristaps  372: Multi-line scope closed by an explicit closing macro.  All macros
                    373: contains bodies; only
1.57      kristaps  374: .Pq Sq \&Bf
1.43      kristaps  375: contains a head.
1.57      kristaps  376: .Bd -literal -offset indent
1.50      kristaps  377: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
                    378: \(lBbody...\(rB
1.43      kristaps  379: \&.Yc
1.57      kristaps  380: .Ed
                    381: .
                    382: .Pp
                    383: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXX"
                    384: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
                    385: .It \&Bd     Ta    \&No     Ta    \&No     Ta    closed by \&Ed
                    386: .It \&Bf     Ta    \&No     Ta    \&No     Ta    closed by \&Ef
                    387: .It \&Bk     Ta    \&No     Ta    \&No     Ta    closed by \&Ek
                    388: .It \&Bl     Ta    \&No     Ta    \&No     Ta    closed by \&El
                    389: .It \&Ed     Ta    \&No     Ta    \&No     Ta    opened by \&Bd
                    390: .It \&Ef     Ta    \&No     Ta    \&No     Ta    opened by \&Bf
                    391: .It \&Ek     Ta    \&No     Ta    \&No     Ta    opened by \&Bk
                    392: .It \&El     Ta    \&No     Ta    \&No     Ta    opened by \&Bl
                    393: .El
1.56      kristaps  394: .
                    395: .
1.57      kristaps  396: .Ss Block full-implicit
1.43      kristaps  397: Multi-line scope closed by end-of-file or implicitly by another macro.
1.50      kristaps  398: All macros have bodies; some
1.57      kristaps  399: .Po
                    400: .Sq \&It \-bullet ,
                    401: .Sq \-hyphen ,
                    402: .Sq \-dash ,
                    403: .Sq \-enum ,
                    404: .Sq \-item
                    405: .Pc
1.50      kristaps  406: don't have heads, while
1.57      kristaps  407: .Sq \&It \-column
1.43      kristaps  408: may have multiple heads.
1.57      kristaps  409: .Bd -literal -offset indent
1.50      kristaps  410: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
                    411: \(lBbody...\(rB
1.57      kristaps  412: .Ed
1.56      kristaps  413: .
1.57      kristaps  414: .Pp
                    415: .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsableX" "closed by XXXXXXXXXXX"
                    416: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
                    417: .It \&It     Ta    \&No     Ta    Yes      Ta    closed by \&It, \&El
                    418: .It \&Nd     Ta    \&No     Ta    \&No     Ta    closed by \&Sh
                    419: .It \&Sh     Ta    \&No     Ta    \&No     Ta    closed by \&Sh
                    420: .It \&Ss     Ta    \&No     Ta    \&No     Ta    closed by \&Sh, \&Ss
                    421: .El
1.56      kristaps  422: .
1.57      kristaps  423: .
                    424: .Ss Block partial-explicit
1.43      kristaps  425: Like block full-explicit, but also with single-line scope.  Each
1.50      kristaps  426: has at least a body and, in limited circumstances, a head
1.57      kristaps  427: .Pq So \&Fo Sc , So \&Eo Sc
1.50      kristaps  428: and/or tail
1.57      kristaps  429: .Pq So \&Ec Sc .
                    430: .Bd -literal -offset indent
1.50      kristaps  431: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
                    432: \(lBbody...\(rB
                    433: \&.Yc \(lBtail...\(rB
1.2       kristaps  434:
1.43      kristaps  435: \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
1.50      kristaps  436: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.57      kristaps  437: .Ed
                    438: .
                    439: .Pp
                    440: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset indent
                    441: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
                    442: .It \&Ac     Ta    Yes      Ta    Yes      Ta    opened by \&Ao
                    443: .It \&Ao     Ta    Yes      Ta    Yes      Ta    closed by \&Ac
                    444: .It \&Bc     Ta    Yes      Ta    Yes      Ta    closed by \&Bo
                    445: .It \&Bo     Ta    Yes      Ta    Yes      Ta    opened by \&Bc
                    446: .It \&Brc    Ta    Yes      Ta    Yes      Ta    opened by \&Bro
                    447: .It \&Bro    Ta    Yes      Ta    Yes      Ta    closed by \&Brc
                    448: .It \&Dc     Ta    Yes      Ta    Yes      Ta    opened by \&Do
                    449: .It \&Do     Ta    Yes      Ta    Yes      Ta    closed by \&Dc
                    450: .It \&Ec     Ta    Yes      Ta    Yes      Ta    opened by \&Eo
                    451: .It \&Eo     Ta    Yes      Ta    Yes      Ta    closed by \&Ec
                    452: .It \&Fc     Ta    Yes      Ta    Yes      Ta    opened by \&Fo
                    453: .It \&Fo     Ta    \&No     Ta    \&No     Ta    closed by \&Fc
                    454: .It \&Oc     Ta    Yes      Ta    Yes      Ta    closed by \&Oo
                    455: .It \&Oo     Ta    Yes      Ta    Yes      Ta    opened by \&Oc
                    456: .It \&Pc     Ta    Yes      Ta    Yes      Ta    closed by \&Po
                    457: .It \&Po     Ta    Yes      Ta    Yes      Ta    opened by \&Pc
                    458: .It \&Qc     Ta    Yes      Ta    Yes      Ta    opened by \&Oo
                    459: .It \&Qo     Ta    Yes      Ta    Yes      Ta    closed by \&Oc
                    460: .It \&Re     Ta    \&No     Ta    \&No     Ta    opened by \&Rs
                    461: .It \&Rs     Ta    \&No     Ta    \&No     Ta    closed by \&Re
                    462: .It \&Sc     Ta    Yes      Ta    Yes      Ta    opened by \&So
                    463: .It \&So     Ta    Yes      Ta    Yes      Ta    closed by \&Sc
                    464: .It \&Xc     Ta    Yes      Ta    Yes      Ta    opened by \&Xo
                    465: .It \&Xo     Ta    Yes      Ta    Yes      Ta    closed by \&Xc
                    466: .El
1.56      kristaps  467: .
                    468: .
1.57      kristaps  469: .Ss Block partial-implicit
1.50      kristaps  470: Like block full-implicit, but with single-line scope closed by
1.57      kristaps  471: .Sx Reserved Characters
1.43      kristaps  472: or end of line.
1.57      kristaps  473: .Bd -literal -offset indent
1.43      kristaps  474: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
1.57      kristaps  475: .Ed
1.56      kristaps  476: .
1.57      kristaps  477: .Pp
                    478: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset indent
                    479: .It Em Macro Ta Em Callable Ta Em Parsable
                    480: .It \&Aq     Ta    Yes      Ta    Yes
                    481: .It \&Bq     Ta    Yes      Ta    Yes
                    482: .It \&Brq    Ta    Yes      Ta    Yes
                    483: .It \&D1     Ta    \&No     Ta    \&Yes
                    484: .It \&Dl     Ta    \&No     Ta    Yes
                    485: .It \&Dq     Ta    Yes      Ta    Yes
                    486: .It \&Op     Ta    Yes      Ta    Yes
                    487: .It \&Pq     Ta    Yes      Ta    Yes
                    488: .It \&Ql     Ta    Yes      Ta    Yes
                    489: .It \&Qq     Ta    Yes      Ta    Yes
                    490: .It \&Sq     Ta    Yes      Ta    Yes
                    491: .El
1.56      kristaps  492: .
1.57      kristaps  493: .
                    494: .Ss In-line
1.50      kristaps  495: Closed by
1.57      kristaps  496: .Sx Reserved Characters ,
1.43      kristaps  497: end of line, fixed argument lengths, and/or subsequent macros.  In-line
                    498: macros have only text children.  If a number (or inequality) of
1.3       kristaps  499: arguments is
1.57      kristaps  500: .Pq n ,
1.3       kristaps  501: then the macro accepts an arbitrary number of arguments.
1.57      kristaps  502: .Bd -literal -offset indent
1.43      kristaps  503: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lbres...\(rb
                    504:
                    505: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
                    506:
                    507: \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
1.57      kristaps  508: .Ed
                    509: .
                    510: .Pp
                    511: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset indent
                    512: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
                    513: .It \&%A     Ta    \&No     Ta    \&No     Ta    >0
                    514: .It \&%B     Ta    \&No     Ta    \&No     Ta    >0
                    515: .It \&%C     Ta    \&No     Ta    \&No     Ta    >0
                    516: .It \&%D     Ta    \&No     Ta    \&No     Ta    >0
                    517: .It \&%I     Ta    \&No     Ta    \&No     Ta    >0
                    518: .It \&%J     Ta    \&No     Ta    \&No     Ta    >0
                    519: .It \&%N     Ta    \&No     Ta    \&No     Ta    >0
                    520: .It \&%O     Ta    \&No     Ta    \&No     Ta    >0
                    521: .It \&%P     Ta    \&No     Ta    \&No     Ta    >0
                    522: .It \&%R     Ta    \&No     Ta    \&No     Ta    >0
                    523: .It \&%T     Ta    \&No     Ta    \&No     Ta    >0
                    524: .It \&%V     Ta    \&No     Ta    \&No     Ta    >0
                    525: .It \&Ad     Ta    Yes      Ta    Yes      Ta    n
                    526: .It \&An     Ta    Yes      Ta    Yes      Ta    n
                    527: .It \&Ap     Ta    Yes      Ta    Yes      Ta    0
                    528: .It \&Ar     Ta    Yes      Ta    Yes      Ta    n
                    529: .It \&At     Ta    Yes      Ta    Yes      Ta    1
                    530: .It \&Bsx    Ta    Yes      Ta    Yes      Ta    n
                    531: .It \&Bt     Ta    \&No     Ta    \&No     Ta    0
                    532: .It \&Bx     Ta    Yes      Ta    Yes      Ta    n
                    533: .It \&Cd     Ta    Yes      Ta    Yes      Ta    >0
                    534: .It \&Cm     Ta    Yes      Ta    Yes      Ta    n
                    535: .It \&Db     Ta    \&No     Ta    \&No     Ta    1
                    536: .It \&Dd     Ta    \&No     Ta    \&No     Ta    >0
                    537: .It \&Dt     Ta    \&No     Ta    \&No     Ta    n
                    538: .It \&Dv     Ta    Yes      Ta    Yes      Ta    n
                    539: .It \&Dx     Ta    Yes      Ta    Yes      Ta    n
                    540: .It \&Em     Ta    Yes      Ta    Yes      Ta    >0
                    541: .It \&En     Ta    \&No     Ta    \&No     Ta    0
                    542: .It \&Er     Ta    Yes      Ta    Yes      Ta    >0
                    543: .It \&Es     Ta    \&No     Ta    \&No     Ta    0
                    544: .It \&Ev     Ta    Yes      Ta    Yes      Ta    n
1.58      kristaps  545: .It \&Ex     Ta    \&No     Ta    \&No     Ta    n
1.57      kristaps  546: .It \&Fa     Ta    Yes      Ta    Yes      Ta    n
                    547: .It \&Fd     Ta    \&No     Ta    \&No     Ta    >0
                    548: .It \&Fl     Ta    Yes      Ta    Yes      Ta    n
                    549: .It \&Fn     Ta    Yes      Ta    Yes      Ta    >0
                    550: .It \&Fr     Ta    \&No     Ta    \&No     Ta    n
                    551: .It \&Ft     Ta    Yes      Ta    Yes      Ta    n
                    552: .It \&Fx     Ta    Yes      Ta    Yes      Ta    n
                    553: .It \&Hf     Ta    \&No     Ta    \&No     Ta    n
                    554: .It \&Ic     Ta    Yes      Ta    Yes      Ta    >0
                    555: .It \&In     Ta    \&No     Ta    \&No     Ta    n
                    556: .It \&Lb     Ta    \&No     Ta    \&No     Ta    1
                    557: .It \&Li     Ta    Yes      Ta    Yes      Ta    n
                    558: .It \&Lk     Ta    Yes      Ta    Yes      Ta    n
                    559: .It \&Lp     Ta    \&No     Ta    \&No     Ta    0
                    560: .It \&Ms     Ta    Yes      Ta    Yes      Ta    >0
                    561: .It \&Mt     Ta    Yes      Ta    Yes      Ta    >0
                    562: .It \&Nm     Ta    Yes      Ta    Yes      Ta    n
                    563: .It \&No     Ta    Yes      Ta    Yes      Ta    0
                    564: .It \&Ns     Ta    Yes      Ta    Yes      Ta    0
                    565: .It \&Nx     Ta    Yes      Ta    Yes      Ta    n
                    566: .It \&Os     Ta    \&No     Ta    \&No     Ta    n
                    567: .It \&Ot     Ta    \&No     Ta    \&No     Ta    n
                    568: .It \&Ox     Ta    Yes      Ta    Yes      Ta    n
                    569: .It \&Pa     Ta    Yes      Ta    Yes      Ta    n
                    570: .It \&Pf     Ta    \&No     Ta    Yes      Ta    1
                    571: .It \&Pp     Ta    \&No     Ta    \&No     Ta    0
1.58      kristaps  572: .It \&Rv     Ta    \&No     Ta    \&No     Ta    n
1.57      kristaps  573: .It \&Sm     Ta    \&No     Ta    \&No     Ta    1
                    574: .It \&St     Ta    \&No     Ta    Yes      Ta    1
                    575: .It \&Sx     Ta    Yes      Ta    Yes      Ta    >0
                    576: .It \&Sy     Ta    Yes      Ta    Yes      Ta    >0
                    577: .It \&Tn     Ta    Yes      Ta    Yes      Ta    >0
                    578: .It \&Ud     Ta    \&No     Ta    \&No     Ta    0
                    579: .It \&Ux     Ta    Yes      Ta    Yes      Ta    n
                    580: .It \&Va     Ta    Yes      Ta    Yes      Ta    n
                    581: .It \&Vt     Ta    Yes      Ta    Yes      Ta    >0
                    582: .It \&Xr     Ta    Yes      Ta    Yes      Ta    >0, <3
                    583: .It \&br     Ta    \&No     Ta    \&No     Ta    0
                    584: .It \&sp     Ta    \&No     Ta    \&No     Ta    1
                    585: .El
1.56      kristaps  586: .
                    587: .
1.4       kristaps  588: .Sh COMPATIBILITY
1.28      kristaps  589: This section documents compatibility with other roff implementations, at
1.50      kristaps  590: this time limited to
1.57      kristaps  591: .Xr groff 1 .
1.50      kristaps  592: The term
1.57      kristaps  593: .Qq historic groff
1.50      kristaps  594: refers to those versions before the
1.57      kristaps  595: .Pa doc.tmac
1.50      kristaps  596: file re-write
1.57      kristaps  597: .Pq somewhere between 1.15 and 1.19 .
                    598: .
                    599: .Pp
                    600: .Bl -dash -compact
                    601: .It
1.61      kristaps  602: Negative scaling units are now truncated to zero instead of creating
                    603: interesting conditions, such as with
                    604: .Sq \&sp -1i .
                    605: Furthermore, the
                    606: .Sq f
                    607: scaling unit, while accepted, is rendered as the default unit.
                    608: .It
1.51      kristaps  609: The
1.57      kristaps  610: .Sq \-split
1.51      kristaps  611: or
1.57      kristaps  612: .Sq \-nosplit
1.51      kristaps  613: argument to
1.57      kristaps  614: .Sq \&An
1.51      kristaps  615: applies to the whole document, not just to the current section as it
                    616: does in groff.
1.57      kristaps  617: .It
1.48      kristaps  618: In quoted literals, groff allowed pair-wise double-quotes to produce a
                    619: standalone double-quote in formatted output.  This idiosyncratic
                    620: behaviour is no longer applicable.
1.57      kristaps  621: .It
1.50      kristaps  622: The
1.57      kristaps  623: .Sq \&sp
1.45      kristaps  624: macro does not accept negative numbers.
1.57      kristaps  625: .It
1.35      kristaps  626: Blocks of whitespace are stripped from both macro and free-form text
                    627: lines (except when in literal mode), while groff would retain whitespace
                    628: in free-form text lines.
1.57      kristaps  629: .It
1.28      kristaps  630: Historic groff has many un-callable macros.  Most of these (excluding
                    631: some block-level macros) are now callable, conforming to the
                    632: non-historic groff version.
1.57      kristaps  633: .It
1.50      kristaps  634: The vertical bar
1.57      kristaps  635: .Sq \(ba
1.28      kristaps  636: made historic groff
1.57      kristaps  637: .Qq go orbital
1.28      kristaps  638: but is a proper delimiter in this implementation.
1.57      kristaps  639: .It
                    640: .Sq \&It \-nested
1.28      kristaps  641: is assumed for all lists (it wasn't in historic groff): any list may be
                    642: nested and
1.57      kristaps  643: .Sq \-enum
1.4       kristaps  644: lists will restart the sequence only for the sub-list.
1.57      kristaps  645: .It
                    646: .Sq \&It \-column
1.21      kristaps  647: syntax where column widths may be preceded by other arguments (instead
1.4       kristaps  648: of proceeded) is not supported.
1.57      kristaps  649: .It
1.50      kristaps  650: The
1.57      kristaps  651: .Sq \&At
1.4       kristaps  652: macro only accepts a single parameter.
1.57      kristaps  653: .It
1.4       kristaps  654: Some manuals use
1.57      kristaps  655: .Sq \&Li
1.4       kristaps  656: incorrectly by following it with a reserved character and expecting the
                    657: delimiter to render.  This is not supported.
1.57      kristaps  658: .It
1.50      kristaps  659: In groff, the
1.57      kristaps  660: .Sq \&Fo
1.41      kristaps  661: macro only produces the first parameter.  This is no longer the case.
1.57      kristaps  662: .El
1.56      kristaps  663: .
                    664: .
1.2       kristaps  665: .Sh SEE ALSO
1.57      kristaps  666: .Xr mandoc 1 ,
                    667: .Xr mandoc_char 7
1.56      kristaps  668: .
                    669: .
1.2       kristaps  670: .Sh AUTHORS
                    671: The
1.57      kristaps  672: .Nm
1.50      kristaps  673: reference was written by
1.57      kristaps  674: .An Kristaps Dzonsons Aq kristaps@kth.se .
1.56      kristaps  675: .
                    676: .
1.5       kristaps  677: .Sh CAVEATS
1.28      kristaps  678: There are many ambiguous parts of mdoc.
1.57      kristaps  679: .
                    680: .Pp
                    681: .Bl -dash -compact
                    682: .It
                    683: .Sq \&Fa
1.50      kristaps  684: should be
1.57      kristaps  685: .Sq \&Va
1.5       kristaps  686: as function arguments are variables.
1.57      kristaps  687: .It
                    688: .Sq \&Ft
1.5       kristaps  689: should be
1.57      kristaps  690: .Sq \&Vt
1.5       kristaps  691: as function return types are still types.  Furthermore, the
1.57      kristaps  692: .Sq \&Ft
1.5       kristaps  693: should be removed and
1.57      kristaps  694: .Sq \&Fo ,
1.5       kristaps  695: which ostensibly follows it, should follow the same convention as
1.57      kristaps  696: .Sq \&Va .
                    697: .It
                    698: .Sq \&Va
1.5       kristaps  699: should formalise that only one or two arguments are acceptable: a
1.21      kristaps  700: variable name and optional, preceding type.
1.57      kristaps  701: .It
                    702: .Sq \&Fd
1.5       kristaps  703: is ambiguous.  It's commonly used to indicate an include file in the
1.50      kristaps  704: synopsis section.
1.57      kristaps  705: .Sq \&In
1.5       kristaps  706: should be used, instead.
1.57      kristaps  707: .It
1.5       kristaps  708: Only the
1.57      kristaps  709: .Sq \-literal
1.5       kristaps  710: argument to
1.57      kristaps  711: .Sq \&Bd
1.5       kristaps  712: makes sense.  The remaining ones should be removed.
1.57      kristaps  713: .It
1.50      kristaps  714: The
1.57      kristaps  715: .Sq \&Xo
1.5       kristaps  716: and
1.57      kristaps  717: .Sq \&Xc
1.5       kristaps  718: macros should be deprecated.
1.57      kristaps  719: .It
1.5       kristaps  720: The
1.57      kristaps  721: .Sq \&Dt
1.5       kristaps  722: macro lacks clarity.  It should be absolutely clear which title will
                    723: render when formatting the manual page.
1.57      kristaps  724: .It
1.6       kristaps  725: A
1.57      kristaps  726: .Sq \&Lx
1.50      kristaps  727: should be provided for Linux (\(`a la
1.57      kristaps  728: .Sq \&Ox ,
                    729: .Sq \&Nx
1.6       kristaps  730: etc.).
1.57      kristaps  731: .It
1.14      kristaps  732: There's no way to refer to references in
1.57      kristaps  733: .Sq \&Rs/Re
1.14      kristaps  734: blocks.
1.57      kristaps  735: .It
1.54      kristaps  736: The \-split and \-nosplit dictates via
1.57      kristaps  737: .Sq \&An
1.54      kristaps  738: are re-set when entering and leaving the AUTHORS section.
1.57      kristaps  739: .El
1.56      kristaps  740: .

CVSweb