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

Annotation of mandoc/mandoc.1, Revision 1.235

1.235   ! schwarze    1: .\"    $Id: mandoc.1,v 1.234 2018/12/24 23:37:22 schwarze Exp $
1.1       kristaps    2: .\"
1.92      schwarze    3: .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
1.222     schwarze    4: .\" Copyright (c) 2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
1.1       kristaps    5: .\"
                      6: .\" Permission to use, copy, modify, and distribute this software for any
1.16      kristaps    7: .\" purpose with or without fee is hereby granted, provided that the above
                      8: .\" copyright notice and this permission notice appear in all copies.
1.1       kristaps    9: .\"
1.16      kristaps   10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     11: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     12: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     13: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     14: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     15: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     16: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       kristaps   17: .\"
1.235   ! schwarze   18: .Dd $Mdocdate: December 24 2018 $
1.14      kristaps   19: .Dt MANDOC 1
1.1       kristaps   20: .Os
                     21: .Sh NAME
                     22: .Nm mandoc
1.181     schwarze   23: .Nd format manual pages
1.1       kristaps   24: .Sh SYNOPSIS
                     25: .Nm mandoc
1.184     schwarze   26: .Op Fl ac
1.156     schwarze   27: .Op Fl I Cm os Ns = Ns Ar name
                     28: .Op Fl K Ar encoding
1.180     schwarze   29: .Op Fl mdoc | man
1.184     schwarze   30: .Op Fl O Ar options
1.156     schwarze   31: .Op Fl T Ar output
                     32: .Op Fl W Ar level
1.89      kristaps   33: .Op Ar
1.1       kristaps   34: .Sh DESCRIPTION
                     35: The
                     36: .Nm
1.224     schwarze   37: utility formats manual pages for display.
1.100     kristaps   38: .Pp
                     39: By default,
                     40: .Nm
                     41: reads
                     42: .Xr mdoc 7
                     43: or
                     44: .Xr man 7
1.180     schwarze   45: text from stdin and produces
1.156     schwarze   46: .Fl T Cm locale
1.100     kristaps   47: output.
                     48: .Pp
1.109     schwarze   49: The options are as follows:
1.19      kristaps   50: .Bl -tag -width Ds
1.107     schwarze   51: .It Fl a
                     52: If the standard output is a terminal device and
                     53: .Fl c
                     54: is not specified, use
                     55: .Xr more 1
                     56: to paginate the output, just like
                     57: .Xr man 1
                     58: would.
                     59: .It Fl c
                     60: Copy the formatted manual pages to the standard output without using
                     61: .Xr more 1
                     62: to paginate them.
                     63: This is the default.
                     64: It can be specified to override
                     65: .Fl a .
1.156     schwarze   66: .It Fl I Cm os Ns = Ns Ar name
1.101     schwarze   67: Override the default operating system
                     68: .Ar name
                     69: for the
                     70: .Xr mdoc 7
1.180     schwarze   71: .Ic \&Os
1.130     schwarze   72: and for the
                     73: .Xr man 7
1.180     schwarze   74: .Ic \&TH
1.101     schwarze   75: macro.
1.156     schwarze   76: .It Fl K Ar encoding
1.119     schwarze   77: Specify the input encoding.
                     78: The supported
                     79: .Ar encoding
                     80: arguments are
                     81: .Cm us-ascii ,
                     82: .Cm iso-8859-1 ,
                     83: and
                     84: .Cm utf-8 .
1.176     schwarze   85: If not specified, autodetection uses the first match in the following
                     86: list:
                     87: .Bl -enum
                     88: .It
                     89: If the first three bytes of the input file are the UTF-8 byte order
                     90: mark (BOM, 0xefbbbf), input is interpreted as
                     91: .Cm utf-8 .
                     92: .It
                     93: If the first or second line of the input file matches the
1.119     schwarze   94: .Sy emacs
                     95: mode line format
                     96: .Pp
                     97: .D1 .\e" -*- Oo ...; Oc coding: Ar encoding ; No -*-
1.176     schwarze   98: .Pp
                     99: then input is interpreted according to
                    100: .Ar encoding .
                    101: .It
                    102: If the first non-ASCII byte in the file introduces a valid UTF-8
                    103: sequence, input is interpreted as
                    104: .Cm utf-8 .
                    105: .It
                    106: Otherwise, input is interpreted as
                    107: .Cm iso-8859-1 .
1.119     schwarze  108: .El
1.180     schwarze  109: .It Fl mdoc | man
                    110: With
                    111: .Fl mdoc ,
                    112: all input files are interpreted as
                    113: .Xr mdoc 7 .
                    114: With
                    115: .Fl man ,
                    116: all input files are interpreted as
                    117: .Xr man 7 .
                    118: By default, the input language is automatically detected for each file:
1.221     schwarze  119: if the first macro is
1.180     schwarze  120: .Ic \&Dd
                    121: or
                    122: .Ic \&Dt ,
                    123: the
                    124: .Xr mdoc 7
                    125: parser is used; otherwise, the
                    126: .Xr man 7
                    127: parser is used.
                    128: With other arguments,
                    129: .Fl m
                    130: is silently ignored.
1.184     schwarze  131: .It Fl O Ar options
1.57      kristaps  132: Comma-separated output options.
1.224     schwarze  133: See the descriptions of the individual output formats for supported
                    134: .Ar options .
1.156     schwarze  135: .It Fl T Ar output
1.224     schwarze  136: Select the output format.
                    137: Supported values for the
                    138: .Ar output
                    139: argument are
                    140: .Cm ascii ,
                    141: .Cm html ,
                    142: the default of
                    143: .Cm locale ,
                    144: .Cm man ,
                    145: .Cm markdown ,
                    146: .Cm pdf ,
                    147: .Cm ps ,
                    148: .Cm tree ,
                    149: and
                    150: .Cm utf8 .
                    151: .Pp
                    152: The special
                    153: .Fl T Cm lint
                    154: mode only parses the input and produces no output.
                    155: It implies
                    156: .Fl W Cm all
                    157: and redirects parser messages, which usually appear on standard
                    158: error output, to standard output.
1.156     schwarze  159: .It Fl W Ar level
1.77      schwarze  160: Specify the minimum message
                    161: .Ar level
                    162: to be reported on the standard error output and to affect the exit status.
                    163: The
                    164: .Ar level
                    165: can be
1.202     schwarze  166: .Cm base ,
1.185     schwarze  167: .Cm style ,
1.133     schwarze  168: .Cm warning ,
                    169: .Cm error ,
1.77      schwarze  170: or
1.202     schwarze  171: .Cm unsupp .
                    172: The
                    173: .Cm base
                    174: level automatically derives the operating system from the contents of the
                    175: .Ic \&Os
                    176: macro, from the
                    177: .Fl Ios
                    178: command line option, or from the
                    179: .Xr uname 3
                    180: return value.
                    181: The levels
                    182: .Cm openbsd
                    183: and
                    184: .Cm netbsd
                    185: are variants of
                    186: .Cm base
                    187: that bypass autodetection and request validation of base system
                    188: conventions for a particular operating system.
                    189: The level
1.132     schwarze  190: .Cm all
1.77      schwarze  191: is an alias for
1.202     schwarze  192: .Cm base .
1.132     schwarze  193: By default,
                    194: .Nm
                    195: is silent.
1.77      schwarze  196: See
                    197: .Sx EXIT STATUS
                    198: and
                    199: .Sx DIAGNOSTICS
                    200: for details.
                    201: .Pp
                    202: The special option
1.156     schwarze  203: .Fl W Cm stop
1.77      schwarze  204: tells
                    205: .Nm
                    206: to exit after parsing a file that causes warnings or errors of at least
                    207: the requested level.
                    208: No formatted output will be produced from that file.
                    209: If both a
                    210: .Ar level
                    211: and
                    212: .Cm stop
                    213: are requested, they can be joined with a comma, for example
1.156     schwarze  214: .Fl W Cm error , Ns Cm stop .
1.58      kristaps  215: .It Ar file
1.224     schwarze  216: Read from the given input file.
                    217: If multiple files are specified, they are processed in the given order.
                    218: If unspecified,
1.2       kristaps  219: .Nm
1.224     schwarze  220: reads from standard input.
1.1       kristaps  221: .El
1.109     schwarze  222: .Pp
1.183     schwarze  223: The options
                    224: .Fl fhklw
                    225: are also supported and are documented in man(1).
1.109     schwarze  226: In
                    227: .Fl f
                    228: and
                    229: .Fl k
                    230: mode,
                    231: .Nm
                    232: also supports the options
1.183     schwarze  233: .Fl CMmOSs
1.109     schwarze  234: described in the
                    235: .Xr apropos 1
                    236: manual.
1.182     schwarze  237: The options
                    238: .Fl fkl
                    239: are mutually exclusive and override each other.
1.66      kristaps  240: .Ss ASCII Output
1.224     schwarze  241: Use
1.156     schwarze  242: .Fl T Cm ascii
1.224     schwarze  243: to force text output in 7-bit ASCII character encoding documented in the
                    244: .Xr ascii 7
                    245: manual page, ignoring the
                    246: .Xr locale 1
                    247: set in the environment.
1.66      kristaps  248: .Pp
                    249: Font styles are applied by using back-spaced encoding such that an
                    250: underlined character
                    251: .Sq c
                    252: is rendered as
                    253: .Sq _ Ns \e[bs] Ns c ,
                    254: where
                    255: .Sq \e[bs]
                    256: is the back-space character number 8.
                    257: Emboldened characters are rendered as
                    258: .Sq c Ns \e[bs] Ns c .
1.235   ! schwarze  259: This markup is typically converted to appropriate terminal sequences by
        !           260: the pager or
        !           261: .Xr ul 1 .
        !           262: To remove the markup, pipe the output to
        !           263: .Xr col 1
        !           264: .Fl b
        !           265: instead.
1.66      kristaps  266: .Pp
                    267: The special characters documented in
                    268: .Xr mandoc_char 7
                    269: are rendered best-effort in an ASCII equivalent.
                    270: .Pp
                    271: The following
                    272: .Fl O
                    273: arguments are accepted:
1.19      kristaps  274: .Bl -tag -width Ds
1.98      schwarze  275: .It Cm indent Ns = Ns Ar indent
                    276: The left margin for normal text is set to
                    277: .Ar indent
                    278: blank characters instead of the default of five for
                    279: .Xr mdoc 7
                    280: and seven for
                    281: .Xr man 7 .
                    282: Increasing this is not recommended; it may result in degraded formatting,
1.99      schwarze  283: for example overfull lines or ugly line breaks.
1.223     schwarze  284: When output is to a pager on a terminal that is less than 66 columns
                    285: wide, the default is reduced to three columns.
1.218     schwarze  286: .It Cm mdoc
                    287: Format
                    288: .Xr man 7
                    289: input files in
                    290: .Xr mdoc 7
                    291: output style.
                    292: Specifically, this suppresses the two additional blank lines near the
                    293: top and the bottom of each page, and it implies
                    294: .Fl O Cm indent Ns =5 .
                    295: One useful application is for checking that
                    296: .Fl T Cm man
                    297: output formats in the same way as the
                    298: .Xr mdoc 7
                    299: source it was generated from.
