1.\" $Id: mdoc.7,v 1.296 2025/01/27 03:17:33 schwarze Exp $ 2.\" 3.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> 4.\" Copyright (c) 2010, 2011, 2013-2020 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 27 2025 $ 19.Dt MDOC 7 20.Os 21.Sh NAME 22.Nm mdoc 23.Nd semantic markup language for formatting manual pages 24.Sh DESCRIPTION 25The 26.Nm mdoc 27language supports authoring of manual pages for the 28.Xr man 1 29utility by allowing semantic annotations of words, phrases, 30page sections and complete manual pages. 31Such annotations are used by formatting tools to achieve a uniform 32presentation across all manuals written in 33.Nm , 34and to support hyperlinking if supported by the output medium. 35.Pp 36This reference document describes the structure of manual pages 37and the syntax and usage of the 38.Nm 39language. 40The reference implementation of a parsing and formatting tool is 41.Xr mandoc 1 ; 42the 43.Sx COMPATIBILITY 44section describes compatibility with other implementations. 45.Pp 46In an 47.Nm 48document, lines beginning with the control character 49.Sq \&. 50are called 51.Dq macro lines . 52The first word is the macro name. 53It consists of two or three letters. 54Most macro names begin with a capital letter. 55For a list of available macros, see 56.Sx MACRO OVERVIEW . 57The words following the macro name are arguments to the macro, optionally 58including the names of other, callable macros; see 59.Sx MACRO SYNTAX 60for details. 61.Pp 62Lines not beginning with the control character are called 63.Dq text lines . 64They provide free-form text to be printed; the formatting of the text 65depends on the respective processing context: 66.Bd -literal -offset indent 67\&.Sh Macro lines change control state. 68Text lines are interpreted within the current state. 69.Ed 70.Pp 71Many aspects of the basic syntax of the 72.Nm 73language are based on the 74.Xr roff 7 75language; see the 76.Em LANGUAGE SYNTAX 77and 78.Em MACRO SYNTAX 79sections in the 80.Xr roff 7 81manual for details, in particular regarding 82comments, escape sequences, whitespace, and quoting. 83However, using 84.Xr roff 7 85requests in 86.Nm 87documents is discouraged; 88.Xr mandoc 1 89supports some of them merely for backward compatibility. 90.Sh MANUAL STRUCTURE 91A well-formed 92.Nm 93document consists of a document prologue followed by one or more 94sections. 95.Pp 96The prologue, which consists of the 97.Ic \&Dd , 98.Ic \&Dt , 99and 100.Ic \&Os 101macros in that order, is required for every document. 102.Pp 103The first section (sections are denoted by 104.Ic \&Sh ) 105must be the NAME section, consisting of at least one 106.Ic \&Nm 107followed by 108.Ic \&Nd . 109.Pp 110Following that, convention dictates specifying at least the 111.Em SYNOPSIS 112and 113.Em DESCRIPTION 114sections, although this varies between manual sections. 115.Pp 116The following is a well-formed skeleton 117.Nm 118file for a utility 119.Qq progname : 120.Bd -literal -offset indent 121\&.Dd $\&Mdocdate$ 122\&.Dt PROGNAME section 123\&.Os 124\&.Sh NAME 125\&.Nm progname 126\&.Nd one line about what it does 127\&.\e\(dq .Sh LIBRARY 128\&.\e\(dq For sections 2, 3, and 9 only. 129\&.\e\(dq Not used in OpenBSD. 130\&.Sh SYNOPSIS 131\&.Nm progname 132\&.Op Fl options 133\&.Ar 134\&.Sh DESCRIPTION 135The 136\&.Nm 137utility processes files ... 138\&.\e\(dq .Sh CONTEXT 139\&.\e\(dq For section 9 functions only. 140\&.\e\(dq .Sh HARDWARE 141\&.\e\(dq For section 4 only. 142\&.\e\(dq Not used in OpenBSD. 143\&.\e\(dq .Sh IMPLEMENTATION NOTES 144\&.\e\(dq Not used in OpenBSD. 145\&.\e\(dq .Sh RETURN VALUES 146\&.\e\(dq For sections 2, 3, and 9 function return values only. 147\&.\e\(dq .Sh ENVIRONMENT 148\&.\e\(dq For sections 1, 6, 7, and 8 only. 149\&.\e\(dq .Sh FILES 150\&.\e\(dq .Sh EXIT STATUS 151\&.\e\(dq For sections 1, 6, and 8 only. 152\&.\e\(dq .Sh EXAMPLES 153\&.\e\(dq .Sh DIAGNOSTICS 154\&.\e\(dq For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only. 155\&.\e\(dq .Sh ERRORS 156\&.\e\(dq For sections 2, 3, 4, and 9 errno settings only. 157\&.\e\(dq .Sh SEE ALSO 158\&.\e\(dq .Xr foobar 1 159\&.\e\(dq .Sh STANDARDS 160\&.\e\(dq .Sh HISTORY 161\&.\e\(dq .Sh AUTHORS 162\&.\e\(dq .Sh CAVEATS 163\&.\e\(dq .Sh BUGS 164\&.\e\(dq .Sh SECURITY CONSIDERATIONS 165\&.\e\(dq Not used in OpenBSD. 166.Ed 167.Pp 168The sections in an 169.Nm 170document are conventionally ordered as they appear above. 171Sections should be composed as follows: 172.Bl -ohang -offset Ds 173.It Em NAME 174The name(s) and a one line description of the documented material. 175The syntax for this as follows: 176.Bd -literal -offset indent 177\&.Nm name0 , 178\&.Nm name1 , 179\&.Nm name2 180\&.Nd a one line description 181.Ed 182.Pp 183Multiple 184.Sq \&Nm 185names should be separated by commas. 186.Pp 187The 188.Ic \&Nm 189macro(s) must precede the 190.Ic \&Nd 191macro. 192.Pp 193See 194.Ic \&Nm 195and 196.Ic \&Nd . 197.It Em LIBRARY 198The name of the library containing the documented material, which is 199assumed to be a function in a section 2, 3, or 9 manual. 200The syntax for this is as follows: 201.Bd -literal -offset indent 202\&.Lb libarm 203.Ed 204.Pp 205See 206.Ic \&Lb . 207.It Em SYNOPSIS 208Documents the utility invocation syntax, function call syntax, or device 209configuration. 210.Pp 211For the first, utilities (sections 1, 6, and 8), this is 212generally structured as follows: 213.Bd -literal -offset indent 214\&.Nm bar 215\&.Op Fl v 216\&.Op Fl o Ar file 217\&.Op Ar 218\&.Nm foo 219\&.Op Fl v 220\&.Op Fl o Ar file 221\&.Op Ar 222.Ed 223.Pp 224Commands should be ordered alphabetically. 225.Pp 226For the second, function calls (sections 2, 3, 9): 227.Bd -literal -offset indent 228\&.In header.h 229\&.Vt extern const char *global; 230\&.Ft "char *" 231\&.Fn foo "const char *src" 232\&.Ft "char *" 233\&.Fn bar "const char *src" 234.Ed 235.Pp 236Ordering of 237.Ic \&In , 238.Ic \&Vt , 239.Ic \&Fn , 240and 241.Ic \&Fo 242macros should follow C header-file conventions. 243.Pp 244And for the third, configurations (section 4): 245.Bd -literal -offset indent 246\&.Cd \(dqit* at isa? port 0x2e\(dq 247\&.Cd \(dqit* at isa? port 0x4e\(dq 248.Ed 249.Pp 250Manuals not in these sections generally don't need a 251.Em SYNOPSIS . 252.Pp 253Some macros are displayed differently in the 254.Em SYNOPSIS 255section, particularly 256.Ic \&Nm , 257.Ic \&Cd , 258.Ic \&Fd , 259.Ic \&Fn , 260.Ic \&Fo , 261.Ic \&In , 262.Ic \&Vt , 263and 264.Ic \&Ft . 265All of these macros are output on their own line. 266If two such dissimilar macros are pairwise invoked (except for 267.Ic \&Ft 268before 269.Ic \&Fo 270or 271.Ic \&Fn ) , 272they are separated by a vertical space, unless in the case of 273.Ic \&Fo , 274.Ic \&Fn , 275and 276.Ic \&Ft , 277which are always separated by vertical space. 278.Pp 279When text and macros following an 280.Ic \&Nm 281macro starting an input line span multiple output lines, 282all output lines but the first will be indented to align 283with the text immediately following the 284.Ic \&Nm 285macro, up to the next 286.Ic \&Nm , 287.Ic \&Sh , 288or 289.Ic \&Ss 290macro or the end of an enclosing block, whichever comes first. 291.It Em DESCRIPTION 292This begins with an expansion of the brief, one line description in 293.Em NAME : 294.Bd -literal -offset indent 295The 296\&.Nm 297utility does this, that, and the other. 298.Ed 299.Pp 300It usually follows with a breakdown of the options (if documenting a 301command), such as: 302.Bd -literal -offset indent 303The options are as follows: 304\&.Bl \-tag \-width Ds 305\&.It Fl v 306Print verbose information. 307\&.El 308.Ed 309.Pp 310List the options in alphabetical order, 311uppercase before lowercase for each letter and 312with no regard to whether an option takes an argument. 313Put digits in ascending order before all letter options. 314.Pp 315Manuals not documenting a command won't include the above fragment. 316.Pp 317Since the 318.Em DESCRIPTION 319section usually contains most of the text of a manual, longer manuals 320often use the 321.Ic \&Ss 322macro to form subsections. 323In very long manuals, the 324.Em DESCRIPTION 325may be split into multiple sections, each started by an 326.Ic \&Sh 327macro followed by a non-standard section name, and each having 328several subsections, like in the present 329.Nm 330manual. 331.It Em CONTEXT 332This section lists the contexts in which functions can be called in section 9. 333The contexts are autoconf, process, or interrupt. 334.It Em HARDWARE 335This section lists the hardware support 336provided by kernel modules in section 4. 337FreeBSD Hardware Compatibility Notes are generated from this section. 338.It Em IMPLEMENTATION NOTES 339Implementation-specific notes should be kept here. 340This is useful when implementing standard functions that may have side 341effects or notable algorithmic implications. 342.It Em RETURN VALUES 343This section documents the 344return values of functions in sections 2, 3, and 9. 345.Pp 346See 347.Ic \&Rv . 348.It Em ENVIRONMENT 349Lists the environment variables used by the utility, 350and explains the syntax and semantics of their values. 351The 352.Xr environ 7 353manual provides examples of typical content and formatting. 354.Pp 355See 356.Ic \&Ev . 357.It Em FILES 358Documents files used. 359It's helpful to document both the file name and a short description of how 360the file is used (created, modified, etc.). 361.Pp 362See 363.Ic \&Pa . 364.It Em EXIT STATUS 365This section documents the 366command exit status for section 1, 6, and 8 utilities. 367Historically, this information was described in 368.Em DIAGNOSTICS , 369a practise that is now discouraged. 370.Pp 371See 372.Ic \&Ex . 373.It Em EXAMPLES 374Example usages. 375This often contains snippets of well-formed, well-tested invocations. 376Make sure that examples work properly! 377.It Em DIAGNOSTICS 378Documents error messages. 379In section 4 and 9 manuals, these are usually messages printed by the 380kernel to the console and to the kernel log. 381In section 1, 6, 7, and 8, these are usually messages printed by 382userland programs to the standard error output. 383.Pp 384Historically, this section was used in place of 385.Em EXIT STATUS 386for manuals in sections 1, 6, and 8; however, this practise is 387discouraged. 388.Pp 389See 390.Ic \&Bl 391.Fl diag . 392.It Em ERRORS 393Documents 394.Xr errno 2 395settings in sections 2, 3, 4, and 9. 396.Pp 397See 398.Ic \&Er . 399.It Em SEE ALSO 400References other manuals with related topics. 401This section should exist for most manuals. 402Cross-references should conventionally be ordered first by section, then 403alphabetically (ignoring case). 404.Pp 405References to other documentation concerning the topic of the manual page, 406for example authoritative books or journal articles, may also be 407provided in this section. 408.Pp 409See 410.Ic \&Rs 411and 412.Ic \&Xr . 413.It Em STANDARDS 414References any standards implemented or used. 415If not adhering to any standards, the 416.Em HISTORY 417section should be used instead. 418.Pp 419See 420.Ic \&St . 421.It Em HISTORY 422A brief history of the subject, including where it was first implemented, 423and when it was ported to or reimplemented for the operating system at hand. 424.It Em AUTHORS 425Credits to the person or persons who wrote the code and/or documentation. 426Authors should generally be noted by both name and email address. 427.Pp 428See 429.Ic \&An . 430.It Em CAVEATS 431Common misuses and misunderstandings should be explained 432in this section. 433.It Em BUGS 434Known bugs, limitations, and work-arounds should be described 435in this section. 436.It Em SECURITY CONSIDERATIONS 437Documents any security precautions that operators should consider. 438.El 439.Sh MACRO OVERVIEW 440This overview is sorted such that macros of similar purpose are listed 441together, to help find the best macro for any given purpose. 442Deprecated macros are not included in the overview, but can be found below 443in the alphabetical 444.Sx MACRO REFERENCE . 445.Ss Document preamble and NAME section macros 446.Bl -column "Brq, Bro, Brc" description 447.It Ic \&Dd Ta document date: Cm $\&Mdocdate$ | Ar month day , year 448.It Ic \&Dt Ta document title: Ar TITLE section Op Ar arch 449.It Ic \&Os Ta operating system footer: Op Ar footer text 450.It Ic \&Nm Ta document name (one argument) 451.It Ic \&Nd Ta document description (one line) 452.El 453.Ss Sections and cross references 454.Bl -column "Brq, Bro, Brc" description 455.It Ic \&Sh Ta section header (one line) 456.It Ic \&Ss Ta subsection header (one line) 457.It Ic \&Sx Ta internal cross reference to a section or subsection 458.It Ic \&Xr Ta cross reference to another manual page: Ar name section 459.It Ic \&Tg Ta tag the definition of a Ar term Pq <= 1 arguments 460.It Ic \&Pp Ta start a text paragraph (no arguments) 461.El 462.Ss Displays and lists 463.Bl -column "Brq, Bro, Brc" description 464.It Ic \&Bd , \&Ed Ta display block: 465.Fl Ar type 466.Op Fl offset Ar width 467.Op Fl compact 468.It Ic \&D1 Ta indented display (one line) 469.It Ic \&Dl Ta indented literal display (one line) 470.It Ic \&Ql Ta in-line literal display: Ql text 471.It Ic \&Bl , \&El Ta list block: 472.Fl Ar type 473.Op Fl width Ar val 474.Op Fl offset Ar val 475.Op Fl compact 476.It Ic \&It Ta list item (syntax depends on Fl Ar type ) 477.It Ic \&Ta Ta table cell separator in Ic \&Bl Fl column No lists 478.It Ic \&Rs , \&%* , \&Re Ta bibliographic block (references) 479.El 480.Ss Spacing control 481.Bl -column "Brq, Bro, Brc" description 482.It Ic \&Pf Ta prefix, no following horizontal space (one argument) 483.It Ic \&Ns Ta roman font, no preceding horizontal space (no arguments) 484.It Ic \&Ap Ta apostrophe without surrounding whitespace (no arguments) 485.It Ic \&Sm Ta switch horizontal spacing mode: Op Cm on | off 486.It Ic \&Bk , \&Ek Ta keep block: Fl words 487.El 488.Ss Semantic markup for command line utilities 489.Bl -column "Brq, Bro, Brc" description 490.It Ic \&Nm Ta start a SYNOPSIS block with the name of a utility 491.It Ic \&Fl Ta command line options (flags) (>=0 arguments) 492.It Ic \&Cm Ta command modifier (>0 arguments) 493.It Ic \&Ar Ta command arguments (>=0 arguments) 494.It Ic \&Op , \&Oo , \&Oc Ta optional syntax elements (enclosure) 495.It Ic \&Ic Ta internal or interactive command (>0 arguments) 496.It Ic \&Ev Ta environmental variable (>0 arguments) 497.It Ic \&Pa Ta file system path (>=0 arguments) 498.El 499.Ss Semantic markup for function libraries 500.Bl -column "Brq, Bro, Brc" description 501.It Ic \&Lb Ta function library (one argument) 502.It Ic \&In Ta include file (one argument) 503.It Ic \&Fd Ta other preprocessor directive (>0 arguments) 504.It Ic \&Ft Ta function type (>0 arguments) 505.It Ic \&Fo , \&Fc Ta function block: Ar funcname 506.It Ic \&Fn Ta function name: Ar funcname Op Ar argument ... 507.It Ic \&Fa Ta function argument (>0 arguments) 508.It Ic \&Vt Ta variable type (>0 arguments) 509.It Ic \&Va Ta variable name (>0 arguments) 510.It Ic \&Dv Ta defined variable or preprocessor constant (>0 arguments) 511.It Ic \&Er Ta error constant (>0 arguments) 512.It Ic \&Ev Ta environmental variable (>0 arguments) 513.El 514.Ss Various semantic markup 515.Bl -column "Brq, Bro, Brc" description 516.It Ic \&An Ta author name (>0 arguments) 517.It Ic \&Lk Ta hyperlink: Ar uri Op Ar display_name 518.It Ic \&Mt Ta Do mailto Dc hyperlink: Ar localpart Ns @ Ns Ar domain 519.It Ic \&Cd Ta kernel configuration declaration (>0 arguments) 520.It Ic \&Ad Ta memory address (>0 arguments) 521.It Ic \&Ms Ta mathematical symbol (>0 arguments) 522.El 523.Ss Physical markup 524.Bl -column "Brq, Bro, Brc" description 525.It Ic \&Em Ta italic font or underline (emphasis) (>0 arguments) 526.It Ic \&Sy Ta boldface font (symbolic) (>0 arguments) 527.It Ic \&No Ta return to roman font (normal) (>0 arguments) 528.It Ic \&Bf , \&Ef Ta font block: Fl Ar type | Cm \&Em | \&Li | \&Sy 529.El 530.Ss Physical enclosures 531.Bl -column "Brq, Bro, Brc" description 532.It Ic \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text 533.It Ic \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text 534.It Ic \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text 535.It Ic \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text 536.It Ic \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text 537.It Ic \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text 538.It Ic \&Aq , \&Ao , \&Ac Ta enclose in angle brackets: Aq text 539.It Ic \&Eo , \&Ec Ta generic enclosure 540.El 541.Ss Text production 542.Bl -column "Brq, Bro, Brc" description 543.It Ic \&Ex Fl std Ta standard command exit values: Op Ar utility ... 544.It Ic \&Rv Fl std Ta standard function return values: Op Ar function ... 545.It Ic \&St Ta reference to a standards document (one argument) 546.It Ic \&At Ta At 547.It Ic \&Bx Ta Bx 548.It Ic \&Bsx Ta Bsx 549.It Ic \&Nx Ta Nx 550.It Ic \&Fx Ta Fx 551.It Ic \&Ox Ta Ox 552.It Ic \&Dx Ta Dx 553.El 554.Sh MACRO REFERENCE 555This section is a canonical reference of all macros, arranged 556alphabetically. 557For the scoping of individual macros, see 558.Sx MACRO SYNTAX . 559.Bl -tag -width 3n 560.It Ic \&%A Ar first_name ... last_name 561Author name of an 562.Ic \&Rs 563block. 564Multiple authors should each be accorded their own 565.Ic \%%A 566line. 567Author names should be ordered with full or abbreviated forename(s) 568first, then full surname. 569.It Ic \&%B Ar title 570Book title of an 571.Ic \&Rs 572block. 573This macro may also be used in a non-bibliographic context when 574referring to book titles. 575.It Ic \&%C Ar location 576Publication city or location of an 577.Ic \&Rs 578block. 579.It Ic \&%D Oo Ar month day , Oc Ar year 580Publication date of an 581.Ic \&Rs 582block. 583Provide the full English name of the 584.Ar month 585and all four digits of the 586.Ar year . 587.It Ic \&%I Ar name 588Publisher or issuer name of an 589.Ic \&Rs 590block. 591.It Ic \&%J Ar name 592Journal name of an 593.Ic \&Rs 594block. 595.It Ic \&%N Ar number 596Issue number (usually for journals) of an 597.Ic \&Rs 598block. 599.It Ic \&%O Ar line 600Optional information of an 601.Ic \&Rs 602block. 603.It Ic \&%P Ar number 604Book or journal page number of an 605.Ic \&Rs 606block. 607Conventionally, the argument starts with 608.Ql p.\& 609for a single page or 610.Ql pp.\& 611for a range of pages, for example: 612.Pp 613.Dl .%P pp. 42\e(en47 614.It Ic \&%Q Ar name 615Institutional author (school, government, etc.) of an 616.Ic \&Rs 617block. 618Multiple institutional authors should each be accorded their own 619.Ic \&%Q 620line. 621.It Ic \&%R Ar name 622Technical report name of an 623.Ic \&Rs 624block. 625.It Ic \&%T Ar title 626Article title of an 627.Ic \&Rs 628block. 629This macro may also be used in a non-bibliographical context when 630referring to article titles. 631.It Ic \&%U Ar protocol Ns :// Ns Ar path 632URI of reference document. 633.It Ic \&%V Ar number 634Volume number of an 635.Ic \&Rs 636block. 637.It Ic \&Ac 638Close an 639.Ic \&Ao 640block. 641Does not have any tail arguments. 642.Tg Ad 643.It Ic \&Ad Ar address 644Memory address. 645Do not use this for postal addresses. 646.Pp 647Examples: 648.Dl \&.Ad [0,$] 649.Dl \&.Ad 0x00000000 650.Tg An 651.It Ic \&An Fl split | nosplit | Ar first_name ... last_name 652Author name. 653Can be used both for the authors of the program, function, or driver 654documented in the manual, or for the authors of the manual itself. 655Requires either the name of an author or one of the following arguments: 656.Pp 657.Bl -tag -width "-nosplitX" -offset indent -compact 658.It Fl split 659Start a new output line before each subsequent invocation of 660.Ic \&An . 661.It Fl nosplit 662The opposite of 663.Fl split . 664.El 665.Pp 666The default is 667.Fl nosplit . 668The effect of selecting either of the 669.Fl split 670modes ends at the beginning of the 671.Em AUTHORS 672section. 673In the 674.Em AUTHORS 675section, the default is 676.Fl nosplit 677for the first author listing and 678.Fl split 679for all other author listings. 680.Pp 681Examples: 682.Dl \&.An -nosplit 683.Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv 684.It Ic \&Ao Ar block 685Begin a block enclosed by angle brackets. 686Does not have any head arguments. 687This macro is almost never useful. 688See 689.Ic \&Aq 690for more details. 691.Tg Ap 692.It Ic \&Ap 693Inserts an apostrophe without any surrounding whitespace. 694This is generally used as a grammatical device when referring to the verb 695form of a function. 696.Pp 697Examples: 698.Dl \&.Fn execve \&Ap d 699.Tg Aq 700.It Ic \&Aq Ar line 701Enclose the rest of the input line in angle brackets. 702The only important use case is for email addresses. 703See 704.Ic \&Mt 705for an example. 706.Pp 707Occasionally, it is used for names of characters and keys, for example: 708.Bd -literal -offset indent 709Press the 710\&.Aq escape 711key to ... 712.Ed 713.Pp 714For URIs, use 715.Ic \&Lk 716instead, and 717.Ic \&In 718for 719.Dq #include 720directives. 721Never wrap 722.Ic \&Ar 723in 724.Ic \&Aq . 725.Pp 726Since 727.Ic \&Aq 728usually renders with non-ASCII characters in non-ASCII output modes, 729do not use it where the ASCII characters 730.Sq < 731and 732.Sq > 733are required as syntax elements. 734Instead, use these characters directly in such cases, combining them 735with the macros 736.Ic \&Pf , 737.Ic \&Ns , 738or 739.Ic \&Eo 740as needed. 741.Pp 742See also 743.Ic \&Ao . 744.Tg Ar 745.It Ic \&Ar Op Ar placeholder ... 746Command arguments. 747If an argument is not provided, the string 748.Dq file ...\& 749is used as a default. 750.Pp 751Examples: 752.Dl ".Fl o Ar file" 753.Dl ".Ar" 754.Dl ".Ar arg1 , arg2 ." 755.Pp 756The arguments to the 757.Ic \&Ar 758macro are names and placeholders for command arguments; 759for fixed strings to be passed verbatim as arguments, use 760.Ic \&Fl 761or 762.Ic \&Cm . 763.Tg At 764.It Ic \&At Op Ar version 765Formats an 766.At 767version. 768Accepts one optional argument: 769.Pp 770.Bl -tag -width "v[1-7] | 32vX" -offset indent -compact 771.It Cm v[1-7] | 32v 772A version of 773.At . 774.It Cm III 775.At III . 776.It Cm V | V.[1-4] 777A version of 778.At V . 779.El 780.Pp 781Note that these arguments do not begin with a hyphen. 782.Pp 783Examples: 784.Dl \&.At 785.Dl \&.At III 786.Dl \&.At V.1 787.Pp 788See also 789.Ic \&Bsx , 790.Ic \&Bx , 791.Ic \&Dx , 792.Ic \&Fx , 793.Ic \&Nx , 794and 795.Ic \&Ox . 796.It Ic \&Bc 797Close a 798.Ic \&Bo 799block. 800Does not have any tail arguments. 801.Tg Bd 802.It Ic \&Bd Fl Ns Ar type Oo Fl offset Ar width Oc Op Fl compact 803Begin a display block. 804Display blocks are used to select a different indentation and 805justification than the one used by the surrounding text. 806They may contain both macro lines and text lines. 807By default, a display block is preceded by a vertical space. 808.Pp 809The 810.Ar type 811must be one of the following: 812.Bl -tag -width 13n -offset indent 813.It Fl centered 814Produce one output line from each input line, and center-justify each line. 815Using this display type is not recommended; many 816.Nm 817implementations render it poorly. 818.It Fl filled 819Change the positions of line breaks to fill each line, and left- and 820right-justify the resulting block. 821.It Fl literal 822Produce one output line from each input line, 823and do not justify the block at all. 824Preserve white space as it appears in the input. 825Always use a constant-width font. 826Use this for displaying source code. 827.It Fl ragged 828Change the positions of line breaks to fill each line, and left-justify 829the resulting block. 830.It Fl unfilled 831The same as 832.Fl literal , 833but using the same font as for normal text, which is a variable width font 834if supported by the output device. 835.El 836.Pp 837The 838.Ar type 839must be provided first. 840Additional arguments may follow: 841.Bl -tag -width 13n -offset indent 842.It Fl offset Ar width 843Indent the display by the 844.Ar width , 845which may be one of the following: 846.Bl -item 847.It 848One of the pre-defined strings 849.Cm indent , 850the width of a standard indentation (six constant width characters); 851.Cm indent-two , 852twice 853.Cm indent ; 854.Cm left , 855which has no effect; 856.Cm right , 857which justifies to the right margin; or 858.Cm center , 859which aligns around an imagined center axis. 860.It 861A macro invocation, which selects a predefined width 862associated with that macro. 863The most popular is the imaginary macro 864.Ar \&Ds , 865which resolves to 866.Sy 6n . 867.It 868A scaling width as described in 869.Xr roff 7 . 870.It 871An arbitrary string, which indents by the length of this string. 872.El 873.Pp 874When the argument is missing, 875.Fl offset 876is ignored. 877.It Fl compact 878Do not assert vertical space before the display. 879.El 880.Pp 881Examples: 882.Bd -literal -offset indent 883\&.Bd \-literal \-offset indent \-compact 884 Hello world. 885\&.Ed 886.Ed 887.Pp 888See also 889.Ic \&D1 890and 891.Ic \&Dl . 892.Tg Bf 893.It Ic \&Bf Fl emphasis | literal | symbolic | Cm \&Em | \&Li | \&Sy 894Change the font mode for a scoped block of text. 895The 896.Fl emphasis 897and 898.Cm \&Em 899argument are equivalent, as are 900.Fl symbolic 901and 902.Cm \&Sy , 903and 904.Fl literal 905and 906.Cm \&Li . 907Without an argument, this macro does nothing. 908The font mode continues until broken by a new font mode in a nested 909scope or 910.Ic \&Ef 911is encountered. 912.Pp 913See also 914.Ic \&Li , 915.Ic \&Ef , 916.Ic \&Em , 917and 918.Ic \&Sy . 919.Tg Bk 920.It Ic \&Bk Fl words 921For each macro, keep its output together on the same output line, 922until the end of the macro or the end of the input line is reached, 923whichever comes first. 924Line breaks in text lines are unaffected. 925.Pp 926The 927.Fl words 928argument is required; additional arguments are ignored. 929.Pp 930The following example will not break within each 931.Ic \&Op 932macro line: 933.Bd -literal -offset indent 934\&.Bk \-words 935\&.Op Fl f Ar flags 936\&.Op Fl o Ar output 937\&.Ek 938.Ed 939.Pp 940Be careful in using over-long lines within a keep block! 941Doing so will clobber the right margin. 942.Tg Bl 943.It Xo 944.Ic \&Bl 945.Fl Ns Ar type 946.Op Fl width Ar val 947.Op Fl offset Ar val 948.Op Fl compact 949.Op Ar col ... 950.Xc 951Begin a list. 952Lists consist of items specified using the 953.Ic \&It 954macro, containing a head or a body or both. 955.Pp 956The list 957.Ar type 958is mandatory and must be specified first. 959The 960.Fl width 961and 962.Fl offset 963arguments accept macro names as described for 964.Ic \&Bd 965.Fl offset , 966scaling widths as described in 967.Xr roff 7 , 968or use the length of the given string. 969The 970.Fl offset 971is a global indentation for the whole list, affecting both item heads 972and bodies. 973For those list types supporting it, the 974.Fl width 975argument requests an additional indentation of item bodies, 976to be added to the 977.Fl offset . 978Unless the 979.Fl compact 980argument is specified, list entries are separated by vertical space. 981.Pp 982A list must specify one of the following list types: 983.Bl -tag -width 12n -offset indent 984.It Fl bullet 985No item heads can be specified, but a bullet will be printed at the head 986of each item. 987Item bodies start on the same output line as the bullet 988and are indented according to the 989.Fl width 990argument. 991.It Fl column 992A columnated list. 993The 994.Fl width 995argument has no effect; instead, the string length of each argument 996specifies the width of one column. 997If the first line of the body of a 998.Fl column 999list is not an 1000.Ic \&It 1001macro line, 1002.Ic \&It 1003contexts spanning one input line each are implied until an 1004.Ic \&It 1005macro line is encountered, at which point items start being interpreted as 1006described in the 1007.Ic \&It 1008documentation. 1009.It Fl dash 1010Like 1011.Fl bullet , 1012except that dashes are used in place of bullets. 1013.It Fl diag 1014Like 1015.Fl inset , 1016except that item heads are not parsed for macro invocations. 1017Most often used in the 1018.Em DIAGNOSTICS 1019section with error constants in the item heads. 1020.It Fl enum 1021A numbered list. 1022No item heads can be specified. 1023Formatted like 1024.Fl bullet , 1025except that ordinal numbers are used in place of bullets, 1026starting at 1. 1027.It Fl hang 1028Like 1029.Fl tag , 1030except that the first lines of item bodies are not indented, but follow 1031the item heads like in 1032.Fl inset 1033lists. 1034.It Fl hyphen 1035Synonym for 1036.Fl dash . 1037.It Fl inset 1038Item bodies follow items heads on the same line, using normal inter-word 1039spacing. 1040Bodies are not indented, and the 1041.Fl width 1042argument is ignored. 1043.It Fl item 1044No item heads can be specified, and none are printed. 1045Bodies are not indented, and the 1046.Fl width 1047argument is ignored. 1048.It Fl ohang 1049Item bodies start on the line following item heads and are not indented. 1050The 1051.Fl width 1052argument is ignored. 1053.It Fl tag 1054Item bodies are indented according to the 1055.Fl width 1056argument. 1057When an item head fits inside the indentation, the item body follows 1058this head on the same output line. 1059Otherwise, the body starts on the output line following the head. 1060.El 1061.Pp 1062Lists may be nested within lists and displays. 1063Nesting of 1064.Fl column 1065and 1066.Fl enum 1067lists may not be portable. 1068.Pp 1069See also 1070.Ic \&El 1071and 1072.Ic \&It . 1073.It Ic \&Bo Ar block 1074Begin a block enclosed by square brackets. 1075Does not have any head arguments. 1076.Pp 1077Examples: 1078.Bd -literal -offset indent -compact 1079\&.Bo 1 , 1080\&.Dv BUFSIZ \&Bc 1081.Ed 1082.Pp 1083See also 1084.Ic \&Bq . 1085.Tg Bq 1086.It Ic \&Bq Ar line 1087Encloses its arguments in square brackets. 1088.Pp 1089Examples: 1090.Dl \&.Bq 1 , \&Dv BUFSIZ 1091.Pp 1092.Em Remarks : 1093this macro is sometimes abused to emulate optional arguments for 1094commands; the correct macros to use for this purpose are 1095.Ic \&Op , 1096.Ic \&Oo , 1097and 1098.Ic \&Oc . 1099.Pp 1100See also 1101.Ic \&Bo . 1102.It Ic \&Brc 1103Close a 1104.Ic \&Bro 1105block. 1106Does not have any tail arguments. 1107.It Ic \&Bro Ar block 1108Begin a block enclosed by curly braces. 1109Does not have any head arguments. 1110.Pp 1111Examples: 1112.Bd -literal -offset indent -compact 1113\&.Bro 1 , ... , 1114\&.Va n \&Brc 1115.Ed 1116.Pp 1117See also 1118.Ic \&Brq . 1119.Tg Brq 1120.It Ic \&Brq Ar line 1121Encloses its arguments in curly braces. 1122.Pp 1123Examples: 1124.Dl \&.Brq 1 , ... , \&Va n 1125.Pp 1126See also 1127.Ic \&Bro . 1128.Tg Bsx 1129.It Ic \&Bsx Op Ar version 1130Format the 1131.Bsx 1132version provided as an argument, or a default value if 1133no argument is provided. 1134.Pp 1135Examples: 1136.Dl \&.Bsx 1.0 1137.Dl \&.Bsx 1138.Pp 1139See also 1140.Ic \&At , 1141.Ic \&Bx , 1142.Ic \&Dx , 1143.Ic \&Fx , 1144.Ic \&Nx , 1145and 1146.Ic \&Ox . 1147.It Ic \&Bt 1148Supported only for compatibility, do not use this in new manuals. 1149Prints 1150.Dq is currently in beta test. 1151.Tg Bx 1152.It Ic \&Bx Op Ar version Op Ar variant 1153Format the 1154.Bx 1155version provided as an argument, or a default value if no 1156argument is provided. 1157.Pp 1158Examples: 1159.Dl \&.Bx 4.3 Tahoe 1160.Dl \&.Bx 4.4 1161.Dl \&.Bx 1162.Pp 1163See also 1164.Ic \&At , 1165.Ic \&Bsx , 1166.Ic \&Dx , 1167.Ic \&Fx , 1168.Ic \&Nx , 1169and 1170.Ic \&Ox . 1171.Tg Cd 1172.It Ic \&Cd Ar line 1173Kernel configuration declaration. 1174This denotes strings accepted by 1175.Xr config 8 . 1176It is most often used in section 4 manual pages. 1177.Pp 1178Examples: 1179.Dl \&.Cd device le0 at scode? 1180.Pp 1181.Em Remarks : 1182this macro is commonly abused by using quoted literals to retain 1183whitespace and align consecutive 1184.Ic \&Cd 1185declarations. 1186This practise is discouraged. 1187.Tg Cm 1188.It Ic \&Cm Ar keyword ... 1189Command modifiers. 1190Typically used for fixed strings passed as arguments to interactive 1191commands, to commands in interpreted scripts, or to configuration 1192file directives, unless 1193.Ic \&Fl 1194is more appropriate. 1195.Pp 1196Examples: 1197.Dl ".Nm mt Fl f Ar device Cm rewind" 1198.Dl ".Nm ps Fl o Cm pid , Ns Cm command" 1199.Dl ".Nm dd Cm if= Ns Ar file1 Cm of= Ns Ar file2" 1200.Dl ".Ic set Fl o Cm vi" 1201.Dl ".Ic lookup Cm file bind" 1202.Dl ".Ic permit Ar identity Op Cm as Ar target" 1203.Tg D1 1204.It Ic \&D1 Ar line 1205One-line indented display. 1206This is formatted by the default rules and is useful for simple indented 1207statements. 1208It is followed by a newline. 1209.Pp 1210Examples: 1211.Dl \&.D1 \&Fl abcdefgh 1212.Pp 1213See also 1214.Ic \&Bd 1215and 1216.Ic \&Dl . 1217.It Ic \&Db 1218This macro is obsolete. 1219No replacement is needed. 1220It is ignored by 1221.Xr mandoc 1 1222and groff including its arguments. 1223It was formerly used to toggle a debugging mode. 1224.It Ic \&Dc 1225Close a 1226.Ic \&Do 1227block. 1228Does not have any tail arguments. 1229.Tg Dd 1230.It Ic \&Dd Cm $\&Mdocdate$ | Ar month day , year 1231Document date for display in the page footer, 1232by convention the date of the last change. 1233This is the mandatory first macro of any 1234.Nm 1235manual. 1236.Pp 1237The 1238.Ar month 1239is the full English month name, the 1240.Ar day 1241is an integer number, and the 1242.Ar year 1243is the full four-digit year. 1244.Pp 1245Other arguments are not portable; the 1246.Xr mandoc 1 1247utility handles them as follows: 1248.Bl -dash -offset 3n -compact 1249.It 1250To have the date automatically filled in by the 1251.Ox 1252version of 1253.Xr cvs 1 , 1254the special string 1255.Dq $\&Mdocdate$ 1256can be given as an argument. 1257.It 1258The traditional, purely numeric 1259.Xr man 7 1260format 1261.Ar year Ns \(en Ns Ar month Ns \(en Ns Ar day 1262is accepted, too. 1263.It 1264If a date string cannot be parsed, it is used verbatim. 1265.It 1266If no date string is given, the current date is used. 1267.El 1268.Pp 1269Examples: 1270.Dl \&.Dd $\&Mdocdate$ 1271.Dl \&.Dd $\&Mdocdate: July 2 2018$ 1272.Dl \&.Dd July 2, 2018 1273.Pp 1274See also 1275.Ic \&Dt 1276and 1277.Ic \&Os . 1278.Tg Dl 1279.It Ic \&Dl Ar line 1280One-line indented display. 1281This is formatted as literal text and is useful for commands and 1282invocations. 1283It is followed by a newline. 1284.Pp 1285Examples: 1286.Dl \&.Dl % mandoc mdoc.7 \e(ba less 1287.Pp 1288See also 1289.Ic \&Ql , 1290.Ic \&Bd Fl literal , 1291and 1292.Ic \&D1 . 1293.It Ic \&Do Ar block 1294Begin a block enclosed by double quotes. 1295Does not have any head arguments. 1296.Pp 1297Examples: 1298.Bd -literal -offset indent -compact 1299\&.Do 1300April is the cruellest month 1301\&.Dc 1302\e(em T.S. Eliot 1303.Ed 1304.Pp 1305See also 1306.Ic \&Dq . 1307.Tg Dq 1308.It Ic \&Dq Ar line 1309Encloses its arguments in 1310.Dq typographic 1311double-quotes. 1312.Pp 1313Examples: 1314.Bd -literal -offset indent -compact 1315\&.Dq April is the cruellest month 1316\e(em T.S. Eliot 1317.Ed 1318.Pp 1319See also 1320.Ic \&Qq , 1321.Ic \&Sq , 1322and 1323.Ic \&Do . 1324.Tg Dt 1325.It Ic \&Dt Ar TITLE section Op Ar arch 1326Document title for display in the page header. 1327This is the mandatory second macro of any 1328.Nm 1329file. 1330.Pp 1331Its arguments are as follows: 1332.Bl -tag -width section -offset 2n 1333.It Ar TITLE 1334The document's title (name), defaulting to 1335.Dq UNTITLED 1336if unspecified. 1337To achieve a uniform appearance of page header lines, 1338it should by convention be all caps. 1339.It Ar section 1340The manual section. 1341This may be one of 1342.Cm 1 1343.Pq General Commands , 1344.Cm 2 1345.Pq System Calls , 1346.Cm 3 1347.Pq Library Functions , 1348.Cm 3p 1349.Pq Perl Library , 1350.Cm 4 1351.Pq Device Drivers , 1352.Cm 5 1353.Pq File Formats , 1354.Cm 6 1355.Pq Games , 1356.Cm 7 1357.Pq Miscellaneous Information , 1358.Cm 8 1359.Pq System Manager's Manual , 1360or 1361.Cm 9 1362.Pq Kernel Developer's Manual . 1363It should correspond to the manual's filename suffix and defaults to 1364the empty string if unspecified. 1365.It Ar arch 1366This specifies the machine architecture a manual page applies to, 1367where relevant, for example 1368.Cm alpha , 1369.Cm amd64 , 1370.Cm i386 , 1371or 1372.Cm sparc64 . 1373The list of valid architectures varies by operating system. 1374.El 1375.Pp 1376Examples: 1377.Dl \&.Dt FOO 1 1378.Dl \&.Dt FOO 9 i386 1379.Pp 1380See also 1381.Ic \&Dd 1382and 1383.Ic \&Os . 1384.Tg Dv 1385.It Ic \&Dv Ar identifier ... 1386Defined variables such as preprocessor constants, constant symbols, 1387enumeration values, and so on. 1388.Pp 1389Examples: 1390.Dl \&.Dv NULL 1391.Dl \&.Dv BUFSIZ 1392.Dl \&.Dv STDOUT_FILENO 1393.Pp 1394See also 1395.Ic \&Er 1396and 1397.Ic \&Ev 1398for special-purpose constants, 1399.Ic \&Va 1400for variable symbols, and 1401.Ic \&Fd 1402for listing preprocessor variable definitions in the 1403.Em SYNOPSIS . 1404.Tg Dx 1405.It Ic \&Dx Op Ar version 1406Format the 1407.Dx 1408version provided as an argument, or a default 1409value if no argument is provided. 1410.Pp 1411Examples: 1412.Dl \&.Dx 2.4.1 1413.Dl \&.Dx 1414.Pp 1415See also 1416.Ic \&At , 1417.Ic \&Bsx , 1418.Ic \&Bx , 1419.Ic \&Fx , 1420.Ic \&Nx , 1421and 1422.Ic \&Ox . 1423.It Ic \&Ec Op Ar closing_delimiter 1424Close a scope started by 1425.Ic \&Eo . 1426.Pp 1427The 1428.Ar closing_delimiter 1429argument is used as the enclosure tail, for example, specifying \e(rq 1430will emulate 1431.Ic \&Dc . 1432.It Ic \&Ed 1433End a display context started by 1434.Ic \&Bd . 1435.It Ic \&Ef 1436End a font mode context started by 1437.Ic \&Bf . 1438.It Ic \&Ek 1439End a keep context started by 1440.Ic \&Bk . 1441.It Ic \&El 1442End a list context started by 1443.Ic \&Bl . 1444See also 1445.Ic \&It . 1446.Tg Em 1447.It Ic \&Em Ar word ... 1448Request an italic font. 1449If the output device does not provide that, underline. 1450.Pp 1451This is most often used for stress emphasis (not to be confused with 1452importance, see 1453.Ic \&Sy ) . 1454In the rare cases where none of the semantic markup macros fit, 1455it can also be used for technical terms and placeholders, except 1456that for syntax elements, 1457.Ic \&Sy 1458and 1459.Ic \&Ar 1460are preferred, respectively. 1461.Pp 1462Examples: 1463.Bd -literal -compact -offset indent 1464Selected lines are those 1465\&.Em not 1466matching any of the specified patterns. 1467Some of the functions use a 1468\&.Em hold space 1469to save the pattern space for subsequent retrieval. 1470.Ed 1471.Pp 1472See also 1473.Ic \&No , 1474.Ic \&Ql , 1475and 1476.Ic \&Sy . 1477.It Ic \&En Ar word ... 1478This macro is obsolete. 1479Use 1480.Ic \&Eo 1481or any of the other enclosure macros. 1482.Pp 1483It encloses its argument in the delimiters specified by the last 1484.Ic \&Es 1485macro. 1486.Tg Eo 1487.It Ic \&Eo Op Ar opening_delimiter 1488An arbitrary enclosure. 1489The 1490.Ar opening_delimiter 1491argument is used as the enclosure head, for example, specifying \e(lq 1492will emulate 1493.Ic \&Do . 1494.Tg Er 1495.It Ic \&Er Ar identifier ... 1496Error constants for definitions of the 1497.Va errno 1498libc global variable. 1499This is most often used in section 2 and 3 manual pages. 1500.Pp 1501Examples: 1502.Dl \&.Er EPERM 1503.Dl \&.Er ENOENT 1504.Pp 1505See also 1506.Ic \&Dv 1507for general constants. 1508.It Ic \&Es Ar opening_delimiter closing_delimiter 1509This macro is obsolete. 1510Use 1511.Ic \&Eo 1512or any of the other enclosure macros. 1513.Pp 1514It takes two arguments, defining the delimiters to be used by subsequent 1515.Ic \&En 1516macros. 1517.Tg Ev 1518.It Ic \&Ev Ar identifier ... 1519Environmental variables such as those specified in 1520.Xr environ 7 . 1521.Pp 1522Examples: 1523.Dl \&.Ev DISPLAY 1524.Dl \&.Ev PATH 1525.Pp 1526See also 1527.Ic \&Dv 1528for general constants. 1529.Tg Ex 1530.It Ic \&Ex Fl std Op Ar utility ... 1531Insert a standard sentence regarding command exit values of 0 on success 1532and >0 on failure. 1533This is most often used in section 1, 6, and 8 manual pages. 1534.Pp 1535If 1536.Ar utility 1537is not specified, the document's name set by 1538.Ic \&Nm 1539is used. 1540Multiple 1541.Ar utility 1542arguments are treated as separate utilities. 1543.Pp 1544See also 1545.Ic \&Rv . 1546.Tg Fa 1547.It Ic \&Fa Ar argument ... 1548Function argument or parameter. 1549Each argument may be a name and a type (recommended for the 1550.Em SYNOPSIS 1551section), a name alone (for function invocations), 1552or a type alone (for function prototypes). 1553If both a type and a name are given or if the type consists of multiple 1554words, all words belonging to the same function argument have to be 1555given in a single argument to the 1556.Ic \&Fa 1557macro. 1558.Pp 1559This macro is also used to specify the field name of a structure. 1560.Pp 1561Most often, the 1562.Ic \&Fa 1563macro is used in the 1564.Em SYNOPSIS 1565within 1566.Ic \&Fo 1567blocks when documenting multi-line function prototypes. 1568If invoked with multiple arguments, the arguments are separated by a 1569comma. 1570Furthermore, if the following macro is another 1571.Ic \&Fa , 1572the last argument will also have a trailing comma. 1573.Pp 1574Examples: 1575.Dl \&.Fa \(dqconst char *p\(dq 1576.Dl \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq 1577.Dl \&.Fa \(dqchar *\(dq size_t 1578.Pp 1579See also 1580.Ic \&Fo . 1581.It Ic \&Fc 1582End a function context started by 1583.Ic \&Fo . 1584.Tg Fd 1585.It Ic \&Fd Pf # Ar directive Op Ar argument ... 1586Preprocessor directive, in particular for listing it in the 1587.Em SYNOPSIS . 1588Historically, it was also used to document include files. 1589The latter usage has been deprecated in favour of 1590.Ic \&In . 1591.Pp 1592Examples: 1593.Dl \&.Fd #define sa_handler __sigaction_u.__sa_handler 1594.Dl \&.Fd #define SIO_MAXNFDS 1595.Dl \&.Fd #ifdef FS_DEBUG 1596.Dl \&.Ft void 1597.Dl \&.Fn dbg_open \(dqconst char *\(dq 1598.Dl \&.Fd #endif 1599.Pp 1600See also 1601.Sx MANUAL STRUCTURE , 1602.Ic \&In , 1603and 1604.Ic \&Dv . 1605.Tg Fl 1606.It Ic \&Fl Op Ar word ... 1607Command-line flag or option. 1608Used when listing arguments to command-line utilities. 1609For each argument, prints an ASCII hyphen-minus character 1610.Sq \- , 1611immediately followed by the argument. 1612If no arguments are provided, a hyphen-minus is printed followed by a space. 1613If the argument is a macro, a hyphen-minus is prefixed 1614to the subsequent macro output. 1615.Pp 1616Examples: 1617.Dl ".Nm du Op Fl H | L | P" 1618.Dl ".Nm ls Op Fl 1AaCcdFfgHhikLlmnopqRrSsTtux" 1619.Dl ".Nm route Cm add Fl inet Ar destination gateway" 1620.Dl ".Nm locate.updatedb Op Fl \e-fcodes Ns = Ns Ar dbfile" 1621.Dl ".Nm aucat Fl o Fl" 1622.Dl ".Nm kill Fl Ar signal_number" 1623.Pp 1624For GNU-style long options, escaping the additional hyphen-minus is not 1625strictly required, but may be safer with future versions of GNU troff; see 1626.Xr mandoc_char 7 1627for details. 1628.Pp 1629See also 1630.Ic \&Cm . 1631.Tg Fn 1632.It Ic \&Fn Ar funcname Op Ar argument ... 1633A function name. 1634.Pp 1635Function arguments are surrounded in parenthesis and 1636are delimited by commas. 1637If no arguments are specified, blank parenthesis are output. 1638In the 1639.Em SYNOPSIS 1640section, this macro starts a new output line, 1641and a blank line is automatically inserted between function definitions. 1642.Pp 1643Examples: 1644.Dl \&.Fn \(dqint funcname\(dq \(dqint arg0\(dq \(dqint arg1\(dq 1645.Dl \&.Fn funcname \(dqint arg0\(dq 1646.Dl \&.Fn funcname arg0 1647.Bd -literal -offset indent 1648\&.Ft functype 1649\&.Fn funcname 1650.Ed 1651.Pp 1652When referring to a function documented in another manual page, use 1653.Ic \&Xr 1654instead. 1655See also 1656.Sx MANUAL STRUCTURE , 1657.Ic \&Fo , 1658and 1659.Ic \&Ft . 1660.Tg Fo 1661.It Ic \&Fo Ar funcname 1662Begin a function block. 1663This is a multi-line version of 1664.Ic \&Fn . 1665.Pp 1666Invocations usually occur in the following context: 1667.Bd -ragged -offset indent 1668.Pf \. Ic \&Ft Ar functype 1669.br 1670.Pf \. Ic \&Fo Ar funcname 1671.br 1672.Pf \. Ic \&Fa Qq Ar argtype Ar argname 1673.br 1674\&.\.\. 1675.br 1676.Pf \. Ic \&Fc 1677.Ed 1678.Pp 1679A 1680.Ic \&Fo 1681scope is closed by 1682.Ic \&Fc . 1683.Pp 1684See also 1685.Sx MANUAL STRUCTURE , 1686.Ic \&Fa , 1687.Ic \&Fc , 1688and 1689.Ic \&Ft . 1690.It Ic \&Fr Ar number 1691This macro is obsolete. 1692No replacement markup is needed. 1693.Pp 1694It was used to show numerical function return values in an italic font. 1695.Tg Ft 1696.It Ic \&Ft Ar functype 1697A function type. 1698.Pp 1699In the 1700.Em SYNOPSIS 1701section, a new output line is started after this macro. 1702.Pp 1703Examples: 1704.Dl \&.Ft int 1705.Bd -literal -offset indent -compact 1706\&.Ft functype 1707\&.Fn funcname 1708.Ed 1709.Pp 1710See also 1711.Sx MANUAL STRUCTURE , 1712.Ic \&Fn , 1713and 1714.Ic \&Fo . 1715.Tg Fx 1716.It Ic \&Fx Op Ar version 1717Format the 1718.Fx 1719version provided as an argument, or a default value 1720if no argument is provided. 1721.Pp 1722Examples: 1723.Dl \&.Fx 7.1 1724.Dl \&.Fx 1725.Pp 1726See also 1727.Ic \&At , 1728.Ic \&Bsx , 1729.Ic \&Bx , 1730.Ic \&Dx , 1731.Ic \&Nx , 1732and 1733.Ic \&Ox . 1734.It Ic \&Hf Ar filename 1735This macro is not implemented in 1736.Xr mandoc 1 . 1737It was used to include the contents of a (header) file literally. 1738.Tg Ic 1739.It Ic \&Ic Ar keyword ... 1740Internal or interactive command, or configuration instruction 1741in a configuration file. 1742See also 1743.Ic \&Cm . 1744.Pp 1745Examples: 1746.Dl \&.Ic :wq 1747.Dl \&.Ic hash 1748.Dl \&.Ic alias 1749.Pp 1750Note that using 1751.Ic \&Ql , 1752.Ic \&Dl , 1753or 1754.Ic \&Bd Fl literal 1755is preferred for displaying code samples; the 1756.Ic \&Ic 1757macro is used when referring to an individual command name. 1758.Tg In 1759.It Ic \&In Ar filename 1760The name of an include file. 1761This macro is most often used in section 2, 3, and 9 manual pages. 1762.Pp 1763When invoked as the first macro on an input line in the 1764.Em SYNOPSIS 1765section, the argument is displayed in angle brackets 1766and preceded by 1767.Qq #include , 1768and a blank line is inserted in front if there is a preceding 1769function declaration. 1770In other sections, it only encloses its argument in angle brackets 1771and causes no line break. 1772.Pp 1773Examples: 1774.Dl \&.In sys/types.h 1775.Pp 1776See also 1777.Sx MANUAL STRUCTURE . 1778.Tg It 1779.It Ic \&It Op Ar head 1780A list item. 1781The syntax of this macro depends on the list type. 1782.Pp 1783Lists 1784of type 1785.Fl hang , 1786.Fl ohang , 1787.Fl inset , 1788and 1789.Fl diag 1790have the following syntax: 1791.Pp 1792.D1 Pf \. Ic \&It Ar args 1793.Pp 1794Lists of type 1795.Fl bullet , 1796.Fl dash , 1797.Fl enum , 1798.Fl hyphen 1799and 1800.Fl item 1801have the following syntax: 1802.Pp 1803.D1 Pf \. Ic \&It 1804.Pp 1805with subsequent lines interpreted within the scope of the 1806.Ic \&It 1807until either a closing 1808.Ic \&El 1809or another 1810.Ic \&It . 1811.Pp 1812The 1813.Fl tag 1814list has the following syntax: 1815.Pp 1816.D1 Pf \. Ic \&It Op Cm args 1817.Pp 1818Subsequent lines are interpreted as with 1819.Fl bullet 1820and family. 1821The line arguments correspond to the list's left-hand side; body 1822arguments correspond to the list's contents. 1823.Pp 1824The 1825.Fl column 1826list is the most complicated. 1827Its syntax is as follows: 1828.Pp 1829.D1 Pf \. Ic \&It Ar cell Op Ic \&Ta Ar cell ... 1830.D1 Pf \. Ic \&It Ar cell Op <TAB> Ar cell ... 1831.Pp 1832The arguments consist of one or more lines of text and macros 1833representing a complete table line. 1834Cells within the line are delimited by the special 1835.Ic \&Ta 1836block macro or by literal tab characters. 1837.Pp 1838Using literal tabs is strongly discouraged because they are very 1839hard to use correctly and 1840.Nm 1841code using them is very hard to read. 1842In particular, a blank character is syntactically significant 1843before and after the literal tab character. 1844If a word precedes or follows the tab without an intervening blank, 1845that word is never interpreted as a macro call, but always output 1846literally. 1847.Pp 1848The tab cell delimiter may only be used within the 1849.Ic \&It 1850line itself; on following lines, only the 1851.Ic \&Ta 1852macro can be used to delimit cells, and portability requires that 1853.Ic \&Ta 1854is called by other macros: some parsers do not recognize it when 1855it appears as the first macro on a line. 1856.Pp 1857Note that quoted strings may span tab-delimited cells on an 1858.Ic \&It 1859line. 1860For example, 1861.Pp 1862.Dl .It \(dqcol1 ,\& <TAB> col2 ,\(dq \&; 1863.Pp 1864will preserve the whitespace before both commas, 1865but not the whitespace before the semicolon. 1866.Pp 1867See also 1868.Ic \&Bl . 1869.Tg Lb 1870.It Ic \&Lb Cm lib Ns Ar name 1871Specify a library. 1872.Pp 1873The 1874.Ar name 1875parameter may be a system library, such as 1876.Cm z 1877or 1878.Cm pam , 1879in which case a small library description is printed next to the linker 1880invocation; or a custom library, in which case the library name is 1881printed in quotes. 1882This is most commonly used in the 1883.Em SYNOPSIS 1884section as described in 1885.Sx MANUAL STRUCTURE . 1886.Pp 1887Examples: 1888.Dl \&.Lb libz 1889.Dl \&.Lb libmandoc 1890.Tg Li 1891.It Ic \&Li Ar word ... 1892Request a typewriter (literal) font. 1893Deprecated because on terminal output devices, this is usually 1894indistinguishable from normal text. 1895For literal displays, use 1896.Ic \&Ql Pq in-line , 1897.Ic \&Dl Pq single line , 1898or 1899.Ic \&Bd Fl literal Pq multi-line 1900instead. 1901.Tg Lk 1902.It Ic \&Lk Ar uri Op Ar display_name 1903Format a hyperlink. 1904.Pp 1905Examples: 1906.Dl \&.Lk https://bsd.lv \(dqThe BSD.lv Project\(dq 1907.Dl \&.Lk https://bsd.lv 1908.Pp 1909See also 1910.Ic \&Mt . 1911.It Ic \&Lp 1912Deprecated synonym for 1913.Ic \&Pp . 1914.Tg Ms 1915.It Ic \&Ms Ar name 1916Display a mathematical symbol. 1917.Pp 1918Examples: 1919.Dl \&.Ms sigma 1920.Dl \&.Ms aleph 1921.Tg Mt 1922.It Ic \&Mt Ar localpart Ns @ Ns Ar domain 1923Format a 1924.Dq mailto: 1925hyperlink. 1926.Pp 1927Examples: 1928.Dl \&.Mt discuss@manpages.bsd.lv 1929.Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv 1930.Tg Nd 1931.It Ic \&Nd Ar line 1932A one line description of the manual's content. 1933This is the mandatory last macro of the 1934.Em NAME 1935section and not appropriate for other sections. 1936.Pp 1937Examples: 1938.Dl Pf . Ic \&Nd mdoc language reference 1939.Dl Pf . Ic \&Nd format and display UNIX manuals 1940.Pp 1941The 1942.Ic \&Nd 1943macro technically accepts child macros and terminates with a subsequent 1944.Ic \&Sh 1945invocation. 1946Do not assume this behaviour: some 1947.Xr whatis 1 1948database generators are not smart enough to parse more than the line 1949arguments and will display macros verbatim. 1950.Pp 1951See also 1952.Ic \&Nm . 1953.Tg Nm 1954.It Ic \&Nm Op Ar name 1955The name of the manual page, or \(em in particular in section 1, 6, 1956and 8 pages \(em of an additional command or feature documented in 1957the manual page. 1958When first invoked, the 1959.Ic \&Nm 1960macro expects a single argument, the name of the manual page. 1961Usually, the first invocation happens in the 1962.Em NAME 1963section of the page. 1964The specified name will be remembered and used whenever the macro is 1965called again without arguments later in the page. 1966The 1967.Ic \&Nm 1968macro uses 1969.Sx Block full-implicit 1970semantics when invoked as the first macro on an input line in the 1971.Em SYNOPSIS 1972section; otherwise, it uses ordinary 1973.Sx In-line 1974semantics. 1975.Pp 1976Examples: 1977.Bd -literal -offset indent 1978\&.Sh SYNOPSIS 1979\&.Nm cat 1980\&.Op Fl benstuv 1981\&.Op Ar 1982.Ed 1983.Pp 1984In the 1985.Em SYNOPSIS 1986of section 2, 3 and 9 manual pages, use the 1987.Ic \&Fn 1988macro rather than 1989.Ic \&Nm 1990to mark up the name of the manual page. 1991.Tg No 1992.It Ic \&No Ar word ... 1993Normal text. 1994Closes the scope of any preceding in-line macro. 1995When used after physical formatting macros like 1996.Ic \&Em 1997or 1998.Ic \&Sy , 1999switches back to the standard font face and weight. 2000Can also be used to embed plain text strings in macro lines 2001using semantic annotation macros. 2002.Pp 2003Examples: 2004.Dl ".Em italic , Sy bold , No and roman" 2005.Bd -literal -offset indent 2006\&.Sm off 2007\&.Cm :C No / Ar pattern No / Ar replacement No / 2008\&.Sm on 2009.Ed 2010.Pp 2011See also 2012.Ic \&Em , 2013.Ic \&Ql , 2014and 2015.Ic \&Sy . 2016.Tg Ns 2017.It Ic \&Ns 2018Suppress a space between the output of the preceding macro 2019and the following text or macro. 2020Following invocation, input is interpreted as normal text 2021just like after an 2022.Ic \&No 2023macro. 2024.Pp 2025This has no effect when invoked at the start of a macro line. 2026.Pp 2027Examples: 2028.Dl ".Ar name Ns = Ns Ar value" 2029.Dl ".Cm :M Ns Ar pattern" 2030.Dl ".Fl o Ns Ar output" 2031.Pp 2032See also 2033.Ic \&No 2034and 2035.Ic \&Sm . 2036.Tg Nx 2037.It Ic \&Nx Op Ar version 2038Format the 2039.Nx 2040version provided as an argument, or a default value if 2041no argument is provided. 2042.Pp 2043Examples: 2044.Dl \&.Nx 5.01 2045.Dl \&.Nx 2046.Pp 2047See also 2048.Ic \&At , 2049.Ic \&Bsx , 2050.Ic \&Bx , 2051.Ic \&Dx , 2052.Ic \&Fx , 2053and 2054.Ic \&Ox . 2055.It Ic \&Oc 2056Close multi-line 2057.Ic \&Oo 2058context. 2059.It Ic \&Oo Ar block 2060Multi-line version of 2061.Ic \&Op . 2062.Pp 2063Examples: 2064.Bd -literal -offset indent -compact 2065\&.Oo 2066\&.Op Fl flag Ns Ar value 2067\&.Oc 2068.Ed 2069.Tg Op 2070.It Ic \&Op Ar line 2071Optional part of a command line. 2072Prints the argument(s) in brackets. 2073This is most often used in the 2074.Em SYNOPSIS 2075section of section 1 and 8 manual pages. 2076.Pp 2077Examples: 2078.Dl \&.Op \&Fl a \&Ar b 2079.Dl \&.Op \&Ar a | b 2080.Pp 2081See also 2082.Ic \&Oo . 2083.Tg Os 2084.It Ic \&Os Op Ar footer text 2085The mandatory third macro of every 2086.Nm 2087file. 2088Usually, do not specify any arguments, 2089in particular not the operating system name and/or version. 2090.Pp 2091If no argument is given, 2092.Xr mandoc 1 2093prints its 2094.Fl Ios 2095argument in the page footer, or 2096.Fa sysname 2097and 2098.Fa release 2099as returned by 2100.Xr uname 3 2101by default. 2102.Pp 2103Manual pages that are part of a portable software project can override 2104the default by giving the project name and version number as arguments, 2105but leaving it blank is never a bad choice. 2106.Pp 2107See also 2108.Ic \&Dd 2109and 2110.Ic \&Dt . 2111.It Ic \&Ot Ar functype 2112This macro is obsolete. 2113Use 2114.Ic \&Ft 2115instead; with 2116.Xr mandoc 1 , 2117both have the same effect. 2118.Pp 2119Historical 2120.Nm 2121packages described it as 2122.Dq "old function type (FORTRAN)" . 2123.Tg Ox 2124.It Ic \&Ox Op Ar version 2125Format the 2126.Ox 2127version provided as an argument, or a default value 2128if no argument is provided. 2129.Pp 2130Examples: 2131.Dl \&.Ox 4.5 2132.Dl \&.Ox 2133.Pp 2134See also 2135.Ic \&At , 2136.Ic \&Bsx , 2137.Ic \&Bx , 2138.Ic \&Dx , 2139.Ic \&Fx , 2140and 2141.Ic \&Nx . 2142.Tg Pa 2143.It Ic \&Pa Ar name ... 2144An absolute or relative file system path, or a file or directory name. 2145If an argument is not provided, the character 2146.Sq \(ti 2147is used as a default. 2148.Pp 2149Examples: 2150.Dl \&.Pa /usr/bin/mandoc 2151.Dl \&.Pa /usr/share/man/man7/mdoc.7 2152.Pp 2153See also 2154.Ic \&Lk . 2155.It Ic \&Pc 2156Close parenthesised context opened by 2157.Ic \&Po . 2158.Tg Pf 2159.It Ic \&Pf Ar prefix macro Op Ar argument ... 2160Removes the space between its argument and the following macro. 2161It is equivalent to: 2162.Pp 2163.D1 Ic \&No Pf \e& Ar prefix Ic \&Ns Ar macro Op Ar argument ... 2164.Pp 2165The 2166.Ar prefix 2167argument is not parsed for macro names or delimiters, 2168but used verbatim as if it were escaped. 2169.Pp 2170Examples: 2171.Dl ".Pf $ Ar variable_name" 2172.Dl ".Pf . Ar macro_name" 2173.Dl ".Pf 0x Ar hex_digits" 2174.Pp 2175See also 2176.Ic \&Ns 2177and 2178.Ic \&Sm . 2179.It Ic \&Po Ar block 2180Multi-line version of 2181.Ic \&Pq . 2182.Tg Pp 2183.It Ic \&Pp 2184Break a paragraph. 2185This will assert vertical space between prior and subsequent macros 2186and/or text. 2187.Pp 2188Paragraph breaks are not needed before or after 2189.Ic \&Sh 2190or 2191.Ic \&Ss 2192macros or before displays 2193.Pq Ic \&Bd Ar line 2194or lists 2195.Pq Ic \&Bl 2196unless the 2197.Fl compact 2198flag is given. 2199.Tg Pq 2200.It Ic \&Pq Ar line 2201Parenthesised enclosure. 2202.Pp 2203See also 2204.Ic \&Po . 2205.It Ic \&Qc 2206Close quoted context opened by 2207.Ic \&Qo . 2208.Tg Ql 2209.It Ic \&Ql Ar line 2210In-line literal display. 2211This can be used for complete command invocations and for multi-word 2212code examples when an indented display is not desired. 2213.Pp 2214See also 2215.Ic \&Dl 2216and 2217.Ic \&Bd 2218.Fl literal . 2219.It Ic \&Qo Ar block 2220Multi-line version of 2221.Ic \&Qq . 2222.Tg Qq 2223.It Ic \&Qq Ar line 2224Encloses its arguments in 2225.Qq typewriter 2226double-quotes. 2227Consider using 2228.Ic \&Dq . 2229.Pp 2230See also 2231.Ic \&Dq , 2232.Ic \&Sq , 2233and 2234.Ic \&Qo . 2235.It Ic \&Re 2236Close an 2237.Ic \&Rs 2238block. 2239Does not have any tail arguments. 2240.Tg Rs 2241.It Ic \&Rs 2242Begin a bibliographic 2243.Pq Dq reference 2244block. 2245Does not have any head arguments. 2246The block macro may only contain 2247.Ic \&%A , 2248.Ic \&%B , 2249.Ic \&%C , 2250.Ic \&%D , 2251.Ic \&%I , 2252.Ic \&%J , 2253.Ic \&%N , 2254.Ic \&%O , 2255.Ic \&%P , 2256.Ic \&%Q , 2257.Ic \&%R , 2258.Ic \&%T , 2259.Ic \&%U , 2260and 2261.Ic \&%V 2262child macros (at least one must be specified). 2263.Pp 2264Examples: 2265.Bd -literal -offset indent -compact 2266\&.Rs 2267\&.%A J. E. Hopcroft 2268\&.%A J. D. Ullman 2269\&.%B Introduction to Automata Theory, Languages, and Computation 2270\&.%I Addison-Wesley 2271\&.%C Reading, Massachusetts 2272\&.%D 1979 2273\&.Re 2274.Ed 2275.Pp 2276If an 2277.Ic \&Rs 2278block is used within a SEE ALSO section, a vertical space is asserted 2279before the rendered output, else the block continues on the current 2280line. 2281.Tg Rv 2282.It Ic \&Rv Fl std Op Ar function ... 2283Insert a standard sentence regarding a function call's return value of 0 2284on success and \-1 on error, with the 2285.Va errno 2286libc global variable set on error. 2287.Pp 2288If 2289.Ar function 2290is not specified, the document's name set by 2291.Ic \&Nm 2292is used. 2293Multiple 2294.Ar function 2295arguments are treated as separate functions. 2296.Pp 2297See also 2298.Ic \&Ex . 2299.It Ic \&Sc 2300Close single-quoted context opened by 2301.Ic \&So . 2302.Tg Sh 2303.It Ic \&Sh Ar TITLE LINE 2304Begin a new section. 2305For a list of conventional manual sections, see 2306.Sx MANUAL STRUCTURE . 2307Use the conventional sections where applicable. 2308For unusually long and complicated manual pages, 2309adding custom sections is occasionally useful. 2310.Pp 2311Avoid using macros inside the 2312.Ar TITLE LINE 2313and keep that line unique within the manual page, 2314such that it can be pointed to with 2315.Ic \&Sx . 2316.Pp 2317See also 2318.Ic \&Pp , 2319.Ic \&Ss , 2320and 2321.Ic \&Sx . 2322.Tg Sm 2323.It Ic \&Sm Op Cm on | off 2324Switches the spacing mode for output generated from macros. 2325.Pp 2326By default, spacing is 2327.Cm on . 2328When switched 2329.Cm off , 2330no white space is inserted between macro arguments and between the 2331output generated from adjacent macros, but text lines 2332still get normal spacing between words and sentences. 2333.Pp 2334When called without an argument, the 2335.Ic \&Sm 2336macro toggles the spacing mode. 2337Using this is not recommended because it makes the code harder to read. 2338.It Ic \&So Ar block 2339Multi-line version of 2340.Ic \&Sq . 2341.Tg Sq 2342.It Ic \&Sq Ar line 2343Encloses its arguments in 2344.Sq typewriter 2345single-quotes. 2346.Pp 2347See also 2348.Ic \&Dq , 2349.Ic \&Qq , 2350and 2351.Ic \&So . 2352.Tg Ss 2353.It Ic \&Ss Ar Title line 2354Begin a new subsection. 2355Unlike with 2356.Ic \&Sh , 2357there is no convention for the naming of subsections. 2358Except 2359.Em DESCRIPTION , 2360the conventional sections described in 2361.Sx MANUAL STRUCTURE 2362rarely have subsections. 2363.Pp 2364Avoid using macros inside the 2365.Ar Title line 2366and keep that line unique within the manual page, 2367such that it can be pointed to with 2368.Ic \&Sx . 2369.Pp 2370See also 2371.Ic \&Pp , 2372.Ic \&Sh , 2373and 2374.Ic \&Sx . 2375.Tg St 2376.It Ic \&St Fl Ns Ar abbreviation 2377Replace an abbreviation for a standard with the full form. 2378The following standards are recognised. 2379Where multiple lines are given without a blank line in between, 2380they all refer to the same standard, and using the first form 2381is recommended. 2382.Bl -tag -width 1n 2383.It C language standards 2384.Pp 2385.Bl -tag -width "-p1003.1g-2000" -compact 2386.It \-ansiC 2387.St -ansiC 2388.It \-ansiC-89 2389.St -ansiC-89 2390.It \-isoC 2391.St -isoC 2392.It \-isoC-90 2393.St -isoC-90 2394.br 2395The original C standard. 2396.Pp 2397.It \-isoC-amd1 2398.St -isoC-amd1 2399.Pp 2400.It \-isoC-tcor1 2401.St -isoC-tcor1 2402.Pp 2403.It \-isoC-tcor2 2404.St -isoC-tcor2 2405.Pp 2406.It \-isoC-99 2407.St -isoC-99 2408.br 2409Edition 2 of the C language standard. 2410.Pp 2411.It \-isoC-2011 2412.St -isoC-2011 2413.br 2414Edition 3 of the C language standard. 2415.Pp 2416.It \-isoC-2023 2417.St -isoC-2023 2418.br 2419Edition 5 of the C language standard. 2420.El 2421.It POSIX.1 before XPG4.2 2422.Pp 2423.Bl -tag -width "-p1003.1g-2000" -compact 2424.It \-p1003.1-88 2425.St -p1003.1-88 2426.It \-p1003.1 2427.St -p1003.1 2428.br 2429The original POSIX standard, based on ANSI C. 2430.Pp 2431.It \-p1003.1-90 2432.St -p1003.1-90 2433.It \-iso9945-1-90 2434.St -iso9945-1-90 2435.br 2436The first update of POSIX.1. 2437.Pp 2438.It \-p1003.1b-93 2439.St -p1003.1b-93 2440.It \-p1003.1b 2441.St -p1003.1b 2442.br 2443Real-time extensions. 2444.Pp 2445.It \-p1003.1c-95 2446.St -p1003.1c-95 2447.br 2448POSIX thread interfaces. 2449.Pp 2450.It \-p1003.1i-95 2451.St -p1003.1i-95 2452.br 2453Technical Corrigendum. 2454.Pp 2455.It \-p1003.1-96 2456.St -p1003.1-96 2457.It \-iso9945-1-96 2458.St -iso9945-1-96 2459.br 2460Includes POSIX.1-1990, 1b, 1c, and 1i. 2461.El 2462.It X/Open Portability Guide before XPG4.2 2463.Pp 2464.Bl -tag -width "-p1003.1g-2000" -compact 2465.It \-xpg3 2466.St -xpg3 2467.br 2468An XPG4 precursor, published in 1989. 2469.Pp 2470.It \-p1003.2 2471.St -p1003.2 2472.It \-p1003.2-92 2473.St -p1003.2-92 2474.It \-iso9945-2-93 2475.St -iso9945-2-93 2476.br 2477An XCU4 precursor. 2478.Pp 2479.It \-p1003.2a-92 2480.St -p1003.2a-92 2481.br 2482Updates to POSIX.2. 2483.Pp 2484.It \-xpg4 2485.St -xpg4 2486.br 2487Based on POSIX.1 and POSIX.2, published in 1992. 2488.El 2489.It X/Open Portability Guide Issue 4 Version 2 and related standards 2490.Pp 2491.Bl -tag -width "-p1003.1g-2000" -compact 2492.It \-susv1 2493.St -susv1 2494.It \-xpg4.2 2495.St -xpg4.2 2496.br 2497This standard was published in 1994. 2498It was used as the basis for UNIX 95 certification. 2499The following two refer to parts of it. 2500.Pp 2501.It \-xcurses4.2 2502.St -xcurses4.2 2503.Pp 2504.It \-p1003.1g-2000 2505.St -p1003.1g-2000 2506.br 2507Networking APIs, including sockets. 2508.Pp 2509.It \-svid4 2510.St -svid4 , 2511.br 2512Published in 1995. 2513.El 2514.It X/Open Portability Guide Issue 5 and related standards 2515.Pp 2516.Bl -tag -width "-p1003.1g-2000" -compact 2517.It \-susv2 2518.St -susv2 2519.br 2520This Standard was published in 1997 2521and is also called X/Open Portability Guide Issue 5. 2522It was used as the basis for UNIX 98 certification. 2523The following refer to parts of it. 2524.Pp 2525.It \-xbd5 2526.St -xbd5 2527.Pp 2528.It \-xsh5 2529.St -xsh5 2530.Pp 2531.It \-xcu5 2532.St -xcu5 2533.Pp 2534.It \-xns5 2535.St -xns5 2536.It \-xns5.2 2537.St -xns5.2 2538.El 2539.It POSIX Issue 6 2540.Pp 2541.Bl -tag -width "-p1003.1-2001" -compact 2542.It \-p1003.1-2001 2543.St -p1003.1-2001 2544.It \-susv3 2545.St -susv3 2546.br 2547This standard is based on C99, SUSv2, POSIX.1-1996, 1d, and 1j. 2548It is also called X/Open Portability Guide Issue 6. 2549It is used as the basis for UNIX 03 certification. 2550.Pp 2551.It \-p1003.1-2004 2552.St -p1003.1-2004 2553.br 2554The second and last Technical Corrigendum. 2555.El 2556.It POSIX Issues 7 and 8 2557.Pp 2558.Bl -tag -width "-p1003.1g-2000" -compact 2559.It \-p1003.1-2008 2560.St -p1003.1-2008 2561.It \-susv4 2562.St -susv4 2563.br 2564This standard is based on C99. 2565It is also called the 2566Open Group Standard Base Specifications, Issue 7. 2567.El 2568.Pp 2569.Bl -tag -width "-p1003.1g-2000" -compact 2570.It \-p1003.1-2024 2571.St -p1003.1-2024 2572.br 2573This standard is based on C17. 2574It is also called the 2575Open Group Standard Base Specifications, Issue 8. 2576.El 2577.It Other standards 2578.Pp 2579.Bl -tag -width "-p1003.1g-2000" -compact 2580.It \-ieee754 2581.St -ieee754 2582.br 2583Floating-point arithmetic. 2584.Pp 2585.It \-iso8601 2586.St -iso8601 2587.br 2588Representation of dates and times, published in 1988. 2589.Pp 2590.It \-iso8802-3 2591.St -iso8802-3 2592.br 2593Ethernet local area networks. 2594.Pp 2595.It \-ieee1275-94 2596.St -ieee1275-94 2597.El 2598.El 2599.Tg Sx 2600.It Ic \&Sx Ar Title line 2601Reference a section or subsection in the same manual page. 2602The referenced section or subsection name must be identical to the 2603enclosed argument, including whitespace. 2604.Pp 2605Examples: 2606.Dl \&.Sx MANUAL STRUCTURE 2607.Pp 2608See also 2609.Ic \&Sh 2610and 2611.Ic \&Ss . 2612.Tg Sy 2613.It Ic \&Sy Ar word ... 2614Request a boldface font. 2615.Pp 2616This is most often used to indicate importance or seriousness (not to be 2617confused with stress emphasis, see 2618.Ic \&Em ) . 2619When none of the semantic macros fit, it is also adequate for syntax 2620elements that have to be given or that appear verbatim. 2621.Pp 2622Examples: 2623.Bd -literal -compact -offset indent 2624\&.Sy Warning : 2625If 2626\&.Sy s 2627appears in the owner permissions, set-user-ID mode is set. 2628This utility replaces the former 2629\&.Sy dumpdir 2630program. 2631.Ed 2632.Pp 2633See also 2634.Ic \&Em , 2635.Ic \&No , 2636and 2637.Ic \&Ql . 2638.Tg Ta 2639.It Ic \&Ta 2640Table cell separator in 2641.Ic \&Bl Fl column 2642lists; can only be used below 2643.Ic \&It . 2644.Tg Tg 2645.It Ic \&Tg Op Ar term 2646Announce that the next input line starts a definition of the 2647.Ar term . 2648This macro must appear alone on its own input line. 2649The argument defaults to the first argument of the first macro 2650on the next line. 2651The argument may not contain whitespace characters, not even when it is quoted. 2652This macro is a 2653.Xr mandoc 1 2654extension and is typically ignored by other formatters. 2655.Pp 2656When viewing terminal output with 2657.Xr less 1 , 2658the interactive 2659.Ic :t 2660command can be used to go to the definition of the 2661.Ar term 2662as described for the 2663.Ev MANPAGER 2664variable in 2665.Xr man 1 ; 2666when producing HTML output, a fragment identifier 2667.Pq Ic id No attribute 2668is generated, to be used for deep linking to this place of the document. 2669.Pp 2670In most cases, adding a 2671.Ic \&Tg 2672macro would be redundant because 2673.Xr mandoc 1 2674is able to automatically tag most definitions. 2675This macro is intended for cases where automatic tagging of a 2676.Ar term 2677is unsatisfactory, for example if a definition is not tagged 2678automatically (false negative) or if places are tagged that do 2679not define the 2680.Ar term 2681(false positives). 2682When there is at least one 2683.Ic \&Tg 2684macro for a 2685.Ar term , 2686no other places are automatically marked as definitions of that 2687.Ar term . 2688.It Ic \&Tn Ar word ... 2689Supported only for compatibility, do not use this in new manuals. 2690Even though the macro name 2691.Pq Dq tradename 2692suggests a semantic function, historic usage is inconsistent, mostly 2693using it as a presentation-level macro to request a small caps font. 2694.It Ic \&Ud 2695Supported only for compatibility, do not use this in new manuals. 2696Prints out 2697.Dq currently under development. 2698.It Ic \&Ux 2699Supported only for compatibility, do not use this in new manuals. 2700Prints out 2701.Dq Ux . 2702.Tg Va 2703.It Ic \&Va Oo Ar type Oc Ar identifier ... 2704A variable name. 2705.Pp 2706Examples: 2707.Dl \&.Va foo 2708.Dl \&.Va const char *bar ; 2709.Pp 2710For function arguments and parameters, use 2711.Ic \&Fa 2712instead. 2713For declarations of global variables in the 2714.Em SYNOPSIS 2715section, use 2716.Ic \&Vt . 2717.Tg Vt 2718.It Ic \&Vt Ar type Op Ar identifier 2719A variable type. 2720.Pp 2721This is also used for indicating global variables in the 2722.Em SYNOPSIS 2723section, in which case a variable name is also specified. 2724Note that it accepts 2725.Sx Block partial-implicit 2726syntax when invoked as the first macro on an input line in the 2727.Em SYNOPSIS 2728section, else it accepts ordinary 2729.Sx In-line 2730syntax. 2731In the former case, this macro starts a new output line, 2732and a blank line is inserted in front if there is a preceding 2733function definition or include directive. 2734.Pp 2735Examples: 2736.Dl \&.Vt unsigned char 2737.Dl \&.Vt extern const char * const sys_signame[] \&; 2738.Pp 2739For parameters in function prototypes, use 2740.Ic \&Fa 2741instead, for function return types 2742.Ic \&Ft , 2743and for variable names outside the 2744.Em SYNOPSIS 2745section 2746.Ic \&Va , 2747even when including a type with the name. 2748See also 2749.Sx MANUAL STRUCTURE . 2750.It Ic \&Xc 2751Close a scope opened by 2752.Ic \&Xo . 2753.It Ic \&Xo Ar block 2754Extend the header of an 2755.Ic \&It 2756macro or the body of a partial-implicit block macro 2757beyond the end of the input line. 2758This macro originally existed to work around the 9-argument limit 2759of historic 2760.Xr roff 7 . 2761.Tg Xr 2762.It Ic \&Xr Ar name section 2763Link to another manual 2764.Pq Qq cross-reference . 2765.Pp 2766Cross reference the 2767.Ar name 2768and 2769.Ar section 2770number of another man page. 2771.Pp 2772Examples: 2773.Dl \&.Xr mandoc 1 2774.Dl \&.Xr mandoc 1 \&; 2775.Dl \&.Xr mandoc 1 \&Ns s behaviour 2776.El 2777.Sh MACRO SYNTAX 2778The syntax of a macro depends on its classification. 2779In this section, 2780.Sq \-arg 2781refers to macro arguments, which may be followed by zero or more 2782.Sq parm 2783parameters; 2784.Sq \&Yo 2785opens the scope of a macro; and if specified, 2786.Sq \&Yc 2787closes it out. 2788.Pp 2789The 2790.Em Callable 2791column indicates that the macro may also be called by passing its name 2792as an argument to another macro. 2793For example, 2794.Sq \&.Op \&Fl O \&Ar file 2795produces 2796.Sq Op Fl O Ar file . 2797To prevent a macro call and render the macro name literally, 2798escape it by prepending a zero-width space, 2799.Sq \e& . 2800For example, 2801.Sq \&Op \e&Fl O 2802produces 2803.Sq Op \&Fl O . 2804If a macro is not callable but its name appears as an argument 2805to another macro, it is interpreted as opaque text. 2806For example, 2807.Sq \&.Fl \&Sh 2808produces 2809.Sq Fl \&Sh . 2810.Pp 2811The 2812.Em Parsed 2813column indicates whether the macro may call other macros by receiving 2814their names as arguments. 2815If a macro is not parsed but the name of another macro appears 2816as an argument, it is interpreted as opaque text. 2817.Pp 2818The 2819.Em Scope 2820column, if applicable, describes closure rules. 2821.Ss Block full-explicit 2822Multi-line scope closed by an explicit closing macro. 2823All macros contains bodies; only 2824.Ic \&Bf 2825and 2826.Pq optionally 2827.Ic \&Bl 2828contain a head. 2829.Bd -literal -offset indent 2830\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB 2831\(lBbody...\(rB 2832\&.Yc 2833.Ed 2834.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXX" -offset indent 2835.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope 2836.It Ic \&Bd Ta \&No Ta \&No Ta closed by Ic \&Ed 2837.It Ic \&Bf Ta \&No Ta \&No Ta closed by Ic \&Ef 2838.It Ic \&Bk Ta \&No Ta \&No Ta closed by Ic \&Ek 2839.It Ic \&Bl Ta \&No Ta \&No Ta closed by Ic \&El 2840.It Ic \&Ed Ta \&No Ta \&No Ta opened by Ic \&Bd 2841.It Ic \&Ef Ta \&No Ta \&No Ta opened by Ic \&Bf 2842.It Ic \&Ek Ta \&No Ta \&No Ta opened by Ic \&Bk 2843.It Ic \&El Ta \&No Ta \&No Ta opened by Ic \&Bl 2844.El 2845.Ss Block full-implicit 2846Multi-line scope closed by end-of-file or implicitly by another macro. 2847All macros have bodies; some 2848.Po 2849.Ic \&It Fl bullet , 2850.Fl hyphen , 2851.Fl dash , 2852.Fl enum , 2853.Fl item 2854.Pc 2855don't have heads; only one 2856.Po 2857.Ic \&It 2858in 2859.Ic \&Bl Fl column 2860.Pc 2861has multiple heads. 2862.Bd -literal -offset indent 2863\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB 2864\(lBbody...\(rB 2865.Ed 2866.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX" -offset indent 2867.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope 2868.It Ic \&It Ta \&No Ta Yes Ta closed by Ic \&It , Ic \&El 2869.It Ic \&Nd Ta \&No Ta \&No Ta closed by Ic \&Sh 2870.It Ic \&Nm Ta \&No Ta Yes Ta closed by Ic \&Nm , Ic \&Sh , Ic \&Ss 2871.It Ic \&Sh Ta \&No Ta Yes Ta closed by Ic \&Sh 2872.It Ic \&Ss Ta \&No Ta Yes Ta closed by Ic \&Sh , Ic \&Ss 2873.El 2874.Pp 2875Note that the 2876.Ic \&Nm 2877macro is a 2878.Sx Block full-implicit 2879macro only when invoked as the first macro 2880in a 2881.Em SYNOPSIS 2882section line, else it is 2883.Sx In-line . 2884.Ss Block partial-explicit 2885Like block full-explicit, but also with single-line scope. 2886Each has at least a body and, in limited circumstances, a head 2887.Po 2888.Ic \&Fo , 2889.Ic \&Eo 2890.Pc 2891and/or tail 2892.Pq Ic \&Ec . 2893.Bd -literal -offset indent 2894\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB 2895\(lBbody...\(rB 2896\&.Yc \(lBtail...\(rB 2897 2898\&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \ 2899\(lBbody...\(rB \&Yc \(lBtail...\(rB 2900.Ed 2901.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent 2902.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope 2903.It Ic \&Ac Ta Yes Ta Yes Ta opened by Ic \&Ao 2904.It Ic \&Ao Ta Yes Ta Yes Ta closed by Ic \&Ac 2905.It Ic \&Bc Ta Yes Ta Yes Ta closed by Ic \&Bo 2906.It Ic \&Bo Ta Yes Ta Yes Ta opened by Ic \&Bc 2907.It Ic \&Brc Ta Yes Ta Yes Ta opened by Ic \&Bro 2908.It Ic \&Bro Ta Yes Ta Yes Ta closed by Ic \&Brc 2909.It Ic \&Dc Ta Yes Ta Yes Ta opened by Ic \&Do 2910.It Ic \&Do Ta Yes Ta Yes Ta closed by Ic \&Dc 2911.It Ic \&Ec Ta Yes Ta Yes Ta opened by Ic \&Eo 2912.It Ic \&Eo Ta Yes Ta Yes Ta closed by Ic \&Ec 2913.It Ic \&Fc Ta Yes Ta Yes Ta opened by Ic \&Fo 2914.It Ic \&Fo Ta \&No Ta \&No Ta closed by Ic \&Fc 2915.It Ic \&Oc Ta Yes Ta Yes Ta closed by Ic \&Oo 2916.It Ic \&Oo Ta Yes Ta Yes Ta opened by Ic \&Oc 2917.It Ic \&Pc Ta Yes Ta Yes Ta closed by Ic \&Po 2918.It Ic \&Po Ta Yes Ta Yes Ta opened by Ic \&Pc 2919.It Ic \&Qc Ta Yes Ta Yes Ta opened by Ic \&Oo 2920.It Ic \&Qo Ta Yes Ta Yes Ta closed by Ic \&Oc 2921.It Ic \&Re Ta \&No Ta \&No Ta opened by Ic \&Rs 2922.It Ic \&Rs Ta \&No Ta \&No Ta closed by Ic \&Re 2923.It Ic \&Sc Ta Yes Ta Yes Ta opened by Ic \&So 2924.It Ic \&So Ta Yes Ta Yes Ta closed by Ic \&Sc 2925.It Ic \&Xc Ta Yes Ta Yes Ta opened by Ic \&Xo 2926.It Ic \&Xo Ta Yes Ta Yes Ta closed by Ic \&Xc 2927.El 2928.Ss Block partial-implicit 2929Like block full-implicit, but with single-line scope closed by the 2930end of the line. 2931.Bd -literal -offset indent 2932\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB 2933.Ed 2934.Bl -column "MacroX" "CallableX" "ParsedX" -offset indent 2935.It Em Macro Ta Em Callable Ta Em Parsed 2936.It Ic \&Aq Ta Yes Ta Yes 2937.It Ic \&Bq Ta Yes Ta Yes 2938.It Ic \&Brq Ta Yes Ta Yes 2939.It Ic \&D1 Ta \&No Ta \&Yes 2940.It Ic \&Dl Ta \&No Ta Yes 2941.It Ic \&Dq Ta Yes Ta Yes 2942.It Ic \&En Ta Yes Ta Yes 2943.It Ic \&Op Ta Yes Ta Yes 2944.It Ic \&Pq Ta Yes Ta Yes 2945.It Ic \&Ql Ta Yes Ta Yes 2946.It Ic \&Qq Ta Yes Ta Yes 2947.It Ic \&Sq Ta Yes Ta Yes 2948.It Ic \&Vt Ta Yes Ta Yes 2949.El 2950.Pp 2951Note that the 2952.Ic \&Vt 2953macro is a 2954.Sx Block partial-implicit 2955only when invoked as the first macro 2956in a 2957.Em SYNOPSIS 2958section line, else it is 2959.Sx In-line . 2960.Ss Special block macro 2961The 2962.Ic \&Ta 2963macro can only be used below 2964.Ic \&It 2965in 2966.Ic \&Bl Fl column 2967lists. 2968It delimits blocks representing table cells; 2969these blocks have bodies, but no heads. 2970.Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -offset indent 2971.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope 2972.It Ic \&Ta Ta Yes Ta Yes Ta closed by Ic \&Ta , Ic \&It 2973.El 2974.Ss In-line 2975Closed by the end of the line, fixed argument lengths, 2976and/or subsequent macros. 2977In-line macros have only text children. 2978If a number (or inequality) of arguments is 2979.Pq n , 2980then the macro accepts an arbitrary number of arguments. 2981.Bd -literal -offset indent 2982\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB 2983 2984\&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc... 2985 2986\&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN 2987.Ed 2988.Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -offset indent 2989.It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments 2990.It Ic \&%A Ta \&No Ta \&No Ta >0 2991.It Ic \&%B Ta \&No Ta \&No Ta >0 2992.It Ic \&%C Ta \&No Ta \&No Ta >0 2993.It Ic \&%D Ta \&No Ta \&No Ta >0 2994.It Ic \&%I Ta \&No Ta \&No Ta >0 2995.It Ic \&%J Ta \&No Ta \&No Ta >0 2996.It Ic \&%N Ta \&No Ta \&No Ta >0 2997.It Ic \&%O Ta \&No Ta \&No Ta >0 2998.It Ic \&%P Ta \&No Ta \&No Ta >0 2999.It Ic \&%Q Ta \&No Ta \&No Ta >0 3000.It Ic \&%R Ta \&No Ta \&No Ta >0 3001.It Ic \&%T Ta \&No Ta \&No Ta >0 3002.It Ic \&%U Ta \&No Ta \&No Ta >0 3003.It Ic \&%V Ta \&No Ta \&No Ta >0 3004.It Ic \&Ad Ta Yes Ta Yes Ta >0 3005.It Ic \&An Ta Yes Ta Yes Ta >0 3006.It Ic \&Ap Ta Yes Ta Yes Ta 0 3007.It Ic \&Ar Ta Yes Ta Yes Ta n 3008.It Ic \&At Ta Yes Ta Yes Ta 1 3009.It Ic \&Bsx Ta Yes Ta Yes Ta n 3010.It Ic \&Bt Ta \&No Ta \&No Ta 0 3011.It Ic \&Bx Ta Yes Ta Yes Ta n 3012.It Ic \&Cd Ta Yes Ta Yes Ta >0 3013.It Ic \&Cm Ta Yes Ta Yes Ta >0 3014.It Ic \&Db Ta \&No Ta \&No Ta 1 3015.It Ic \&Dd Ta \&No Ta \&No Ta n 3016.It Ic \&Dt Ta \&No Ta \&No Ta n 3017.It Ic \&Dv Ta Yes Ta Yes Ta >0 3018.It Ic \&Dx Ta Yes Ta Yes Ta n 3019.It Ic \&Em Ta Yes Ta Yes Ta >0 3020.It Ic \&Er Ta Yes Ta Yes Ta >0 3021.It Ic \&Es Ta Yes Ta Yes Ta 2 3022.It Ic \&Ev Ta Yes Ta Yes Ta >0 3023.It Ic \&Ex Ta \&No Ta \&No Ta n 3024.It Ic \&Fa Ta Yes Ta Yes Ta >0 3025.It Ic \&Fd Ta \&No Ta \&No Ta >0 3026.It Ic \&Fl Ta Yes Ta Yes Ta n 3027.It Ic \&Fn Ta Yes Ta Yes Ta >0 3028.It Ic \&Fr Ta Yes Ta Yes Ta >0 3029.It Ic \&Ft Ta Yes Ta Yes Ta >0 3030.It Ic \&Fx Ta Yes Ta Yes Ta n 3031.It Ic \&Hf Ta \&No Ta \&No Ta n 3032.It Ic \&Ic Ta Yes Ta Yes Ta >0 3033.It Ic \&In Ta Yes Ta Yes Ta 1 3034.It Ic \&Lb Ta \&No Ta \&No Ta 1 3035.It Ic \&Li Ta Yes Ta Yes Ta >0 3036.It Ic \&Lk Ta Yes Ta Yes Ta >0 3037.It Ic \&Lp Ta \&No Ta \&No Ta 0 3038.It Ic \&Ms Ta Yes Ta Yes Ta >0 3039.It Ic \&Mt Ta Yes Ta Yes Ta >0 3040.It Ic \&Nm Ta Yes Ta Yes Ta n 3041.It Ic \&No Ta Yes Ta Yes Ta >0 3042.It Ic \&Ns Ta Yes Ta Yes Ta 0 3043.It Ic \&Nx Ta Yes Ta Yes Ta n 3044.It Ic \&Os Ta \&No Ta \&No Ta n 3045.It Ic \&Ot Ta Yes Ta Yes Ta >0 3046.It Ic \&Ox Ta Yes Ta Yes Ta n 3047.It Ic \&Pa Ta Yes Ta Yes Ta n 3048.It Ic \&Pf Ta Yes Ta Yes Ta 1 3049.It Ic \&Pp Ta \&No Ta \&No Ta 0 3050.It Ic \&Rv Ta \&No Ta \&No Ta n 3051.It Ic \&Sm Ta \&No Ta \&No Ta <2 3052.It Ic \&St Ta \&No Ta Yes Ta 1 3053.It Ic \&Sx Ta Yes Ta Yes Ta >0 3054.It Ic \&Sy Ta Yes Ta Yes Ta >0 3055.It Ic \&Tg Ta \&No Ta \&No Ta <2 3056.It Ic \&Tn Ta Yes Ta Yes Ta >0 3057.It Ic \&Ud Ta \&No Ta \&No Ta 0 3058.It Ic \&Ux Ta Yes Ta Yes Ta n 3059.It Ic \&Va Ta Yes Ta Yes Ta n 3060.It Ic \&Vt Ta Yes Ta Yes Ta >0 3061.It Ic \&Xr Ta Yes Ta Yes Ta 2 3062.El 3063.Ss Delimiters 3064When a macro argument consists of one single input character 3065considered as a delimiter, the argument gets special handling. 3066This does not apply when delimiters appear in arguments containing 3067more than one character. 3068Consequently, to prevent special handling and just handle it 3069like any other argument, a delimiter can be escaped by prepending 3070a zero-width space 3071.Pq Sq \e& . 3072In text lines, delimiters never need escaping, but may be used 3073as normal punctuation. 3074.Pp 3075For many macros, when the leading arguments are opening delimiters, 3076these delimiters are put before the macro scope, 3077and when the trailing arguments are closing delimiters, 3078these delimiters are put after the macro scope. 3079Spacing is suppressed after opening delimiters 3080and before closing delimiters. 3081For example, 3082.Pp 3083.D1 Pf \. \&Aq "( [ word ] ) ." 3084.Pp 3085renders as: 3086.Pp 3087.D1 Aq ( [ word ] ) . 3088.Pp 3089Opening delimiters are: 3090.Pp 3091.Bl -tag -width Ds -offset indent -compact 3092.It \&( 3093left parenthesis 3094.It \&[ 3095left bracket 3096.El 3097.Pp 3098Closing delimiters are: 3099.Pp 3100.Bl -tag -width Ds -offset indent -compact 3101.It \&. 3102period 3103.It \&, 3104comma 3105.It \&: 3106colon 3107.It \&; 3108semicolon 3109.It \&) 3110right parenthesis 3111.It \&] 3112right bracket 3113.It \&? 3114question mark 3115.It \&! 3116exclamation mark 3117.El 3118.Pp 3119Note that even a period preceded by a backslash 3120.Pq Sq \e.\& 3121gets this special handling; use 3122.Sq \e&.\& 3123to prevent that. 3124.Pp 3125Many in-line macros interrupt their scope when they encounter 3126delimiters, and resume their scope when more arguments follow that 3127are not delimiters. 3128For example, 3129.Pp 3130.D1 Pf \. \&Fl "a ( b | c \e*(Ba d ) e" 3131.Pp 3132renders as: 3133.Pp 3134.D1 Fl a ( b | c \*(Ba d ) e 3135.Pp 3136This applies to both opening and closing delimiters, 3137and also to the middle delimiter, which does not suppress spacing: 3138.Pp 3139.Bl -tag -width Ds -offset indent -compact 3140.It \&| 3141vertical bar 3142.El 3143.Pp 3144As a special case, the predefined string \e*(Ba is handled and rendered 3145in the same way as a plain 3146.Sq \&| 3147character. 3148Using this predefined string is not recommended in new manuals. 3149.Pp 3150Appending a zero-width space 3151.Pq Sq \e& 3152to the end of an input line is also useful to prevent the interpretation 3153of a trailing period, exclamation or question mark as the end of a 3154sentence, for example when an abbreviation happens to occur 3155at the end of a text or macro input line. 3156.Ss Font handling 3157In 3158.Nm 3159documents, usage of semantic markup is recommended in order to have 3160proper fonts automatically selected; only when no fitting semantic markup 3161is available, consider falling back to 3162.Sx Physical markup 3163macros. 3164Whenever any 3165.Nm 3166macro switches the 3167.Xr roff 7 3168font mode, it will automatically restore the previous font when exiting 3169its scope. 3170Manually switching the font using the 3171.Xr roff 7 3172.Ql \ef 3173font escape sequences is never required. 3174.Sh COMPATIBILITY 3175This section provides an incomplete list of compatibility issues 3176between mandoc and GNU troff 3177.Pq Qq groff . 3178.Pp 3179The following problematic behaviour is found in groff: 3180.Pp 3181.Bl -dash -compact 3182.It 3183.Ic \&Pa 3184does not format its arguments when used in the FILES section under 3185certain list types. 3186.It 3187.Ic \&Ta 3188can only be called by other macros, but not at the beginning of a line. 3189.It 3190.Sq \ef 3191.Pq font face 3192and 3193.Sq \eF 3194.Pq font family face 3195.Sx Text Decoration 3196escapes behave irregularly when specified within line-macro scopes. 3197.It 3198Negative scaling units return to prior lines. 3199Instead, mandoc truncates them to zero. 3200.El 3201.Pp 3202The following features are unimplemented in mandoc: 3203.Pp 3204.Bl -dash -compact 3205.It 3206.Ic \&Bd Fl file Ar file 3207is unsupported for security reasons. 3208.It 3209.Ic \&Bd 3210.Fl filled 3211does not adjust the right margin, but is an alias for 3212.Ic \&Bd 3213.Fl ragged . 3214.It 3215.Ic \&Bd 3216.Fl literal 3217does not use a literal font, but is an alias for 3218.Ic \&Bd 3219.Fl unfilled . 3220.It 3221.Ic \&Bd 3222.Fl offset Cm center 3223and 3224.Fl offset Cm right 3225don't work. 3226Groff does not implement centered and flush-right rendering either, 3227but produces large indentations. 3228.El 3229.Sh SEE ALSO 3230.Xr man 1 , 3231.Xr mandoc 1 , 3232.Xr eqn 7 , 3233.Xr man 7 , 3234.Xr mandoc_char 7 , 3235.Xr roff 7 , 3236.Xr tbl 7 3237.Pp 3238The web page 3239.Lk https://mandoc.bsd.lv/mdoc/ "extended documentation for the mdoc language" 3240provides a few tutorial-style pages for beginners, an extensive style 3241guide for advanced authors, and an alphabetic index helping to choose 3242the best macros for various kinds of content. 3243.Pp 3244The manual page 3245.Lk https://man.voidlinux.org/groff_mdoc "groff_mdoc(7)" 3246contained in the 3247.Dq groff 3248package documents exactly the same language in a somewhat different style. 3249.Sh HISTORY 3250The 3251.Nm 3252language first appeared as a troff macro package in 3253.Bx 4.4 . 3254It was later significantly updated by Werner Lemberg and Ruslan Ermilov 3255in groff-1.17. 3256The standalone implementation that is part of the 3257.Xr mandoc 1 3258utility written by Kristaps Dzonsons appeared in 3259.Ox 4.6 . 3260.Sh AUTHORS 3261The 3262.Nm 3263reference was written by 3264.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . 3265