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

Annotation of mandoc/man.7, Revision 1.96

1.96    ! schwarze    1: .\"    $Id: man.7,v 1.95 2011/01/12 10:43:22 kristaps Exp $
1.1       kristaps    2: .\"
1.78      schwarze    3: .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
1.1       kristaps    4: .\"
                      5: .\" Permission to use, copy, modify, and distribute this software for any
1.10      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.
                      8: .\"
                      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.1       kristaps   16: .\"
1.96    ! schwarze   17: .Dd $Mdocdate: January 12 2011 $
1.9       kristaps   18: .Dt MAN 7
1.1       kristaps   19: .Os
                     20: .Sh NAME
1.32      kristaps   21: .Nm man
                     22: .Nd man language reference
1.1       kristaps   23: .Sh DESCRIPTION
                     24: The
1.32      kristaps   25: .Nm man
1.20      kristaps   26: language was historically used to format
1.32      kristaps   27: .Ux
1.68      kristaps   28: manuals.
                     29: This reference document describes its syntax, structure, and usage.
1.32      kristaps   30: .Pp
                     31: .Bf -emphasis
1.20      kristaps   32: Do not use
1.32      kristaps   33: .Nm
1.20      kristaps   34: to write your manuals.
1.32      kristaps   35: .Ef
1.19      kristaps   36: Use the
1.32      kristaps   37: .Xr mdoc 7
1.1       kristaps   38: language, instead.
1.32      kristaps   39: .Pp
1.78      schwarze   40: A
1.32      kristaps   41: .Nm
1.1       kristaps   42: document follows simple rules:  lines beginning with the control
1.20      kristaps   43: character
1.32      kristaps   44: .Sq \&.
1.68      kristaps   45: are parsed for macros.
                     46: Other lines are interpreted within the scope of
1.1       kristaps   47: prior macros:
1.32      kristaps   48: .Bd -literal -offset indent
1.1       kristaps   49: \&.SH Macro lines change control state.
                     50: Other lines are interpreted within the current state.
1.32      kristaps   51: .Ed
1.1       kristaps   52: .Sh INPUT ENCODING
1.32      kristaps   53: .Nm
1.14      kristaps   54: documents may contain only graphable 7-bit ASCII characters, the
1.78      schwarze   55: space character, and the tab character.
1.68      kristaps   56: All manuals must have
1.32      kristaps   57: .Ux
1.20      kristaps   58: line termination.
1.32      kristaps   59: .Pp
1.5       kristaps   60: Blank lines are acceptable; where found, the output will assert a
1.1       kristaps   61: vertical space.
1.95      kristaps   62: .Pp
                     63: If the first character of a line is a space, that line is printed
                     64: with a leading newline.
1.32      kristaps   65: .Ss Comments
1.21      kristaps   66: Text following a
1.75      kristaps   67: .Sq \e\*q ,
1.21      kristaps   68: whether in a macro or free-form text line, is ignored to the end of
1.68      kristaps   69: line.
                     70: A macro line with only a control character and comment escape,
1.75      kristaps   71: .Sq \&.\e\*q ,
1.68      kristaps   72: is also ignored.
                     73: Macro lines with only a control character and optionally whitespace are
                     74: stripped from input.
1.32      kristaps   75: .Ss Special Characters
1.21      kristaps   76: Special characters may occur in both macro and free-form lines.
                     77: Sequences begin with the escape character
