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

Annotation of mandoc/man.7, Revision 1.125

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

CVSweb