1.231     schwarze  300: .It Cm tag Ns Op = Ns Ar term
                    301: If the formatted manual page is opened in a pager,
                    302: go to the definition of the
                    303: .Ar term
                    304: rather than showing the manual page from the beginning.
                    305: If no
                    306: .Ar term
                    307: is specified, reuse the first command line argument that is not a
                    308: .Ar section
                    309: number.
                    310: This is useful when it is the name of a manual page,
                    311: in particular the name of a library function.
1.66      kristaps  312: .It Cm width Ns = Ns Ar width
                    313: The output width is set to
1.223     schwarze  314: .Ar width
                    315: instead of the default of 78.
                    316: When output is to a pager on a terminal that is less than 79 columns
                    317: wide, the default is reduced to one less than the terminal width.
                    318: In any case, lines that are output in literal mode are never wrapped
                    319: and may exceed the output width.
1.1       kristaps  320: .El
1.66      kristaps  321: .Ss HTML Output
                    322: Output produced by
1.156     schwarze  323: .Fl T Cm html
1.114     kristaps  324: conforms to HTML5 using optional self-closing tags.
1.116     kristaps  325: Default styles use only CSS1.
                    326: Equations rendered from
                    327: .Xr eqn 7
                    328: blocks use MathML.
1.66      kristaps  329: .Pp
1.234     schwarze  330: The file
                    331: .Pa /usr/share/misc/mandoc.css
                    332: documents style-sheet classes available for customising output.
1.83      kristaps  333: If a style-sheet is not specified with
1.156     schwarze  334: .Fl O Cm style ,
                    335: .Fl T Cm html
1.114     kristaps  336: defaults to simple output (via an embedded style-sheet)
                    337: readable in any graphical or text-based web
1.83      kristaps  338: browser.
1.66      kristaps  339: .Pp
1.224     schwarze  340: Non-ASCII characters are rendered
1.225     schwarze  341: as hexadecimal Unicode character references.
1.66      kristaps  342: .Pp
                    343: The following
1.64      kristaps  344: .Fl O
1.66      kristaps  345: arguments are accepted:
1.37      kristaps  346: .Bl -tag -width Ds
1.94      kristaps  347: .It Cm fragment
1.123     schwarze  348: Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
                    349: elements and only emit the subtree below the <body> element.
1.94      kristaps  350: The
                    351: .Cm style
1.97      schwarze  352: argument will be ignored.
1.94      kristaps  353: This is useful when embedding manual content within existing documents.
1.64      kristaps  354: .It Cm includes Ns = Ns Ar fmt
1.40      kristaps  355: The string
                    356: .Ar fmt ,
1.49      kristaps  357: for example,
1.40      kristaps  358: .Ar ../src/%I.html ,
                    359: is used as a template for linked header files (usually via the
1.180     schwarze  360: .Ic \&In
1.57      kristaps  361: macro).
                    362: Instances of
1.43      kristaps  363: .Sq \&%I
1.57      kristaps  364: are replaced with the include filename.
                    365: The default is not to present a
1.40      kristaps  366: hyperlink.
1.229     schwarze  367: .It Cm man Ns = Ns Ar fmt Ns Op ; Ns Ar fmt
1.39      kristaps  368: The string
                    369: .Ar fmt ,
1.49      kristaps  370: for example,
1.39      kristaps  371: .Ar ../html%S/%N.%S.html ,
                    372: is used as a template for linked manuals (usually via the
1.180     schwarze  373: .Ic \&Xr
1.57      kristaps  374: macro).
                    375: Instances of
1.43      kristaps  376: .Sq \&%N
1.40      kristaps  377: and
                    378: .Sq %S
                    379: are replaced with the linked manual's name and section, respectively.
1.57      kristaps  380: If no section is included, section 1 is assumed.
                    381: The default is not to
1.40      kristaps  382: present a hyperlink.
1.229     schwarze  383: If two formats are given and a file
                    384: .Ar %N.%S
                    385: exists in the current directory, the first format is used;
                    386: otherwise, the second format is used.
1.64      kristaps  387: .It Cm style Ns = Ns Ar style.css
1.58      kristaps  388: The file
                    389: .Ar style.css
                    390: is used for an external style-sheet.
                    391: This must be a valid absolute or
                    392: relative URI.
1.230     schwarze  393: .It Cm toc
                    394: If an input file contains at least two non-standard sections,
                    395: print a table of contents near the beginning of the output.
1.61      kristaps  396: .El
1.93      schwarze  397: .Ss Locale Output
1.224     schwarze  398: By default,
                    399: .Nm
                    400: automatically selects UTF-8 or ASCII output according to the current
                    401: .Xr locale 1 .
                    402: If any of the environment variables
                    403: .Ev LC_ALL ,
                    404: .Ev LC_CTYPE ,
                    405: or
                    406: .Ev LANG
                    407: are set and the first one that is set
                    408: selects the UTF-8 character encoding, it produces
                    409: .Sx UTF-8 Output ;
                    410: otherwise, it falls back to
                    411: .Sx ASCII Output .
                    412: This output mode can also be selected explicitly with
1.156     schwarze  413: .Fl T Cm locale .
1.95      kristaps  414: .Ss Man Output
1.224     schwarze  415: Use
                    416: .Fl T Cm man
                    417: to translate
                    418: .Xr mdoc 7
                    419: input into
1.95      kristaps  420: .Xr man 7
                    421: output format.
1.102     schwarze  422: This is useful for distributing manual sources to legacy systems
1.96      kristaps  423: lacking
1.95      kristaps  424: .Xr mdoc 7
                    425: formatters.
                    426: .Pp
1.224     schwarze  427: If the input format of a file is
1.95      kristaps  428: .Xr man 7 ,
1.97      schwarze  429: the input is copied to the output, expanding any
1.95      kristaps  430: .Xr roff 7
1.180     schwarze  431: .Ic so
1.97      schwarze  432: requests.
                    433: The parser is also run, and as usual, the
                    434: .Fl W
                    435: level controls which
                    436: .Sx DIAGNOSTICS
                    437: are displayed before copying the input to the output.
1.175     schwarze  438: .Ss Markdown Output
1.224     schwarze  439: Use
                    440: .Fl T Cm markdown
                    441: to translate
1.175     schwarze  442: .Xr mdoc 7
1.224     schwarze  443: input to the markdown format conforming to
1.175     schwarze  444: .Lk http://daringfireball.net/projects/markdown/syntax.text\
                    445:  "John Gruber's 2004 specification" .
1.178     schwarze  446: The output also almost conforms to the
                    447: .Lk http://commonmark.org/ CommonMark
                    448: specification.
                    449: .Pp
                    450: The character set used for the markdown output is ASCII.
                    451: Non-ASCII characters are encoded as HTML entities.
                    452: Since that is not possible in literal font contexts, because these
                    453: are rendered as code spans and code blocks in the markdown output,
                    454: non-ASCII characters are transliterated to ASCII approximations in
                    455: these contexts.
1.175     schwarze  456: .Pp
                    457: Markdown is a very weak markup language, so all semantic markup is
                    458: lost, and even part of the presentational markup may be lost.
                    459: Do not use this as an intermediate step in converting to HTML;
                    460: instead, use
                    461: .Fl T Cm html
                    462: directly.
                    463: .Pp
                    464: The
                    465: .Xr man 7 ,
                    466: .Xr tbl 7 ,
                    467: and
                    468: .Xr eqn 7
                    469: input languages are not supported by
                    470: .Fl T Cm markdown
                    471: output mode.
1.93      schwarze  472: .Ss PDF Output
                    473: PDF-1.1 output may be generated by
1.156     schwarze  474: .Fl T Cm pdf .
1.93      schwarze  475: See
                    476: .Sx PostScript Output
                    477: for
                    478: .Fl O
                    479: arguments and defaults.
1.62      kristaps  480: .Ss PostScript Output
1.65      kristaps  481: PostScript
                    482: .Qq Adobe-3.0
                    483: Level-2 pages may be generated by
1.156     schwarze  484: .Fl T Cm ps .
1.67      kristaps  485: Output pages default to letter sized and are rendered in the Times font
1.70      kristaps  486: family, 11-point.
                    487: Margins are calculated as 1/9 the page length and width.
1.71      kristaps  488: Line-height is 1.4m.
1.66      kristaps  489: .Pp
                    490: Special characters are rendered as in
                    491: .Sx ASCII Output .
                    492: .Pp
                    493: The following
                    494: .Fl O
                    495: arguments are accepted:
                    496: .Bl -tag -width Ds
                    497: .It Cm paper Ns = Ns Ar name
                    498: The paper size
                    499: .Ar name
                    500: may be one of
1.68      kristaps  501: .Ar a3 ,
                    502: .Ar a4 ,
                    503: .Ar a5 ,
                    504: .Ar legal ,
1.66      kristaps  505: or
                    506: .Ar letter .
1.68      kristaps  507: You may also manually specify dimensions as
                    508: .Ar NNxNN ,
                    509: width by height in millimetres.
                    510: If an unknown value is encountered,
                    511: .Ar letter
                    512: is used.
1.66      kristaps  513: .El
1.224     schwarze  514: .Ss UTF-8 Output
1.93      schwarze  515: Use
1.156     schwarze  516: .Fl T Cm utf8
1.224     schwarze  517: to force text output in UTF-8 multi-byte character encoding,
                    518: ignoring the
                    519: .Xr locale 1
                    520: settings in the environment.
1.73      kristaps  521: See
1.224     schwarze  522: .Sx ASCII Output
                    523: regarding font styles and
                    524: .Fl O
                    525: arguments.
                    526: .Pp
                    527: On operating systems lacking locale or wide character support, and
                    528: on those where the internal character representation is not UCS-4,
                    529: .Nm
                    530: always falls back to
                    531: .Sx ASCII Output .
1.161     schwarze  532: .Ss Syntax tree output
                    533: Use
                    534: .Fl T Cm tree
                    535: to show a human readable representation of the syntax tree.
                    536: It is useful for debugging the source code of manual pages.
1.162     schwarze  537: The exact format is subject to change, so don't write parsers for it.
1.170     schwarze  538: .Pp
                    539: The first paragraph shows meta data found in the
                    540: .Xr mdoc 7
                    541: prologue, on the
                    542: .Xr man 7
                    543: .Ic \&TH
                    544: line, or the fallbacks used.
                    545: .Pp
                    546: In the tree dump, each output line shows one syntax tree node.
1.161     schwarze  547: Child nodes are indented with respect to their parent node.
                    548: The columns are:
                    549: .Pp
                    550: .Bl -enum -compact
                    551: .It
                    552: For macro nodes, the macro name; for text and
                    553: .Xr tbl 7
1.162     schwarze  554: nodes, the content.
                    555: There is a special format for
1.161     schwarze  556: .Xr eqn 7
                    557: nodes.
                    558: .It
                    559: Node type (text, elem, block, head, body, body-end, tail, tbl, eqn).
                    560: .It
                    561: Flags:
                    562: .Bl -dash -compact
                    563: .It
                    564: An opening parenthesis if the node is an opening delimiter.
                    565: .It
                    566: An asterisk if the node starts a new input line.
                    567: .It
                    568: The input line number (starting at one).
                    569: .It
                    570: A colon.
                    571: .It
                    572: The input column number (starting at one).
                    573: .It
                    574: A closing parenthesis if the node is a closing delimiter.
                    575: .It
                    576: A full stop if the node ends a sentence.
1.169     schwarze  577: .It
1.174     schwarze  578: BROKEN if the node is a block broken by another block.
                    579: .It