1.32      kristaps   78: .Sq \e
1.20      kristaps   79: followed by either an open-parenthesis
1.32      kristaps   80: .Sq \&(
1.1       kristaps   81: for two-character sequences; an open-bracket
1.32      kristaps   82: .Sq \&[
1.1       kristaps   83: for n-character sequences (terminated at a close-bracket
1.32      kristaps   84: .Sq \&] ) ;
1.68      kristaps   85: or a single one-character sequence.
                     86: See
1.32      kristaps   87: .Xr mandoc_char 7
1.68      kristaps   88: for a complete list.
                     89: Examples include
1.32      kristaps   90: .Sq \e(em
                     91: .Pq em-dash
1.21      kristaps   92: and
1.32      kristaps   93: .Sq \ee
                     94: .Pq back-slash .
                     95: .Ss Text Decoration
1.21      kristaps   96: Terms may be text-decorated using the
1.32      kristaps   97: .Sq \ef
1.78      schwarze   98: escape followed by an indicator: B (bold), I (italic), R (Roman), or P
1.55      kristaps   99: (revert to previous mode):
1.48      kristaps  100: .Pp
                    101: .D1 \efBbold\efR \efIitalic\efP
                    102: .Pp
                    103: A numerical representation 3, 2, or 1 (bold, italic, and Roman,
1.68      kristaps  104: respectively) may be used instead.
                    105: A text decoration is only valid, if specified in free-form text, until
                    106: the next macro invocation; if specified within a macro, it's only valid
                    107: until the macro closes scope.
1.54      kristaps  108: Note that macros like
                    109: .Sx \&BR
                    110: open and close a font scope with each argument.
1.48      kristaps  111: .Pp
1.76      kristaps  112: The
1.49      kristaps  113: .Sq \ef
1.76      kristaps  114: attribute is forgotten when entering or exiting a macro block.
1.32      kristaps  115: .Ss Whitespace
1.66      kristaps  116: Whitespace consists of the space character.
1.80      kristaps  117: In free-form lines, whitespace is preserved within a line; unescaped
1.64      kristaps  118: trailing spaces are stripped from input (unless in a literal context).
                    119: Blank free-form lines, which may include spaces, are permitted and
                    120: rendered as an empty line.
                    121: .Pp
1.68      kristaps  122: In macro lines, whitespace delimits arguments and is discarded.
                    123: If arguments are quoted, whitespace within the quotes is retained.
1.43      kristaps  124: .Ss Dates
                    125: The
                    126: .Sx \&TH
                    127: macro is the only
                    128: .Nm
1.68      kristaps  129: macro that requires a date.
                    130: The form for this date is the ISO-8601
1.43      kristaps  131: standard
                    132: .Cm YYYY-MM-DD .
1.38      kristaps  133: .Ss Scaling Widths
                    134: Many macros support scaled widths for their arguments, such as
                    135: stipulating a two-inch paragraph indentation with the following:
                    136: .Bd -literal -offset indent
                    137: \&.HP 2i
                    138: .Ed
                    139: .Pp
                    140: The syntax for scaled widths is
                    141: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:]? ,
                    142: where a decimal must be preceded or proceeded by at least one digit.
1.68      kristaps  143: Negative numbers, while accepted, are truncated to zero.
                    144: The following scaling units are accepted:
1.38      kristaps  145: .Pp
                    146: .Bl -tag -width Ds -offset indent -compact
                    147: .It c
                    148: centimetre
                    149: .It i
                    150: inch
                    151: .It P
                    152: pica (~1/6 inch)
                    153: .It p
                    154: point (~1/72 inch)
                    155: .It f
                    156: synonym for
                    157: .Sq u
                    158: .It v
                    159: default vertical span
                    160: .It m
                    161: width of rendered
                    162: .Sq m
                    163: .Pq em
                    164: character
                    165: .It n
                    166: width of rendered
                    167: .Sq n
                    168: .Pq en
                    169: character
                    170: .It u
                    171: default horizontal span
                    172: .It M
                    173: mini-em (~1/100 em)
                    174: .El
                    175: .Pp
                    176: Using anything other than
                    177: .Sq m ,
                    178: .Sq n ,
                    179: .Sq u ,
                    180: or
                    181: .Sq v
1.44      kristaps  182: is necessarily non-portable across output media.
1.38      kristaps  183: .Pp
                    184: If a scaling unit is not provided, the numerical value is interpreted
                    185: under the default rules of
                    186: .Sq v
                    187: for vertical spaces and
                    188: .Sq u
                    189: for horizontal ones.
                    190: .Em Note :
                    191: this differs from
                    192: .Xr mdoc 7 ,
                    193: which, if a unit is not provided, will instead interpret the string as
                    194: literal text.
1.69      kristaps  195: .Ss Sentence Spacing
1.80      kristaps  196: When composing a manual, make sure that sentences end at the end of
1.69      kristaps  197: a line.
                    198: By doing so, front-ends will be able to apply the proper amount of
1.71      kristaps  199: spacing after the end of sentence (unescaped) period, exclamation mark,
                    200: or question mark followed by zero or more non-sentence closing
1.80      kristaps  201: delimiters
                    202: .Po
                    203: .Sq \&) ,
1.71      kristaps  204: .Sq \&] ,
                    205: .Sq \&' ,
1.80      kristaps  206: .Sq \&"
                    207: .Pc .
1.22      kristaps  208: .Sh MANUAL STRUCTURE
1.16      kristaps  209: Each
1.32      kristaps  210: .Nm
1.80      kristaps  211: document must contain the
1.39      kristaps  212: .Sx \&TH
1.68      kristaps  213: macro describing the document's section and title.
1.80      kristaps  214: It may occur anywhere in the document, although conventionally it
1.68      kristaps  215: appears as the first macro.
1.32      kristaps  216: .Pp
1.22      kristaps  217: Beyond
1.39      kristaps  218: .Sx \&TH ,
1.68      kristaps  219: at least one macro or text node must appear in the document.
                    220: Documents are generally structured as follows:
