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

Annotation of mandoc/man.7, Revision 1.133

1.133   ! schwarze    1: .\"    $Id: man.7,v 1.132 2015/01/29 00:33:57 schwarze Exp $
1.1       kristaps    2: .\"
1.115     schwarze    3: .\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
1.129     schwarze    4: .\" Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
1.122     schwarze    5: .\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
1.1       kristaps    6: .\"
                      7: .\" Permission to use, copy, modify, and distribute this software for any
1.10      kristaps    8: .\" purpose with or without fee is hereby granted, provided that the above
                      9: .\" copyright notice and this permission notice appear in all copies.
                     10: .\"
                     11: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     12: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     13: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     14: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     15: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     16: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     17: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       kristaps   18: .\"
1.133   ! schwarze   19: .Dd $Mdocdate: January 29 2015 $
1.9       kristaps   20: .Dt MAN 7
1.1       kristaps   21: .Os
                     22: .Sh NAME
1.32      kristaps   23: .Nm man
1.111     schwarze   24: .Nd legacy formatting language for manual pages
1.1       kristaps   25: .Sh DESCRIPTION
1.111     schwarze   26: Traditionally, the
1.32      kristaps   27: .Nm man
1.111     schwarze   28: language has been used to write
1.32      kristaps   29: .Ux
1.111     schwarze   30: manuals for the
                     31: .Xr man 1
                     32: utility.
                     33: It supports limited control of presentational details like fonts,
                     34: indentation and spacing.
                     35: This reference document describes the structure of manual pages
                     36: and the syntax and usage of the man language.
1.32      kristaps   37: .Pp
                     38: .Bf -emphasis
1.20      kristaps   39: Do not use
1.32      kristaps   40: .Nm
1.111     schwarze   41: to write your manuals:
1.32      kristaps   42: .Ef
1.111     schwarze   43: It lacks support for semantic markup.
1.19      kristaps   44: Use the
1.32      kristaps   45: .Xr mdoc 7
1.1       kristaps   46: language, instead.
1.32      kristaps   47: .Pp
1.111     schwarze   48: In a
1.32      kristaps   49: .Nm
1.111     schwarze   50: document, lines beginning with the control character
1.32      kristaps   51: .Sq \&.
1.111     schwarze   52: are called
                     53: .Dq macro lines .
                     54: The first word is the macro name.
                     55: It usually consists of two capital letters.
                     56: For a list of available macros, see
                     57: .Sx MACRO OVERVIEW .
                     58: The words following the macro name are arguments to the macro.
                     59: .Pp
                     60: Lines not beginning with the control character are called
                     61: .Dq text lines .
                     62: They provide free-form text to be printed; the formatting of the text
                     63: depends on the respective processing context:
1.32      kristaps   64: .Bd -literal -offset indent
1.1       kristaps   65: \&.SH Macro lines change control state.
1.106     kristaps   66: Text lines are interpreted within the current state.
1.32      kristaps   67: .Ed
1.103     kristaps   68: .Pp
1.111     schwarze   69: Many aspects of the basic syntax of the
1.103     kristaps   70: .Nm
1.111     schwarze   71: language are based on the
                     72: .Xr roff 7
                     73: language; see the
                     74: .Em LANGUAGE SYNTAX
1.106     kristaps   75: and
1.111     schwarze   76: .Em MACRO SYNTAX
                     77: sections in the
                     78: .Xr roff 7
                     79: manual for details, in particular regarding
                     80: comments, escape sequences, whitespace, and quoting.
1.22      kristaps   81: .Sh MANUAL STRUCTURE
1.16      kristaps   82: Each
1.32      kristaps   83: .Nm
1.80      kristaps   84: document must contain the
1.39      kristaps   85: .Sx \&TH
1.68      kristaps   86: macro describing the document's section and title.
1.80      kristaps   87: It may occur anywhere in the document, although conventionally it
1.68      kristaps   88: appears as the first macro.
1.32      kristaps   89: .Pp
1.22      kristaps   90: Beyond
1.39      kristaps   91: .Sx \&TH ,
1.111     schwarze   92: at least one macro or text line must appear in the document.
1.100     kristaps   93: .Pp
                     94: The following is a well-formed skeleton
                     95: .Nm
                     96: file for a utility
                     97: .Qq progname :
