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