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

Annotation of mandoc/man.7, Revision 1.123

1.123   ! schwarze    1: .\"    $Id: man.7,v 1.122 2014/01/06 00:53:33 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.123   ! schwarze   19: .Dd $Mdocdate: January 6 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.100     kristaps  101: \efBprogname\efR \e(en a description goes here
1.106     kristaps  102: \&.\e\(dq .SH LIBRARY
                    103: \&.\e\(dq For sections 2 & 3 only.
                    104: \&.\e\(dq Not used in OpenBSD.
1.22      kristaps  105: \&.SH SYNOPSIS
1.100     kristaps  106: \efBprogname\efR [\efB\e-options\efR] arguments...
1.22      kristaps  107: \&.SH DESCRIPTION
1.33      kristaps  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
                    112: \&.\e\(dq For sections 2, 3, & 9 only.
                    113: \&.\e\(dq .SH ENVIRONMENT
                    114: \&.\e\(dq For sections 1, 6, 7, & 8 only.
                    115: \&.\e\(dq .SH FILES
                    116: \&.\e\(dq .SH EXIT STATUS
                    117: \&.\e\(dq For sections 1, 6, & 8 only.
                    118: \&.\e\(dq .SH EXAMPLES
                    119: \&.\e\(dq .SH DIAGNOSTICS
                    120: \&.\e\(dq For sections 1, 4, 6, 7, & 8 only.
                    121: \&.\e\(dq .SH ERRORS
                    122: \&.\e\(dq For sections 2, 3, & 9 only.
                    123: \&.\e\(dq .SH SEE ALSO
                    124: \&.\e\(dq .BR foo ( 1 )
                    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.
                    200: This is most useful in section 4 manuals.
1.42      kristaps  201: Historically, this section was used in place of
                    202: .Em EXIT STATUS
                    203: for manuals in sections 1, 6, and 8; however, this practise is
                    204: discouraged.
                    205: .It Em ERRORS
                    206: Documents error handling in sections 2, 3, and 9.
                    207: .It Em SEE ALSO
1.68      kristaps  208: References other manuals with related topics.
                    209: This section should exist for most manuals.
1.44      kristaps  210: .Pp
                    211: .D1 \&.BR bar \&( 1 \&),
                    212: .Pp
                    213: Cross-references should conventionally be ordered
1.42      kristaps  214: first by section, then alphabetically.
                    215: .It Em STANDARDS
                    216: References any standards implemented or used, such as
                    217: .Pp
                    218: .D1 IEEE Std 1003.2 (\e(lqPOSIX.2\e(rq)
                    219: .Pp
                    220: If not adhering to any standards, the
                    221: .Em HISTORY
                    222: section should be used.
                    223: .It Em HISTORY
1.81      schwarze  224: A brief history of the subject, including where support first appeared.
1.42      kristaps  225: .It Em AUTHORS
1.81      schwarze  226: Credits to the person or persons who wrote the code and/or documentation.
1.78      schwarze  227: Authors should generally be noted by both name and email address.
1.42      kristaps  228: .It Em CAVEATS
1.78      schwarze  229: Common misuses and misunderstandings should be explained
1.42      kristaps  230: in this section.
                    231: .It Em BUGS
1.80      kristaps  232: Known bugs, limitations, and work-arounds should be described
1.78      schwarze  233: in this section.
1.42      kristaps  234: .It Em SECURITY CONSIDERATIONS
                    235: Documents any security precautions that operators should consider.
1.41      kristaps  236: .El
1.110     schwarze  237: .Sh MACRO OVERVIEW
                    238: This overview is sorted such that macros of similar purpose are listed
                    239: together, to help find the best macro for any given purpose.
                    240: Deprecated macros are not included in the overview, but can be found
                    241: in the alphabetical reference below.
                    242: .Ss Page header and footer meta-data
                    243: .Bl -column "PP, LP, P" description
                    244: .It Sx TH Ta set the title: Ar title section date Op Ar source Op Ar volume
                    245: .It Sx AT Ta display AT&T UNIX version in the page footer (<= 1 argument)
                    246: .It Sx UC Ta display BSD version in the page footer (<= 1 argument)
                    247: .El
                    248: .Ss Sections and paragraphs
                    249: .Bl -column "PP, LP, P" description
                    250: .It Sx SH Ta section header (one line)
                    251: .It Sx SS Ta subsection header (one line)
                    252: .It Sx PP , LP , P Ta start an undecorated paragraph (no arguments)
                    253: .It Sx RS , RE Ta reset the left margin: Op Ar width
                    254: .It Sx IP Ta indented paragraph: Op Ar head Op Ar width
                    255: .It Sx TP Ta tagged paragraph: Op Ar width
                    256: .It Sx HP Ta hanged paragraph: Op Ar width
1.118     schwarze  257: .It Sx PD Ta set vertical paragraph distance: Op Ar height
1.110     schwarze  258: .It Sx \&br Ta force output line break in text mode (no arguments)
                    259: .It Sx \&sp Ta force vertical space: Op Ar height
                    260: .It Sx fi , nf Ta fill mode and no-fill mode (no arguments)
                    261: .It Sx in Ta additional indent: Op Ar width
                    262: .El
                    263: .Ss Physical markup
                    264: .Bl -column "PP, LP, P" description
                    265: .It Sx B Ta boldface font
                    266: .It Sx I Ta italic font
                    267: .It Sx R Ta roman (default) font
                    268: .It Sx SB Ta small boldface font
                    269: .It Sx SM Ta small roman font
                    270: .It Sx BI Ta alternate between boldface and italic fonts
                    271: .It Sx BR Ta alternate between boldface and roman fonts
                    272: .It Sx IB Ta alternate between italic and boldface fonts
                    273: .It Sx IR Ta alternate between italic and roman fonts
                    274: .It Sx RB Ta alternate between roman and boldface fonts
                    275: .It Sx RI Ta alternate between roman and italic fonts
                    276: .El
1.111     schwarze  277: .Sh MACRO REFERENCE
1.22      kristaps  278: This section is a canonical reference to all macros, arranged
1.68      kristaps  279: alphabetically.
                    280: For the scoping of individual macros, see
1.32      kristaps  281: .Sx MACRO SYNTAX .
1.72      joerg     282: .Ss \&AT
                    283: Sets the volume for the footer for compatibility with man pages from
1.123   ! schwarze  284: .At
1.72      joerg     285: releases.
                    286: The optional arguments specify which release it is from.
1.39      kristaps  287: .Ss \&B
1.22      kristaps  288: Text is rendered in bold face.
1.44      kristaps  289: .Pp
                    290: See also
1.92      kristaps  291: .Sx \&I
1.44      kristaps  292: and
1.92      kristaps  293: .Sx \&R .
1.39      kristaps  294: .Ss \&BI
1.68      kristaps  295: Text is rendered alternately in bold face and italic.
                    296: Thus,
1.32      kristaps  297: .Sq .BI this word and that
1.22      kristaps  298: causes
1.32      kristaps  299: .Sq this
1.22      kristaps  300: and
1.32      kristaps  301: .Sq and
1.55      kristaps  302: to render in bold face, while
1.32      kristaps  303: .Sq word
1.22      kristaps  304: and
1.32      kristaps  305: .Sq that
1.68      kristaps  306: render in italics.
                    307: Whitespace between arguments is omitted in output.
1.44      kristaps  308: .Pp
                    309: Examples:
1.46      kristaps  310: .Pp
1.93      kristaps  311: .Dl \&.BI bold italic bold italic
1.44      kristaps  312: .Pp
                    313: The output of this example will be emboldened
                    314: .Dq bold
                    315: and italicised
                    316: .Dq italic ,
                    317: with spaces stripped between arguments.
                    318: .Pp
                    319: See also
                    320: .Sx \&IB ,
                    321: .Sx \&BR ,
                    322: .Sx \&RB ,
                    323: .Sx \&RI ,
                    324: and
                    325: .Sx \&IR .
1.39      kristaps  326: .Ss \&BR
1.22      kristaps  327: Text is rendered alternately in bold face and roman (the default font).
                    328: Whitespace between arguments is omitted in output.
1.44      kristaps  329: .Pp
                    330: See
                    331: .Sx \&BI
                    332: for an equivalent example.
                    333: .Pp
                    334: See also
                    335: .Sx \&BI ,
                    336: .Sx \&IB ,
                    337: .Sx \&RB ,
                    338: .Sx \&RI ,
                    339: and
                    340: .Sx \&IR .
1.39      kristaps  341: .Ss \&DT
1.68      kristaps  342: Has no effect.
                    343: Included for compatibility.
1.116     schwarze  344: .Ss \&EE
                    345: This is a non-standard GNU extension, included only for compatibility.
                    346: In
                    347: .Xr mandoc 1 ,
                    348: it does the same as
                    349: .Sx \&fi .
                    350: .Ss \&EX
                    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 \&nf .
1.39      kristaps  356: .Ss \&HP
1.23      kristaps  357: Begin a paragraph whose initial output line is left-justified, but
1.27      kristaps  358: subsequent output lines are indented, with the following syntax:
1.44      kristaps  359: .Bd -filled -offset indent
                    360: .Pf \. Sx \&HP
                    361: .Op Cm width
1.32      kristaps  362: .Ed
1.44      kristaps  363: .Pp
                    364: The
                    365: .Cm width
1.117     schwarze  366: argument is a
                    367: .Xr roff 7
                    368: scaling width.
1.44      kristaps  369: If specified, it's saved for later paragraph left-margins; if unspecified, the
                    370: saved or default width is used.
                    371: .Pp
                    372: See also
1.45      kristaps  373: .Sx \&IP ,
                    374: .Sx \&LP ,
                    375: .Sx \&P ,
                    376: .Sx \&PP ,
1.44      kristaps  377: and
1.45      kristaps  378: .Sx \&TP .
1.39      kristaps  379: .Ss \&I
1.22      kristaps  380: Text is rendered in italics.
1.44      kristaps  381: .Pp
                    382: See also
1.92      kristaps  383: .Sx \&B
1.44      kristaps  384: and
1.92      kristaps  385: .Sx \&R .
1.39      kristaps  386: .Ss \&IB
1.80      kristaps  387: Text is rendered alternately in italics and bold face.
                    388: Whitespace between arguments is omitted in output.
1.44      kristaps  389: .Pp
                    390: See
                    391: .Sx \&BI
                    392: for an equivalent example.
                    393: .Pp
                    394: See also
                    395: .Sx \&BI ,
                    396: .Sx \&BR ,
                    397: .Sx \&RB ,
                    398: .Sx \&RI ,
                    399: and
                    400: .Sx \&IR .
1.39      kristaps  401: .Ss \&IP
1.44      kristaps  402: Begin an indented paragraph with the following syntax:
                    403: .Bd -filled -offset indent
                    404: .Pf \. Sx \&IP
                    405: .Op Cm head Op Cm width
1.32      kristaps  406: .Ed
1.44      kristaps  407: .Pp
                    408: The
                    409: .Cm width
1.117     schwarze  410: argument is a
                    411: .Xr roff 7
                    412: scaling width defining the left margin.
1.44      kristaps  413: It's saved for later paragraph left-margins; if unspecified, the saved or
                    414: default width is used.
                    415: .Pp
                    416: The
                    417: .Cm head
1.68      kristaps  418: argument is used as a leading term, flushed to the left margin.
                    419: This is useful for bulleted paragraphs and so on.
1.44      kristaps  420: .Pp
                    421: See also
1.45      kristaps  422: .Sx \&HP ,
                    423: .Sx \&LP ,
                    424: .Sx \&P ,
                    425: .Sx \&PP ,
1.44      kristaps  426: and
1.45      kristaps  427: .Sx \&TP .
1.39      kristaps  428: .Ss \&IR
1.22      kristaps  429: Text is rendered alternately in italics and roman (the default font).
                    430: Whitespace between arguments is omitted in output.
1.44      kristaps  431: .Pp
                    432: See
                    433: .Sx \&BI
                    434: for an equivalent example.
                    435: .Pp
                    436: See also
                    437: .Sx \&BI ,
                    438: .Sx \&IB ,
                    439: .Sx \&BR ,
                    440: .Sx \&RB ,
                    441: and
                    442: .Sx \&RI .
1.39      kristaps  443: .Ss \&LP
1.68      kristaps  444: Begin an undecorated paragraph.
                    445: The scope of a paragraph is closed by a subsequent paragraph,
                    446: sub-section, section, or end of file.
1.78      schwarze  447: The saved paragraph left-margin width is reset to the default.
1.44      kristaps  448: .Pp
                    449: See also
1.45      kristaps  450: .Sx \&HP ,
                    451: .Sx \&IP ,
                    452: .Sx \&P ,
                    453: .Sx \&PP ,
1.44      kristaps  454: and
1.45      kristaps  455: .Sx \&TP .
1.113     kristaps  456: .Ss \&OP
                    457: Optional command-line argument.
1.114     schwarze  458: This is a non-standard GNU extension, included only for compatibility.
                    459: It has the following syntax:
1.113     kristaps  460: .Bd -filled -offset indent
                    461: .Pf \. Sx \&OP
                    462: .Cm key Op Cm value
                    463: .Ed
                    464: .Pp
                    465: The
                    466: .Cm key
                    467: is usually a command-line flag and
                    468: .Cm value
                    469: its argument.
1.39      kristaps  470: .Ss \&P
                    471: Synonym for
                    472: .Sx \&LP .
1.44      kristaps  473: .Pp
                    474: See also
1.45      kristaps  475: .Sx \&HP ,
                    476: .Sx \&IP ,
                    477: .Sx \&LP ,
                    478: .Sx \&PP ,
1.118     schwarze  479: and
                    480: .Sx \&TP .
                    481: .Ss \&PD
                    482: Specify the vertical space to be inserted before each new paragraph.
                    483: .br
                    484: The syntax is as follows:
                    485: .Bd -filled -offset indent
                    486: .Pf \. Sx \&PD
                    487: .Op Cm height
                    488: .Ed
                    489: .Pp
                    490: The
                    491: .Cm height
                    492: argument is a
                    493: .Xr roff 7
                    494: scaling width.
                    495: It defaults to
                    496: .Cm 1v .
                    497: If the unit is omitted,
                    498: .Cm v
                    499: is assumed.
                    500: .Pp
                    501: This macro affects the spacing before any subsequent instances of
                    502: .Sx \&HP ,
                    503: .Sx \&IP ,
                    504: .Sx \&LP ,
                    505: .Sx \&P ,
                    506: .Sx \&PP ,
                    507: .Sx \&SH ,
                    508: .Sx \&SS ,
1.44      kristaps  509: and
1.45      kristaps  510: .Sx \&TP .
1.39      kristaps  511: .Ss \&PP
                    512: Synonym for
                    513: .Sx \&LP .
1.44      kristaps  514: .Pp
                    515: See also
1.45      kristaps  516: .Sx \&HP ,
                    517: .Sx \&IP ,
                    518: .Sx \&LP ,
                    519: .Sx \&P ,
1.44      kristaps  520: and
1.45      kristaps  521: .Sx \&TP .
1.39      kristaps  522: .Ss \&R
1.22      kristaps  523: Text is rendered in roman (the default font).
1.44      kristaps  524: .Pp
                    525: See also
1.92      kristaps  526: .Sx \&I
1.44      kristaps  527: and
1.92      kristaps  528: .Sx \&B .
1.39      kristaps  529: .Ss \&RB
1.22      kristaps  530: Text is rendered alternately in roman (the default font) and bold face.
                    531: Whitespace between arguments is omitted in output.
1.44      kristaps  532: .Pp
                    533: See
                    534: .Sx \&BI
                    535: for an equivalent example.
                    536: .Pp
                    537: See also
                    538: .Sx \&BI ,
                    539: .Sx \&IB ,
                    540: .Sx \&BR ,
                    541: .Sx \&RI ,
                    542: and
                    543: .Sx \&IR .
1.39      kristaps  544: .Ss \&RE
1.30      kristaps  545: Explicitly close out the scope of a prior
1.39      kristaps  546: .Sx \&RS .
1.102     kristaps  547: The default left margin is restored to the state of the original
                    548: .Sx \&RS
                    549: invocation.
1.39      kristaps  550: .Ss \&RI
1.22      kristaps  551: Text is rendered alternately in roman (the default font) and italics.
                    552: Whitespace between arguments is omitted in output.
1.44      kristaps  553: .Pp
                    554: See
                    555: .Sx \&BI
                    556: for an equivalent example.
                    557: .Pp
                    558: See also
                    559: .Sx \&BI ,
                    560: .Sx \&IB ,
                    561: .Sx \&BR ,
                    562: .Sx \&RB ,
                    563: and
                    564: .Sx \&IR .
1.39      kristaps  565: .Ss \&RS
1.102     kristaps  566: Temporarily reset the default left margin.
1.44      kristaps  567: This has the following syntax:
                    568: .Bd -filled -offset indent
1.102     kristaps  569: .Pf \. Sx \&RS
1.44      kristaps  570: .Op Cm width
1.32      kristaps  571: .Ed
1.44      kristaps  572: .Pp
                    573: The
                    574: .Cm width
1.117     schwarze  575: argument is a
                    576: .Xr roff 7
                    577: scaling width.
1.55      kristaps  578: If not specified, the saved or default width is used.
1.102     kristaps  579: .Pp
                    580: See also
                    581: .Sx \&RE .
1.39      kristaps  582: .Ss \&SB
1.22      kristaps  583: Text is rendered in small size (one point smaller than the default font)
                    584: bold face.
1.39      kristaps  585: .Ss \&SH
1.68      kristaps  586: Begin a section.
                    587: The scope of a section is only closed by another section or the end of
                    588: file.
1.78      schwarze  589: The paragraph left-margin width is reset to the default.
1.39      kristaps  590: .Ss \&SM
1.22      kristaps  591: Text is rendered in small size (one point smaller than the default
                    592: font).
1.39      kristaps  593: .Ss \&SS
1.68      kristaps  594: Begin a sub-section.
                    595: The scope of a sub-section is closed by a subsequent sub-section,
                    596: section, or end of file.
1.78      schwarze  597: The paragraph left-margin width is reset to the default.
1.39      kristaps  598: .Ss \&TH
1.22      kristaps  599: Sets the title of the manual page with the following syntax:
1.44      kristaps  600: .Bd -filled -offset indent
                    601: .Pf \. Sx \&TH
1.99      schwarze  602: .Ar title section date
                    603: .Op Ar source Op Ar volume
1.44      kristaps  604: .Ed
1.43      kristaps  605: .Pp
1.99      schwarze  606: Conventionally, the document
                    607: .Ar title
                    608: is given in all caps.
                    609: The recommended
                    610: .Ar date
                    611: format is
                    612: .Sy YYYY-MM-DD
                    613: as specified in the ISO-8601 standard;
                    614: if the argument does not conform, it is printed verbatim.
                    615: If the
                    616: .Ar date
                    617: is empty or not specified, the current date is used.
                    618: The optional
                    619: .Ar source
1.68      kristaps  620: string specifies the organisation providing the utility.
                    621: The
1.99      schwarze  622: .Ar volume
1.43      kristaps  623: string replaces the default rendered volume, which is dictated by the
                    624: manual section.
                    625: .Pp
                    626: Examples:
1.46      kristaps  627: .Pp
1.93      kristaps  628: .Dl \&.TH CVS 5 "1992-02-12" GNU
1.39      kristaps  629: .Ss \&TP
1.25      kristaps  630: Begin a paragraph where the head, if exceeding the indentation width, is
1.24      kristaps  631: followed by a newline; if not, the body follows on the same line after a
1.68      kristaps  632: buffer to the indentation width.
                    633: Subsequent output lines are indented.
1.44      kristaps  634: The syntax is as follows:
                    635: .Bd -filled -offset indent
                    636: .Pf \. Sx \&TP
                    637: .Op Cm width
1.32      kristaps  638: .Ed
                    639: .Pp
1.44      kristaps  640: The
                    641: .Cm width
1.117     schwarze  642: argument is a
                    643: .Xr roff 7
                    644: scaling width.
1.44      kristaps  645: If specified, it's saved for later paragraph left-margins; if
1.27      kristaps  646: unspecified, the saved or default width is used.
1.44      kristaps  647: .Pp
                    648: See also
1.45      kristaps  649: .Sx \&HP ,
                    650: .Sx \&IP ,
                    651: .Sx \&LP ,
                    652: .Sx \&P ,
1.44      kristaps  653: and
1.45      kristaps  654: .Sx \&PP .
1.72      joerg     655: .Ss \&UC
                    656: Sets the volume for the footer for compatibility with man pages from
1.120     schwarze  657: .Bx
                    658: releases.
1.72      joerg     659: The optional first argument specifies which release it is from.
1.121     schwarze  660: .Ss \&UE
                    661: End a uniform resource identifier block.
                    662: This is a non-standard GNU extension, included only for compatibility.
                    663: See
                    664: .Sx \&UE .
                    665: .Ss \&UR
                    666: Begin a uniform resource identifier block.
                    667: This is a non-standard GNU extension, included only for compatibility.
                    668: It has the following syntax:
                    669: .Bd -literal -offset indent
                    670: .Pf \. Sx \&UR Ar uri
                    671: link description to be shown
                    672: .Pf \. Sx UE
                    673: .Ed
1.39      kristaps  674: .Ss \&br
1.68      kristaps  675: Breaks the current line.
                    676: Consecutive invocations have no further effect.
1.44      kristaps  677: .Pp
                    678: See also
                    679: .Sx \&sp .
1.39      kristaps  680: .Ss \&fi
1.22      kristaps  681: End literal mode begun by
1.39      kristaps  682: .Sx \&nf .
1.91      kristaps  683: .Ss \&ft
                    684: Change the current font mode.
                    685: See
                    686: .Sx Text Decoration
                    687: for a listing of available font modes.
1.79      kristaps  688: .Ss \&in
                    689: Indent relative to the current indentation:
                    690: .Pp
                    691: .D1 Pf \. Sx \&in Op Cm width
                    692: .Pp
                    693: If
                    694: .Cm width
                    695: is signed, the new offset is relative.
                    696: Otherwise, it is absolute.
                    697: This value is reset upon the next paragraph, section, or sub-section.
1.39      kristaps  698: .Ss \&na
1.36      kristaps  699: Don't align to the right margin.
1.39      kristaps  700: .Ss \&nf
1.22      kristaps  701: Begin literal mode: all subsequent free-form lines have their end of
1.68      kristaps  702: line boundaries preserved.
                    703: May be ended by
1.39      kristaps  704: .Sx \&fi .
1.101     kristaps  705: Literal mode is implicitly ended by
                    706: .Sx \&SH
                    707: or
                    708: .Sx \&SS .
1.39      kristaps  709: .Ss \&sp
1.44      kristaps  710: Insert vertical spaces into output with the following syntax:
                    711: .Bd -filled -offset indent
                    712: .Pf \. Sx \&sp
                    713: .Op Cm height
                    714: .Ed
                    715: .Pp
1.117     schwarze  716: The
1.44      kristaps  717: .Cm height
1.117     schwarze  718: argument is a scaling width as described in
                    719: .Xr roff 7 .
1.44      kristaps  720: If 0, this is equivalent to the
1.39      kristaps  721: .Sx \&br
1.68      kristaps  722: macro.
                    723: Defaults to 1, if unspecified.
1.44      kristaps  724: .Pp
                    725: See also
                    726: .Sx \&br .
1.111     schwarze  727: .Sh MACRO SYNTAX
                    728: The
                    729: .Nm
                    730: macros are classified by scope: line scope or block scope.
                    731: Line macros are only scoped to the current line (and, in some
                    732: situations, the subsequent line).
                    733: Block macros are scoped to the current line and subsequent lines until
                    734: closed by another block macro.
                    735: .Ss Line Macros
                    736: Line macros are generally scoped to the current line, with the body
                    737: consisting of zero or more arguments.
                    738: If a macro is scoped to the next line and the line arguments are empty,
                    739: the next line, which must be text, is used instead.
                    740: Thus:
                    741: .Bd -literal -offset indent
                    742: \&.I
                    743: foo
                    744: .Ed
                    745: .Pp
                    746: is equivalent to
                    747: .Sq \&.I foo .
                    748: If next-line macros are invoked consecutively, only the last is used.
                    749: If a next-line macro is followed by a non-next-line macro, an error is
                    750: raised, except for
                    751: .Sx \&br ,
                    752: .Sx \&sp ,
                    753: and
                    754: .Sx \&na .
                    755: .Pp
                    756: The syntax is as follows:
                    757: .Bd -literal -offset indent
                    758: \&.YO \(lBbody...\(rB
                    759: \(lBbody...\(rB
                    760: .Ed
                    761: .Bl -column "MacroX" "ArgumentsX" "ScopeXXXXX" "CompatX" -offset indent
                    762: .It Em Macro Ta Em Arguments Ta Em Scope     Ta Em Notes
                    763: .It Sx \&AT  Ta    <=1       Ta    current   Ta    \&
                    764: .It Sx \&B   Ta    n         Ta    next-line Ta    \&
                    765: .It Sx \&BI  Ta    n         Ta    current   Ta    \&
                    766: .It Sx \&BR  Ta    n         Ta    current   Ta    \&
                    767: .It Sx \&DT  Ta    0         Ta    current   Ta    \&
1.121     schwarze  768: .It Sx \&EE  Ta    0         Ta    current   Ta    compat
                    769: .It Sx \&EX  Ta    0         Ta    current   Ta    compat
1.111     schwarze  770: .It Sx \&I   Ta    n         Ta    next-line Ta    \&
                    771: .It Sx \&IB  Ta    n         Ta    current   Ta    \&
                    772: .It Sx \&IR  Ta    n         Ta    current   Ta    \&
1.113     kristaps  773: .It Sx \&OP  Ta    0, 1      Ta    current   Ta    compat
1.121     schwarze  774: .It Sx \&PD  Ta    1         Ta    current   Ta    \&
1.111     schwarze  775: .It Sx \&R   Ta    n         Ta    next-line Ta    \&
                    776: .It Sx \&RB  Ta    n         Ta    current   Ta    \&
                    777: .It Sx \&RI  Ta    n         Ta    current   Ta    \&
                    778: .It Sx \&SB  Ta    n         Ta    next-line Ta    \&
                    779: .It Sx \&SM  Ta    n         Ta    next-line Ta    \&
                    780: .It Sx \&TH  Ta    >1, <6    Ta    current   Ta    \&
                    781: .It Sx \&UC  Ta    <=1       Ta    current   Ta    \&
                    782: .It Sx \&br  Ta    0         Ta    current   Ta    compat
                    783: .It Sx \&fi  Ta    0         Ta    current   Ta    compat
                    784: .It Sx \&ft  Ta    1         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