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