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

Annotation of mandoc/roff.7, Revision 1.53

1.53    ! schwarze    1: .\"    $Id: roff.7,v 1.52 2014/04/05 20:34:57 schwarze Exp $
1.1       kristaps    2: .\"
1.46      schwarze    3: .\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
1.47      schwarze    4: .\" Copyright (c) 2010, 2011, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
1.1       kristaps    5: .\"
                      6: .\" Permission to use, copy, modify, and distribute this software for any
                      7: .\" purpose with or without fee is hereby granted, provided that the above
                      8: .\" copyright notice and this permission notice appear in all copies.
                      9: .\"
                     10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     11: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     12: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     13: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     14: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     15: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     16: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     17: .\"
1.53    ! schwarze   18: .Dd $Mdocdate: April 5 2014 $
1.1       kristaps   19: .Dt ROFF 7
                     20: .Os
                     21: .Sh NAME
                     22: .Nm roff
1.17      schwarze   23: .Nd roff language reference for mandoc
1.1       kristaps   24: .Sh DESCRIPTION
                     25: The
                     26: .Nm roff
1.17      schwarze   27: language is a general purpose text formatting language.
1.33      schwarze   28: Since traditional implementations of the
1.17      schwarze   29: .Xr mdoc 7
                     30: and
                     31: .Xr man 7
1.33      schwarze   32: manual formatting languages are based on it,
                     33: many real-world manuals use small numbers of
1.17      schwarze   34: .Nm
1.46      schwarze   35: requests and escape sequences intermixed with their
1.33      schwarze   36: .Xr mdoc 7
                     37: or
                     38: .Xr man 7
                     39: code.
                     40: To properly format such manuals, the
1.1       kristaps   41: .Xr mandoc 1
1.33      schwarze   42: utility supports a tiny subset of
                     43: .Nm
1.46      schwarze   44: requests and escapes.
                     45: Only these requests and escapes supported by
1.33      schwarze   46: .Xr mandoc 1
                     47: are documented in the present manual,
                     48: together with the basic language syntax shared by
                     49: .Nm ,
                     50: .Xr mdoc 7 ,
                     51: and
                     52: .Xr man 7 .
                     53: For complete
                     54: .Nm
                     55: manuals, consult the
                     56: .Sx SEE ALSO
                     57: section.
1.1       kristaps   58: .Pp
1.33      schwarze   59: Input lines beginning with the control character
1.17      schwarze   60: .Sq \&.
1.33      schwarze   61: are parsed for requests and macros.
                     62: Such lines are called
                     63: .Dq request lines
