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