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