1.1       kristaps   64: or
1.33      schwarze   65: .Dq macro lines ,
                     66: respectively.
                     67: Requests change the processing state and manipulate the formatting;
                     68: some macros also define the document structure and produce formatted
                     69: output.
                     70: The single quote
                     71: .Pq Qq \(aq
                     72: is accepted as an alternative control character,
                     73: treated by
                     74: .Xr mandoc 1
                     75: just like
                     76: .Ql \&.
                     77: .Pp
                     78: Lines not beginning with control characters are called
                     79: .Dq text lines .
                     80: They provide free-form text to be printed; the formatting of the text
                     81: depends on the respective processing context.
1.1       kristaps   82: .Sh LANGUAGE SYNTAX
                     83: .Nm
                     84: documents may contain only graphable 7-bit ASCII characters, the space
1.17      schwarze   85: character, and, in certain circumstances, the tab character.
1.38      kristaps   86: The backslash character
1.33      schwarze   87: .Sq \e
1.46      schwarze   88: indicates the start of an escape sequence, used for example for
1.33      schwarze   89: .Sx Comments ,
                     90: .Sx Special Characters ,
                     91: .Sx Predefined Strings ,
                     92: and
                     93: user-defined strings defined using the
                     94: .Sx ds
                     95: request.
1.46      schwarze   96: For a listing of escape sequences, consult the
                     97: .Sx ESCAPE SEQUENCE REFERENCE
                     98: below.
1.33      schwarze   99: .Ss Comments
                    100: Text following an escaped double-quote
                    101: .Sq \e\(dq ,
                    102: whether in a request, macro, or text line, is ignored to the end of the line.
                    103: A request line beginning with a control character and comment escape
                    104: .Sq \&.\e\(dq
                    105: is also ignored.
                    106: Furthermore, request lines with only a control character and optional
                    107: trailing whitespace are stripped from input.
                    108: .Pp
                    109: Examples:
                    110: .Bd -literal -offset indent -compact
                    111: \&.\e\(dq This is a comment line.
                    112: \&.\e\(dq The next line is ignored:
                    113: \&.
                    114: \&.Sh EXAMPLES \e\(dq This is a comment, too.
                    115: \&example text \e\(dq And so is this.
                    116: .Ed
                    117: .Ss Special Characters
                    118: Special characters are used to encode special glyphs and are rendered
                    119: differently across output media.
                    120: They may occur in request, macro, and text lines.
                    121: Sequences begin with the escape character
                    122: .Sq \e
                    123: followed by either an open-parenthesis
                    124: .Sq \&(
                    125: for two-character sequences; an open-bracket
                    126: .Sq \&[
                    127: for n-character sequences (terminated at a close-bracket
                    128: .Sq \&] ) ;
                    129: or a single one character sequence.
                    130: .Pp
                    131: Examples:
                    132: .Bl -tag -width Ds -offset indent -compact
                    133: .It Li \e(em
                    134: Two-letter em dash escape.
                    135: .It Li \ee
                    136: One-letter backslash escape.
                    137: .El
                    138: .Pp
                    139: See
1.17      schwarze  140: .Xr mandoc_char 7
1.33      schwarze  141: for a complete list.
                    142: .Ss Text Decoration
                    143: Terms may be text-decorated using the
                    144: .Sq \ef
                    145: escape followed by an indicator: B (bold), I (italic), R (regular), or P
                    146: (revert to previous mode).
                    147: A numerical representation 3, 2, or 1 (bold, italic, and regular,
                    148: respectively) may be used instead.
1.34      kristaps  149: The indicator or numerical representative may be preceded by C
                    150: (constant-width), which is ignored.
1.33      schwarze  151: .Pp
1.42      schwarze  152: The two-character indicator
                    153: .Sq BI
                    154: requests a font that is both bold and italic.
                    155: It may not be portable to old roff implementations.
                    156: .Pp
1.33      schwarze  157: Examples:
                    158: .Bl -tag -width Ds -offset indent -compact
                    159: .It Li \efBbold\efR
1.42      schwarze  160: Write in \fBbold\fP, then switch to regular font mode.
1.33      schwarze  161: .It Li \efIitalic\efP
1.42      schwarze  162: Write in \fIitalic\fP, then return to previous font mode.
                    163: .It Li \ef(BIbold italic\efP
                    164: Write in \f(BIbold italic\fP, then return to previous font mode.
1.33      schwarze  165: .El
                    166: .Pp
                    167: Text decoration is
                    168: .Em not
                    169: recommended for
                    170: .Xr mdoc 7 ,
                    171: which encourages semantic annotation.
                    172: .Ss Predefined Strings
                    173: Predefined strings, like
                    174: .Sx Special Characters ,
                    175: mark special output glyphs.
                    176: Predefined strings are escaped with the slash-asterisk,
                    177: .Sq \e* :
                    178: single-character
                    179: .Sq \e*X ,
                    180: two-character
                    181: .Sq \e*(XX ,
                    182: and N-character
                    183: .Sq \e*[N] .
                    184: .Pp
                    185: Examples:
                    186: .Bl -tag -width Ds -offset indent -compact
                    187: .It Li \e*(Am
                    188: Two-letter ampersand predefined string.
                    189: .It Li \e*q
                    190: One-letter double-quote predefined string.
                    191: .El
                    192: .Pp
                    193: Predefined strings are not recommended for use,
                    194: as they differ across implementations.
                    195: Those supported by
                    196: .Xr mandoc 1
                    197: are listed in
                    198: .Xr mandoc_char 7 .
                    199: Manuals using these predefined strings are almost certainly not portable.
                    200: .Ss Whitespace
                    201: Whitespace consists of the space character.
                    202: In text lines, whitespace is preserved within a line.
                    203: In request and macro lines, whitespace delimits arguments and is discarded.
                    204: .Pp
                    205: Unescaped trailing spaces are stripped from text line input unless in a
                    206: literal context.
                    207: In general, trailing whitespace on any input line is discouraged for
                    208: reasons of portability.
                    209: In the rare case that a blank character is needed at the end of an
                    210: input line, it may be forced by
                    211: .Sq \e\ \e& .
                    212: .Pp
                    213: Literal space characters can be produced in the output
                    214: using escape sequences.
                    215: In macro lines, they can also be included in arguments using quotation; see
                    216: .Sx MACRO SYNTAX
                    217: for details.
                    218: .Pp
                    219: Blank text lines, which may include whitespace, are only permitted
                    220: within literal contexts.
                    221: If the first character of a text line is a space, that line is printed
                    222: with a leading newline.
                    223: .Ss Scaling Widths
                    224: Many requests and macros support scaled widths for their arguments.
                    225: The syntax for a scaled width is
                    226: .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
                    227: where a decimal must be preceded or followed by at least one digit.
                    228: Negative numbers, while accepted, are truncated to zero.
                    229: .Pp
                    230: The following scaling units are accepted:
                    231: .Pp
                    232: .Bl -tag -width Ds -offset indent -compact
                    233: .It c
                    234: centimetre
                    235: .It i
                    236: inch
                    237: .It P
                    238: pica (~1/6 inch)
                    239: .It p
                    240: point (~1/72 inch)
                    241: .It f
                    242: synonym for
                    243: .Sq u
                    244: .It v
                    245: default vertical span
                    246: .It m
                    247: width of rendered
                    248: .Sq m
                    249: .Pq em
                    250: character
                    251: .It n
                    252: width of rendered
                    253: .Sq n
                    254: .Pq en
                    255: character
                    256: .It u
                    257: default horizontal span
                    258: .It M
                    259: mini-em (~1/100 em)
                    260: .El
                    261: .Pp
                    262: Using anything other than
                    263: .Sq m ,
                    264: .Sq n ,
                    265: .Sq u ,
                    266: or
                    267: .Sq v
                    268: is necessarily non-portable across output media.
                    269: See
                    270: .Sx COMPATIBILITY .
                    271: .Pp
                    272: If a scaling unit is not provided, the numerical value is interpreted
                    273: under the default rules of
                    274: .Sq v
                    275: for vertical spaces and
                    276: .Sq u
                    277: for horizontal ones.
                    278: .Pp
                    279: Examples:
                    280: .Bl -tag -width ".Bl -tag -width 2i" -offset indent -compact
                    281: .It Li \&.Bl -tag -width 2i
                    282: two-inch tagged list indentation in
                    283: .Xr mdoc 7
                    284: .It Li \&.HP 2i
                    285: two-inch tagged list indentation in
                    286: .Xr man 7
                    287: .It Li \&.sp 2v
                    288: two vertical spaces
                    289: .El
                    290: .Ss Sentence Spacing
                    291: Each sentence should terminate at the end of an input line.
                    292: By doing this, a formatter will be able to apply the proper amount of
                    293: spacing after the end of sentence (unescaped) period, exclamation mark,
                    294: or question mark followed by zero or more non-sentence closing
                    295: delimiters
                    296: .Po
                    297: .Sq \&) ,
                    298: .Sq \&] ,
                    299: .Sq \&' ,
                    300: .Sq \&"
                    301: .Pc .
                    302: .Pp
                    303: The proper spacing is also intelligently preserved if a sentence ends at
                    304: the boundary of a macro line.
                    305: .Pp
                    306: Examples:
                    307: .Bd -literal -offset indent -compact
                    308: Do not end sentences mid-line like this.  Instead,
                    309: end a sentence like this.
                    310: A macro would end like this:
                    311: \&.Xr mandoc 1 \&.
                    312: .Ed
1.17      schwarze  313: .Sh REQUEST SYNTAX
                    314: A request or macro line consists of:
                    315: .Pp
                    316: .Bl -enum -compact
                    317: .It
                    318: the control character
                    319: .Sq \&.
1.1       kristaps  320: or
1.17      schwarze  321: .Sq \(aq
                    322: at the beginning of the line,
                    323: .It
                    324: optionally an arbitrary amount of whitespace,
                    325: .It
                    326: the name of the request or the macro, which is one word of arbitrary
                    327: length, terminated by whitespace,
                    328: .It
                    329: and zero or more arguments delimited by whitespace.
                    330: .El
                    331: .Pp
                    332: Thus, the following request lines are all equivalent:
1.1       kristaps  333: .Bd -literal -offset indent
1.17      schwarze  334: \&.ig end
                    335: \&.ig    end
                    336: \&.   ig end
1.1       kristaps  337: .Ed
1.24      schwarze  338: .Sh MACRO SYNTAX
1.33      schwarze  339: Macros are provided by the
                    340: .Xr mdoc 7
                    341: and
                    342: .Xr man 7
                    343: languages and can be defined by the
1.24      schwarze  344: .Sx \&de
                    345: request.
                    346: When called, they follow the same syntax as requests, except that
                    347: macro arguments may optionally be quoted by enclosing them
                    348: in double quote characters
                    349: .Pq Sq \(dq .
1.33      schwarze  350: Quoted text, even if it contains whitespace or would cause
                    351: a macro invocation when unquoted, is always considered literal text.
                    352: Inside quoted text, pairs of double quote characters
                    353: .Pq Sq Qq
                    354: resolve to single double quote characters.
                    355: .Pp
1.32      kristaps  356: To be recognised as the beginning of a quoted argument, the opening
1.24      schwarze  357: quote character must be preceded by a space character.
                    358: A quoted argument extends to the next double quote character that is not
                    359: part of a pair, or to the end of the input line, whichever comes earlier.
                    360: Leaving out the terminating double quote character at the end of the line
                    361: is discouraged.
                    362: For clarity, if more arguments follow on the same input line,
                    363: it is recommended to follow the terminating double quote character
                    364: by a space character; in case the next character after the terminating
                    365: double quote character is anything else, it is regarded as the beginning
                    366: of the next, unquoted argument.
                    367: .Pp
                    368: Both in quoted and unquoted arguments, pairs of backslashes
                    369: .Pq Sq \e\e
                    370: resolve to single backslashes.
                    371: In unquoted arguments, space characters can alternatively be included
                    372: by preceding them with a backslash
                    373: .Pq Sq \e\~ ,
                    374: but quoting is usually better for clarity.
1.33      schwarze  375: .Pp
                    376: Examples:
                    377: .Bl -tag -width Ds -offset indent -compact
                    378: .It Li .Fn strlen \(dqconst char *s\(dq
                    379: Group arguments
                    380: .Qq const char *s
                    381: into one function argument.
                    382: If unspecified,
                    383: .Qq const ,
                    384: .Qq char ,
                    385: and
                    386: .Qq *s
                    387: would be considered separate arguments.
                    388: .It Li .Op \(dqFl a\(dq
                    389: Consider
                    390: .Qq \&Fl a
                    391: as literal text instead of a flag macro.
                    392: .El
1.15      kristaps  393: .Sh REQUEST REFERENCE
1.17      schwarze  394: The
1.15      kristaps  395: .Xr mandoc 1
                    396: .Nm
1.32      kristaps  397: parser recognises the following requests.
1.17      schwarze  398: Note that the
1.15      kristaps  399: .Nm
1.17      schwarze  400: language defines many more requests not implemented in
1.15      kristaps  401: .Xr mandoc 1 .
                    402: .Ss \&ad
                    403: Set line adjustment mode.
                    404: This line-scoped request is intended to have one argument to select
1.32      kristaps  405: normal, left, right, or centre adjustment for subsequent text.
1.15      kristaps  406: Currently, it is ignored including its arguments,
                    407: and the number of arguments is not checked.
1.3       kristaps  408: .Ss \&am
1.15      kristaps  409: Append to a macro definition.
                    410: The syntax of this request is the same as that of
                    411: .Sx \&de .
                    412: It is currently ignored by
                    413: .Xr mandoc 1 ,
                    414: as are its children.
1.3       kristaps  415: .Ss \&ami
1.15      kristaps  416: Append to a macro definition, specifying the macro name indirectly.
                    417: The syntax of this request is the same as that of
                    418: .Sx \&dei .
                    419: It is currently ignored by
                    420: .Xr mandoc 1 ,
                    421: as are its children.
1.3       kristaps  422: .Ss \&am1
1.15      kristaps  423: Append to a macro definition, switching roff compatibility mode off
                    424: during macro execution.
                    425: The syntax of this request is the same as that of
                    426: .Sx \&de1 .
                    427: It is currently ignored by
                    428: .Xr mandoc 1 ,
                    429: as are its children.
1.47      schwarze  430: .Ss \&as
                    431: Append to a user-defined string.
                    432: The syntax of this request is the same as that of
                    433: .Sx \&ds .
                    434: If a user-defined string with the specified name does not yet exist,
                    435: it is set to the empty string before appending.
1.39      kristaps  436: .Ss \&cc
                    437: Changes the control character.
                    438: Its syntax is as follows:
                    439: .Bd -literal -offset indent
                    440: .Pf . Cm \&cc Op Ar c
                    441: .Ed
                    442: .Pp
                    443: If
                    444: .Ar c
                    445: is not specified, the control character is reset to
                    446: .Sq \&. .
                    447: Trailing characters are ignored.
1.47      schwarze  448: .Ss \&ce
                    449: Center some lines.
                    450: This line-scoped request is intended to take one integer argument,
                    451: specifying how many lines to center.
                    452: Currently, it is ignored including its arguments, and the number
                    453: of arguments is not checked.
1.3       kristaps  454: .Ss \&de
1.17      schwarze  455: Define a
1.15      kristaps  456: .Nm
                    457: macro.
                    458: Its syntax can be either
                    459: .Bd -literal -offset indent
                    460: .Pf . Cm \&de Ar name
                    461: .Ar macro definition
                    462: \&..
                    463: .Ed
                    464: .Pp
                    465: or
                    466: .Bd -literal -offset indent
                    467: .Pf . Cm \&de Ar name Ar end
                    468: .Ar macro definition
                    469: .Pf . Ar end
                    470: .Ed
                    471: .Pp
                    472: Both forms define or redefine the macro
                    473: .Ar name
                    474: to represent the
                    475: .Ar macro definition ,
                    476: which may consist of one or more input lines, including the newline
                    477: characters terminating each line, optionally containing calls to
                    478: .Nm
                    479: requests,
                    480: .Nm
                    481: macros or high-level macros like
                    482: .Xr man 7
                    483: or
                    484: .Xr mdoc 7
                    485: macros, whichever applies to the document in question.
                    486: .Pp
                    487: Specifying a custom
                    488: .Ar end
                    489: macro works in the same way as for
                    490: .Sx \&ig ;
                    491: namely, the call to
                    492: .Sq Pf . Ar end
                    493: first ends the
                    494: .Ar macro definition ,
                    495: and after that, it is also evaluated as a
                    496: .Nm
                    497: request or
                    498: .Nm
                    499: macro, but not as a high-level macro.
                    500: .Pp
1.17      schwarze  501: The macro can be invoked later using the syntax
1.15      kristaps  502: .Pp
                    503: .D1 Pf . Ar name Op Ar argument Op Ar argument ...
                    504: .Pp
1.24      schwarze  505: Regarding argument parsing, see
                    506: .Sx MACRO SYNTAX
                    507: above.
1.15      kristaps  508: .Pp
1.17      schwarze  509: The line invoking the macro will be replaced
1.15      kristaps  510: in the input stream by the
                    511: .Ar macro definition ,
                    512: replacing all occurrences of
                    513: .No \e\e$ Ns Ar N ,
1.17      schwarze  514: where
1.15      kristaps  515: .Ar N
                    516: is a digit, by the
                    517: .Ar N Ns th Ar argument .
                    518: For example,
                    519: .Bd -literal -offset indent
                    520: \&.de ZN
                    521: \efI\e^\e\e$1\e^\efP\e\e$2
                    522: \&..
                    523: \&.ZN XtFree .
                    524: .Ed
                    525: .Pp
                    526: produces
                    527: .Pp
                    528: .D1 \efI\e^XtFree\e^\efP.
                    529: .Pp
                    530: in the input stream, and thus in the output: \fI\^XtFree\^\fP.
                    531: .Pp
1.17      schwarze  532: Since macros and user-defined strings share a common string table,
1.15      kristaps  533: defining a macro
                    534: .Ar name
                    535: clobbers the user-defined string
                    536: .Ar name ,
                    537: and the
                    538: .Ar macro definition
                    539: can also be printed using the
                    540: .Sq \e*
                    541: string interpolation syntax described below
                    542: .Sx ds ,
                    543: but this is rarely useful because every macro definition contains at least
                    544: one explicit newline character.
1.16      schwarze  545: .Pp
                    546: In order to prevent endless recursion, both groff and
                    547: .Xr mandoc 1
                    548: limit the stack depth for expanding macros and strings
                    549: to a large, but finite number.
                    550: Do not rely on the exact value of this limit.
1.3       kristaps  551: .Ss \&dei
1.17      schwarze  552: Define a
1.15      kristaps  553: .Nm
                    554: macro, specifying the macro name indirectly.
1.17      schwarze  555: The syntax of this request is the same as that of
1.15      kristaps  556: .Sx \&de .
                    557: It is currently ignored by
                    558: .Xr mandoc 1 ,
                    559: as are its children.
                    560: .Ss \&de1
1.17      schwarze  561: Define a
1.15      kristaps  562: .Nm
                    563: macro that will be executed with
                    564: .Nm
                    565: compatibility mode switched off during macro execution.
                    566: This is a GNU extension not available in traditional
                    567: .Nm
                    568: implementations and not even in older versions of groff.
                    569: Since
                    570: .Xr mandoc 1
                    571: does not implement
                    572: .Nm
1.17      schwarze  573: compatibility mode at all, it handles this request as an alias for
1.15      kristaps  574: .Sx \&de .
1.6       schwarze  575: .Ss \&ds
1.15      kristaps  576: Define a user-defined string.
1.13      kristaps  577: Its syntax is as follows:
                    578: .Pp
1.15      kristaps  579: .D1 Pf . Cm \&ds Ar name Oo \(dq Oc Ns Ar string
1.13      kristaps  580: .Pp
                    581: The
1.15      kristaps  582: .Ar name
1.13      kristaps  583: and
1.15      kristaps  584: .Ar string
                    585: arguments are space-separated.
                    586: If the
                    587: .Ar string
                    588: begins with a double-quote character, that character will not be part
                    589: of the string.
                    590: All remaining characters on the input line form the
                    591: .Ar string ,
                    592: including whitespace and double-quote characters, even trailing ones.
                    593: .Pp
1.13      kristaps  594: The
1.15      kristaps  595: .Ar string
                    596: can be interpolated into subsequent text by using
                    597: .No \e* Ns Bq Ar name
                    598: for a
                    599: .Ar name
                    600: of arbitrary length, or \e*(NN or \e*N if the length of
                    601: .Ar name
                    602: is two or one characters, respectively.
1.17      schwarze  603: Interpolation can be prevented by escaping the leading backslash;
                    604: that is, an asterisk preceded by an even number of backslashes
                    605: does not trigger string interpolation.
1.15      kristaps  606: .Pp
                    607: Since user-defined strings and macros share a common string table,
                    608: defining a string
                    609: .Ar name
1.17      schwarze  610: clobbers the macro
1.15      kristaps  611: .Ar name ,
                    612: and the
                    613: .Ar name
                    614: used for defining a string can also be invoked as a macro,
                    615: in which case the following input line will be appended to the
                    616: .Ar string ,
                    617: forming a new input line passed to the
                    618: .Nm
                    619: parser.
                    620: For example,
                    621: .Bd -literal -offset indent
                    622: \&.ds badidea .S
                    623: \&.badidea
                    624: H SYNOPSIS
                    625: .Ed
                    626: .Pp
                    627: invokes the
                    628: .Cm SH
                    629: macro when used in a
                    630: .Xr man 7
                    631: document.
                    632: Such abuse is of course strongly discouraged.
1.5       kristaps  633: .Ss \&el
                    634: The
                    635: .Qq else
                    636: half of an if/else conditional.
                    637: Pops a result off the stack of conditional evaluations pushed by
                    638: .Sx \&ie
                    639: and uses it as its conditional.
                    640: If no stack entries are present (e.g., due to no prior
                    641: .Sx \&ie
                    642: calls)
                    643: then false is assumed.
1.17      schwarze  644: The syntax of this request is similar to
1.5       kristaps  645: .Sx \&if
                    646: except that the conditional is missing.
1.27      kristaps  647: .Ss \&EN
                    648: End an equation block.
                    649: See
                    650: .Sx \&EQ .
                    651: .Ss \&EQ
                    652: Begin an equation block.
                    653: See
                    654: .Xr eqn 7
                    655: for a description of the equation language.
1.43      schwarze  656: .Ss \&fam
                    657: Change the font family.
                    658: This line-scoped request is intended to have one argument specifying
                    659: the font family to be selected.
                    660: It is a groff extension, and currently, it is ignored including its
                    661: arguments, and the number of arguments is not checked.
1.49      schwarze  662: .Ss \&ft
                    663: Change the font.
                    664: Its syntax is as follows:
                    665: .Pp
                    666: .D1 Pf . Cm \&ft Op Ar font
                    667: .Pp
                    668: The following
                    669: .Ar font
                    670: arguments are supported:
                    671: .Bl -tag -width 4n -offset indent
                    672: .It Cm B , BI , 3 , 4
                    673: switches to
                    674: .Sy bold
                    675: font
                    676: .It Cm I , 2
                    677: switches to
                    678: .Em underlined
                    679: font
                    680: .It Cm R , CW , 1
                    681: switches to normal font
                    682: .It Cm P No "or no argument"
                    683: switches back to the previous font
                    684: .El
                    685: .Pp
                    686: This request takes effect only locally, may be overridden by macros
                    687: and escape sequences, and is only supported in
                    688: .Xr man 7
                    689: for now.
1.44      schwarze  690: .Ss \&hw
                    691: Specify hyphenation points in words.
                    692: This line-scoped request is currently ignored.
1.15      kristaps  693: .Ss \&hy
                    694: Set automatic hyphenation mode.
                    695: This line-scoped request is currently ignored.
1.5       kristaps  696: .Ss \&ie
                    697: The
                    698: .Qq if
                    699: half of an if/else conditional.
                    700: The result of the conditional is pushed into a stack used by subsequent
                    701: invocations of
                    702: .Sx \&el ,
                    703: which may be separated by any intervening input (or not exist at all).
                    704: Its syntax is equivalent to
                    705: .Sx \&if .
1.1       kristaps  706: .Ss \&if
1.7       schwarze  707: Begins a conditional.
1.48      schwarze  708: This request has the following syntax:
                    709: .Bd -literal -offset indent
                    710: \&.if COND BODY
                    711: .Ed
                    712: .Bd -literal -offset indent
                    713: \&.if COND \e{BODY
                    714: BODY...\e}
                    715: .Ed
                    716: .Bd -literal -offset indent
                    717: \&.if COND \e{\e
                    718: BODY...
                    719: \&.\e}
                    720: .Ed
                    721: .Pp
                    722: COND is a conditional statement.
                    723: Currently,
                    724: .Xr mandoc 1
                    725: supports the following subset of roff conditionals:
                    726: .Bl -bullet
                    727: .It
                    728: If
                    729: .Sq \&!
                    730: is prefixed to COND, the condition is logically inverted.
                    731: .It
                    732: If the first character of COND is
                    733: .Sq n
                    734: .Pq nroff mode
                    735: or
                    736: .Sq o
                    737: .Pq odd page ,
                    738: COND evaluates to true.
                    739: .It
                    740: If the first character of COND is
                    741: .Sq c
                    742: .Pq character available ,
                    743: .Sq d
                    744: .Pq string defined ,
                    745: .Sq e
                    746: .Pq even page ,
                    747: .Sq r
                    748: .Pq register accessed ,
                    749: or
                    750: .Sq t
                    751: .Pq troff mode ,
                    752: COND evaluates to false.
                    753: .It
1.53    ! schwarze  754: If COND starts with a parenthesis or with an optionally signed
        !           755: integer number, it is evaluated according to the rules of
        !           756: .Sx Numerical expressions
        !           757: explained below.
        !           758: It evaluates to true if the the result is positive,
        !           759: or to false if the result is zero or negative.
1.48      schwarze  760: .It
                    761: Otherwise, the first character of COND is regarded as a delimiter
                    762: and COND evaluates to true if the string extending from its first
                    763: to its second occurrence is equal to the string extending from its
                    764: second to its third occurrence.
                    765: .It
                    766: If COND cannot be parsed, it evaluates to false.
                    767: .El
                    768: .Pp
1.3       kristaps  769: If a conditional is false, its children are not processed, but are
                    770: syntactically interpreted to preserve the integrity of the input
                    771: document.
                    772: Thus,
                    773: .Pp
1.17      schwarze  774: .D1 \&.if t .ig
1.3       kristaps  775: .Pp
                    776: will discard the
                    777: .Sq \&.ig ,
                    778: which may lead to interesting results, but
                    779: .Pp
1.17      schwarze  780: .D1 \&.if t .if t \e{\e
1.3       kristaps  781: .Pp
                    782: will continue to syntactically interpret to the block close of the final
                    783: conditional.
                    784: Sub-conditionals, in this case, obviously inherit the truth value of
                    785: the parent.
1.1       kristaps  786: .Pp
                    787: If the BODY section is begun by an escaped brace
                    788: .Sq \e{ ,
1.48      schwarze  789: scope continues until the end of the input line containing the
                    790: matching closing-brace escape sequence
                    791: .Sq \e} .
1.17      schwarze  792: If the BODY is not enclosed in braces, scope continues until
                    793: the end of the line.
1.1       kristaps  794: If the COND is followed by a BODY on the same line, whether after a
1.17      schwarze  795: brace or not, then requests and macros
1.1       kristaps  796: .Em must
                    797: begin with a control character.
                    798: It is generally more intuitive, in this case, to write
                    799: .Bd -literal -offset indent
                    800: \&.if COND \e{\e
                    801: \&.foo
                    802: bar
                    803: \&.\e}
                    804: .Ed
                    805: .Pp
1.17      schwarze  806: than having the request or macro follow as
1.1       kristaps  807: .Pp
                    808: .D1 \&.if COND \e{ .foo
                    809: .Pp
                    810: The scope of a conditional is always parsed, but only executed if the
                    811: conditional evaluates to true.
                    812: .Pp
1.29      kristaps  813: Note that the
1.1       kristaps  814: .Sq \e}
1.29      kristaps  815: is converted into a zero-width escape sequence if not passed as a
                    816: standalone macro
                    817: .Sq \&.\e} .
                    818: For example,
                    819: .Pp
                    820: .D1 \&.Fl a \e} b
                    821: .Pp
                    822: will result in
1.8       kristaps  823: .Sq \e}
1.29      kristaps  824: being considered an argument of the
                    825: .Sq \&Fl
                    826: macro.
1.1       kristaps  827: .Ss \&ig
1.2       kristaps  828: Ignore input.
1.15      kristaps  829: Its syntax can be either
                    830: .Bd -literal -offset indent
                    831: .Pf . Cm \&ig
                    832: .Ar ignored text
1.2       kristaps  833: \&..
                    834: .Ed
1.15      kristaps  835: .Pp
                    836: or
                    837: .Bd -literal -offset indent
                    838: .Pf . Cm \&ig Ar end
                    839: .Ar ignored text
                    840: .Pf . Ar end
1.2       kristaps  841: .Ed
                    842: .Pp
                    843: In the first case, input is ignored until a
                    844: .Sq \&..
1.17      schwarze  845: request is encountered on its own line.
1.15      kristaps  846: In the second case, input is ignored until the specified
                    847: .Sq Pf . Ar end
                    848: macro is encountered.
                    849: Do not use the escape character
1.2       kristaps  850: .Sq \e
1.15      kristaps  851: anywhere in the definition of
                    852: .Ar end ;
                    853: it would cause very strange behaviour.
                    854: .Pp
                    855: When the
                    856: .Ar end
                    857: macro is a roff request or a roff macro, like in
1.2       kristaps  858: .Pp
                    859: .D1 \&.ig if
                    860: .Pp
                    861: the subsequent invocation of
                    862: .Sx \&if
1.15      kristaps  863: will first terminate the
                    864: .Ar ignored text ,
                    865: then be invoked as usual.
                    866: Otherwise, it only terminates the
                    867: .Ar ignored text ,
                    868: and arguments following it or the
                    869: .Sq \&..
1.17      schwarze  870: request are discarded.
1.50      schwarze  871: .Ss \&ll
                    872: Change the output line length.
                    873: Its syntax is as follows:
                    874: .Pp
1.51      schwarze  875: .D1 Pf . Cm \&ll Op Oo +|- Oc Ns Ar width
1.50      schwarze  876: .Pp
                    877: If the
                    878: .Ar width
                    879: argument is omitted, the line length is reset to its previous value.
                    880: The default setting for terminal output is 78n.
1.51      schwarze  881: If a sign is given, the line length is added to or subtracted from;
                    882: otherwise, it is set to the provided value.
1.50      schwarze  883: Using this request in new manuals is discouraged for several reasons,
                    884: among others because it overrides the
                    885: .Xr mandoc 1
                    886: .Fl O Cm width
                    887: command line option.
1.15      kristaps  888: .Ss \&ne
                    889: Declare the need for the specified minimum vertical space
                    890: before the next trap or the bottom of the page.
                    891: This line-scoped request is currently ignored.
                    892: .Ss \&nh
                    893: Turn off automatic hyphenation mode.
                    894: This line-scoped request is currently ignored.
1.10      kristaps  895: .Ss \&nr
1.45      schwarze  896: Define or change a register.
1.10      kristaps  897: A register is an arbitrary string value that defines some sort of state,
                    898: which influences parsing and/or formatting.
                    899: Its syntax is as follows:
                    900: .Pp
1.53    ! schwarze  901: .D1 Pf \. Cm \&nr Ar name Oo +|- Oc Ns Ar expression
1.10      kristaps  902: .Pp
1.53    ! schwarze  903: For the syntax of
        !           904: .Ar expression ,
        !           905: see
        !           906: .Sx Numerical expressions
        !           907: below.
1.46      schwarze  908: If it is prefixed by a sign, the register will be
1.45      schwarze  909: incremented or decremented instead of assigned to.
                    910: .Pp
                    911: The following register
1.15      kristaps  912: .Ar name
1.45      schwarze  913: is handled specially:
1.10      kristaps  914: .Bl -tag -width Ds
                    915: .It Cm nS
                    916: If set to a positive integer value, certain
                    917: .Xr mdoc 7
1.17      schwarze  918: macros will behave in the same way as in the
1.10      kristaps  919: .Em SYNOPSIS
1.11      kristaps  920: section.
1.17      schwarze  921: If set to 0, these macros will behave in the same way as outside the
                    922: .Em SYNOPSIS
                    923: section, even when called within the
1.10      kristaps  924: .Em SYNOPSIS
1.17      schwarze  925: section itself.
                    926: Note that starting a new
1.11      kristaps  927: .Xr mdoc 7
1.17      schwarze  928: section with the
                    929: .Cm \&Sh
                    930: macro will reset this register.
1.10      kristaps  931: .El
1.26      schwarze  932: .Ss \&ns
                    933: Turn on no-space mode.
                    934: This line-scoped request is intended to take no arguments.
                    935: Currently, it is ignored including its arguments,
                    936: and the number of arguments is not checked.
                    937: .Ss \&ps
                    938: Change point size.
                    939: This line-scoped request is intended to take one numerical argument.
                    940: Currently, it is ignored including its arguments,
                    941: and the number of arguments is not checked.
1.52      schwarze  942: .Ss \&rm
                    943: Remove a request, macro or string.
                    944: Its syntax is as follows:
                    945: .Pp
                    946: .D1 Pf \. Cm \&rm Ar name
                    947: .Ss \&rr
                    948: Remove a register.
                    949: Its syntax is as follows:
                    950: .Pp
                    951: .D1 Pf \. Cm \&rr Ar name
1.15      kristaps  952: .Ss \&so
                    953: Include a source file.
                    954: Its syntax is as follows:
                    955: .Pp
                    956: .D1 Pf \. Cm \&so Ar file
                    957: .Pp
                    958: The
                    959: .Ar file
                    960: will be read and its contents processed as input in place of the
                    961: .Sq \&.so
                    962: request line.
1.28      kristaps  963: To avoid inadvertent inclusion of unrelated files,
1.15      kristaps  964: .Xr mandoc 1
                    965: only accepts relative paths not containing the strings
                    966: .Qq ../
                    967: and
                    968: .Qq /.. .
1.37      schwarze  969: .Pp
                    970: This request requires
                    971: .Xr man 1
                    972: to change to the right directory before calling
                    973: .Xr mandoc 1 ,
                    974: per convention to the root of the manual tree.
                    975: Typical usage looks like:
                    976: .Pp
                    977: .Dl \&.so man3/Xcursor.3
                    978: .Pp
                    979: As the whole concept is rather fragile, the use of
                    980: .Sx \&so
                    981: is discouraged.
                    982: Use
                    983: .Xr ln 1
                    984: instead.
1.26      schwarze  985: .Ss \&ta
                    986: Set tab stops.
                    987: This line-scoped request can take an arbitrary number of arguments.
                    988: Currently, it is ignored including its arguments.
1.6       schwarze  989: .Ss \&tr
                    990: Output character translation.
1.30      kristaps  991: Its syntax is as follows:
                    992: .Pp
                    993: .D1 Pf \. Cm \&tr Ar [ab]+
                    994: .Pp
                    995: Pairs of
                    996: .Ar ab
                    997: characters are replaced
                    998: .Ar ( a
                    999: for
                   1000: .Ar b ) .
                   1001: Replacement (or origin) characters may also be character escapes; thus,
                   1002: .Pp
                   1003: .Dl tr \e(xx\e(yy
                   1004: .Pp
                   1005: replaces all invocations of \e(xx with \e(yy.
1.20      kristaps 1006: .Ss \&T&
                   1007: Re-start a table layout, retaining the options of the prior table
                   1008: invocation.
                   1009: See
                   1010: .Sx \&TS .
                   1011: .Ss \&TE
                   1012: End a table context.
                   1013: See
                   1014: .Sx \&TS .
                   1015: .Ss \&TS
                   1016: Begin a table, which formats input in aligned rows and columns.
1.23      kristaps 1017: See
                   1018: .Xr tbl 7
                   1019: for a description of the tbl language.
1.53    ! schwarze 1020: .Ss Numerical expressions
        !          1021: The
        !          1022: .Sx \&nr ,
        !          1023: .Sx \&if ,
        !          1024: and
        !          1025: .Sx \&ie
        !          1026: requests accept integer numerical expressions as arguments.
        !          1027: These are always evaluated using the C
        !          1028: .Vt int
        !          1029: type; integer overflow works the same way as in the C language.
        !          1030: Numbers consist of an arbitrary number of digits
        !          1031: .Sq 0
        !          1032: to
        !          1033: .Sq 9
        !          1034: prefixed by an optional sign
        !          1035: .Sq +
        !          1036: or
        !          1037: .Sq - .
        !          1038: .Pp
        !          1039: The following binary operators are implemented.
        !          1040: Unless otherwise stated, they behave as in the C language:
        !          1041: .Pp
        !          1042: .Bl -tag -width 2n -compact
        !          1043: .It Ic +
        !          1044: addition
        !          1045: .It Ic -
        !          1046: subtraction
        !          1047: .It Ic *
        !          1048: multiplication
        !          1049: .It Ic /
        !          1050: division
        !          1051: .It Ic %
        !          1052: remainder of division
        !          1053: .It Ic <
        !          1054: less than
        !          1055: .It Ic >
        !          1056: greater than
        !          1057: .It Ic ==
        !          1058: equal to
        !          1059: .It Ic =
        !          1060: equal to, same effect as
        !          1061: .Ic ==
        !          1062: (this differs from C)
        !          1063: .It Ic <=
        !          1064: less than or equal to
        !          1065: .It Ic >=
        !          1066: greater than or equal to
        !          1067: .It Ic <>
        !          1068: not equal to (corresponds to C
        !          1069: .Ic != ;
        !          1070: this one is of limited portability, it is supported by Heirloom roff,
        !          1071: but not by groff)
        !          1072: .It Ic &
        !          1073: logical and (corresponds to C
        !          1074: .Ic && )
        !          1075: .It Ic \&:
        !          1076: logical or (corresponds to C
        !          1077: .Ic \&|| )
        !          1078: .It Ic <?
        !          1079: minimum (not available in C)
        !          1080: .It Ic >?
        !          1081: maximum (not available in C)
        !          1082: .El
        !          1083: .Pp
        !          1084: There is no concept of precendence; evaluation proceeds from left to right,
        !          1085: except when subexpressions are enclosed in parantheses.
        !          1086: Inside parentheses, whitespace is ignored.
1.46      schwarze 1087: .Sh ESCAPE SEQUENCE REFERENCE
                   1088: The
                   1089: .Xr mandoc 1
                   1090: .Nm
                   1091: parser recognises the following escape sequences.
                   1092: Note that the
                   1093: .Nm
                   1094: language defines more escape sequences not implemented in
                   1095: .Xr mandoc 1 .
                   1096: In
                   1097: .Xr mdoc 7
                   1098: and
                   1099: .Xr man 7
                   1100: documents, using escape sequences is discouraged except for those
                   1101: described in the
                   1102: .Sx LANGUAGE SYNTAX
                   1103: section above.
                   1104: .Pp
                   1105: A backslash followed by any character not listed here
                   1106: simply prints that character itself.
                   1107: .Ss \e<newline>
                   1108: A backslash at the end of an input line can be used to continue the
                   1109: logical input line on the next physical input line, joining the text
                   1110: on both lines together as if it were on a single input line.
                   1111: .Ss \e<space>
                   1112: The escape sequence backslash-space
                   1113: .Pq Sq \e\ \&
                   1114: is an unpaddable space-sized non-breaking space character; see
                   1115: .Sx Whitespace .
                   1116: .Ss \e\(dq
                   1117: The rest of the input line is treated as
                   1118: .Sx Comments .
                   1119: .Ss \e%
                   1120: Hyphenation allowed at this point of the word; ignored by
                   1121: .Xr mandoc 1 .
                   1122: .Ss \e&
                   1123: Non-printing zero-width character; see
                   1124: .Sx Whitespace .
                   1125: .Ss \e\(aq
                   1126: Acute accent special character; use
                   1127: .Sq \e(aa
                   1128: instead.
                   1129: .Ss \e( Ns Ar cc
                   1130: .Sx Special Characters
                   1131: with two-letter names, see
                   1132: .Xr mandoc_char 7 .
                   1133: .Ss \e*[ Ns Ar name ]
                   1134: Interpolate the string with the
                   1135: .Ar name ;
                   1136: see
                   1137: .Sx Predefined Strings
                   1138: and
                   1139: .Sx ds .
                   1140: For short names, there are variants
                   1141: .No \e* Ns Ar c
                   1142: and
                   1143: .No \e*( Ns Ar cc .
                   1144: .Ss \e-
                   1145: Special character
                   1146: .Dq mathematical minus sign .
                   1147: .Ss \e[ Ns Ar name ]
                   1148: .Sx Special Characters
                   1149: with names of arbitrary length, see
                   1150: .Xr mandoc_char 7 .
                   1151: .Ss \e^
                   1152: One-twelfth em half-narrow space character, effectively zero-width in
                   1153: .Xr mandoc 1 .
                   1154: .Ss \e`
                   1155: Grave accent special character; use
                   1156: .Sq \e(ga
                   1157: instead.
                   1158: .Ss \e{
                   1159: Begin conditional input; see
                   1160: .Sx if .
                   1161: .Ss \e\(ba
                   1162: One-sixth em narrow space character, effectively zero-width in
                   1163: .Xr mandoc 1 .
                   1164: .Ss \e}
                   1165: End conditional input; see
                   1166: .Sx if .
                   1167: .Ss \e~
                   1168: Paddable non-breaking space character.
                   1169: .Ss \e0
                   1170: Digit width space character.
                   1171: .Ss \eA\(aq Ns Ar string Ns \(aq
                   1172: Anchor definition; ignored by
                   1173: .Xr mandoc 1 .
                   1174: .Ss \eB\(aq Ns Ar string Ns \(aq
                   1175: Test whether
                   1176: .Ar string
                   1177: is a numerical expession; ignored by
                   1178: .Xr mandoc 1 .
                   1179: .Ss \eb\(aq Ns Ar string Ns \(aq
                   1180: Bracket building function; ignored by
                   1181: .Xr mandoc 1 .
                   1182: .Ss \eC\(aq Ns Ar name Ns \(aq
                   1183: .Sx Special Characters
                   1184: with names of arbitrary length.
                   1185: .Ss \ec
                   1186: Interrupt text processing to insert requests or macros; ignored by
                   1187: .Xr mandoc 1 .
                   1188: .Ss \eD\(aq Ns Ar string Ns \(aq
                   1189: Draw graphics function; ignored by
                   1190: .Xr mandoc 1 .
                   1191: .Ss \ed
                   1192: Move down by half a line; ignored by
                   1193: .Xr mandoc 1 .
                   1194: .Ss \ee
                   1195: Backslash special character.
                   1196: .Ss \eF[ Ns Ar name ]
                   1197: Switch font family (groff extension); ignored by
                   1198: .Xr mandoc 1 .
                   1199: For short names, there are variants
                   1200: .No \eF Ns Ar c
                   1201: and
                   1202: .No \eF( Ns Ar cc .
                   1203: .Ss \ef[ Ns Ar name ]
                   1204: Switch to the font
                   1205: .Ar name ,
                   1206: see
                   1207: .Sx Text Decoration .
                   1208: For short names, there are variants
                   1209: .No \ef Ns Ar c
                   1210: and
                   1211: .No \ef( Ns Ar cc .
                   1212: .Ss \eg[ Ns Ar name ]
                   1213: Interpolate the format of a number register; ignored by
                   1214: .Xr mandoc 1 .
                   1215: For short names, there are variants
                   1216: .No \eg Ns Ar c
                   1217: and
                   1218: .No \eg( Ns Ar cc .
                   1219: .Ss \eH\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
                   1220: Set the height of the current font; ignored by
                   1221: .Xr mandoc 1 .
                   1222: .Ss \eh\(aq Ns Ar number Ns \(aq
                   1223: Horizontal motion; ignored by
                   1224: .Xr mandoc 1 .
                   1225: .Ss \ek[ Ns Ar name ]
                   1226: Mark horizontal input place in register; ignored by
                   1227: .Xr mandoc 1 .
                   1228: For short names, there are variants
                   1229: .No \ek Ns Ar c
                   1230: and
                   1231: .No \ek( Ns Ar cc .
                   1232: .Ss \eL\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
                   1233: Vertical line drawing function; ignored by
                   1234: .Xr mandoc 1 .
                   1235: .Ss \el\(aq Ns Ar number Ns Oo Ar c Oc Ns \(aq
                   1236: Horizontal line drawing function; ignored by
                   1237: .Xr mandoc 1 .
                   1238: .Ss \eM[ Ns Ar name ]
                   1239: Set fill (background) color (groff extension); ignored by
                   1240: .Xr mandoc 1 .
                   1241: For short names, there are variants
                   1242: .No \eM Ns Ar c
                   1243: and
                   1244: .No \eM( Ns Ar cc .
                   1245: .Ss \em[ Ns Ar name ]
                   1246: Set glyph drawing color (groff extension); ignored by
                   1247: .Xr mandoc 1 .
                   1248: For short names, there are variants
                   1249: .No \em Ns Ar c
                   1250: and
                   1251: .No \em( Ns Ar cc .
                   1252: .Ss \eN\(aq Ns Ar number Ns \(aq
                   1253: Character
                   1254: .Ar number
                   1255: on the current font.
                   1256: .Ss \en[ Ns Ar name ]
                   1257: Interpolate the number register
                   1258: .Ar name .
                   1259: For short names, there are variants
                   1260: .No \en Ns Ar c
                   1261: and
                   1262: .No \en( Ns Ar cc .
                   1263: .Ss \eo\(aq Ns Ar string Ns \(aq
                   1264: Overstrike
                   1265: .Ar string ;
                   1266: ignored by
                   1267: .Xr mandoc 1 .
                   1268: .Ss \eR\(aq Ns Ar name Oo +|- Oc Ns Ar number Ns \(aq
                   1269: Set number register; ignored by
                   1270: .Xr mandoc 1 .
                   1271: .Ss \eS\(aq Ns Ar number Ns \(aq
                   1272: Slant output; ignored by
                   1273: .Xr mandoc 1 .
                   1274: .Ss \es\(aq Ns Oo +|- Oc Ns Ar number Ns \(aq
                   1275: Change point size; ignored by
                   1276: .Xr mandoc 1 .
                   1277: Alternative forms
                   1278: .No \es Ns Oo +|- Oc Ns Ar n ,
                   1279: .No \es Ns Oo +|- Oc Ns \(aq Ns Ar number Ns \(aq ,
                   1280: .No \es Ns [ Oo +|- Oc Ns Ar number ] ,
                   1281: and
                   1282: .No \es Ns Oo +|- Oc Ns [ Ar number Ns ]
                   1283: are also parsed and ignored.
                   1284: .Ss \et
                   1285: Horizontal tab; ignored by
                   1286: .Xr mandoc 1 .
                   1287: .Ss \eu
                   1288: Move up by half a line; ignored by
                   1289: .Xr mandoc 1 .
                   1290: .Ss \eV[ Ns Ar name ]
                   1291: Interpolate an environment variable; ignored by
                   1292: .Xr mandoc 1 .
                   1293: For short names, there are variants
                   1294: .No \eV Ns Ar c
                   1295: and
                   1296: .No \eV( Ns Ar cc .
                   1297: .Ss \ev\(aq Ns Ar number Ns \(aq
                   1298: Vertical motion; ignored by
                   1299: .Xr mandoc 1 .
                   1300: .Ss \ew\(aq Ns Ar string Ns \(aq
                   1301: Interpolate the width of the
                   1302: .Ar string ;
                   1303: ignored by
                   1304: .Xr mandoc 1 .
                   1305: .Ss \eX\(aq Ns Ar string Ns \(aq
                   1306: Output
                   1307: .Ar string
                   1308: as device control function; ignored in nroff mode and by
                   1309: .Xr mandoc 1 .
                   1310: .Ss \ex\(aq Ns Ar number Ns \(aq
                   1311: Extra line space function; ignored by
                   1312: .Xr mandoc 1 .
                   1313: .Ss \eY[ Ns Ar name ]
                   1314: Output a string as a device control function; ignored in nroff mode and by
                   1315: .Xr mandoc 1 .
                   1316: For short names, there are variants
                   1317: .No \eY Ns Ar c
                   1318: and
                   1319: .No \eY( Ns Ar cc .
                   1320: .Ss \eZ\(aq Ns Ar string Ns \(aq
                   1321: Print
                   1322: .Ar string
                   1323: with zero width and height; ignored by
                   1324: .Xr mandoc 1 .
                   1325: .Ss \ez
                   1326: Output the next character without advancing the cursor position;
                   1327: approximated in
                   1328: .Xr mandoc 1
                   1329: by simply skipping the next character.
1.2       kristaps 1330: .Sh COMPATIBILITY
1.40      schwarze 1331: This section documents compatibility between mandoc and other
1.17      schwarze 1332: .Nm
                   1333: implementations, at this time limited to GNU troff
1.2       kristaps 1334: .Pq Qq groff .
                   1335: The term
                   1336: .Qq historic groff
1.17      schwarze 1337: refers to groff version 1.15.
1.2       kristaps 1338: .Pp
                   1339: .Bl -dash -compact
1.10      kristaps 1340: .It
1.27      kristaps 1341: In mandoc, the
                   1342: .Sx \&EQ ,
                   1343: .Sx \&TE ,
                   1344: .Sx \&TS ,
                   1345: and
                   1346: .Sx \&T& ,
                   1347: macros are considered regular macros.
                   1348: In all other
                   1349: .Nm
                   1350: implementations, these are special macros that must be specified without
                   1351: spacing between the control character (which must be a period) and the
                   1352: macro name.
                   1353: .It
1.10      kristaps 1354: The
                   1355: .Cm nS
1.17      schwarze 1356: register is only compatible with OpenBSD's groff-1.15.
1.2       kristaps 1357: .It
1.17      schwarze 1358: Historic groff did not accept white-space before a custom
                   1359: .Ar end
                   1360: macro for the
1.2       kristaps 1361: .Sx \&ig
1.17      schwarze 1362: request.
1.4       kristaps 1363: .It
                   1364: The
                   1365: .Sx \&if
                   1366: and family would print funny white-spaces with historic groff when
1.17      schwarze 1367: using the next-line syntax.
1.2       kristaps 1368: .El
1.17      schwarze 1369: .Sh SEE ALSO
                   1370: .Xr mandoc 1 ,
1.27      kristaps 1371: .Xr eqn 7 ,
1.17      schwarze 1372: .Xr man 7 ,
                   1373: .Xr mandoc_char 7 ,
1.23      kristaps 1374: .Xr mdoc 7 ,
                   1375: .Xr tbl 7
1.17      schwarze 1376: .Rs
                   1377: .%A Joseph F. Ossanna
                   1378: .%A Brian W. Kernighan
                   1379: .%I AT&T Bell Laboratories
                   1380: .%T Troff User's Manual
                   1381: .%R Computing Science Technical Report
                   1382: .%N 54
                   1383: .%C Murray Hill, New Jersey
                   1384: .%D 1976 and 1992
                   1385: .%U http://www.kohala.com/start/troff/cstr54.ps
                   1386: .Re
                   1387: .Rs
                   1388: .%A Joseph F. Ossanna
                   1389: .%A Brian W. Kernighan
                   1390: .%A Gunnar Ritter
                   1391: .%T Heirloom Documentation Tools Nroff/Troff User's Manual
                   1392: .%D September 17, 2007
                   1393: .%U http://heirloom.sourceforge.net/doctools/troff.pdf
                   1394: .Re
                   1395: .Sh HISTORY
1.35      kristaps 1396: The RUNOFF typesetting system, whose input forms the basis for
1.17      schwarze 1397: .Nm ,
1.35      kristaps 1398: was written in MAD and FAP for the CTSS operating system by Jerome E.
                   1399: Saltzer in 1964.
                   1400: Doug McIlroy rewrote it in BCPL in 1969, renaming it
                   1401: .Nm .
                   1402: Dennis M. Ritchie rewrote McIlroy's
1.36      schwarze 1403: .Nm
                   1404: in PDP-11 assembly for
1.35      kristaps 1405: .At v1 ,
                   1406: Joseph F. Ossanna improved roff and renamed it nroff
                   1407: for
                   1408: .At v2 ,
                   1409: then ported nroff to C as troff, which Brian W. Kernighan released with
                   1410: .At v7 .
                   1411: In 1989, James Clarke re-implemented troff in C++, naming it groff.
1.1       kristaps 1412: .Sh AUTHORS
1.15      kristaps 1413: .An -nosplit
1.31      kristaps 1414: This
1.1       kristaps 1415: .Nm
                   1416: reference was written by
1.41      schwarze 1417: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
1.15      kristaps 1418: and
1.41      schwarze 1419: .An Ingo Schwarze Aq Mt schwarze@openbsd.org .

CVSweb