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

Annotation of mandoc/man.7, Revision 1.118

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

CVSweb