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