1.32      kristaps   98: .Bd -literal -offset indent
1.100     kristaps   99: \&.TH PROGNAME 1 2009-10-10
1.22      kristaps  100: \&.SH NAME
1.124     schwarze  101: \efBprogname\efR \e(en one line about what it does
1.106     kristaps  102: \&.\e\(dq .SH LIBRARY
1.124     schwarze  103: \&.\e\(dq For sections 2, 3, and 9 only.
1.106     kristaps  104: \&.\e\(dq Not used in OpenBSD.
1.22      kristaps  105: \&.SH SYNOPSIS
1.124     schwarze  106: \efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR
1.22      kristaps  107: \&.SH DESCRIPTION
1.124     schwarze  108: The \efBfoo\efR utility processes files ...
1.126     schwarze  109: \&.\e\(dq .Sh CONTEXT
                    110: \&.\e\(dq For section 9 functions only.
1.106     kristaps  111: \&.\e\(dq .SH IMPLEMENTATION NOTES
                    112: \&.\e\(dq Not used in OpenBSD.
                    113: \&.\e\(dq .SH RETURN VALUES
1.124     schwarze  114: \&.\e\(dq For sections 2, 3, and 9 function return values only.
1.106     kristaps  115: \&.\e\(dq .SH ENVIRONMENT
1.124     schwarze  116: \&.\e\(dq For sections 1, 6, 7, and 8 only.
1.106     kristaps  117: \&.\e\(dq .SH FILES
                    118: \&.\e\(dq .SH EXIT STATUS
1.124     schwarze  119: \&.\e\(dq For sections 1, 6, and 8 only.
1.106     kristaps  120: \&.\e\(dq .SH EXAMPLES
                    121: \&.\e\(dq .SH DIAGNOSTICS
1.124     schwarze  122: \&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only.
1.106     kristaps  123: \&.\e\(dq .SH ERRORS
1.124     schwarze  124: \&.\e\(dq For sections 2, 3, 4, and 9 errno settings only.
1.106     kristaps  125: \&.\e\(dq .SH SEE ALSO
1.124     schwarze  126: \&.\e\(dq .BR foobar ( 1 )
1.106     kristaps  127: \&.\e\(dq .SH STANDARDS
                    128: \&.\e\(dq .SH HISTORY
                    129: \&.\e\(dq .SH AUTHORS
                    130: \&.\e\(dq .SH CAVEATS
                    131: \&.\e\(dq .SH BUGS
                    132: \&.\e\(dq .SH SECURITY CONSIDERATIONS
                    133: \&.\e\(dq Not used in OpenBSD.
1.32      kristaps  134: .Ed
1.41      kristaps  135: .Pp
                    136: The sections in a
                    137: .Nm
1.68      kristaps  138: document are conventionally ordered as they appear above.
                    139: Sections should be composed as follows:
1.42      kristaps  140: .Bl -ohang -offset indent
                    141: .It Em NAME
1.68      kristaps  142: The name(s) and a short description of the documented material.
                    143: The syntax for this is generally as follows:
1.41      kristaps  144: .Pp
                    145: .D1 \efBname\efR \e(en description
1.42      kristaps  146: .It Em LIBRARY
1.41      kristaps  147: The name of the library containing the documented material, which is
1.68      kristaps  148: assumed to be a function in a section 2 or 3 manual.
                    149: For functions in the C library, this may be as follows:
1.41      kristaps  150: .Pp
                    151: .D1 Standard C Library (libc, -lc)
1.42      kristaps  152: .It Em SYNOPSIS
1.41      kristaps  153: Documents the utility invocation syntax, function call syntax, or device
1.55      kristaps  154: configuration.
1.41      kristaps  155: .Pp
                    156: For the first, utilities (sections 1, 6, and 8), this is
                    157: generally structured as follows:
                    158: .Pp
                    159: .D1 \efBname\efR [-\efBab\efR] [-\efBc\efR\efIarg\efR] \efBpath\efR...
                    160: .Pp
                    161: For the second, function calls (sections 2, 3, 9):
                    162: .Pp
1.44      kristaps  163: .D1 \&.B char *name(char *\efIarg\efR);
1.41      kristaps  164: .Pp
                    165: And for the third, configurations (section 4):
                    166: .Pp
1.44      kristaps  167: .D1 \&.B name* at cardbus ? function ?
1.41      kristaps  168: .Pp
1.55      kristaps  169: Manuals not in these sections generally don't need a
1.42      kristaps  170: .Em SYNOPSIS .
                    171: .It Em DESCRIPTION
1.55      kristaps  172: This expands upon the brief, one-line description in
1.42      kristaps  173: .Em NAME .
                    174: It usually contains a break-down of the options (if documenting a
                    175: command).
1.126     schwarze  176: .It Em CONTEXT
                    177: This section lists the contexts in which functions can be called in section 9.
                    178: The contexts are autoconf, process, or interrupt.
1.42      kristaps  179: .It Em IMPLEMENTATION NOTES
1.68      kristaps  180: Implementation-specific notes should be kept here.
                    181: This is useful when implementing standard functions that may have side
                    182: effects or notable algorithmic implications.
1.42      kristaps  183: .It Em RETURN VALUES
1.80      kristaps  184: This section documents the return values of functions in sections 2, 3, and 9.
1.42      kristaps  185: .It Em ENVIRONMENT
                    186: Documents any usages of environment variables, e.g.,
                    187: .Xr environ 7 .
                    188: .It Em FILES
1.68      kristaps  189: Documents files used.
1.78      schwarze  190: It's helpful to document both the file name and a short description of how
1.68      kristaps  191: the file is used (created, modified, etc.).
1.67      kristaps  192: .It Em EXIT STATUS
1.80      kristaps  193: This section documents the command exit status for
                    194: section 1, 6, and 8 utilities.
1.68      kristaps  195: Historically, this information was described in
1.67      kristaps  196: .Em DIAGNOSTICS ,
                    197: a practise that is now discouraged.
1.42      kristaps  198: .It Em EXAMPLES
1.68      kristaps  199: Example usages.
                    200: This often contains snippets of well-formed,
                    201: well-tested invocations.
1.80      kristaps  202: Make sure that examples work properly!
1.42      kristaps  203: .It Em DIAGNOSTICS
1.68      kristaps  204: Documents error conditions.
1.124     schwarze  205: In section 4 and 9 manuals, these are usually messages
                    206: printed by the kernel to the console and to the kernel log.
                    207: In section 1, 6, 7, and 8, these are usually messages
                    208: printed by userland programs to the standard error output.
                    209: .Pp
1.42      kristaps  210: Historically, this section was used in place of
                    211: .Em EXIT STATUS
                    212: for manuals in sections 1, 6, and 8; however, this practise is
                    213: discouraged.
                    214: .It Em ERRORS
1.124     schwarze  215: Documents
                    216: .Xr errno 2
                    217: settings in sections 2, 3, 4, and 9.
1.42      kristaps  218: .It Em SEE ALSO
1.68      kristaps  219: References other manuals with related topics.
                    220: This section should exist for most manuals.
1.44      kristaps  221: .Pp
                    222: .D1 \&.BR bar \&( 1 \&),
                    223: .Pp
                    224: Cross-references should conventionally be ordered
1.42      kristaps  225: first by section, then alphabetically.
                    226: .It Em STANDARDS
                    227: References any standards implemented or used, such as
                    228: .Pp
                    229: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
                    230: .Pp
                    231: If not adhering to any standards, the
                    232: .Em HISTORY
                    233: section should be used.
                    234: .It Em HISTORY
1.81      schwarze  235: A brief history of the subject, including where support first appeared.
1.42      kristaps  236: .It Em AUTHORS
1.81      schwarze  237: Credits to the person or persons who wrote the code and/or documentation.
1.78      schwarze  238: Authors should generally be noted by both name and email address.
1.42      kristaps  239: .It Em CAVEATS
1.78      schwarze  240: Common misuses and misunderstandings should be explained
1.42      kristaps  241: in this section.
                    242: .It Em BUGS
1.80      kristaps  243: Known bugs, limitations, and work-arounds should be described
1.78      schwarze  244: in this section.
1.42      kristaps  245: .It Em SECURITY CONSIDERATIONS
                    246: Documents any security precautions that operators should consider.
1.41      kristaps  247: .El
1.110     schwarze  248: .Sh MACRO OVERVIEW
                    249: This overview is sorted such that macros of similar purpose are listed
                    250: together, to help find the best macro for any given purpose.
                    251: Deprecated macros are not included in the overview, but can be found
                    252: in the alphabetical reference below.
                    253: .Ss Page header and footer meta-data
                    254: .Bl -column "PP, LP, P" description
                    255: .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
                    256: .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
                    257: .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
                    258: .El
                    259: .Ss Sections and paragraphs
                    260: .Bl -column "PP, LP, P" description
                    261: .It Sx SH Ta section header (one line)
                    262: .It Sx SS Ta subsection header (one line)
                    263: .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
                    264: .It Sx RS , RE Ta reset the left margin: Op Ar width
                    265: .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
                    266: .It Sx TP Ta tagged paragraph: Op Ar width
                    267: .It Sx HP Ta hanged paragraph: Op Ar width
1.118     schwarze  268: .It Sx PD Ta set vertical paragraph distance: Op Ar height
1.110     schwarze  269: .It Sx \&sp Ta force vertical space: Op Ar height
                    270: .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
                    271: .It Sx in Ta additional indent: Op Ar width
                    272: .El
                    273: .Ss Physical markup
                    274: .Bl -column "PP, LP, P" description
                    275: .It Sx B Ta boldface font
                    276: .It Sx I Ta italic font
                    277: .It Sx R Ta roman (default) font
                    278: .It Sx SB Ta small boldface font
                    279: .It Sx SM Ta small roman font
                    280: .It Sx BI Ta alternate between boldface and italic fonts
                    281: .It Sx BR Ta alternate between boldface and roman fonts
                    282: .It Sx IB Ta alternate between italic and boldface fonts
                    283: .It Sx IR Ta alternate between italic and roman fonts
                    284: .It Sx RB Ta alternate between roman and boldface fonts
                    285: .It Sx RI Ta alternate between roman and italic fonts
                    286: .El
1.111     schwarze  287: .Sh MACRO REFERENCE
1.22      kristaps  288: This section is a canonical reference to all macros, arranged
1.68      kristaps  289: alphabetically.
                    290: For the scoping of individual macros, see
1.32      kristaps  291: .Sx MACRO SYNTAX .
1.72      joerg     292: .Ss \&AT
                    293: Sets the volume for the footer for compatibility with man pages from
1.123     schwarze  294: .At
1.72      joerg     295: releases.
                    296: The optional arguments specify which release it is from.
1.39      kristaps  297: .Ss \&B
1.22      kristaps  298: Text is rendered in bold face.
1.44      kristaps  299: .Pp
                    300: See also
1.92      kristaps  301: .Sx \&I
1.44      kristaps  302: and
1.92      kristaps  303: .Sx \&R .
1.39      kristaps  304: .Ss \&BI
1.68      kristaps  305: Text is rendered alternately in bold face and italic.
                    306: Thus,
1.32      kristaps  307: .Sq .BI this word and that
1.22      kristaps  308: causes
1.32      kristaps  309: .Sq this
1.22      kristaps  310: and
1.32      kristaps  311: .Sq and
1.55      kristaps  312: to render in bold face, while
1.32      kristaps  313: .Sq word
1.22      kristaps  314: and
1.32      kristaps  315: .Sq that
1.68      kristaps  316: render in italics.
                    317: Whitespace between arguments is omitted in output.
1.44      kristaps  318: .Pp
                    319: Examples:
1.46      kristaps  320: .Pp
1.93      kristaps  321: .Dl \&.BI bold italic bold italic
1.44      kristaps  322: .Pp
                    323: The output of this example will be emboldened
                    324: .Dq bold
                    325: and italicised
                    326: .Dq italic ,
                    327: with spaces stripped between arguments.
                    328: .Pp
                    329: See also
                    330: .Sx \&IB ,
                    331: .Sx \&BR ,
                    332: .Sx \&RB ,
                    333: .Sx \&RI ,
                    334: and
                    335: .Sx \&IR .
1.39      kristaps  336: .Ss \&BR
1.22      kristaps  337: Text is rendered alternately in bold face and roman (the default font).
                    338: Whitespace between arguments is omitted in output.
1.44      kristaps  339: .Pp
                    340: See
                    341: .Sx \&BI
                    342: for an equivalent example.
                    343: .Pp
                    344: See also
                    345: .Sx \&BI ,
                    346: .Sx \&IB ,
                    347: .Sx \&RB ,
                    348: .Sx \&RI ,
                    349: and
                    350: .Sx \&IR .
1.39      kristaps  351: .Ss \&DT
1.68      kristaps  352: Has no effect.
                    353: Included for compatibility.
1.116     schwarze  354: .Ss \&EE
                    355: This is a non-standard GNU extension, included only for compatibility.
                    356: In
                    357: .Xr mandoc 1 ,
                    358: it does the same as
                    359: .Sx \&fi .
                    360: .Ss \&EX
                    361: This is a non-standard GNU extension, included only for compatibility.
                    362: In
                    363: .Xr mandoc 1 ,
                    364: it does the same as
                    365: .Sx \&nf .
1.39      kristaps  366: .Ss \&HP
1.23      kristaps  367: Begin a paragraph whose initial output line is left-justified, but
1.27      kristaps  368: subsequent output lines are indented, with the following syntax:
1.44      kristaps  369: .Bd -filled -offset indent
                    370: .Pf \. Sx \&HP
1.130     schwarze  371: .Op Ar width
1.32      kristaps  372: .Ed
1.44      kristaps  373: .Pp
                    374: The
1.130     schwarze  375: .Ar width
1.117     schwarze  376: argument is a
                    377: .Xr roff 7
                    378: scaling width.
1.44      kristaps  379: If specified, it's saved for later paragraph left-margins; if unspecified, the
                    380: saved or default width is used.
                    381: .Pp
                    382: See also
1.45      kristaps  383: .Sx \&IP ,
                    384: .Sx \&LP ,
                    385: .Sx \&P ,
                    386: .Sx \&PP ,
1.44      kristaps  387: and
1.45      kristaps  388: .Sx \&TP .
1.39      kristaps  389: .Ss \&I
1.22      kristaps  390: Text is rendered in italics.
1.44      kristaps  391: .Pp
                    392: See also
1.92      kristaps  393: .Sx \&B
1.44      kristaps  394: and
1.92      kristaps  395: .Sx \&R .
1.39      kristaps  396: .Ss \&IB
1.80      kristaps  397: Text is rendered alternately in italics and bold face.
                    398: Whitespace between arguments is omitted in output.
1.44      kristaps  399: .Pp
                    400: See
                    401: .Sx \&BI
                    402: for an equivalent example.
                    403: .Pp
                    404: See also
                    405: .Sx \&BI ,
                    406: .Sx \&BR ,
                    407: .Sx \&RB ,
                    408: .Sx \&RI ,
                    409: and
                    410: .Sx \&IR .
1.39      kristaps  411: .Ss \&IP
1.44      kristaps  412: Begin an indented paragraph with the following syntax:
                    413: .Bd -filled -offset indent
                    414: .Pf \. Sx \&IP
1.130     schwarze  415: .Op Ar head Op Ar width
1.32      kristaps  416: .Ed
1.44      kristaps  417: .Pp
                    418: The
1.130     schwarze  419: .Ar width
1.117     schwarze  420: argument is a
                    421: .Xr roff 7
                    422: scaling width defining the left margin.
1.44      kristaps  423: It's saved for later paragraph left-margins; if unspecified, the saved or
                    424: default width is used.
                    425: .Pp
                    426: The
1.130     schwarze  427: .Ar head
1.68      kristaps  428: argument is used as a leading term, flushed to the left margin.
                    429: This is useful for bulleted paragraphs and so on.
1.44      kristaps  430: .Pp
                    431: See also
1.45      kristaps  432: .Sx \&HP ,
                    433: .Sx \&LP ,
                    434: .Sx \&P ,
                    435: .Sx \&PP ,
1.44      kristaps  436: and
1.45      kristaps  437: .Sx \&TP .
1.39      kristaps  438: .Ss \&IR
1.22      kristaps  439: Text is rendered alternately in italics and roman (the default font).
                    440: Whitespace between arguments is omitted in output.
1.44      kristaps  441: .Pp
                    442: See
                    443: .Sx \&BI
                    444: for an equivalent example.
                    445: .Pp
                    446: See also
                    447: .Sx \&BI ,
                    448: .Sx \&IB ,
                    449: .Sx \&BR ,
                    450: .Sx \&RB ,
                    451: and
                    452: .Sx \&RI .
1.39      kristaps  453: .Ss \&LP
1.68      kristaps  454: Begin an undecorated paragraph.
                    455: The scope of a paragraph is closed by a subsequent paragraph,
                    456: sub-section, section, or end of file.
1.78      schwarze  457: The saved paragraph left-margin width is reset to the default.
1.44      kristaps  458: .Pp
                    459: See also
1.45      kristaps  460: .Sx \&HP ,
                    461: .Sx \&IP ,
                    462: .Sx \&P ,
                    463: .Sx \&PP ,
1.44      kristaps  464: and
1.45      kristaps  465: .Sx \&TP .
1.113     kristaps  466: .Ss \&OP
                    467: Optional command-line argument.
1.114     schwarze  468: This is a non-standard GNU extension, included only for compatibility.
                    469: It has the following syntax:
1.113     kristaps  470: .Bd -filled -offset indent
                    471: .Pf \. Sx \&OP
1.130     schwarze  472: .Ar key Op Ar value
1.113     kristaps  473: .Ed
                    474: .Pp
                    475: The
1.130     schwarze  476: .Ar key
1.113     kristaps  477: is usually a command-line flag and
1.130     schwarze  478: .Ar value
1.113     kristaps  479: its argument.
1.39      kristaps  480: .Ss \&P
                    481: Synonym for
                    482: .Sx \&LP .
1.44      kristaps  483: .Pp
                    484: See also
1.45      kristaps  485: .Sx \&HP ,
                    486: .Sx \&IP ,
                    487: .Sx \&LP ,
                    488: .Sx \&PP ,
1.118     schwarze  489: and
                    490: .Sx \&TP .
                    491: .Ss \&PD
                    492: Specify the vertical space to be inserted before each new paragraph.
                    493: .br
                    494: The syntax is as follows:
                    495: .Bd -filled -offset indent
                    496: .Pf \. Sx \&PD
1.130     schwarze  497: .Op Ar height
1.118     schwarze  498: .Ed
                    499: .Pp
                    500: The
1.130     schwarze  501: .Ar height
1.118     schwarze  502: argument is a
                    503: .Xr roff 7
                    504: scaling width.
                    505: It defaults to
                    506: .Cm 1v .
                    507: If the unit is omitted,
                    508: .Cm v
                    509: is assumed.
                    510: .Pp
                    511: This macro affects the spacing before any subsequent instances of
                    512: .Sx \&HP ,
                    513: .Sx \&IP ,
                    514: .Sx \&LP ,
                    515: .Sx \&P ,
                    516: .Sx \&PP ,
                    517: .Sx \&SH ,
                    518: .Sx \&SS ,
1.44      kristaps  519: and
1.45      kristaps  520: .Sx \&TP .
1.39      kristaps  521: .Ss \&PP
                    522: Synonym for
                    523: .Sx \&LP .
1.44      kristaps  524: .Pp
                    525: See also
1.45      kristaps  526: .Sx \&HP ,
                    527: .Sx \&IP ,
                    528: .Sx \&LP ,
                    529: .Sx \&P ,
1.44      kristaps  530: and
1.45      kristaps  531: .Sx \&TP .
1.39      kristaps  532: .Ss \&R
1.22      kristaps  533: Text is rendered in roman (the default font).
1.44      kristaps  534: .Pp
                    535: See also
1.92      kristaps  536: .Sx \&I
1.44      kristaps  537: and
1.92      kristaps  538: .Sx \&B .
1.39      kristaps  539: .Ss \&RB
1.22      kristaps  540: Text is rendered alternately in roman (the default font) and bold face.
                    541: Whitespace between arguments is omitted in output.
1.44      kristaps  542: .Pp
                    543: See
                    544: .Sx \&BI
                    545: for an equivalent example.
                    546: .Pp
                    547: See also
                    548: .Sx \&BI ,
                    549: .Sx \&IB ,
                    550: .Sx \&BR ,
                    551: .Sx \&RI ,
                    552: and
                    553: .Sx \&IR .
1.39      kristaps  554: .Ss \&RE
1.30      kristaps  555: Explicitly close out the scope of a prior
1.39      kristaps  556: .Sx \&RS .
1.129     schwarze  557: The default left margin is restored to the state before that
1.102     kristaps  558: .Sx \&RS
                    559: invocation.
1.129     schwarze  560: .Pp
                    561: The syntax is as follows:
                    562: .Bd -filled -offset indent
                    563: .Pf \. Sx \&RE
                    564: .Op Ar level
                    565: .Ed
                    566: .Pp
                    567: Without an argument, the most recent
                    568: .Sx \&RS
                    569: block is closed out.
                    570: If
                    571: .Ar level
                    572: is 1, all open
                    573: .Sx \&RS
                    574: blocks are closed out.
                    575: Otherwise,
                    576: .Ar level No \(mi 1
                    577: nested
                    578: .Sx \&RS
                    579: blocks remain open.
1.39      kristaps  580: .Ss \&RI
1.22      kristaps  581: Text is rendered alternately in roman (the default font) and italics.
                    582: Whitespace between arguments is omitted in output.
1.44      kristaps  583: .Pp
                    584: See
                    585: .Sx \&BI
                    586: for an equivalent example.
                    587: .Pp
                    588: See also
                    589: .Sx \&BI ,
                    590: .Sx \&IB ,
                    591: .Sx \&BR ,
                    592: .Sx \&RB ,
                    593: and
                    594: .Sx \&IR .
1.39      kristaps  595: .Ss \&RS
1.102     kristaps  596: Temporarily reset the default left margin.
1.44      kristaps  597: This has the following syntax:
                    598: .Bd -filled -offset indent
1.102     kristaps  599: .Pf \. Sx \&RS
1.130     schwarze  600: .Op Ar width
1.32      kristaps  601: .Ed
1.44      kristaps  602: .Pp
                    603: The
1.130     schwarze  604: .Ar width
1.117     schwarze  605: argument is a
                    606: .Xr roff 7
                    607: scaling width.
1.55      kristaps  608: If not specified, the saved or default width is used.
1.102     kristaps  609: .Pp
                    610: See also
                    611: .Sx \&RE .
1.39      kristaps  612: .Ss \&SB
1.22      kristaps  613: Text is rendered in small size (one point smaller than the default font)
                    614: bold face.
1.39      kristaps  615: .Ss \&SH
1.68      kristaps  616: Begin a section.
                    617: The scope of a section is only closed by another section or the end of
                    618: file.
1.78      schwarze  619: The paragraph left-margin width is reset to the default.
1.39      kristaps  620: .Ss \&SM
1.22      kristaps  621: Text is rendered in small size (one point smaller than the default
                    622: font).
1.39      kristaps  623: .Ss \&SS
1.68      kristaps  624: Begin a sub-section.
                    625: The scope of a sub-section is closed by a subsequent sub-section,
                    626: section, or end of file.
1.78      schwarze  627: The paragraph left-margin width is reset to the default.
1.39      kristaps  628: .Ss \&TH
1.128     schwarze  629: Sets the title of the manual page for use in the page header
                    630: and footer with the following syntax:
1.44      kristaps  631: .Bd -filled -offset indent
                    632: .Pf \. Sx \&TH
1.99      schwarze  633: .Ar title section date
                    634: .Op Ar source Op Ar volume
1.44      kristaps  635: .Ed
1.43      kristaps  636: .Pp
1.99      schwarze  637: Conventionally, the document
                    638: .Ar title
                    639: is given in all caps.
                    640: The recommended
                    641: .Ar date
                    642: format is
                    643: .Sy YYYY-MM-DD
                    644: as specified in the ISO-8601 standard;
                    645: if the argument does not conform, it is printed verbatim.
                    646: If the
                    647: .Ar date
                    648: is empty or not specified, the current date is used.
                    649: The optional
                    650: .Ar source
1.68      kristaps  651: string specifies the organisation providing the utility.
1.128     schwarze  652: When unspecified,
                    653: .Xr mandoc 1
                    654: uses its
                    655: .Fl Ios
                    656: argument.
1.68      kristaps  657: The
1.99      schwarze  658: .Ar volume
1.43      kristaps  659: string replaces the default rendered volume, which is dictated by the
                    660: manual section.
                    661: .Pp
                    662: Examples:
1.46      kristaps  663: .Pp
1.93      kristaps  664: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39      kristaps  665: .Ss \&TP
1.25      kristaps  666: Begin a paragraph where the head, if exceeding the indentation width, is
1.24      kristaps  667: followed by a newline; if not, the body follows on the same line after a
1.68      kristaps  668: buffer to the indentation width.
                    669: Subsequent output lines are indented.
1.44      kristaps  670: The syntax is as follows:
                    671: .Bd -filled -offset indent
                    672: .Pf \. Sx \&TP
1.130     schwarze  673: .Op Ar width
1.32      kristaps  674: .Ed
                    675: .Pp
1.44      kristaps  676: The
1.130     schwarze  677: .Ar width
1.117     schwarze  678: argument is a
                    679: .Xr roff 7
                    680: scaling width.
1.44      kristaps  681: If specified, it's saved for later paragraph left-margins; if
1.27      kristaps  682: unspecified, the saved or default width is used.
1.44      kristaps  683: .Pp
                    684: See also
1.45      kristaps  685: .Sx \&HP ,
                    686: .Sx \&IP ,
                    687: .Sx \&LP ,
                    688: .Sx \&P ,
1.44      kristaps  689: and
1.45      kristaps  690: .Sx \&PP .
1.72      joerg     691: .Ss \&UC
                    692: Sets the volume for the footer for compatibility with man pages from
1.120     schwarze  693: .Bx
                    694: releases.
1.72      joerg     695: The optional first argument specifies which release it is from.
1.121     schwarze  696: .Ss \&UE
                    697: End a uniform resource identifier block.
                    698: This is a non-standard GNU extension, included only for compatibility.
                    699: See
                    700: .Sx \&UE .
                    701: .Ss \&UR
                    702: Begin a uniform resource identifier block.
                    703: This is a non-standard GNU extension, included only for compatibility.
                    704: It has the following syntax:
                    705: .Bd -literal -offset indent
                    706: .Pf \. Sx \&UR Ar uri
                    707: link description to be shown
                    708: .Pf \. Sx UE
                    709: .Ed
1.39      kristaps  710: .Ss \&br
1.68      kristaps  711: Breaks the current line.
                    712: Consecutive invocations have no further effect.
1.44      kristaps  713: .Pp
                    714: See also
                    715: .Sx \&sp .
1.39      kristaps  716: .Ss \&fi
1.22      kristaps  717: End literal mode begun by
1.39      kristaps  718: .Sx \&nf .
1.79      kristaps  719: .Ss \&in
                    720: Indent relative to the current indentation:
                    721: .Pp
1.130     schwarze  722: .D1 Pf \. Sx \&in Op Ar width
1.79      kristaps  723: .Pp
                    724: If
1.130     schwarze  725: .Ar width
1.79      kristaps  726: is signed, the new offset is relative.
                    727: Otherwise, it is absolute.
                    728: This value is reset upon the next paragraph, section, or sub-section.
1.39      kristaps  729: .Ss \&nf
1.22      kristaps  730: Begin literal mode: all subsequent free-form lines have their end of
1.68      kristaps  731: line boundaries preserved.
                    732: May be ended by
1.39      kristaps  733: .Sx \&fi .
1.101     kristaps  734: Literal mode is implicitly ended by
                    735: .Sx \&SH
                    736: or
                    737: .Sx \&SS .
1.39      kristaps  738: .Ss \&sp
1.44      kristaps  739: Insert vertical spaces into output with the following syntax:
                    740: .Bd -filled -offset indent
                    741: .Pf \. Sx \&sp
1.130     schwarze  742: .Op Ar height
1.44      kristaps  743: .Ed
                    744: .Pp
1.117     schwarze  745: The
1.130     schwarze  746: .Ar height
1.117     schwarze  747: argument is a scaling width as described in
                    748: .Xr roff 7 .
1.44      kristaps  749: If 0, this is equivalent to the
1.133   ! schwarze  750: .Xr roff 7
        !           751: .Ic \&br
        !           752: request.
1.68      kristaps  753: Defaults to 1, if unspecified.
1.111     schwarze  754: .Sh MACRO SYNTAX
                    755: The
                    756: .Nm
                    757: macros are classified by scope: line scope or block scope.
                    758: Line macros are only scoped to the current line (and, in some
                    759: situations, the subsequent line).
                    760: Block macros are scoped to the current line and subsequent lines until
                    761: closed by another block macro.
                    762: .Ss Line Macros
                    763: Line macros are generally scoped to the current line, with the body
                    764: consisting of zero or more arguments.
                    765: If a macro is scoped to the next line and the line arguments are empty,
                    766: the next line, which must be text, is used instead.
                    767: Thus:
                    768: .Bd -literal -offset indent
                    769: \&.I
                    770: foo
                    771: .Ed
                    772: .Pp
                    773: is equivalent to
                    774: .Sq \&.I foo .
                    775: If next-line macros are invoked consecutively, only the last is used.
                    776: If a next-line macro is followed by a non-next-line macro, an error is
                    777: raised, except for
1.131     schwarze  778: .Sx \&sp .
1.111     schwarze  779: .Pp
                    780: The syntax is as follows:
                    781: .Bd -literal -offset indent
                    782: \&.YO \(lBbody...\(rB
                    783: \(lBbody...\(rB
                    784: .Ed
                    785: .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
                    786: .It Em Macro Ta Em Arguments Ta Em Scope     Ta Em Notes
                    787: .It Sx \&AT  Ta    <=1       Ta    current   Ta    \&
                    788: .It Sx \&B   Ta    n         Ta    next-line Ta    \&
                    789: .It Sx \&BI  Ta    n         Ta    current   Ta    \&
                    790: .It Sx \&BR  Ta    n         Ta    current   Ta    \&
                    791: .It Sx \&DT  Ta    0         Ta    current   Ta    \&
1.121     schwarze  792: .It Sx \&EE  Ta    0         Ta    current   Ta    compat
                    793: .It Sx \&EX  Ta    0         Ta    current   Ta    compat
1.111     schwarze  794: .It Sx \&I   Ta    n         Ta    next-line Ta    \&
                    795: .It Sx \&IB  Ta    n         Ta    current   Ta    \&
                    796: .It Sx \&IR  Ta    n         Ta    current   Ta    \&
1.113     kristaps  797: .It Sx \&OP  Ta    0, 1      Ta    current   Ta    compat
1.121     schwarze  798: .It Sx \&PD  Ta    1         Ta    current   Ta    \&
1.111     schwarze  799: .It Sx \&R   Ta    n         Ta    next-line Ta    \&
                    800: .It Sx \&RB  Ta    n         Ta    current   Ta    \&
                    801: .It Sx \&RI  Ta    n         Ta    current   Ta    \&
                    802: .It Sx \&SB  Ta    n         Ta    next-line Ta    \&
                    803: .It Sx \&SM  Ta    n         Ta    next-line Ta    \&
                    804: .It Sx \&TH  Ta    >1, <6    Ta    current   Ta    \&
                    805: .It Sx \&UC  Ta    <=1       Ta    current   Ta    \&
                    806: .It Sx \&fi  Ta    0         Ta    current   Ta    compat
                    807: .It Sx \&in  Ta    1         Ta    current   Ta    compat
                    808: .It Sx \&nf  Ta    0         Ta    current   Ta    compat
                    809: .It Sx \&sp  Ta    1         Ta    current   Ta    compat
                    810: .El
                    811: .Pp
                    812: Macros marked as
                    813: .Qq compat
                    814: are included for compatibility with the significant corpus of existing
                    815: manuals that mix dialects of roff.
                    816: These macros should not be used for portable
                    817: .Nm
                    818: manuals.
                    819: .Ss Block Macros
                    820: Block macros comprise a head and body.
                    821: As with in-line macros, the head is scoped to the current line and, in
                    822: one circumstance, the next line (the next-line stipulations as in
                    823: .Sx Line Macros
                    824: apply here as well).
                    825: .Pp
                    826: The syntax is as follows:
                    827: .Bd -literal -offset indent
                    828: \&.YO \(lBhead...\(rB
                    829: \(lBhead...\(rB
                    830: \(lBbody...\(rB
                    831: .Ed
                    832: .Pp
                    833: The closure of body scope may be to the section, where a macro is closed
                    834: by
                    835: .Sx \&SH ;
                    836: sub-section, closed by a section or
                    837: .Sx \&SS ;
                    838: part, closed by a section, sub-section, or
                    839: .Sx \&RE ;
                    840: or paragraph, closed by a section, sub-section, part,
                    841: .Sx \&HP ,
                    842: .Sx \&IP ,
                    843: .Sx \&LP ,
                    844: .Sx \&P ,
                    845: .Sx \&PP ,
                    846: or
                    847: .Sx \&TP .
                    848: No closure refers to an explicit block closing macro.
                    849: .Pp
                    850: As a rule, block macros may not be nested; thus, calling a block macro
                    851: while another block macro scope is open, and the open scope is not
                    852: implicitly closed, is syntactically incorrect.
                    853: .Bl -column "MacroX" "ArgumentsX" "Head ScopeX" "sub-sectionX" "compatX" -offset indent
                    854: .It Em Macro Ta Em Arguments Ta Em Head Scope Ta Em Body Scope  Ta Em Notes
                    855: .It Sx \&HP  Ta    <2        Ta    current    Ta    paragraph   Ta    \&
                    856: .It Sx \&IP  Ta    <3        Ta    current    Ta    paragraph   Ta    \&
                    857: .It Sx \&LP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    858: .It Sx \&P   Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    859: .It Sx \&PP  Ta    0         Ta    current    Ta    paragraph   Ta    \&
                    860: .It Sx \&RE  Ta    0         Ta    current    Ta    none        Ta    compat
                    861: .It Sx \&RS  Ta    1         Ta    current    Ta    part        Ta    compat
                    862: .It Sx \&SH  Ta    >0        Ta    next-line  Ta    section     Ta    \&
                    863: .It Sx \&SS  Ta    >0        Ta    next-line  Ta    sub-section Ta    \&
                    864: .It Sx \&TP  Ta    n         Ta    next-line  Ta    paragraph   Ta    \&
1.121     schwarze  865: .It Sx \&UE  Ta    0         Ta    current    Ta    none        Ta    compat
                    866: .It Sx \&UR  Ta    1         Ta    current    Ta    part        Ta    compat
1.111     schwarze  867: .El
                    868: .Pp
                    869: Macros marked
                    870: .Qq compat
                    871: are as mentioned in
                    872: .Sx Line Macros .
                    873: .Pp
                    874: If a block macro is next-line scoped, it may only be followed by in-line
                    875: macros for decorating text.
                    876: .Ss Font handling
                    877: In
                    878: .Nm
                    879: documents, both
                    880: .Sx Physical markup
                    881: macros and
                    882: .Xr roff 7
                    883: .Ql \ef
                    884: font escape sequences can be used to choose fonts.
                    885: In text lines, the effect of manual font selection by escape sequences
                    886: only lasts until the next macro invocation; in macro lines, it only lasts
                    887: until the end of the macro scope.
                    888: Note that macros like
                    889: .Sx \&BR
                    890: open and close a font scope for each argument.
1.1       kristaps  891: .Sh SEE ALSO
1.89      schwarze  892: .Xr man 1 ,
1.32      kristaps  893: .Xr mandoc 1 ,
1.98      kristaps  894: .Xr eqn 7 ,
1.89      schwarze  895: .Xr mandoc_char 7 ,
1.94      kristaps  896: .Xr mdoc 7 ,
                    897: .Xr roff 7 ,
                    898: .Xr tbl 7
1.78      schwarze  899: .Sh HISTORY
                    900: The
                    901: .Nm
                    902: language first appeared as a macro package for the roff typesetting
                    903: system in
                    904: .At v7 .
                    905: It was later rewritten by James Clark as a macro package for groff.
1.113     kristaps  906: Eric S. Raymond wrote the extended
                    907: .Nm
                    908: macros for groff in 2007.
1.78      schwarze  909: The stand-alone implementation that is part of the
                    910: .Xr mandoc 1
                    911: utility written by Kristaps Dzonsons appeared in
1.80      kristaps  912: .Ox 4.6 .
1.1       kristaps  913: .Sh AUTHORS
1.78      schwarze  914: This
1.32      kristaps  915: .Nm
1.23      kristaps  916: reference was written by
1.119     schwarze  917: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
1.1       kristaps  918: .Sh CAVEATS
1.68      kristaps  919: Do not use this language.
                    920: Use
1.32      kristaps  921: .Xr mdoc 7 ,
1.1       kristaps  922: instead.

CVSweb