MANDOC(1)

๐Ÿ“ฆ version 15.1, in freebsd 14.5, freebsd 15.1

๐Ÿ’… MANDOC(1) ๐Ÿ’…

okay so bestie, this is mandoc from the General Commands Manual, and she is literally the main character of manual pages. let's get into it ๐ŸŽ€


โœจ NAME โœจ

mandoc โ€” format manual pages ๐Ÿ’–


๐ŸŒธ SYNOPSIS ๐ŸŒธ

mandoc [-ac] [-I os=name] [-K encoding] [-mdoc | -man] [-O options]
       [-T output] [-W level] [file ...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

The mandoc utility formats manual pages for display. that's her job. that's what she does. ๐Ÿ‘‘

By default, mandoc reads mdoc(7) or man(7) text from stdin and produces -T locale output. no flags, no drama, just vibes.

The options are as follows:

  • -a โ€” if the standard output is a terminal device and -c is not specified, use less(1) to paginate the output, just like man(1) would. so she pages it for you, iconic behavior.
  • -c โ€” copy the formatted manual pages to the standard output without using less(1) to paginate them. this is the default. it can be specified to override -a. so if -a was being extra, -c is the "no bestie, just print it" flag.
  • -I os=name โ€” override the default operating system name for the mdoc(7) Os and for the man(7) TH macro. fake it till you make it, OS edition ๐Ÿ’…
  • -K encoding โ€” specify the input encoding. the supported encoding arguments are us-ascii, iso-8859-1, and utf-8. if not specified, autodetection uses the first match in the following list:
    1. if the first three bytes of the input file are the UTF-8 byte order mark (BOM, 0xefbbbf), input is interpreted as utf-8.
    2. if the first or second line of the input file matches the emacs mode line format
.\" -*- [...;] coding: encoding; -*-

then input is interpreted according to encoding.

  1. if the first non-ASCII byte in the file introduces a valid UTF-8 sequence, input is interpreted as utf-8.
  2. otherwise, input is interpreted as iso-8859-1.
  • -mdoc | -man โ€” with -mdoc, all input files are interpreted as mdoc(7). with -man, all input files are interpreted as man(7). by default, the input language is automatically detected for each file: if the first macro is Dd or Dt, the mdoc(7) parser is used; otherwise, the man(7) parser is used. with other arguments, -m is silently ignored (she's not mad, she's just ignoring you ๐Ÿ™ˆ).
  • -O options โ€” comma-separated output options. see the descriptions of the individual output formats for supported options. details live downstairs โœจ
  • -T output โ€” select the output format. supported values for the output argument are ascii, html, the default of locale, man, markdown, pdf, ps, tree, and utf8.

the special -T lint mode only parses the input and produces no output. it implies -W all and redirects parser messages, which usually appear on standard error output, to standard output. it's giving "no thoughts, just diagnostics" ๐Ÿ’€

  • -W level โ€” specify the minimum message level to be reported on the standard error output and to affect the exit status. the level can be base, style, warning, error, or unsupp. the base level automatically derives the operating system from the contents of the Os macro, from the -Ios command line option, or from the uname(3) return value. the levels openbsd and netbsd are variants of base that bypass autodetection and request validation of base system conventions for a particular operating system. the level all is an alias for base. by default, mandoc is silent. see โ€œEXIT STATUSโ€ and โ€œDIAGNOSTICSโ€ for details.

the special option -W stop tells mandoc 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 level and stop are requested, they can be joined with a comma, for example -W error,stop.

  • file โ€” read from the given input file. if multiple files are specified, they are processed in the given order. if unspecified, mandoc reads from standard input.

The options -fhklw are also supported and are documented in man(1). in -f and -k mode, mandoc also supports the options -CMmOSs described in the apropos(1) manual. the options -fkl are mutually exclusive and override each other. pick a lane, bestie ๐Ÿซถ


๐ŸŒˆ ASCII Output ๐ŸŒˆ

Use -T ascii to force text output in 7-bit ASCII character encoding documented in the ascii(7) manual page, ignoring the locale(1) set in the environment. she doesn't care what your locale thinks, she's ASCII now.

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โ€™. this markup is typically converted to appropriate terminal sequences by the pager or ul(1). to remove the markup, pipe the output to col(1) -b instead. lowkey a glow-up move โœจ

The special characters documented in mandoc_char(7) are rendered best-effort in an ASCII equivalent. in particular, opening and closing โ€˜single quotesโ€™ are represented as characters number 0x60 and 0x27, respectively, which agrees with all ASCII standards from 1965 to the latest revision (2012) and which matches the traditional way in which roff(7) formatters represent single quotes in ASCII output. this correct ASCII rendering may look strange with modern Unicode-compatible fonts because contrary to ASCII, Unicode uses the code point U+0060 for the grave accent only, never for an opening quote. so if it looks weird, it's correct. she said what she said ๐Ÿ’…

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. increasing this is not recommended; it may result in degraded formatting, for example overfull lines or ugly line breaks. when output is to a pager on a terminal that is less than 66 columns wide, the default is reduced to three columns. trust her on the margin, okay? don't fight it.
  • tag[=term] โ€” if the formatted manual page is opened in a pager, go to the definition of the term rather than showing the manual page from the beginning. if no term is specified, reuse the first command line argument that is not a section number. if that argument is in apropos(1) key=val format, only the val is used rather than the argument as a whole. this is useful for commands like โ€˜man -akO tag Ic=ulimitโ€™ to search for a keyword and jump right to its definition in the matching manual pages. chef's kiss, no notes ๐Ÿ‘‘
  • width=width โ€” the output width is set to width instead of the default of 78. when output is to a pager on a terminal that is less than 79 columns wide, the default is reduced to one less than the terminal width. in any case, lines that are output in literal mode are never wrapped and may exceed the output width. literal lines said "I do what I want" ๐Ÿ’€

๐Ÿ’– HTML Output ๐Ÿ’–

Output produced by -T html conforms to HTML5 using optional self-closing tags. equations rendered from eqn(7) blocks use MathML. non-ASCII characters are rendered as hexadecimal Unicode character references. very demure, very standards-compliant โœจ

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 style argument will be ignored. this is useful when embedding manual content within existing documents. she's a fragment, she's lowkey humble ๐ŸŽ€
  • 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[;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. if two formats are given and a file %N.%S exists in the current directory, the first format is used; otherwise, the second format is used. she checks the directory first, she's thorough like that.
  • style=style.css โ€” the file style.css is used as an external stylesheet. this must be a valid absolute or relative URI.

using the file mandoc.css that is distributed with mandoc is recommended. it provides an appearance similar to terminal output with some additional features specific to mandoc HTML output, in particular making anchor locations that support deep linking stand out visually by putting a dotted line under them, providing tooltips showing the semantic function of elements (macro names), providing some simple aspects of responsive web design, and providing simple support for users who prefer a dark color scheme. dark mode besties rise ๐ŸŒ™

using a custom CSS file is possible, but writing it requires proficiency in all of the languages HTML 5, CSS 4, and mdoc(7) and familiarity with the mandoc-specific classes used in mandoc.css. besides, while the file mandoc.css is always adapted to the HTML output generated by the mandoc version it is distributed with, maintaining a custom CSS file usually requires adaptations each time mandoc is upgraded to a new version. so like, you could, but bestie, why ๐Ÿ˜ญ

if a stylesheet is not specified with -O style, -T html embeds a minimal stylesheet into the HTML output, mostly to select adequate font-style and font-weight attributes for various macros. the result is readable in any graphical or text-based web browser, but does not aim for looking similar to terminal output. instead, formatting is mostly left to browser defaults and to user settings in the browser configuration. she's not gonna fight your browser, that's a you problem ๐Ÿซถ

  • tag[=term] โ€” same syntax and semantics as for โ€œASCII Outputโ€. this is implemented by passing a file:// URI ending in a fragment identifier to the pager rather than passing merely a file name. when using this argument, use a pager supporting such URIs, for example
MANPAGER='lynx -force_html' man -T html -O tag=MANPAGER man
MANPAGER='w3m -T text/html' man -T html -O tag=toc mandoc

consequently, for HTML output, this argument does not work with more(1) or less(1). for example, โ€˜MANPAGER=less man -T html -O tag=toc mandocโ€™ does not work because less(1) does not support file:// URIs. sorry bestie, less said no ๐Ÿ’€

  • toc โ€” if an input file contains at least two non-standard sections, print a table of contents near the beginning of the output. yes queen, give us the table of contents ๐Ÿ“–โœจ

๐ŸŒ Locale Output ๐ŸŒ

okay so by default, mandoc is lowkey picking UTF-8 or ASCII output based on the current locale(1). The way it works: if any of the environment variables LC_ALL, LC_CTYPE, or LANG are set, and the first one that is set selects the UTF-8 character encoding, you get โ€œUTF-8 Outputโ€; otherwise, it falls back to โ€œASCII Outputโ€. You can also force this vibe explicitly with -T locale. ๐Ÿ’…

๐Ÿง‘โ€๐Ÿ’ป Man Output ๐Ÿง‘โ€๐Ÿ’ป

Use -T man to translate mdoc(7) input into man(7) output format. This is iconic for distributing manual sources to legacy systems lacking mdoc(7) formatters. Heads up bestie: embedded eqn(7) and tbl(7) code is not supported. ๐Ÿซถ

If the input format of a file is man(7), the input is copied to the output. The parser is also run, and as usual, the -W level controls which โ€œDIAGNOSTICSโ€ are displayed before copying the input to the output. iykyk.

๐Ÿช„ Markdown Output ๐Ÿช„

Use -T markdown to translate mdoc(7) input into the markdown format conforming to John Gruber's 2004 specification: https://daringfireball.net/projects/markdown/syntax.text. The output also almost conforms to the CommonMark: https://commonmark.org/ specification. close enough, honestly.

The character set used for the markdown output is ASCII. Non-ASCII characters are encoded as HTML entities. Since that is not possible in literal font contexts, because these are rendered as code spans and code blocks in the markdown output, non-ASCII characters are transliterated to ASCII approximations in these contexts.

Markdown is a very weak markup language, so all semantic markup is lost, and even part of the presentational markup may be lost. Do not use this as an intermediate step in converting to HTML; instead, use -T html directly. periodt.

The man(7), tbl(7), and eqn(7) input languages are not supported by -T markdown output mode.

๐Ÿ“„ 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 text output in UTF-8 multi-byte character encoding, ignoring the locale(1) settings in the environment. See โ€œASCII Outputโ€ regarding font styles and -O arguments.

On operating systems lacking locale or wide character support, and on those where the internal character representation is not UCS-4, mandoc always falls back to โ€œASCII Outputโ€.

๐ŸŒณ Syntax tree output ๐ŸŒณ

Use -T tree 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.

The first paragraph shows meta data found in the mdoc(7) prologue, on the man(7) TH line, or the fallbacks used.

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:

  1. For macro nodes, the macro name; for text and tbl(7) nodes, the content. There is a special format for eqn(7) nodes.
  2. Node type (text, elem, block, head, body, body-end, tail, tbl, eqn).
  3. Flags:
    • An opening parenthesis if the node is an opening delimiter.
    • An asterisk if the node starts a new input line.
    • The input line number (starting at one).
    • A colon.
    • The input column number (starting at one).
    • A closing parenthesis if the node is a closing delimiter.
    • A full stop if the node ends a sentence.
    • BROKEN if the node is a block broken by another block.
    • NOSRC if the node is not in the input file, but automatically generated from macros.
    • NOPRT if the node is not supposed to generate output for any output format.

The following -O argument is accepted:

  • noval โ€” 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.

๐ŸŒฟ ENVIRONMENT ๐ŸŒฟ

  • LC_CTYPE โ€” The character encoding locale(1). When โ€œLocale Outputโ€ is selected, it decides whether to use ASCII or UTF-8 output format. It never affects the interpretation of input files.
  • MANPAGER โ€” Any non-empty value of the environment variable MANPAGER is used instead of the standard pagination program, less(1); see man(1) for details. Only used if -a or -l is specified.
  • PAGER โ€” Specifies the pagination program to use when MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, less(1) is used. Only used if -a or -l is specified.

๐Ÿšฆ EXIT STATUS ๐Ÿšฆ

The mandoc utility exits with one of the following values, controlled by the message level associated with the -W option:

  • 0 โ€” No base system convention violations, style suggestions, warnings, or errors occurred, or those that did were ignored because they were lower than the requested level.
  • 1 โ€” At least one base system convention violation or style suggestion occurred, but no warning or error, and -W base or -W style was specified.
  • 2 โ€” At least one warning occurred, but no error, and -W warning or a lower level was requested.
  • 3 โ€” At least one parsing error occurred, but no unsupported feature was encountered, and -W error or a lower level was requested.
  • 4 โ€” At least one unsupported feature was encountered, and -W unsupp or a lower level was requested.
  • 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 may cause mandoc to exit at once, possibly in the middle of parsing or formatting a file.
โš ๏ธ Note that selecting -T lint output mode implies -W all.

๐ŸŽ€ EXAMPLES ๐ŸŽ€

To page manuals to the terminal:

$ mandoc -a mandoc.1 man.1 apropos.1 makewhatis.8

To produce HTML manuals with /usr/share/misc/mandoc.css as the stylesheet:

$ mandoc -T html -O style=/usr/share/misc/mandoc.css mdoc.7 >
mdoc.7.html

To 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.ps

Convert 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.man

๐Ÿฉบ DIAGNOSTICS ๐Ÿฉบ

Messages displayed by mandoc follow this format:

mandoc: file:line:column: level: message: macro argument ... (os)

The first three fields identify the file name, line number, and column number of the input file where the message was triggered. The line and column numbers start at 1. Both are omitted for messages referring to an input file as a whole. All level and message strings are explained below. The name of the macro triggering the message and its arguments are omitted where meaningless. The os operating system specifier is omitted for messages that are relevant for all operating systems. 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:

  • syserr โ€” An operating system error occurred. There isn't necessarily anything wrong with the input files. Output may all the same be missing or incomplete.
  • badarg โ€” Invalid command line arguments were specified. No input files have been read and no output is produced.
  • 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 mandoc to process the file may be preferable.
  • error โ€” Indicates a risk of information loss or severe misformatting, in most cases caused by serious syntax errors.
  • warning โ€” Indicates a risk that the information shown or its formatting may mismatch the author's intent in minor ways. Additionally, syntax errors are classified at least as warnings, even if they do not usually cause misformatting.
  • style โ€” An input file uses dubious or discouraged style. This is not a complaint about the syntax, and probably neither formatting nor portability are in danger. While great care is taken to avoid false positives on the higher message levels, the style level tries to reduce the probability that issues go unnoticed, so it may occasionally issue bogus suggestions. Use your judgement to decide whether any particular style suggestion really justifies a change to the input file.
  • base โ€” A convention used in the base system of a specific operating system is not adhered to. These are not markup mistakes, and neither the quality of formatting nor portability are in danger. Messages of the base level are printed with the more intuitive style level tag.

Messages of the base, style, warning, error, and unsupp levels are hidden unless their level, or a lower level, is requested using a -W option or -T lint output mode.

As indicated below, all base and some style checks are only performed if a specific operating system name occurs in the arguments of the -W command line option, of the Os macro, of the -Ios command line option, or, if neither are present, in the return value of the uname(3) function.

๐Ÿ“œ Conventions for base system manuals ๐Ÿ“œ

Mdocdate found (mdoc, NetBSD) The Dd macro uses CVS Mdocdate keyword substitution, which is not supported by the NetBSD base system. Consider using the conventional โ€œMonth dd, yyyyโ€ format instead.

Mdocdate missing (mdoc, OpenBSD) The Dd macro does not use CVS Mdocdate keyword substitution, but using it is conventionally expected in the OpenBSD base system.

unknown architecture (mdoc, OpenBSD, NetBSD) The third argument of the Dt macro does not match any of the architectures this operating system is running on.

  • operating system explicitly specified โ€” (mdoc, OpenBSD, NetBSD) the Os macro actually has an argument, bestie. In the base system it's conventionally left blank. ๐Ÿ‘€
  • RCS id missing โ€” (OpenBSD, NetBSD) your page is missing that comment line with the RCS identifier, the one generated by CVS OpenBSD or NetBSD keyword substitution like these operating systems conventionally use. ๐ŸŽ€

โœจ Style suggestions โœจ

  • legacy man(7) date format โ€” (mdoc) bestie the Dd macro is out here using the legacy man(7) date format yyyy-mm-dd. Consider switching to the conventional mdoc(7) date format Month dd, yyyy instead. it's giving glow-up, trust. ๐Ÿ’…
  • normalizing date format to: ... โ€” (mdoc, man) the Dd or TH macro provides an abbreviated month name or a day number with a leading zero. In the formatted output, the month name is written out in full and the leading zero is omitted. slay, but noted. โœจ
  • lower case character in document title โ€” (mdoc, man) the title is still used as given in the Dt or TH macro โ€” no cap, it doesn't get fixed for you.
  • duplicate RCS id โ€” one single manual page contains two copies of the RCS identifier for the same operating system. Consider deleting the later instance and moving the first one up to the top of the page. two is not better than one here ๐Ÿซถ
  • possible typo in section name โ€” (mdoc) fuzzy string matching revealed that the argument of an Sh macro is similar, but not identical to a standard section name. so close and yet so far ๐Ÿ˜ญ
  • 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. fr fr, close your quotes ๐Ÿ’€
  • useless macro โ€” (mdoc) a Bt, Tn, or Ud macro was found. Simply delete it: it serves no useful purpose. it's giving filler episode ๐Ÿ—‘๏ธ
  • consider using OS macro โ€” (mdoc) a string was found in plain text or in a Bx macro that could be represented using Ox, Nx, Fx, or Dx. upgrade your vibes bestie โญ
  • errnos out of order โ€” (mdoc, NetBSD) the Er items in a Bl list are not in alphabetical order. alphabetize your icons please ๐Ÿฆ‹
  • duplicate errno โ€” (mdoc, NetBSD) a Bl list contains two consecutive It entries describing the same Er number. we don't need double ๐Ÿ’€
  • referenced manual not found โ€” (mdoc) an Xr macro references a manual page that was not found. When running with -W base, the search is restricted to the base system, by default to /usr/share/man:/usr/X11R6/man. This path can be configured at compile time using the MANPATH_BASE preprocessor macro. When running with -W style, the search is done along the full search path as described in the man(1) manual page, respecting the -m and -M command line options, the MANPATH environment variable, the man.conf(5) file and falling back to the default of /usr/share/man:/usr/X11R6/man:/usr/local/man, also configurable at compile time using the MANPATH_DEFAULT preprocessor macro. that page is literally ghosting you ๐Ÿ‘ป
  • trailing delimiter โ€” (mdoc) the last argument of an Ex, Fo, Nd, Nm, Os, Sh, Ss, St, or Sx macro ends with a trailing delimiter. This is usually bad style and often indicates typos. Most likely, the delimiter can be removed. bestie the comma is NOT part of the name ๐Ÿ“
  • no blank before trailing delimiter โ€” (mdoc) the last argument of a macro that supports trailing delimiter arguments is longer than one byte and ends with a trailing delimiter. Consider inserting a blank such that the delimiter becomes a separate argument, thus moving it out of the scope of the macro. give it some personal space ๐Ÿซถ
  • fill mode already enabled, skipping โ€” (man) an fi request occurs even though the document is still in fill mode, or already switched back to fill mode. It has no effect. nothing happened, it's fine ๐Ÿ™ˆ
  • fill mode already disabled, skipping โ€” (man) an nf 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. also nothing ๐Ÿ’…
  • input text line longer than 80 bytes โ€” consider breaking the input text line at one of the blank characters before column 80. it's giving scrollbar energy, wrap it โœจ
  • verbatim --, maybe consider using \(em โ€” (mdoc) even though the ASCII output device renders an em-dash as --, that is not a good way to write it in an input file because it renders poorly on all other output devices. it's giving "works on my machine" ๐Ÿ˜ญ
  • function name without markup โ€” (mdoc) a word followed by an empty pair of parentheses occurs on a text line. Consider using an Fn or Xr macro. put some respect on that function's name ๐Ÿ‘‘
  • 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. invisible AND confusing, iconic combo ๐Ÿ’€
  • bad comment style โ€” (roff) comment lines start with a dot, a backslash, and a double-quote character. The mandoc utility treats the line as a comment line even without the backslash, but leaving out the backslash might not be portable. keep the \ bestie, it's load-bearing ๐Ÿงš

  • missing manual title, using UNTITLED โ€” (mdoc, man) a Dt or TH macro has no arguments, its first argument is an empty string, or there is no Dt macro before the first non-prologue mdoc(7) macro. so we're just calling it UNTITLED now I guess ๐Ÿ˜ญ
  • missing manual title, using "" โ€” (man) an input document does not contain any TH macro. nothing. zero. nada. ๐Ÿซ 
  • missing manual section, using "" โ€” (mdoc, man) a Dt or TH macro lacks the mandatory section argument. which section? we simply do not know ๐Ÿ’€
  • unknown manual section โ€” (mdoc) the section number in a Dt line is invalid, but still used. bold of it, honestly ๐Ÿ”ฅ
  • filename/section mismatch โ€” (mdoc, man) the name of the input file being processed is known and its file name extension starts with a non-zero digit, but the Dt or TH macro contains a section argument that starts with a different non-zero digit. The section argument is used as provided anyway. Consider checking whether the file name or the argument need a correction. it's giving identity crisis ๐Ÿ˜ญ
  • missing date, using "" โ€” (mdoc, man) the document was parsed as mdoc(7) and it has no Dd macro, or the Dd macro has no arguments or only empty arguments; or the document was parsed as man(7) and it has no TH macro, or the TH macro has less than three arguments or its third argument is empty. no date, no problem, except there is a problem ๐Ÿ’…
  • cannot parse date, using it verbatim โ€” (mdoc, man) the date given in a Dd or TH macro does not follow the conventional format. we're printing it exactly as you wrote it, bestie, no takebacks ๐Ÿ™ˆ
  • date in the future, using it anyway โ€” (mdoc, man) the date given in a Dd or TH macro is more than a day ahead of the current system time(3). time traveller behaviour, but we respect it โฐโœจ
  • missing Os macro, using "" โ€” (mdoc) the default or current system is not shown in this case. we simply have no idea what system you're on ๐Ÿฆ‹
  • late prologue macro โ€” (mdoc) a Dd or Os macro occurs after some non-prologue macro, but still takes effect. fashionably late, still counts ๐Ÿ’…
  • 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. chaos order slay, but noted ๐Ÿ“‹

๐Ÿฆ‹ 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. like, it only works under very specific conditions, ngl ๐Ÿซ 
  • 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. just a header and footer, no substance ๐Ÿ˜ญ
  • content before first section header โ€” (mdoc, man) some macros or text precede the first Sh or SH section header. The offending macros and text are parsed and added to the top level of the syntax tree, outside any section block. they're just floating there, unsectioned ๐Ÿ’€
  • first section is not NAME โ€” (mdoc) the argument of the first Sh macro is not NAME. This may confuse makewhatis(8) and apropos(1). bestie the indexers are NOT going to find that ๐Ÿšจ
  • NAME section without Nm before Nd โ€” (mdoc) the NAME section does not contain any Nm child macro before the first Nd macro. who even is this page ๐Ÿง
  • NAME section without description โ€” (mdoc) the NAME section lacks the mandatory Nd child macro. mandatory, bestie. mandatory. ๐Ÿ˜ค
  • description not at the end of NAME โ€” (mdoc) the NAME section does contain an Nd child macro, but other content follows it. the description is supposed to be the last thing, it's the finale ๐Ÿ’…
  • bad NAME section content โ€” (mdoc) the NAME section contains plain text or macros other than Nm and Nd. keep it clean, keep it curated โœจ
  • missing comma before name โ€” (mdoc) the NAME section contains an Nm macro that is neither the first one nor preceded by a comma. comma! please! ๐Ÿ“
  • missing description line, using "" โ€” (mdoc) the Nd macro lacks the required argument. The title line of the manual will end after the dash. so it just... trails off โ€” ๐Ÿ˜ญ
  • description line outside NAME section โ€” (mdoc) an Nd macro appears outside the NAME section. The arguments are printed anyway and the following text is used for apropos(1), but none of that behaviour is portable. it works but like... don't rely on it ๐Ÿซถ
  • 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. we're not rearranging your whole page for you, we're just judging gently ๐Ÿ‘€
  • duplicate section title โ€” (mdoc) the same standard section title occurs more than once. we heard you the first time ๐Ÿ’€
  • unexpected section โ€” (mdoc) a standard section header occurs in a section of the manual where it normally isn't useful. it's giving misplaced confidence ๐Ÿ˜ฌ
  • cross reference to self โ€” (mdoc, man) an Xr or MR macro refers to a name and section matching the section of the present manual page and a name mentioned in an Nm macro in the NAME or SYNOPSIS section, or in an Fn or Fo macro in the SYNOPSIS. Consider using Nm or Fn instead of Xr. stop pointing at yourself bestie, you're already right here ๐Ÿชž
  • unusual Xr order โ€” (mdoc) in the SEE ALSO section, an Xr macro with a lower section number follows one with a higher number, or two Xr macros referring to the same section are out of alphabetical order. sort by section number, then alphabetically. it's a whole system and it's cute โœจ
  • unusual Xr punctuation โ€” (mdoc) in the SEE ALSO section, punctuation between two Xr macros differs from a single comma, or there is trailing punctuation after the last Xr macro. comma, comma, and then NO comma. that's the rule ๐Ÿ“
  • AUTHORS section without An macro โ€” (mdoc) an AUTHORS section contains no An macros, or only empty ones. Probably, there are author names lacking markup. credits without credits, tragic ๐Ÿ˜ญ

  • obsolete macro โ€” (mdoc) see the mdoc(7) manual for replacements. it's giving retired, respectfully ๐Ÿซก
  • 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 \&. pick a lane bestie ๐Ÿ’…
  • 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.

In man(7) documents, it happens

  • for empty P, PP, and LP macros
  • for IP macros having neither head nor body arguments
  • for br or sp right after SH or SS

basically the paragraph macro was unnecessary in that exact spot, so we skipped it ๐Ÿ˜Œ

  • moving paragraph macro out of list โ€” (mdoc) a list item in a Bl list contains a trailing paragraph macro. The paragraph macro is moved after the end of the list. we relocated it for its own good ๐Ÿšš
  • skipping no-space macro โ€” (mdoc) an input line begins with an Ns macro, or the next argument after an Ns macro is an isolated closing delimiter. The macro is ignored. nothing to do here, moving on ๐Ÿ’ซ
  • blocks badly nested (mdoc) โ€” if two blocks intersect, one of them needs to completely contain the other, no crossy business. Otherwise your rendered output is gonna look weird in any output format, and in SGML-based formats it's lowkey gonna be outright wrong, because those languages literally do not support badly nested blocks at all. Classic offenders: Ao Bo Ac Bc and Ao Bq Ac. In those, Ac breaks Bo and Bq respectively. ๐Ÿ’€
  • nested displays are not portable (mdoc) โ€” a Bd, D1, or Dl display is sitting nested inside another Bd display. mandoc handles it fine, but most other implementations just fall over. ๐Ÿ™ˆ
  • moving content out of list (mdoc) โ€” a Bl list block has text or macros before the very first It macro. The offending children get scooted to before the start of the list. ๐Ÿซถ
  • first macro on line โ€” inside a Bl -column list, a Ta macro shows up as the first macro on a line, which is not portable. โœจ
  • line scope broken (man) โ€” while parsing the next-line scope of the previous macro, another macro appears that prematurely terminates the previous one. The previous, interrupted macro gets yeeted from the parse tree. ๐Ÿ˜ญ
  • skipping empty request (roff, eqn) โ€” the macro name is missing from a macro definition request, or an eqn(7) control statement or operation keyword is missing its required argument. ๐Ÿ’…
  • conditional request controls empty scope (roff) โ€” a conditional request only actually does something useful if one of these follows it on the same logical input line:
    • the โ€˜\{โ€™ keyword, which opens a multi-line scope.
    • a request or macro or some text, which gives you a single-line scope.
    • the immediate end of the logical line with no intervening whitespace, which gives you next-line scope.

Here, though, the conditional request is followed by trailing whitespace only, and there's no other content on its logical input line. And ngl, it doesn't matter whether that logical line got split across multiple physical input lines using โ€˜\โ€™ line continuation characters. This is one of those rare cases where trailing whitespace is syntactically significant, bestie. The conditional request is controlling a scope that contains whitespace only, so it's unlikely to do anything meaningful โ€” except it might control a following el clause. ๐Ÿ˜ฌ

  • skipping empty macro (mdoc) โ€” the indicated macro has no arguments, so it has no effect. ๐Ÿคท
  • empty block (mdoc, man) โ€” a Bd, Bk, Bl, D1, Dl, or RS block has nothing in its body and will produce zero output. ๐Ÿ•ณ๏ธ
  • empty argument, using 0n (mdoc) โ€” the required width is missing after Bd or Bl -offset or -width.
  • missing display type, using -ragged (mdoc) โ€” the Bd macro got invoked without the required display type.
  • list type is not the first argument (mdoc) โ€” in a Bl macro, at least one other argument comes before the type argument. mandoc copes with any argument order, but some other mdoc(7) implementations do not. ๐Ÿ™ƒ
  • missing -width in -tag list, using 8n (mdoc) โ€” every Bl macro that has the -tag argument needs -width too.
  • missing utility name, using "" (mdoc) โ€” the Ex -std macro is called without an argument before Nm has first been called with an argument.
  • missing function name, using "" (mdoc) โ€” the Fo macro is called without an argument. No function name gets printed.
  • empty head in list item (mdoc) โ€” in a Bl -diag, -hang, -inset, -ohang, or -tag list, an It macro is missing its required argument. The item head is left empty. ๐Ÿซฅ
  • empty list item (mdoc) โ€” in a Bl -bullet, -dash, -enum, or -hyphen list, an It block is empty. An empty list item gets shown.
  • missing argument, using next line (mdoc) โ€” an It macro in a Bd -column list has no arguments. mandoc uses the text or macros of the following line (if there are any) for the cell, but other formatters may misformat the list. ๐Ÿ˜ตโ€๐Ÿ’ซ
  • missing font type, using \fR (mdoc) โ€” a Bf macro has no argument. It switches to the default font.
  • unknown font type, using \fR (mdoc) โ€” the Bf argument is invalid. The default font is used instead.
  • nothing follows prefix (mdoc) โ€” a Pf macro has no argument, or only one argument and no macro follows on the same input line. That defeats the whole point of it โ€” specifically, spacing is not suppressed before the text or macros that follow on the next input line. ๐Ÿ˜ค
  • empty reference block (mdoc) โ€” an Rs macro is immediately followed by an Re macro on the next input line. An empty block like that produces no output.
  • missing section argument (mdoc, man) โ€” an Xr or MR macro is missing its second argument, the section number. The first argument (the name) is printed, but without a section number. And in the case of Xr, the parentheses get omitted too.
  • missing -std argument, adding it (mdoc) โ€” an Ex or Rv macro is missing the required -std argument. mandoc assumes -std even when you didn't specify it, but other implementations may not. ๐Ÿ™ˆ
  • missing option string, using "" (man) โ€” the OP macro is invoked with no argument at all. You get an empty pair of square brackets.
  • missing resource identifier, using "" (man) โ€” the MT or UR macro is invoked with no argument at all. You get an empty pair of angle brackets.
  • missing eqn box, using "" (eqn) โ€” a diacritic mark or a binary operator is there, but there's nothing to the left of it. An empty box gets inserted.
  • duplicate argument (mdoc) โ€” a Bd or Bl macro has more than one -compact, more than one -offset, or more than one -width argument. All but the last of these instances get ignored. ๐Ÿ—‘๏ธ
  • skipping duplicate argument (mdoc) โ€” an An macro has more than one -split or -nosplit argument. All but the first of these get ignored.
  • skipping duplicate display type (mdoc) โ€” a Bd macro has more than one type argument; the first one wins.
  • skipping duplicate list type (mdoc) โ€” a Bl macro has more than one type argument; the first one wins.
  • skipping -width argument (mdoc) โ€” a Bl -column, -diag, -ohang, -inset, or -item list has a -width argument. That does absolutely nothing, bestie. ๐Ÿ’…
  • wrong number of cells โ€” in a line of a Bl -column list, the number of tabs or Ta macros is less than the number expected from the list header line, or exceeds the expected number by more than one. Missing cells stay empty, and every cell past the column count gets joined into one single cell. ๐Ÿ˜ฎโ€๐Ÿ’จ
  • unknown AT&T UNIX version (mdoc) โ€” an At macro has an invalid argument. It gets used verbatim, with "AT&T UNIX " prefixed onto it.
  • comma in function argument (mdoc) โ€” an argument of an Fa or Fn macro contains a comma; it probably wants to be split into two arguments.
  • parenthesis in function name (mdoc) โ€” the first argument of an Fc or Fn macro contains an opening or closing parenthesis. That's probably wrong โ€” parentheses get added automatically. ๐Ÿ™ƒ
  • unknown library name (mdoc, not on OpenBSD) โ€” an Lb macro has an unknown name argument and will be rendered as library โ€œnameโ€.
  • invalid content in Rs block (mdoc) โ€” an Rs block contains plain text or non-% macros. The bogus content stays in the syntax tree. Formatting may be poor. ๐Ÿ˜ญ
  • invalid Boolean argument (mdoc) โ€” an Sm macro has an argument other than on or off. The invalid argument gets moved out of the macro, which leaves the macro empty and makes it toggle the spacing mode. ๐ŸŒ€
  • argument contains two font escapes (roff) โ€” the second argument of a char request contains more than one font escape sequence. A wrong font may stay active after using the character.
  • unknown font, skipping request (man, tbl) โ€” a roff(7) ft request or a tbl(7) f layout modifier has an unknown font argument.
  • ignoring distance argument (roff) โ€” besides the margin character, an mc request has a second argument that's supposed to represent a distance, but mandoc's implementation of mc always ignores that second argument. ๐Ÿคท
  • odd number of characters in request (roff) โ€” a tr request contains an odd number of characters. The last character gets mapped to the blank character.
  • blank line in fill mode, using .sp (mdoc, man) โ€” the meaning of blank input lines is only well-defined in non-fill mode: in fill mode, line breaks of text input lines aren't supposed to be significant. But for compatibility with groff, blank lines in fill mode get formatted like sp requests. So if you want a paragraph break, use Pp or PP instead of a blank line. โœจ
  • tab in filled text (mdoc, man) โ€” the meaning of tab characters is only well-defined in non-fill mode: in fill mode, whitespace isn't supposed to be significant on text input lines. As an implementation dependent choice, tab characters on text lines get passed through to the formatters in any case. And given that the text before the tab is gonna get filled, it's genuinely hard to predict which tab stop position the tab will advance to. ๐Ÿ˜ต
  • new sentence, new line (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. ๐Ÿซถ
  • invalid escape sequence argument (roff) โ€” the argument of an escape sequence is in an invalid form. Invalid escape sequences get ignored.
  • undefined escape, printing literally (roff) โ€” in an escape sequence, the first character right after the leading backslash is invalid. That character gets printed literally, which is equivalent to ignoring the backslash.
  • undefined string, using "" (roff) โ€” if a string is used without being defined beforehand, its value is implicitly set to the empty string. But defining strings explicitly before you use them keeps the code more readable. ๐Ÿ’…
  • tbl line starts with span (tbl) โ€” the first cell in a table layout line is a horizontal span (โ€˜sโ€™). Data provided for this cell gets 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 gets 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 gets printed, and all the extra bars get discarded. โœ‚๏ธ
  • 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 gets ignored.
  • skipping unknown tbl option (tbl) โ€” the table options line contains a string of letters that doesn't match any known option name. The word gets ignored.
  • missing tbl option argument (tbl) โ€” a table option that requires an argument isn't followed by an opening parenthesis, or the opening parenthesis is immediately followed by a closing parenthesis. The option gets ignored. ๐Ÿ™ˆ
  • wrong tbl option argument size (tbl) โ€” a table option argument has a whack number of characters in it. bestie, it's giving malformed. both the option and the argument get yeeted.
  • empty tbl layout (tbl) โ€” the table layout spec is literally completely empty, like zero lines and zero columns, nothing. as a fallback it just uses a single left-justified column. slay for the backup plan ig.
  • invalid character in tbl layout (tbl) โ€” the layout spec has a character that's neither a layout key character nor a layout modifier, or a modifier showed up before the first key. the invalid character gets discarded.
  • unmatched parenthesis in tbl layout (tbl) โ€” there's an opening parenthesis with no matching closing one. the rest of the input line, starting from that parenthesis, has no effect. it's giving abandoned.
  • ignoring invalid column width in tbl layout (tbl) โ€” a column width specifier is empty, zero, or not a valid numerical expression. the width specifier is ignored and the column is made wide enough to fit all its data cells. lowkey generous of it.
  • ignoring excessive spacing in tbl layout (tbl) โ€” a spacing modifier is unreasonably large. the default spacing of 3n is used instead. calm down bestie.
  • tbl without any data cells (tbl) โ€” the table has no data cells at all. it will probably produce no output. it's giving empty.
  • ignoring data in spanned tbl cell (tbl) โ€” a cell is marked as a horizontal span (s) or vertical span (^) in the layout, but it contains data. the data is ignored. the audacity.
  • ignoring extra tbl data cells (tbl) โ€” a data line has 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 was opened with T{ but never closed with a matching T}. the remaining data lines of the table all go into one cell, and any remaining cells stay empty. not the T{ erasure ๐Ÿ˜ญ
  • duplicate prologue macro (mdoc) โ€” one of the prologue macros occurs more than once. the last instance overrides all the previous ones. last one wins, periodt.
  • skipping late title macro (mdoc) โ€” the Dt macro appears after the first non-prologue macro. traditional formatters can't handle this because they write the page header before parsing the document body. even though this technical restriction doesn't apply to mandoc, traditional semantics is preserved. the late macro is discarded including its arguments. rip.
  • input stack limit exceeded, infinite loop? (roff) โ€” explicit recursion limits exist for these features, all so we don't get stuck in infinite loops:
    • expansion of nested escape sequences including expansion of strings and number registers,
    • expansion of nested user-defined macros,
    • and so file inclusion.

when a limit is hit, the output is incorrect, typically losing some content, but the parser can continue. so it limps on. iconic honestly.

  • skipping bad character (mdoc, man, roff) โ€” the input file contains a byte that's 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. do it for the culture ๐Ÿซถ
  • skipping unknown macro (mdoc, man, roff) โ€” the first identifier on a request or macro line isn't 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. typo era ๐Ÿ’€
  • skipping request outside macro (roff) โ€” a shift or return request occurs outside any macro definition and has no effect.
  • skipping insecure request (roff) โ€” an input file tried to run a shell command or read or write an external file. such attempts are denied for security reasons. not today, malicious input ๐Ÿšซ
  • skipping item outside list (mdoc, eqn) โ€” an It macro occurs outside any Bl list, or an eqn(7) above delimiter occurs outside any pile. it's discarded including its arguments.
  • skipping column outside column list (mdoc) โ€” a Ta macro occurs outside any Bl -column block. it's 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 were previously opened. an mdoc(7) block closing macro, a man(7) ME, RE or UE macro, an eqn(7) right delimiter or closing brace, or the end of an equation, table, or roff(7) conditional request shows up but there's no matching block open. the offending request or macro is discarded. it's giving closing a tab you never opened.
  • fewer RS blocks open, skipping (man) โ€” the RE macro is invoked with an argument, but fewer than the specified number of RS blocks is open. the RE macro 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 its children are properly closed. the open child nodes are closed implicitly. bestie it's fine, we'll clean up for you โœจ
  • 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 MT, RS or UR block, an equation, table, or roff(7) conditional or ignore block is still open. the open block is closed implicitly. leaving things open is so real of it.
  • 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 can't form part of a name. the first argument of an am, as, de, ds, nr, or rr request, or any argument of an rm request, or the name of a request or user defined macro being called, is terminated by an escape sequence. in the cases of as, ds, and nr, the request has no effect at all. in the cases of am, de, rr, and rm, whatever 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, and the characters following it are used as the arguments to the request or macro. okay that's a lot but it's all important, iykyk.
  • using macro argument outside macro (roff) โ€” the escape sequence \$ occurs outside any macro definition and expands to the empty string.
  • argument number is not numeric (roff) โ€” the argument of the escape sequence \$ isn't a digit; the escape sequence expands to the empty string.
  • negative argument, using 0 (roff) โ€” a shift request has a negative argument, or an argument that's negative due to integer overflow. macro argument numbering remains unchanged.
  • NOT IMPLEMENTED: Bd -file (mdoc) โ€” for security reasons, the Bd macro does not support the -file 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. absolutely not, we're not doing that ๐Ÿšซ
  • skipping display without arguments (mdoc) โ€” a Bd block macro has no arguments. the block is discarded, and the block content is displayed in whatever mode was active before the block.
  • missing list type, using -item (mdoc) โ€” a Bl macro fails to specify the list type.
  • argument is not numeric, using 1 (roff) โ€” the argument of a ce request isn't a number.
  • argument is not a character (roff) โ€” the first argument of a char request is neither a single ASCII character nor a single character escape sequence. the request is ignored including all its arguments.
  • skipping unusable escape sequence (roff) โ€” the first argument of an mc request is neither a single ASCII character nor a single character escape sequence. all arguments are ignored and printing of a margin character is disabled.
  • missing manual name, using "" (mdoc, man) โ€” the first call to Nm, or any call in the NAME section, lacks the required argument, or MR is called without any argument. nameless era ๐Ÿ˜ญ
  • uname(3) system call failed, using UNKNOWN (mdoc) โ€” the Os macro is called without arguments, and the uname(3) system call failed. as a workaround, mandoc can be compiled with -DOSNAME="\"string\"". keep this exactly as written bestie ๐Ÿ’…
  • unknown standard specifier (mdoc) โ€” an St macro has an unknown argument and is discarded.
  • skipping request without numeric argument (roff, eqn) โ€” an it request or an eqn(7) size or gsize statement has a non-numeric or negative argument, or no argument at all. the invalid request or statement is ignored.
  • excessive shift (roff) โ€” the argument of a shift request is larger than the number of arguments of the macro currently being executed. all macro arguments are deleted and \n(.$ is set to zero. gone, reduced to atoms.
  • NOT IMPLEMENTED: .so with absolute path or ".." (roff) โ€” for security reasons, mandoc allows so 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. mandoc only shows the path as it appears behind so. hard no ๐Ÿšซ
  • .so request failed (roff) โ€” servicing a so request requires reading an external file, but the file couldn't be opened. mandoc only shows the path as it appears behind so.
  • skipping all arguments (mdoc, man, eqn, roff) โ€” an mdoc(7) Bt, Ed, Ef, Ek, El, Lp, Pp, Re, Rs, or Ud macro, an It macro in a list that don't support item heads, a man(7) LP, P, or PP macro, an eqn(7) EQ or EN macro, or a roff(7) br, fi, or nf request or .. block closing request is invoked with at least one argument. all arguments are ignored. read the room, arguments.
  • skipping excess arguments (mdoc, man, roff) โ€” a macro or request is invoked with too many arguments:
    • Fo, MT, PD, RS, UR, ft, or sp with more than one argument
    • An with another argument after -split or -nosplit
    • RE with more than one argument or with a non-integer argument
    • OP or a request of the de family with more than two arguments
    • Dt or MR with more than three arguments
    • TH with more than five arguments
    • Bd, Bk, or Bl with invalid arguments

the excess arguments are ignored. too much, bestie.

  • incomplete escape sequence (roff) โ€” the end of the input line is hit while parsing the argument of an escape sequence. in this case, \* and \n expand to an empty string, \B to the digit 0, and \w to the length of the incomplete argument. all other incomplete escape sequences are ignored. it ran out of road mid-escape ๐Ÿ˜ญ
  • invalid special character (roff) โ€” so a special character escape sequence is invalid, right? Like a Unicode sequence pointing to a surrogate or beyond the Unicode range, or a \[char...] escape sequence that represents a control character or points beyond the unsigned char range, or an invalid variable-length form of a single-byte character escape sequence โ€” for example writing \[e] or \[~] instead of \e or \~, respectively. Bestie. The escape sequence is ignored.
  • unknown special character (roff) โ€” the name you gave in a special character escape sequence? mandoc literally does not know her. The escape sequence is ignored. ๐Ÿ’€
  • invalid escape argument delimiter (roff) โ€” an escape sequence that expects a numerical argument is trying to use one of the characters " %&()*+-./0123456789:<=> as an argument delimiter. Rude. The escape sequence is ignored including the invalid opening delimiter, and the rest of the argument may appear as output text. And like โ€” various characters can be used as argument delimiters, but using the apostrophe-quote character (โ€˜'โ€™) is recommended for readability and robustness. iykyk ๐ŸŽ€

โœจ Unsupported features โœจ

  • input too large (mdoc, man) โ€” okay so currently, mandoc cannot handle input files larger than its arbitrary size limit of 2^31 bytes (2 Gigabytes). And honestly? Since useful manuals are always small, this is not a problem in practice fr fr. Parsing is aborted as soon as the condition is detected. ๐Ÿซถ
  • unsupported control character (roff) โ€” an ASCII control character that other roff(7) implementations support but mandoc does not was found in an input file. It gets replaced by a question mark. ๐Ÿฅฒ
  • unsupported escape sequence (roff) โ€” an input file contains an escape sequence supported by GNU troff or Heirloom troff but not by mandoc, and it is likely that this will cause information loss or considerable misformatting. ๐Ÿ˜ญ
  • unsupported roff request (roff) โ€” literally the same energy but for a roff(7) request: the input file contains a 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. bye ๐Ÿ‘‹
  • 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. main character energy denied โœจ
  • skipping tbl in -Tman mode (mdoc, tbl) โ€” an input file contains the TS macro. Heads up: this message is only generated in -T man output mode, where tbl(7) input is not supported. ๐Ÿฆ‹
  • skipping eqn in -Tman mode (mdoc, eqn) โ€” an input file contains the EQ macro. Again, this message is only generated in -T man output mode, where eqn(7) input is not supported. ๐Ÿฆ‹

๐ŸŒˆ Bad command line arguments ๐ŸŒˆ

  • bad command line argument โ€” the argument following one of the -IKMmOTW command line options is invalid, or a file given as a command line argument cannot be opened. ngl that one stings ๐Ÿ˜ญ
  • duplicate command line argument โ€” the -I command line option was specified twice. pick a lane bestie ๐Ÿ’…
  • option has a superfluous value โ€” an argument to the -O option has a value but does not accept one.
  • missing option value โ€” an argument to the -O option has no argument but requires one.
  • bad option value โ€” an argument to the -O indent or width option has an invalid value.
  • duplicate option value โ€” the same -O option is specified more than once.
  • no such tag โ€” the -O tag option was specified but the tag was not found in any of the displayed manual pages. she's not here rn ๐Ÿซ 
  • -Tmarkdown unsupported for man(7) input (man) โ€” the -T markdown option was specified but an input file uses the man(7) language. No output is produced for that input file. periodt.

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

apropos(1), man(1), eqn(7), man(7), mandoc_char(7), mdoc(7), roff(7), tbl(7)

The whole friend group ๐Ÿ’–

๐ŸŽ€ HISTORY ๐ŸŽ€

The mandoc utility first appeared in OpenBSD 4.8. The option -I appeared in OpenBSD 5.2, and -aCcfhKklMSsw in OpenBSD 5.7. glow-up after glow-up, we love to see it โœจ

๐Ÿฆ‹ AUTHORS ๐Ÿฆ‹

The mandoc utility was written by Kristaps Dzonsons <kristaps@bsd.lv> and is maintained by Ingo Schwarze <schwarze@openbsd.org>. absolute icons, no cap ๐Ÿ‘‘


bestie that's the whole page!! go forth and format your manuals, you're gonna slay ๐Ÿ’…๐Ÿ’–

Okay so this version is from the Debian fam, dated August 22, 2025 โ€” MANDOC(1), that's the one. mwah ๐Ÿ“๐Ÿงš

๐Ÿ“ฆ where this page comes from
  • freebsd 14.5: base 14.5
  • freebsd 15.1: base 15.1
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms