| Commit | Line | Data |
|---|---|---|
| 92d0a6a6 JR |
1 | .\" groff_mdoc.man |
| 2 | .\" | |
| 3 | .\" A complete reference of the mdoc macro package for GNU troff. | |
| 4 | .\" | |
| 5 | .\" Based on NetBSD's mdoc.samples.7, version 1.21. | |
| 6 | .\" | |
| 7 | .\" | |
| 8 | .\" Warning: You can't format this file with the old mdoc macros! | |
| 9 | .\" | |
| 10 | .\" | |
| 11 | .\" Copyright (c) 1990, 1993 | |
| 12 | .\" The Regents of the University of California. All rights reserved. | |
| 13 | .\" | |
| 14 | .\" Redistribution and use in source and binary forms, with or without | |
| 15 | .\" modification, are permitted provided that the following conditions | |
| 16 | .\" are met: | |
| 17 | .\" 1. Redistributions of source code must retain the above copyright | |
| 18 | .\" notice, this list of conditions and the following disclaimer. | |
| 19 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
| 20 | .\" notice, this list of conditions and the following disclaimer in the | |
| 21 | .\" documentation and/or other materials provided with the distribution. | |
| 465b256c JR |
22 | .\" 3. [Deleted. See |
| 23 | .\" ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change] | |
| 92d0a6a6 JR |
24 | .\" 4. Neither the name of the University nor the names of its contributors |
| 25 | .\" may be used to endorse or promote products derived from this software | |
| 26 | .\" without specific prior written permission. | |
| 27 | .\" | |
| 28 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
| 29 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 30 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 31 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
| 32 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
| 33 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
| 34 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 35 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
| 36 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
| 37 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
| 38 | .\" SUCH DAMAGE. | |
| 39 | .\" | |
| 40 | .\" @(#)mdoc.samples.7 8.2 (Berkeley) 12/30/93 | |
| 41 | .\" | |
| 42 | .\" This reference invokes every macro in the package several | |
| 43 | .\" times and is guaranteed to give a worst case performance | |
| 44 | .\" for an already extremely slow package. | |
| 45 | .\" | |
| 46 | . | |
| 4d3e9548 | 47 | .Dd January 5, 2006 |
| 92d0a6a6 JR |
48 | .Os |
| 49 | .Dt GROFF_MDOC 7 | |
| 50 | . | |
| 51 | . | |
| 52 | .Sh NAME | |
| 53 | . | |
| 54 | .Nm groff_mdoc | |
| 55 | .Nd reference for groff's mdoc implementation | |
| 56 | . | |
| 57 | . | |
| 58 | .Sh SYNOPSIS | |
| 59 | . | |
| 60 | .Nm groff Fl m Ns Cm doc Ar | |
| 61 | . | |
| 62 | . | |
| 63 | .Sh DESCRIPTION | |
| 64 | . | |
| 65 | A complete reference for writing | |
| 66 | .Ux | |
| 67 | manual pages with the | |
| 68 | .Nm \-mdoc | |
| 69 | macro package; a | |
| 70 | .Em content Ns -based | |
| 71 | and | |
| 72 | .Em domain Ns -based | |
| 73 | formatting package for | |
| 74 | .Tn GNU | |
| 75 | .Xr troff 1 . | |
| 76 | Its predecessor, the | |
| 77 | .Xr \-man 7 | |
| 78 | package, addressed page layout leaving the manipulation of fonts and other | |
| 79 | typesetting details to the individual author. | |
| 80 | In | |
| 81 | .Nm \-mdoc , | |
| 82 | page layout macros make up the | |
| 83 | .Em "page structure domain" | |
| 84 | which consists of macros for titles, section headers, displays and lists | |
| 85 | \- essentially items which affect the physical position of text on a | |
| 86 | formatted page. | |
| 87 | In addition to the page structure domain, there are two more domains, the | |
| 88 | .Em manual | |
| 89 | domain and the | |
| 90 | .Em general | |
| 91 | text domain. | |
| 92 | The general text domain is defined as macros which perform tasks such as | |
| 93 | quoting or emphasizing pieces of text. | |
| 94 | The manual domain is defined as macros that are a subset of the day to day | |
| 95 | informal language used to describe commands, routines and related | |
| 96 | .Ux | |
| 97 | files. | |
| 98 | Macros in the manual domain handle command names, command line arguments and | |
| 99 | options, function names, function parameters, pathnames, variables, cross | |
| 100 | references to other manual pages, and so on. | |
| 101 | These domain items have value for both the author and the future user of the | |
| 102 | manual page. | |
| 103 | Hopefully, the consistency gained across the manual set will provide easier | |
| 104 | translation to future documentation tools. | |
| 105 | .Pp | |
| 106 | Throughout the | |
| 107 | .Ux | |
| 108 | manual pages, a manual entry is simply referred to as a man page, regardless | |
| 109 | of actual length and without sexist intention. | |
| 110 | . | |
| 111 | . | |
| 112 | .Sh "GETTING STARTED" | |
| 113 | . | |
| 114 | The material presented in the remainder of this document is outlined | |
| 115 | as follows: | |
| 116 | . | |
| 117 | .Bl -enum -width 3n -offset indent | |
| 118 | . It | |
| 119 | . Tn "TROFF IDIOSYNCRASIES" | |
| 120 | . | |
| 121 | . Bl -tag -width 2n -compact | |
| 122 | . It "Macro Usage" | |
| 123 | . It "Passing Space Characters in an Argument" | |
| 124 | . It "Trailing Blank Space Characters" | |
| 125 | . It "Escaping Special Characters" | |
| 126 | . It "Other Possible Pitfalls" | |
| 127 | . El | |
| 128 | . | |
| 129 | . It | |
| 130 | . Tn "A MANUAL PAGE TEMPLATE" | |
| 131 | . | |
| 132 | . It | |
| 133 | . Tn "CONVENTIONS" | |
| 134 | . | |
| 135 | . It | |
| 136 | . Tn "TITLE MACROS" | |
| 137 | . | |
| 138 | . It | |
| 139 | . Tn "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" | |
| 140 | . | |
| 141 | . Bl -tag -width 2n -compact | |
| 142 | . It "What's in a Name" Ns ... | |
| 143 | . It "General Syntax" | |
| 144 | . El | |
| 145 | . | |
| 146 | . It | |
| 147 | . Tn "MANUAL DOMAIN" | |
| 148 | . | |
| 149 | . Bl -tag -width 2n -compact | |
| 150 | . It "Addresses" | |
| 151 | . It "Author Name" | |
| 152 | . It "Arguments" | |
| 153 | . It "Configuration Declarations (Section Four Only)" | |
| 154 | . It "Command Modifiers" | |
| 155 | . It "Defined Variables" | |
| 156 | . It "Errno's" | |
| 157 | . It "Environment Variables" | |
| 158 | . It "Flags" | |
| 159 | . It "Function Declarations" | |
| 160 | . It "Function Types" | |
| 161 | . It "Functions (Library Routines)" | |
| 162 | . It "Function Arguments" | |
| 163 | . It "Return Values" | |
| 164 | . It "Exit Status" | |
| 165 | . \" .It "Header File (including source code)" | |
| 166 | . It "Interactive Commands" | |
| 167 | . It "Library Names" | |
| 168 | . It "Literals" | |
| 169 | . It "Names" | |
| 170 | . It "Options" | |
| 171 | . It "Pathnames" | |
| 172 | . It "Standards" | |
| 173 | . It "Variable Types" | |
| 174 | . It "Variables" | |
| 175 | . It "Manual Page Cross References" | |
| 176 | . El | |
| 177 | . | |
| 178 | . It | |
| 179 | . Tn "GENERAL TEXT DOMAIN" | |
| 180 | . | |
| 181 | . Bl -tag -width 2n -compact | |
| 182 | . It "AT&T Macro" | |
| 183 | . It "BSD Macro" | |
| 184 | . It "NetBSD Macro" | |
| 185 | . It "FreeBSD Macro" | |
| 4d3e9548 | 186 | . It "DragonFly Macro" |
| 92d0a6a6 JR |
187 | . It "OpenBSD Macro" |
| 188 | . It "BSD/OS Macro" | |
| 189 | . It "UNIX Macro" | |
| 190 | . It "Emphasis Macro" | |
| 191 | . It "Font Mode" | |
| 192 | . It "Enclosure and Quoting Macros" | |
| 193 | . It "No-Op or Normal Text Macro" | |
| 194 | . It "No-Space Macro" | |
| 195 | . It "Section Cross References" | |
| 196 | . It "Symbolics" | |
| 197 | . It "Mathematical Symbols" | |
| 198 | . It "References and Citations" | |
| 199 | . It "Trade Names (or Acronyms and Type Names)" | |
| 200 | . It "Extended Arguments" | |
| 201 | . El | |
| 202 | . | |
| 203 | . It | |
| 204 | . Tn "PAGE STRUCTURE DOMAIN" | |
| 205 | . | |
| 206 | . Bl -tag -width 2n -compact | |
| 207 | . It "Section Headers" | |
| 208 | . It "Subsection Headers" | |
| 209 | . It "Paragraphs and Line Spacing" | |
| 210 | . It "Keeps" | |
| 211 | . It "Examples and Displays" | |
| 212 | . It "Lists and Columns" | |
| 213 | . El | |
| 214 | . | |
| 215 | . It | |
| 216 | . Tn "MISCELLANEOUS MACROS" | |
| 217 | . | |
| 218 | . It | |
| 219 | . Tn "PREDEFINED STRINGS" | |
| 220 | . | |
| 221 | . It | |
| 222 | . Tn "DIAGNOSTICS" | |
| 223 | . | |
| 224 | . It | |
| 225 | . Tn "FORMATTING WITH GROFF, TROFF, AND NROFF" | |
| 226 | . | |
| 227 | . It | |
| 228 | . Tn "FILES" | |
| 229 | . | |
| 230 | . It | |
| 231 | . Tn "SEE ALSO" | |
| 232 | . | |
| 233 | . It | |
| 234 | . Tn "BUGS" | |
| 235 | .El | |
| 236 | . | |
| 237 | .\" XXX | |
| 238 | .if t \ | |
| 239 | . ne 7 | |
| 240 | . | |
| 241 | . | |
| 242 | .Sh "TROFF IDIOSYNCRASIES" | |
| 243 | . | |
| 244 | The | |
| 245 | .Nm \-mdoc | |
| 246 | package attempts to simplify the process of writing a man page. | |
| 247 | Theoretically, one should not have to learn the tricky details of | |
| 248 | .Tn GNU | |
| 249 | .Xr troff 1 | |
| 250 | to use | |
| 251 | .Nm \-mdoc ; | |
| 252 | however, there are a few limitations which are unavoidable and best gotten | |
| 253 | out of the way. | |
| 254 | And, too, be forewarned, this package is | |
| 255 | .Em not | |
| 256 | fast. | |
| 257 | . | |
| 258 | .Ss "Macro Usage" | |
| 259 | . | |
| 260 | As in | |
| 261 | .Tn GNU | |
| 262 | .Xr troff 1 , | |
| 263 | a macro is called by placing a | |
| 264 | .Ql .\& | |
| 265 | (dot character) at the beginning of a line followed by the two-character | |
| 266 | (or three-character) name for the macro. | |
| 267 | There can be space or tab characters between the dot and the macro name. | |
| 268 | Arguments may follow the macro separated by spaces (but | |
| 269 | .Em no | |
| 270 | tabs). | |
| 271 | It is the dot character at the beginning of the line which causes | |
| 272 | .Tn GNU | |
| 273 | .Xr troff 1 | |
| 274 | to interpret the next two (or more) characters as a macro name. | |
| 275 | A single starting dot followed by nothing is ignored. | |
| 276 | To place a | |
| 277 | .Ql .\& | |
| 278 | (dot character) at the beginning of an input line in some context other than | |
| 279 | a macro invocation, precede the | |
| 280 | .Ql .\& | |
| 281 | (dot) with the | |
| 282 | .Ql \e& | |
| 283 | escape sequence which translates literally to a zero-width space, and is | |
| 284 | never displayed in the output. | |
| 285 | .Pp | |
| 286 | In general, | |
| 287 | .Tn GNU | |
| 288 | .Xr troff 1 | |
| 289 | macros accept an unlimited number of arguments (contrary to other versions | |
| 290 | of troff which can't handle more than nine arguments). | |
| 291 | In limited cases, arguments may be continued or extended on the next | |
| 292 | line (See | |
| 293 | .Sx Extended Arguments | |
| 294 | below). | |
| 295 | Almost all macros handle quoted arguments (see | |
| 296 | .Sx Passing Space Characters in an Argument | |
| 297 | below). | |
| 298 | .Pp | |
| 299 | Most of the | |
| 300 | .Nm \-mdoc | |
| 301 | general text domain and manual domain macros are special in that their | |
| 302 | argument lists are | |
| 303 | .Em parsed | |
| 304 | for callable macro names. | |
| 305 | This means an argument on the argument list which matches a general text or | |
| 306 | manual domain macro name (and which is defined to be callable) will be | |
| 307 | executed or called when it is processed. | |
| 308 | In this case the argument, although the name of a macro, is not preceded by | |
| 309 | a | |
| 310 | .Ql .\& | |
| 311 | (dot). | |
| 312 | This makes it possible to nest macros; for example the option macro, | |
| 313 | .Ql .Op , | |
| 314 | may | |
| 315 | .Em call | |
| 316 | the flag and argument macros, | |
| 317 | .Ql \&Fl | |
| 318 | and | |
| 319 | .Ql \&Ar , | |
| 320 | to specify an optional flag with an argument: | |
| 321 | . | |
| 322 | .Bl -tag -width ".Op Fl s Ar bytes" -offset indent | |
| 323 | .It Op Fl s Ar bytes | |
| 324 | is produced by | |
| 325 | .Ql ".Op Fl s Ar bytes" | |
| 326 | .El | |
| 327 | . | |
| 328 | .Pp | |
| 329 | To prevent a string from being interpreted as a macro name, precede the | |
| 330 | string with the escape sequence | |
| 331 | .Ql \e& : | |
| 332 | . | |
| 333 | .Bl -tag -width ".Op \&Fl s \&Ar bytes" -offset indent | |
| 334 | .It Op \&Fl s \&Ar bytes | |
| 335 | is produced by | |
| 336 | .Ql ".Op \e&Fl s \e&Ar bytes" | |
| 337 | .El | |
| 338 | . | |
| 339 | .Pp | |
| 340 | Here the strings | |
| 341 | .Ql \&Fl | |
| 342 | and | |
| 343 | .Ql \&Ar | |
| 344 | are not interpreted as macros. | |
| 345 | Macros whose argument lists are parsed for callable arguments are referred | |
| 346 | to as | |
| 347 | .Em parsed | |
| 348 | and macros which may be called from an argument list are referred to as | |
| 349 | .Em callable | |
| 350 | throughout this document. | |
| 351 | This is a technical | |
| 352 | .Em faux pas | |
| 353 | as almost all of the macros in | |
| 354 | .Nm \-mdoc | |
| 355 | are parsed, but as it was cumbersome to constantly refer to macros as | |
| 356 | being callable and being able to call other macros, the term parsed | |
| 357 | has been used. | |
| 358 | . | |
| 359 | .Pp | |
| 360 | In the following, we call an | |
| 361 | .Nm \-mdoc | |
| 362 | macro which starts a line (with a leading dot) a | |
| 363 | .Em command | |
| 364 | if this distinction is necessary. | |
| 365 | . | |
| 366 | .Ss "Passing Space Characters in an Argument" | |
| 367 | . | |
| 368 | Sometimes it is desirable to give as an argument a string containing one or | |
| 369 | more blank space characters, say, to specify arguments to commands which | |
| 370 | expect particular arrangement of items in the argument list. | |
| 371 | Additionally, it makes | |
| 372 | .Nm \-mdoc | |
| 373 | working faster. | |
| 374 | For example, the function command | |
| 375 | .Ql .Fn | |
| 376 | expects the first argument to be the name of a function and any remaining | |
| 377 | arguments to be function parameters. | |
| 378 | As | |
| 379 | .Tn ANSI\~C | |
| 380 | stipulates the declaration of function parameters in the parenthesized | |
| 381 | parameter list, each parameter is guaranteed to be at minimum a two word | |
| 382 | string. | |
| 383 | For example, | |
| 384 | .Fa int foo . | |
| 385 | .Pp | |
| 386 | There are two possible ways to pass an argument which contains | |
| 387 | an embedded space. | |
| 388 | One way of passing a string containing blank spaces is to use the hard or | |
| 389 | unpaddable space character | |
| 390 | .Ql \e\ , | |
| 391 | that is, a blank space preceded by the escape character | |
| 392 | .Ql \e . | |
| 393 | This method may be used with any macro but has the side effect of | |
| 394 | interfering with the adjustment of text over the length of a line. | |
| 395 | .Xr Troff | |
| 396 | sees the hard space as if it were any other printable character and cannot | |
| 397 | split the string into blank or newline separated pieces as one would expect. | |
| 398 | This method is useful for strings which are not expected to overlap a line | |
| 399 | boundary. | |
| 400 | An alternative is to use | |
| 401 | .Ql \e~ , | |
| 402 | a paddable (i.e.\& stretchable), unbreakable space (this is a | |
| 403 | .Tn GNU | |
| 404 | .Xr troff 1 | |
| 405 | extension). | |
| 406 | The second method is to enclose the string with double quotes. | |
| 407 | .Pp | |
| 408 | For example: | |
| 409 | . | |
| 410 | .Bl -tag -width ".Fn fetch char\ *str" -offset indent | |
| 411 | .It Fn fetch char\ *str | |
| 412 | is created by | |
| 413 | .Ql ".Fn fetch char\e *str" | |
| 414 | .It Fn fetch "char *str" | |
| 415 | can also be created by | |
| 416 | .Ql ".Fn fetch \*[q]char *str\*[q]" | |
| 417 | .El | |
| 418 | . | |
| 419 | .Pp | |
| 420 | If the | |
| 421 | .Ql \e | |
| 422 | before the space in the first example | |
| 423 | or double quotes in the second example | |
| 424 | were omitted, | |
| 425 | .Ql .Fn | |
| 426 | would see three arguments, and the result would be: | |
| 427 | .Pp | |
| 428 | .Dl Fn fetch char *str | |
| 429 | .Pp | |
| 430 | .\" For an example of what happens when the parameter list overlaps a newline | |
| 431 | .\" boundary, see the | |
| 432 | .\" .Sx BUGS | |
| 433 | .\" section. | |
| 434 | . | |
| 435 | .Ss "Trailing Blank Space Characters" | |
| 436 | . | |
| 437 | .Xr Troff | |
| 438 | can be confused by blank space characters at the end of a line. | |
| 439 | It is a wise preventive measure to globally remove all blank spaces | |
| 440 | from | |
| 441 | .Ao blank-space Ac Ns Ao end-of-line Ac | |
| 442 | character sequences. | |
| 443 | Should the need arise to use a blank character at the end of a line, it | |
| 444 | may be forced with an unpaddable space and the | |
| 445 | .Ql \e& | |
| 446 | escape character. | |
| 447 | For example, | |
| 448 | .Ql string\e\ \e& . | |
| 449 | . | |
| 450 | .Ss "Escaping Special Characters" | |
| 451 | . | |
| 452 | Special characters like the newline character | |
| 453 | .Ql \en | |
| 454 | are handled by replacing the | |
| 455 | .Ql \e | |
| 456 | with | |
| 457 | .Ql \ee | |
| 458 | (e.g.\& | |
| 459 | .Ql \een ) | |
| 460 | to preserve the backslash. | |
| 461 | . | |
| 462 | .Ss "Other Possible Pitfalls" | |
| 463 | . | |
| 464 | A warning is emitted when an empty input line is found outside of displays | |
| 465 | (see below). | |
| 466 | Use | |
| 467 | .Ql .sp | |
| 468 | instead. | |
| 469 | (Well, it is even better to use | |
| 470 | .Nm \-mdoc | |
| 471 | macros to avoid the usage of low-level commands.) | |
| 472 | .Pp | |
| 473 | Leading spaces will cause a break and are output directly. | |
| 474 | Avoid this behaviour if possible. | |
| 475 | Similarly, do not use more than one space character between words in an | |
| 476 | ordinary text line; contrary to other text formatters, they are | |
| 477 | .Em not | |
| 478 | replaced with a single space. | |
| 479 | .Pp | |
| 480 | You can't pass | |
| 481 | .Ql \*[q] | |
| 482 | directly as an argument. | |
| 483 | Use | |
| 484 | .Ql \e*[q] | |
| 485 | (or | |
| 486 | .Ql \e*q ) | |
| 487 | instead. | |
| 488 | .Pp | |
| 489 | By default, | |
| 490 | .Xr troff 1 | |
| 491 | inserts two space characters after a punctuation mark closing a sentence; | |
| 492 | characters like | |
| 493 | .Ql \&) | |
| 494 | or | |
| 495 | .Ql \&' | |
| 496 | are treated transparently, not influencing the sentence-ending behaviour. | |
| 497 | To change this, insert | |
| 498 | .Ql \e& | |
| 499 | before or after the dot: | |
| 500 | . | |
| 501 | .Bd -literal -offset indent | |
| 502 | The | |
| 503 | \&.Ql . | |
| 504 | character. | |
| 505 | \&.Pp | |
| 506 | The | |
| 507 | \&.Ql \e&. | |
| 508 | character. | |
| 509 | \&.Pp | |
| 510 | \&.No test . | |
| 511 | test | |
| 512 | \&.Pp | |
| 513 | \&.No test. | |
| 514 | test | |
| 515 | .Ed | |
| 516 | .Pp | |
| 517 | . | |
| 518 | gives | |
| 519 | . | |
| 520 | .Bd -filled -offset indent | |
| 521 | The | |
| 522 | .Ql . | |
| 523 | character | |
| 524 | .Pp | |
| 525 | The | |
| 526 | .Ql \&. | |
| 527 | character. | |
| 528 | .Pp | |
| 529 | .No test . | |
| 530 | test | |
| 531 | .Pp | |
| 532 | .No test. | |
| 533 | test | |
| 534 | .Ed | |
| 535 | .Pp | |
| 536 | . | |
| 537 | As can be seen in the first and third line, | |
| 538 | .Nm \-mdoc | |
| 539 | handles punctuation characters specially in macro arguments. | |
| 540 | This will be explained in section | |
| 541 | .Sx General Syntax | |
| 542 | below. | |
| 543 | In the same way, you have to protect trailing full stops of abbreviations | |
| 544 | with a trailing zero-width space: | |
| 545 | .Ql e.g.\e& . | |
| 546 | .Pp | |
| 547 | A comment in the source file of a man page can be either started with | |
| 548 | .Ql .\e" | |
| 549 | on a single line, | |
| 550 | .Ql \e" | |
| 551 | after some input, or | |
| 552 | .Ql \e# | |
| 553 | anywhere (the latter is a | |
| 554 | .Tn GNU | |
| 555 | .Xr troff 1 | |
| 556 | extension); the rest of such a line is ignored. | |
| 557 | . | |
| 558 | . | |
| 559 | .Sh "A MANUAL PAGE TEMPLATE" | |
| 560 | . | |
| 561 | The body of a man page is easily constructed from a basic template: | |
| 562 | . | |
| 563 | .Bd -literal -offset indent | |
| 564 | \&.\e" The following commands are required for all man pages. | |
| 565 | \&.Dd Month day, year | |
| 566 | \&.Os [OPERATING_SYSTEM] [version/release] | |
| 567 | \&.Dt DOCUMENT_TITLE [section number] [architecture/volume] | |
| 568 | \&.Sh NAME | |
| 569 | \&.Nm name | |
| 570 | \&.Nd one line description of name | |
| 571 | \&.\e" This next command is for sections 2 and 3 only. | |
| 572 | \&.\e" .Sh LIBRARY | |
| 573 | \&.Sh SYNOPSIS | |
| 574 | \&.Sh DESCRIPTION | |
| 575 | \&.\e" The following commands should be uncommented and | |
| 576 | \&.\e" used where appropriate. | |
| 577 | \&.\e" .Sh IMPLEMENTATION NOTES | |
| 578 | \&.\e" This next command is for sections 2, 3 and 9 function | |
| 579 | \&.\e" return values only. | |
| 580 | \&.\e" .Sh RETURN VALUES | |
| 581 | \&.\e" This next command is for sections 1, 6, 7 and 8 only. | |
| 582 | \&.\e" .Sh ENVIRONMENT | |
| 583 | \&.\e" .Sh FILES | |
| 584 | \&.\e" .Sh EXAMPLES | |
| 585 | \&.\e" This next command is for sections 1, 6, 7, 8 and 9 only | |
| 586 | \&.\e" (command return values (to shell) and | |
| 587 | \&.\e" fprintf/stderr type diagnostics). | |
| 588 | \&.\e" .Sh DIAGNOSTICS | |
| 589 | \&.\e" .Sh COMPATIBILITY | |
| 590 | \&.\e" This next command is for sections 2, 3 and 9 error | |
| 591 | \&.\e" and signal handling only. | |
| 592 | \&.\e" .Sh ERRORS | |
| 593 | \&.\e" .Sh SEE ALSO | |
| 594 | \&.\e" .Sh STANDARDS | |
| 595 | \&.\e" .Sh HISTORY | |
| 596 | \&.\e" .Sh AUTHORS | |
| 597 | \&.\e" .Sh BUGS | |
| 598 | .Ed | |
| 599 | .Pp | |
| 600 | . | |
| 601 | The first items in the template are the commands | |
| 602 | .Ql .Dd , | |
| 603 | .Ql .Os , | |
| 604 | and | |
| 605 | .Ql .Dt ; | |
| 606 | the document date, the operating system the man page or subject source is | |
| 607 | developed or modified for, and the man page title (in | |
| 608 | .Em upper case ) | |
| 609 | along with the section of the manual the page belongs in. | |
| 610 | These commands identify the page and are discussed below in | |
| 611 | .Sx TITLE MACROS . | |
| 612 | .Pp | |
| 613 | The remaining items in the template are section headers | |
| 614 | .Pf ( Li .Sh ) ; | |
| 615 | of which | |
| 616 | .Sx NAME , | |
| 617 | .Sx SYNOPSIS , | |
| 618 | and | |
| 619 | .Sx DESCRIPTION | |
| 620 | are mandatory. | |
| 621 | The headers are discussed in | |
| 622 | .Sx "PAGE STRUCTURE DOMAIN" , | |
| 623 | after presentation of | |
| 624 | .Sx "MANUAL DOMAIN" . | |
| 625 | Several content macros are used to demonstrate page layout macros; reading | |
| 626 | about content macros before page layout macros is recommended. | |
| 627 | . | |
| 628 | . | |
| 629 | .Sh CONVENTIONS | |
| 630 | . | |
| 631 | In the description of all macros below, optional arguments are put into | |
| 632 | brackets. | |
| 633 | An ellipsis | |
| 634 | .Pf ( Sq ... ) | |
| 635 | represents zero or more additional arguments. | |
| 636 | Alternative values for a parameter are separated with | |
| 637 | .Ql | . | |
| 638 | If there are alternative values for a mandatory parameter, braces are used | |
| 639 | (together with | |
| 640 | .Ql | ) | |
| 641 | to enclose the value set. | |
| 642 | Meta-variables are specified within angles. | |
| 643 | .Pp | |
| 644 | Example: | |
| 645 | . | |
| 646 | .Bl -tag -width 6n -offset indent | |
| 647 | .It Li .Xx Xo | |
| 648 | .Aq foo | |
| 649 | .Brq bar1 | bar2 | |
| 650 | .Op \-test1 Op \-test2 | \-test3 | |
| 651 | .No ... | |
| 652 | .Xc | |
| 653 | .El | |
| 654 | . | |
| 655 | .Pp | |
| 656 | Except stated explicitly, all macros are parsed and callable. | |
| 657 | .Pp | |
| 658 | Note that a macro takes effect up to the next nested macro. | |
| 659 | For example, | |
| 660 | .Ql ".Ic foo Aq bar" | |
| 661 | doesn't produce | |
| 662 | .Sq Ic "foo <bar>" | |
| 663 | but | |
| 664 | .Sq Ic foo Aq bar . | |
| 665 | Consequently, a warning message is emitted for most commands if the first | |
| 666 | argument is a macro itself since it cancels the effect of the calling | |
| 667 | command completely. | |
| 668 | Another consequence is that quoting macros never insert literal quotes; | |
| 669 | .Sq Ic "foo <bar>" | |
| 670 | has been produced by | |
| 671 | .Ql ".Ic \*[q]foo <bar>\*[q]" . | |
| 672 | .Pp | |
| 673 | Most macros have a default width value which can be used to specify a label | |
| 674 | width | |
| 675 | .Pf ( Fl width ) | |
| 676 | or offset | |
| 677 | .Pf ( Fl offset ) | |
| 678 | for the | |
| 679 | .Ql .Bl | |
| 680 | and | |
| 681 | .Ql .Bd | |
| 682 | macros. | |
| 683 | It is recommended not to use this rather obscure feature to avoid | |
| 684 | dependencies on local modifications of the | |
| 685 | .Nm \-mdoc | |
| 686 | package. | |
| 687 | . | |
| 688 | . | |
| 689 | .Sh "TITLE MACROS" | |
| 690 | . | |
| 691 | The title macros are part of the page structure domain but are presented | |
| 692 | first and separately for someone who wishes to start writing a man page | |
| 693 | yesterday. | |
| 694 | Three header macros designate the document title or manual page title, the | |
| 695 | operating system, and the date of authorship. | |
| 696 | These macros are called once at the very beginning of the document and are | |
| 697 | used to construct headers and footers only. | |
| 698 | . | |
| 699 | .Bl -tag -width 6n | |
| 700 | .It Li .Dt Xo | |
| 701 | .Op Aq document title | |
| 702 | .Op Aq section number | |
| 703 | .Op Aq volume | |
| 704 | .Xc | |
| 705 | The document title is the subject of the man page and must be in | |
| 706 | .Tn CAPITALS | |
| 707 | due to troff limitations. | |
| 708 | If omitted, | |
| 709 | .Sq Tn UNTITLED | |
| 710 | is used. | |
| 711 | The section number may be a number in the range | |
| 712 | .No 1,\~ Ns ... Ns ,\~9 | |
| 713 | or | |
| 714 | .Ql unass , | |
| 715 | .Ql draft , | |
| 716 | or | |
| 717 | .Ql paper . | |
| 718 | If it is specified, and no volume name is given, a default volume name is | |
| 719 | used. | |
| 720 | . | |
| 721 | .Pp | |
| 722 | Under | |
| 723 | .Tn \*[operating-system] , | |
| 724 | the following sections are defined: | |
| 725 | .Pp | |
| 726 | .Bl -column LOCAL -offset indent -compact | |
| 727 | .It Li 1 Ta "\*[volume-operating-system] \*[volume-ds-1]" | |
| 728 | .It Li 2 Ta "\*[volume-operating-system] \*[volume-ds-2]" | |
| 729 | .It Li 3 Ta "\*[volume-operating-system] \*[volume-ds-3]" | |
| 730 | .It Li 4 Ta "\*[volume-operating-system] \*[volume-ds-4]" | |
| 731 | .It Li 5 Ta "\*[volume-operating-system] \*[volume-ds-5]" | |
| 732 | .It Li 6 Ta "\*[volume-operating-system] \*[volume-ds-6]" | |
| 733 | .It Li 7 Ta "\*[volume-operating-system] \*[volume-ds-7]" | |
| 734 | .It Li 8 Ta "\*[volume-operating-system] \*[volume-ds-8]" | |
| 735 | .It Li 9 Ta "\*[volume-operating-system] \*[volume-ds-9]" | |
| 736 | .El | |
| 737 | .Pp | |
| 738 | . | |
| 739 | A volume name may be arbitrary or one of the following: | |
| 740 | . | |
| 741 | .Pp | |
| 742 | .Bl -column LOCAL -offset indent -compact | |
| 743 | .It Li USD Ta "\*[volume-ds-USD]" | |
| 744 | .It Li PS1 Ta "\*[volume-ds-PS1]" | |
| 745 | .It Li AMD Ta "\*[volume-ds-AMD]" | |
| 746 | .It Li SMM Ta "\*[volume-ds-SMM]" | |
| 747 | .It Li URM Ta "\*[volume-ds-URM]" | |
| 748 | .It Li PRM Ta "\*[volume-ds-PRM]" | |
| 749 | .It Li KM Ta "\*[volume-ds-KM]" | |
| 750 | .It Li IND Ta "\*[volume-ds-IND]" | |
| 751 | .It Li LOCAL Ta "\*[volume-ds-LOCAL]" | |
| 752 | .It Li CON Ta "\*[volume-ds-CON]" | |
| 753 | .El | |
| 754 | .Pp | |
| 755 | . | |
| 756 | For compatibility, | |
| 757 | .Ql MMI | |
| 758 | can be used for | |
| 759 | .Ql IND , | |
| 760 | and | |
| 761 | .Ql LOC | |
| 762 | for | |
| 763 | .Ql LOCAL . | |
| 764 | Values from the previous table will specify a new volume name. | |
| 765 | If the third parameter is a keyword designating a computer architecture, | |
| 766 | its value is prepended to the default volume name as specified by the | |
| 767 | second parameter. | |
| 768 | By default, the following architecture keywords are defined: | |
| 769 | . | |
| 770 | \# we use `No' to avoid hyphenation | |
| 771 | .Bd -ragged -offset indent | |
| 772 | .No alpha , acorn26 , acorn32 , algor , amd64 , amiga , arc , arm26 , | |
| 773 | .No arm32 , atari , bebox , cats , cesfic , cobalt , dreamcast , evbarm , | |
| 774 | .No evbmips , evbppc , evbsh3 , hp300 , hp700 , hpcmips , i386 , luna68k , | |
| 775 | .No m68k , mac68k , macppc , mips , mmeye , mvme68k , mvmeppc , netwinder , | |
| 776 | .No news68k , newsmips , next68k , ofppc , pc532 , pmax , pmppc , powerpc , | |
| 777 | .No prep , sandpoint , sgimips , sh3 , shark , sparc , sparc64 , sun3 , | |
| 778 | .No tahoe , vax , x68k , x86_64 | |
| 779 | .Ed | |
| 780 | .Pp | |
| 781 | . | |
| 782 | If the section number is neither a numeric expression in the range 1 to\~9 | |
| 783 | nor one of the above described keywords, the third parameter is used | |
| 784 | verbatim as the volume name. | |
| 785 | .Pp | |
| 786 | In the following examples, the left (which is identical to the right) and | |
| 787 | the middle part of the manual page header strings are shown. | |
| 788 | Note how | |
| 789 | .Ql \e& | |
| 790 | prevents the digit\~7 from being a valid numeric expression. | |
| 791 | . | |
| 792 | .Bd -ragged | |
| 793 | .Bl -tag -width ".Li .Dt\ FOO\ 2\ i386" -compact -offset indent | |
| 794 | .It Li ".Dt FOO 7" | |
| 795 | .Ql FOO(7) | |
| 796 | .Ql \*[volume-operating-system] \*[volume-ds-7] | |
| 797 | .It Li ".Dt FOO 7 bar" | |
| 798 | .Ql FOO(7) | |
| 799 | .Ql \*[volume-operating-system] \*[volume-ds-7] | |
| 800 | .It Li ".Dt FOO \e&7 bar" | |
| 801 | .Ql FOO(7) | |
| 802 | .Ql bar | |
| 803 | .It Li ".Dt FOO 2 i386" | |
| 804 | .Ql FOO(2) | |
| 805 | .Ql \*[volume-operating-system]/\*[volume-as-i386] \*[volume-ds-2] | |
| 806 | .It Li ".Dt FOO \*[q]\*[q] bar" | |
| 807 | .Ql FOO | |
| 808 | .Ql bar | |
| 809 | .El | |
| 810 | .Ed | |
| 811 | .Pp | |
| 812 | . | |
| 813 | Local, OS-specific additions might be found in the file | |
| 814 | .Pa mdoc.local ; | |
| 815 | look for strings named | |
| 4d3e9548 | 816 | .Ql volume\-ds\-XXX |
| 92d0a6a6 | 817 | (for the former type) and |
| 4d3e9548 | 818 | .Ql volume\-as\-XXX |
| 92d0a6a6 JR |
819 | (for the latter type); |
| 820 | .Ql XXX | |
| 821 | then denotes the keyword to be used with the | |
| 822 | .Ql .Dt | |
| 823 | macro. | |
| 824 | .Pp | |
| 825 | This macro is neither callable nor parsed. | |
| 826 | . | |
| 827 | .It Li .Os Xo | |
| 828 | .Op Aq operating system | |
| 829 | .Op Aq release | |
| 830 | .Xc | |
| 831 | If the first parameter is empty, | |
| 832 | the default | |
| 833 | .Sq Tn "\*[operating-system]" | |
| 834 | is used. | |
| 835 | This may be overridden in the local configuration file, | |
| 836 | .Pa mdoc.local . | |
| 837 | In general, the name of the operating system should be the common acronym, | |
| 838 | e.g.\& | |
| 839 | .Tn BSD | |
| 840 | or | |
| 841 | .Tn ATT . | |
| 842 | The release should be the standard release nomenclature for the system | |
| 843 | specified. | |
| 844 | In the following table, the possible second arguments for some predefined | |
| 845 | operating systems are listed. | |
| 846 | Similar to | |
| 847 | .Ql .Dt , | |
| 848 | local additions might be defined in | |
| 849 | .Pa mdoc.local ; | |
| 850 | look for strings named | |
| 4d3e9548 | 851 | .Ql operating\-system\-XXX\-YYY , |
| 92d0a6a6 JR |
852 | where |
| 853 | .Ql XXX | |
| 854 | is the acronym for the operating system and | |
| 855 | .Ql YYY | |
| 856 | the release ID. | |
| 857 | . | |
| 858 | .Bd -ragged -compact | |
| 859 | .Bl -tag -width ".No FreeBSD" -offset indent | |
| 860 | .It ATT | |
| 861 | 7th, 7, III, 3, V, V.2, V.3, V.4 | |
| 862 | .It BSD | |
| 863 | 3, 4, 4.1, 4.2, 4.3, 4.3t, 4.3T, 4.3r, 4.3R, 4.4 | |
| 864 | .It NetBSD | |
| 865 | 0.8, 0.8a, 0.9, 0.9a, 1.0, 1.0a, 1.1, 1.2, 1.2a, 1.2b, 1.2c, 1.2d, 1.2e, | |
| 866 | 1.3, 1.3a, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1, | |
| 4d3e9548 JL |
867 | 1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.1, 4.0, |
| 868 | 4.0.1 | |
| 92d0a6a6 JR |
869 | .It FreeBSD |
| 870 | 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1, | |
| 871 | 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, | |
| 4d3e9548 JL |
872 | 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1, |
| 873 | 5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1 | |
| 874 | .It DragonFly | |
| 875 | 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0 | |
| 876 | .It Darwin | |
| 877 | 8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, | |
| 878 | 8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0 | |
| 92d0a6a6 JR |
879 | .El |
| 880 | .Ed | |
| 881 | .Pp | |
| 882 | . | |
| 883 | For | |
| 884 | .Tn ATT , | |
| 885 | an unknown second parameter will be replaced with the string | |
| 886 | .Tn UNIX ; | |
| 887 | for the other predefined acronyms it will be ignored and a warning message | |
| 888 | emitted. | |
| 889 | Unrecognized arguments are displayed as given in the page footer. | |
| 890 | For instance, a typical footer might be: | |
| 891 | .Pp | |
| 892 | .Dl .Os BSD 4.3 | |
| 893 | .Pp | |
| 894 | giving | |
| 895 | .Ql 4.3\~Berkeley Distribution , | |
| 896 | or for a locally produced set | |
| 897 | .Pp | |
| 898 | .Dl .Os CS Department | |
| 899 | .Pp | |
| 900 | which will produce | |
| 901 | .Ql CS\~Department . | |
| 902 | .Pp | |
| 903 | If the | |
| 904 | .Ql .Os | |
| 905 | macro is not present, the bottom left corner of the manual page will be | |
| 906 | ugly. | |
| 907 | .Pp | |
| 908 | This macro is neither callable nor parsed. | |
| 909 | . | |
| 910 | .It Li .Dd Oo | |
| 911 | .Aq month | |
| 912 | .Aq day , | |
| 913 | .Aq year | |
| 914 | .Oc | |
| 915 | If | |
| 916 | .Ql Dd | |
| 917 | has no arguments, | |
| 918 | .Ql Epoch | |
| 919 | is used for the date string. | |
| 920 | If it has exactly three arguments, they are concatenated, separated with | |
| 921 | unbreakable space: | |
| 922 | .Pp | |
| 923 | .Dl .Dd January 25, 2001 | |
| 924 | .Pp | |
| 465b256c JR |
925 | The month's name shall not be abbreviated. |
| 926 | .Pp | |
| 927 | With any other number of arguments, the current date is used, ignoring | |
| 928 | the parameters. | |
| 92d0a6a6 JR |
929 | .Pp |
| 930 | This macro is neither callable nor parsed. | |
| 931 | .El | |
| 932 | . | |
| 933 | . | |
| 934 | .Sh "INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS" | |
| 935 | . | |
| 936 | .Ss "What's in a Name" Ns ... | |
| 937 | . | |
| 938 | The manual domain macro names are derived from the day to day informal | |
| 939 | language used to describe commands, subroutines and related files. | |
| 940 | Slightly different variations of this language are used to describe the | |
| 941 | three different aspects of writing a man page. | |
| 942 | First, there is the description of | |
| 943 | .Nm \-mdoc | |
| 944 | macro command usage. | |
| 945 | Second is the description of a | |
| 946 | .Ux | |
| 947 | command | |
| 948 | .Em with | |
| 949 | .Nm \-mdoc | |
| 950 | macros, and third, the description of a command to a user in the verbal | |
| 951 | sense; that is, discussion of a command in the text of a man page. | |
| 952 | .Pp | |
| 953 | In the first case, | |
| 954 | .Xr troff 1 | |
| 955 | macros are themselves a type of command; the general syntax for a troff | |
| 956 | command is: | |
| 957 | . | |
| 958 | .Bd -filled -offset indent | |
| 959 | .Li ".Xx argument1 argument2" ... | |
| 960 | .Ed | |
| 961 | .Pp | |
| 962 | . | |
| 963 | .Ql .Xx | |
| 964 | is a macro command, and anything following it are arguments to | |
| 965 | be processed. | |
| 966 | In the second case, the description of a | |
| 967 | .Ux | |
| 968 | command using the content macros is a bit more involved; a typical | |
| 969 | .Sx SYNOPSIS | |
| 970 | command line might be displayed as: | |
| 971 | . | |
| 972 | .Bd -filled -offset indent | |
| 973 | .Nm filter | |
| 974 | .Op Fl flag | |
| 975 | .Ao Ar infile Ac Ao Ar outfile Ac | |
| 976 | .Ed | |
| 977 | .Pp | |
| 978 | . | |
| 979 | Here, | |
| 980 | .Nm filter | |
| 981 | is the command name and the | |
| 982 | bracketed string | |
| 983 | .Fl flag | |
| 984 | is a | |
| 985 | .Em flag | |
| 986 | argument designated as optional by the option brackets. | |
| 987 | In | |
| 988 | .Nm \-mdoc | |
| 989 | terms, | |
| 990 | .Ao Ar infile Ac | |
| 991 | and | |
| 992 | .Ao Ar outfile Ac | |
| 993 | are called | |
| 994 | .Em meta arguments ; | |
| 995 | in this example, the user has to replace the meta expressions given in angle | |
| 996 | brackets with real file names. | |
| 997 | Note that in this document meta arguments are used to describe | |
| 998 | .Nm \-mdoc | |
| 999 | commands; in most man pages, meta variables are not specifically written | |
| 1000 | with angle brackets. | |
| 1001 | The macros which formatted the above example: | |
| 1002 | . | |
| 1003 | .Bd -literal -offset indent | |
| 1004 | \&.Nm filter | |
| 1005 | \&.Op Fl flag | |
| 1006 | \&.Ao Ar infile Ac Ao Ar outfile Ac | |
| 1007 | .Ed | |
| 1008 | .Pp | |
| 1009 | . | |
| 1010 | In the third case, discussion of commands and command syntax includes both | |
| 1011 | examples above, but may add more detail. | |
| 1012 | The arguments | |
| 1013 | .Ao Ar infile Ac | |
| 1014 | and | |
| 1015 | .Ao Ar outfile Ac | |
| 1016 | from the example above might be referred to as | |
| 1017 | .Em operands | |
| 1018 | or | |
| 1019 | .Em file arguments . | |
| 1020 | Some command line argument lists are quite long: | |
| 1021 | . | |
| 1022 | .Bd -ragged | |
| 1023 | .Bl -tag -width ".Nm make" -offset indent -compact | |
| 1024 | .It Nm make | |
| 1025 | .Op Fl eiknqrstv | |
| 1026 | .Op Fl D Ar variable | |
| 1027 | .Op Fl d Ar flags | |
| 1028 | .Op Fl f Ar makefile | |
| 1029 | .Op Fl I Ar directory | |
| 1030 | .Op Fl j Ar max_jobs | |
| 1031 | .Op Ar variable Ns = Ns Ar value | |
| 1032 | .Bk | |
| 1033 | .Op Ar target ... | |
| 1034 | .Ek | |
| 1035 | .El | |
| 1036 | .Ed | |
| 1037 | .Pp | |
| 1038 | . | |
| 1039 | Here one might talk about the command | |
| 1040 | .Nm make | |
| 1041 | and qualify the argument, | |
| 1042 | .Ar makefile , | |
| 1043 | as an argument to the flag, | |
| 1044 | .Fl f , | |
| 1045 | or discuss the optional file operand | |
| 1046 | .Ar target . | |
| 1047 | In the verbal context, such detail can prevent confusion, however the | |
| 1048 | .Nm \-mdoc | |
| 1049 | package does not have a macro for an argument | |
| 1050 | .Em to | |
| 1051 | a flag. | |
| 1052 | Instead the | |
| 1053 | .Ql \&Ar | |
| 1054 | argument macro is used for an operand or file argument like | |
| 1055 | .Ar target | |
| 1056 | as well as an argument to a flag like | |
| 1057 | .Ar variable . | |
| 1058 | The make command line was produced from: | |
| 1059 | . | |
| 1060 | .Bd -literal -offset indent | |
| 1061 | \&.Nm make | |
| 1062 | \&.Op Fl eiknqrstv | |
| 1063 | \&.Op Fl D Ar variable | |
| 1064 | \&.Op Fl d Ar flags | |
| 1065 | \&.Op Fl f Ar makefile | |
| 1066 | \&.Op Fl I Ar directory | |
| 1067 | \&.Op Fl j Ar max_jobs | |
| 1068 | \&.Op Ar variable Ns = Ns Ar value | |
| 1069 | \&.Bk | |
| 1070 | \&.Op Ar target ... | |
| 1071 | \&.Ek | |
| 1072 | .Ed | |
| 1073 | .Pp | |
| 1074 | . | |
| 1075 | The | |
| 1076 | .Ql .Bk | |
| 1077 | and | |
| 1078 | .Ql .Ek | |
| 1079 | macros are explained in | |
| 1080 | .Sx Keeps . | |
| 1081 | . | |
| 1082 | .Ss "General Syntax" | |
| 1083 | . | |
| 1084 | The manual domain and general text domain macros share a similar syntax with | |
| 1085 | a few minor deviations; most notably, | |
| 1086 | .Ql .Ar , | |
| 1087 | .Ql .Fl , | |
| 1088 | .Ql .Nm , | |
| 1089 | and | |
| 1090 | .Ql .Pa | |
| 1091 | differ only when called without arguments; and | |
| 1092 | .Ql .Fn | |
| 1093 | and | |
| 1094 | .Ql .Xr | |
| 1095 | impose an order on their argument lists. | |
| 1096 | All content macros are capable of recognizing and properly handling | |
| 1097 | punctuation, provided each punctuation character is separated by a leading | |
| 1098 | space. | |
| 1099 | If a command is given: | |
| 1100 | .Pp | |
| 1101 | .Dl \&.Ar sptr, ptr), | |
| 1102 | .Pp | |
| 1103 | The result is: | |
| 1104 | .Pp | |
| 1105 | .Dl Ar sptr, ptr), | |
| 1106 | .Pp | |
| 1107 | The punctuation is not recognized and all is output in the | |
| 1108 | font used by | |
| 1109 | .Ql .Ar . | |
| 1110 | If the punctuation is separated by a leading white space: | |
| 1111 | .Pp | |
| 1112 | .Dl \&.Ar "sptr , ptr ) ," | |
| 1113 | .Pp | |
| 1114 | The result is: | |
| 1115 | .Pp | |
| 1116 | .Dl Ar sptr , ptr ) , | |
| 1117 | .Pp | |
| 1118 | The punctuation is now recognized and output in the default font | |
| 1119 | distinguishing it from the argument strings. | |
| 1120 | To remove the special meaning from a punctuation character escape it with | |
| 1121 | .Ql \e& . | |
| 1122 | .Pp | |
| 1123 | The following punctuation characters are recognized by | |
| 1124 | .Nm \-mdoc : | |
| 1125 | . | |
| 1126 | .Bl -column -offset indent-two XXXXXX XXXXXX XXXXXX XXXXXX | |
| 1127 | .It Li .\& Ta Li ,\& Ta Li :\& Ta Li ;\& Ta Li (\& | |
| 1128 | .It Li )\& Ta Li [\& Ta Li ]\& Ta Li ?\& Ta Li !\& | |
| 1129 | .El | |
| 1130 | .Pp | |
| 1131 | . | |
| 1132 | .Xr Troff | |
| 1133 | is limited as a macro language, and has difficulty when presented with a | |
| 1134 | string containing a member of the mathematical, logical or quotation set: | |
| 1135 | . | |
| 1136 | .Bd -literal -offset indent-two | |
| 1137 | {+,\-,/,*,%,<,>,<=,>=,=,==,&,`,',"} | |
| 1138 | .Ed | |
| 1139 | .Pp | |
| 1140 | . | |
| 1141 | The problem is that | |
| 1142 | .Xr troff | |
| 1143 | may assume it is supposed to actually perform the operation or evaluation | |
| 1144 | suggested by the characters. | |
| 1145 | To prevent the accidental evaluation of these characters, escape them with | |
| 1146 | .Ql \e& . | |
| 1147 | Typical syntax is shown in the first content macro displayed below, | |
| 1148 | .Ql .Ad . | |
| 1149 | . | |
| 1150 | . | |
| 1151 | .Sh "MANUAL DOMAIN" | |
| 1152 | . | |
| 1153 | .Ss Addresses | |
| 1154 | . | |
| 1155 | The address macro identifies an address construct. | |
| 1156 | .Pp | |
| 1157 | .Dl Usage: .Ad Ao address Ac ... | |
| 1158 | .Pp | |
| 1159 | .Bl -tag -width ".Li .Ad\ f1\ ,\ f2\ ,\ f3\ :" -compact -offset 15n | |
| 1160 | .It Li ".Ad addr1" | |
| 1161 | .Ad addr1 | |
| 1162 | .It Li ".Ad addr1 ." | |
| 1163 | .Ad addr1 . | |
| 1164 | .It Li ".Ad addr1 , file2" | |
| 1165 | .Ad addr1 , file2 | |
| 1166 | .It Li ".Ad f1 , f2 , f3 :" | |
| 1167 | .Ad f1 , f2 , f3 : | |
| 1168 | .It Li ".Ad addr ) ) ," | |
| 1169 | .Ad addr ) ) , | |
| 1170 | .El | |
| 1171 | .Pp | |
| 1172 | . | |
| 1173 | The default width is 12n. | |
| 1174 | . | |
| 1175 | .Ss "Author Name" | |
| 1176 | . | |
| 1177 | The | |
| 1178 | .Ql .An | |
| 1179 | macro is used to specify the name of the author of the item being | |
| 1180 | documented, or the name of the author of the actual manual page. | |
| 1181 | .Pp | |
| 1182 | .Dl Usage: .An Ao author name Ac ... | |
| 1183 | .Pp | |
| 1184 | .Bl -tag -width ".Li .An\ \*[q]Joe\ Author\*[q]\ )\ )\ ," -offset 15n | |
| 1185 | .It Li ".An \*[q]Joe Author\*[q]" | |
| 1186 | .An "Joe Author" | |
| 1187 | .It Li ".An \*[q]Joe Author\*[q] ," | |
| 1188 | .An "Joe Author" , | |
| 1189 | .It Li ".An \*[q]Joe Author\*[q] Aq nobody@FreeBSD.org" | |
| 1190 | .An "Joe Author" Aq nobody@FreeBSD.org | |
| 1191 | .It Li ".An \*[q]Joe Author\*[q] ) ) ," | |
| 1192 | .An "Joe Author" ) ) , | |
| 1193 | .El | |
| 1194 | .Pp | |
| 1195 | . | |
| 1196 | The default width is 12n. | |
| 1197 | .Pp | |
| 1198 | In the | |
| 1199 | .Sx AUTHORS | |
| 1200 | section, the | |
| 1201 | .Ql .An | |
| 1202 | command causes a line break allowing each new name to appear on its own | |
| 1203 | line. | |
| 1204 | If this is not desirable, | |
| 1205 | . | |
| 1206 | .Bd -literal -offset indent | |
| 4d3e9548 | 1207 | \&.An \-nosplit |
| 92d0a6a6 JR |
1208 | .Ed |
| 1209 | .Pp | |
| 1210 | . | |
| 1211 | call will turn this off. | |
| 1212 | To turn splitting back on, write | |
| 1213 | . | |
| 1214 | .Bd -literal -offset indent | |
| 4d3e9548 | 1215 | \&.An \-split |
| 92d0a6a6 JR |
1216 | .Ed |
| 1217 | . | |
| 1218 | .Ss "Arguments" | |
| 1219 | . | |
| 1220 | The | |
| 1221 | .Li .Ar | |
| 1222 | argument macro may be used whenever an argument is referenced. | |
| 1223 | If called without arguments, the | |
| 1224 | .Sq Ar | |
| 1225 | string is output. | |
| 1226 | .Pp | |
| 1227 | .Dl Usage: .Ar Oo Ao argument Ac Oc ... | |
| 1228 | .Pp | |
| 1229 | .Bl -tag -width ".Li .Ar\ file1\ file2" -compact -offset 15n | |
| 1230 | .It Li .Ar | |
| 1231 | .Ar | |
| 1232 | .It Li ".Ar file1" | |
| 1233 | .Ar file1 | |
| 1234 | .It Li ".Ar file1 ." | |
| 1235 | .Ar file1 . | |
| 1236 | .It Li ".Ar file1 file2" | |
| 1237 | .Ar file1 file2 | |
| 1238 | .It Li ".Ar f1 f2 f3 :" | |
| 1239 | .Ar f1 f2 f3 : | |
| 1240 | .It Li ".Ar file ) ) ," | |
| 1241 | .Ar file ) ) , | |
| 1242 | .El | |
| 1243 | .Pp | |
| 1244 | . | |
| 1245 | The default width is 12n. | |
| 1246 | . | |
| 1247 | .Ss "Configuration Declaration (Section Four Only)" | |
| 1248 | . | |
| 1249 | The | |
| 1250 | .Ql .Cd | |
| 1251 | macro is used to demonstrate a | |
| 1252 | .Xr config 8 | |
| 1253 | declaration for a device interface in a section four manual. | |
| 1254 | .Pp | |
| 1255 | .Dl Usage: .Cd Ao argument Ac ... | |
| 1256 | .Pp | |
| 1257 | .Bl -tag -width ".Li .Cd\ Xdevice\ le0\ at\ scode?X" -offset 15n | |
| 1258 | .It Li ".Cd \*[q]device le0 at scode?\*[q]" | |
| 1259 | .Cd "device le0 at scode?" | |
| 1260 | .El | |
| 1261 | .Pp | |
| 1262 | In the | |
| 1263 | .Sx SYNOPSIS | |
| 1264 | section a | |
| 1265 | .Ql .Cd | |
| 1266 | command causes a line break before and after its arguments are printed. | |
| 1267 | .Pp | |
| 1268 | . | |
| 1269 | The default width is 12n. | |
| 1270 | . | |
| 1271 | .Ss "Command Modifiers" | |
| 1272 | . | |
| 1273 | The command modifier is identical to the | |
| 1274 | .Ql .Fl | |
| 1275 | (flag) command with the exception that the | |
| 1276 | .Ql .Cm | |
| 1277 | macro does not assert a dash in front of every argument. | |
| 1278 | Traditionally flags are marked by the preceding dash, however, some commands | |
| 1279 | or subsets of commands do not use them. | |
| 1280 | Command modifiers may also be specified in conjunction with interactive | |
| 1281 | commands such as editor commands. | |
| 1282 | See | |
| 1283 | .Sx Flags . | |
| 1284 | .Pp | |
| 1285 | The default width is 10n. | |
| 1286 | . | |
| 1287 | .Ss "Defined Variables" | |
| 1288 | . | |
| 1289 | A variable (or constant) which is defined in an include file | |
| 1290 | is specified by the macro | |
| 1291 | .Ql .Dv . | |
| 1292 | .Pp | |
| 1293 | .Dl Usage: .Dv Ao defined variable Ac ... | |
| 1294 | .Pp | |
| 1295 | .Bl -tag -width ".Li .Dv\ MAXHOSTNAMELEN" -compact -offset 15n | |
| 1296 | .It Li ".Dv MAXHOSTNAMELEN" | |
| 1297 | .Dv MAXHOSTNAMELEN | |
| 1298 | .It Li ".Dv TIOCGPGRP )" | |
| 1299 | .Dv TIOCGPGRP ) | |
| 1300 | .El | |
| 1301 | .Pp | |
| 1302 | . | |
| 1303 | The default width is 12n. | |
| 1304 | . | |
| 1305 | .Ss Errno's | |
| 1306 | . | |
| 1307 | The | |
| 1308 | .Ql .Er | |
| 1309 | errno macro specifies the error return value for section 2, 3, and\~9 library | |
| 1310 | routines. | |
| 1311 | The second example below shows | |
| 1312 | .Ql .Er | |
| 1313 | used with the | |
| 1314 | .Ql .Bq | |
| 1315 | general text domain macro, as it would be used in a section two manual page. | |
| 1316 | .Pp | |
| 1317 | .Dl Usage: .Er Ao errno type Ac ... | |
| 1318 | .Pp | |
| 1319 | .Bl -tag -width ".Li .Bq\ Er\ ENOTDIR" -compact -offset 15n | |
| 1320 | .It Li ".Er ENOENT" | |
| 1321 | .Er ENOENT | |
| 1322 | .It Li ".Er ENOENT ) ;" | |
| 1323 | .Er ENOENT ) ; | |
| 1324 | .It Li ".Bq Er ENOTDIR" | |
| 1325 | .Bq Er ENOTDIR | |
| 1326 | .El | |
| 1327 | .Pp | |
| 1328 | . | |
| 1329 | The default width is 17n. | |
| 1330 | . | |
| 1331 | .Ss "Environment Variables" | |
| 1332 | . | |
| 1333 | The | |
| 1334 | .Ql .Ev | |
| 1335 | macro specifies an environment variable. | |
| 1336 | .Pp | |
| 1337 | .Dl Usage: .Ev Ao argument Ac ... | |
| 1338 | .Pp | |
| 1339 | .Bl -tag -width ".Li .Ev\ PRINTER\ )\ )\ ," -compact -offset 15n | |
| 1340 | .It Li ".Ev DISPLAY" | |
| 1341 | .Ev DISPLAY | |
| 1342 | .It Li ".Ev PATH ." | |
| 1343 | .Ev PATH . | |
| 1344 | .It Li ".Ev PRINTER ) ) ," | |
| 1345 | .Ev PRINTER ) ) , | |
| 1346 | .El | |
| 1347 | .Pp | |
| 1348 | . | |
| 1349 | The default width is 15n. | |
| 1350 | . | |
| 1351 | .Ss Flags | |
| 1352 | . | |
| 1353 | The | |
| 1354 | .Ql .Fl | |
| 1355 | macro handles command line flags. | |
| 1356 | It prepends a dash, | |
| 1357 | .Ql \- , | |
| 1358 | to the flag. | |
| 1359 | For interactive command flags, which are not prepended with a dash, the | |
| 1360 | .Ql .Cm | |
| 1361 | (command modifier) | |
| 1362 | macro is identical, but without the dash. | |
| 1363 | .Pp | |
| 1364 | .Dl Usage: .Fl Ao argument Ac ... | |
| 1365 | .Pp | |
| 1366 | .Bl -tag -width ".Li .Fl\ xyz\ )\ ," -compact -offset 15n | |
| 1367 | .It Li .Fl | |
| 1368 | .Fl | |
| 1369 | .It Li ".Fl cfv" | |
| 1370 | .Fl cfv | |
| 1371 | .It Li ".Fl cfv ." | |
| 1372 | .Fl cfv . | |
| 1373 | .It Li ".Cm cfv ." | |
| 1374 | .Cm cfv . | |
| 1375 | .It Li ".Fl s v t" | |
| 1376 | .Fl s v t | |
| 1377 | .It Li ".Fl \- ," | |
| 1378 | .Fl \- , | |
| 1379 | .It Li ".Fl xyz ) ," | |
| 1380 | .Fl xyz ) , | |
| 1381 | .It Li ".Fl |" | |
| 1382 | .Fl | | |
| 1383 | .El | |
| 1384 | .Pp | |
| 1385 | The | |
| 1386 | .Ql .Fl | |
| 1387 | macro without any arguments results in a dash representing stdin/stdout. | |
| 1388 | Note that giving | |
| 1389 | .Ql .Fl | |
| 1390 | a single dash will result in two dashes. | |
| 1391 | .Pp | |
| 1392 | The default width is 12n. | |
| 1393 | . | |
| 1394 | .Ss "Function Declarations" | |
| 1395 | . | |
| 1396 | The | |
| 1397 | .Ql .Fd | |
| 1398 | macro is used in the | |
| 1399 | .Sx SYNOPSIS | |
| 1400 | section with section two or three functions. | |
| 1401 | It is neither callable nor parsed. | |
| 1402 | .Pp | |
| 1403 | .Dl Usage: .Fd Ao argument Ac ... | |
| 1404 | .Pp | |
| 1405 | .Bl -tag -width ".Li .Fd\ X#include\ <sys/types.h>X" -compact -offset 15n | |
| 1406 | .It Li ".Fd \*[q]#include <sys/types.h>\*[q]" | |
| 1407 | .Fd "#include <sys/types.h>" | |
| 1408 | .El | |
| 1409 | .Pp | |
| 1410 | In the | |
| 1411 | .Sx SYNOPSIS | |
| 1412 | section a | |
| 1413 | .Ql .Fd | |
| 1414 | command causes a line break if a function has already been presented and a | |
| 1415 | break has not occurred. | |
| 1416 | This leaves a nice vertical space in between the previous function call and | |
| 1417 | the declaration for the next function. | |
| 1418 | . | |
| 1419 | .Pp | |
| 1420 | The | |
| 1421 | .Ql .In | |
| 1422 | macro, while in the | |
| 1423 | .Sx SYNOPSIS | |
| 1424 | section, represents the | |
| 1425 | .Li #include | |
| 1426 | statement, and is the short form of the above example. | |
| 1427 | It specifies the C\~header file as being included in a C\~program. | |
| 1428 | It also causes a line break. | |
| 1429 | .Pp | |
| 1430 | While not in the | |
| 1431 | .Sx SYNOPSIS | |
| 1432 | section, it represents the header file enclosed in angle brackets. | |
| 1433 | .Pp | |
| 1434 | .Dl Usage: .In Ao header file Ac | |
| 1435 | .Pp | |
| 1436 | .Bl -tag -width ".Li .In\ stdio.h" -compact -offset 15n | |
| 1437 | .nr in-synopsis-section 1 | |
| 1438 | .It Li ".In stdio.h" | |
| 1439 | .In stdio.h | |
| 1440 | .nr in-synopsis-section 0 | |
| 1441 | .It Li ".In stdio.h" | |
| 1442 | .In stdio.h | |
| 1443 | .El | |
| 1444 | . | |
| 1445 | .Ss "Function Types" | |
| 1446 | . | |
| 1447 | This macro is intended for the | |
| 1448 | .Sx SYNOPSIS | |
| 1449 | section. | |
| 1450 | It may be used anywhere else in the man page without problems, but its main | |
| 1451 | purpose is to present the function type in kernel normal form for the | |
| 1452 | .Sx SYNOPSIS | |
| 1453 | of sections two and three (it causes a line break, allowing the function | |
| 1454 | name to appear on the next line). | |
| 1455 | .Pp | |
| 1456 | .Dl Usage: .Ft Ao type Ac ... | |
| 1457 | .Pp | |
| 1458 | .Bl -tag -width ".Li .Ft\ struct\ stat" -compact -offset 15n | |
| 1459 | .It Li ".Ft struct stat" | |
| 1460 | .Ft struct stat | |
| 1461 | .El | |
| 1462 | . | |
| 1463 | .Ss "Functions (Library Routines)" | |
| 1464 | . | |
| 1465 | The | |
| 1466 | .Ql .Fn | |
| 1467 | macro is modeled on | |
| 1468 | .Tn ANSI\~C | |
| 1469 | conventions. | |
| 1470 | .Pp | |
| 1471 | .Dl Usage: .Fn Ao function Ac Oo Ao parameter Ac Oc ... | |
| 1472 | .Pp | |
| 1473 | .Bl -tag -width ".Li .Fn\ align\ Xchar\ *ptrX\ ," -compact -offset 15n | |
| 1474 | .It Li ".Fn getchar" | |
| 1475 | .Fn getchar | |
| 1476 | .It Li ".Fn strlen ) ," | |
| 1477 | .Fn strlen ) , | |
| 1478 | .It Li ".Fn align \*[q]char *ptr\*[q] ," | |
| 1479 | .Fn align "char *ptr" , | |
| 1480 | .El | |
| 1481 | .Pp | |
| 1482 | Note that any call to another macro signals the end of the | |
| 1483 | .Ql .Fn | |
| 1484 | call (it will insert a closing parenthesis at that point). | |
| 1485 | .Pp | |
| 1486 | For functions with many parameters (which is rare), the macros | |
| 1487 | .Ql .Fo | |
| 1488 | (function open) | |
| 1489 | and | |
| 1490 | .Ql .Fc | |
| 1491 | (function close) | |
| 1492 | may be used with | |
| 1493 | .Ql .Fa | |
| 1494 | (function argument). | |
| 1495 | .Pp | |
| 1496 | Example: | |
| 1497 | . | |
| 1498 | .Bd -literal -offset indent | |
| 1499 | \&.Ft int | |
| 1500 | \&.Fo res_mkquery | |
| 1501 | \&.Fa "int op" | |
| 1502 | \&.Fa "char *dname" | |
| 1503 | \&.Fa "int class" | |
| 1504 | \&.Fa "int type" | |
| 1505 | \&.Fa "char *data" | |
| 1506 | \&.Fa "int datalen" | |
| 1507 | \&.Fa "struct rrec *newrr" | |
| 1508 | \&.Fa "char *buf" | |
| 1509 | \&.Fa "int buflen" | |
| 1510 | \&.Fc | |
| 1511 | .Ed | |
| 1512 | .Pp | |
| 1513 | . | |
| 1514 | Produces: | |
| 1515 | . | |
| 1516 | .Bd -ragged -offset indent | |
| 1517 | .Ft int | |
| 1518 | .Fo res_mkquery | |
| 1519 | .Fa "int op" | |
| 1520 | .Fa "char *dname" | |
| 1521 | .Fa "int class" | |
| 1522 | .Fa "int type" | |
| 1523 | .Fa "char *data" | |
| 1524 | .Fa "int datalen" | |
| 1525 | .Fa "struct rrec *newrr" | |
| 1526 | .Fa "char *buf" | |
| 1527 | .Fa "int buflen" | |
| 1528 | .Fc | |
| 1529 | .Ed | |
| 1530 | .Pp | |
| 1531 | . | |
| 1532 | In the | |
| 1533 | .Sx SYNOPSIS | |
| 1534 | section, the function will always begin at the beginning of line. | |
| 1535 | If there is more than one function presented in the | |
| 1536 | .Sx SYNOPSIS | |
| 1537 | section and a function type has not been given, a line break will occur, | |
| 1538 | leaving a nice vertical space between the current function name and the one | |
| 1539 | prior. | |
| 1540 | .Pp | |
| 1541 | The default width values of | |
| 1542 | .Ql .Fn | |
| 1543 | and | |
| 1544 | .Ql .Fo | |
| 1545 | are 12n and 16n, respectively. | |
| 1546 | . | |
| 1547 | .Ss "Function Arguments" | |
| 1548 | . | |
| 1549 | The | |
| 1550 | .Ql .Fa | |
| 1551 | macro is used to refer to function arguments (parameters) outside of the | |
| 1552 | .Sx SYNOPSIS | |
| 1553 | section of the manual or inside the | |
| 1554 | .Sx SYNOPSIS | |
| 1555 | section if the enclosure macros | |
| 1556 | .Ql .Fo | |
| 1557 | and | |
| 1558 | .Ql .Fc | |
| 1559 | instead of | |
| 1560 | .Ql .Fn | |
| 1561 | are used. | |
| 1562 | .Ql .Fa | |
| 1563 | may also be used to refer to structure members. | |
| 1564 | .Pp | |
| 1565 | .Dl Usage: .Fa Ao function argument Ac ... | |
| 1566 | .Pp | |
| 1567 | .Bl -tag -width ".Li .Fa\ d_namlen\ )\ )\ ," -compact -offset 15n | |
| 1568 | .It Li ".Fa d_namlen ) ) ," | |
| 1569 | .Fa d_namlen ) ) , | |
| 1570 | .It Li ".Fa iov_len" | |
| 1571 | .Fa iov_len | |
| 1572 | .El | |
| 1573 | .Pp | |
| 1574 | . | |
| 1575 | The default width is 12n. | |
| 1576 | . | |
| 1577 | .Ss "Return Values" | |
| 1578 | . | |
| 1579 | The | |
| 1580 | .Ql .Rv | |
| 1581 | macro generates text for use in the | |
| 1582 | .Sx RETURN VALUES | |
| 1583 | section. | |
| 1584 | .Pp | |
| 4d3e9548 | 1585 | .Dl Usage: .Rv Oo \-std Oc Op Ao function Ac ... |
| 92d0a6a6 JR |
1586 | .Pp |
| 1587 | For example, | |
| 4d3e9548 | 1588 | .Ql ".Rv \-std atexit" |
| 92d0a6a6 JR |
1589 | produces: |
| 1590 | . | |
| 1591 | .Bd -ragged -offset -indent | |
| 1592 | \# a small hack to suppress a warning message | |
| 1593 | .ds section-old "\*[section] | |
| 1594 | .ds section 3 | |
| 1595 | .Rv -std atexit | |
| 1596 | .ds section "\*[section-old] | |
| 1597 | .Ed | |
| 1598 | .Pp | |
| 1599 | . | |
| 1600 | The | |
| 1601 | .Fl std | |
| 1602 | option is valid only for manual page sections\~2 and\~3. | |
| 1603 | Currently, this macro does nothing if used without the | |
| 1604 | .Fl std | |
| 1605 | flag. | |
| 1606 | . | |
| 1607 | .Ss "Exit Status" | |
| 1608 | . | |
| 1609 | The | |
| 1610 | .Ql .Ex | |
| 1611 | macro generates text for use in the | |
| 1612 | .Sx DIAGNOSTICS | |
| 1613 | section. | |
| 1614 | .Pp | |
| 4d3e9548 | 1615 | .Dl Usage: .Ex Oo \-std Oc Op Ao utility Ac ... |
| 92d0a6a6 JR |
1616 | .Pp |
| 1617 | For example, | |
| 4d3e9548 | 1618 | .Ql ".Ex \-std cat" |
| 92d0a6a6 JR |
1619 | produces: |
| 1620 | . | |
| 1621 | .Bd -ragged -offset -indent | |
| 1622 | \# a small hack to suppress a warning message | |
| 1623 | .ds section-old "\*[section] | |
| 1624 | .ds section 1 | |
| 1625 | .Ex -std cat | |
| 1626 | .ds section "\*[section-old] | |
| 1627 | .Ed | |
| 1628 | .Pp | |
| 1629 | . | |
| 1630 | The | |
| 1631 | .Fl std | |
| 1632 | option is valid only for manual page sections 1, 6 and\~8. | |
| 1633 | Currently, this macro does nothing if used without the | |
| 1634 | .Fl std | |
| 1635 | flag. | |
| 1636 | . | |
| 1637 | .Ss "Interactive Commands" | |
| 1638 | . | |
| 1639 | The | |
| 1640 | .Ql .Ic | |
| 1641 | macro designates an interactive or internal command. | |
| 1642 | .Pp | |
| 1643 | .Dl Usage: .Ic Ao argument Ac ... | |
| 1644 | .Pp | |
| 1645 | .Bl -tag -width ".Li .Ic\ setenv\ ,\ unsetenv" -compact -offset 15n | |
| 1646 | .It Li ".Ic :wq" | |
| 1647 | .Ic :wq | |
| 1648 | .It Li ".Ic \*[q]do while {...}\*[q]" | |
| 1649 | .Ic "do while {...}" | |
| 1650 | .It Li ".Ic setenv , unsetenv" | |
| 1651 | .Ic setenv , unsetenv | |
| 1652 | .El | |
| 1653 | .Pp | |
| 1654 | . | |
| 1655 | The default width is 12n. | |
| 1656 | . | |
| 1657 | .Ss "Library Names" | |
| 1658 | . | |
| 1659 | The | |
| 1660 | .Ql .Lb | |
| 1661 | macro is used to specify the library where a particular function is compiled | |
| 1662 | in. | |
| 1663 | .Pp | |
| 1664 | .Dl Usage: .Lb Ao argument Ac ... | |
| 1665 | .Pp | |
| 1666 | Available arguments to | |
| 1667 | .Ql .Lb | |
| 1668 | and their results are: | |
| 1669 | . | |
| 1670 | .Pp | |
| 1671 | .Bl -tag -width ".Li libossaudio" -compact -offset indent | |
| 1672 | .It Li libarm | |
| 1673 | .Lb libarm | |
| 1674 | .It Li libarm32 | |
| 1675 | .Lb libarm32 | |
| 1676 | .It Li libc | |
| 1677 | .Lb libc | |
| 1678 | .It Li libcdk | |
| 1679 | .Lb libcdk | |
| 1680 | .It Li libcompat | |
| 1681 | .Lb libcompat | |
| 1682 | .It Li libcrypt | |
| 1683 | .Lb libcrypt | |
| 1684 | .It Li libcurses | |
| 1685 | .Lb libcurses | |
| 1686 | .It Li libedit | |
| 1687 | .Lb libedit | |
| 92d0a6a6 JR |
1688 | .It Li libevent |
| 1689 | .Lb libevent | |
| 1690 | .It Li libform | |
| 1691 | .Lb libform | |
| 1692 | .It Li libi386 | |
| 1693 | .Lb libi386 | |
| 1694 | .It Li libintl | |
| 1695 | .Lb libintl | |
| 1696 | .It Li libipsec | |
| 1697 | .Lb libipsec | |
| 1698 | .It Li libkvm | |
| 1699 | .Lb libkvm | |
| 1700 | .It Li libm | |
| 1701 | .Lb libm | |
| 1702 | .It Li libm68k | |
| 1703 | .Lb libm68k | |
| 1704 | .It Li libmagic | |
| 1705 | .Lb libmagic | |
| 1706 | .It Li libmenu | |
| 1707 | .Lb libmenu | |
| 1708 | .It Li libossaudio | |
| 1709 | .Lb libossaudio | |
| 465b256c JR |
1710 | .It Li libpam |
| 1711 | .Lb libpam | |
| 92d0a6a6 JR |
1712 | .It Li libpcap |
| 1713 | .Lb libpcap | |
| 1714 | .It Li libpci | |
| 1715 | .Lb libpci | |
| 1716 | .It Li libpmc | |
| 1717 | .Lb libpmc | |
| 1718 | .It Li libposix | |
| 1719 | .Lb libposix | |
| 1720 | .It Li libpthread | |
| 1721 | .Lb libpthread | |
| 1722 | .It Li libresolv | |
| 1723 | .Lb libresolv | |
| 1724 | .It Li librt | |
| 1725 | .Lb librt | |
| 1726 | .It Li libtermcap | |
| 1727 | .Lb libtermcap | |
| 1728 | .It Li libusbhid | |
| 1729 | .Lb libusbhid | |
| 1730 | .It Li libutil | |
| 1731 | .Lb libutil | |
| 1732 | .It Li libx86_64 | |
| 1733 | .Lb libx86_64 | |
| 1734 | .It Li libz | |
| 1735 | .Lb libz | |
| 1736 | .El | |
| 1737 | .Pp | |
| 1738 | . | |
| 1739 | Local, OS-specific additions might be found in the file | |
| 1740 | .Pa mdoc.local ; | |
| 1741 | look for strings named | |
| 4d3e9548 | 1742 | .Ql str\-Lb\-XXX . |
| 92d0a6a6 JR |
1743 | .Ql XXX |
| 1744 | then denotes the keyword to be used with the | |
| 1745 | .Ql .Lb | |
| 1746 | macro. | |
| 1747 | .Pp | |
| 1748 | In the | |
| 1749 | .Sx LIBRARY | |
| 1750 | section an | |
| 1751 | .Ql .Lb | |
| 1752 | command causes a line break before and after its arguments are printed. | |
| 1753 | .Pp | |
| 1754 | . | |
| 1755 | .Ss Literals | |
| 1756 | . | |
| 1757 | The | |
| 1758 | .Ql .Li | |
| 1759 | literal macro may be used for special characters, variable constants, etc.\& | |
| 4d3e9548 | 1760 | \- anything which should be displayed as it would be typed. |
| 92d0a6a6 JR |
1761 | .Pp |
| 1762 | .Dl Usage: .Li Ao argument Ac ... | |
| 1763 | .Pp | |
| 4d3e9548 | 1764 | .Bl -tag -width ".Li .Li\ cntrl\-D\ )\ ," -compact -offset 15n |
| 92d0a6a6 JR |
1765 | .It Li ".Li \een" |
| 1766 | .Li \en | |
| 1767 | .It Li ".Li M1 M2 M3 ;" | |
| 1768 | .Li M1 M2 M3 ; | |
| 4d3e9548 | 1769 | .It Li ".Li cntrl\-D ) ," |
| 92d0a6a6 JR |
1770 | .Li cntrl-D ) , |
| 1771 | .It Li ".Li 1024 ..." | |
| 1772 | .Li 1024 ... | |
| 1773 | .El | |
| 1774 | .Pp | |
| 1775 | . | |
| 1776 | The default width is 16n. | |
| 1777 | . | |
| 1778 | .Ss Names | |
| 1779 | . | |
| 1780 | The | |
| 1781 | .Ql .Nm | |
| 1782 | macro is used for the document title or subject name. | |
| 1783 | It has the peculiarity of remembering the first argument it was called with, | |
| 1784 | which should always be the subject name of the page. | |
| 1785 | When called without arguments, | |
| 1786 | .Ql .Nm | |
| 1787 | regurgitates this initial name for the sole purpose of making less work for | |
| 1788 | the author. | |
| 1789 | Note: A section two or three document function name is addressed with the | |
| 1790 | .Ql .Nm | |
| 1791 | in the | |
| 1792 | .Sx NAME | |
| 1793 | section, and with | |
| 1794 | .Ql .Fn | |
| 1795 | in the | |
| 1796 | .Sx SYNOPSIS | |
| 1797 | and remaining sections. | |
| 1798 | For interactive commands, such as the | |
| 1799 | .Ql while | |
| 1800 | command keyword in | |
| 1801 | .Xr csh 1 , | |
| 1802 | the | |
| 1803 | .Ql .Ic | |
| 1804 | macro should be used. | |
| 1805 | While | |
| 1806 | .Ql .Ic | |
| 1807 | is nearly identical | |
| 1808 | to | |
| 1809 | .Ql .Nm , | |
| 1810 | it can not recall the first argument it was invoked with. | |
| 1811 | .Pp | |
| 1812 | .Dl Usage: .Nm Oo Ao argument Ac Oc ... | |
| 1813 | .Pp | |
| 1814 | .Bl -tag -width ".Li .Nm\ groff_mdoc" -compact -offset 15n | |
| 1815 | .It Li ".Nm groff_mdoc" | |
| 1816 | .Nm groff_mdoc | |
| 4d3e9548 | 1817 | .It Li ".Nm \e\-mdoc" |
| 92d0a6a6 JR |
1818 | .Nm \-mdoc |
| 1819 | .It Li ".Nm foo ) ) ," | |
| 1820 | .Nm foo ) ) , | |
| 1821 | .It Li ".Nm :" | |
| 1822 | .Nm : | |
| 1823 | .El | |
| 1824 | .Pp | |
| 1825 | . | |
| 1826 | The default width is 10n. | |
| 1827 | . | |
| 1828 | .Ss Options | |
| 1829 | . | |
| 1830 | The | |
| 1831 | .Ql .Op | |
| 1832 | macro places option brackets around any remaining arguments on the | |
| 1833 | command line, and places any trailing punctuation outside the brackets. | |
| 1834 | The macros | |
| 1835 | .Ql .Oo | |
| 1836 | and | |
| 1837 | .Ql .Oc | |
| 1838 | (which produce an opening and a closing option bracket respectively) may be used | |
| 1839 | across one or more lines or to specify the exact position of the closing | |
| 1840 | parenthesis. | |
| 1841 | .Pp | |
| 1842 | .Dl Usage: .Op Oo Ao option Ac Oc ... | |
| 1843 | .Pp | |
| 1844 | .Bl -tag -width ".Li .Op\ Fl\ c\ Ar\ objfil\ Op\ Ar\ corfil\ ," -compact -offset 15n | |
| 1845 | .It Li .Op | |
| 1846 | .Op | |
| 1847 | .It Li ".Op Fl k" | |
| 1848 | .Op Fl k | |
| 1849 | .It Li ".Op Fl k ) ." | |
| 1850 | .Op Fl k ) . | |
| 1851 | .It Li ".Op Fl k Ar kookfile" | |
| 1852 | .Op Fl k Ar kookfile | |
| 1853 | .It Li ".Op Fl k Ar kookfile ," | |
| 1854 | .Op Fl k Ar kookfile , | |
| 1855 | .It Li ".Op Ar objfil Op Ar corfil" | |
| 1856 | .Op Ar objfil Op Ar corfil | |
| 1857 | .It Li ".Op Fl c Ar objfil Op Ar corfil ," | |
| 1858 | .Op Fl c Ar objfil Op Ar corfil , | |
| 1859 | .It Li ".Op word1 word2" | |
| 1860 | .Op word1 word2 | |
| 1861 | .It Li ".Li .Op Oo Ao option Ac Oc ..." | |
| 465b256c | 1862 | .Li .Op Oo Ao option Ac Oc ... |
| 92d0a6a6 JR |
1863 | .El |
| 1864 | .Pp | |
| 1865 | Here a typical example of the | |
| 1866 | .Ql .Oo | |
| 1867 | and | |
| 1868 | .Ql .Oc | |
| 1869 | macros: | |
| 1870 | . | |
| 1871 | .Bd -literal -offset indent | |
| 1872 | \&.Oo | |
| 1873 | \&.Op Fl k Ar kilobytes | |
| 1874 | \&.Op Fl i Ar interval | |
| 1875 | \&.Op Fl c Ar count | |
| 1876 | \&.Oc | |
| 1877 | .Ed | |
| 1878 | .Pp | |
| 1879 | . | |
| 1880 | Produces: | |
| 1881 | . | |
| 1882 | .Bd -filled -offset indent | |
| 1883 | .Oo | |
| 1884 | .Op Fl k Ar kilobytes | |
| 1885 | .Op Fl i Ar interval | |
| 1886 | .Op Fl c Ar count | |
| 1887 | .Oc | |
| 1888 | .Ed | |
| 1889 | .Pp | |
| 1890 | . | |
| 1891 | The default width values of | |
| 1892 | .Ql .Op | |
| 1893 | and | |
| 1894 | .Ql .Oo | |
| 1895 | are 14n and 10n, respectively. | |
| 1896 | . | |
| 1897 | .Ss Pathnames | |
| 1898 | . | |
| 1899 | The | |
| 1900 | .Ql .Pa | |
| 1901 | macro formats path or file names. | |
| 1902 | If called without arguments, the | |
| 1903 | .Sq Pa | |
| 1904 | string is output, which represents the current user's home directory. | |
| 1905 | .Pp | |
| 1906 | .Dl Usage: .Pa Oo Ao pathname Ac Oc ... | |
| 1907 | .Pp | |
| 1908 | .Bl -tag -width ".Li .Pa\ /tmp/fooXXXXX\ )\ ." -compact -offset 15n | |
| 1909 | .It Li .Pa | |
| 1910 | .Pa | |
| 1911 | .It Li ".Pa /usr/share" | |
| 1912 | .Pa /usr/share | |
| 1913 | .It Li ".Pa /tmp/fooXXXXX ) ." | |
| 1914 | .Pa /tmp/fooXXXXX ) . | |
| 1915 | .El | |
| 1916 | .Pp | |
| 1917 | . | |
| 1918 | The default width is 32n. | |
| 1919 | . | |
| 1920 | .Ss Standards | |
| 1921 | . | |
| 1922 | The | |
| 1923 | .Ql .St | |
| 1924 | macro replaces standard abbreviations with their formal names. | |
| 1925 | .Pp | |
| 1926 | .Dl Usage: .St Ao abbreviation Ac ... | |
| 1927 | .Pp | |
| 1928 | Available pairs for | |
| 1929 | .Dq Abbreviation/Formal Name | |
| 1930 | are: | |
| 1931 | . | |
| 1932 | .Pp | |
| 1933 | .Tn ANSI/ISO C | |
| 1934 | .Pp | |
| 4d3e9548 JL |
1935 | .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent |
| 1936 | .It Li \-ansiC | |
| 92d0a6a6 | 1937 | .St -ansiC |
| 4d3e9548 | 1938 | .It Li \-ansiC\-89 |
| 92d0a6a6 | 1939 | .St -ansiC-89 |
| 4d3e9548 | 1940 | .It Li \-isoC |
| 92d0a6a6 | 1941 | .St -isoC |
| 4d3e9548 | 1942 | .It Li \-isoC\-90 |
| 92d0a6a6 | 1943 | .St -isoC-90 |
| 4d3e9548 | 1944 | .It Li \-isoC\-99 |
| 92d0a6a6 JR |
1945 | .St -isoC-99 |
| 1946 | .El | |
| 1947 | .Pp | |
| 1948 | . | |
| 1949 | .Tn POSIX | |
| 1950 | Part 1: System API | |
| 1951 | .Pp | |
| 4d3e9548 JL |
1952 | .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent |
| 1953 | .It Li \-iso9945\-1\-90 | |
| 92d0a6a6 | 1954 | .St -iso9945-1-90 |
| 4d3e9548 | 1955 | .It Li \-iso9945\-1\-96 |
| 92d0a6a6 | 1956 | .St -iso9945-1-96 |
| 4d3e9548 | 1957 | .It Li \-p1003.1 |
| 92d0a6a6 | 1958 | .St -p1003.1 |
| 4d3e9548 | 1959 | .It Li \-p1003.1\-88 |
| 92d0a6a6 | 1960 | .St -p1003.1-88 |
| 4d3e9548 | 1961 | .It Li \-p1003.1\-90 |
| 92d0a6a6 | 1962 | .St -p1003.1-90 |
| 4d3e9548 | 1963 | .It Li \-p1003.1\-96 |
| 92d0a6a6 | 1964 | .St -p1003.1-96 |
| 4d3e9548 | 1965 | .It Li \-p1003.1b\-93 |
| 92d0a6a6 | 1966 | .St -p1003.1b-93 |
| 4d3e9548 | 1967 | .It Li \-p1003.1c\-95 |
| 92d0a6a6 | 1968 | .St -p1003.1c-95 |
| 4d3e9548 | 1969 | .It Li \-p1003.1g\-2000 |
| 92d0a6a6 | 1970 | .St -p1003.1g-2000 |
| 4d3e9548 | 1971 | .It Li \-p1003.1i\-95 |
| 92d0a6a6 | 1972 | .St -p1003.1i-95 |
| 4d3e9548 | 1973 | .It Li \-p1003.1\-2001 |
| 92d0a6a6 | 1974 | .St -p1003.1-2001 |
| 4d3e9548 | 1975 | .It Li \-p1003.1\-2004 |
| 465b256c | 1976 | .St -p1003.1-2004 |
| 92d0a6a6 JR |
1977 | .El |
| 1978 | .Pp | |
| 1979 | . | |
| 1980 | .Tn POSIX | |
| 1981 | Part 2: Shell and Utilities | |
| 1982 | .Pp | |
| 4d3e9548 JL |
1983 | .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent |
| 1984 | .It Li \-iso9945\-2\-93 | |
| 92d0a6a6 | 1985 | .St -iso9945-2-93 |
| 4d3e9548 | 1986 | .It Li \-p1003.2 |
| 92d0a6a6 | 1987 | .St -p1003.2 |
| 4d3e9548 | 1988 | .It Li \-p1003.2\-92 |
| 92d0a6a6 | 1989 | .St -p1003.2-92 |
| 4d3e9548 | 1990 | .It Li \-p1003.2a\-92 |
| 92d0a6a6 JR |
1991 | .St -p1003.2a-92 |
| 1992 | .El | |
| 1993 | .Pp | |
| 1994 | . | |
| 1995 | X/Open | |
| 4d3e9548 | 1996 | .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent |
| 92d0a6a6 | 1997 | .Pp |
| 4d3e9548 | 1998 | .It Li \-susv2 |
| 92d0a6a6 | 1999 | .St -susv2 |
| 4d3e9548 JL |
2000 | .It Li \-susv3 |
| 2001 | .St -susv3 | |
| 2002 | .It Li \-svid4 | |
| 92d0a6a6 | 2003 | .St -svid4 |
| 4d3e9548 | 2004 | .It Li \-xbd5 |
| 92d0a6a6 | 2005 | .St -xbd5 |
| 4d3e9548 | 2006 | .It Li \-xcu5 |
| 92d0a6a6 | 2007 | .St -xcu5 |
| 4d3e9548 | 2008 | .It Li \-xcurses4.2 |
| 92d0a6a6 | 2009 | .St -xcurses4.2 |
| 4d3e9548 | 2010 | .It Li \-xns5 |
| 92d0a6a6 | 2011 | .St -xns5 |
| 4d3e9548 | 2012 | .It Li \-xns5.2 |
| 92d0a6a6 | 2013 | .St -xns5.2 |
| 4d3e9548 | 2014 | .It Li \-xpg3 |
| 92d0a6a6 | 2015 | .St -xpg3 |
| 4d3e9548 | 2016 | .It Li \-xpg4 |
| 92d0a6a6 | 2017 | .St -xpg4 |
| 4d3e9548 | 2018 | .It Li \-xpg4.2 |
| 92d0a6a6 | 2019 | .St -xpg4.2 |
| 4d3e9548 | 2020 | .It Li \-xsh5 |
| 92d0a6a6 JR |
2021 | .St -xsh5 |
| 2022 | .El | |
| 2023 | .Pp | |
| 2024 | . | |
| 2025 | Miscellaneous | |
| 2026 | .Pp | |
| 4d3e9548 JL |
2027 | .Bl -tag -width ".Li \-p1003.1g\-2000" -compact -offset indent |
| 2028 | .It Li \-ieee754 | |
| 92d0a6a6 | 2029 | .St -ieee754 |
| 4d3e9548 | 2030 | .It Li \-iso8802\-3 |
| 92d0a6a6 JR |
2031 | .St -iso8802-3 |
| 2032 | .El | |
| 2033 | . | |
| 2034 | .Ss "Variable Types" | |
| 2035 | . | |
| 2036 | The | |
| 2037 | .Ql .Vt | |
| 2038 | macro may be used whenever a type is referenced. | |
| 2039 | In the | |
| 2040 | .Sx SYNOPSIS | |
| 2041 | section, it causes a line break (useful for old style variable declarations). | |
| 2042 | .Pp | |
| 2043 | .Dl Usage: .Vt Ao type Ac ... | |
| 2044 | .Pp | |
| 2045 | .Bl -tag -width ".Li .Vt\ extern\ char\ *optarg\ ;" -compact -offset 15n | |
| 2046 | .It Li ".Vt extern char *optarg ;" | |
| 2047 | .Vt extern char *optarg ; | |
| 2048 | .It Li ".Vt FILE *" | |
| 2049 | .Vt FILE * | |
| 2050 | .El | |
| 2051 | . | |
| 2052 | .Ss Variables | |
| 2053 | . | |
| 2054 | Generic variable reference. | |
| 2055 | .Pp | |
| 2056 | .Dl Usage: .Va Ao variable Ac ... | |
| 2057 | .Pp | |
| 2058 | .Bl -tag -width ".Li .Va\ Xchar\ sX\ ]\ )\ )\ ," -compact -offset 15n | |
| 2059 | .It Li ".Va count" | |
| 2060 | .Va count | |
| 2061 | .It Li ".Va settimer ," | |
| 2062 | .Va settimer , | |
| 2063 | .It Li ".Va \*[q]int *prt\*[q] ) :" | |
| 2064 | .Va "int *prt" ) : | |
| 2065 | .It Li ".Va \*[q]char s\*[q] ] ) ) ," | |
| 2066 | .Va "char s" ] ) ) , | |
| 2067 | .El | |
| 2068 | .Pp | |
| 2069 | . | |
| 2070 | The default width is 12n. | |
| 2071 | . | |
| 2072 | .Ss "Manual Page Cross References" | |
| 2073 | . | |
| 2074 | The | |
| 2075 | .Ql .Xr | |
| 2076 | macro expects the first argument to be a manual page name. | |
| 2077 | The optional second argument, if a string (defining the manual section), is | |
| 2078 | put into parentheses. | |
| 2079 | .Pp | |
| 2080 | .Dl Usage: .Xr Ao man page name Ac Oo Ao section Ac Oc ... | |
| 2081 | .Pp | |
| 2082 | .Bl -tag -width ".Li .Xr\ xinit\ 1x\ ;" -compact -offset 15n | |
| 2083 | .It Li ".Xr mdoc" | |
| 2084 | .Xr mdoc | |
| 2085 | .It Li ".Xr mdoc ," | |
| 2086 | .Xr mdoc , | |
| 2087 | .It Li ".Xr mdoc 7" | |
| 2088 | .Xr mdoc 7 | |
| 2089 | .It Li ".Xr xinit 1x ;" | |
| 2090 | .Xr xinit 1x ; | |
| 2091 | .El | |
| 2092 | .Pp | |
| 2093 | . | |
| 2094 | The default width is 10n. | |
| 2095 | . | |
| 2096 | . | |
| 2097 | .Sh "GENERAL TEXT DOMAIN" | |
| 2098 | . | |
| 2099 | .Ss "AT&T Macro" | |
| 2100 | . | |
| 2101 | .Pp | |
| 2102 | .Dl Usage: .At Oo Ao version Ac Oc ... | |
| 2103 | .Pp | |
| 2104 | .Bl -tag -width ".Li .At\ v6\ ." -compact -offset 15n | |
| 2105 | .It Li .At | |
| 2106 | .At | |
| 2107 | .It Li ".At v6 ." | |
| 2108 | .At v6 . | |
| 2109 | .El | |
| 2110 | .Pp | |
| 2111 | The following values for | |
| 2112 | .Ao version Ac | |
| 2113 | are possible: | |
| 2114 | .Pp | |
| 2115 | .Dl 32v, v1, v2, v3, v4, v5, v6, v7, V, V.1, V.2, V.3, V.4 | |
| 2116 | . | |
| 2117 | .Ss "BSD Macro" | |
| 2118 | . | |
| 2119 | .Pp | |
| 4d3e9548 | 2120 | .Dl "Usage: .Bx" Bro \-alpha | \-beta | \-devel Brc ... |
| 92d0a6a6 JR |
2121 | .Dl " .Bx" Oo Ao version Ac Oo Ao release Ac Oc Oc ... |
| 2122 | .Pp | |
| 2123 | .Bl -tag -width ".Li .Bx\ -devel" -compact -offset 15n | |
| 2124 | .It Li .Bx | |
| 2125 | .Bx | |
| 2126 | .It Li ".Bx 4.3 ." | |
| 2127 | .Bx 4.3 . | |
| 2128 | .It Li ".Bx \-devel" | |
| 2129 | .Bx -devel | |
| 2130 | .El | |
| 2131 | .Pp | |
| 2132 | .Ao version Ac | |
| 2133 | will be prepended to the string | |
| 2134 | .Sq Bx . | |
| 2135 | The following values for | |
| 2136 | .Ao release Ac | |
| 2137 | are possible: | |
| 2138 | .Pp | |
| 2139 | .Dl Reno, reno, Tahoe, tahoe, Lite, lite, Lite2, lite2 | |
| 2140 | . | |
| 2141 | .Ss "NetBSD Macro" | |
| 2142 | . | |
| 2143 | .Pp | |
| 2144 | .Dl Usage: .Nx Oo Ao version Ac Oc ... | |
| 2145 | .Pp | |
| 2146 | .Bl -tag -width ".Li .Nx\ 1.4\ ." -compact -offset 15n | |
| 2147 | .It Li .Nx | |
| 2148 | .Nx | |
| 2149 | .It Li ".Nx 1.4 ." | |
| 2150 | .Nx 1.4 . | |
| 2151 | .El | |
| 2152 | .Pp | |
| 2153 | For possible values of | |
| 2154 | .Ao version Ac | |
| 2155 | see the description of the | |
| 2156 | .Ql .Os | |
| 2157 | command above in section | |
| 2158 | .Sx "TITLE MACROS" . | |
| 2159 | . | |
| 2160 | .Ss "FreeBSD Macro" | |
| 2161 | . | |
| 2162 | .Pp | |
| 2163 | .Dl Usage: .Fx Oo Ao version Ac Oc ... | |
| 2164 | .Pp | |
| 2165 | .Bl -tag -width ".Li .Fx\ 2.2\ ." -compact -offset 15n | |
| 2166 | .It Li .Fx | |
| 2167 | .Fx | |
| 2168 | .It Li ".Fx 2.2 ." | |
| 2169 | .Fx 2.2 . | |
| 2170 | .El | |
| 2171 | .Pp | |
| 2172 | For possible values of | |
| 2173 | .Ao version Ac | |
| 2174 | see the description of the | |
| 2175 | .Ql .Os | |
| 2176 | command above in section | |
| 2177 | .Sx "TITLE MACROS" . | |
| 2178 | . | |
| 4d3e9548 JL |
2179 | .Ss "DragonFly Macro" |
| 2180 | . | |
| 2181 | .Pp | |
| 2182 | .Dl Usage: .Dx Oo Ao version Ac Oc ... | |
| 2183 | .Pp | |
| 2184 | .Bl -tag -width ".Li .Dx\ 1.4\ ." -compact -offset 15n | |
| 2185 | .It Li .Dx | |
| 2186 | .Dx | |
| 2187 | .It Li ".Dx 1.4 ." | |
| 2188 | .Dx 1.4 . | |
| 2189 | .El | |
| 2190 | .Pp | |
| 2191 | For possible values of | |
| 2192 | .Ao version Ac | |
| 2193 | see the description of the | |
| 2194 | .Ql .Os | |
| 2195 | command above in section | |
| 2196 | .Sx "TITLE MACROS" . | |
| 2197 | . | |
| 92d0a6a6 JR |
2198 | .Ss "OpenBSD Macro" |
| 2199 | . | |
| 2200 | .Pp | |
| 2201 | .Dl Usage: .Ox Oo Ao version Ac Oc ... | |
| 2202 | .Pp | |
| 2203 | .Bl -tag -width ".Li .Ox\ 1.0" -compact -offset 15n | |
| 2204 | .It Li ".Ox 1.0" | |
| 2205 | .Ox 1.0 | |
| 2206 | .El | |
| 2207 | . | |
| 2208 | .Ss "BSD/OS Macro" | |
| 2209 | . | |
| 2210 | .Pp | |
| 2211 | .Dl Usage: .Bsx Oo Ao version Ac Oc ... | |
| 2212 | .Pp | |
| 2213 | .Bl -tag -width ".Li .Bsx\ 1.0" -compact -offset 15n | |
| 2214 | .It Li ".Bsx 1.0" | |
| 2215 | .Bsx 1.0 | |
| 2216 | .El | |
| 2217 | . | |
| 2218 | .Ss "UNIX Macro" | |
| 2219 | . | |
| 2220 | .Pp | |
| 2221 | .Dl Usage: .Ux ... | |
| 2222 | .Pp | |
| 2223 | .Bl -tag -width ".Li .Ux" -compact -offset 15n | |
| 2224 | .It Li .Ux | |
| 2225 | .Ux | |
| 2226 | .El | |
| 2227 | . | |
| 2228 | .Ss "Emphasis Macro" | |
| 2229 | . | |
| 2230 | Text may be stressed or emphasized with the | |
| 2231 | .Ql .Em | |
| 2232 | macro. | |
| 2233 | The usual font for emphasis is italic. | |
| 2234 | .Pp | |
| 2235 | .Dl Usage: .Em Ao argument Ac ... | |
| 2236 | .Pp | |
| 2237 | .Bl -tag -width ".Li .Em\ vide\ infra\ )\ )\ ," -compact -offset 15n | |
| 2238 | .It Li ".Em does not" | |
| 2239 | .Em does not | |
| 2240 | .It Li ".Em exceed 1024 ." | |
| 2241 | .Em exceed 1024 . | |
| 2242 | .It Li ".Em vide infra ) ) ," | |
| 2243 | .Em vide infra ) ) , | |
| 2244 | .El | |
| 2245 | .Pp | |
| 2246 | . | |
| 2247 | The default width is 10n. | |
| 2248 | . | |
| 2249 | .Ss "Font Mode" | |
| 2250 | . | |
| 2251 | The | |
| 2252 | .Ql .Bf | |
| 2253 | font mode must be ended with the | |
| 2254 | .Ql .Ef | |
| 2255 | macro (the latter takes no arguments). | |
| 2256 | Font modes may be nested within other font modes. | |
| 2257 | .Pp | |
| 2258 | .Ql .Bf | |
| 2259 | has the following syntax: | |
| 2260 | .Pp | |
| 2261 | .Dl .Bf Ao font mode Ac | |
| 2262 | .Pp | |
| 2263 | .Ao font mode Ac | |
| 2264 | must be one of the following three types: | |
| 2265 | .Pp | |
| 2266 | .Bl -tag -width ".Sy \&Sy | Fl symbolic" -compact -offset indent | |
| 2267 | .It Sy \&Em | Fl emphasis | |
| 2268 | Same as if the | |
| 2269 | .Ql .Em | |
| 2270 | macro was used for the entire block of text. | |
| 2271 | .It Sy \&Li | Fl literal | |
| 2272 | Same as if the | |
| 2273 | .Ql .Li | |
| 2274 | macro was used for the entire block of text. | |
| 2275 | .It Sy \&Sy | Fl symbolic | |
| 2276 | Same as if the | |
| 2277 | .Ql .Sy | |
| 2278 | macro was used for the entire block of text. | |
| 2279 | .El | |
| 2280 | .Pp | |
| 2281 | Both macros are neither callable nor parsed. | |
| 2282 | . | |
| 2283 | .Ss "Enclosure and Quoting Macros" | |
| 2284 | . | |
| 2285 | The concept of enclosure is similar to quoting. | |
| 2286 | The object being to enclose one or more strings between a pair of characters | |
| 2287 | like quotes or parentheses. | |
| 2288 | The terms quoting and enclosure are used interchangeably throughout this | |
| 2289 | document. | |
| 2290 | Most of the one-line enclosure macros end in small letter | |
| 2291 | .Ql q | |
| 2292 | to give a hint of quoting, but there are a few irregularities. | |
| 2293 | For each enclosure macro there is also a pair of open and close macros which | |
| 2294 | end in small letters | |
| 2295 | .Ql o | |
| 2296 | and | |
| 2297 | .Ql c | |
| 2298 | respectively. | |
| 2299 | .Pp | |
| 2300 | \# XXX | |
| 2301 | .if t \ | |
| 2302 | . ne 10 | |
| 2303 | . | |
| 2304 | .Bd -filled -offset 4n | |
| 2305 | .Bl -column "quote" "close" "open" "Angle Bracket Enclosure" "`string' or string" | |
| 2306 | .Em Quote Ta Em Open Ta Em Close Ta Em Function Ta Em Result | |
| 2307 | .No .Aq Ta .Ao Ta .Ac Ta "Angle Bracket Enclosure" Ta Ao string Ac | |
| 2308 | .No .Bq Ta .Bo Ta .Bc Ta "Bracket Enclosure" Ta Bo string Bc | |
| 2309 | .No .Brq Ta .Bro Ta .Brc Ta "Brace Enclosure" Ta Bro string Brc | |
| 2310 | .No .Dq Ta .Do Ta .Dc Ta "Double Quote" Ta Do string Dc | |
| 2311 | .No .Eq Ta .Eo Ta .Ec Ta "Enclose String (in XX)" Ta XXstringXX | |
| 2312 | .No .Pq Ta .Po Ta .Pc Ta "Parenthesis Enclosure" Ta Po string Pc | |
| 2313 | .No .Ql Ta Ta Ta "Quoted Literal" Ta So string Sc or Li string | |
| 2314 | .No .Qq Ta .Qo Ta .Qc Ta "Straight Double Quote" Ta Qo string Qc | |
| 2315 | .No .Sq Ta .So Ta .Sc Ta "Single Quote" Ta So string Sc | |
| 2316 | .El | |
| 2317 | .Ed | |
| 2318 | .Pp | |
| 2319 | All macros ending with | |
| 2320 | .Sq q | |
| 2321 | and | |
| 2322 | .Sq o | |
| 2323 | have a default width value of 12n. | |
| 2324 | . | |
| 2325 | .Bl -tag -width ".Li .Ec , .Eo" | |
| 2326 | .It Li .Eo , .Ec | |
| 2327 | These macros expect the first argument to be the opening and closing strings | |
| 2328 | respectively. | |
| 2329 | .It Li .Es , .En | |
| 2330 | Due to the nine-argument limit in the original troff program two other | |
| 2331 | macros have been implemented which are now rather obsolete: | |
| 2332 | .Ql .Es | |
| 2333 | takes the first and second parameter as the left and right enclosure string, | |
| 2334 | which are then used to enclose the arguments of | |
| 2335 | .Ql .En . | |
| 2336 | The default width value is 12n for both macros. | |
| 2337 | .It Li .Eq | |
| 2338 | The first and second arguments of this macro are the opening and | |
| 2339 | closing strings respectively, followed by the arguments to be enclosed. | |
| 2340 | .It Li .Ql | |
| 2341 | The quoted literal macro behaves differently in troff and nroff mode. | |
| 2342 | If formatted with | |
| 2343 | .Xr nroff , | |
| 2344 | a quoted literal is always quoted. | |
| 2345 | If formatted with troff, an item is only quoted if the width of the item is | |
| 2346 | less than three constant width characters. | |
| 2347 | This is to make short strings more visible where the font change to literal | |
| 2348 | (constant width) is less noticeable. | |
| 2349 | .Pp | |
| 2350 | The default width is 16n. | |
| 2351 | .It Li .Pf | |
| 2352 | The prefix macro suppresses the whitespace between its first and second | |
| 2353 | argument: | |
| 2354 | . | |
| 2355 | .Bl -tag -width ".Li .Pf\ (\ Fa\ name2" -offset indent | |
| 2356 | .It Li ".Pf ( Fa name2" | |
| 2357 | .Pf ( Fa name2 | |
| 2358 | .El | |
| 2359 | .Pp | |
| 2360 | . | |
| 2361 | The default width is 12n. | |
| 2362 | .Pp | |
| 2363 | The | |
| 2364 | .Ql .Ns | |
| 2365 | macro (see below) performs the analogous suffix function. | |
| 2366 | .It Li .Ap | |
| 2367 | The | |
| 2368 | .Ql .Ap | |
| 2369 | macro inserts an apostrophe and exits any special text modes, continuing in | |
| 2370 | .Ql .No | |
| 2371 | mode. | |
| 2372 | .El | |
| 2373 | .Pp | |
| 2374 | . | |
| 2375 | Examples of quoting: | |
| 2376 | . | |
| 2377 | .Pp | |
| 2378 | .Bl -tag -width ".Li .Bq\ Em\ Greek\ ,\ French\ ." -compact -offset indent | |
| 2379 | .It Li .Aq | |
| 2380 | .Aq | |
| 2381 | .It Li ".Aq Pa ctype.h ) ," | |
| 2382 | .Aq Pa ctype.h ) , | |
| 2383 | .It Li .Bq | |
| 2384 | .Bq | |
| 2385 | .It Li ".Bq Em Greek , French ." | |
| 2386 | .Bq Em Greek , French . | |
| 2387 | .It Li .Dq | |
| 2388 | .Dq | |
| 2389 | .It Li ".Dq string abc ." | |
| 2390 | .Dq string abc . | |
| 4d3e9548 | 2391 | .It Li ".Dq \'^[A\-Z]\'" |
| 92d0a6a6 JR |
2392 | .Dq \'^[A-Z]\' |
| 2393 | .It Li ".Ql man mdoc" | |
| 2394 | .Ql man mdoc | |
| 2395 | .It Li .Qq | |
| 2396 | ||
| 2397 | .It Li ".Qq string ) ," | |
| 2398 | .Qq string ) , | |
| 2399 | .It Li ".Qq string Ns )," | |
| 2400 | .Qq string Ns ), | |
| 2401 | .It Li .Sq | |
| 2402 | .Sq | |
| 2403 | .It Li ".Sq string" | |
| 2404 | .Sq string | |
| 2405 | .It Li ".Em or Ap ing" | |
| 2406 | .Em or Ap ing | |
| 2407 | .El | |
| 2408 | .Pp | |
| 2409 | . | |
| 2410 | For a good example of nested enclosure macros, see the | |
| 2411 | .Ql .Op | |
| 2412 | option macro. | |
| 2413 | It was created from the same underlying enclosure macros as those presented | |
| 2414 | in the list above. | |
| 2415 | The | |
| 2416 | .Ql .Xo | |
| 2417 | and | |
| 2418 | .Ql .Xc | |
| 2419 | extended argument list macros are discussed below. | |
| 2420 | . | |
| 2421 | .Ss "No-Op or Normal Text Macro" | |
| 2422 | . | |
| 2423 | The | |
| 2424 | .Ql .No | |
| 2425 | macro can be used in a macro command line for parameters which should | |
| 2426 | .Em not | |
| 2427 | be formatted. | |
| 2428 | Be careful to add | |
| 2429 | .Ql \e& | |
| 2430 | to the word | |
| 2431 | .Ql \&No | |
| 2432 | if you really want that English word (and not the macro) as a parameter. | |
| 2433 | .Pp | |
| 2434 | .Dl Usage: .No Ao argument Ac ... | |
| 2435 | .Pp | |
| 2436 | .Bl -tag -width ".Li .No\ test\ Ta\ with\ Ta\ tabs" -compact -offset 15n | |
| 2437 | .It Li ".No test Ta with Ta tabs" | |
| 2438 | .No test Ta with Ta tabs | |
| 2439 | .El | |
| 2440 | .Pp | |
| 2441 | . | |
| 2442 | The default width is 12n. | |
| 2443 | . | |
| 2444 | .Ss "No-Space Macro" | |
| 2445 | . | |
| 2446 | The | |
| 2447 | .Ql .Ns | |
| 2448 | macro suppresses insertion of a space between the current position and its | |
| 2449 | first parameter. | |
| 2450 | For example, it is useful for old style argument lists where there is no | |
| 2451 | space between the flag and argument: | |
| 2452 | .Pp | |
| 2453 | .Dl "Usage:" ... Ao argument Ac \&Ns Oo Ao argument Ac Oc ... | |
| 2454 | .Dl " " .Ns Ao argument Ac ... | |
| 2455 | .Pp | |
| 2456 | .Bl -tag -width ".Li .Op\ Fl\ I\ Ns\ Ar\ directory" -compact -offset 15n | |
| 2457 | .It Li ".Op Fl I Ns Ar directory" | |
| 2458 | .Op Fl I Ns Ar directory | |
| 2459 | .El | |
| 2460 | .Pp | |
| 2461 | Note: The | |
| 2462 | .Ql .Ns | |
| 2463 | macro always invokes the | |
| 2464 | .Ql .No | |
| 2465 | macro after eliminating the space unless another macro name follows it. | |
| 2466 | If used as a command (i.e., the second form above in the | |
| 2467 | .Sq Usage | |
| 2468 | line), | |
| 2469 | .Ql .Ns | |
| 2470 | is identical to | |
| 2471 | .Ql .No . | |
| 2472 | . | |
| 2473 | .Ss "Section Cross References" | |
| 2474 | . | |
| 2475 | The | |
| 2476 | .Ql .Sx | |
| 2477 | macro designates a reference to a section header within the same document. | |
| 2478 | .Pp | |
| 2479 | .Dl Usage: .Sx Ao section reference Ac ... | |
| 2480 | .Pp | |
| 2481 | .Bl -tag -width ".Li .Sx\ FILES" -offset 15n | |
| 2482 | .It Li ".Sx FILES" | |
| 2483 | .Sx FILES | |
| 2484 | .El | |
| 2485 | .Pp | |
| 2486 | . | |
| 2487 | The default width is 16n. | |
| 2488 | . | |
| 2489 | .Ss Symbolics | |
| 2490 | . | |
| 2491 | The symbolic emphasis macro is generally a boldface macro in either the | |
| 2492 | symbolic sense or the traditional English usage. | |
| 2493 | .Pp | |
| 2494 | .Dl Usage: .Sy Ao symbol Ac ... | |
| 2495 | .Pp | |
| 2496 | .Bl -tag -width ".Li .Sy\ Important\ Notice" -compact -offset 15n | |
| 2497 | .It Li ".Sy Important Notice" | |
| 2498 | .Sy Important Notice | |
| 2499 | .El | |
| 2500 | .Pp | |
| 2501 | . | |
| 2502 | The default width is 6n. | |
| 2503 | . | |
| 2504 | .Ss Mathematical Symbols | |
| 2505 | . | |
| 2506 | Use this macro for mathematical symbols and similar things. | |
| 2507 | .Pp | |
| 2508 | .Dl Usage: .Ms Ao math symbol Ac ... | |
| 2509 | .Pp | |
| 2510 | .Bl -tag -width ".Li .Ms\ sigma" -compact -offset 15n | |
| 2511 | .It Li ".Ms sigma" | |
| 2512 | .Ms sigma | |
| 2513 | .El | |
| 2514 | .Pp | |
| 2515 | . | |
| 2516 | The default width is 6n. | |
| 2517 | . | |
| 2518 | .Ss "References and Citations" | |
| 2519 | . | |
| 2520 | The following macros make a modest attempt to handle references. | |
| 2521 | At best, the macros make it convenient to manually drop in a subset of | |
| 2522 | .Xr refer 1 | |
| 2523 | style references. | |
| 2524 | .Pp | |
| 2525 | .Bl -tag -width 6n -offset indent -compact | |
| 2526 | .It Li .Rs | |
| 2527 | Reference start (does not take arguments). | |
| 2528 | Causes a line break in the | |
| 2529 | .Sx "SEE ALSO" | |
| 2530 | section and begins collection of reference information until the reference | |
| 2531 | end macro is read. | |
| 2532 | .It Li .Re | |
| 2533 | Reference end (does not take arguments). | |
| 2534 | The reference is printed. | |
| 2535 | .It Li .%A | |
| 2536 | Reference author name; one name per invocation. | |
| 2537 | .It Li .%B | |
| 2538 | Book title. | |
| 2539 | .It Li .%C | |
| 2540 | City/place (not implemented yet). | |
| 2541 | .It Li .%D | |
| 2542 | Date. | |
| 2543 | .It Li .%I | |
| 2544 | Issuer/publisher name. | |
| 2545 | .It Li .%J | |
| 2546 | Journal name. | |
| 2547 | .It Li .%N | |
| 2548 | Issue number. | |
| 2549 | .It Li .%O | |
| 2550 | Optional information. | |
| 2551 | .It Li .%P | |
| 2552 | Page number. | |
| 2553 | .It Li .%Q | |
| 2554 | Corporate or foreign author. | |
| 2555 | .It Li .%R | |
| 2556 | Report name. | |
| 2557 | .It Li .%T | |
| 2558 | Title of article. | |
| 2559 | .It Li .%V | |
| 2560 | Volume. | |
| 2561 | .El | |
| 2562 | .Pp | |
| 2563 | Macros beginning with | |
| 2564 | .Ql % | |
| 2565 | are not callable but accept multiple arguments in the usual way. | |
| 2566 | Only the | |
| 2567 | .Ql .Tn | |
| 2568 | macro is handled properly as a parameter; other macros will cause strange | |
| 2569 | output. | |
| 2570 | .Ql .%B | |
| 2571 | and | |
| 2572 | .Ql .%T | |
| 2573 | can be used outside of the | |
| 2574 | .Ql .Rs/.Re | |
| 2575 | environment. | |
| 2576 | .Pp | |
| 2577 | Example: | |
| 2578 | . | |
| 2579 | .Bd -literal -offset indent | |
| 2580 | \&.Rs | |
| 2581 | \&.%A "Matthew Bar" | |
| 2582 | \&.%A "John Foo" | |
| 2583 | \&.%T "Implementation Notes on foobar(1)" | |
| 4d3e9548 | 2584 | \&.%R "Technical Report ABC\-DE\-12\-345" |
| 92d0a6a6 JR |
2585 | \&.%Q "Drofnats College, Nowhere" |
| 2586 | \&.%D "April 1991" | |
| 2587 | \&.Re | |
| 2588 | .Ed | |
| 2589 | .Pp | |
| 2590 | produces | |
| 2591 | . | |
| 2592 | .Bd -ragged -offset indent | |
| 2593 | .Rs | |
| 2594 | .%A "Matthew Bar" | |
| 2595 | .%A "John Foo" | |
| 2596 | .%T "Implementation Notes on foobar(1)" | |
| 2597 | .%R "Technical Report ABC-DE-12-345" | |
| 2598 | .%Q "Drofnats College, Nowhere" | |
| 2599 | .%D "April 1991" | |
| 2600 | .Re | |
| 2601 | .Ed | |
| 2602 | . | |
| 2603 | .Ss "Trade Names (or Acronyms and Type Names)" | |
| 2604 | . | |
| 2605 | The trade name macro prints its arguments in a smaller font. | |
| 2606 | Its intended use is to imitate a small caps fonts for uppercase acronyms. | |
| 2607 | .Pp | |
| 2608 | .Dl Usage: .Tn Ao symbol Ac ... | |
| 2609 | .Pp | |
| 2610 | .Bl -tag -width ".Li .Tn\ ASCII" -compact -offset 15n | |
| 2611 | .It Li ".Tn DEC" | |
| 2612 | .Tn DEC | |
| 2613 | .It Li ".Tn ASCII" | |
| 2614 | .Tn ASCII | |
| 2615 | .El | |
| 2616 | .Pp | |
| 2617 | . | |
| 2618 | The default width is 10n. | |
| 2619 | . | |
| 2620 | .Ss "Extended Arguments" | |
| 2621 | . | |
| 2622 | The | |
| 2623 | .Li .Xo | |
| 2624 | and | |
| 2625 | .Li .Xc | |
| 2626 | macros allow one to extend an argument list on a macro boundary for the | |
| 2627 | .Ql .It | |
| 2628 | macro (see below). | |
| 2629 | Note that | |
| 2630 | .Li .Xo | |
| 2631 | and | |
| 2632 | .Li .Xc | |
| 2633 | are implemented similarly to all other macros opening and closing an | |
| 2634 | enclosure (without inserting characters, of course). | |
| 2635 | This means that the following is true for those macros also. | |
| 2636 | .Pp | |
| 2637 | Here is an example of | |
| 2638 | .Ql .Xo | |
| 2639 | using the space mode macro to turn spacing off: | |
| 2640 | . | |
| 2641 | .Bd -literal -offset indent | |
| 2642 | \&.Sm off | |
| 2643 | \&.It Xo Sy I Ar operation | |
| 2644 | \&.No \een Ar count No \een | |
| 2645 | \&.Xc | |
| 2646 | \&.Sm on | |
| 2647 | .Ed | |
| 2648 | .Pp | |
| 2649 | . | |
| 2650 | produces | |
| 2651 | . | |
| 2652 | .Bd -filled -offset indent | |
| 2653 | .Bl -tag -compact | |
| 2654 | .Sm off | |
| 2655 | .It Xo Sy I Ar operation | |
| 2656 | .No \en Ar count No \en | |
| 2657 | .Xc | |
| 2658 | .Sm on | |
| 2659 | .El | |
| 2660 | .Ed | |
| 2661 | .Pp | |
| 2662 | . | |
| 2663 | Another one: | |
| 2664 | . | |
| 2665 | .Bd -literal -offset indent | |
| 2666 | \&.Sm off | |
| 2667 | \&.It Cm S No / Ar old_pattern Xo | |
| 2668 | \&.No / Ar new_pattern | |
| 2669 | \&.No / Op Cm g | |
| 2670 | \&.Xc | |
| 2671 | \&.Sm on | |
| 2672 | .Ed | |
| 2673 | .Pp | |
| 2674 | . | |
| 2675 | produces | |
| 2676 | . | |
| 2677 | .Bd -filled -offset indent | |
| 2678 | .Bl -tag -compact | |
| 2679 | .Sm off | |
| 2680 | .It Cm S No \&/ Ar old_pattern Xo | |
| 2681 | .No \&/ Ar new_pattern | |
| 2682 | .No \&/ Op Cm g | |
| 2683 | .Xc | |
| 2684 | .Sm on | |
| 2685 | .El | |
| 2686 | .Ed | |
| 2687 | .Pp | |
| 2688 | . | |
| 2689 | Another example of | |
| 2690 | .Ql .Xo | |
| 2691 | and enclosure macros: Test the value of a variable. | |
| 2692 | . | |
| 2693 | .Bd -literal -offset indent | |
| 2694 | \&.It Xo | |
| 2695 | \&.Ic .ifndef | |
| 2696 | \&.Oo \e&! Oc Ns Ar variable Oo | |
| 2697 | \&.Ar operator variable ... | |
| 2698 | \&.Oc Xc | |
| 2699 | .Ed | |
| 2700 | .Pp | |
| 2701 | . | |
| 2702 | produces | |
| 2703 | . | |
| 2704 | .Bd -filled -offset indent | |
| 2705 | .Bl -tag -width flag -compact | |
| 2706 | .It Xo | |
| 2707 | .Ic .ifndef | |
| 2708 | .Oo \&! Oc Ns Ar variable Oo | |
| 2709 | .Ar operator variable ... | |
| 2710 | .Oc Xc | |
| 2711 | .El | |
| 2712 | .Ed | |
| 2713 | .Pp | |
| 2714 | . | |
| 2715 | . | |
| 2716 | .Sh "PAGE STRUCTURE DOMAIN" | |
| 2717 | . | |
| 2718 | .Ss "Section Headers" | |
| 2719 | . | |
| 2720 | The following | |
| 2721 | .Ql .Sh | |
| 2722 | section header macros are required in every man page. | |
| 2723 | The remaining section headers are recommended at the discretion of the | |
| 2724 | author writing the manual page. | |
| 2725 | The | |
| 2726 | .Ql .Sh | |
| 2727 | macro is parsed but not generally callable. | |
| 2728 | It can be used as an argument in a call to | |
| 2729 | .Ql .Sh | |
| 2730 | only; it then reactivates the default font for | |
| 2731 | .Ql .Sh . | |
| 2732 | .Pp | |
| 2733 | The default width is 8n. | |
| 2734 | . | |
| 2735 | .Bl -tag -width ".Li .Sh\ RETURN\ VALUES" | |
| 2736 | .It Li ".Sh NAME" | |
| 2737 | The | |
| 2738 | .Ql ".Sh NAME" | |
| 2739 | macro is mandatory. | |
| 2740 | If not specified, headers, footers and page layout defaults will not be set | |
| 2741 | and things will be rather unpleasant. | |
| 2742 | The | |
| 2743 | .Sx NAME | |
| 2744 | section consists of at least three items. | |
| 2745 | The first is the | |
| 2746 | .Ql .Nm | |
| 2747 | name macro naming the subject of the man page. | |
| 2748 | The second is the name description macro, | |
| 2749 | .Ql .Nd , | |
| 2750 | which separates the subject name from the third item, which is the | |
| 2751 | description. | |
| 2752 | The description should be the most terse and lucid possible, as the space | |
| 2753 | available is small. | |
| 2754 | .Pp | |
| 2755 | .Ql .Nd | |
| 2756 | first prints | |
| 4d3e9548 | 2757 | .Ql \- , |
| 92d0a6a6 JR |
2758 | then all its arguments. |
| 2759 | . | |
| 2760 | .It Li ".Sh LIBRARY" | |
| 2761 | This section is for section two and three function calls. | |
| 2762 | It should consist of a single | |
| 2763 | .Ql .Lb | |
| 2764 | macro call; | |
| 2765 | see | |
| 2766 | .Sx "Library Names" . | |
| 2767 | . | |
| 2768 | .It Li ".Sh SYNOPSIS" | |
| 2769 | The | |
| 2770 | .Sx SYNOPSIS | |
| 2771 | section describes the typical usage of the subject of a man page. | |
| 2772 | The macros required are either | |
| 2773 | .Ql .Nm , | |
| 2774 | .Ql .Cd , | |
| 2775 | or | |
| 2776 | .Ql .Fn | |
| 2777 | (and possibly | |
| 2778 | .Ql .Fo , | |
| 2779 | .Ql .Fc , | |
| 2780 | .Ql .Fd , | |
| 2781 | and | |
| 2782 | .Ql .Ft ) . | |
| 2783 | The function name macro | |
| 2784 | .Ql .Fn | |
| 2785 | is required for manual page sections\~2 and\~3; the command and general name | |
| 2786 | macro | |
| 2787 | .Ql .Nm | |
| 2788 | is required for sections 1, 5, 6, 7, and\~8. | |
| 2789 | Section\~4 manuals require a | |
| 2790 | .Ql .Nm , | |
| 2791 | .Ql .Fd | |
| 2792 | or a | |
| 2793 | .Ql .Cd | |
| 2794 | configuration device usage macro. | |
| 2795 | Several other macros may be necessary to produce the synopsis line as shown | |
| 2796 | below: | |
| 2797 | . | |
| 2798 | .Bd -filled -offset indent | |
| 2799 | .Nm cat | |
| 2800 | .Op Fl benstuv | |
| 2801 | .Op Fl | |
| 2802 | .Ar | |
| 2803 | .Ed | |
| 2804 | .Pp | |
| 2805 | . | |
| 2806 | The following macros were used: | |
| 2807 | .Pp | |
| 2808 | .Dl ".Nm cat" | |
| 2809 | .Dl ".Op Fl benstuv" | |
| 2810 | .Dl ".Op Fl" | |
| 2811 | .Dl .Ar | |
| 2812 | . | |
| 2813 | .It Li ".Sh DESCRIPTION" | |
| 2814 | In most cases the first text in the | |
| 2815 | .Sx DESCRIPTION | |
| 2816 | section is a brief paragraph on the command, function or file, followed by a | |
| 2817 | lexical list of options and respective explanations. | |
| 2818 | To create such a list, the | |
| 2819 | .Ql .Bl | |
| 2820 | (begin list), | |
| 2821 | .Ql .It | |
| 2822 | (list item) and | |
| 2823 | .Ql .El | |
| 2824 | (end list) | |
| 2825 | macros are used (see | |
| 2826 | .Sx Lists and Columns | |
| 2827 | below). | |
| 2828 | . | |
| 2829 | .It Li ".Sh IMPLEMENTATION NOTES" | |
| 2830 | Implementation specific information should be placed here. | |
| 2831 | . | |
| 2832 | .It Li ".Sh RETURN VALUES" | |
| 2833 | Sections 2, 3 and\~9 function return values should go here. | |
| 2834 | The | |
| 2835 | .Ql .Rv | |
| 2836 | macro may be used to generate text for use in the | |
| 2837 | .Sx RETURN VALUES | |
| 2838 | section for most section 2 and 3 library functions; | |
| 2839 | see | |
| 2840 | .Sx "Return Values" . | |
| 2841 | .El | |
| 2842 | .Pp | |
| 2843 | . | |
| 2844 | The following | |
| 2845 | .Ql .Sh | |
| 2846 | section headers are part of the preferred manual page layout and must be | |
| 2847 | used appropriately to maintain consistency. | |
| 2848 | They are listed in the order in which they would be used. | |
| 2849 | . | |
| 2850 | .Bl -tag -width ".Li .Sh\ COMPATIBILITY" | |
| 2851 | .It Li ".Sh ENVIRONMENT" | |
| 2852 | The | |
| 2853 | .Sx ENVIRONMENT | |
| 2854 | section should reveal any related environment variables and clues to their | |
| 2855 | behavior and/or usage. | |
| 2856 | . | |
| 2857 | .It Li ".Sh FILES" | |
| 2858 | Files which are used or created by the man page subject should be listed via | |
| 2859 | the | |
| 2860 | .Ql .Pa | |
| 2861 | macro in the | |
| 2862 | .Sx FILES | |
| 2863 | section. | |
| 2864 | . | |
| 2865 | .It Li ".Sh EXAMPLES" | |
| 2866 | There are several ways to create examples. | |
| 2867 | See the | |
| 2868 | .Sx EXAMPLES | |
| 2869 | section below for details. | |
| 2870 | . | |
| 2871 | .It Li ".Sh DIAGNOSTICS" | |
| 2872 | Diagnostic messages from a command should be placed in this section. | |
| 2873 | The | |
| 2874 | .Ql .Ex | |
| 2875 | macro may be used to generate text for use in the | |
| 2876 | .Sx DIAGNOSTICS | |
| 2877 | section for most section 1, 6 and\~8 commands; | |
| 2878 | see | |
| 2879 | .Sx "Exit Status" . | |
| 2880 | . | |
| 2881 | .It Li ".Sh COMPATIBILITY" | |
| 2882 | Known compatibility issues (e.g. deprecated options or parameters) | |
| 2883 | should be listed here. | |
| 2884 | . | |
| 2885 | .It Li ".Sh ERRORS" | |
| 2886 | Specific error handling, especially from library functions (man page | |
| 2887 | sections 2, 3, and\~9) should go here. | |
| 2888 | The | |
| 2889 | .Ql .Er | |
| 2890 | macro is used to specify an error (errno). | |
| 2891 | . | |
| 2892 | .It Li ".Sh SEE ALSO" | |
| 2893 | References to other material on the man page topic and cross references to | |
| 2894 | other relevant man pages should be placed in the | |
| 2895 | .Sx "SEE ALSO" | |
| 2896 | section. | |
| 2897 | Cross references are specified using the | |
| 2898 | .Ql .Xr | |
| 2899 | macro. | |
| 2900 | Currently | |
| 2901 | .Xr refer 1 | |
| 2902 | style references are not accommodated. | |
| 2903 | .Pp | |
| 2904 | It is recommended that the cross references are sorted on the section | |
| 2905 | number, then alphabetically on the names within a section, and placed | |
| 2906 | in that order and comma separated. | |
| 2907 | Example: | |
| 2908 | .Pp | |
| 2909 | .Xr ls 1 , | |
| 2910 | .Xr ps 1 , | |
| 2911 | .Xr group 5 , | |
| 2912 | .Xr passwd 5 | |
| 2913 | . | |
| 2914 | .It Li ".Sh STANDARDS" | |
| 2915 | If the command, library function or file adheres to a specific | |
| 2916 | implementation such as | |
| 2917 | .St -p1003.2 | |
| 2918 | or | |
| 2919 | .St -ansiC | |
| 2920 | this should be noted here. | |
| 2921 | If the command does not adhere to any standard, its history should be noted | |
| 2922 | in the | |
| 2923 | .Sx HISTORY | |
| 2924 | section. | |
| 2925 | . | |
| 2926 | .It Li ".Sh HISTORY" | |
| 2927 | Any command which does not adhere to any specific standards should be | |
| 2928 | outlined historically in this section. | |
| 2929 | . | |
| 2930 | .It Li ".Sh AUTHORS" | |
| 2931 | Credits should be placed here. | |
| 465b256c | 2932 | Use the |
| 92d0a6a6 | 2933 | .Ql .An |
| 465b256c JR |
2934 | macro for names and the |
| 2935 | .Ql .Aq | |
| 2936 | macro for e-mail addresses within optional contact information. | |
| 2937 | Explicitly indicate whether the person authored the initial manual page | |
| 2938 | or the software or whatever the person is being credited for. | |
| 92d0a6a6 JR |
2939 | .It Li ".Sh BUGS" |
| 2940 | Blatant problems with the topic go here. | |
| 2941 | .El | |
| 2942 | .Pp | |
| 2943 | . | |
| 2944 | User-specified | |
| 2945 | .Ql .Sh | |
| 2946 | sections may be added; for example, this section was set with: | |
| 2947 | . | |
| 2948 | .Bd -literal -offset 15n | |
| 2949 | \&.Sh "PAGE STRUCTURE DOMAIN" | |
| 2950 | .Ed | |
| 2951 | . | |
| 2952 | .Ss "Subsection Headers" | |
| 2953 | . | |
| 2954 | Subsection headers have exactly the same syntax as section headers: | |
| 2955 | .Ql .Ss | |
| 2956 | is parsed but not generally callable. | |
| 2957 | It can be used as an argument in a call to | |
| 2958 | .Ql .Ss | |
| 2959 | only; it then reactivates the default font for | |
| 2960 | .Ql .Ss . | |
| 2961 | .Pp | |
| 2962 | The default width is 8n. | |
| 2963 | . | |
| 2964 | .Ss "Paragraphs and Line Spacing" | |
| 2965 | . | |
| 2966 | .Bl -tag -width ".Li .Pp" | |
| 2967 | .It Li .Pp | |
| 2968 | The | |
| 2969 | .Ql .Pp | |
| 2970 | paragraph command may be used to specify a line space where necessary. | |
| 2971 | The macro is not necessary after a | |
| 2972 | .Ql .Sh | |
| 2973 | or | |
| 2974 | .Ql .Ss | |
| 2975 | macro or before a | |
| 2976 | .Ql .Bl | |
| 2977 | or | |
| 2978 | .Ql .Bd | |
| 2979 | macro (which both assert a vertical distance unless the | |
| 2980 | .Fl compact | |
| 2981 | flag is given). | |
| 2982 | .Pp | |
| 2983 | The macro is neither callable nor parsed and takes no arguments; an | |
| 2984 | alternative name is | |
| 2985 | .Ql .Lp . | |
| 2986 | .El | |
| 2987 | . | |
| 2988 | .\" XXX | |
| 2989 | . | |
| 2990 | .\" This worked with version one, need to redo for version three | |
| 2991 | .\" .Pp | |
| 2992 | .\" .Ds I | |
| 2993 | .\" .Cw (ax+bx+c) \ is\ produced\ by\ \& | |
| 2994 | .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& | |
| 2995 | .\" .Cl Cx \t\t | |
| 2996 | .\" .Li \&.Cx\ ( | |
| 2997 | .\" .Cx | |
| 2998 | .\" .Cl Cx \t\t | |
| 2999 | .\" .Li \&.Va ax | |
| 3000 | .\" .Cx | |
| 3001 | .\" .Cl Cx \t\t | |
| 3002 | .\" .Li \&.Sy \+ | |
| 3003 | .\" .Cx | |
| 3004 | .\" .Cl Cx \&(\& | |
| 3005 | .\" .Va ax | |
| 3006 | .\" .Cx + | |
| 3007 | .\" .Va by | |
| 3008 | .\" .Cx + | |
| 3009 | .\" .Va c ) | |
| 3010 | .\" .Cx \t | |
| 3011 | .\" .Em is produced by | |
| 3012 | .\" .Cx \t | |
| 3013 | .\" .Li \&.Va by | |
| 3014 | .\" .Cx | |
| 3015 | .\" .Cl Cx \t\t | |
| 3016 | .\" .Li \&.Sy \+ | |
| 3017 | .\" .Cx | |
| 3018 | .\" .Cl Cx \t\t | |
| 3019 | .\" .Li \&.Va c ) | |
| 3020 | .\" .Cx | |
| 3021 | .\" .Cl Cx \t\t | |
| 3022 | .\" .Li \&.Cx | |
| 3023 | .\" .Cx | |
| 3024 | .\" .Cw | |
| 3025 | .\" .De | |
| 3026 | .\" .Pp | |
| 3027 | .\" This example shows the same equation in a different format. | |
| 3028 | .\" The spaces | |
| 3029 | .\" around the | |
| 3030 | .\" .Li \&+ | |
| 3031 | .\" signs were forced with | |
| 3032 | .\" .Li \e : | |
| 3033 | .\" .Pp | |
| 3034 | .\" .Ds I | |
| 3035 | .\" .Cw (ax\ +\ bx\ +\ c) \ is\ produced\ by\ \& | |
| 3036 | .\" .\".Cw (ax+bx+c) \&.Va_by_) \&_and_\& \&[?/]m_b1_e1_f1[?/]\& | |
| 3037 | .\" .Cl Cx \t\t | |
| 3038 | .\" .Li \&.Cx\ ( | |
| 3039 | .\" .Cx | |
| 3040 | .\" .Cl Cx \t\t | |
| 3041 | .\" .Li \&.Va a | |
| 3042 | .\" .Cx | |
| 3043 | .\" .Cl Cx \t\t | |
| 3044 | .\" .Li \&.Sy x | |
| 3045 | .\" .Cx | |
| 3046 | .\" .Cl Cx \t\t | |
| 3047 | .\" .Li \&.Cx \e\ +\e\ \e& | |
| 3048 | .\" .Cx | |
| 3049 | .\" .Cl Cx \&(\& | |
| 3050 | .\" .Va a | |
| 3051 | .\" .Sy x | |
| 3052 | .\" .Cx \ +\ \& | |
| 3053 | .\" .Va b | |
| 3054 | .\" .Sy y | |
| 3055 | .\" .Cx \ +\ \& | |
| 3056 | .\" .Va c ) | |
| 3057 | .\" .Cx \t | |
| 3058 | .\" .Em is produced by | |
| 3059 | .\" .Cl Cx \t\t | |
| 3060 | .\" .Li \&.Va b | |
| 3061 | .\" .Cx | |
| 3062 | .\" .Cl Cx \t\t | |
| 3063 | .\" .Li \&.Sy y | |
| 3064 | .\" .Cx | |
| 3065 | .\" .Cl Cx \t\t | |
| 3066 | .\" .Li \&.Cx \e\ +\e\ \e& | |
| 3067 | .\" .Cx | |
| 3068 | .\" .Cl Cx \t\t | |
| 3069 | .\" .Li \&.Va c ) | |
| 3070 | .\" .Cx | |
| 3071 | .\" .Cl Cx \t\t | |
| 3072 | .\" .Li \&.Cx | |
| 3073 | .\" .Cx | |
| 3074 | .\" .Cw | |
| 3075 | .\" .De | |
| 3076 | .\" .Pp | |
| 3077 | .\" The incantation below was | |
| 3078 | .\" lifted from the | |
| 3079 | .\" .Xr adb 1 | |
| 3080 | .\" manual page: | |
| 3081 | .\" .Pp | |
| 3082 | .\" .Ds I | |
| 3083 | .\" .Cw \&[?/]m_b1_e1_f1[?/]\& is\ produced\ by | |
| 3084 | .\" .Cl Cx \t\t | |
| 3085 | .\" .Li \&.Cx Op Sy ?/ | |
| 3086 | .\" .Cx | |
| 3087 | .\" .Cl Cx \t\t | |
| 3088 | .\" .Li \&.Nm m | |
| 3089 | .\" .Cx | |
| 3090 | .\" .Cl Cx Op Sy ?/ | |
| 3091 | .\" .Nm m | |
| 3092 | .\" .Ad \ b1 e1 f1 | |
| 3093 | .\" .Op Sy ?/ | |
| 3094 | .\" .Cx \t | |
| 3095 | .\" .Em is produced by | |
| 3096 | .\" .Cx \t | |
| 3097 | .\" .Li \&.Ar \e\ b1 e1 f1 | |
| 3098 | .\" .Cx | |
| 3099 | .\" .Cl Cx \t\t | |
| 3100 | .\" .Li \&.Op Sy ?/ | |
| 3101 | .\" .Cx | |
| 3102 | .\" .Cl Cx \t\t | |
| 3103 | .\" .Li \&.Cx | |
| 3104 | .\" .Cx | |
| 3105 | .\" .Cw | |
| 3106 | .\" .De | |
| 3107 | .\" .Pp | |
| 3108 | . | |
| 3109 | .Ss Keeps | |
| 3110 | . | |
| 3111 | The only keep that is implemented at this time is for words. | |
| 3112 | The macros are | |
| 3113 | .Ql .Bk | |
| 3114 | (begin keep) | |
| 3115 | and | |
| 3116 | .Ql .Ek | |
| 3117 | (end keep). | |
| 3118 | The only option that | |
| 3119 | .Ql .Bk | |
| 3120 | accepts currently is | |
| 3121 | .Fl words | |
| 3122 | (this is also the default if no option is given) which is useful for | |
| 3123 | preventing line breaks in the middle of options. | |
| 3124 | In the example for the make command line arguments (see | |
| 3125 | .Sx What's in a Name ) , | |
| 3126 | the keep prevented | |
| 3127 | .Xr nroff | |
| 3128 | from placing up the flag and the argument on separate lines. | |
| 3129 | .Pp | |
| 3130 | Both macros are neither callable nor parsed. | |
| 3131 | .Pp | |
| 3132 | More work needs to be done with the keep macros; specifically, a | |
| 3133 | .Fl line | |
| 3134 | option should be added. | |
| 3135 | . | |
| 3136 | .Ss "Examples and Displays" | |
| 3137 | . | |
| 3138 | There are seven types of displays. | |
| 3139 | .Pp | |
| 3140 | .Bl -tag -width ".Li .D1" | |
| 3141 | .It Li .D1 | |
| 3142 | (This is D-one.) | |
| 3143 | Display one line of indented text. | |
| 3144 | This macro is parsed but not callable. | |
| 3145 | .Pp | |
| 3146 | .D1 Fl ldghfstru | |
| 3147 | .Pp | |
| 3148 | The above was produced by: | |
| 3149 | .Li ".D1 Fl ldghfstru" . | |
| 3150 | . | |
| 3151 | .It Li .Dl | |
| 3152 | (This is D-ell.) | |
| 3153 | Display one line of indented | |
| 3154 | .Em literal | |
| 3155 | text. | |
| 3156 | The | |
| 3157 | .Ql .Dl | |
| 3158 | example macro has been used throughout this file. | |
| 3159 | It allows the indentation (display) of one line of text. | |
| 3160 | Its default font is set to constant width (literal). | |
| 3161 | .Ql .Dl | |
| 3162 | is parsed but not callable. | |
| 3163 | .Pp | |
| 4d3e9548 | 3164 | .Dl % ls \-ldg /usr/local/bin |
| 92d0a6a6 JR |
3165 | .Pp |
| 3166 | The above was produced by: | |
| 4d3e9548 | 3167 | .Li ".Dl % ls \e\-ldg /usr/local/bin" . |
| 92d0a6a6 JR |
3168 | . |
| 3169 | .It Li .Bd | |
| 3170 | Begin display. | |
| 3171 | The | |
| 3172 | .Ql .Bd | |
| 3173 | display must be ended with the | |
| 3174 | .Ql .Ed | |
| 3175 | macro. | |
| 3176 | It has the following syntax: | |
| 3177 | .Pp | |
| 3178 | .Bd -ragged -compact | |
| 3179 | .Bl -tag -width ".Li .Bd" -offset indent | |
| 3180 | .It Li .Bd Xo | |
| 3181 | .Bro \-literal | \-filled | \-unfilled | \-ragged | \-centered Brc | |
| 3182 | .Oo \-offset Ao string Ac Oc Oo \-file Ao file name Ac Oc Oo \-compact Oc Xc | |
| 3183 | .El | |
| 3184 | .Ed | |
| 3185 | .Pp | |
| 3186 | . | |
| 3187 | .Bl -tag -width ".Fl file Ao Ar file name Ac " -compact | |
| 3188 | .It Fl ragged | |
| 3189 | Fill, but do not adjust the right margin (only left-justify). | |
| 3190 | .It Fl centered | |
| 3191 | Center lines between the current left and right margin. | |
| 3192 | Note that each single line is centered. | |
| 3193 | .It Fl unfilled | |
| 3194 | Do not fill; display a block of text as typed, using line breaks as | |
| 3195 | specified by the user. | |
| 3196 | This can produce overlong lines without warning messages. | |
| 3197 | .It Fl filled | |
| 3198 | Display a filled block. | |
| 3199 | The block of text is formatted (i.e., the text is justified on both the left | |
| 3200 | and right side). | |
| 3201 | .It Fl literal | |
| 3202 | Display block with literal font (usually fixed-width). | |
| 3203 | Useful for source code or simple tabbed or spaced text. | |
| 3204 | .It Fl file Ao Ar file name Ac | |
| 3205 | The file whose name follows the | |
| 3206 | .Fl file | |
| 3207 | flag is read and displayed before any data enclosed with | |
| 3208 | .Ql .Bd | |
| 3209 | and | |
| 3210 | .Ql .Ed , | |
| 3211 | using the selected display type. | |
| 3212 | Any | |
| 3213 | .Xr troff/ Ns Nm \-mdoc | |
| 3214 | commands in the file will be processed. | |
| 3215 | .It Fl offset Ao Ar string Ac | |
| 3216 | If | |
| 3217 | .Fl offset | |
| 3218 | is specified with one of the following strings, the string is interpreted to | |
| 3219 | indicate the level of indentation for the forthcoming block of text: | |
| 3220 | . | |
| 3221 | .Pp | |
| 3222 | .Bl -tag -width ".Ar indent-two" -compact | |
| 3223 | .It Ar left | |
| 3224 | Align block on the current left margin; this is the default mode of | |
| 3225 | .Ql .Bd . | |
| 3226 | .It Ar center | |
| 3227 | Supposedly center the block. | |
| 3228 | At this time unfortunately, the block merely gets left aligned about an | |
| 3229 | imaginary center margin. | |
| 3230 | .It Ar indent | |
| 3231 | Indent by one default indent value or tab. | |
| 3232 | The default indent value is also used for the | |
| 3233 | .Ql .D1 | |
| 3234 | and | |
| 3235 | .Ql .Dl | |
| 3236 | macros, so one is guaranteed the two types of displays will line up. | |
| 3237 | The indentation value is normally set to\~6n or about two thirds of an inch | |
| 3238 | (six constant width characters). | |
| 4d3e9548 | 3239 | .It Ar indent\-two |
| 92d0a6a6 JR |
3240 | Indent two times the default indent value. |
| 3241 | .It Ar right | |
| 3242 | This | |
| 3243 | .Em left | |
| 3244 | aligns the block about two inches from the right side of the page. | |
| 3245 | This macro needs work and perhaps may never do the right thing within | |
| 3246 | .Xr troff . | |
| 3247 | .El | |
| 3248 | .Pp | |
| 3249 | . | |
| 3250 | If | |
| 3251 | .Ao string Ac | |
| 3252 | is a valid numeric expression instead | |
| 3253 | .Pf ( Em with a scale indicator other than | |
| 3254 | .Sq Em u ) , | |
| 3255 | use that value for indentation. | |
| 3256 | The most useful scale indicators are | |
| 3257 | .Sq m | |
| 3258 | and | |
| 3259 | .Sq n , | |
| 3260 | specifying the so-called | |
| 3261 | .Em \&Em | |
| 3262 | and | |
| 3263 | .Em "En square" . | |
| 3264 | This is approximately the width of the letters | |
| 3265 | .Sq m | |
| 3266 | and | |
| 3267 | .Sq n | |
| 3268 | respectively | |
| 3269 | of the current font (for nroff output, both scale indicators give the same | |
| 3270 | values). | |
| 3271 | If | |
| 3272 | .Ao string Ac | |
| 3273 | isn't a numeric expression, it is tested whether it is an | |
| 3274 | .Nm \-mdoc | |
| 3275 | macro name, and the default offset value associated with this macro is used. | |
| 3276 | Finally, if all tests fail, | |
| 3277 | the width of | |
| 3278 | .Ao string Ac | |
| 3279 | (typeset with a fixed-width font) is taken as the offset. | |
| 3280 | .It Fl compact | |
| 3281 | Suppress insertion of vertical space before begin of display. | |
| 3282 | .El | |
| 3283 | . | |
| 3284 | .It Li .Ed | |
| 3285 | End display (takes no arguments). | |
| 3286 | .El | |
| 3287 | . | |
| 3288 | .Ss "Lists and Columns" | |
| 3289 | . | |
| 3290 | There are several types of lists which may be initiated with the | |
| 3291 | .Ql .Bl | |
| 3292 | begin-list macro. | |
| 3293 | Items within the list are specified with the | |
| 3294 | .Ql .It | |
| 3295 | item macro, and each list must end with the | |
| 3296 | .Ql .El | |
| 3297 | macro. | |
| 3298 | Lists may be nested within themselves and within displays. | |
| 3299 | The use of columns inside of lists or lists inside of columns is unproven. | |
| 3300 | .Pp | |
| 3301 | In addition, several list attributes may be specified such as the width of a | |
| 3302 | tag, the list offset, and compactness (blank lines between items allowed or | |
| 3303 | disallowed). | |
| 3304 | Most of this document has been formatted with a tag style list | |
| 3305 | .Pf ( Fl tag ) . | |
| 3306 | .Pp | |
| 3307 | It has the following syntax forms: | |
| 3308 | . | |
| 3309 | .Pp | |
| 3310 | .Bd -ragged -compact | |
| 3311 | .Bl -tag -width ".Li .Bl" -offset indent -compact | |
| 3312 | .It Li .Bl Xo | |
| 3313 | .Bro \-hang | \-ohang | \-tag | \-diag | \-inset Brc | |
| 3314 | .Oo \-width Ao string Ac Oc | |
| 3315 | .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc | |
| 3316 | .It Li .Bl Xo | |
| 3317 | .No \-column Oo \-offset Ao string Ac Oc | |
| 3318 | .Ao string1 Ac Ao string2 Ac ... Xc | |
| 3319 | .It Li .Bl Xo | |
| 3320 | .Bro \-item | \-enum Oo \-nested Oc | \-bullet | \-hyphen | \-dash Brc | |
| 3321 | .Oo \-offset Ao string Ac Oc Oo \-compact Oc Xc | |
| 3322 | .El | |
| 3323 | .Ed | |
| 3324 | .Pp | |
| 3325 | . | |
| 3326 | And now a detailed description of the list types. | |
| 3327 | . | |
| 3328 | .Pp | |
| 3329 | .Bl -tag -width ".Fl column" -compact | |
| 3330 | .It Fl bullet | |
| 3331 | A bullet list. | |
| 3332 | . | |
| 3333 | .Bd -literal -offset indent | |
| 4d3e9548 | 3334 | \&.Bl \-bullet \-offset indent \-compact |
| 92d0a6a6 JR |
3335 | \&.It |
| 3336 | Bullet one goes here. | |
| 3337 | \&.It | |
| 3338 | Bullet two here. | |
| 3339 | \&.El | |
| 3340 | .Ed | |
| 3341 | .Pp | |
| 3342 | . | |
| 3343 | Produces: | |
| 3344 | . | |
| 3345 | .Pp | |
| 3346 | .Bl -bullet -offset indent -compact | |
| 3347 | .It | |
| 3348 | Bullet one goes here. | |
| 3349 | .It | |
| 3350 | Bullet two here. | |
| 3351 | .El | |
| 3352 | .Pp | |
| 3353 | . | |
| 3354 | .It Fl dash No ( or Fl hyphen ) | |
| 3355 | A dash list. | |
| 3356 | . | |
| 3357 | .Bd -literal -offset indent | |
| 4d3e9548 | 3358 | \&.Bl \-dash \-offset indent \-compact |
| 92d0a6a6 JR |
3359 | \&.It |
| 3360 | Dash one goes here. | |
| 3361 | \&.It | |
| 3362 | Dash two here. | |
| 3363 | \&.El | |
| 3364 | .Ed | |
| 3365 | .Pp | |
| 3366 | . | |
| 3367 | Produces: | |
| 3368 | . | |
| 3369 | .Pp | |
| 3370 | .Bl -dash -offset indent -compact | |
| 3371 | .It | |
| 3372 | Dash one goes here. | |
| 3373 | .It | |
| 3374 | Dash two here. | |
| 3375 | .El | |
| 3376 | .Pp | |
| 3377 | . | |
| 3378 | .It Fl enum | |
| 3379 | An enumerated list. | |
| 3380 | . | |
| 3381 | .Bd -literal -offset indent | |
| 4d3e9548 | 3382 | \&.Bl \-enum \-offset indent \-compact |
| 92d0a6a6 JR |
3383 | \&.It |
| 3384 | Item one goes here. | |
| 3385 | \&.It | |
| 3386 | And item two here. | |
| 3387 | \&.El | |
| 3388 | .Ed | |
| 3389 | .Pp | |
| 3390 | . | |
| 3391 | The result: | |
| 3392 | . | |
| 3393 | .Pp | |
| 3394 | .Bl -enum -offset indent -compact | |
| 3395 | .It | |
| 3396 | Item one goes here. | |
| 3397 | .It | |
| 3398 | And item two here. | |
| 3399 | .El | |
| 3400 | .Pp | |
| 3401 | . | |
| 3402 | If you want to nest enumerated lists, use the | |
| 3403 | .Fl nested | |
| 3404 | flag (starting with the second-level list): | |
| 3405 | . | |
| 3406 | .Bd -literal -offset indent | |
| 4d3e9548 | 3407 | \&.Bl \-enum \-offset indent \-compact |
| 92d0a6a6 JR |
3408 | \&.It |
| 3409 | Item one goes here | |
| 4d3e9548 | 3410 | \&.Bl \-enum \-nested \-compact |
| 92d0a6a6 JR |
3411 | \&.It |
| 3412 | Item two goes here. | |
| 3413 | \&.It | |
| 3414 | And item three here. | |
| 3415 | \&.El | |
| 3416 | \&.It | |
| 3417 | And item four here. | |
| 3418 | \&.El | |
| 3419 | .Ed | |
| 3420 | .Pp | |
| 3421 | . | |
| 3422 | Result: | |
| 3423 | . | |
| 3424 | .Pp | |
| 3425 | .Bl -enum -offset indent -compact | |
| 3426 | .It | |
| 3427 | Item one goes here. | |
| 3428 | .Bl -enum -nested -compact | |
| 3429 | .It | |
| 3430 | Item two goes here. | |
| 3431 | .It | |
| 3432 | And item three here. | |
| 3433 | .El | |
| 3434 | .It | |
| 3435 | And item four here. | |
| 3436 | .El | |
| 3437 | .Pp | |
| 3438 | . | |
| 3439 | .It Fl item | |
| 3440 | A list of type | |
| 3441 | .Fl item | |
| 3442 | without list markers. | |
| 3443 | . | |
| 3444 | .Bd -literal -offset indent | |
| 4d3e9548 | 3445 | \&.Bl \-item \-offset indent |
| 92d0a6a6 JR |
3446 | \&.It |
| 3447 | Item one goes here. | |
| 3448 | Item one goes here. | |
| 3449 | Item one goes here. | |
| 3450 | \&.It | |
| 3451 | Item two here. | |
| 3452 | Item two here. | |
| 3453 | Item two here. | |
| 3454 | \&.El | |
| 3455 | .Ed | |
| 3456 | .Pp | |
| 3457 | . | |
| 3458 | Produces: | |
| 3459 | . | |
| 3460 | .Pp | |
| 3461 | .Bl -item -offset indent | |
| 3462 | .It | |
| 3463 | Item one goes here. | |
| 3464 | Item one goes here. | |
| 3465 | Item one goes here. | |
| 3466 | .It | |
| 3467 | Item two here. | |
| 3468 | Item two here. | |
| 3469 | Item two here. | |
| 3470 | .El | |
| 3471 | .Pp | |
| 3472 | . | |
| 3473 | .It Fl tag | |
| 3474 | A list with tags. | |
| 3475 | Use | |
| 3476 | .Fl width | |
| 3477 | to specify the tag width. | |
| 3478 | . | |
| 3479 | .Pp | |
| 3480 | .Bl -tag -width "PPID" -compact -offset indent | |
| 3481 | .It SL | |
| 3482 | sleep time of the process (seconds blocked) | |
| 3483 | .It PAGEIN | |
| 3484 | number of disk | |
| 3485 | .Tn I/O Ns 's | |
| 3486 | resulting from references by the process | |
| 3487 | to pages not loaded in core. | |
| 3488 | .It UID | |
| 3489 | numerical user-id of process owner | |
| 3490 | .It PPID | |
| 3491 | numerical id of parent of process priority | |
| 3492 | (non-positive when in non-interruptible wait) | |
| 3493 | .El | |
| 3494 | .Pp | |
| 3495 | . | |
| 3496 | The raw text: | |
| 3497 | . | |
| 3498 | .Bd -literal -offset indent | |
| 4d3e9548 | 3499 | \&.Bl \-tag \-width "PPID" \-compact \-offset indent |
| 92d0a6a6 JR |
3500 | \&.It SL |
| 3501 | sleep time of the process (seconds blocked) | |
| 3502 | \&.It PAGEIN | |
| 3503 | number of disk | |
| 3504 | \&.Tn I/O Ns 's | |
| 3505 | resulting from references by the process | |
| 3506 | to pages not loaded in core. | |
| 3507 | \&.It UID | |
| 4d3e9548 | 3508 | numerical user\-id of process owner |
| 92d0a6a6 JR |
3509 | \&.It PPID |
| 3510 | numerical id of parent of process priority | |
| 4d3e9548 | 3511 | (non\-positive when in non\-interruptible wait) |
| 92d0a6a6 JR |
3512 | \&.El |
| 3513 | .Ed | |
| 3514 | .Pp | |
| 3515 | . | |
| 3516 | .It Fl diag | |
| 3517 | Diag lists create section four diagnostic lists and are similar to inset | |
| 3518 | lists except callable macros are ignored. | |
| 3519 | The | |
| 3520 | .Fl width | |
| 3521 | flag is not meaningful in this context. | |
| 3522 | .Pp | |
| 3523 | Example: | |
| 3524 | . | |
| 3525 | .Bd -literal -offset indent | |
| 4d3e9548 | 3526 | \&.Bl \-diag |
| 92d0a6a6 JR |
3527 | \&.It You can't use Sy here. |
| 3528 | The message says all. | |
| 3529 | \&.El | |
| 3530 | .Ed | |
| 3531 | .Pp | |
| 3532 | . | |
| 3533 | produces | |
| 3534 | . | |
| 3535 | .Bl -diag | |
| 3536 | .It You can't use Sy here. | |
| 3537 | The message says all. | |
| 3538 | .El | |
| 3539 | .Pp | |
| 3540 | . | |
| 3541 | .It Fl hang | |
| 3542 | A list with hanging tags. | |
| 3543 | . | |
| 3544 | .Bl -hang -offset indent | |
| 3545 | .It Em Hanged | |
| 3546 | labels appear similar to tagged lists when the | |
| 3547 | label is smaller than the label width. | |
| 3548 | .It Em Longer hanged list labels | |
| 3549 | blend into the paragraph unlike | |
| 3550 | tagged paragraph labels. | |
| 3551 | .El | |
| 3552 | .Pp | |
| 3553 | And the unformatted text which created it: | |
| 3554 | . | |
| 3555 | .Bd -literal -offset indent | |
| 4d3e9548 | 3556 | \&.Bl \-hang \-offset indent |
| 92d0a6a6 JR |
3557 | \&.It Em Hanged |
| 3558 | labels appear similar to tagged lists when the | |
| 3559 | label is smaller than the label width. | |
| 3560 | \&.It Em Longer hanged list labels | |
| 3561 | blend into the paragraph unlike | |
| 3562 | tagged paragraph labels. | |
| 3563 | \&.El | |
| 3564 | .Ed | |
| 3565 | .Pp | |
| 3566 | . | |
| 3567 | .It Fl ohang | |
| 3568 | Lists with overhanging tags do not use indentation for the items; tags are | |
| 3569 | written to a separate line. | |
| 3570 | .Pp | |
| 3571 | .Bl -ohang -offset indent | |
| 3572 | .It Sy SL | |
| 3573 | sleep time of the process (seconds blocked) | |
| 3574 | .It Sy PAGEIN | |
| 3575 | number of disk | |
| 3576 | .Tn I/O Ns 's | |
| 3577 | resulting from references by the process | |
| 3578 | to pages not loaded in core. | |
| 3579 | .It Sy UID | |
| 3580 | numerical user-id of process owner | |
| 3581 | .It Sy PPID | |
| 3582 | numerical id of parent of process priority | |
| 3583 | (non-positive when in non-interruptible wait) | |
| 3584 | .El | |
| 3585 | .Pp | |
| 3586 | . | |
| 3587 | The raw text: | |
| 3588 | . | |
| 3589 | .Bd -literal -offset indent | |
| 4d3e9548 | 3590 | \&.Bl \-ohang \-offset indent |
| 92d0a6a6 JR |
3591 | \&.It Sy SL |
| 3592 | sleep time of the process (seconds blocked) | |
| 3593 | \&.It Sy PAGEIN | |
| 3594 | number of disk | |
| 3595 | \&.Tn I/O Ns 's | |
| 3596 | resulting from references by the process | |
| 3597 | to pages not loaded in core. | |
| 3598 | \&.It Sy UID | |
| 4d3e9548 | 3599 | numerical user\-id of process owner |
| 92d0a6a6 JR |
3600 | \&.It Sy PPID |
| 3601 | numerical id of parent of process priority | |
| 4d3e9548 | 3602 | (non\-positive when in non\-interruptible wait) |
| 92d0a6a6 JR |
3603 | \&.El |
| 3604 | .Ed | |
| 3605 | .Pp | |
| 3606 | . | |
| 3607 | .It Fl inset | |
| 3608 | Here is an example of inset labels: | |
| 3609 | .Bl -inset -offset indent | |
| 3610 | .It Em Tag | |
| 3611 | The tagged list (also called a tagged paragraph) | |
| 3612 | is the most common type of list used in the | |
| 3613 | Berkeley manuals. | |
| 3614 | Use a | |
| 3615 | .Fl width | |
| 3616 | attribute as described below. | |
| 3617 | .It Em Diag | |
| 3618 | Diag lists create section four diagnostic lists | |
| 3619 | and are similar to inset lists except callable | |
| 3620 | macros are ignored. | |
| 3621 | .It Em Hang | |
| 3622 | Hanged labels are a matter of taste. | |
| 3623 | .It Em Ohang | |
| 3624 | Overhanging labels are nice when space is constrained. | |
| 3625 | .It Em Inset | |
| 3626 | Inset labels are useful for controlling blocks of | |
| 3627 | paragraphs and are valuable for converting | |
| 3628 | .Nm \-mdoc | |
| 3629 | manuals to other formats. | |
| 3630 | .El | |
| 3631 | .Pp | |
| 3632 | Here is the source text which produced the above example: | |
| 3633 | . | |
| 3634 | .Bd -literal -offset indent | |
| 4d3e9548 | 3635 | \&.Bl \-inset \-offset indent |
| 92d0a6a6 JR |
3636 | \&.It Em Tag |
| 3637 | The tagged list (also called a tagged paragraph) | |
| 3638 | is the most common type of list used in the | |
| 3639 | Berkeley manuals. | |
| 3640 | \&.It Em Diag | |
| 3641 | Diag lists create section four diagnostic lists | |
| 3642 | and are similar to inset lists except callable | |
| 3643 | macros are ignored. | |
| 3644 | \&.It Em Hang | |
| 3645 | Hanged labels are a matter of taste. | |
| 3646 | \&.It Em Ohang | |
| 3647 | Overhanging labels are nice when space is constrained. | |
| 3648 | \&.It Em Inset | |
| 3649 | Inset labels are useful for controlling blocks of | |
| 3650 | paragraphs and are valuable for converting | |
| 3651 | \&.Nm \-mdoc | |
| 3652 | manuals to other formats. | |
| 3653 | \&.El | |
| 3654 | .Ed | |
| 3655 | .Pp | |
| 3656 | . | |
| 3657 | .It Fl column | |
| 3658 | This list type generates multiple columns. | |
| 3659 | The number of columns and the width of each column is determined by the | |
| 3660 | arguments to the | |
| 3661 | .Fl column | |
| 3662 | list, | |
| 3663 | .Aq Ar string1 , | |
| 3664 | .Aq Ar string2 , | |
| 3665 | etc. | |
| 3666 | If | |
| 3667 | .Aq Ar stringN | |
| 3668 | starts with a | |
| 3669 | .Ql .\& | |
| 3670 | (dot) immediately followed by a valid | |
| 3671 | .Nm \-mdoc | |
| 3672 | macro name, interpret | |
| 3673 | .Aq Ar stringN | |
| 3674 | and use the width of the result. | |
| 3675 | Otherwise, the width of | |
| 3676 | .Aq Ar stringN | |
| 3677 | (typeset with a fixed-width font) is taken as the | |
| 3678 | .Ar N Ns th | |
| 3679 | column width. | |
| 3680 | .Pp | |
| 3681 | Each | |
| 3682 | .Ql .It | |
| 3683 | argument is parsed to make a row, each column within the row is a separate | |
| 3684 | argument separated by a tab or the | |
| 3685 | .Ql .Ta | |
| 3686 | macro. | |
| 3687 | .Pp | |
| 3688 | The table: | |
| 3689 | . | |
| 3690 | .Bl -column -offset indent ".Sy String" ".Sy Nroff" ".Sy Troff" | |
| 3691 | .It Sy String Ta Sy Nroff Ta Sy Troff | |
| 3692 | .It Li <= Ta <= Ta \*(<= | |
| 3693 | .It Li >= Ta >= Ta \*(>= | |
| 3694 | .El | |
| 3695 | .Pp | |
| 3696 | . | |
| 3697 | was produced by: | |
| 3698 | . | |
| 3699 | .Bd -literal | |
| 4d3e9548 | 3700 | \&.Bl \-column \-offset indent ".Sy String" ".Sy Nroff" ".Sy Troff" |
| 92d0a6a6 JR |
3701 | \&.It Sy String Ta Sy Nroff Ta Sy Troff |
| 3702 | \&.It Li <= Ta <= Ta \e*(<= | |
| 3703 | \&.It Li >= Ta >= Ta \e*(>= | |
| 3704 | \&.El | |
| 3705 | .Ed | |
| 4d3e9548 JL |
3706 | .Pp |
| 3707 | . | |
| 3708 | Don't abuse this list type! | |
| 3709 | For more complicated cases it might be far better and easier to use | |
| 3710 | .Xr tbl 1 , | |
| 3711 | the table preprocessor. | |
| 92d0a6a6 JR |
3712 | .El |
| 3713 | .Pp | |
| 3714 | . | |
| 3715 | Other keywords: | |
| 3716 | . | |
| 3717 | .Bl -tag -width ".Fl indent Ao Ar string Ac" | |
| 3718 | .It Fl width Ao Ar string Ac | |
| 3719 | If | |
| 3720 | .Aq Ar string | |
| 3721 | starts with a | |
| 3722 | .Ql .\& | |
| 3723 | (dot) immediately followed by a valid | |
| 3724 | .Nm \-mdoc | |
| 3725 | macro name, interpret | |
| 3726 | .Aq Ar string | |
| 3727 | and use the width of the result. | |
| 3728 | Almost all lists in this document use this option. | |
| 3729 | .Pp | |
| 3730 | Example: | |
| 3731 | . | |
| 3732 | .Bd -literal -offset indent | |
| 4d3e9548 | 3733 | \&.Bl \-tag \-width ".Fl test Ao Ar string Ac" |
| 92d0a6a6 JR |
3734 | \&.It Fl test Ao Ar string Ac |
| 3735 | This is a longer sentence to show how the | |
| 3736 | \&.Fl width | |
| 3737 | flag works in combination with a tag list. | |
| 3738 | \&.El | |
| 3739 | .Ed | |
| 3740 | .Pp | |
| 3741 | . | |
| 3742 | gives: | |
| 3743 | . | |
| 3744 | .Bl -tag -width ".Fl test Ao Ar string Ac" | |
| 3745 | .It Fl test Ao Ar string Ac | |
| 3746 | This is a longer sentence to show how the | |
| 3747 | .Fl width | |
| 3748 | flag works in combination with a tag list. | |
| 3749 | .El | |
| 3750 | .Pp | |
| 3751 | . | |
| 3752 | (Note that the current state of | |
| 3753 | .Nm \-mdoc | |
| 3754 | is saved before | |
| 3755 | .Aq Ar string | |
| 3756 | is interpreted; afterwards, all variables are restored again. | |
| 3757 | However, boxes (used for enclosures) can't be saved in | |
| 3758 | .Tn GNU | |
| 3759 | .Xr troff 1 ; | |
| 3760 | as a consequence, arguments must always be | |
| 3761 | .Em balanced | |
| 3762 | to avoid nasty errors. | |
| 3763 | For example, do not write | |
| 3764 | .Ql ".Ao Ar string" | |
| 3765 | but | |
| 3766 | .Ql ".Ao Ar string Xc" | |
| 3767 | instead if you really need only an opening angle bracket.) | |
| 3768 | .Pp | |
| 3769 | Otherwise, if | |
| 3770 | .Aq Ar string | |
| 3771 | is a valid numeric expression | |
| 3772 | .Em ( with a scale indicator other than | |
| 3773 | .Sq Em u ) , | |
| 3774 | use that value for indentation. | |
| 3775 | The most useful scale indicators are | |
| 3776 | .Sq m | |
| 3777 | and | |
| 3778 | .Sq n , | |
| 3779 | specifying the so-called | |
| 3780 | .Em \&Em | |
| 3781 | and | |
| 3782 | .Em "En square" . | |
| 3783 | This is approximately the width of the letters | |
| 3784 | .Sq m | |
| 3785 | and | |
| 3786 | .Sq n | |
| 3787 | respectively | |
| 3788 | of the current font (for nroff output, both scale indicators give the same | |
| 3789 | values). | |
| 3790 | If | |
| 3791 | .Aq Ar string | |
| 3792 | isn't a numeric expression, it is tested whether it is an | |
| 3793 | .Nm \-mdoc | |
| 3794 | macro name, and the default width value associated with this macro is used. | |
| 3795 | Finally, if all tests fail, | |
| 3796 | the width of | |
| 3797 | .Aq Ar string | |
| 3798 | (typeset with a fixed-width font) is taken as the width. | |
| 3799 | .Pp | |
| 3800 | If a width is not specified for the tag list type, every time | |
| 3801 | .Ql .It | |
| 3802 | is invoked, an attempt is made to determine an appropriate width. | |
| 3803 | If the first argument to | |
| 3804 | .Ql .It | |
| 3805 | is a callable macro, the default width for that macro will be used; | |
| 3806 | otherwise, the default width of | |
| 3807 | .Ql .No | |
| 3808 | is used. | |
| 3809 | .It Fl offset Ao Ar string Ac | |
| 3810 | If | |
| 3811 | .Aq Ar string | |
| 3812 | is | |
| 3813 | .Ar indent , | |
| 3814 | a default indent value (normally set to\~6n, similar to the value used in | |
| 3815 | .Ql .Dl | |
| 3816 | or | |
| 3817 | .Ql .Bd ) | |
| 3818 | is used. | |
| 3819 | If | |
| 3820 | .Aq Ar string | |
| 3821 | is a valid numeric expression instead | |
| 3822 | .Pf ( Em with a scale indicator other than | |
| 3823 | .Sq Em u ) , | |
| 3824 | use that value for indentation. | |
| 3825 | The most useful scale indicators are | |
| 3826 | .Sq m | |
| 3827 | and | |
| 3828 | .Sq n , | |
| 3829 | specifying the so-called | |
| 3830 | .Em \&Em | |
| 3831 | and | |
| 3832 | .Em "En square" . | |
| 3833 | This is approximately the width of the letters | |
| 3834 | .Sq m | |
| 3835 | and | |
| 3836 | .Sq n | |
| 3837 | respectively | |
| 3838 | of the current font (for nroff output, both scale indicators give the same | |
| 3839 | values). | |
| 3840 | If | |
| 3841 | .Aq Ar string | |
| 3842 | isn't a numeric expression, it is tested whether it is an | |
| 3843 | .Nm \-mdoc | |
| 3844 | macro name, and the default offset value associated with this macro is used. | |
| 3845 | Finally, if all tests fail, | |
| 3846 | the width of | |
| 3847 | .Aq Ar string | |
| 3848 | (typeset with a fixed-width font) is taken as the offset. | |
| 3849 | .It Fl compact | |
| 3850 | Suppress insertion of vertical space before the list and between list items. | |
| 3851 | .El | |
| 3852 | . | |
| 3853 | . | |
| 3854 | .Sh "MISCELLANEOUS MACROS" | |
| 3855 | . | |
| 3856 | Here a list of the remaining macros which do not fit well into one of the | |
| 3857 | above sections. | |
| 3858 | We couldn't find real examples for the following macros: | |
| 3859 | .Ql .Me | |
| 3860 | and | |
| 3861 | .Ql .Ot . | |
| 3862 | They are documented here for completeness \- if you know how to use them | |
| 3863 | properly please send a mail to | |
| 3864 | .Mt bug-groff@gnu.org | |
| 3865 | (including an example). | |
| 3866 | . | |
| 3867 | .Bl -tag -width ".Li .Bt" | |
| 3868 | .It Li .Bt | |
| 3869 | prints | |
| 3870 | . | |
| 3871 | .Bd -ragged -offset indent | |
| 3872 | .Bt | |
| 3873 | .Ed | |
| 3874 | .Pp | |
| 3875 | It is neither callable nor parsed and takes no arguments. | |
| 3876 | . | |
| 3877 | .It Li .Fr | |
| 3878 | .Pp | |
| 3879 | .Dl Usage: .Fr Ao function return value Ac ... | |
| 3880 | .Pp | |
| 3881 | Don't use this macro. | |
| 3882 | It allows a break right before the return value (usually a single digit) | |
| 3883 | which is bad typographical behaviour. | |
| 3884 | Use | |
| 3885 | .Ql \e~ | |
| 3886 | to tie the return value to the previous word. | |
| 3887 | . | |
| 3888 | .It Li .Hf | |
| 3889 | Use this macro to include a (header) file literally. | |
| 3890 | It first prints | |
| 3891 | .Ql File: | |
| 3892 | followed by the file name, then the contents of | |
| 3893 | .Ao file Ac . | |
| 3894 | .Pp | |
| 3895 | .Dl Usage: .Hf Ao file Ac | |
| 3896 | .Pp | |
| 3897 | It is neither callable nor parsed. | |
| 3898 | . | |
| 3899 | .It Li .Lk | |
| 3900 | To be written. | |
| 3901 | . | |
| 3902 | .It Li .Me | |
| 3903 | Exact usage unknown. | |
| 3904 | The documentation in the | |
| 3905 | .Nm \-mdoc | |
| 3906 | source file describes it as a macro for | |
| 3907 | .Dq "menu entries" . | |
| 3908 | .Pp | |
| 3909 | Its default width is 6n. | |
| 3910 | . | |
| 3911 | .It Li .Mt | |
| 3912 | To be written. | |
| 3913 | . | |
| 3914 | .It Li .Ot | |
| 3915 | Exact usage unknown. | |
| 3916 | The documentation in the | |
| 3917 | .Nm \-mdoc | |
| 3918 | source file describes it as | |
| 3919 | .Dq old function type (fortran) . | |
| 3920 | . | |
| 3921 | .It Li .Sm | |
| 3922 | Activate (toggle) space mode. | |
| 3923 | .Pp | |
| 3924 | .Dl Usage: .Sm Oo on | off Oc ... | |
| 3925 | .Pp | |
| 3926 | If space mode is off, no spaces between macro arguments are inserted. | |
| 3927 | If called without a parameter (or if the next parameter is neither | |
| 3928 | .Ql on | |
| 3929 | nor | |
| 3930 | .Ql off , | |
| 3931 | .Ql .Sm | |
| 3932 | toggles space mode. | |
| 3933 | . | |
| 3934 | .It Li .Ud | |
| 3935 | prints | |
| 3936 | . | |
| 3937 | .Bd -ragged -offset indent | |
| 3938 | .Ud | |
| 3939 | .Ed | |
| 3940 | .Pp | |
| 3941 | It is neither callable nor parsed and takes no arguments. | |
| 3942 | .El | |
| 3943 | . | |
| 3944 | . | |
| 3945 | .Sh "PREDEFINED STRINGS" | |
| 3946 | . | |
| 3947 | The following strings are predefined: | |
| 3948 | .Pp | |
| 3949 | .Bl -column String infinity "Troff " "straight double quote" -offset indent | |
| 3950 | .It Sy String Ta Sy Nroff Ta Sy Troff Ta Sy Meaning | |
| 3951 | .It Li <= Ta <= Ta \*[<=] Ta "less equal" | |
| 3952 | .It Li >= Ta >= Ta \*[>=] Ta "greater equal" | |
| 3953 | .It Li Rq Ta '' Ta \*[Rq] Ta "right double quote" | |
| 3954 | .It Li Lq Ta `` Ta \*[Lq] Ta "left double quote" | |
| 3955 | .It Li ua Ta ^ Ta \*[ua] Ta "upwards arrow" | |
| 3956 | .It Li aa Ta \' Ta \*[aa] Ta "acute accent" | |
| 3957 | .It Li ga Ta \` Ta \*[ga] Ta "grave accent" | |
| 3958 | .It Li q Ta \&" Ta \*[q] Ta "straight double quote" | |
| 3959 | .It Li Pi Ta pi Ta \*[Pi] Ta "greek pi" | |
| 3960 | .It Li Ne Ta != Ta \*[Ne] Ta "not equal" | |
| 3961 | .It Li Le Ta <= Ta \*[Le] Ta "less equal" | |
| 3962 | .It Li Ge Ta >= Ta \*[Ge] Ta "greater equal" | |
| 3963 | .It Li Lt Ta < Ta \*[Lt] Ta "less than" | |
| 3964 | .It Li Gt Ta > Ta \*[Gt] Ta "greater than" | |
| 3965 | .It Li Pm Ta +\- Ta \*[Pm] Ta "plus minus" | |
| 3966 | .It Li If Ta infinity Ta \*[If] Ta "infinity" | |
| 3967 | .It Li Am Ta \*[Am] Ta \*[Am] Ta "ampersand" | |
| 3968 | .It Li Na Ta \*[Na] Ta \*[Na] Ta "not a number" | |
| 3969 | .It Li Ba Ta \*[Ba] Ta \*[Ba] Ta "vertical bar" | |
| 3970 | .El | |
| 3971 | .Pp | |
| 3972 | The names of the columns | |
| 3973 | .Sy Nroff | |
| 3974 | and | |
| 3975 | .Sy Troff | |
| 3976 | are a bit misleading; | |
| 3977 | .Sy Nroff | |
| 3978 | shows the | |
| 3979 | .Tn ASCII | |
| 3980 | representation, while | |
| 3981 | .Sy Troff | |
| 3982 | gives the best glyph form available. | |
| 3983 | For example, a Unicode enabled | |
| 3984 | .Tn TTY Ns - Ns | |
| 3985 | device will have proper glyph representations for all strings, whereas the | |
| 3986 | enhancement for a Latin1 | |
| 3987 | .Tn TTY Ns - Ns | |
| 3988 | device is only the plus-minus sign. | |
| 3989 | .Pp | |
| 3990 | String names which consist of two characters can be written as | |
| 3991 | .Ql \e*(xx ; | |
| 3992 | string names which consist of one character can be written as | |
| 3993 | .Ql \e*x . | |
| 3994 | A generic syntax for a string name of any length is | |
| 3995 | .Ql \e*[xxx] | |
| 3996 | (this is a | |
| 3997 | .Tn GNU | |
| 3998 | .Xr troff 1 | |
| 3999 | extension). | |
| 4000 | . | |
| 4001 | . | |
| 4002 | \# | |
| 4003 | \#===================================================================== | |
| 4004 | \# | |
| 4005 | .Sh DIAGNOSTICS | |
| 4006 | . | |
| 4007 | The debugging macro | |
| 4008 | .Ql .Db | |
| 4009 | available in previous versions of | |
| 4010 | .Nm \-mdoc | |
| 4011 | has been removed since | |
| 4012 | .Tn GNU | |
| 4013 | .Xr troff 1 | |
| 4014 | provides better facilities to check parameters; additionally, many error and | |
| 4015 | warning messages have been added to this macro package, making it both more | |
| 4016 | robust and verbose. | |
| 4017 | .Pp | |
| 4018 | The only remaining debugging macro is | |
| 4019 | .Ql .Rd | |
| 4020 | which yields a register dump of all global registers and strings. | |
| 4021 | A normal user will never need it. | |
| 4022 | . | |
| 4023 | . | |
| 4024 | .Sh "FORMATTING WITH GROFF, TROFF, AND NROFF" | |
| 4025 | . | |
| 4026 | By default, the package inhibits page breaks, headers, and footers if | |
| 4027 | displayed with a | |
| 4028 | .Tn TTY | |
| 4029 | device like | |
| 4030 | .Sq latin1 | |
| 4031 | or | |
| 4032 | .Sq unicode , | |
| 4033 | to make the manual more efficient for viewing on-line. | |
| 4034 | This behaviour can be changed (e.g.\& to create a hardcopy of the | |
| 4035 | .Tn TTY | |
| 4036 | output) by setting the register | |
| 4037 | .Ql cR | |
| 4038 | to zero while calling | |
| 4039 | .Xr groff 1 , | |
| 4040 | resulting in multiple pages instead of a single, very long page: | |
| 4041 | .Pp | |
| 4d3e9548 | 4042 | .Dl groff \-Tlatin1 \-rcR=0 \-mdoc foo.man > foo.txt |
| 92d0a6a6 JR |
4043 | .Pp |
| 4044 | For double-sided printing, set register | |
| 4045 | .Ql D | |
| 4046 | to\~1: | |
| 4047 | .Pp | |
| 4d3e9548 | 4048 | .Dl groff \-Tps \-rD1 \-mdoc foo.man > foo.ps |
| 92d0a6a6 JR |
4049 | .Pp |
| 4050 | To change the document font size to 11pt or 12pt, set register | |
| 4051 | .Ql S | |
| 4052 | accordingly: | |
| 4053 | .Pp | |
| 4d3e9548 | 4054 | .Dl groff \-Tdvi \-rS11 \-mdoc foo.man > foo.dvi |
| 92d0a6a6 JR |
4055 | .Pp |
| 4056 | Register | |
| 4057 | .Ql S | |
| 4058 | is ignored for | |
| 4059 | .Tn TTY | |
| 4060 | devices. | |
| 4061 | .Pp | |
| 4062 | The line and title length can be changed by setting the registers | |
| 4063 | .Ql LL | |
| 4064 | and | |
| 4065 | .Ql LT , | |
| 4066 | respectively: | |
| 4067 | .Pp | |
| 4d3e9548 | 4068 | .Dl groff \-Tutf8 \-rLL=100n \-rLT=100n \-mdoc foo.man | less |
| 92d0a6a6 JR |
4069 | .Pp |
| 4070 | If not set, both registers default to 78n for TTY devices and 6.5i | |
| 4071 | otherwise. | |
| 4072 | . | |
| 4073 | . | |
| 4074 | .Sh FILES | |
| 4075 | . | |
| 4076 | .Bl -tag -width mdoc/doc-ditroff -compact | |
| 4077 | .It Pa doc.tmac | |
| 4078 | The main manual macro package. | |
| 4079 | .It Pa mdoc.tmac | |
| 4080 | A wrapper file to call | |
| 4081 | .Pa doc.tmac . | |
| 4082 | .It Pa mdoc/doc-common | |
| 4083 | Common strings, definitions, stuff related typographic output. | |
| 4084 | .It Pa mdoc/doc-nroff | |
| 4085 | Definitions used for a | |
| 4086 | .Tn TTY | |
| 4087 | output device. | |
| 4088 | .It Pa mdoc/doc-ditroff | |
| 4089 | Definitions used for all other devices. | |
| 4090 | .It Pa mdoc.local | |
| 4091 | Local additions and customizations. | |
| 4092 | .It Pa andoc.tmac | |
| 4d3e9548 | 4093 | Use this file if you don't know whether the |
| 92d0a6a6 JR |
4094 | .Nm \-mdoc |
| 4095 | or the | |
| 4096 | .Nm \-man | |
| 4097 | package should be used. | |
| 4d3e9548 | 4098 | Multiple man pages (in either format) can be handled. |
| 92d0a6a6 JR |
4099 | .El |
| 4100 | . | |
| 4101 | . | |
| 4102 | .Sh "SEE ALSO" | |
| 4103 | . | |
| 4104 | .Xr groff 1 , | |
| 4105 | .Xr man 1 , | |
| 4106 | .Xr troff 1 , | |
| 4107 | .Xr groff_man 7 | |
| 4108 | . | |
| 4109 | . | |
| 4110 | .Sh BUGS | |
| 4111 | . | |
| 4112 | Section 3f has not been added to the header routines. | |
| 4113 | .Pp | |
| 4114 | .Ql \&.Nm | |
| 4115 | font should be changed in | |
| 4116 | .Sx NAME | |
| 4117 | section. | |
| 4118 | .Pp | |
| 4119 | .Ql \&.Fn | |
| 4120 | needs to have a check to prevent splitting up | |
| 4121 | if the line length is too short. | |
| 4122 | Occasionally it | |
| 4123 | separates the last parenthesis, and sometimes | |
| 4124 | looks ridiculous if a line is in fill mode. | |
| 4125 | .Pp | |
| 4126 | The list and display macros do not do any keeps | |
| 4127 | and certainly should be able to. | |
| 4128 | .\" Note what happens if the parameter list overlaps a newline | |
| 4129 | .\" boundary. | |
| 4130 | .\" to make sure a line boundary is crossed: | |
| 4131 | .\" .Bd -literal | |
| 4132 | .\" \&.Fn struct\e\ dictionarytable\e\ *dictionarylookup struct\e\ dictionarytable\e\ *tab[] | |
| 4133 | .\" .Ed | |
| 4134 | .\" .Pp | |
| 4135 | .\" produces, nudge nudge, | |
| 4136 | .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , | |
| 4137 | .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] , | |
| 4138 | .\" nudge | |
| 4139 | .\" .Fn struct\ dictionarytable\ *dictionarylookup char\ *h struct\ dictionarytable\ *tab[] . | |
| 4140 | .\" .Pp | |
| 4141 | .\" If double quotes are used, for example: | |
| 4142 | .\" .Bd -literal | |
| 4143 | .\" \&.Fn \*qstruct dictionarytable *dictionarylookup\*q \*qchar *h\*q \*qstruct dictionarytable *tab[]\*q | |
| 4144 | .\" .Ed | |
| 4145 | .\" .Pp | |
| 4146 | .\" produces, nudge nudge, | |
| 4147 | .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , | |
| 4148 | .\" nudge | |
| 4149 | .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" , | |
| 4150 | .\" nudge | |
| 4151 | .\" .Fn "struct dictionarytable *dictionarylookup" "char *h" "struct dictionarytable *tab[]" . | |
| 4152 | .\" .Pp | |
| 4153 | .\" Not a pretty sight... | |
| 4154 | .\" In a paragraph, a long parameter containing unpaddable spaces as | |
| 4155 | .\" in the former example will cause | |
| 4156 | .\" .Xr troff | |
| 4157 | .\" to break the line and spread | |
| 4158 | .\" the remaining words out. | |
| 4159 | .\" The latter example will adjust nicely to | |
| 4160 | .\" justified margins, but may break in between an argument and its | |
| 4161 | .\" declaration. | |
| 4162 | .\" In | |
| 4163 | .\" .Xr nroff | |
| 4164 | .\" the right margin adjustment is normally ragged and the problem is | |
| 4165 | .\" not as severe. | |
| 4166 | . | |
| 4167 | .\" Local Variables: | |
| 4168 | .\" mode: nroff | |
| 4169 | .\" End: |