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

Annotation of mandoc/mandoc.1, Revision 1.243

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

CVSweb