1.169     schwarze  580: NOSRC if the node is not in the input file,
                    581: but automatically generated from macros.
                    582: .It
                    583: NOPRT if the node is not supposed to generate output
                    584: for any output format.
1.161     schwarze  585: .El
1.174     schwarze  586: .El
                    587: .Pp
                    588: The following
                    589: .Fl O
                    590: argument is accepted:
                    591: .Bl -tag -width Ds
                    592: .It Cm noval
                    593: Skip validation and show the unvalidated syntax tree.
                    594: This can help to find out whether a given behaviour is caused by
                    595: the parser or by the validator.
                    596: Meta data is not available in this case.
1.161     schwarze  597: .El
1.108     schwarze  598: .Sh ENVIRONMENT
                    599: .Bl -tag -width MANPAGER
1.224     schwarze  600: .It Ev LC_CTYPE
                    601: The character encoding
                    602: .Xr locale 1 .
                    603: When
                    604: .Sx Locale Output
                    605: is selected, it decides whether to use ASCII or UTF-8 output format.
                    606: It never affects the interpretation of input files.
1.108     schwarze  607: .It Ev MANPAGER
                    608: Any non-empty value of the environment variable
                    609: .Ev MANPAGER
1.179     schwarze  610: is used instead of the standard pagination program,
                    611: .Xr more 1 ;
                    612: see
                    613: .Xr man 1
                    614: for details.
                    615: Only used if
                    616: .Fl a
                    617: or
                    618: .Fl l
                    619: is specified.
1.108     schwarze  620: .It Ev PAGER
                    621: Specifies the pagination program to use when
                    622: .Ev MANPAGER
                    623: is not defined.
                    624: If neither PAGER nor MANPAGER is defined,
1.159     schwarze  625: .Xr more 1
                    626: .Fl s
1.179     schwarze  627: is used.
                    628: Only used if
                    629: .Fl a
                    630: or
                    631: .Fl l
                    632: is specified.
1.108     schwarze  633: .El
1.77      schwarze  634: .Sh EXIT STATUS
                    635: The
                    636: .Nm
                    637: utility exits with one of the following values, controlled by the message
                    638: .Ar level
                    639: associated with the
                    640: .Fl W
                    641: option:
                    642: .Pp
                    643: .Bl -tag -width Ds -compact
                    644: .It 0
1.202     schwarze  645: No base system convention violations, style suggestions, warnings,
                    646: or errors occurred, or those that did were ignored because they
                    647: were lower than the requested
1.77      schwarze  648: .Ar level .
1.185     schwarze  649: .It 1
1.202     schwarze  650: At least one base system convention violation or style suggestion
                    651: occurred, but no warning or error, and
                    652: .Fl W Cm base
                    653: or
1.185     schwarze  654: .Fl W Cm style
                    655: was specified.
1.77      schwarze  656: .It 2
                    657: At least one warning occurred, but no error, and
1.156     schwarze  658: .Fl W Cm warning
1.202     schwarze  659: or a lower
                    660: .Ar level
                    661: was requested.
1.77      schwarze  662: .It 3
1.133     schwarze  663: At least one parsing error occurred,
                    664: but no unsupported feature was encountered, and
1.156     schwarze  665: .Fl W Cm error
1.185     schwarze  666: or a lower
                    667: .Ar level
                    668: was requested.
1.133     schwarze  669: .It 4
1.134     schwarze  670: At least one unsupported feature was encountered, and
1.185     schwarze  671: .Fl W Cm unsupp
                    672: or a lower
                    673: .Ar level
                    674: was requested.
1.77      schwarze  675: .It 5
                    676: Invalid command line arguments were specified.
                    677: No input files have been read.
                    678: .It 6
1.131     schwarze  679: An operating system error occurred, for example exhaustion
                    680: of memory, file descriptors, or process table entries.
1.77      schwarze  681: Such errors cause
                    682: .Nm
                    683: to exit at once, possibly in the middle of parsing or formatting a file.
                    684: .El
                    685: .Pp
                    686: Note that selecting
1.156     schwarze  687: .Fl T Cm lint
1.77      schwarze  688: output mode implies
1.202     schwarze  689: .Fl W Cm all .
1.1       kristaps  690: .Sh EXAMPLES
1.13      kristaps  691: To page manuals to the terminal:
1.1       kristaps  692: .Pp
1.187     schwarze  693: .Dl $ mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8
1.28      kristaps  694: .Pp
1.41      kristaps  695: To produce HTML manuals with
1.234     schwarze  696: .Pa /usr/share/misc/mandoc.css
1.41      kristaps  697: as the style-sheet:
1.38      kristaps  698: .Pp
1.234     schwarze  699: .Dl $ mandoc \-T html -O style=/usr/share/misc/mandoc.css mdoc.7 > mdoc.7.html
1.38      kristaps  700: .Pp
1.28      kristaps  701: To check over a large set of manuals:
                    702: .Pp
