.TH "MANDOC" "1" "February 10, 2017" "Debian" "General Commands Manual" .nh .if n .ad l .SH "NAME" \fBmandoc\fR \- format and display UNIX manuals .SH "SYNOPSIS" .HP 7n \fBmandoc\fR [\fB\-acfhkl\fR] [\fB\-I\fR\ \fBos\fR=\fIname\fR] [\fB\-K\fR\ \fIencoding\fR] [\fB\-m\fR\fIformat\fR] [\fB\-O\fR\ \fIoption\fR] [\fB\-T\fR\ \fIoutput\fR] [\fB\-W\fR\ \fIlevel\fR] [\fIfile\ ...\fR] .SH "DESCRIPTION" The \fBmandoc\fR utility formats UNIX manual pages for display. .PP By default, \fBmandoc\fR reads mdoc(7) or man(7) text from stdin, implying \fB\-m\fR\fBandoc\fR, and produces \fB\-T\fR \fBlocale\fR output. .PP The options are as follows: .TP 8n \fB\-a\fR If the standard output is a terminal device and \fB\-c\fR is not specified, use more(1) to paginate the output, just like man(1) would. .TP 8n \fB\-c\fR Copy the formatted manual pages to the standard output without using more(1) to paginate them. This is the default. It can be specified to override \fB\-a\fR. .TP 8n \fB\-f\fR A synonym for whatis(1). This overrides any earlier \fB\-k\fR and \fB\-l\fR options. .TP 8n \fB\-h\fR Display only the SYNOPSIS lines. Implies \fB\-c\fR. .TP 8n \fB\-I\fR \fBos\fR=\fIname\fR Override the default operating system \fIname\fR for the mdoc(7) \(oq\&Os\(cq and for the man(7) \(oq\&TH\(cq macro. .TP 8n \fB\-K\fR \fIencoding\fR Specify the input encoding. The supported \fIencoding\fR arguments are \fBus-ascii\fR, \fBiso-8859-1\fR, and \fButf-8\fR. If not specified, autodetection uses the first match: .PP .RS 8n .PD 0 .TP 12n \fButf-8\fR if the first three bytes of the input file are the UTF-8 byte order mark (BOM, 0xefbbbf) .PD .TP 12n \fIencoding\fR if the first or second line of the input file matches the \fBemacs\fR mode line format .sp .RS 18n \&.\e" -*- [...;] coding: \fIencoding\fR; -*- .RE .TP 12n \fButf-8\fR if the first non-ASCII byte in the file introduces a valid UTF-8 sequence .TP 12n \fBiso-8859-1\fR otherwise .PD 0 .PP .RE .PD .TP 8n \fB\-k\fR A synonym for apropos(1). This overrides any earlier \fB\-f\fR and \fB\-l\fR options. .TP 8n \fB\-l\fR A synonym for \fB\-a\fR. Also reverts any earlier \fB\-f\fR and \fB\-k\fR options. .TP 8n \fB\-m\fR\fIformat\fR Input format. See \fIInput Formats\fR for available formats. Defaults to \fB\-m\fR\fBandoc\fR. .TP 8n \fB\-O\fR \fIoption\fR Comma-separated output options. .TP 8n \fB\-T\fR \fIoutput\fR Output format. See \fIOutput Formats\fR for available formats. Defaults to \fB\-T\fR \fBlocale\fR. .TP 8n \fB\-W\fR \fIlevel\fR Specify the minimum message \fIlevel\fR to be reported on the standard error output and to affect the exit status. The \fIlevel\fR can be \fBwarning\fR, \fBerror\fR, or \fBunsupp\fR; \fBall\fR is an alias for \fBwarning\fR. By default, \fBmandoc\fR is silent. See \fIEXIT STATUS\fR and \fIDIAGNOSTICS\fR for details. .sp The special option \fB\-W\fR \fBstop\fR tells \fBmandoc\fR to exit after parsing a file that causes warnings or errors of at least the requested level. No formatted output will be produced from that file. If both a \fIlevel\fR and \fBstop\fR are requested, they can be joined with a comma, for example \fB\-W\fR \fBerror\fR,\fBstop\fR. .TP 8n \fIfile\fR Read input from zero or more files. If unspecified, reads from stdin. If multiple files are specified, \fBmandoc\fR will halt with the first failed parse. .PP In \fB\-f\fR and \fB\-k\fR mode, \fBmandoc\fR also supports the options \fB\-CMmOSsw\fR described in the apropos(1) manual. .SS "Input Formats" The \fBmandoc\fR utility accepts mdoc(7) and man(7) input with \fB\-m\fR\fBdoc\fR and \fB\-m\fR\fBan\fR, respectively. The mdoc(7) format is \fIstrongly\fR recommended; man(7) should only be used for legacy manuals. .PP A third option, \fB\-m\fR\fBandoc\fR, which is also the default, determines encoding on-the-fly: if the first non-comment macro is \(oq\&Dd\(cq or \(oq\&Dt\(cq, the mdoc(7) parser is used; otherwise, the man(7) parser is used. .PP If multiple files are specified with \fB\-m\fR\fBandoc\fR, each has its file-type determined this way. If multiple files are specified and \fB\-m\fR\fBdoc\fR or \fB\-m\fR\fBan\fR is specified, then this format is used exclusively. .SS "Output Formats" The \fBmandoc\fR utility accepts the following \fB\-T\fR arguments, which correspond to output modes: .TP 11n \fB\-T\fR \fBascii\fR Produce 7-bit ASCII output. See \fIASCII Output\fR. .TP 11n \fB\-T\fR \fBhtml\fR Produce HTML5, CSS1, and MathML output. See \fIHTML Output\fR. .TP 11n \fB\-T\fR \fBlint\fR Parse only: produce no output. Implies \fB\-W\fR \fBwarning\fR. .TP 11n \fB\-T\fR \fBlocale\fR .br Encode output using the current locale. This is the default. See \fILocale Output\fR. .TP 11n \fB\-T\fR \fBman\fR Produce man(7) format output. See \fIMan Output\fR. .TP 11n \fB\-T\fR \fBpdf\fR Produce PDF output. See \fIPDF Output\fR. .TP 11n \fB\-T\fR \fBps\fR Produce PostScript output. See \fIPostScript Output\fR. .TP 11n \fB\-T\fR \fBtree\fR Produce an indented parse tree. See \fISyntax tree output\fR. .TP 11n \fB\-T\fR \fButf8\fR Encode output in the UTF\-8 multi-byte format. See \fIUTF\-8 Output\fR. .TP 11n \fB\-T\fR \fBxhtml\fR This is a synonym for \fB\-T\fR \fBhtml\fR. .PP If multiple input files are specified, these will be processed by the corresponding filter in-order. .SS "ASCII Output" Output produced by \fB\-T\fR \fBascii\fR is rendered in standard 7-bit ASCII documented in ascii(7). .PP Font styles are applied by using back-spaced encoding such that an underlined character \(oqc\(cq is rendered as \(oq_\e[bs]c\(cq, where \(oq\e[bs]\(cq is the back-space character number 8. Emboldened characters are rendered as \(oqc\e[bs]c\(cq. .PP The special characters documented in mandoc_char(7) are rendered best-effort in an ASCII equivalent. .PP Output width is limited to 78 visible columns unless literal input lines exceed this limit. .PP The following \fB\-O\fR arguments are accepted: .TP 8n \fBindent\fR=\fIindent\fR The left margin for normal text is set to \fIindent\fR blank characters instead of the default of five for mdoc(7) and seven for man(7). Increasing this is not recommended; it may result in degraded formatting, for example overfull lines or ugly line breaks. .TP 8n \fBwidth\fR=\fIwidth\fR The output width is set to \fIwidth\fR, which will normalise to \(>=58. .SS "HTML Output" Output produced by \fB\-T\fR \fBhtml\fR conforms to HTML5 using optional self-closing tags. Default styles use only CSS1. Equations rendered from eqn(7) blocks use MathML. .PP The \fImandoc.css\fR file documents style-sheet classes available for customising output. If a style-sheet is not specified with \fB\-O\fR \fBstyle\fR, \fB\-T\fR \fBhtml\fR defaults to simple output (via an embedded style-sheet) readable in any graphical or text-based web browser. .PP Special characters are rendered in decimal-encoded UTF\-8. .PP The following \fB\-O\fR arguments are accepted: .TP 8n \fBfragment\fR Omit the declaration and the , , and elements and only emit the subtree below the element. The \fBstyle\fR argument will be ignored. This is useful when embedding manual content within existing documents. .TP 8n \fBincludes\fR=\fIfmt\fR The string \fIfmt\fR, for example, \fI../src/%I.html\fR, is used as a template for linked header files (usually via the \(oq\&In\(cq macro). Instances of \(oq\&%I\(cq are replaced with the include filename. The default is not to present a hyperlink. .TP 8n \fBman\fR=\fIfmt\fR .br The string \fIfmt\fR, for example, \fI../html%S/%N.%S.html\fR, is used as a template for linked manuals (usually via the \(oq\&Xr\(cq macro). Instances of \(oq\&%N\(cq and \(oq%S\(cq are replaced with the linked manual's name and section, respectively. If no section is included, section 1 is assumed. The default is not to present a hyperlink. .TP 8n \fBstyle\fR=\fIstyle.css\fR The file \fIstyle.css\fR is used for an external style-sheet. This must be a valid absolute or relative URI. .SS "Locale Output" Locale-depending output encoding is triggered with \fB\-T\fR \fBlocale\fR. This is the default. .PP This option is not available on all systems: systems without locale support, or those whose internal representation is not natively UCS-4, will fall back to \fB\-T\fR \fBascii\fR. See \fIASCII Output\fR for font style specification and available command-line arguments. .SS "Man Output" Translate input format into man(7) output format. This is useful for distributing manual sources to legacy systems lacking mdoc(7) formatters. .PP If mdoc(7) is passed as input, it is translated into man(7). If the input format is man(7), the input is copied to the output, expanding any roff(7) \(oqso\(cq requests. The parser is also run, and as usual, the \fB\-W\fR level controls which \fIDIAGNOSTICS\fR are displayed before copying the input to the output. .SS "PDF Output" PDF-1.1 output may be generated by \fB\-T\fR \fBpdf\fR. See \fIPostScript Output\fR for \fB\-O\fR arguments and defaults. .SS "PostScript Output" PostScript "Adobe-3.0" Level-2 pages may be generated by \fB\-T\fR \fBps\fR. Output pages default to letter sized and are rendered in the Times font family, 11-point. Margins are calculated as 1/9 the page length and width. Line-height is 1.4m. .PP Special characters are rendered as in \fIASCII Output\fR. .PP The following \fB\-O\fR arguments are accepted: .TP 8n \fBpaper\fR=\fIname\fR The paper size \fIname\fR may be one of \fIa3\fR, \fIa4\fR, \fIa5\fR, \fIlegal\fR, or \fIletter\fR. You may also manually specify dimensions as \fINNxNN\fR, width by height in millimetres. If an unknown value is encountered, \fIletter\fR is used. .SS "UTF\-8 Output" Use \fB\-T\fR \fButf8\fR to force a UTF\-8 locale. See \fILocale Output\fR for details and options. .SS "Syntax tree output" Use \fB\-T\fR \fBtree\fR to show a human readable representation of the syntax tree. It is useful for debugging the source code of manual pages. The exact format is subject to change, so don't write parsers for it. .PP The first paragraph shows meta data found in the mdoc(7) prologue, on the man(7) \fB\&TH\fR line, or the fallbacks used. .PP In the tree dump, each output line shows one syntax tree node. Child nodes are indented with respect to their parent node. The columns are: .TP 5n 1.\& For macro nodes, the macro name; for text and tbl(7) nodes, the content. There is a special format for eqn(7) nodes. .PD 0 .TP 5n 2.\& Node type (text, elem, block, head, body, body-end, tail, tbl, eqn). .TP 5n 3.\& Flags: .PP .RS 5n .TP 4n \fB-\fR An opening parenthesis if the node is an opening delimiter. .TP 4n \fB-\fR An asterisk if the node starts a new input line. .TP 4n \fB-\fR The input line number (starting at one). .TP 4n \fB-\fR A colon. .TP 4n \fB-\fR The input column number (starting at one). .TP 4n \fB-\fR A closing parenthesis if the node is a closing delimiter. .TP 4n \fB-\fR A full stop if the node ends a sentence. .TP 4n \fB-\fR BROKEN if the node is a block broken by another block. .TP 4n \fB-\fR NOSRC if the node is not in the input file, but automatically generated from macros. .TP 4n \fB-\fR NOPRT if the node is not supposed to generate output for any output format. .PP .RE .PD .PP The following \fB\-O\fR argument is accepted: .TP 8n \fBnoval\fR Skip validation and show the unvalidated syntax tree. This can help to find out whether a given behaviour is caused by the parser or by the validator. Meta data is not available in this case. .SH "ENVIRONMENT" .TP 10n \fRMANPAGER\fR Any non-empty value of the environment variable \fRMANPAGER\fR will be used instead of the standard pagination program, more(1). .TP 10n \fRPAGER\fR Specifies the pagination program to use when \fRMANPAGER\fR is not defined. If neither PAGER nor MANPAGER is defined, more(1) \fB\-s\fR will be used. .SH "EXIT STATUS" The \fBmandoc\fR utility exits with one of the following values, controlled by the message \fIlevel\fR associated with the \fB\-W\fR option: .TP 8n 0 No warnings or errors occurred, or those that did were ignored because they were lower than the requested \fIlevel\fR. .PD 0 .TP 8n 2 At least one warning occurred, but no error, and \fB\-W\fR \fBwarning\fR was specified. .TP 8n 3 At least one parsing error occurred, but no unsupported feature was encountered, and \fB\-W\fR \fBerror\fR or \fB\-W\fR \fBwarning\fR was specified. .TP 8n 4 At least one unsupported feature was encountered, and \fB\-W\fR \fBunsupp\fR, \fB\-W\fR \fBerror\fR or \fB\-W\fR \fBwarning\fR was specified. .TP 8n 5 Invalid command line arguments were specified. No input files have been read. .TP 8n 6 An operating system error occurred, for example exhaustion of memory, file descriptors, or process table entries. Such errors cause \fBmandoc\fR to exit at once, possibly in the middle of parsing or formatting a file. .PD .PP Note that selecting \fB\-T\fR \fBlint\fR output mode implies \fB\-W\fR \fBwarning\fR. .SH "EXAMPLES" To page manuals to the terminal: .PP .RS 6n $ mandoc \-W all,stop mandoc.1 2>&1 | less .RE .RS 6n $ mandoc mandoc.1 mdoc.3 mdoc.7 | less .RE .PP To produce HTML manuals with \fImandoc.css\fR as the style-sheet: .PP .RS 6n $ mandoc \-T html -O style=mandoc.css mdoc.7 > mdoc.7.html .RE .PP To check over a large set of manuals: .PP .RS 6n $ mandoc \-T lint \(gafind /usr/src -name \e*\e.[1-9]\(ga .RE .PP To produce a series of PostScript manuals for A4 paper: .PP .RS 6n $ mandoc \-T ps \-O paper=a4 mdoc.7 man.7 > manuals.ps .RE .PP Convert a modern mdoc(7) manual to the older man(7) format, for use on systems lacking an mdoc(7) parser: .PP .RS 6n $ mandoc \-T man foo.mdoc > foo.man .RE .SH "DIAGNOSTICS" Messages displayed by \fBmandoc\fR follow this format: .PP .RS 6n \fBmandoc\fR: \fIfile\fR:\fIline\fR:\fIcolumn\fR: \fIlevel\fR: \fImessage\fR: \fImacro args\fR .RE .PP Line and column numbers start at 1. Both are omitted for messages referring to an input file as a whole. Macro names and arguments are omitted where meaningless. Fatal messages about invalid command line arguments or operating system errors, for example when memory is exhausted, may also omit the \fIfile\fR and \fIlevel\fR fields. .PP Message levels have the following meanings: .TP 9n \fBunsupp\fR An input file uses unsupported low-level roff(7) features. The output may be incomplete and/or misformatted, so using GNU troff instead of \fBmandoc\fR to process the file may be preferable. .TP 9n \fBerror\fR An input file contains invalid syntax that cannot be safely interpreted. By discarding part of the input or inserting missing tokens, the parser is able to continue, and the error does not prevent generation of formatted output, but typically, preparing that output involves information loss, broken document structure or unintended formatting, no matter whether \fBmandoc\fR or GNU troff is used. In many cases, the output of \fBmandoc\fR and GNU troff is identical, but in some, \fBmandoc\fR is more resilient than GNU troff with respect to malformed input. .sp Non-existent or unreadable input files are also reported on the \fBerror\fR level. In that case, the parser cannot even be started and no output is produced from those input files. .TP 9n \fBwarning\fR An input file uses obsolete, discouraged or non-portable syntax. All the same, the meaning of the input is unambiguous and a correct rendering can be produced. Documents causing warnings may render poorly when using other formatting tools instead of \fBmandoc\fR. .PP Messages of the \fBwarning\fR, \fBerror\fR, and \fBunsupp\fR levels except those about non-existent or unreadable input files are hidden unless their level, or a lower level, is requested using a \fB\-W\fR option or \fB\-T\fR \fBlint\fR output mode. .SS "Warnings related to the document prologue" .PP .R "\fBmissing manual title, using UNTITLED\fR .br (mdoc) A \fB\&Dt\fR macro has no arguments, or there is no \fB\&Dt\fR macro before the first non-prologue macro. .PP .R "\fBmissing manual title, using \(dq\(dq\fR .br (man) There is no \fB\&TH\fR macro, or it has no arguments. .PP .R "\fBlower case character in document title\fR .br (mdoc, man) The title is still used as given in the \fB\&Dt\fR or \fB\&TH\fR macro. .PP .R "\fBmissing manual section, using \(dq\(dq\fR .br (mdoc, man) A \fB\&Dt\fR or \fB\&TH\fR macro lacks the mandatory section argument. .PP .R "\fBunknown manual section\fR .br (mdoc) The section number in a \fB\&Dt\fR line is invalid, but still used. .PP .R "\fBmissing date, using today's date\fR .br (mdoc, man) The document was parsed as mdoc(7) and it has no \fB\&Dd\fR macro, or the \fB\&Dd\fR macro has no arguments or only empty arguments; or the document was parsed as man(7) and it has no \fB\&TH\fR macro, or the \fB\&TH\fR macro has less than three arguments or its third argument is empty. .PP .R "\fBcannot parse date, using it verbatim\fR .br (mdoc, man) The date given in a \fB\&Dd\fR or \fB\&TH\fR macro does not follow the conventional format. .PP .R "\fBmissing Os macro, using \(dq\(dq\fR .br (mdoc) The default or current system is not shown in this case. .PP .R "\fBduplicate prologue macro\fR .br (mdoc) One of the prologue macros occurs more than once. The last instance overrides all previous ones. .PP .R "\fBlate prologue macro\fR .br (mdoc) A \fB\&Dd\fR or \fB\&Os\fR macro occurs after some non-prologue macro, but still takes effect. .PP .R "\fBskipping late title macro\fR .br (mdoc) The \fB\&Dt\fR macro appears after the first non-prologue macro. Traditional formatters cannot handle this because they write the page header before parsing the document body. Even though this technical restriction does not apply to \fBmandoc\fR, traditional semantics is preserved. The late macro is discarded including its arguments. .PP .R "\fBprologue macros out of order\fR .br (mdoc) The prologue macros are not given in the conventional order \fB\&Dd\fR, \fB\&Dt\fR, \fB\&Os\fR. All three macros are used even when given in another order. .SS "Warnings regarding document structure" .PP .R "\fB.so is fragile, better use ln(1)\fR .br (roff) Including files only works when the parser program runs with the correct current working directory. .PP .R "\fBno document body\fR .br (mdoc, man) The document body contains neither text nor macros. An empty document is shown, consisting only of a header and a footer line. .PP .R "\fBcontent before first section header\fR .br (mdoc, man) Some macros or text precede the first \fB\&Sh\fR or \fB\&SH\fR section header. The offending macros and text are parsed and added to the top level of the syntax tree, outside any section block. .PP .R "\fBfirst section is not NAME\fR .br (mdoc) The argument of the first \fB\&Sh\fR macro is not \(oqNAME\(cq. This may confuse makewhatis(8) and apropos(1). .PP .R "\fBNAME section without Nm before Nd\fR .br (mdoc) The NAME section does not contain any \fB\&Nm\fR child macro before the first \fB\&Nd\fR macro. .PP .R "\fBNAME section without description\fR .br (mdoc) The NAME section lacks the mandatory \fB\&Nd\fR child macro. .PP .R "\fBdescription not at the end of NAME\fR .br (mdoc) The NAME section does contain an \fB\&Nd\fR child macro, but other content follows it. .PP .R "\fBbad NAME section content\fR .br (mdoc) The NAME section contains plain text or macros other than \fB\&Nm\fR and \fB\&Nd\fR. .PP .R "\fBmissing comma before name\fR .br (mdoc) The NAME section contains an \fB\&Nm\fR macro that is neither the first one nor preceded by a comma. .PP .R "\fBmissing description line, using \(dq\(dq\fR .br (mdoc) The \fB\&Nd\fR macro lacks the required argument. The title line of the manual will end after the dash. .PP .R "\fBsections out of conventional order\fR .br (mdoc) A standard section occurs after another section it usually precedes. All section titles are used as given, and the order of sections is not changed. .PP .R "\fBduplicate section title\fR .br (mdoc) The same standard section title occurs more than once. .PP .R "\fBunexpected section\fR .br (mdoc) A standard section header occurs in a section of the manual where it normally isn't useful. .PP .R "\fBunusual Xr order\fR .br (mdoc) In the SEE ALSO section, an \fB\&Xr\fR macro with a lower section number follows one with a higher number, or two \fB\&Xr\fR macros referring to the same section are out of alphabetical order. .PP .R "\fBunusual Xr punctuation\fR .br (mdoc) In the SEE ALSO section, punctuation between two \fB\&Xr\fR macros differs from a single comma, or there is trailing punctuation after the last \fB\&Xr\fR macro. .PP .R "\fBAUTHORS section without An macro\fR .br (mdoc) An AUTHORS sections contains no \fB\&An\fR macros, or only empty ones. Probably, there are author names lacking markup. .SS "Warnings related to macros and nesting" .PP .R "\fBobsolete macro\fR .br (mdoc) See the mdoc(7) manual for replacements. .PP .R "\fBmacro neither callable nor escaped\fR .br (mdoc) The name of a macro that is not callable appears on a macro line. It is printed verbatim. If the intention is to call it, move it to its own input line; otherwise, escape it by prepending \(oq\e&\(cq. .PP .R "\fBskipping paragraph macro\fR .br In mdoc(7) documents, this happens .PD 0 .TP 4n \fB-\fR at the beginning and end of sections and subsections .TP 4n \fB-\fR right before non-compact lists and displays .TP 4n \fB-\fR at the end of items in non-column, non-compact lists .TP 4n \fB-\fR and for multiple consecutive paragraph macros. .PP In man(7) documents, it happens .TP 4n \fB-\fR for empty \fB\&P\fR, \fB\&PP\fR, and \fB\&LP\fR macros .TP 4n \fB-\fR for \fB\&IP\fR macros having neither head nor body arguments .TP 4n \fB-\fR for \fB\&br\fR or \fB\&sp\fR right after \fB\&SH\fR or \fB\&SS\fR .PD .PP .R "\fBmoving paragraph macro out of list\fR .br (mdoc) A list item in a \fB\&Bl\fR list contains a trailing paragraph macro. The paragraph macro is moved after the end of the list. .PP .R "\fBskipping no-space macro\fR .br (mdoc) An input line begins with an \fB\&Ns\fR macro. The macro is ignored. .PP .R "\fBblocks badly nested\fR .br (mdoc) If two blocks intersect, one should completely contain the other. Otherwise, rendered output is likely to look strange in any output format, and rendering in SGML-based output formats is likely to be outright wrong because such languages do not support badly nested blocks at all. Typical examples of badly nested blocks are "\fB\&Ao \&Bo \&Ac \&Bc\fR" and "\fB\&Ao \&Bq \&Ac\fR". In these examples, \fB\&Ac\fR breaks \fB\&Bo\fR and \fB\&Bq\fR, respectively. .PP .R "\fBnested displays are not portable\fR .br (mdoc) A \fB\&Bd\fR, \fB\&D1\fR, or \fB\&Dl\fR display occurs nested inside another \fB\&Bd\fR display. This works with \fBmandoc\fR, but fails with most other implementations. .PP .R "\fBmoving content out of list\fR .br (mdoc) A \fB\&Bl\fR list block contains text or macros before the first \fB\&It\fR macro. The offending children are moved before the beginning of the list. .PP .R "\fBfill mode already enabled, skipping\fR .br (man) A \fB\&fi\fR request occurs even though the document is still in fill mode, or already switched back to fill mode. It has no effect. .PP .R "\fBfill mode already disabled, skipping\fR .br (man) An \fB\&nf\fR request occurs even though the document already switched to no-fill mode and did not switch back to fill mode yet. It has no effect. .PP .R "\fBline scope broken\fR .br (man) While parsing the next-line scope of the previous macro, another macro is found that prematurely terminates the previous one. The previous, interrupted macro is deleted from the parse tree. .SS "Warnings related to missing arguments" .PP .R "\fBskipping empty request\fR .br (roff, eqn) The macro name is missing from a macro definition request, or an eqn(7) control statement or operation keyword lacks its required argument. .PP .R "\fBconditional request controls empty scope\fR .br (roff) A conditional request is only useful if any of the following follows it on the same logical input line: .PD 0 .TP 4n \fB-\fR The \(oq\e{\(cq keyword to open a multi-line scope. .TP 4n \fB-\fR A request or macro or some text, resulting in a single-line scope. .TP 4n \fB-\fR The immediate end of the logical line without any intervening whitespace, resulting in next-line scope. .PP Here, a conditional request is followed by trailing whitespace only, and there is no other content on its logical input line. Note that it doesn't matter whether the logical input line is split across multiple physical input lines using \(oq\e\(cq line continuation characters. This is one of the rare cases where trailing whitespace is syntactically significant. The conditional request controls a scope containing whitespace only, so it is unlikely to have a significant effect, except that it may control a following \fB\&el\fR clause. .PD .PP .R "\fBskipping empty macro\fR .br (mdoc) The indicated macro has no arguments and hence no effect. .PP .R "\fBempty block\fR .br (mdoc, man) A \fB\&Bd\fR, \fB\&Bk\fR, \fB\&Bl\fR, \fB\&D1\fR, \fB\&Dl\fR, \fB\&RS\fR, or \fB\&UR\fR block contains nothing in its body and will produce no output. .PP .R "\fBempty argument, using 0n\fR .br (mdoc) The required width is missing after \fB\&Bd\fR or \fB\&Bl\fR \fB\-offset\fR or \fB\-width.\fR .PP .R "\fBmissing display type, using -ragged\fR .br (mdoc) The \fB\&Bd\fR macro is invoked without the required display type. .PP .R "\fBlist type is not the first argument\fR .br (mdoc) In a \fB\&Bl\fR macro, at least one other argument precedes the type argument. The \fBmandoc\fR utility copes with any argument order, but some other mdoc(7) implementations do not. .PP .R "\fBmissing -width in -tag list, using 8n\fR .br (mdoc) Every \fB\&Bl\fR macro having the \fB\-tag\fR argument requires \fB\-width\fR, too. .PP .R "\fBmissing utility name, using \(dq\(dq\fR .br (mdoc) The \fB\&Ex\fR \fB\-std\fR macro is called without an argument before \fB\&Nm\fR has first been called with an argument. .PP .R "\fBmissing function name, using \(dq\(dq\fR .br (mdoc) The \fB\&Fo\fR macro is called without an argument. No function name is printed. .PP .R "\fBempty head in list item\fR .br (mdoc) In a \fB\&Bl\fR \fB\-diag\fR, \fB\-hang\fR, \fB\-inset\fR, \fB\-ohang\fR, or \fB\-tag\fR list, an \fB\&It\fR macro lacks the required argument. The item head is left empty. .PP .R "\fBempty list item\fR .br (mdoc) In a \fB\&Bl\fR \fB\-bullet\fR, \fB\-dash\fR, \fB\-enum\fR, or \fB\-hyphen\fR list, an \fB\&It\fR block is empty. An empty list item is shown. .PP .R "\fBmissing font type, using \efR\fR .br (mdoc) A \fB\&Bf\fR macro has no argument. It switches to the default font. .PP .R "\fBunknown font type, using \efR\fR .br (mdoc) The \fB\&Bf\fR argument is invalid. The default font is used instead. .PP .R "\fBnothing follows prefix\fR .br (mdoc) A \fB\&Pf\fR macro has no argument, or only one argument and no macro follows on the same input line. This defeats its purpose; in particular, spacing is not suppressed before the text or macros following on the next input line. .PP .R "\fBempty reference block\fR .br (mdoc) An \fB\&Rs\fR macro is immediately followed by an \fB\&Re\fR macro on the next input line. Such an empty block does not produce any output. .PP .R "\fBmissing section argument\fR .br (mdoc) An \fB\&Xr\fR macro lacks its second, section number argument. The first argument, i.e. the name, is printed, but without subsequent parentheses. .PP .R "\fBmissing -std argument, adding it\fR .br (mdoc) An \fB\&Ex\fR or \fB\&Rv\fR macro lacks the required \fB\-std\fR argument. The \fBmandoc\fR utility assumes \fB\-std\fR even when it is not specified, but other implementations may not. .PP .R "\fBmissing option string, using \(dq\(dq\fR .br (man) The \fB\&OP\fR macro is invoked without any argument. An empty pair of square brackets is shown. .PP .R "\fBmissing resource identifier, using \(dq\(dq\fR .br (man) The \fB\&UR\fR macro is invoked without any argument. An empty pair of angle brackets is shown. .PP .R "\fBmissing eqn box, using \(dq\(dq\fR .br (eqn) A diacritic mark or a binary operator is found, but there is nothing to the left of it. An empty box is inserted. .SS "Warnings related to bad macro arguments" .PP .R "\fBunterminated quoted argument\fR .br (roff) Macro arguments can be enclosed in double quote characters such that space characters and macro names contained in the quoted argument need not be escaped. The closing quote of the last argument of a macro can be omitted. However, omitting it is not recommended because it makes the code harder to read. .PP .R "\fBduplicate argument\fR .br (mdoc) A \fB\&Bd\fR or \fB\&Bl\fR macro has more than one \fB\-compact\fR, more than one \fB\-offset\fR, or more than one \fB\-width\fR argument. All but the last instances of these arguments are ignored. .PP .R "\fBskipping duplicate argument\fR .br (mdoc) An \fB\&An\fR macro has more than one \fB\-split\fR or \fB\-nosplit\fR argument. All but the first of these arguments are ignored. .PP .R "\fBskipping duplicate display type\fR .br (mdoc) A \fB\&Bd\fR macro has more than one type argument; the first one is used. .PP .R "\fBskipping duplicate list type\fR .br (mdoc) A \fB\&Bl\fR macro has more than one type argument; the first one is used. .PP .R "\fBskipping -width argument\fR .br (mdoc) A \fB\&Bl\fR \fB\-column\fR, \fB\-diag\fR, \fB\-ohang\fR, \fB\-inset\fR, or \fB\-item\fR list has a \fB\-width\fR argument. That has no effect. .PP .R "\fBwrong number of cells\fR .br In a line of a \fB\&Bl\fR \fB\-column\fR list, the number of tabs or \fB\&Ta\fR macros is less than the number expected from the list header line or exceeds the expected number by more than one. Missing cells remain empty, and all cells exceeding the number of columns are joined into one single cell. .PP .R "\fBunknown AT&T UNIX version\fR .br (mdoc) An \fB\&At\fR macro has an invalid argument. It is used verbatim, with "AT&T UNIX " prefixed to it. .PP .R "\fBcomma in function argument\fR .br (mdoc) An argument of an \fB\&Fa\fR or \fB\&Fn\fR macro contains a comma; it should probably be split into two arguments. .PP .R "\fBparenthesis in function name\fR .br (mdoc) The first argument of an \fB\&Fc\fR or \fB\&Fn\fR macro contains an opening or closing parenthesis; that's probably wrong, parentheses are added automatically. .PP .R "\fBinvalid content in Rs block\fR .br (mdoc) An \fB\&Rs\fR block contains plain text or non-% macros. The bogus content is left in the syntax tree. Formatting may be poor. .PP .R "\fBinvalid Boolean argument\fR .br (mdoc) An \fB\&Sm\fR macro has an argument other than \fBon\fR or \fBoff\fR. The invalid argument is moved out of the macro, which leaves the macro empty, causing it to toggle the spacing mode. .PP .R "\fBunknown font, skipping request\fR .br (man, tbl) A roff(7) \fB\&ft\fR request or a tbl(7) \fB\&f\fR layout modifier has an unknown \fIfont\fR argument. .PP .R "\fBodd number of characters in request\fR .br (roff) A \fB\&tr\fR request contains an odd number of characters. The last character is mapped to the blank character. .SS "Warnings related to plain text" .PP .R "\fBblank line in fill mode, using .sp\fR .br (mdoc) The meaning of blank input lines is only well-defined in non-fill mode: In fill mode, line breaks of text input lines are not supposed to be significant. However, for compatibility with groff, blank lines in fill mode are replaced with \fB\&sp\fR requests. .PP .R "\fBtab in filled text\fR .br (mdoc, man) The meaning of tab characters is only well-defined in non-fill mode: In fill mode, whitespace is not supposed to be significant on text input lines. As an implementation dependent choice, tab characters on text lines are passed through to the formatters in any case. Given that the text before the tab character will be filled, it is hard to predict which tab stop position the tab will advance to. .PP .R "\fBwhitespace at end of input line\fR .br (mdoc, man, roff) Whitespace at the end of input lines is almost never semantically significant \(em but in the odd case where it might be, it is extremely confusing when reviewing and maintaining documents. .PP .R "\fBnew sentence, new line\fR .br (mdoc) A new sentence starts in the middle of a text line. Start it on a new input line to help formatters produce correct spacing. .PP .R "\fBbad comment style\fR .br (roff) Comment lines start with a dot, a backslash, and a double-quote character. The \fBmandoc\fR utility treats the line as a comment line even without the backslash, but leaving out the backslash might not be portable. .PP .R "\fBinvalid escape sequence\fR .br (roff) An escape sequence has an invalid opening argument delimiter, lacks the closing argument delimiter, or the argument has too few characters. If the argument is incomplete, \fB\e*\fR and \fB\en\fR expand to an empty string, \fB\eB\fR to the digit \(oq0\(cq, and \fB\ew\fR to the length of the incomplete argument. All other invalid escape sequences are ignored. .PP .R "\fBundefined string, using \(dq\(dq\fR .br (roff) If a string is used without being defined before, its value is implicitly set to the empty string. However, defining strings explicitly before use keeps the code more readable. .SS "Warnings related to tables" .PP .R "\fBtbl line starts with span\fR .br (tbl) The first cell in a table layout line is a horizontal span (\(oq\fBs\fR\(cq). Data provided for this cell is ignored, and nothing is printed in the cell. .PP .R "\fBtbl column starts with span\fR .br (tbl) The first line of a table layout specification requests a vertical span (\(oq\fB^\fR\(cq). Data provided for this cell is ignored, and nothing is printed in the cell. .PP .R "\fBskipping vertical bar in tbl layout\fR .br (tbl) A table layout specification contains more than two consecutive vertical bars. A double bar is printed, all additional bars are discarded. .SS "Errors related to tables" .PP .R "\fBnon-alphabetic character in tbl options\fR .br (tbl) The table options line contains a character other than a letter, blank, or comma where the beginning of an option name is expected. The character is ignored. .PP .R "\fBskipping unknown tbl option\fR .br (tbl) The table options line contains a string of letters that does not match any known option name. The word is ignored. .PP .R "\fBmissing tbl option argument\fR .br (tbl) A table option that requires an argument is not followed by an opening parenthesis, or the opening parenthesis is immediately followed by a closing parenthesis. The option is ignored. .PP .R "\fBwrong tbl option argument size\fR .br (tbl) A table option argument contains an invalid number of characters. Both the option and the argument are ignored. .PP .R "\fBempty tbl layout\fR .br (tbl) A table layout specification is completely empty, specifying zero lines and zero columns. As a fallback, a single left-justified column is used. .PP .R "\fBinvalid character in tbl layout\fR .br (tbl) A table layout specification contains a character that can neither be interpreted as a layout key character nor as a layout modifier, or a modifier precedes the first key. The invalid character is discarded. .PP .R "\fBunmatched parenthesis in tbl layout\fR .br (tbl) A table layout specification contains an opening parenthesis, but no matching closing parenthesis. The rest of the input line, starting from the parenthesis, has no effect. .PP .R "\fBtbl without any data cells\fR .br (tbl) A table does not contain any data cells. It will probably produce no output. .PP .R "\fBignoring data in spanned tbl cell\fR .br (tbl) A table cell is marked as a horizontal span (\(oq\fBs\fR\(cq) or vertical span (\(oq\fB^\fR\(cq) in the table layout, but it contains data. The data is ignored. .PP .R "\fBignoring extra tbl data cells\fR .br (tbl) A data line contains more cells than the corresponding layout line. The data in the extra cells is ignored. .PP .R "\fBdata block open at end of tbl\fR .br (tbl) A data block is opened with \fBT{\fR, but never closed with a matching \fBT}\fR. The remaining data lines of the table are all put into one cell, and any remaining cells stay empty. .SS "Errors related to roff, mdoc, and man code" .PP .R "\fBinput stack limit exceeded, infinite loop?\fR .br (roff) Explicit recursion limits are implemented for the following features, in order to prevent infinite loops: .PD 0 .TP 4n \fB-\fR expansion of nested escape sequences including expansion of strings and number registers, .TP 4n \fB-\fR expansion of nested user-defined macros, .TP 4n \fB-\fR and \fB\&so\fR file inclusion. .PP When a limit is hit, the output is incorrect, typically losing some content, but the parser can continue. .PD .PP .R "\fBskipping bad character\fR .br (mdoc, man, roff) The input file contains a byte that is not a printable ascii(7) character. The message mentions the character number. The offending byte is replaced with a question mark (\(oq\&?\(cq). Consider editing the input file to replace the byte with an ASCII transliteration of the intended character. .PP .R "\fBskipping unknown macro\fR .br (mdoc, man, roff) The first identifier on a request or macro line is neither recognized as a roff(7) request, nor as a user-defined macro, nor, respectively, as an mdoc(7) or man(7) macro. It may be mistyped or unsupported. The request or macro is discarded including its arguments. .PP .R "\fBskipping insecure request\fR .br (roff) An input file attempted to run a shell command or to read or write an external file. Such attempts are denied for security reasons. .PP .R "\fBskipping item outside list\fR .br (mdoc, eqn) An \fB\&It\fR macro occurs outside any \fB\&Bl\fR list, or an eqn(7) \fBabove\fR delimiter occurs outside any pile. It is discarded including its arguments. .PP .R "\fBskipping column outside column list\fR .br (mdoc) A \fB\&Ta\fR macro occurs outside any \fB\&Bl\fR \fB\-column\fR block. It is discarded including its arguments. .PP .R "\fBskipping end of block that is not open\fR .br (mdoc, man, eqn, tbl, roff) Various syntax elements can only be used to explicitly close blocks that have previously been opened. An mdoc(7) block closing macro, a man(7) \fB\&RE\fR or \fB\&UE\fR macro, an eqn(7) right delimiter or closing brace, or the end of an equation, table, or roff(7) conditional request is encountered but no matching block is open. The offending request or macro is discarded. .PP .R "\fBfewer RS blocks open, skipping\fR .br (man) The \fB\&RE\fR macro is invoked with an argument, but less than the specified number of \fB\&RS\fR blocks is open. The \fB\&RE\fR macro is discarded. .PP .R "\fBinserting missing end of block\fR .br (mdoc, tbl) Various mdoc(7) macros as well as tables require explicit closing by dedicated macros. A block that doesn't support bad nesting ends before all of its children are properly closed. The open child nodes are closed implicitly. .PP .R "\fBappending missing end of block\fR .br (mdoc, man, eqn, tbl, roff) At the end of the document, an explicit mdoc(7) block, a man(7) next-line scope or \fB\&RS\fR or \fB\&UR\fR block, an equation, table, or roff(7) conditional or ignore block is still open. The open block is closed implicitly. .PP .R "\fBescaped character not allowed in a name\fR .br (roff) Macro, string and register identifiers consist of printable, non-whitespace ASCII characters. Escape sequences and characters and strings expressed in terms of them cannot form part of a name. The first argument of an \fB\&am\fR, \fB\&as\fR, \fB\&de\fR, \fB\&ds\fR, \fB\&nr\fR, or \fB\&rr\fR request, or any argument of an \fB\&rm\fR request, or the name of a request or user defined macro being called, is terminated by an escape sequence. In the cases of \fB\&as\fR, \fB\&ds\fR, and \fB\&nr\fR, the request has no effect at all. In the cases of \fB\&am\fR, \fB\&de\fR, \fB\&rr\fR, and \fB\&rm\fR, what was parsed up to this point is used as the arguments to the request, and the rest of the input line is discarded including the escape sequence. When parsing for a request or a user-defined macro name to be called, only the escape sequence is discarded. The characters preceding it are used as the request or macro name, the characters following it are used as the arguments to the request or macro. .PP .R "\fBNOT IMPLEMENTED: Bd -file\fR .br (mdoc) For security reasons, the \fB\&Bd\fR macro does not support the \fB\-file\fR argument. By requesting the inclusion of a sensitive file, a malicious document might otherwise trick a privileged user into inadvertently displaying the file on the screen, revealing the file content to bystanders. The argument is ignored including the file name following it. .PP .R "\fBskipping display without arguments\fR .br (mdoc) A \fB\&Bd\fR block macro does not have any arguments. The block is discarded, and the block content is displayed in whatever mode was active before the block. .PP .R "\fBmissing list type, using -item\fR .br (mdoc) A \fB\&Bl\fR macro fails to specify the list type. .PP .R "\fBmissing manual name, using \(dq\(dq\fR .br (mdoc) The first call to \fB\&Nm\fR, or any call in the NAME section, lacks the required argument. .PP .R "\fBuname(3) system call failed, using UNKNOWN\fR .br (mdoc) The \fB\&Os\fR macro is called without arguments, and the uname(3) system call failed. As a workaround, \fBmandoc\fR can be compiled with \fB\-D\fR\fBOSNAME=\(dq\e\(dq\fR\fIstring\fR\fB\e\(dq\(dq\fR. .PP .R "\fBunknown standard specifier\fR .br (mdoc) An \fB\&St\fR macro has an unknown argument and is discarded. .PP .R "\fBskipping request without numeric argument\fR .br (roff, eqn) An \fB\&it\fR request or an eqn(7) \fB\&size\fR or \fB\&gsize\fR statement has a non-numeric or negative argument or no argument at all. The invalid request or statement is ignored. .PP .R "\fBNOT IMPLEMENTED: .so with absolute path or \(dq..\(dq\fR .br (roff) For security reasons, \fBmandoc\fR allows \fB\&so\fR file inclusion requests only with relative paths and only without ascending to any parent directory. By requesting the inclusion of a sensitive file, a malicious document might otherwise trick a privileged user into inadvertently displaying the file on the screen, revealing the file content to bystanders. \fBmandoc\fR only shows the path as it appears behind \fB\&so\fR. .PP .R "\fB.so request failed\fR .br (roff) Servicing a \fB\&so\fR request requires reading an external file, but the file could not be opened. \fBmandoc\fR only shows the path as it appears behind \fB\&so\fR. .PP .R "\fBskipping all arguments\fR .br (mdoc, man, eqn, roff) An mdoc(7) \fB\&Bt\fR, \fB\&Ed\fR, \fB\&Ef\fR, \fB\&Ek\fR, \fB\&El\fR, \fB\&Lp\fR, \fB\&Pp\fR, \fB\&Re\fR, \fB\&Rs\fR, or \fB\&Ud\fR macro, an \fB\&It\fR macro in a list that don't support item heads, a man(7) \fB\&LP\fR, \fB\&P\fR, or \fB\&PP\fR macro, an eqn(7) \fB\&EQ\fR or \fB\&EN\fR macro, or a roff(7) \fB\&br\fR, \fB\&fi\fR, or \fB\&nf\fR request or \(oq\&..\(cq block closing request is invoked with at least one argument. All arguments are ignored. .PP .R "\fBskipping excess arguments\fR .br (mdoc, man, roff) A macro or request is invoked with too many arguments: .RS 2n .PD 0 .TP 4n \fB-\fR \fB\&Fo\fR, \fB\&PD\fR, \fB\&RS\fR, \fB\&UR\fR, \fB\&ft\fR, or \fB\&sp\fR with more than one argument .TP 4n \fB-\fR \fB\&An\fR with another argument after \fB\-split\fR or \fB\-nosplit\fR .TP 4n \fB-\fR \fB\&RE\fR with more than one argument or with a non-integer argument .TP 4n \fB-\fR \fB\&OP\fR or a request of the \fB\&de\fR family with more than two arguments .TP 4n \fB-\fR \fB\&Dt\fR with more than three arguments .TP 4n \fB-\fR \fB\&TH\fR with more than five arguments .TP 4n \fB-\fR \fB\&Bd\fR, \fB\&Bk\fR, or \fB\&Bl\fR with invalid arguments .RE The excess arguments are ignored. .PD .SS "Unsupported features" .PP .R "\fBinput too large\fR .br (mdoc, man) Currently, \fBmandoc\fR cannot handle input files larger than its arbitrary size limit of 2^31 bytes (2 Gigabytes). Since useful manuals are always small, this is not a problem in practice. Parsing is aborted as soon as the condition is detected. .PP .R "\fBunsupported control character\fR .br (roff) An ASCII control character supported by other roff(7) implementations but not by \fBmandoc\fR was found in an input file. It is replaced by a question mark. .PP .R "\fBunsupported roff request\fR .br (roff) An input file contains a roff(7) request supported by GNU troff or Heirloom troff but not by \fBmandoc\fR, and it is likely that this will cause information loss or considerable misformatting. .PP .R "\fBeqn delim option in tbl\fR .br (eqn, tbl) The options line of a table defines equation delimiters. Any equation source code contained in the table will be printed unformatted. .PP .R "\fBunsupported table layout modifier\fR .br (tbl) A table layout specification contains an \(oq\fBm\fR\(cq modifier. The modifier is discarded. .PP .R "\fBignoring macro in table\fR .br (tbl, mdoc, man) A table contains an invocation of an mdoc(7) or man(7) macro or of an undefined macro. The macro is ignored, and its arguments are handled as if they were a text line. .SH "SEE ALSO" apropos(1), man(1), eqn(7), man(7), mandoc_char(7), mdoc(7), roff(7), tbl(7) .SH "HISTORY" The \fBmandoc\fR utility first appeared in OpenBSD 4.8. The option \fB\-I\fR appeared in OpenBSD 5.2, and \fB\-aCcfhKklMSsw\fR in OpenBSD 5.7. .SH "AUTHORS" The \fBmandoc\fR utility was written by Kristaps Dzonsons <\fIkristaps@bsd.lv\fR> and is maintained by Ingo Schwarze <\fIschwarze@openbsd.org\fR>.