1.32      kristaps  221: .Bd -literal -offset indent
1.43      kristaps  222: \&.TH FOO 1 2009-10-10
1.22      kristaps  223: \&.SH NAME
1.29      kristaps  224: \efBfoo\efR \e(en a description goes here
1.33      kristaps  225: \&.\e\*q .SH LIBRARY
1.86      kristaps  226: \&.\e\*q For sections 2 & 3 only.
                    227: \&.\e\*q Not used in OpenBSD.
1.22      kristaps  228: \&.SH SYNOPSIS
                    229: \efBfoo\efR [\efB\e-options\efR] arguments...
                    230: \&.SH DESCRIPTION
1.33      kristaps  231: The \efBfoo\efR utility processes files...
                    232: \&.\e\*q .SH IMPLEMENTATION NOTES
1.89      schwarze  233: \&.\e\*q Not used in OpenBSD.
1.22      kristaps  234: \&.\e\*q .SH RETURN VALUES
1.86      kristaps  235: \&.\e\*q For sections 2, 3, & 9 only.
1.22      kristaps  236: \&.\e\*q .SH ENVIRONMENT
1.86      kristaps  237: \&.\e\*q For sections 1, 6, 7, & 8 only.
1.22      kristaps  238: \&.\e\*q .SH FILES
1.67      kristaps  239: \&.\e\*q .SH EXIT STATUS
1.89      schwarze  240: \&.\e\*q For sections 1, 6, & 8 only.
1.22      kristaps  241: \&.\e\*q .SH EXAMPLES
                    242: \&.\e\*q .SH DIAGNOSTICS
1.86      kristaps  243: \&.\e\*q For sections 1, 4, 6, 7, & 8 only.
1.22      kristaps  244: \&.\e\*q .SH ERRORS
1.86      kristaps  245: \&.\e\*q For sections 2, 3, & 9 only.
1.22      kristaps  246: \&.\e\*q .SH SEE ALSO
1.42      kristaps  247: \&.\e\*q .BR foo ( 1 )
1.22      kristaps  248: \&.\e\*q .SH STANDARDS
                    249: \&.\e\*q .SH HISTORY
                    250: \&.\e\*q .SH AUTHORS
                    251: \&.\e\*q .SH CAVEATS
                    252: \&.\e\*q .SH BUGS
1.33      kristaps  253: \&.\e\*q .SH SECURITY CONSIDERATIONS
1.86      kristaps  254: \&.\e\*q Not used in OpenBSD.
1.32      kristaps  255: .Ed
1.41      kristaps  256: .Pp
                    257: The sections in a
                    258: .Nm
1.68      kristaps  259: document are conventionally ordered as they appear above.
                    260: Sections should be composed as follows:
1.42      kristaps  261: .Bl -ohang -offset indent
                    262: .It Em NAME
1.68      kristaps  263: The name(s) and a short description of the documented material.
                    264: The syntax for this is generally as follows:
1.41      kristaps  265: .Pp
                    266: .D1 \efBname\efR \e(en description
1.42      kristaps  267: .It Em LIBRARY
1.41      kristaps  268: The name of the library containing the documented material, which is
1.68      kristaps  269: assumed to be a function in a section 2 or 3 manual.
                    270: For functions in the C library, this may be as follows:
1.41      kristaps  271: .Pp
                    272: .D1 Standard C Library (libc, -lc)
1.42      kristaps  273: .It Em SYNOPSIS
1.41      kristaps  274: Documents the utility invocation syntax, function call syntax, or device
1.55      kristaps  275: configuration.
1.41      kristaps  276: .Pp
                    277: For the first, utilities (sections 1, 6, and 8), this is
                    278: generally structured as follows:
                    279: .Pp
                    280: .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
                    281: .Pp
                    282: For the second, function calls (sections 2, 3, 9):
                    283: .Pp
1.44      kristaps  284: .D1 \&.B char *name(char *\efIarg\efR);
1.41      kristaps  285: .Pp
                    286: And for the third, configurations (section 4):
                    287: .Pp
1.44      kristaps  288: .D1 \&.B name* at cardbus ? function ?
1.41      kristaps  289: .Pp
1.55      kristaps  290: Manuals not in these sections generally don't need a
1.42      kristaps  291: .Em SYNOPSIS .
                    292: .It Em DESCRIPTION
1.55      kristaps  293: This expands upon the brief, one-line description in
1.42      kristaps  294: .Em NAME .
                    295: It usually contains a break-down of the options (if documenting a
                    296: command).
                    297: .It Em IMPLEMENTATION NOTES
1.68      kristaps  298: Implementation-specific notes should be kept here.
                    299: This is useful when implementing standard functions that may have side
                    300: effects or notable algorithmic implications.
1.42      kristaps  301: .It Em RETURN VALUES
1.80      kristaps  302: This section documents the return values of functions in sections 2, 3, and 9.
1.42      kristaps  303: .It Em ENVIRONMENT
                    304: Documents any usages of environment variables, e.g.,
                    305: .Xr environ 7 .
                    306: .It Em FILES
1.68      kristaps  307: Documents files used.
1.78      schwarze  308: It's helpful to document both the file name and a short description of how
1.68      kristaps  309: the file is used (created, modified, etc.).
1.67      kristaps  310: .It Em EXIT STATUS
1.80      kristaps  311: This section documents the command exit status for
                    312: section 1, 6, and 8 utilities.
1.68      kristaps  313: Historically, this information was described in
1.67      kristaps  314: .Em DIAGNOSTICS ,
                    315: a practise that is now discouraged.
1.42      kristaps  316: .It Em EXAMPLES
1.68      kristaps  317: Example usages.
                    318: This often contains snippets of well-formed,
                    319: well-tested invocations.
1.80      kristaps  320: Make sure that examples work properly!
1.42      kristaps  321: .It Em DIAGNOSTICS
1.68      kristaps  322: Documents error conditions.
                    323: This is most useful in section 4 manuals.
1.42      kristaps  324: Historically, this section was used in place of
                    325: .Em EXIT STATUS
                    326: for manuals in sections 1, 6, and 8; however, this practise is
                    327: discouraged.
                    328: .It Em ERRORS
                    329: Documents error handling in sections 2, 3, and 9.
                    330: .It Em SEE ALSO
1.68      kristaps  331: References other manuals with related topics.
                    332: This section should exist for most manuals.
1.44      kristaps  333: .Pp
                    334: .D1 \&.BR bar \&( 1 \&),
                    335: .Pp
                    336: Cross-references should conventionally be ordered
1.42      kristaps  337: first by section, then alphabetically.
                    338: .It Em STANDARDS
                    339: References any standards implemented or used, such as
                    340: .Pp
                    341: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
                    342: .Pp
                    343: If not adhering to any standards, the
                    344: .Em HISTORY
                    345: section should be used.
                    346: .It Em HISTORY
1.81      schwarze  347: A brief history of the subject, including where support first appeared.
1.42      kristaps  348: .It Em AUTHORS
1.81      schwarze  349: Credits to the person or persons who wrote the code and/or documentation.
1.78      schwarze  350: Authors should generally be noted by both name and email address.
1.42      kristaps  351: .It Em CAVEATS
1.78      schwarze  352: Common misuses and misunderstandings should be explained
1.42      kristaps  353: in this section.
                    354: .It Em BUGS
1.80      kristaps  355: Known bugs, limitations, and work-arounds should be described
1.78      schwarze  356: in this section.
1.42      kristaps  357: .It Em SECURITY CONSIDERATIONS
                    358: Documents any security precautions that operators should consider.
1.41      kristaps  359: .El
1.22      kristaps  360: .Sh MACRO SYNTAX
1.80      kristaps  361: Macros are one to three characters in length and begin with a
1.78      schwarze  362: control character,
1.32      kristaps  363: .Sq \&. ,
1.68      kristaps  364: at the beginning of the line.
                    365: The
1.59      kristaps  366: .Sq \(aq
1.68      kristaps  367: macro control character is also accepted.
                    368: An arbitrary amount of whitespace (spaces or tabs) may sit between the
                    369: control character and the macro name.
                    370: Thus, the following are equivalent:
1.39      kristaps  371: .Bd -literal -offset indent
                    372: \&.PP
                    373: \&.\ \ \ PP
                    374: .Ed
1.96    ! schwarze  375: .Pp
        !           376: To include space characters in macro arguments, arguments may be quoted;
        !           377: see the
        !           378: .Sq MACRO SYNTAX
        !           379: section in the
        !           380: .Xr roff 7
        !           381: manual for details.
1.32      kristaps  382: .Pp
1.1       kristaps  383: The
1.32      kristaps  384: .Nm
1.68      kristaps  385: macros are classified by scope: line scope or block scope.
                    386: Line macros are only scoped to the current line (and, in some
                    387: situations, the subsequent line).
                    388: Block macros are scoped to the current line and subsequent lines until
                    389: closed by another block macro.
1.32      kristaps  390: .Ss Line Macros
1.30      kristaps  391: Line macros are generally scoped to the current line, with the body
1.68      kristaps  392: consisting of zero or more arguments.
                    393: If a macro is scoped to the next line and the line arguments are empty,
                    394: the next line, which must be text, is used instead.
                    395: Thus:
1.32      kristaps  396: .Bd -literal -offset indent
1.30      kristaps  397: \&.I
1.4       kristaps  398: foo
1.32      kristaps  399: .Ed
                    400: .Pp
1.20      kristaps  401: is equivalent to
1.32      kristaps  402: .Sq \&.I foo .
1.56      kristaps  403: If next-line macros are invoked consecutively, only the last is used.
                    404: If a next-line macro is followed by a non-next-line macro, an error is
1.78      schwarze  405: raised, except for
1.56      kristaps  406: .Sx \&br ,
                    407: .Sx \&sp ,
1.78      schwarze  408: and
                    409: .Sx \&na .
1.56      kristaps  410: .Pp
                    411: The syntax is as follows:
1.32      kristaps  412: .Bd -literal -offset indent
1.22      kristaps  413: \&.YO \(lBbody...\(rB
                    414: \(lBbody...\(rB
1.32      kristaps  415: .Ed
                    416: .Pp
1.57      kristaps  417: .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX"
                    418: .It Em Macro Ta Em Arguments Ta Em Scope     Ta Em Notes
1.73      kristaps  419: .It Sx \&AT  Ta    <=1       Ta    current   Ta    \&
1.57      kristaps  420: .It Sx \&B   Ta    n         Ta    next-line Ta    \&
                    421: .It Sx \&BI  Ta    n         Ta    current   Ta    \&
                    422: .It Sx \&BR  Ta    n         Ta    current   Ta    \&
                    423: .It Sx \&DT  Ta    0         Ta    current   Ta    \&
                    424: .It Sx \&I   Ta    n         Ta    next-line Ta    \&
                    425: .It Sx \&IB  Ta    n         Ta    current   Ta    \&
                    426: .It Sx \&IR  Ta    n         Ta    current   Ta    \&
                    427: .It Sx \&R   Ta    n         Ta    next-line Ta    \&
                    428: .It Sx \&RB  Ta    n         Ta    current   Ta    \&
                    429: .It Sx \&RI  Ta    n         Ta    current   Ta    \&
                    430: .It Sx \&SB  Ta    n         Ta    next-line Ta    \&
                    431: .It Sx \&SM  Ta    n         Ta    next-line Ta    \&
                    432: .It Sx \&TH  Ta    >1, <6    Ta    current   Ta    \&
1.73      kristaps  433: .It Sx \&UC  Ta    <=1       Ta    current   Ta    \&
1.57      kristaps  434: .It Sx \&br  Ta    0         Ta    current   Ta    compat
                    435: .It Sx \&fi  Ta    0         Ta    current   Ta    compat
1.91      kristaps  436: .It Sx \&ft  Ta    1         Ta    current   Ta    compat
1.79      kristaps  437: .It Sx \&in  Ta    1         Ta    current   Ta    compat
1.57      kristaps  438: .It Sx \&na  Ta    0         Ta    current   Ta    compat
                    439: .It Sx \&nf  Ta    0         Ta    current   Ta    compat
                    440: .It Sx \&sp  Ta    1         Ta    current   Ta    compat
1.32      kristaps  441: .El
                    442: .Pp
1.57      kristaps  443: Macros marked as
                    444: .Qq compat
                    445: are included for compatibility with the significant corpus of existing
1.68      kristaps  446: manuals that mix dialects of roff.
                    447: These macros should not be used for portable
1.58      kristaps  448: .Nm
                    449: manuals.
1.32      kristaps  450: .Ss Block Macros
1.80      kristaps  451: Block macros comprise a head and body.
                    452: As with in-line macros, the head is scoped to the current line and, in
1.68      kristaps  453: one circumstance, the next line (the next-line stipulations as in
1.57      kristaps  454: .Sx Line Macros
                    455: apply here as well).
1.56      kristaps  456: .Pp
                    457: The syntax is as follows:
1.32      kristaps  458: .Bd -literal -offset indent
1.22      kristaps  459: \&.YO \(lBhead...\(rB
                    460: \(lBhead...\(rB
                    461: \(lBbody...\(rB
1.32      kristaps  462: .Ed
                    463: .Pp
1.30      kristaps  464: The closure of body scope may be to the section, where a macro is closed
                    465: by
1.39      kristaps  466: .Sx \&SH ;
1.30      kristaps  467: sub-section, closed by a section or
1.39      kristaps  468: .Sx \&SS ;
1.30      kristaps  469: part, closed by a section, sub-section, or
1.39      kristaps  470: .Sx \&RE ;
1.55      kristaps  471: or paragraph, closed by a section, sub-section, part,
1.39      kristaps  472: .Sx \&HP ,
                    473: .Sx \&IP ,
                    474: .Sx \&LP ,
                    475: .Sx \&P ,
                    476: .Sx \&PP ,
1.30      kristaps  477: or
1.39      kristaps  478: .Sx \&TP .
1.30      kristaps  479: No closure refers to an explicit block closing macro.
1.32      kristaps  480: .Pp
1.58      kristaps  481: As a rule, block macros may not be nested; thus, calling a block macro
                    482: while another block macro scope is open, and the open scope is not
                    483: implicitly closed, is syntactically incorrect.
                    484: .Pp
1.57      kristaps  485: .Bl -column -compact -offset indent "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX"
                    486: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope  Ta Em Notes
                    487: .It Sx \&HP  Ta    <2        Ta    current    Ta    paragraph   Ta    \&
                    488: .It Sx \&IP  Ta    <3        Ta    current    Ta    paragraph   Ta    \&
                    489: .It Sx \&LP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    490: .It Sx \&P   Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    491: .It Sx \&PP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    492: .It Sx \&RE  Ta    0         Ta    current    Ta    none        Ta    compat
                    493: .It Sx \&RS  Ta    1         Ta    current    Ta    part        Ta    compat
                    494: .It Sx \&SH  Ta    >0        Ta    next-line  Ta    section     Ta    \&
                    495: .It Sx \&SS  Ta    >0        Ta    next-line  Ta    sub-section Ta    \&
                    496: .It Sx \&TP  Ta    n         Ta    next-line  Ta    paragraph   Ta    \&
1.32      kristaps  497: .El
1.57      kristaps  498: .Pp
                    499: Macros marked
                    500: .Qq compat
                    501: are as mentioned in
                    502: .Sx Line Macros .
1.32      kristaps  503: .Pp
1.22      kristaps  504: If a block macro is next-line scoped, it may only be followed by in-line
1.57      kristaps  505: macros for decorating text.
1.22      kristaps  506: .Sh REFERENCE
                    507: This section is a canonical reference to all macros, arranged
1.68      kristaps  508: alphabetically.
                    509: For the scoping of individual macros, see
1.32      kristaps  510: .Sx MACRO SYNTAX .
1.72      joerg     511: .Ss \&AT
                    512: Sets the volume for the footer for compatibility with man pages from
                    513: .Tn AT&T UNIX
                    514: releases.
                    515: The optional arguments specify which release it is from.
1.39      kristaps  516: .Ss \&B
1.22      kristaps  517: Text is rendered in bold face.
1.44      kristaps  518: .Pp
                    519: See also
1.92      kristaps  520: .Sx \&I
1.44      kristaps  521: and
1.92      kristaps  522: .Sx \&R .
1.39      kristaps  523: .Ss \&BI
1.68      kristaps  524: Text is rendered alternately in bold face and italic.
                    525: Thus,
1.32      kristaps  526: .Sq .BI this word and that
1.22      kristaps  527: causes
1.32      kristaps  528: .Sq this
1.22      kristaps  529: and
1.32      kristaps  530: .Sq and
1.55      kristaps  531: to render in bold face, while
1.32      kristaps  532: .Sq word
1.22      kristaps  533: and
1.32      kristaps  534: .Sq that
1.68      kristaps  535: render in italics.
                    536: Whitespace between arguments is omitted in output.
1.44      kristaps  537: .Pp
                    538: Examples:
1.46      kristaps  539: .Pp
1.93      kristaps  540: .Dl \&.BI bold italic bold italic
1.44      kristaps  541: .Pp
                    542: The output of this example will be emboldened
                    543: .Dq bold
                    544: and italicised
                    545: .Dq italic ,
                    546: with spaces stripped between arguments.
                    547: .Pp
                    548: See also
                    549: .Sx \&IB ,
                    550: .Sx \&BR ,
                    551: .Sx \&RB ,
                    552: .Sx \&RI ,
                    553: and
                    554: .Sx \&IR .
1.39      kristaps  555: .Ss \&BR
1.22      kristaps  556: Text is rendered alternately in bold face and roman (the default font).
                    557: Whitespace between arguments is omitted in output.
1.44      kristaps  558: .Pp
                    559: See
                    560: .Sx \&BI
                    561: for an equivalent example.
                    562: .Pp
                    563: See also
                    564: .Sx \&BI ,
                    565: .Sx \&IB ,
                    566: .Sx \&RB ,
                    567: .Sx \&RI ,
                    568: and
                    569: .Sx \&IR .
1.39      kristaps  570: .Ss \&DT
1.68      kristaps  571: Has no effect.
                    572: Included for compatibility.
1.39      kristaps  573: .Ss \&HP
1.23      kristaps  574: Begin a paragraph whose initial output line is left-justified, but
1.27      kristaps  575: subsequent output lines are indented, with the following syntax:
1.44      kristaps  576: .Bd -filled -offset indent
                    577: .Pf \. Sx \&HP
                    578: .Op Cm width
1.32      kristaps  579: .Ed
1.44      kristaps  580: .Pp
                    581: The
                    582: .Cm width
                    583: argument must conform to
                    584: .Sx Scaling Widths .
                    585: If specified, it's saved for later paragraph left-margins; if unspecified, the
                    586: saved or default width is used.
                    587: .Pp
                    588: See also
1.45      kristaps  589: .Sx \&IP ,
                    590: .Sx \&LP ,
                    591: .Sx \&P ,
                    592: .Sx \&PP ,
1.44      kristaps  593: and
1.45      kristaps  594: .Sx \&TP .
1.39      kristaps  595: .Ss \&I
1.22      kristaps  596: Text is rendered in italics.
1.44      kristaps  597: .Pp
                    598: See also
1.92      kristaps  599: .Sx \&B
1.44      kristaps  600: and
1.92      kristaps  601: .Sx \&R .
1.39      kristaps  602: .Ss \&IB
1.80      kristaps  603: Text is rendered alternately in italics and bold face.
                    604: Whitespace between arguments is omitted in output.
1.44      kristaps  605: .Pp
                    606: See
                    607: .Sx \&BI
                    608: for an equivalent example.
                    609: .Pp
                    610: See also
                    611: .Sx \&BI ,
                    612: .Sx \&BR ,
                    613: .Sx \&RB ,
                    614: .Sx \&RI ,
                    615: and
                    616: .Sx \&IR .
1.39      kristaps  617: .Ss \&IP
1.44      kristaps  618: Begin an indented paragraph with the following syntax:
                    619: .Bd -filled -offset indent
                    620: .Pf \. Sx \&IP
                    621: .Op Cm head Op Cm width
1.32      kristaps  622: .Ed
1.44      kristaps  623: .Pp
                    624: The
                    625: .Cm width
                    626: argument defines the width of the left margin and is defined by
1.80      kristaps  627: .Sx Scaling Widths .
1.44      kristaps  628: It's saved for later paragraph left-margins; if unspecified, the saved or
                    629: default width is used.
                    630: .Pp
                    631: The
                    632: .Cm head
1.68      kristaps  633: argument is used as a leading term, flushed to the left margin.
                    634: This is useful for bulleted paragraphs and so on.
1.44      kristaps  635: .Pp
                    636: See also
1.45      kristaps  637: .Sx \&HP ,
                    638: .Sx \&LP ,
                    639: .Sx \&P ,
                    640: .Sx \&PP ,
1.44      kristaps  641: and
1.45      kristaps  642: .Sx \&TP .
1.39      kristaps  643: .Ss \&IR
1.22      kristaps  644: Text is rendered alternately in italics and roman (the default font).
                    645: Whitespace between arguments is omitted in output.
1.44      kristaps  646: .Pp
                    647: See
                    648: .Sx \&BI
                    649: for an equivalent example.
                    650: .Pp
                    651: See also
                    652: .Sx \&BI ,
                    653: .Sx \&IB ,
                    654: .Sx \&BR ,
                    655: .Sx \&RB ,
                    656: and
                    657: .Sx \&RI .
1.39      kristaps  658: .Ss \&LP
1.68      kristaps  659: Begin an undecorated paragraph.
                    660: The scope of a paragraph is closed by a subsequent paragraph,
                    661: sub-section, section, or end of file.
1.78      schwarze  662: The saved paragraph left-margin width is reset to the default.
1.44      kristaps  663: .Pp
                    664: See also
1.45      kristaps  665: .Sx \&HP ,
                    666: .Sx \&IP ,
                    667: .Sx \&P ,
                    668: .Sx \&PP ,
1.44      kristaps  669: and
1.45      kristaps  670: .Sx \&TP .
1.39      kristaps  671: .Ss \&P
                    672: Synonym for
                    673: .Sx \&LP .
1.44      kristaps  674: .Pp
                    675: See also
1.45      kristaps  676: .Sx \&HP ,
                    677: .Sx \&IP ,
                    678: .Sx \&LP ,
                    679: .Sx \&PP ,
1.44      kristaps  680: and
1.45      kristaps  681: .Sx \&TP .
1.39      kristaps  682: .Ss \&PP
                    683: Synonym for
                    684: .Sx \&LP .
1.44      kristaps  685: .Pp
                    686: See also
1.45      kristaps  687: .Sx \&HP ,
                    688: .Sx \&IP ,
                    689: .Sx \&LP ,
                    690: .Sx \&P ,
1.44      kristaps  691: and
1.45      kristaps  692: .Sx \&TP .
1.39      kristaps  693: .Ss \&R
1.22      kristaps  694: Text is rendered in roman (the default font).
1.44      kristaps  695: .Pp
                    696: See also
1.92      kristaps  697: .Sx \&I
1.44      kristaps  698: and
1.92      kristaps  699: .Sx \&B .
1.39      kristaps  700: .Ss \&RB
1.22      kristaps  701: Text is rendered alternately in roman (the default font) and bold face.
                    702: Whitespace between arguments is omitted in output.
1.44      kristaps  703: .Pp
                    704: See
                    705: .Sx \&BI
                    706: for an equivalent example.
                    707: .Pp
                    708: See also
                    709: .Sx \&BI ,
                    710: .Sx \&IB ,
                    711: .Sx \&BR ,
                    712: .Sx \&RI ,
                    713: and
                    714: .Sx \&IR .
1.39      kristaps  715: .Ss \&RE
1.30      kristaps  716: Explicitly close out the scope of a prior
1.39      kristaps  717: .Sx \&RS .
                    718: .Ss \&RI
1.22      kristaps  719: Text is rendered alternately in roman (the default font) and italics.
                    720: Whitespace between arguments is omitted in output.
1.44      kristaps  721: .Pp
                    722: See
                    723: .Sx \&BI
                    724: for an equivalent example.
                    725: .Pp
                    726: See also
                    727: .Sx \&BI ,
                    728: .Sx \&IB ,
                    729: .Sx \&BR ,
                    730: .Sx \&RB ,
                    731: and
                    732: .Sx \&IR .
1.39      kristaps  733: .Ss \&RS
1.68      kristaps  734: Begin a part setting the left margin.
                    735: The left margin controls the offset, following an initial indentation,
                    736: to un-indented text such as that of
1.39      kristaps  737: .Sx \&PP .
1.44      kristaps  738: This has the following syntax:
                    739: .Bd -filled -offset indent
                    740: .Pf \. Sx \&Rs
                    741: .Op Cm width
1.32      kristaps  742: .Ed
1.44      kristaps  743: .Pp
                    744: The
                    745: .Cm width
                    746: argument must conform to
                    747: .Sx Scaling Widths .
1.55      kristaps  748: If not specified, the saved or default width is used.
1.39      kristaps  749: .Ss \&SB
1.22      kristaps  750: Text is rendered in small size (one point smaller than the default font)
                    751: bold face.
1.39      kristaps  752: .Ss \&SH
1.68      kristaps  753: Begin a section.
                    754: The scope of a section is only closed by another section or the end of
                    755: file.
1.78      schwarze  756: The paragraph left-margin width is reset to the default.
1.39      kristaps  757: .Ss \&SM
1.22      kristaps  758: Text is rendered in small size (one point smaller than the default
                    759: font).
1.39      kristaps  760: .Ss \&SS
1.68      kristaps  761: Begin a sub-section.
                    762: The scope of a sub-section is closed by a subsequent sub-section,
                    763: section, or end of file.
1.78      schwarze  764: The paragraph left-margin width is reset to the default.
1.39      kristaps  765: .Ss \&TH
1.22      kristaps  766: Sets the title of the manual page with the following syntax:
1.44      kristaps  767: .Bd -filled -offset indent
                    768: .Pf \. Sx \&TH
                    769: .Cm title section
                    770: .Op Cm date Op Cm source Op Cm volume
                    771: .Ed
1.43      kristaps  772: .Pp
1.78      schwarze  773: At least the upper-case document
1.43      kristaps  774: .Cm title
1.78      schwarze  775: and the manual
1.44      kristaps  776: .Cm section
1.68      kristaps  777: arguments must be provided.
                    778: The
1.43      kristaps  779: .Cm date
                    780: argument should be formatted as described in
1.74      kristaps  781: .Sx Dates ,
                    782: but will be printed verbatim if it is not.
                    783: If the date is not specified, the current date is used.
1.68      kristaps  784: The
1.44      kristaps  785: .Cm source
1.68      kristaps  786: string specifies the organisation providing the utility.
                    787: The
1.44      kristaps  788: .Cm volume
1.43      kristaps  789: string replaces the default rendered volume, which is dictated by the
                    790: manual section.
                    791: .Pp
                    792: Examples:
1.46      kristaps  793: .Pp
1.93      kristaps  794: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39      kristaps  795: .Ss \&TP
1.25      kristaps  796: Begin a paragraph where the head, if exceeding the indentation width, is
1.24      kristaps  797: followed by a newline; if not, the body follows on the same line after a
1.68      kristaps  798: buffer to the indentation width.
                    799: Subsequent output lines are indented.
1.44      kristaps  800: The syntax is as follows:
                    801: .Bd -filled -offset indent
                    802: .Pf \. Sx \&TP
                    803: .Op Cm width
1.32      kristaps  804: .Ed
                    805: .Pp
1.44      kristaps  806: The
                    807: .Cm width
                    808: argument must conform to
                    809: .Sx Scaling Widths .
                    810: If specified, it's saved for later paragraph left-margins; if
1.27      kristaps  811: unspecified, the saved or default width is used.
1.44      kristaps  812: .Pp
                    813: See also
1.45      kristaps  814: .Sx \&HP ,
                    815: .Sx \&IP ,
                    816: .Sx \&LP ,
                    817: .Sx \&P ,
1.44      kristaps  818: and
1.45      kristaps  819: .Sx \&PP .
1.72      joerg     820: .Ss \&UC
                    821: Sets the volume for the footer for compatibility with man pages from
                    822: BSD releases.
                    823: The optional first argument specifies which release it is from.
1.39      kristaps  824: .Ss \&br
1.68      kristaps  825: Breaks the current line.
                    826: Consecutive invocations have no further effect.
1.44      kristaps  827: .Pp
                    828: See also
                    829: .Sx \&sp .
1.39      kristaps  830: .Ss \&fi
1.22      kristaps  831: End literal mode begun by
1.39      kristaps  832: .Sx \&nf .
1.91      kristaps  833: .Ss \&ft
                    834: Change the current font mode.
                    835: See
                    836: .Sx Text Decoration
                    837: for a listing of available font modes.
1.79      kristaps  838: .Ss \&in
                    839: Indent relative to the current indentation:
                    840: .Pp
                    841: .D1 Pf \. Sx \&in Op Cm width
                    842: .Pp
                    843: If
                    844: .Cm width
                    845: is signed, the new offset is relative.
                    846: Otherwise, it is absolute.
                    847: This value is reset upon the next paragraph, section, or sub-section.
1.39      kristaps  848: .Ss \&na
1.36      kristaps  849: Don't align to the right margin.
1.39      kristaps  850: .Ss \&nf
1.22      kristaps  851: Begin literal mode: all subsequent free-form lines have their end of
1.68      kristaps  852: line boundaries preserved.
                    853: May be ended by
1.39      kristaps  854: .Sx \&fi .
                    855: .Ss \&sp
1.44      kristaps  856: Insert vertical spaces into output with the following syntax:
                    857: .Bd -filled -offset indent
                    858: .Pf \. Sx \&sp
                    859: .Op Cm height
                    860: .Ed
                    861: .Pp
1.55      kristaps  862: Insert
1.44      kristaps  863: .Cm height
                    864: spaces, which must conform to
                    865: .Sx Scaling Widths .
                    866: If 0, this is equivalent to the
1.39      kristaps  867: .Sx \&br
1.68      kristaps  868: macro.
                    869: Defaults to 1, if unspecified.
1.44      kristaps  870: .Pp
                    871: See also
                    872: .Sx \&br .
1.18      kristaps  873: .Sh COMPATIBILITY
1.58      kristaps  874: This section documents areas of questionable portability between
                    875: implementations of the
                    876: .Nm
                    877: language.
1.51      kristaps  878: .Pp
                    879: .Bl -dash -compact
1.77      kristaps  880: .It
1.58      kristaps  881: In quoted literals, GNU troff allowed pair-wise double-quotes to produce
1.68      kristaps  882: a standalone double-quote in formatted output.
                    883: It is not known whether this behaviour is exhibited by other formatters.
1.32      kristaps  884: .It
1.82      kristaps  885: troff suppresses a newline before
                    886: .Sq \(aq
                    887: macro output; in mandoc, it is an alias for the standard
                    888: .Sq \&.
                    889: control character.
                    890: .It
                    891: The
                    892: .Sq \eh
                    893: .Pq horizontal position ,
                    894: .Sq \ev
                    895: .Pq vertical position ,
                    896: .Sq \em
                    897: .Pq text colour ,
                    898: .Sq \eM
                    899: .Pq text filling colour ,
1.83      kristaps  900: .Sq \ez
                    901: .Pq zero-length character ,
1.84      kristaps  902: .Sq \ew
                    903: .Pq string length ,
1.85      kristaps  904: .Sq \ek
                    905: .Pq horizontal position marker ,
1.87      kristaps  906: .Sq \eo
                    907: .Pq text overstrike ,
1.82      kristaps  908: and
                    909: .Sq \es
                    910: .Pq text size
1.84      kristaps  911: escape sequences are all discarded in mandoc.
1.82      kristaps  912: .It
                    913: The
                    914: .Sq \ef
                    915: scaling unit is accepted by mandoc, but rendered as the default unit.
                    916: .It
1.23      kristaps  917: The
1.51      kristaps  918: .Sx \&sp
1.68      kristaps  919: macro does not accept negative values in mandoc.
                    920: In GNU troff, this would result in strange behaviour.
1.32      kristaps  921: .El
1.1       kristaps  922: .Sh SEE ALSO
1.89      schwarze  923: .Xr man 1 ,
1.32      kristaps  924: .Xr mandoc 1 ,
1.89      schwarze  925: .Xr mandoc_char 7 ,
1.94      kristaps  926: .Xr mdoc 7 ,
                    927: .Xr roff 7 ,
                    928: .Xr tbl 7
1.78      schwarze  929: .Sh HISTORY
                    930: The
                    931: .Nm
                    932: language first appeared as a macro package for the roff typesetting
                    933: system in
                    934: .At v7 .
                    935: It was later rewritten by James Clark as a macro package for groff.
                    936: The stand-alone implementation that is part of the
                    937: .Xr mandoc 1
                    938: utility written by Kristaps Dzonsons appeared in
1.80      kristaps  939: .Ox 4.6 .
1.1       kristaps  940: .Sh AUTHORS
1.78      schwarze  941: This
1.32      kristaps  942: .Nm
1.23      kristaps  943: reference was written by
1.62      kristaps  944: .An Kristaps Dzonsons Aq kristaps@bsd.lv .
1.1       kristaps  945: .Sh CAVEATS
1.68      kristaps  946: Do not use this language.
                    947: Use
1.32      kristaps  948: .Xr mdoc 7 ,
1.1       kristaps  949: instead.

CVSweb