1.158     schwarze  703: .Dl $ mandoc \-T lint \(gafind /usr/src -name \e*\e.[1-9]\(ga
1.66      kristaps  704: .Pp
                    705: To produce a series of PostScript manuals for A4 paper:
                    706: .Pp
1.234     schwarze  707: .Dl $ mandoc \-T ps \-O paper=a4 mdoc.7 man.7 > manuals.ps
1.91      schwarze  708: .Pp
                    709: Convert a modern
                    710: .Xr mdoc 7
                    711: manual to the older
                    712: .Xr man 7
                    713: format, for use on systems lacking an
                    714: .Xr mdoc 7
                    715: parser:
                    716: .Pp
1.234     schwarze  717: .Dl $ mandoc \-T man foo.mdoc > foo.man
1.77      schwarze  718: .Sh DIAGNOSTICS
1.106     schwarze  719: Messages displayed by
                    720: .Nm
                    721: follow this format:
1.202     schwarze  722: .Bd -ragged -offset indent
1.205     schwarze  723: .Nm :
1.233     schwarze  724: .Ar file : Ns Ar line : Ns Ar column : level : message : macro arguments
1.202     schwarze  725: .Pq Ar os
                    726: .Ed
1.77      schwarze  727: .Pp
1.233     schwarze  728: The first three fields identify the
                    729: .Ar file
                    730: name,
                    731: .Ar line
                    732: number, and
                    733: .Ar column
                    734: number of the input file where the message was triggered.
                    735: The line and column numbers start at 1.
1.106     schwarze  736: Both are omitted for messages referring to an input file as a whole.
1.233     schwarze  737: All
                    738: .Ar level
                    739: and
                    740: .Ar message
                    741: strings are explained below.
                    742: The name of the
                    743: .Ar macro
                    744: triggering the message and its
                    745: .Ar arguments
                    746: are omitted where meaningless.
1.202     schwarze  747: The
                    748: .Ar os
                    749: operating system specifier is omitted for messages that are relevant
                    750: for all operating systems.
1.106     schwarze  751: Fatal messages about invalid command line arguments
                    752: or operating system errors, for example when memory is exhausted,
                    753: may also omit the
                    754: .Ar file
1.104     schwarze  755: and
1.106     schwarze  756: .Ar level
                    757: fields.
1.104     schwarze  758: .Pp
1.77      schwarze  759: Message levels have the following meanings:
                    760: .Bl -tag -width "warning"
1.133     schwarze  761: .It Cm unsupp
                    762: An input file uses unsupported low-level
                    763: .Xr roff 7
                    764: features.
                    765: The output may be incomplete and/or misformatted,
                    766: so using GNU troff instead of
                    767: .Nm
                    768: to process the file may be preferable.
1.77      schwarze  769: .It Cm error
1.216     schwarze  770: Indicates a risk of information loss or severe misformatting,
                    771: in most cases caused by serious syntax errors.
1.77      schwarze  772: .It Cm warning
1.216     schwarze  773: Indicates a risk that the information shown or its formatting
                    774: may mismatch the author's intent in minor ways.
                    775: Additionally, syntax errors are classified at least as warnings,
                    776: even if they do not usually cause misformatting.
1.185     schwarze  777: .It Cm style
                    778: An input file uses dubious or discouraged style.
                    779: This is not a complaint about the syntax, and probably neither
                    780: formatting nor portability are in danger.
                    781: While great care is taken to avoid false positives on the higher
                    782: message levels, the
                    783: .Cm style
                    784: level tries to reduce the probability that issues go unnoticed,
                    785: so it may occasionally issue bogus suggestions.
                    786: Please use your good judgement to decide whether any particular
                    787: .Cm style
                    788: suggestion really justifies a change to the input file.
1.202     schwarze  789: .It Cm base
1.219     schwarze  790: A convention used in the base system of a specific operating system
1.202     schwarze  791: is not adhered to.
                    792: These are not markup mistakes, and neither the quality of formatting
                    793: nor portability are in danger.
1.214     schwarze  794: Messages of the
                    795: .Cm base
                    796: level are printed with the more intuitive
                    797: .Cm style
                    798: .Ar level
                    799: tag.
1.77      schwarze  800: .El
                    801: .Pp
                    802: Messages of the
1.202     schwarze  803: .Cm base ,
1.185     schwarze  804: .Cm style ,
1.133     schwarze  805: .Cm warning ,
                    806: .Cm error ,
1.77      schwarze  807: and
1.133     schwarze  808: .Cm unsupp
1.131     schwarze  809: levels except those about non-existent or unreadable input files
                    810: are hidden unless their level, or a lower level, is requested using a
1.77      schwarze  811: .Fl W
                    812: option or
1.156     schwarze  813: .Fl T Cm lint
1.77      schwarze  814: output mode.
1.202     schwarze  815: .Pp
                    816: As indicated below, all
                    817: .Cm base
                    818: and some
                    819: .Cm style
                    820: checks are only performed if a specific operating system name occurs
                    821: in the arguments of the
                    822: .Fl W
                    823: command line option, of the
1.195     schwarze  824: .Ic \&Os
                    825: macro, of the
                    826: .Fl Ios
                    827: command line option, or, if neither are present, in the return value
                    828: of the
                    829: .Xr uname 3
                    830: function.
1.202     schwarze  831: .Ss Conventions for base system manuals
1.189     schwarze  832: .Bl -ohang
1.200     schwarze  833: .It Sy "Mdocdate found"
                    834: .Pq mdoc , Nx
                    835: The
                    836: .Ic \&Dd
                    837: macro uses CVS
                    838: .Ic Mdocdate
                    839: keyword substitution, which is not supported by the
                    840: .Nx
                    841: base system.
                    842: Consider using the conventional
                    843: .Dq "Month dd, yyyy"
                    844: format instead.
                    845: .It Sy "Mdocdate missing"
                    846: .Pq mdoc , Ox
                    847: The
                    848: .Ic \&Dd
                    849: macro does not use CVS
                    850: .Ic Mdocdate
                    851: keyword substitution, but using it is conventionally expected in the
                    852: .Ox
                    853: base system.
1.204     schwarze  854: .It Sy "unknown architecture"
                    855: .Pq mdoc , Ox , Nx
                    856: The third argument of the
                    857: .Ic \&Dt
                    858: macro does not match any of the architectures this operating system
                    859: is running on.
1.203     schwarze  860: .It Sy "operating system explicitly specified"
                    861: .Pq mdoc , Ox , Nx
                    862: The
                    863: .Ic \&Os
                    864: macro has an argument.
                    865: In the base system, it is conventionally left blank.
1.202     schwarze  866: .It Sy "RCS id missing"
                    867: .Pq Ox , Nx
                    868: The manual page lacks the comment line with the RCS identifier
                    869: generated by CVS
                    870: .Ic OpenBSD
                    871: or
                    872: .Ic NetBSD
                    873: keyword substitution as conventionally used in these operating systems.
1.210     schwarze  874: .It Sy "referenced manual not found"
                    875: .Pq mdoc
                    876: An
                    877: .Ic \&Xr
                    878: macro references a manual page that is not found in the base system.
                    879: The path to look for base system manuals is configurable at compile
                    880: time and defaults to
                    881: .Pa /usr/share/man : /usr/X11R6/man .
1.202     schwarze  882: .El
                    883: .Ss Style suggestions
                    884: .Bl -ohang
1.200     schwarze  885: .It Sy "legacy man(7) date format"
                    886: .Pq mdoc
                    887: The
                    888: .Ic \&Dd
                    889: macro uses the legacy
                    890: .Xr man 7
                    891: date format
                    892: .Dq yyyy-dd-mm .
                    893: Consider using the conventional
                    894: .Xr mdoc 7
                    895: date format
                    896: .Dq "Month dd, yyyy"
                    897: instead.
1.226     schwarze  898: .It Sy "normalizing date format to" : No ...
                    899: .Pq mdoc , man
                    900: The
                    901: .Ic \&Dd
                    902: or
                    903: .Ic \&TH
                    904: macro provides an abbreviated month name or a day number with a
                    905: leading zero.
                    906: In the formatted output, the month name is written out in full
                    907: and the leading zero is omitted.
1.215     schwarze  908: .It Sy "lower case character in document title"
                    909: .Pq mdoc , man
                    910: The title is still used as given in the
                    911: .Ic \&Dt
                    912: or
                    913: .Ic \&TH
                    914: macro.
1.201     schwarze  915: .It Sy "duplicate RCS id"
                    916: A single manual page contains two copies of the RCS identifier for
                    917: the same operating system.
                    918: Consider deleting the later instance and moving the first one up
                    919: to the top of the page.
1.220     schwarze  920: .It Sy "possible typo in section name"
1.207     schwarze  921: .Pq mdoc
                    922: Fuzzy string matching revealed that the argument of an
                    923: .Ic \&Sh
                    924: macro is similar, but not identical to a standard section name.
1.215     schwarze  925: .It Sy "unterminated quoted argument"
                    926: .Pq roff
                    927: Macro arguments can be enclosed in double quote characters
                    928: such that space characters and macro names contained in the quoted
                    929: argument need not be escaped.
                    930: The closing quote of the last argument of a macro can be omitted.
                    931: However, omitting it is not recommended because it makes the code
                    932: harder to read.
1.189     schwarze  933: .It Sy "useless macro"
                    934: .Pq mdoc
                    935: A
                    936: .Ic \&Bt ,
                    937: .Ic \&Tn ,
                    938: or
1.190     schwarze  939: .Ic \&Ud
1.189     schwarze  940: macro was found.
1.190     schwarze  941: Simply delete it: it serves no useful purpose.
1.191     schwarze  942: .It Sy "consider using OS macro"
                    943: .Pq mdoc
                    944: A string was found in plain text or in a
                    945: .Ic \&Bx
                    946: macro that could be represented using
                    947: .Ic \&Ox ,
                    948: .Ic \&Nx ,
                    949: .Ic \&Fx ,
                    950: or
                    951: .Ic \&Dx .
1.195     schwarze  952: .It Sy "errnos out of order"
                    953: .Pq mdoc, Nx
                    954: The
                    955: .Ic \&Er
                    956: items in a
                    957: .Ic \&Bl
                    958: list are not in alphabetical order.
                    959: .It Sy "duplicate errno"
                    960: .Pq mdoc, Nx
                    961: A
                    962: .Ic \&Bl
                    963: list contains two consecutive
                    964: .Ic \&It
                    965: entries describing the same
                    966: .Ic \&Er
                    967: number.
1.213     schwarze  968: .It Sy "trailing delimiter"
1.192     schwarze  969: .Pq mdoc
1.213     schwarze  970: The last argument of an
                    971: .Ic \&Ex , \&Fo , \&Nd , \&Nm , \&Os , \&Sh , \&Ss , \&St ,
                    972: or
                    973: .Ic \&Sx
                    974: macro ends with a trailing delimiter.
                    975: This is usually bad style and often indicates typos.
                    976: Most likely, the delimiter can be removed.
1.197     schwarze  977: .It Sy "no blank before trailing delimiter"
1.198     schwarze  978: .Pq mdoc
1.197     schwarze  979: The last argument of a macro that supports trailing delimiter
                    980: arguments is longer than one byte and ends with a trailing delimiter.
                    981: Consider inserting a blank such that the delimiter becomes a separate
                    982: argument, thus moving it out of the scope of the macro.
1.215     schwarze  983: .It Sy "fill mode already enabled, skipping"
                    984: .Pq man
                    985: A
                    986: .Ic \&fi
                    987: request occurs even though the document is still in fill mode,
                    988: or already switched back to fill mode.
                    989: It has no effect.
                    990: .It Sy "fill mode already disabled, skipping"
                    991: .Pq man
                    992: An
                    993: .Ic \&nf
                    994: request occurs even though the document already switched to no-fill mode
                    995: and did not switch back to fill mode yet.
                    996: It has no effect.
1.222     schwarze  997: .It Sy "verbatim \(dq--\(dq, maybe consider using \e(em"
                    998: .Pq mdoc
                    999: Even though the ASCII output device renders an em-dash as
                   1000: .Qq \-\- ,
                   1001: that is not a good way to write it in an input file
                   1002: because it renders poorly on all other output devices.
1.198     schwarze 1003: .It Sy "function name without markup"
                   1004: .Pq mdoc
                   1005: A word followed by an empty pair of parentheses occurs on a text line.
                   1006: Consider using an
                   1007: .Ic \&Fn
                   1008: or
                   1009: .Ic \&Xr
                   1010: macro.
1.215     schwarze 1011: .It Sy "whitespace at end of input line"
                   1012: .Pq mdoc , man , roff
                   1013: Whitespace at the end of input lines is almost never semantically
                   1014: significant \(em but in the odd case where it might be, it is
                   1015: extremely confusing when reviewing and maintaining documents.
                   1016: .It Sy "bad comment style"
                   1017: .Pq roff
                   1018: Comment lines start with a dot, a backslash, and a double-quote character.
                   1019: The
                   1020: .Nm
                   1021: utility treats the line as a comment line even without the backslash,
                   1022: but leaving out the backslash might not be portable.
1.189     schwarze 1023: .El
1.106     schwarze 1024: .Ss Warnings related to the document prologue
                   1025: .Bl -ohang
                   1026: .It Sy "missing manual title, using UNTITLED"
                   1027: .Pq mdoc
                   1028: A
                   1029: .Ic \&Dt
                   1030: macro has no arguments, or there is no
                   1031: .Ic \&Dt
                   1032: macro before the first non-prologue macro.
                   1033: .It Sy "missing manual title, using \(dq\(dq"
                   1034: .Pq man
                   1035: There is no
                   1036: .Ic \&TH
                   1037: macro, or it has no arguments.
                   1038: .It Sy "missing manual section, using \(dq\(dq"
                   1039: .Pq mdoc , man
                   1040: A
                   1041: .Ic \&Dt
                   1042: or
                   1043: .Ic \&TH
                   1044: macro lacks the mandatory section argument.
                   1045: .It Sy "unknown manual section"
                   1046: .Pq mdoc
                   1047: The section number in a
                   1048: .Ic \&Dt
                   1049: line is invalid, but still used.
                   1050: .It Sy "missing date, using today's date"
                   1051: .Pq mdoc, man
                   1052: The document was parsed as
                   1053: .Xr mdoc 7
                   1054: and it has no
                   1055: .Ic \&Dd
                   1056: macro, or the
                   1057: .Ic \&Dd
                   1058: macro has no arguments or only empty arguments;
                   1059: or the document was parsed as
                   1060: .Xr man 7
                   1061: and it has no
                   1062: .Ic \&TH
                   1063: macro, or the
                   1064: .Ic \&TH
                   1065: macro has less than three arguments or its third argument is empty.
                   1066: .It Sy "cannot parse date, using it verbatim"
                   1067: .Pq mdoc , man
                   1068: The date given in a
                   1069: .Ic \&Dd
                   1070: or
                   1071: .Ic \&TH
                   1072: macro does not follow the conventional format.
1.212     schwarze 1073: .It Sy "date in the future, using it anyway"
                   1074: .Pq mdoc , man
                   1075: The date given in a
                   1076: .Ic \&Dd
                   1077: or
                   1078: .Ic \&TH
                   1079: macro is more than a day ahead of the current system
                   1080: .Xr time 3 .
1.106     schwarze 1081: .It Sy "missing Os macro, using \(dq\(dq"
                   1082: .Pq mdoc
                   1083: The default or current system is not shown in this case.
                   1084: .It Sy "late prologue macro"
                   1085: .Pq mdoc
                   1086: A
                   1087: .Ic \&Dd
                   1088: or
                   1089: .Ic \&Os
                   1090: macro occurs after some non-prologue macro, but still takes effect.
                   1091: .It Sy "prologue macros out of order"
                   1092: .Pq mdoc
                   1093: The prologue macros are not given in the conventional order
                   1094: .Ic \&Dd ,
                   1095: .Ic \&Dt ,
                   1096: .Ic \&Os .
                   1097: All three macros are used even when given in another order.
                   1098: .El
                   1099: .Ss Warnings regarding document structure
                   1100: .Bl -ohang
                   1101: .It Sy ".so is fragile, better use ln(1)"
                   1102: .Pq roff
                   1103: Including files only works when the parser program runs with the correct
                   1104: current working directory.
                   1105: .It Sy "no document body"
                   1106: .Pq mdoc , man
                   1107: The document body contains neither text nor macros.
                   1108: An empty document is shown, consisting only of a header and a footer line.
                   1109: .It Sy "content before first section header"
                   1110: .Pq mdoc , man
                   1111: Some macros or text precede the first
                   1112: .Ic \&Sh
                   1113: or
                   1114: .Ic \&SH
                   1115: section header.
                   1116: The offending macros and text are parsed and added to the top level
                   1117: of the syntax tree, outside any section block.
                   1118: .It Sy "first section is not NAME"
                   1119: .Pq mdoc
                   1120: The argument of the first
                   1121: .Ic \&Sh
                   1122: macro is not
                   1123: .Sq NAME .
                   1124: This may confuse
                   1125: .Xr makewhatis 8
                   1126: and
                   1127: .Xr apropos 1 .
1.168     schwarze 1128: .It Sy "NAME section without Nm before Nd"
1.106     schwarze 1129: .Pq mdoc
1.155     schwarze 1130: The NAME section does not contain any
                   1131: .Ic \&Nm
1.168     schwarze 1132: child macro before the first
                   1133: .Ic \&Nd
                   1134: macro.
1.155     schwarze 1135: .It Sy "NAME section without description"
                   1136: .Pq mdoc
                   1137: The NAME section lacks the mandatory
                   1138: .Ic \&Nd
                   1139: child macro.
                   1140: .It Sy "description not at the end of NAME"
                   1141: .Pq mdoc
                   1142: The NAME section does contain an
1.106     schwarze 1143: .Ic \&Nd
1.155     schwarze 1144: child macro, but other content follows it.
                   1145: .It Sy "bad NAME section content"
                   1146: .Pq mdoc
                   1147: The NAME section contains plain text or macros other than
                   1148: .Ic \&Nm
1.106     schwarze 1149: and
1.155     schwarze 1150: .Ic \&Nd .
1.168     schwarze 1151: .It Sy "missing comma before name"
                   1152: .Pq mdoc
                   1153: The NAME section contains an
                   1154: .Ic \&Nm
                   1155: macro that is neither the first one nor preceded by a comma.
1.142     schwarze 1156: .It Sy "missing description line, using \(dq\(dq"
                   1157: .Pq mdoc
                   1158: The
                   1159: .Ic \&Nd
                   1160: macro lacks the required argument.
                   1161: The title line of the manual will end after the dash.
1.177     schwarze 1162: .It Sy "description line outside NAME section"
                   1163: .Pq mdoc
                   1164: An
                   1165: .Ic \&Nd
                   1166: macro appears outside the NAME section.
                   1167: The arguments are printed anyway and the following text is used for
                   1168: .Xr apropos 1 ,
                   1169: but none of that behaviour is portable.
1.106     schwarze 1170: .It Sy "sections out of conventional order"
                   1171: .Pq mdoc
                   1172: A standard section occurs after another section it usually precedes.
                   1173: All section titles are used as given,
                   1174: and the order of sections is not changed.
                   1175: .It Sy "duplicate section title"
                   1176: .Pq mdoc
                   1177: The same standard section title occurs more than once.
                   1178: .It Sy "unexpected section"
                   1179: .Pq mdoc
                   1180: A standard section header occurs in a section of the manual
                   1181: where it normally isn't useful.
1.211     schwarze 1182: .It Sy "cross reference to self"
                   1183: .Pq mdoc
                   1184: An
                   1185: .Ic \&Xr
                   1186: macro refers to a name and section matching the section of the present
                   1187: manual page and a name mentioned in an
                   1188: .Ic \&Nm
                   1189: macro in the NAME or SYNOPSIS section, or in an
                   1190: .Ic \&Fn
                   1191: or
                   1192: .Ic \&Fo
                   1193: macro in the SYNOPSIS.
                   1194: Consider using
                   1195: .Ic \&Nm
                   1196: or
                   1197: .Ic \&Fn
                   1198: instead of
                   1199: .Ic \&Xr .
1.112     schwarze 1200: .It Sy "unusual Xr order"
                   1201: .Pq mdoc
                   1202: In the SEE ALSO section, an
                   1203: .Ic \&Xr
                   1204: macro with a lower section number follows one with a higher number,
                   1205: or two
                   1206: .Ic \&Xr
1.157     schwarze 1207: macros referring to the same section are out of alphabetical order.
1.112     schwarze 1208: .It Sy "unusual Xr punctuation"
                   1209: .Pq mdoc
                   1210: In the SEE ALSO section, punctuation between two
                   1211: .Ic \&Xr
                   1212: macros differs from a single comma, or there is trailing punctuation
                   1213: after the last
                   1214: .Ic \&Xr
                   1215: macro.
1.111     schwarze 1216: .It Sy "AUTHORS section without An macro"
                   1217: .Pq mdoc
                   1218: An AUTHORS sections contains no
                   1219: .Ic \&An
                   1220: macros, or only empty ones.
                   1221: Probably, there are author names lacking markup.
1.106     schwarze 1222: .El
                   1223: .Ss "Warnings related to macros and nesting"
                   1224: .Bl -ohang
                   1225: .It Sy "obsolete macro"
                   1226: .Pq mdoc
                   1227: See the
                   1228: .Xr mdoc 7
                   1229: manual for replacements.
1.126     schwarze 1230: .It Sy "macro neither callable nor escaped"
                   1231: .Pq mdoc
                   1232: The name of a macro that is not callable appears on a macro line.
                   1233: It is printed verbatim.
1.152     schwarze 1234: If the intention is to call it, move it to its own input line;
1.126     schwarze 1235: otherwise, escape it by prepending
                   1236: .Sq \e& .
1.106     schwarze 1237: .It Sy "skipping paragraph macro"
                   1238: In
                   1239: .Xr mdoc 7
                   1240: documents, this happens
                   1241: .Bl -dash -compact
                   1242: .It
                   1243: at the beginning and end of sections and subsections
                   1244: .It
                   1245: right before non-compact lists and displays
                   1246: .It
                   1247: at the end of items in non-column, non-compact lists
                   1248: .It
                   1249: and for multiple consecutive paragraph macros.
                   1250: .El
                   1251: In
                   1252: .Xr man 7
                   1253: documents, it happens
                   1254: .Bl -dash -compact
                   1255: .It
                   1256: for empty
                   1257: .Ic \&P ,
                   1258: .Ic \&PP ,
                   1259: and
                   1260: .Ic \&LP
                   1261: macros
                   1262: .It
                   1263: for
                   1264: .Ic \&IP
                   1265: macros having neither head nor body arguments
                   1266: .It
                   1267: for
                   1268: .Ic \&br
                   1269: or
                   1270: .Ic \&sp
                   1271: right after
                   1272: .Ic \&SH
                   1273: or
                   1274: .Ic \&SS
                   1275: .El
                   1276: .It Sy "moving paragraph macro out of list"
                   1277: .Pq mdoc
                   1278: A list item in a
                   1279: .Ic \&Bl
                   1280: list contains a trailing paragraph macro.
                   1281: The paragraph macro is moved after the end of the list.
                   1282: .It Sy "skipping no-space macro"
                   1283: .Pq mdoc
                   1284: An input line begins with an
                   1285: .Ic \&Ns
1.208     schwarze 1286: macro, or the next argument after an
                   1287: .Ic \&Ns
                   1288: macro is an isolated closing delimiter.
1.106     schwarze 1289: The macro is ignored.
                   1290: .It Sy "blocks badly nested"
                   1291: .Pq mdoc
                   1292: If two blocks intersect, one should completely contain the other.
                   1293: Otherwise, rendered output is likely to look strange in any output
                   1294: format, and rendering in SGML-based output formats is likely to be
                   1295: outright wrong because such languages do not support badly nested
                   1296: blocks at all.
                   1297: Typical examples of badly nested blocks are
                   1298: .Qq Ic \&Ao \&Bo \&Ac \&Bc
                   1299: and
                   1300: .Qq Ic \&Ao \&Bq \&Ac .
                   1301: In these examples,
                   1302: .Ic \&Ac
                   1303: breaks
                   1304: .Ic \&Bo
                   1305: and
                   1306: .Ic \&Bq ,
                   1307: respectively.
                   1308: .It Sy "nested displays are not portable"
                   1309: .Pq mdoc
                   1310: A
                   1311: .Ic \&Bd ,
                   1312: .Ic \&D1 ,
                   1313: or
                   1314: .Ic \&Dl
                   1315: display occurs nested inside another
                   1316: .Ic \&Bd
                   1317: display.
                   1318: This works with
                   1319: .Nm ,
                   1320: but fails with most other implementations.
                   1321: .It Sy "moving content out of list"
                   1322: .Pq mdoc
                   1323: A
                   1324: .Ic \&Bl
                   1325: list block contains text or macros before the first
                   1326: .Ic \&It
                   1327: macro.
                   1328: The offending children are moved before the beginning of the list.
1.209     schwarze 1329: .It Sy "first macro on line"
                   1330: Inside a
                   1331: .Ic \&Bl Fl column
                   1332: list, a
                   1333: .Ic \&Ta
                   1334: macro occurs as the first macro on a line, which is not portable.
1.106     schwarze 1335: .It Sy "line scope broken"
                   1336: .Pq man
                   1337: While parsing the next-line scope of the previous macro,
                   1338: another macro is found that prematurely terminates the previous one.
                   1339: The previous, interrupted macro is deleted from the parse tree.
                   1340: .El
                   1341: .Ss "Warnings related to missing arguments"
                   1342: .Bl -ohang
                   1343: .It Sy "skipping empty request"
1.118     schwarze 1344: .Pq roff , eqn
                   1345: The macro name is missing from a macro definition request,
                   1346: or an
                   1347: .Xr eqn 7
                   1348: control statement or operation keyword lacks its required argument.
1.106     schwarze 1349: .It Sy "conditional request controls empty scope"
                   1350: .Pq roff
                   1351: A conditional request is only useful if any of the following
                   1352: follows it on the same logical input line:
                   1353: .Bl -dash -compact
                   1354: .It
                   1355: The
                   1356: .Sq \e{
                   1357: keyword to open a multi-line scope.
                   1358: .It
                   1359: A request or macro or some text, resulting in a single-line scope.
                   1360: .It
                   1361: The immediate end of the logical line without any intervening whitespace,
                   1362: resulting in next-line scope.
                   1363: .El
                   1364: Here, a conditional request is followed by trailing whitespace only,
                   1365: and there is no other content on its logical input line.
                   1366: Note that it doesn't matter whether the logical input line is split
                   1367: across multiple physical input lines using
                   1368: .Sq \e
                   1369: line continuation characters.
                   1370: This is one of the rare cases
                   1371: where trailing whitespace is syntactically significant.
                   1372: The conditional request controls a scope containing whitespace only,
                   1373: so it is unlikely to have a significant effect,
                   1374: except that it may control a following
                   1375: .Ic \&el
                   1376: clause.
                   1377: .It Sy "skipping empty macro"
                   1378: .Pq mdoc
1.147     schwarze 1379: The indicated macro has no arguments and hence no effect.
                   1380: .It Sy "empty block"
                   1381: .Pq mdoc , man
                   1382: A
                   1383: .Ic \&Bd ,
                   1384: .Ic \&Bk ,
                   1385: .Ic \&Bl ,
                   1386: .Ic \&D1 ,
                   1387: .Ic \&Dl ,
1.206     schwarze 1388: .Ic \&MT ,
1.147     schwarze 1389: .Ic \&RS ,
                   1390: or
                   1391: .Ic \&UR
                   1392: block contains nothing in its body and will produce no output.
1.106     schwarze 1393: .It Sy "empty argument, using 0n"
                   1394: .Pq mdoc
                   1395: The required width is missing after
                   1396: .Ic \&Bd
                   1397: or
                   1398: .Ic \&Bl
                   1399: .Fl offset
                   1400: or
1.186     schwarze 1401: .Fl width .
1.106     schwarze 1402: .It Sy "missing display type, using -ragged"
                   1403: .Pq mdoc
                   1404: The
                   1405: .Ic \&Bd
                   1406: macro is invoked without the required display type.
                   1407: .It Sy "list type is not the first argument"
                   1408: .Pq mdoc
                   1409: In a
                   1410: .Ic \&Bl
                   1411: macro, at least one other argument precedes the type argument.
                   1412: The
                   1413: .Nm
                   1414: utility copes with any argument order, but some other
                   1415: .Xr mdoc 7
                   1416: implementations do not.
                   1417: .It Sy "missing -width in -tag list, using 8n"
                   1418: .Pq mdoc
                   1419: Every
                   1420: .Ic \&Bl
                   1421: macro having the
                   1422: .Fl tag
                   1423: argument requires
                   1424: .Fl width ,
                   1425: too.
                   1426: .It Sy "missing utility name, using \(dq\(dq"
                   1427: .Pq mdoc
                   1428: The
                   1429: .Ic \&Ex Fl std
                   1430: macro is called without an argument before
                   1431: .Ic \&Nm
                   1432: has first been called with an argument.
1.146     schwarze 1433: .It Sy "missing function name, using \(dq\(dq"
                   1434: .Pq mdoc
                   1435: The
                   1436: .Ic \&Fo
                   1437: macro is called without an argument.
                   1438: No function name is printed.
1.106     schwarze 1439: .It Sy "empty head in list item"
                   1440: .Pq mdoc
                   1441: In a
                   1442: .Ic \&Bl
                   1443: .Fl diag ,
                   1444: .Fl hang ,
                   1445: .Fl inset ,
                   1446: .Fl ohang ,
                   1447: or
                   1448: .Fl tag
                   1449: list, an
                   1450: .Ic \&It
                   1451: macro lacks the required argument.
                   1452: The item head is left empty.
                   1453: .It Sy "empty list item"
                   1454: .Pq mdoc
                   1455: In a
                   1456: .Ic \&Bl
                   1457: .Fl bullet ,
                   1458: .Fl dash ,
                   1459: .Fl enum ,
                   1460: or
                   1461: .Fl hyphen
                   1462: list, an
                   1463: .Ic \&It
                   1464: block is empty.
                   1465: An empty list item is shown.
1.209     schwarze 1466: .It Sy "missing argument, using next line"
                   1467: .Pq mdoc
                   1468: An
                   1469: .Ic \&It
                   1470: macro in a
                   1471: .Ic \&Bd Fl column
                   1472: list has no arguments.
                   1473: While
                   1474: .Nm
                   1475: uses the text or macros of the following line, if any, for the cell,
                   1476: other formatters may misformat the list.
1.152     schwarze 1477: .It Sy "missing font type, using \efR"
1.106     schwarze 1478: .Pq mdoc
                   1479: A
                   1480: .Ic \&Bf
                   1481: macro has no argument.
1.152     schwarze 1482: It switches to the default font.
                   1483: .It Sy "unknown font type, using \efR"
1.106     schwarze 1484: .Pq mdoc
                   1485: The
                   1486: .Ic \&Bf
                   1487: argument is invalid.
1.152     schwarze 1488: The default font is used instead.
1.127     schwarze 1489: .It Sy "nothing follows prefix"
                   1490: .Pq mdoc
                   1491: A
                   1492: .Ic \&Pf
                   1493: macro has no argument, or only one argument and no macro follows
                   1494: on the same input line.
                   1495: This defeats its purpose; in particular, spacing is not suppressed
                   1496: before the text or macros following on the next input line.
1.143     schwarze 1497: .It Sy "empty reference block"
                   1498: .Pq mdoc
                   1499: An
                   1500: .Ic \&Rs
                   1501: macro is immediately followed by an
                   1502: .Ic \&Re
                   1503: macro on the next input line.
                   1504: Such an empty block does not produce any output.
1.165     schwarze 1505: .It Sy "missing section argument"
                   1506: .Pq mdoc
                   1507: An
                   1508: .Ic \&Xr
                   1509: macro lacks its second, section number argument.
                   1510: The first argument, i.e. the name, is printed, but without subsequent
1.166     schwarze 1511: parentheses.
1.106     schwarze 1512: .It Sy "missing -std argument, adding it"
                   1513: .Pq mdoc
                   1514: An
                   1515: .Ic \&Ex
                   1516: or
                   1517: .Ic \&Rv
                   1518: macro lacks the required
                   1519: .Fl std
                   1520: argument.
                   1521: The
                   1522: .Nm
                   1523: utility assumes
                   1524: .Fl std
                   1525: even when it is not specified, but other implementations may not.
1.150     schwarze 1526: .It Sy "missing option string, using \(dq\(dq"
                   1527: .Pq man
                   1528: The
                   1529: .Ic \&OP
                   1530: macro is invoked without any argument.
                   1531: An empty pair of square brackets is shown.
                   1532: .It Sy "missing resource identifier, using \(dq\(dq"
                   1533: .Pq man
                   1534: The
1.206     schwarze 1535: .Ic \&MT
                   1536: or
1.150     schwarze 1537: .Ic \&UR
                   1538: macro is invoked without any argument.
                   1539: An empty pair of angle brackets is shown.
1.118     schwarze 1540: .It Sy "missing eqn box, using \(dq\(dq"
                   1541: .Pq eqn
                   1542: A diacritic mark or a binary operator is found,
                   1543: but there is nothing to the left of it.
                   1544: An empty box is inserted.
1.106     schwarze 1545: .El
                   1546: .Ss "Warnings related to bad macro arguments"
                   1547: .Bl -ohang
                   1548: .It Sy "duplicate argument"
                   1549: .Pq mdoc
                   1550: A
                   1551: .Ic \&Bd
                   1552: or
                   1553: .Ic \&Bl
                   1554: macro has more than one
                   1555: .Fl compact ,
                   1556: more than one
                   1557: .Fl offset ,
                   1558: or more than one
                   1559: .Fl width
                   1560: argument.
                   1561: All but the last instances of these arguments are ignored.
                   1562: .It Sy "skipping duplicate argument"
                   1563: .Pq mdoc
                   1564: An
                   1565: .Ic \&An
                   1566: macro has more than one
                   1567: .Fl split
                   1568: or
                   1569: .Fl nosplit
                   1570: argument.
                   1571: All but the first of these arguments are ignored.
                   1572: .It Sy "skipping duplicate display type"
                   1573: .Pq mdoc
                   1574: A
                   1575: .Ic \&Bd
                   1576: macro has more than one type argument; the first one is used.
                   1577: .It Sy "skipping duplicate list type"
                   1578: .Pq mdoc
                   1579: A
                   1580: .Ic \&Bl
                   1581: macro has more than one type argument; the first one is used.
                   1582: .It Sy "skipping -width argument"
                   1583: .Pq mdoc
                   1584: A
                   1585: .Ic \&Bl
                   1586: .Fl column ,
                   1587: .Fl diag ,
                   1588: .Fl ohang ,
                   1589: .Fl inset ,
                   1590: or
                   1591: .Fl item
                   1592: list has a
                   1593: .Fl width
                   1594: argument.
                   1595: That has no effect.
1.151     schwarze 1596: .It Sy "wrong number of cells"
                   1597: In a line of a
                   1598: .Ic \&Bl Fl column
                   1599: list, the number of tabs or
                   1600: .Ic \&Ta
                   1601: macros is less than the number expected from the list header line
                   1602: or exceeds the expected number by more than one.
                   1603: Missing cells remain empty, and all cells exceeding the number of
                   1604: columns are joined into one single cell.
1.106     schwarze 1605: .It Sy "unknown AT&T UNIX version"
                   1606: .Pq mdoc
                   1607: An
                   1608: .Ic \&At
                   1609: macro has an invalid argument.
                   1610: It is used verbatim, with
                   1611: .Qq "AT&T UNIX "
                   1612: prefixed to it.
1.113     schwarze 1613: .It Sy "comma in function argument"
                   1614: .Pq mdoc
                   1615: An argument of an
                   1616: .Ic \&Fa
                   1617: or
                   1618: .Ic \&Fn
                   1619: macro contains a comma; it should probably be split into two arguments.
1.117     schwarze 1620: .It Sy "parenthesis in function name"
                   1621: .Pq mdoc
                   1622: The first argument of an
                   1623: .Ic \&Fc
                   1624: or
                   1625: .Ic \&Fn
                   1626: macro contains an opening or closing parenthesis; that's probably wrong,
                   1627: parentheses are added automatically.
1.196     schwarze 1628: .It Sy "unknown library name"
                   1629: .Pq mdoc, not on Ox
                   1630: An
                   1631: .Ic \&Lb
                   1632: macro has an unknown name argument and will be rendered as
                   1633: .Qq library Dq Ar name .
1.106     schwarze 1634: .It Sy "invalid content in Rs block"
                   1635: .Pq mdoc
                   1636: An
                   1637: .Ic \&Rs
                   1638: block contains plain text or non-% macros.
                   1639: The bogus content is left in the syntax tree.
                   1640: Formatting may be poor.
                   1641: .It Sy "invalid Boolean argument"
                   1642: .Pq mdoc
                   1643: An
                   1644: .Ic \&Sm
                   1645: macro has an argument other than
                   1646: .Cm on
                   1647: or
                   1648: .Cm off .
                   1649: The invalid argument is moved out of the macro, which leaves the macro
                   1650: empty, causing it to toggle the spacing mode.
1.228     schwarze 1651: .It Sy "argument contains two font escapes"
                   1652: .Pq roff
                   1653: The second argument of a
                   1654: .Ic char
                   1655: request contains more than one font escape sequence.
                   1656: A wrong font may remain active after using the character.
1.106     schwarze 1657: .It Sy "unknown font, skipping request"
1.115     schwarze 1658: .Pq man , tbl
1.106     schwarze 1659: A
                   1660: .Xr roff 7
                   1661: .Ic \&ft
1.115     schwarze 1662: request or a
                   1663: .Xr tbl 7
                   1664: .Ic \&f
                   1665: layout modifier has an unknown
                   1666: .Ar font
                   1667: argument.
1.151     schwarze 1668: .It Sy "odd number of characters in request"
                   1669: .Pq roff
                   1670: A
                   1671: .Ic \&tr
                   1672: request contains an odd number of characters.
                   1673: The last character is mapped to the blank character.
1.106     schwarze 1674: .El
                   1675: .Ss "Warnings related to plain text"
                   1676: .Bl -ohang
                   1677: .It Sy "blank line in fill mode, using .sp"
                   1678: .Pq mdoc
                   1679: The meaning of blank input lines is only well-defined in non-fill mode:
                   1680: In fill mode, line breaks of text input lines are not supposed to be
                   1681: significant.
                   1682: However, for compatibility with groff, blank lines in fill mode
                   1683: are replaced with
                   1684: .Ic \&sp
                   1685: requests.
                   1686: .It Sy "tab in filled text"
                   1687: .Pq mdoc , man
                   1688: The meaning of tab characters is only well-defined in non-fill mode:
                   1689: In fill mode, whitespace is not supposed to be significant
                   1690: on text input lines.
                   1691: As an implementation dependent choice, tab characters on text lines
                   1692: are passed through to the formatters in any case.
                   1693: Given that the text before the tab character will be filled,
                   1694: it is hard to predict which tab stop position the tab will advance to.
1.172     schwarze 1695: .It Sy "new sentence, new line"
                   1696: .Pq mdoc
                   1697: A new sentence starts in the middle of a text line.
                   1698: Start it on a new input line to help formatters produce correct spacing.
1.106     schwarze 1699: .It Sy "invalid escape sequence"
                   1700: .Pq roff
                   1701: An escape sequence has an invalid opening argument delimiter, lacks the
1.232     schwarze 1702: closing argument delimiter, the argument is of an invalid form, or it is
                   1703: a character escape sequence with an invalid name.
1.106     schwarze 1704: If the argument is incomplete,
                   1705: .Ic \e*
                   1706: and
                   1707: .Ic \en
                   1708: expand to an empty string,
                   1709: .Ic \eB
                   1710: to the digit
                   1711: .Sq 0 ,
                   1712: and
                   1713: .Ic \ew
                   1714: to the length of the incomplete argument.
                   1715: All other invalid escape sequences are ignored.
1.232     schwarze 1716: .It Sy "undefined escape, printing literally"
                   1717: .Pq roff
                   1718: In an escape sequence, the first character
                   1719: right after the leading backslash is invalid.
                   1720: That character is printed literally,
                   1721: which is equivalent to ignoring the backslash.
1.106     schwarze 1722: .It Sy "undefined string, using \(dq\(dq"
                   1723: .Pq roff
                   1724: If a string is used without being defined before,
                   1725: its value is implicitly set to the empty string.
                   1726: However, defining strings explicitly before use
                   1727: keeps the code more readable.
                   1728: .El
1.138     schwarze 1729: .Ss "Warnings related to tables"
                   1730: .Bl -ohang
                   1731: .It Sy "tbl line starts with span"
                   1732: .Pq tbl
                   1733: The first cell in a table layout line is a horizontal span
                   1734: .Pq Sq Cm s .
                   1735: Data provided for this cell is ignored, and nothing is printed in the cell.
                   1736: .It Sy "tbl column starts with span"
                   1737: .Pq tbl
                   1738: The first line of a table layout specification
                   1739: requests a vertical span
                   1740: .Pq Sq Cm ^ .
                   1741: Data provided for this cell is ignored, and nothing is printed in the cell.
                   1742: .It Sy "skipping vertical bar in tbl layout"
                   1743: .Pq tbl
                   1744: A table layout specification contains more than two consecutive vertical bars.
                   1745: A double bar is printed, all additional bars are discarded.
1.106     schwarze 1746: .El
                   1747: .Ss "Errors related to tables"
1.136     schwarze 1748: .Bl -ohang
                   1749: .It Sy "non-alphabetic character in tbl options"
                   1750: .Pq tbl
                   1751: The table options line contains a character other than a letter,
                   1752: blank, or comma where the beginning of an option name is expected.
                   1753: The character is ignored.
                   1754: .It Sy "skipping unknown tbl option"
                   1755: .Pq tbl
                   1756: The table options line contains a string of letters that does not
                   1757: match any known option name.
                   1758: The word is ignored.
                   1759: .It Sy "missing tbl option argument"
                   1760: .Pq tbl
                   1761: A table option that requires an argument is not followed by an
                   1762: opening parenthesis, or the opening parenthesis is immediately
                   1763: followed by a closing parenthesis.
                   1764: The option is ignored.
                   1765: .It Sy "wrong tbl option argument size"
                   1766: .Pq tbl
                   1767: A table option argument contains an invalid number of characters.
                   1768: Both the option and the argument are ignored.
1.138     schwarze 1769: .It Sy "empty tbl layout"
                   1770: .Pq tbl
                   1771: A table layout specification is completely empty,
                   1772: specifying zero lines and zero columns.
                   1773: As a fallback, a single left-justified column is used.
                   1774: .It Sy "invalid character in tbl layout"
                   1775: .Pq tbl
                   1776: A table layout specification contains a character that can neither
                   1777: be interpreted as a layout key character nor as a layout modifier,
                   1778: or a modifier precedes the first key.
                   1779: The invalid character is discarded.
                   1780: .It Sy "unmatched parenthesis in tbl layout"
                   1781: .Pq tbl
                   1782: A table layout specification contains an opening parenthesis,
                   1783: but no matching closing parenthesis.
                   1784: The rest of the input line, starting from the parenthesis, has no effect.
1.139     schwarze 1785: .It Sy "tbl without any data cells"
                   1786: .Pq tbl
                   1787: A table does not contain any data cells.
                   1788: It will probably produce no output.
                   1789: .It Sy "ignoring data in spanned tbl cell"
                   1790: .Pq tbl
                   1791: A table cell is marked as a horizontal span
                   1792: .Pq Sq Cm s
                   1793: or vertical span
                   1794: .Pq Sq Cm ^
                   1795: in the table layout, but it contains data.
                   1796: The data is ignored.
                   1797: .It Sy "ignoring extra tbl data cells"
                   1798: .Pq tbl
                   1799: A data line contains more cells than the corresponding layout line.
                   1800: The data in the extra cells is ignored.
                   1801: .It Sy "data block open at end of tbl"
                   1802: .Pq tbl
                   1803: A data block is opened with
                   1804: .Cm T{ ,
                   1805: but never closed with a matching
                   1806: .Cm T} .
                   1807: The remaining data lines of the table are all put into one cell,
                   1808: and any remaining cells stay empty.
1.106     schwarze 1809: .El
                   1810: .Ss "Errors related to roff, mdoc, and man code"
                   1811: .Bl -ohang
1.215     schwarze 1812: .It Sy "duplicate prologue macro"
                   1813: .Pq mdoc
                   1814: One of the prologue macros occurs more than once.
                   1815: The last instance overrides all previous ones.
                   1816: .It Sy "skipping late title macro"
                   1817: .Pq mdoc
                   1818: The
                   1819: .Ic \&Dt
                   1820: macro appears after the first non-prologue macro.
                   1821: Traditional formatters cannot handle this because
                   1822: they write the page header before parsing the document body.
                   1823: Even though this technical restriction does not apply to
                   1824: .Nm ,
                   1825: traditional semantics is preserved.
                   1826: The late macro is discarded including its arguments.
1.106     schwarze 1827: .It Sy "input stack limit exceeded, infinite loop?"
                   1828: .Pq roff
                   1829: Explicit recursion limits are implemented for the following features,
                   1830: in order to prevent infinite loops:
                   1831: .Bl -dash -compact
                   1832: .It
                   1833: expansion of nested escape sequences
                   1834: including expansion of strings and number registers,
                   1835: .It
                   1836: expansion of nested user-defined macros,
                   1837: .It
                   1838: and
                   1839: .Ic \&so
                   1840: file inclusion.
                   1841: .El
                   1842: When a limit is hit, the output is incorrect, typically losing
                   1843: some content, but the parser can continue.
                   1844: .It Sy "skipping bad character"
                   1845: .Pq mdoc , man , roff
                   1846: The input file contains a byte that is not a printable
                   1847: .Xr ascii 7
                   1848: character.
                   1849: The message mentions the character number.
                   1850: The offending byte is replaced with a question mark
                   1851: .Pq Sq \&? .
                   1852: Consider editing the input file to replace the byte with an ASCII
                   1853: transliteration of the intended character.
                   1854: .It Sy "skipping unknown macro"
                   1855: .Pq mdoc , man , roff
                   1856: The first identifier on a request or macro line is neither recognized as a
                   1857: .Xr roff 7
                   1858: request, nor as a user-defined macro, nor, respectively, as an
                   1859: .Xr mdoc 7
                   1860: or
                   1861: .Xr man 7
                   1862: macro.
                   1863: It may be mistyped or unsupported.
                   1864: The request or macro is discarded including its arguments.
1.227     schwarze 1865: .It Sy "skipping request outside macro"
                   1866: .Pq roff
                   1867: A
                   1868: .Ic shift
                   1869: or
                   1870: .Ic return
                   1871: request occurs outside any macro definition and has no effect.
1.133     schwarze 1872: .It Sy "skipping insecure request"
                   1873: .Pq roff
                   1874: An input file attempted to run a shell command
                   1875: or to read or write an external file.
                   1876: Such attempts are denied for security reasons.
1.106     schwarze 1877: .It Sy "skipping item outside list"
1.118     schwarze 1878: .Pq mdoc , eqn
1.106     schwarze 1879: An
                   1880: .Ic \&It
                   1881: macro occurs outside any
                   1882: .Ic \&Bl
1.118     schwarze 1883: list, or an
                   1884: .Xr eqn 7
                   1885: .Ic above
                   1886: delimiter occurs outside any pile.
1.106     schwarze 1887: It is discarded including its arguments.
                   1888: .It Sy "skipping column outside column list"
                   1889: .Pq mdoc
                   1890: A
                   1891: .Ic \&Ta
                   1892: macro occurs outside any
                   1893: .Ic \&Bl Fl column
                   1894: block.
                   1895: It is discarded including its arguments.
                   1896: .It Sy "skipping end of block that is not open"
                   1897: .Pq mdoc , man , eqn , tbl , roff
                   1898: Various syntax elements can only be used to explicitly close blocks
                   1899: that have previously been opened.
                   1900: An
                   1901: .Xr mdoc 7
                   1902: block closing macro, a
                   1903: .Xr man 7
1.206     schwarze 1904: .Ic \&ME , \&RE
1.106     schwarze 1905: or
                   1906: .Ic \&UE
1.118     schwarze 1907: macro, an
                   1908: .Xr eqn 7
                   1909: right delimiter or closing brace, or the end of an equation, table, or
1.106     schwarze 1910: .Xr roff 7
                   1911: conditional request is encountered but no matching block is open.
                   1912: The offending request or macro is discarded.
1.135     schwarze 1913: .It Sy "fewer RS blocks open, skipping"
                   1914: .Pq man
                   1915: The
                   1916: .Ic \&RE
                   1917: macro is invoked with an argument, but less than the specified number of
                   1918: .Ic \&RS
                   1919: blocks is open.
                   1920: The
                   1921: .Ic \&RE
                   1922: macro is discarded.
1.106     schwarze 1923: .It Sy "inserting missing end of block"
                   1924: .Pq mdoc , tbl
                   1925: Various
                   1926: .Xr mdoc 7
                   1927: macros as well as tables require explicit closing by dedicated macros.
                   1928: A block that doesn't support bad nesting
                   1929: ends before all of its children are properly closed.
                   1930: The open child nodes are closed implicitly.
1.152     schwarze 1931: .It Sy "appending missing end of block"
1.106     schwarze 1932: .Pq mdoc , man , eqn , tbl , roff
                   1933: At the end of the document, an explicit
                   1934: .Xr mdoc 7
                   1935: block, a
                   1936: .Xr man 7
                   1937: next-line scope or
1.206     schwarze 1938: .Ic \&MT , \&RS
1.106     schwarze 1939: or
                   1940: .Ic \&UR
                   1941: block, an equation, table, or
                   1942: .Xr roff 7
                   1943: conditional or ignore block is still open.
                   1944: The open block is closed implicitly.
                   1945: .It Sy "escaped character not allowed in a name"
                   1946: .Pq roff
                   1947: Macro, string and register identifiers consist of printable,
                   1948: non-whitespace ASCII characters.
                   1949: Escape sequences and characters and strings expressed in terms of them
                   1950: cannot form part of a name.
                   1951: The first argument of an
                   1952: .Ic \&am ,
                   1953: .Ic \&as ,
                   1954: .Ic \&de ,
                   1955: .Ic \&ds ,
                   1956: .Ic \&nr ,
                   1957: or
                   1958: .Ic \&rr
                   1959: request, or any argument of an
                   1960: .Ic \&rm
                   1961: request, or the name of a request or user defined macro being called,
                   1962: is terminated by an escape sequence.
                   1963: In the cases of
                   1964: .Ic \&as ,
                   1965: .Ic \&ds ,
                   1966: and
                   1967: .Ic \&nr ,
                   1968: the request has no effect at all.
                   1969: In the cases of
                   1970: .Ic \&am ,
                   1971: .Ic \&de ,
                   1972: .Ic \&rr ,
                   1973: and
                   1974: .Ic \&rm ,
                   1975: what was parsed up to this point is used as the arguments to the request,
                   1976: and the rest of the input line is discarded including the escape sequence.
                   1977: When parsing for a request or a user-defined macro name to be called,
                   1978: only the escape sequence is discarded.
                   1979: The characters preceding it are used as the request or macro name,
                   1980: the characters following it are used as the arguments to the request or macro.
1.227     schwarze 1981: .It Sy "using macro argument outside macro"
                   1982: .Pq roff
                   1983: The escape sequence \e$ occurs outside any macro definition
                   1984: and expands to the empty string.
                   1985: .It Sy "argument number is not numeric"
                   1986: .Pq roff
                   1987: The argument of the escape sequence \e$ is not a digit;
                   1988: the escape sequence expands to the empty string.
1.124     schwarze 1989: .It Sy "NOT IMPLEMENTED: Bd -file"
                   1990: .Pq mdoc
                   1991: For security reasons, the
                   1992: .Ic \&Bd
                   1993: macro does not support the
                   1994: .Fl file
                   1995: argument.
                   1996: By requesting the inclusion of a sensitive file, a malicious document
                   1997: might otherwise trick a privileged user into inadvertently displaying
                   1998: the file on the screen, revealing the file content to bystanders.
                   1999: The argument is ignored including the file name following it.
1.163     schwarze 2000: .It Sy "skipping display without arguments"
                   2001: .Pq mdoc
                   2002: A
                   2003: .Ic \&Bd
                   2004: block macro does not have any arguments.
                   2005: The block is discarded, and the block content is displayed in
                   2006: whatever mode was active before the block.
1.106     schwarze 2007: .It Sy "missing list type, using -item"
                   2008: .Pq mdoc
                   2009: A
                   2010: .Ic \&Bl
                   2011: macro fails to specify the list type.
1.194     schwarze 2012: .It Sy "argument is not numeric, using 1"
                   2013: .Pq roff
                   2014: The argument of a
                   2015: .Ic \&ce
                   2016: request is not a number.
1.228     schwarze 2017: .It Sy "argument is not a character"
                   2018: .Pq roff
                   2019: The first argument of a
                   2020: .Ic char
                   2021: request is neither a single ASCII character
                   2022: nor a single character escape sequence.
                   2023: The request is ignored including all its arguments.
1.106     schwarze 2024: .It Sy "missing manual name, using \(dq\(dq"
                   2025: .Pq mdoc
                   2026: The first call to
1.168     schwarze 2027: .Ic \&Nm ,
                   2028: or any call in the NAME section, lacks the required argument.
1.106     schwarze 2029: .It Sy "uname(3) system call failed, using UNKNOWN"
                   2030: .Pq mdoc
                   2031: The
                   2032: .Ic \&Os
                   2033: macro is called without arguments, and the
                   2034: .Xr uname 3
                   2035: system call failed.
                   2036: As a workaround,
                   2037: .Nm
                   2038: can be compiled with
                   2039: .Sm off
                   2040: .Fl D Cm OSNAME=\(dq\e\(dq Ar string Cm \e\(dq\(dq .
                   2041: .Sm on
                   2042: .It Sy "unknown standard specifier"
                   2043: .Pq mdoc
                   2044: An
                   2045: .Ic \&St
                   2046: macro has an unknown argument and is discarded.
                   2047: .It Sy "skipping request without numeric argument"
1.118     schwarze 2048: .Pq roff , eqn
1.106     schwarze 2049: An
                   2050: .Ic \&it
1.118     schwarze 2051: request or an
                   2052: .Xr eqn 7
                   2053: .Ic \&size
                   2054: or
                   2055: .Ic \&gsize
                   2056: statement has a non-numeric or negative argument or no argument at all.
                   2057: The invalid request or statement is ignored.
1.227     schwarze 2058: .It Sy "excessive shift"
                   2059: .Pq roff
                   2060: The argument of a
                   2061: .Ic shift
                   2062: request is larger than the number of arguments of the macro that is
                   2063: currently being executed.
                   2064: All macro arguments are deleted and \en(.$ is set to zero.
1.132     schwarze 2065: .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq"
                   2066: .Pq roff
                   2067: For security reasons,
                   2068: .Nm
                   2069: allows
                   2070: .Ic \&so
                   2071: file inclusion requests only with relative paths
                   2072: and only without ascending to any parent directory.
                   2073: By requesting the inclusion of a sensitive file, a malicious document
                   2074: might otherwise trick a privileged user into inadvertently displaying
                   2075: the file on the screen, revealing the file content to bystanders.
                   2076: .Nm
                   2077: only shows the path as it appears behind
                   2078: .Ic \&so .
                   2079: .It Sy ".so request failed"
                   2080: .Pq roff
                   2081: Servicing a
                   2082: .Ic \&so
                   2083: request requires reading an external file, but the file could not be
                   2084: opened.
                   2085: .Nm
                   2086: only shows the path as it appears behind
                   2087: .Ic \&so .
1.106     schwarze 2088: .It Sy "skipping all arguments"
                   2089: .Pq mdoc , man , eqn , roff
                   2090: An
                   2091: .Xr mdoc 7
                   2092: .Ic \&Bt ,
                   2093: .Ic \&Ed ,
                   2094: .Ic \&Ef ,
                   2095: .Ic \&Ek ,
                   2096: .Ic \&El ,
1.144     schwarze 2097: .Ic \&Lp ,
                   2098: .Ic \&Pp ,
1.106     schwarze 2099: .Ic \&Re ,
1.143     schwarze 2100: .Ic \&Rs ,
1.106     schwarze 2101: or
                   2102: .Ic \&Ud
                   2103: macro, an
                   2104: .Ic \&It
                   2105: macro in a list that don't support item heads, a
                   2106: .Xr man 7
                   2107: .Ic \&LP ,
                   2108: .Ic \&P ,
                   2109: or
                   2110: .Ic \&PP
                   2111: macro, an
                   2112: .Xr eqn 7
1.120     schwarze 2113: .Ic \&EQ
                   2114: or
1.106     schwarze 2115: .Ic \&EN
                   2116: macro, or a
                   2117: .Xr roff 7
1.148     schwarze 2118: .Ic \&br ,
                   2119: .Ic \&fi ,
                   2120: or
                   2121: .Ic \&nf
1.144     schwarze 2122: request or
1.106     schwarze 2123: .Sq \&..
                   2124: block closing request is invoked with at least one argument.
                   2125: All arguments are ignored.
                   2126: .It Sy "skipping excess arguments"
1.135     schwarze 2127: .Pq mdoc , man , roff
1.150     schwarze 2128: A macro or request is invoked with too many arguments:
                   2129: .Bl -dash -offset 2n -width 2n -compact
                   2130: .It
                   2131: .Ic \&Fo ,
1.206     schwarze 2132: .Ic \&MT ,
1.150     schwarze 2133: .Ic \&PD ,
                   2134: .Ic \&RS ,
                   2135: .Ic \&UR ,
                   2136: .Ic \&ft ,
                   2137: or
                   2138: .Ic \&sp
                   2139: with more than one argument
                   2140: .It
1.144     schwarze 2141: .Ic \&An
1.150     schwarze 2142: with another argument after
1.144     schwarze 2143: .Fl split
                   2144: or
1.150     schwarze 2145: .Fl nosplit
                   2146: .It
                   2147: .Ic \&RE
                   2148: with more than one argument or with a non-integer argument
                   2149: .It
                   2150: .Ic \&OP
                   2151: or a request of the
                   2152: .Ic \&de
                   2153: family with more than two arguments
1.154     schwarze 2154: .It
                   2155: .Ic \&Dt
                   2156: with more than three arguments
1.150     schwarze 2157: .It
                   2158: .Ic \&TH
                   2159: with more than five arguments
                   2160: .It
1.145     schwarze 2161: .Ic \&Bd ,
                   2162: .Ic \&Bk ,
                   2163: or
                   2164: .Ic \&Bl
1.150     schwarze 2165: with invalid arguments
                   2166: .El
1.106     schwarze 2167: The excess arguments are ignored.
1.133     schwarze 2168: .El
                   2169: .Ss Unsupported features
                   2170: .Bl -ohang
                   2171: .It Sy "input too large"
                   2172: .Pq mdoc , man
                   2173: Currently,
                   2174: .Nm
                   2175: cannot handle input files larger than its arbitrary size limit
                   2176: of 2^31 bytes (2 Gigabytes).
                   2177: Since useful manuals are always small, this is not a problem in practice.
                   2178: Parsing is aborted as soon as the condition is detected.
1.136     schwarze 2179: .It Sy "unsupported control character"
                   2180: .Pq roff
                   2181: An ASCII control character supported by other
                   2182: .Xr roff 7
                   2183: implementations but not by
                   2184: .Nm
                   2185: was found in an input file.
                   2186: It is replaced by a question mark.
1.232     schwarze 2187: .It Sy "unsupported escape sequence"
                   2188: .Pq roff
                   2189: An input file contains an escape sequence supported by GNU troff
                   2190: or Heirloom troff but not by
                   2191: .Nm ,
                   2192: and it is likely that this will cause information loss
                   2193: or considerable misformatting.
1.133     schwarze 2194: .It Sy "unsupported roff request"
                   2195: .Pq roff
                   2196: An input file contains a
                   2197: .Xr roff 7
                   2198: request supported by GNU troff or Heirloom troff but not by
                   2199: .Nm ,
                   2200: and it is likely that this will cause information loss
                   2201: or considerable misformatting.
1.139     schwarze 2202: .It Sy "eqn delim option in tbl"
                   2203: .Pq eqn , tbl
                   2204: The options line of a table defines equation delimiters.
                   2205: Any equation source code contained in the table will be printed unformatted.
                   2206: .It Sy "unsupported table layout modifier"
1.138     schwarze 2207: .Pq tbl
                   2208: A table layout specification contains an
                   2209: .Sq Cm m
                   2210: modifier.
                   2211: The modifier is discarded.
1.133     schwarze 2212: .It Sy "ignoring macro in table"
1.139     schwarze 2213: .Pq tbl , mdoc , man
                   2214: A table contains an invocation of an
                   2215: .Xr mdoc 7
                   2216: or
                   2217: .Xr man 7
                   2218: macro or of an undefined macro.
                   2219: The macro is ignored, and its arguments are handled
                   2220: as if they were a text line.
1.106     schwarze 2221: .El
1.1       kristaps 2222: .Sh SEE ALSO
1.141     schwarze 2223: .Xr apropos 1 ,
                   2224: .Xr man 1 ,
1.85      kristaps 2225: .Xr eqn 7 ,
1.57      kristaps 2226: .Xr man 7 ,
1.13      kristaps 2227: .Xr mandoc_char 7 ,
1.84      kristaps 2228: .Xr mdoc 7 ,
                   2229: .Xr roff 7 ,
                   2230: .Xr tbl 7
1.173     schwarze 2231: .Sh HISTORY
                   2232: The
                   2233: .Nm
                   2234: utility first appeared in
                   2235: .Ox 4.8 .
                   2236: The option
                   2237: .Fl I
                   2238: appeared in
                   2239: .Ox 5.2 ,
                   2240: and
                   2241: .Fl aCcfhKklMSsw
                   2242: in
                   2243: .Ox 5.7 .
1.1       kristaps 2244: .Sh AUTHORS
1.156     schwarze 2245: .An -nosplit
1.1       kristaps 2246: The
                   2247: .Nm
1.26      kristaps 2248: utility was written by
1.141     schwarze 2249: .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
                   2250: and is maintained by
                   2251: .An Ingo Schwarze Aq Mt schwarze@openbsd.org .

CVSweb