NAME
mandoc —
format and display UNIX
manuals
SYNOPSIS
mandoc |
[-acfhkl] [-I
os=name]
[-K encoding]
[-mformat]
[-O option]
[-T output]
[-W level]
[file ...] |
DESCRIPTION
The mandoc utility formats
Unix manual pages for display.
By default, mandoc reads
mdoc(7) or man(7) text from stdin, implying
-mandoc, and produces
-T locale output.
The options are as follows:
-a- If the standard output is a terminal device and
-cis not specified, use more(1) to paginate the output, just like man(1) would. -c- 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
-a. -f- A synonym for
whatis(1). This overrides any earlier
-kand-loptions. -Ios=name- Override the default operating system name for the mdoc(7) ‘Os’ and for the man(7) ‘TH’ macro.
-h- Display only the SYNOPSIS lines. Implies
-c. -Kencoding- Specify the input encoding. The supported encoding
arguments are
us-ascii,iso-8859-1, andutf-8. If not specified, autodetection uses the first match:utf-8- if the first three bytes of the input file are the UTF-8 byte order mark (BOM, 0xefbbbf)
- encoding
- if the first or second line of the input file matches the
emacs mode
line format
.\" -*- [...;] coding: encoding; -*-
utf-8- if the first non-ASCII byte in the file introduces a valid UTF-8 sequence
iso-8859-1- otherwise
-k- A synonym for
apropos(1). This overrides any earlier
-fand-loptions. -l- A synonym for
-a. Also reverts any earlier-fand-koptions. -mformat- Input format. See Input Formats
for available formats. Defaults to
-mandoc. -Ooption- Comma-separated output options.
-Toutput- Output format. See Output Formats
for available formats. Defaults to
-Tlocale. -Wlevel- Specify the minimum message level to be reported on
the standard error output and to affect the exit status. The
level can be
warning,error, orunsupp;allis an alias forwarning. By default,mandocis silent. See EXIT STATUS and DIAGNOSTICS for details.The special option
-Wstoptellsmandocto 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 level andstopare requested, they can be joined with a comma, for example-Werror,stop. - file
- Read input from zero or more files. If unspecified, reads from stdin. If
multiple files are specified,
mandocwill halt with the first failed parse.
In -f and -k mode,
mandoc also supports the options
-CMmOSsw described in the
apropos(1) manual.
Input Formats
The mandoc utility accepts
mdoc(7) and man(7) input with
-mdoc and
-man, respectively. The
mdoc(7) format is
strongly
recommended; man(7) should only be used for legacy manuals.
A third option,
-mandoc, which is also the
default, determines encoding on-the-fly: if the first non-comment macro is
‘Dd’ or ‘Dt’, the
mdoc(7) parser is used; otherwise, the
man(7) parser is used.
If multiple files are specified with
-mandoc, each has its
file-type determined this way. If multiple files are specified and
-mdoc or
-man is specified, then this
format is used exclusively.
Output Formats
The mandoc utility accepts the following
-T arguments, which correspond to output modes:
-Tascii- Produce 7-bit ASCII output. See ASCII Output.
-Thtml- Produce HTML5, CSS1, and MathML output. See HTML Output.
-Tlint- Parse only: produce no output. Implies
-Wwarning. -Tlocale- Encode output using the current locale. This is the default. See Locale Output.
-Tman- Produce man(7) format output. See Man Output.
-Tpdf- Produce PDF output. See PDF Output.
-Tps- Produce PostScript output. See PostScript Output.
-Ttree- Produce an indented parse tree.
-Tutf8- Encode output in the UTF-8 multi-byte format. See UTF-8 Output.
-Txhtml- This is a synonym for
-Thtml.
If multiple input files are specified, these will be processed by the corresponding filter in-order.
ASCII Output
Output produced by -T
ascii is rendered in standard 7-bit ASCII documented
in ascii(7).
Font styles are applied by using back-spaced encoding such that an underlined character ‘c’ is rendered as ‘_\[bs]c’, where ‘\[bs]’ is the back-space character number 8. Emboldened characters are rendered as ‘c\[bs]c’.
The special characters documented in mandoc_char(7) are rendered best-effort in an ASCII equivalent.
Output width is limited to 78 visible columns unless literal input lines exceed this limit.
The following -O arguments are
accepted:
indent=indent- The left margin for normal text is set to indent 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.
width=width- The output width is set to width, which will normalise to ≥58.
HTML Output
Output produced by -T
html conforms to HTML5 using optional self-closing
tags. Default styles use only CSS1. Equations rendered from
eqn(7) blocks use MathML.
The example.style.css file documents
style-sheet classes available for customising output. If a style-sheet is
not specified with -O style,
-T html defaults to simple
output (via an embedded style-sheet) readable in any graphical or text-based
web browser.
Special characters are rendered in decimal-encoded UTF-8.
The following -O arguments are
accepted:
fragment- Omit the <!DOCTYPE> declaration and the <html>, <head>,
and <body> elements and only emit the subtree below the <body>
element. The
styleargument will be ignored. This is useful when embedding manual content within existing documents. includes=fmt- The string fmt, for example, ../src/%I.html, is used as a template for linked header files (usually via the ‘In’ macro). Instances of ‘%I’ are replaced with the include filename. The default is not to present a hyperlink.
man=fmt- The string fmt, for example, ../html%S/%N.%S.html, is used as a template for linked manuals (usually via the ‘Xr’ macro). Instances of ‘%N’ and ‘%S’ 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.
style=style.css- The file style.css is used for an external style-sheet. This must be a valid absolute or relative URI.
Locale Output
Locale-depending output encoding is triggered with
-T locale. This is the
default.
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 -T
ascii. See ASCII
Output for font style specification and available command-line
arguments.
Man Output
Translate input format into man(7) output format. This is useful for distributing manual sources to legacy systems lacking mdoc(7) formatters.
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) ‘so’ requests. The parser is also run, and as
usual, the -W level controls which
DIAGNOSTICS are displayed before
copying the input to the output.
PDF Output
PDF-1.1 output may be generated by -T
pdf. See
PostScript Output for
-O arguments and defaults.
PostScript Output
PostScript "Adobe-3.0" Level-2 pages may be generated by
-T ps. 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.
Special characters are rendered as in ASCII Output.
The following -O arguments are
accepted:
paper=name- The paper size name may be one of a3, a4, a5, legal, or letter. You may also manually specify dimensions as NNxNN, width by height in millimetres. If an unknown value is encountered, letter is used.
UTF-8 Output
Use -T utf8 to
force a UTF-8 locale. See Locale
Output for details and options.
ENVIRONMENT
MANPAGER- Any non-empty value of the environment variable
MANPAGERwill be used instead of the standard pagination program, more(1). PAGER- Specifies the pagination program to use when
MANPAGERis not defined. If neither PAGER nor MANPAGER is defined, more(1)-swill be used.
EXIT STATUS
The mandoc utility exits with one of the
following values, controlled by the message level
associated with the -W option:
- 0
- No warnings or errors occurred, or those that did were ignored because they were lower than the requested level.
- 2
- At least one warning occurred, but no error, and
-Wwarningwas specified. - 3
- At least one parsing error occurred, but no unsupported feature was
encountered, and
-Werroror-Wwarningwas specified. - 4
- At least one unsupported feature was encountered, and
-Wunsupp,-Werroror-Wwarningwas specified. - 5
- Invalid command line arguments were specified. No input files have been read.
- 6
- An operating system error occurred, for example exhaustion of memory, file
descriptors, or process table entries. Such errors cause
mandocto exit at once, possibly in the middle of parsing or formatting a file.
Note that selecting -T
lint output mode implies -W
warning.
EXAMPLES
To page manuals to the terminal:
$ mandoc -W all,stop mandoc.1
2>&1 | less$ mandoc mandoc.1 mdoc.3 mdoc.7 |
lessTo produce HTML manuals with style.css as the style-sheet:
$ mandoc -T html -O style=style.css
mdoc.7 > mdoc.7.htmlTo check over a large set of manuals:
$ mandoc -T lint `find /usr/src -name
\*\.[1-9]`To produce a series of PostScript manuals for A4 paper:
$ mandoc -T ps -O paper=a4 mdoc.7
man.7 > manuals.psConvert a modern mdoc(7) manual to the older man(7) format, for use on systems lacking an mdoc(7) parser:
$ mandoc -T man foo.mdoc >
foo.manDIAGNOSTICS
Messages displayed by mandoc follow this
format:
mandoc:
file:line:column:
level: message:
macro argsLine 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 file and level fields.
Message levels have the following meanings:
unsupp- An input file uses unsupported low-level
roff(7) features. The output may be incomplete and/or misformatted,
so using GNU troff instead of
mandocto process the file may be preferable. error- 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
mandocor GNU troff is used. In many cases, the output ofmandocand GNU troff is identical, but in some,mandocis more resilient than GNU troff with respect to malformed input.Non-existent or unreadable input files are also reported on the
errorlevel. In that case, the parser cannot even be started and no output is produced from those input files. warning- 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
mandoc.
Messages of the warning,
error, and unsupp levels
except those about non-existent or unreadable input files are hidden unless
their level, or a lower level, is requested using a
-W option or -T
lint output mode.
Warnings related to the document prologue
- missing manual title, using UNTITLED
- (mdoc) A
Dtmacro has no arguments, or there is noDtmacro before the first non-prologue macro. - missing manual title, using ""
- (man) There is no
THmacro, or it has no arguments. - lower case character in document title
- (mdoc, man) The title is still used as given in the
DtorTHmacro. - missing manual section, using ""
- (mdoc, man) A
DtorTHmacro lacks the mandatory section argument. - unknown manual section
- (mdoc) The section number in a
Dtline is invalid, but still used. - missing date, using today's date
- (mdoc, man) The document was parsed as
mdoc(7) and it has no
Ddmacro, or theDdmacro has no arguments or only empty arguments; or the document was parsed as man(7) and it has noTHmacro, or theTHmacro has less than three arguments or its third argument is empty. - cannot parse date, using it verbatim
- (mdoc, man) The date given in a
DdorTHmacro does not follow the conventional format. - missing Os macro, using ""
- (mdoc) The default or current system is not shown in this case.
- duplicate prologue macro
- (mdoc) One of the prologue macros occurs more than once. The last instance overrides all previous ones.
- late prologue macro
- (mdoc) A
DdorOsmacro occurs after some non-prologue macro, but still takes effect. - skipping late title macro
- (mdoc) The
Dtmacro 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 tomandoc, traditional semantics is preserved. The late macro is discarded including its arguments. - prologue macros out of order
- (mdoc) The prologue macros are not given in the conventional order
Dd,Dt,Os. All three macros are used even when given in another order.
Warnings regarding document structure
- .so is fragile, better use ln(1)
- (roff) Including files only works when the parser program runs with the correct current working directory.
- no document body
- (mdoc, man) The document body contains neither text nor macros. An empty document is shown, consisting only of a header and a footer line.
- content before first section header
- (mdoc, man) Some macros or text precede the first
ShorSHsection header. The offending macros and text are parsed and added to the top level of the syntax tree, outside any section block. - first section is not NAME
- (mdoc) The argument of the first
Shmacro is not ‘NAME’. This may confuse makewhatis(8) and apropos(1). - NAME section without name
- (mdoc) The NAME section does not contain any
Nmchild macro. - NAME section without description
- (mdoc) The NAME section lacks the mandatory
Ndchild macro. - description not at the end of NAME
- (mdoc) The NAME section does contain an
Ndchild macro, but other content follows it. - bad NAME section content
- (mdoc) The NAME section contains plain text or macros other than
NmandNd. - missing description line, using ""
- (mdoc) The
Ndmacro lacks the required argument. The title line of the manual will end after the dash. - sections out of conventional order
- (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.
- duplicate section title
- (mdoc) The same standard section title occurs more than once.
- unexpected section
- (mdoc) A standard section header occurs in a section of the manual where it normally isn't useful.
- unusual Xr order
- (mdoc) In the SEE ALSO section, an
Xrmacro with a lower section number follows one with a higher number, or twoXrmacros referring to the same section are out of alphabetical order. - unusual Xr punctuation
- (mdoc) In the SEE ALSO section, punctuation between two
Xrmacros differs from a single comma, or there is trailing punctuation after the lastXrmacro. - AUTHORS section without An macro
- (mdoc) An AUTHORS sections contains no
Anmacros, or only empty ones. Probably, there are author names lacking markup.
Warnings related to macros and nesting
- obsolete macro
- (mdoc) See the mdoc(7) manual for replacements.
- macro neither callable nor escaped
- (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 ‘\&’.
- skipping paragraph macro
- In mdoc(7) documents, this happens
- at the beginning and end of sections and subsections
- right before non-compact lists and displays
- at the end of items in non-column, non-compact lists
- and for multiple consecutive paragraph macros.
- for empty
P,PP, andLPmacros - for
IPmacros having neither head nor body arguments - for
brorspright afterSHorSS
- moving paragraph macro out of list
- (mdoc) A list item in a
Bllist contains a trailing paragraph macro. The paragraph macro is moved after the end of the list. - skipping no-space macro
- (mdoc) An input line begins with an
Nsmacro. The macro is ignored. - blocks badly nested
- (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 "
Ao Bo Ac Bc" and "Ao Bq Ac". In these examples,AcbreaksBoandBq, respectively. - nested displays are not portable
- (mdoc) A
Bd,D1, orDldisplay occurs nested inside anotherBddisplay. This works withmandoc, but fails with most other implementations. - moving content out of list
- (mdoc) A
Bllist block contains text or macros before the firstItmacro. The offending children are moved before the beginning of the list. - .Vt block has child macro
- (mdoc) The
Vtmacro supports plain text arguments only. Formatting may be ugly and semantic searching for the affected content might not work. - fill mode already enabled, skipping
- (man) A
firequest occurs even though the document is still in fill mode, or already switched back to fill mode. It has no effect. - fill mode already disabled, skipping
- (man) An
nfrequest occurs even though the document already switched to no-fill mode and did not switch back to fill mode yet. It has no effect. - line scope broken
- (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.
Warnings related to missing arguments
- skipping empty request
- (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.
- conditional request controls empty scope
- (roff) A conditional request is only useful if any of the following
follows it on the same logical input line:
- The ‘\{’ keyword to open a multi-line scope.
- A request or macro or some text, resulting in a single-line scope.
- The immediate end of the logical line without any intervening whitespace, resulting in next-line scope.
elclause. - skipping empty macro
- (mdoc) The indicated macro has no arguments and hence no effect.
- empty block
- (mdoc, man) A
Bd,Bk,Bl,D1,Dl,RS, orURblock contains nothing in its body and will produce no output. - empty argument, using 0n
- (mdoc) The required width is missing after
BdorBl-offsetor-width. - missing display type, using -ragged
- (mdoc) The
Bdmacro is invoked without the required display type. - list type is not the first argument
- (mdoc) In a
Blmacro, at least one other argument precedes the type argument. Themandocutility copes with any argument order, but some other mdoc(7) implementations do not. - missing -width in -tag list, using 8n
- (mdoc) Every
Blmacro having the-tagargument requires-width, too. - missing utility name, using ""
- (mdoc) The
Ex-stdmacro is called without an argument beforeNmhas first been called with an argument. - missing function name, using ""
- (mdoc) The
Fomacro is called without an argument. No function name is printed. - empty head in list item
- (mdoc) In a
Bl-diag,-hang,-inset,-ohang, or-taglist, anItmacro lacks the required argument. The item head is left empty. - empty list item
- (mdoc) In a
Bl-bullet,-dash,-enum, or-hyphenlist, anItblock is empty. An empty list item is shown. - missing font type, using \fR
- (mdoc) A
Bfmacro has no argument. It switches to the default font. - unknown font type, using \fR
- (mdoc) The
Bfargument is invalid. The default font is used instead. - nothing follows prefix
- (mdoc) A
Pfmacro 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. - empty reference block
- (mdoc) An
Rsmacro is immediately followed by anRemacro on the next input line. Such an empty block does not produce any output. - missing -std argument, adding it
- (mdoc) An
ExorRvmacro lacks the required-stdargument. Themandocutility assumes-stdeven when it is not specified, but other implementations may not. - missing option string, using ""
- (man) The
OPmacro is invoked without any argument. An empty pair of square brackets is shown. - missing resource identifier, using ""
- (man) The
URmacro is invoked without any argument. An empty pair of angle brackets is shown. - missing eqn box, using ""
- (eqn) A diacritic mark or a binary operator is found, but there is nothing to the left of it. An empty box is inserted.
Warnings related to bad macro arguments
- unterminated quoted argument
- (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.
- duplicate argument
- (mdoc) A
BdorBlmacro has more than one-compact, more than one-offset, or more than one-widthargument. All but the last instances of these arguments are ignored. - skipping duplicate argument
- (mdoc) An
Anmacro has more than one-splitor-nosplitargument. All but the first of these arguments are ignored. - skipping duplicate display type
- (mdoc) A
Bdmacro has more than one type argument; the first one is used. - skipping duplicate list type
- (mdoc) A
Blmacro has more than one type argument; the first one is used. - skipping -width argument
- (mdoc) A
Bl-column,-diag,-ohang,-inset, or-itemlist has a-widthargument. That has no effect. - wrong number of cells
- In a line of a
Bl-columnlist, the number of tabs orTamacros 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. - unknown AT&T UNIX version
- (mdoc) An
Atmacro has an invalid argument. It is used verbatim, with "AT&T UNIX " prefixed to it. - comma in function argument
- (mdoc) An argument of an
FaorFnmacro contains a comma; it should probably be split into two arguments. - parenthesis in function name
- (mdoc) The first argument of an
FcorFnmacro contains an opening or closing parenthesis; that's probably wrong, parentheses are added automatically. - invalid content in Rs block
- (mdoc) An
Rsblock contains plain text or non-% macros. The bogus content is left in the syntax tree. Formatting may be poor. - invalid Boolean argument
- (mdoc) An
Smmacro has an argument other thanonoroff. The invalid argument is moved out of the macro, which leaves the macro empty, causing it to toggle the spacing mode. - unknown font, skipping request
- (man, tbl) A roff(7)
ftrequest or a tbl(7)flayout modifier has an unknown font argument. - odd number of characters in request
- (roff) A
trrequest contains an odd number of characters. The last character is mapped to the blank character.
Warnings related to plain text
- blank line in fill mode, using .sp
- (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
sprequests. - tab in filled text
- (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.
- whitespace at end of input line
- (mdoc, man, roff) Whitespace at the end of input lines is almost never semantically significant — but in the odd case where it might be, it is extremely confusing when reviewing and maintaining documents.
- bad comment style
- (roff) Comment lines start with a dot, a backslash, and a double-quote
character. The
mandocutility treats the line as a comment line even without the backslash, but leaving out the backslash might not be portable. - invalid escape sequence
- (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,
\*and\nexpand to an empty string,\Bto the digit ‘0’, and\wto the length of the incomplete argument. All other invalid escape sequences are ignored. - undefined string, using ""
- (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.
Warnings related to tables
- tbl line starts with span
- (tbl) The first cell in a table layout line is a horizontal span
(‘
s’). Data provided for this cell is ignored, and nothing is printed in the cell. - tbl column starts with span
- (tbl) The first line of a table layout specification requests a vertical
span (‘
^’). Data provided for this cell is ignored, and nothing is printed in the cell. - skipping vertical bar in tbl layout
- (tbl) A table layout specification contains more than two consecutive vertical bars. A double bar is printed, all additional bars are discarded.
Errors related to tables
- non-alphabetic character in tbl options
- (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.
- skipping unknown tbl option
- (tbl) The table options line contains a string of letters that does not match any known option name. The word is ignored.
- missing tbl option argument
- (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.
- wrong tbl option argument size
- (tbl) A table option argument contains an invalid number of characters. Both the option and the argument are ignored.
- empty tbl layout
- (tbl) A table layout specification is completely empty, specifying zero lines and zero columns. As a fallback, a single left-justified column is used.
- invalid character in tbl layout
- (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.
- unmatched parenthesis in tbl layout
- (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.
- tbl without any data cells
- (tbl) A table does not contain any data cells. It will probably produce no output.
- ignoring data in spanned tbl cell
- (tbl) A table cell is marked as a horizontal span
(‘
s’) or vertical span (‘^’) in the table layout, but it contains data. The data is ignored. - ignoring extra tbl data cells
- (tbl) A data line contains more cells than the corresponding layout line. The data in the extra cells is ignored.
- data block open at end of tbl
- (tbl) A data block is opened with
T{, but never closed with a matchingT}. The remaining data lines of the table are all put into one cell, and any remaining cells stay empty.
Errors related to roff, mdoc, and man code
- input stack limit exceeded, infinite loop?
- (roff) Explicit recursion limits are implemented for the following
features, in order to prevent infinite loops:
- expansion of nested escape sequences including expansion of strings and number registers,
- expansion of nested user-defined macros,
- and
sofile inclusion.
- skipping bad character
- (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 (‘?’). Consider editing the input file to replace the byte with an ASCII transliteration of the intended character.
- skipping unknown macro
- (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.
- skipping insecure request
- (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.
- skipping item outside list
- (mdoc, eqn) An
Itmacro occurs outside anyBllist, or an eqn(7)abovedelimiter occurs outside any pile. It is discarded including its arguments. - skipping column outside column list
- (mdoc) A
Tamacro occurs outside anyBl-columnblock. It is discarded including its arguments. - skipping end of block that is not open
- (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)
REorUEmacro, 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. - fewer RS blocks open, skipping
- (man) The
REmacro is invoked with an argument, but less than the specified number ofRSblocks is open. TheREmacro is discarded. - inserting missing end of block
- (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.
- appending missing end of block
- (mdoc, man, eqn, tbl, roff) At the end of the document, an explicit
mdoc(7) block, a
man(7) next-line scope or
RSorURblock, an equation, table, or roff(7) conditional or ignore block is still open. The open block is closed implicitly. - escaped character not allowed in a name
- (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
am,as,de,ds,nr, orrrrequest, or any argument of anrmrequest, or the name of a request or user defined macro being called, is terminated by an escape sequence. In the cases ofas,ds, andnr, the request has no effect at all. In the cases ofam,de,rr, andrm, 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. - NOT IMPLEMENTED: Bd -file
- (mdoc) For security reasons, the
Bdmacro does not support the-fileargument. 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. - missing list type, using -item
- (mdoc) A
Blmacro fails to specify the list type. - missing manual name, using ""
- (mdoc) The first call to
Nmlacks the required argument. - uname(3) system call failed, using UNKNOWN
- (mdoc) The
Osmacro is called without arguments, and the uname(3) system call failed. As a workaround,mandoccan be compiled with-DOSNAME="\"string\"". - unknown standard specifier
- (mdoc) An
Stmacro has an unknown argument and is discarded. - skipping request without numeric argument
- (roff, eqn) An
itrequest or an eqn(7)sizeorgsizestatement has a non-numeric or negative argument or no argument at all. The invalid request or statement is ignored. - NOT IMPLEMENTED: .so with absolute path or ".."
- (roff) For security reasons,
mandocallowssofile 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.mandoconly shows the path as it appears behindso. - .so request failed
- (roff) Servicing a
sorequest requires reading an external file, but the file could not be opened.mandoconly shows the path as it appears behindso. - skipping all arguments
- (mdoc, man, eqn, roff) An
mdoc(7)
Bt,Ed,Ef,Ek,El,Lp,Pp,Re,Rs, orUdmacro, anItmacro in a list that don't support item heads, a man(7)LP,P, orPPmacro, an eqn(7)EQorENmacro, or a roff(7)br,fi, ornfrequest or ‘..’ block closing request is invoked with at least one argument. All arguments are ignored. - skipping excess arguments
- (mdoc, man, roff) A macro or request is invoked with too many arguments:
Fo,PD,RS,UR,ft, orspwith more than one argumentAnwith another argument after-splitor-nosplitREwith more than one argument or with a non-integer argumentOPor a request of thedefamily with more than two argumentsDtwith more than three argumentsTHwith more than five argumentsBd,Bk, orBlwith invalid arguments
Unsupported features
- input too large
- (mdoc, man) Currently,
mandoccannot 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. - unsupported control character
- (roff) An ASCII control character supported by other
roff(7) implementations but not by
mandocwas found in an input file. It is replaced by a question mark. - unsupported roff request
- (roff) An input file contains a
roff(7) request supported by GNU troff or Heirloom troff but not by
mandoc, and it is likely that this will cause information loss or considerable misformatting. - eqn delim option in tbl
- (eqn, tbl) The options line of a table defines equation delimiters. Any equation source code contained in the table will be printed unformatted.
- unsupported table layout modifier
- (tbl) A table layout specification contains an
‘
m’ modifier. The modifier is discarded. - ignoring macro in table
- (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.
SEE ALSO
apropos(1), man(1), eqn(7), man(7), mandoc_char(7), mdoc(7), roff(7), tbl(7)
AUTHORS
The mandoc utility was written by
Kristaps Dzonsons
<kristaps@bsd.lv> and
is maintained by Ingo Schwarze
<schwarze@openbsd.org>.
BUGS
In -T html, the
maximum size of an element attribute is determined by
BUFSIZ, which is usually 1024 bytes. Be aware of
this when setting long link formats such as -O
style=really/long/link.