]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
Clarify that predefined strings aren't groff-isms, they're troff-isms.
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.145 2010/08/07 09:56:12 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
5 .\"
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .\"
18 .Dd $Mdocdate: August 7 2010 $
19 .Dt MDOC 7
20 .Os
21 .Sh NAME
22 .Nm mdoc
23 .Nd mdoc language reference
24 .Sh DESCRIPTION
25 The
26 .Nm mdoc
27 language is used to format
28 .Bx
29 .Ux
30 manuals.
31 This reference document describes its syntax, structure, and
32 usage.
33 The reference implementation is
34 .Xr mandoc 1 ;
35 the
36 .Sx COMPATIBILITY
37 section describes compatibility with other troff \-mdoc implementations.
38 .Pp
39 An
40 .Nm
41 document follows simple rules: lines beginning with the control
42 character
43 .Sq \.
44 are parsed for macros.
45 Other lines are interpreted within the scope of
46 prior macros:
47 .Bd -literal -offset indent
48 \&.Sh Macro lines change control state.
49 Other lines are interpreted within the current state.
50 .Ed
51 .Sh LANGUAGE SYNTAX
52 .Nm
53 documents may contain only graphable 7-bit ASCII characters, the space
54 character, and, in certain circumstances, the tab character.
55 All manuals must have
56 .Ux
57 line terminators.
58 .Ss Comments
59 Text following a
60 .Sq \e\*q ,
61 whether in a macro or free-form text line, is ignored to the end of
62 line.
63 A macro line with only a control character and comment escape,
64 .Sq \&.\e\*q ,
65 is also ignored.
66 Macro lines with only a control character and optional whitespace are
67 stripped from input.
68 .Ss Reserved Characters
69 Within a macro line, the following characters are reserved:
70 .Pp
71 .Bl -tag -width Ds -offset indent -compact
72 .It \&.
73 .Pq period
74 .It \&,
75 .Pq comma
76 .It \&:
77 .Pq colon
78 .It \&;
79 .Pq semicolon
80 .It \&(
81 .Pq left-parenthesis
82 .It \&)
83 .Pq right-parenthesis
84 .It \&[
85 .Pq left-bracket
86 .It \&]
87 .Pq right-bracket
88 .It \&?
89 .Pq question
90 .It \&!
91 .Pq exclamation
92 .It \&|
93 .Pq vertical bar
94 .El
95 .Pp
96 Use of reserved characters is described in
97 .Sx MACRO SYNTAX .
98 For general use in macro lines, these characters can either be escaped
99 with a non-breaking space
100 .Pq Sq \e&
101 or, if applicable, an appropriate escape sequence can be used.
102 .Ss Special Characters
103 Special characters may occur in both macro and free-form lines.
104 Sequences begin with the escape character
105 .Sq \e
106 followed by either an open-parenthesis
107 .Sq \&(
108 for two-character sequences; an open-bracket
109 .Sq \&[
110 for n-character sequences (terminated at a close-bracket
111 .Sq \&] ) ;
112 or a single one character sequence.
113 See
114 .Xr mandoc_char 7
115 for a complete list.
116 Examples include
117 .Sq \e(em
118 .Pq em-dash
119 and
120 .Sq \ee
121 .Pq back-slash .
122 .Ss Text Decoration
123 Terms may be text-decorated using the
124 .Sq \ef
125 escape followed by an indicator: B (bold), I (italic), R (Roman), or P
126 (revert to previous mode):
127 .Pp
128 .D1 \efBbold\efR \efIitalic\efP
129 .Pp
130 A numerical representation 3, 2, or 1 (bold, italic, and Roman,
131 respectively) may be used instead.
132 A text decoration is valid within
133 the current font scope only: if a macro opens a font scope alongside
134 its own scope, such as
135 .Sx \&Bf
136 .Cm \&Sy ,
137 in-scope invocations of
138 .Sq \ef
139 are only valid within the font scope of the macro.
140 If
141 .Sq \ef
142 is specified outside of any font scope, such as in unenclosed, free-form
143 text, it will affect the remainder of the document.
144 .Pp
145 Note this form is
146 .Em not
147 recommended for
148 .Nm ,
149 which encourages semantic annotation.
150 .Ss Predefined Strings
151 Historically,
152 troff
153 also defined a set of package-specific
154 .Dq predefined strings ,
155 which, like
156 .Sx Special Characters ,
157 mark special output characters and strings by way of input codes.
158 Predefined strings are escaped with the slash-asterisk,
159 .Sq \e* :
160 single-character
161 .Sq \e*X ,
162 two-character
163 .Sq \e*(XX ,
164 and N-character
165 .Sq \e*[N] .
166 See
167 .Xr mandoc_char 7
168 for a complete list.
169 Examples include
170 .Sq \e*(Am
171 .Pq ampersand
172 and
173 .Sq \e*(Ba
174 .Pq vertical bar .
175 .Ss Whitespace
176 Whitespace consists of the space character.
177 In free-form lines, whitespace is preserved within a line; unescaped
178 trailing spaces are stripped from input (unless in a literal context).
179 Blank free-form lines, which may include whitespace, are only permitted
180 within literal contexts.
181 .Pp
182 In macro lines, whitespace delimits arguments and is discarded.
183 If arguments are quoted, whitespace within the quotes is retained.
184 .Ss Quotation
185 Macro arguments may be quoted with double-quotes to group
186 space-delimited terms or to retain blocks of whitespace.
187 A quoted argument begins with a double-quote preceded by whitespace.
188 The next double-quote not pairwise adjacent to another double-quote
189 terminates the literal, regardless of surrounding whitespace.
190 .Pp
191 Note that any quoted text, even if it would cause a macro invocation
192 when unquoted, is considered literal text.
193 Thus, the following produces
194 .Sq Op "Fl a" :
195 .Bd -literal -offset indent
196 \&.Op "Fl a"
197 .Ed
198 .Pp
199 In free-form mode, quotes are regarded as opaque text.
200 .Ss Dates
201 There are several macros in
202 .Nm
203 that require a date argument.
204 The canonical form for dates is the American format:
205 .Pp
206 .D1 Cm Month Day , Year
207 .Pp
208 The
209 .Cm Day
210 value is an optionally zero-padded numeral.
211 The
212 .Cm Month
213 value is the full month name.
214 The
215 .Cm Year
216 value is the full four-digit year.
217 .Pp
218 Reduced form dates are broken-down canonical form dates:
219 .Pp
220 .D1 Cm Month , Year
221 .D1 Cm Year
222 .Pp
223 Some examples of valid dates follow:
224 .Pp
225 .D1 "May, 2009" Pq reduced form
226 .D1 "2009" Pq reduced form
227 .D1 "May 20, 2009" Pq canonical form
228 .Ss Scaling Widths
229 Many macros support scaled widths for their arguments, such as
230 stipulating a two-inch list indentation with the following:
231 .Bd -literal -offset indent
232 \&.Bl -tag -width 2i
233 .Ed
234 .Pp
235 The syntax for scaled widths is
236 .Sq Li [+-]?[0-9]*.[0-9]*[:unit:] ,
237 where a decimal must be preceded or proceeded by at least one digit.
238 Negative numbers, while accepted, are truncated to zero.
239 The following scaling units are accepted:
240 .Pp
241 .Bl -tag -width Ds -offset indent -compact
242 .It c
243 centimetre
244 .It i
245 inch
246 .It P
247 pica (~1/6 inch)
248 .It p
249 point (~1/72 inch)
250 .It f
251 synonym for
252 .Sq u
253 .It v
254 default vertical span
255 .It m
256 width of rendered
257 .Sq m
258 .Pq em
259 character
260 .It n
261 width of rendered
262 .Sq n
263 .Pq en
264 character
265 .It u
266 default horizontal span
267 .It M
268 mini-em (~1/100 em)
269 .El
270 .Pp
271 Using anything other than
272 .Sq m ,
273 .Sq n ,
274 .Sq u ,
275 or
276 .Sq v
277 is necessarily non-portable across output media.
278 See
279 .Sx COMPATIBILITY .
280 .Ss Sentence Spacing
281 When composing a manual, make sure that sentences end at the end of
282 a line.
283 By doing so, front-ends will be able to apply the proper amount of
284 spacing after the end of sentence (unescaped) period, exclamation mark,
285 or question mark followed by zero or more non-sentence closing
286 delimiters (
287 .Ns Sq \&) ,
288 .Sq \&] ,
289 .Sq \&' ,
290 .Sq \&" ) .
291 .Pp
292 The proper spacing is also intelligently preserved if a sentence ends at
293 the boundary of a macro line.
294 For example:
295 .Pp
296 .D1 \&Xr mandoc 1 \.
297 .D1 \&Fl T \&Ns \&Cm ascii \.
298 .Sh MANUAL STRUCTURE
299 A well-formed
300 .Nm
301 document consists of a document prologue followed by one or more
302 sections.
303 .Pp
304 The prologue, which consists of the
305 .Sx \&Dd ,
306 .Sx \&Dt ,
307 and
308 .Sx \&Os
309 macros in that order, is required for every document.
310 .Pp
311 The first section (sections are denoted by
312 .Sx \&Sh )
313 must be the NAME section, consisting of at least one
314 .Sx \&Nm
315 followed by
316 .Sx \&Nd .
317 .Pp
318 Following that, convention dictates specifying at least the
319 .Em SYNOPSIS
320 and
321 .Em DESCRIPTION
322 sections, although this varies between manual sections.
323 .Pp
324 The following is a well-formed skeleton
325 .Nm
326 file:
327 .Bd -literal -offset indent
328 \&.Dd $\&Mdocdate$
329 \&.Dt mdoc 7
330 \&.Os
331 \&.Sh NAME
332 \&.Nm foo
333 \&.Nd a description goes here
334 \&.\e\*q The next is for sections 2, 3, & 9 only.
335 \&.\e\*q .Sh LIBRARY
336 \&.Sh SYNOPSIS
337 \&.Nm foo
338 \&.Op Fl options
339 \&.Ar
340 \&.Sh DESCRIPTION
341 The
342 \&.Nm
343 utility processes files ...
344 \&.\e\*q .Sh IMPLEMENTATION NOTES
345 \&.\e\*q The next is for sections 2, 3, & 9 only.
346 \&.\e\*q .Sh RETURN VALUES
347 \&.\e\*q The next is for sections 1, 6, 7, & 8 only.
348 \&.\e\*q .Sh ENVIRONMENT
349 \&.\e\*q .Sh FILES
350 \&.\e\*q The next is for sections 1 & 8 only.
351 \&.\e\*q .Sh EXIT STATUS
352 \&.\e\*q .Sh EXAMPLES
353 \&.\e\*q The next is for sections 1, 4, 6, 7, & 8 only.
354 \&.\e\*q .Sh DIAGNOSTICS
355 \&.\e\*q The next is for sections 2, 3, & 9 only.
356 \&.\e\*q .Sh ERRORS
357 \&.\e\*q .Sh SEE ALSO
358 \&.\e\*q .Xr foobar 1
359 \&.\e\*q .Sh STANDARDS
360 \&.\e\*q .Sh HISTORY
361 \&.\e\*q .Sh AUTHORS
362 \&.\e\*q .Sh CAVEATS
363 \&.\e\*q .Sh BUGS
364 \&.\e\*q .Sh SECURITY CONSIDERATIONS
365 .Ed
366 .Pp
367 The sections in an
368 .Nm
369 document are conventionally ordered as they appear above.
370 Sections should be composed as follows:
371 .Bl -ohang -offset Ds
372 .It Em NAME
373 The name(s) and a one line description of the documented material.
374 The syntax for this as follows:
375 .Bd -literal -offset indent
376 \&.Nm name0 ,
377 \&.Nm name1 ,
378 \&.Nm name2
379 \&.Nd a one line description
380 .Ed
381 .Pp
382 The
383 .Sx \&Nm
384 macro(s) must precede the
385 .Sx \&Nd
386 macro.
387 .Pp
388 See
389 .Sx \&Nm
390 and
391 .Sx \&Nd .
392 .It Em LIBRARY
393 The name of the library containing the documented material, which is
394 assumed to be a function in a section 2, 3, or 9 manual.
395 The syntax for this is as follows:
396 .Bd -literal -offset indent
397 \&.Lb libarm
398 .Ed
399 .Pp
400 See
401 .Sx \&Lb .
402 .It Em SYNOPSIS
403 Documents the utility invocation syntax, function call syntax, or device
404 configuration.
405 .Pp
406 For the first, utilities (sections 1, 6, and 8), this is
407 generally structured as follows:
408 .Bd -literal -offset indent
409 \&.Nm foo
410 \&.Op Fl v
411 \&.Op Fl o Ar file
412 \&.Op Ar
413 \&.Nm bar
414 \&.Op Fl v
415 \&.Op Fl o Ar file
416 \&.Op Ar
417 .Ed
418 .Pp
419 For the second, function calls (sections 2, 3, 9):
420 .Bd -literal -offset indent
421 \&.Vt extern const char *global;
422 \&.In header.h
423 \&.Ft "char *"
424 \&.Fn foo "const char *src"
425 \&.Ft "char *"
426 \&.Fn bar "const char *src"
427 .Ed
428 .Pp
429 And for the third, configurations (section 4):
430 .Bd -literal -offset indent
431 \&.Cd \*qit* at isa? port 0x2e\*q
432 \&.Cd \*qit* at isa? port 0x4e\*q
433 .Ed
434 .Pp
435 Manuals not in these sections generally don't need a
436 .Em SYNOPSIS .
437 .Pp
438 Some macros are displayed differently in the
439 .Em SYNOPSIS
440 section, particularly
441 .Sx \&Nm ,
442 .Sx \&Cd ,
443 .Sx \&Fd ,
444 .Sx \&Fn ,
445 .Sx \&Fo ,
446 .Sx \&In ,
447 .Sx \&Vt ,
448 and
449 .Sx \&Ft .
450 All of these macros are output on their own line.
451 If two such dissimilar macros are pairwise invoked (except for
452 .Sx \&Ft
453 before
454 .Sx \&Fo
455 or
456 .Sx \&Fn ) ,
457 they are separated by a vertical space, unless in the case of
458 .Sx \&Fo ,
459 .Sx \&Fn ,
460 and
461 .Sx \&Ft ,
462 which are always separated by vertical space.
463 .Pp
464 When text and macros following an
465 .Sx \&Nm
466 macro starting an input line span multiple output lines,
467 all output lines but the first will be indented to align
468 with the text immediately following the
469 .Sx \&Nm
470 macro, up to the next
471 .Sx \&Nm ,
472 .Sx \&Sh ,
473 or
474 .Sx \&Ss
475 macro or the end of an enclosing block, whichever comes first.
476 .It Em DESCRIPTION
477 This expands upon the brief, one line description in
478 .Em NAME .
479 It usually contains a breakdown of the options (if documenting a
480 command), such as:
481 .Bd -literal -offset indent
482 The arguments are as follows:
483 \&.Bl \-tag \-width Ds
484 \&.It Fl v
485 Print verbose information.
486 \&.El
487 .Ed
488 .Pp
489 Manuals not documenting a command won't include the above fragment.
490 .It Em IMPLEMENTATION NOTES
491 Implementation-specific notes should be kept here.
492 This is useful when implementing standard functions that may have side
493 effects or notable algorithmic implications.
494 .It Em RETURN VALUES
495 This section documents the
496 return values of functions in sections 2, 3, and 9.
497 .Pp
498 See
499 .Sx \&Rv .
500 .It Em ENVIRONMENT
501 Lists the environment variables used by the utility,
502 and explains the syntax and semantics of their values.
503 The
504 .Xr environ 7
505 manual provides examples of typical content and formatting.
506 .Pp
507 See
508 .Sx \&Ev .
509 .It Em FILES
510 Documents files used.
511 It's helpful to document both the file name and a short description of how
512 the file is used (created, modified, etc.).
513 .Pp
514 See
515 .Sx \&Pa .
516 .It Em EXIT STATUS
517 This section documents the
518 command exit status for section 1, 6, and 8 utilities.
519 Historically, this information was described in
520 .Em DIAGNOSTICS ,
521 a practise that is now discouraged.
522 .Pp
523 See
524 .Sx \&Ex .
525 .It Em EXAMPLES
526 Example usages.
527 This often contains snippets of well-formed, well-tested invocations.
528 Make sure that examples work properly!
529 .It Em DIAGNOSTICS
530 Documents error conditions.
531 This is most useful in section 4 manuals.
532 Historically, this section was used in place of
533 .Em EXIT STATUS
534 for manuals in sections 1, 6, and 8; however, this practise is
535 discouraged.
536 .Pp
537 See
538 .Sx \&Bl
539 .Fl diag .
540 .It Em ERRORS
541 Documents error handling in sections 2, 3, and 9.
542 .Pp
543 See
544 .Sx \&Er .
545 .It Em SEE ALSO
546 References other manuals with related topics.
547 This section should exist for most manuals.
548 Cross-references should conventionally be ordered first by section, then
549 alphabetically.
550 .Pp
551 See
552 .Sx \&Xr .
553 .It Em STANDARDS
554 References any standards implemented or used.
555 If not adhering to any standards, the
556 .Em HISTORY
557 section should be used instead.
558 .Pp
559 See
560 .Sx \&St .
561 .It Em HISTORY
562 A brief history of the subject, including where support first appeared.
563 .It Em AUTHORS
564 Credits to the person or persons who wrote the code and/or documentation.
565 Authors should generally be noted by both name and email address.
566 .Pp
567 See
568 .Sx \&An .
569 .It Em CAVEATS
570 Common misuses and misunderstandings should be explained
571 in this section.
572 .It Em BUGS
573 Known bugs, limitations and work-arounds should be described
574 in this section.
575 .It Em SECURITY CONSIDERATIONS
576 Documents any security precautions that operators should consider.
577 .El
578 .Sh MACRO SYNTAX
579 Macros are one to three three characters in length and begin with a
580 control character,
581 .Sq \&. ,
582 at the beginning of the line.
583 An arbitrary amount of whitespace may sit between the control character
584 and the macro name.
585 Thus, the following are equivalent:
586 .Bd -literal -offset indent
587 \&.Pp
588 \&.\ \ \ \&Pp
589 .Ed
590 .Pp
591 The syntax of a macro depends on its classification.
592 In this section,
593 .Sq \-arg
594 refers to macro arguments, which may be followed by zero or more
595 .Sq parm
596 parameters;
597 .Sq \&Yo
598 opens the scope of a macro; and if specified,
599 .Sq \&Yc
600 closes it out.
601 .Pp
602 The
603 .Em Callable
604 column indicates that the macro may be called subsequent to the initial
605 line-macro.
606 If a macro is not callable, then its invocation after the initial line
607 macro is interpreted as opaque text, such that
608 .Sq \&.Fl \&Sh
609 produces
610 .Sq Fl \&Sh .
611 .Pp
612 The
613 .Em Parsed
614 column indicates whether the macro may be followed by further
615 (ostensibly callable) macros.
616 If a macro is not parsed, subsequent macro invocations on the line
617 will be interpreted as opaque text.
618 .Pp
619 The
620 .Em Scope
621 column, if applicable, describes closure rules.
622 .Ss Block full-explicit
623 Multi-line scope closed by an explicit closing macro.
624 All macros contains bodies; only
625 .Sx \&Bf
626 contains a head.
627 .Bd -literal -offset indent
628 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
629 \(lBbody...\(rB
630 \&.Yc
631 .Ed
632 .Pp
633 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXX"
634 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
635 .It Sx \&Bd Ta \&No Ta \&No Ta closed by Sx \&Ed
636 .It Sx \&Bf Ta \&No Ta \&No Ta closed by Sx \&Ef
637 .It Sx \&Bk Ta \&No Ta \&No Ta closed by Sx \&Ek
638 .It Sx \&Bl Ta \&No Ta \&No Ta closed by Sx \&El
639 .It Sx \&Ed Ta \&No Ta \&No Ta opened by Sx \&Bd
640 .It Sx \&Ef Ta \&No Ta \&No Ta opened by Sx \&Bf
641 .It Sx \&Ek Ta \&No Ta \&No Ta opened by Sx \&Bk
642 .It Sx \&El Ta \&No Ta \&No Ta opened by Sx \&Bl
643 .El
644 .Ss Block full-implicit
645 Multi-line scope closed by end-of-file or implicitly by another macro.
646 All macros have bodies; some
647 .Po
648 .Sx \&It Fl bullet ,
649 .Fl hyphen ,
650 .Fl dash ,
651 .Fl enum ,
652 .Fl item
653 .Pc
654 don't have heads; only one
655 .Po
656 .Sx \&It
657 in
658 .Sx \&Bl Fl column
659 .Pc
660 has multiple heads.
661 .Bd -literal -offset indent
662 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
663 \(lBbody...\(rB
664 .Ed
665 .Pp
666 .Bl -column -compact -offset indent "MacroX" "CallableX" "ParsedX" "closed by XXXXXXXXXXX"
667 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
668 .It Sx \&It Ta \&No Ta Yes Ta closed by Sx \&It , Sx \&El
669 .It Sx \&Nd Ta \&No Ta \&No Ta closed by Sx \&Sh
670 .It Sx \&Nm Ta \&No Ta Yes Ta closed by Sx \&Nm , Sx \&Sh , Sx \&Ss
671 .It Sx \&Sh Ta \&No Ta \&No Ta closed by Sx \&Sh
672 .It Sx \&Ss Ta \&No Ta \&No Ta closed by Sx \&Sh , Sx \&Ss
673 .El
674 .Pp
675 Note that the
676 .Sx \&Nm
677 macro is a
678 .Sx Block full-implicit
679 macro only when invoked as the first macro
680 in a
681 .Em SYNOPSIS
682 section line, else it is
683 .Sx In-line .
684 .Ss Block partial-explicit
685 Like block full-explicit, but also with single-line scope.
686 Each has at least a body and, in limited circumstances, a head
687 .Po
688 .Sx \&Fo ,
689 .Sx \&Eo
690 .Pc
691 and/or tail
692 .Pq Sx \&Ec .
693 .Bd -literal -offset indent
694 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB
695 \(lBbody...\(rB
696 \&.Yc \(lBtail...\(rB
697
698 \&.Yo \(lB\-arg \(lBparm...\(rB\(rB \(lBhead...\(rB \
699 \(lBbody...\(rB \&Yc \(lBtail...\(rB
700 .Ed
701 .Pp
702 .Bl -column "MacroX" "CallableX" "ParsedX" "closed by XXXX" -compact -offset indent
703 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Scope
704 .It Sx \&Ac Ta Yes Ta Yes Ta opened by Sx \&Ao
705 .It Sx \&Ao Ta Yes Ta Yes Ta closed by Sx \&Ac
706 .It Sx \&Bc Ta Yes Ta Yes Ta closed by Sx \&Bo
707 .It Sx \&Bo Ta Yes Ta Yes Ta opened by Sx \&Bc
708 .It Sx \&Brc Ta Yes Ta Yes Ta opened by Sx \&Bro
709 .It Sx \&Bro Ta Yes Ta Yes Ta closed by Sx \&Brc
710 .It Sx \&Dc Ta Yes Ta Yes Ta opened by Sx \&Do
711 .It Sx \&Do Ta Yes Ta Yes Ta closed by Sx \&Dc
712 .It Sx \&Ec Ta Yes Ta Yes Ta opened by Sx \&Eo
713 .It Sx \&Eo Ta Yes Ta Yes Ta closed by Sx \&Ec
714 .It Sx \&Fc Ta Yes Ta Yes Ta opened by Sx \&Fo
715 .It Sx \&Fo Ta \&No Ta \&No Ta closed by Sx \&Fc
716 .It Sx \&Oc Ta Yes Ta Yes Ta closed by Sx \&Oo
717 .It Sx \&Oo Ta Yes Ta Yes Ta opened by Sx \&Oc
718 .It Sx \&Pc Ta Yes Ta Yes Ta closed by Sx \&Po
719 .It Sx \&Po Ta Yes Ta Yes Ta opened by Sx \&Pc
720 .It Sx \&Qc Ta Yes Ta Yes Ta opened by Sx \&Oo
721 .It Sx \&Qo Ta Yes Ta Yes Ta closed by Sx \&Oc
722 .It Sx \&Re Ta \&No Ta \&No Ta opened by Sx \&Rs
723 .It Sx \&Rs Ta \&No Ta \&No Ta closed by Sx \&Re
724 .It Sx \&Sc Ta Yes Ta Yes Ta opened by Sx \&So
725 .It Sx \&So Ta Yes Ta Yes Ta closed by Sx \&Sc
726 .It Sx \&Xc Ta Yes Ta Yes Ta opened by Sx \&Xo
727 .It Sx \&Xo Ta Yes Ta Yes Ta closed by Sx \&Xc
728 .El
729 .Ss Block partial-implicit
730 Like block full-implicit, but with single-line scope closed by
731 .Sx Reserved Characters
732 or end of line.
733 .Bd -literal -offset indent
734 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBres...\(rB
735 .Ed
736 .Pp
737 .Bl -column "MacroX" "CallableX" "ParsedX" -compact -offset indent
738 .It Em Macro Ta Em Callable Ta Em Parsed
739 .It Sx \&Aq Ta Yes Ta Yes
740 .It Sx \&Bq Ta Yes Ta Yes
741 .It Sx \&Brq Ta Yes Ta Yes
742 .It Sx \&D1 Ta \&No Ta \&Yes
743 .It Sx \&Dl Ta \&No Ta Yes
744 .It Sx \&Dq Ta Yes Ta Yes
745 .It Sx \&Op Ta Yes Ta Yes
746 .It Sx \&Pq Ta Yes Ta Yes
747 .It Sx \&Ql Ta Yes Ta Yes
748 .It Sx \&Qq Ta Yes Ta Yes
749 .It Sx \&Sq Ta Yes Ta Yes
750 .It Sx \&Vt Ta Yes Ta Yes
751 .El
752 .Pp
753 Note that the
754 .Sx \&Vt
755 macro is a
756 .Sx Block partial-implicit
757 only when invoked as the first macro
758 in a
759 .Em SYNOPSIS
760 section line, else it is
761 .Sx In-line .
762 .Ss In-line
763 Closed by
764 .Sx Reserved Characters ,
765 end of line, fixed argument lengths, and/or subsequent macros.
766 In-line macros have only text children.
767 If a number (or inequality) of arguments is
768 .Pq n ,
769 then the macro accepts an arbitrary number of arguments.
770 .Bd -literal -offset indent
771 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB \(lBres...\(rB
772
773 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB Yc...
774
775 \&.Yo \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
776 .Ed
777 .Pp
778 .Bl -column "MacroX" "CallableX" "ParsedX" "Arguments" -compact -offset indent
779 .It Em Macro Ta Em Callable Ta Em Parsed Ta Em Arguments
780 .It Sx \&%A Ta \&No Ta \&No Ta >0
781 .It Sx \&%B Ta \&No Ta \&No Ta >0
782 .It Sx \&%C Ta \&No Ta \&No Ta >0
783 .It Sx \&%D Ta \&No Ta \&No Ta >0
784 .It Sx \&%I Ta \&No Ta \&No Ta >0
785 .It Sx \&%J Ta \&No Ta \&No Ta >0
786 .It Sx \&%N Ta \&No Ta \&No Ta >0
787 .It Sx \&%O Ta \&No Ta \&No Ta >0
788 .It Sx \&%P Ta \&No Ta \&No Ta >0
789 .It Sx \&%Q Ta \&No Ta \&No Ta >0
790 .It Sx \&%R Ta \&No Ta \&No Ta >0
791 .It Sx \&%T Ta \&No Ta \&No Ta >0
792 .It Sx \&%U Ta \&No Ta \&No Ta >0
793 .It Sx \&%V Ta \&No Ta \&No Ta >0
794 .It Sx \&Ad Ta Yes Ta Yes Ta n
795 .It Sx \&An Ta Yes Ta Yes Ta n
796 .It Sx \&Ap Ta Yes Ta Yes Ta 0
797 .It Sx \&Ar Ta Yes Ta Yes Ta n
798 .It Sx \&At Ta Yes Ta Yes Ta 1
799 .It Sx \&Bsx Ta Yes Ta Yes Ta n
800 .It Sx \&Bt Ta \&No Ta \&No Ta 0
801 .It Sx \&Bx Ta Yes Ta Yes Ta n
802 .It Sx \&Cd Ta Yes Ta Yes Ta >0
803 .It Sx \&Cm Ta Yes Ta Yes Ta n
804 .It Sx \&Db Ta \&No Ta \&No Ta 1
805 .It Sx \&Dd Ta \&No Ta \&No Ta n
806 .It Sx \&Dt Ta \&No Ta \&No Ta n
807 .It Sx \&Dv Ta Yes Ta Yes Ta n
808 .It Sx \&Dx Ta Yes Ta Yes Ta n
809 .It Sx \&Em Ta Yes Ta Yes Ta >0
810 .It Sx \&En Ta \&No Ta \&No Ta 0
811 .It Sx \&Er Ta Yes Ta Yes Ta >0
812 .It Sx \&Es Ta \&No Ta \&No Ta 0
813 .It Sx \&Ev Ta Yes Ta Yes Ta n
814 .It Sx \&Ex Ta \&No Ta \&No Ta n
815 .It Sx \&Fa Ta Yes Ta Yes Ta n
816 .It Sx \&Fd Ta \&No Ta \&No Ta >0
817 .It Sx \&Fl Ta Yes Ta Yes Ta n
818 .It Sx \&Fn Ta Yes Ta Yes Ta >0
819 .It Sx \&Fr Ta \&No Ta \&No Ta n
820 .It Sx \&Ft Ta Yes Ta Yes Ta n
821 .It Sx \&Fx Ta Yes Ta Yes Ta n
822 .It Sx \&Hf Ta \&No Ta \&No Ta n
823 .It Sx \&Ic Ta Yes Ta Yes Ta >0
824 .It Sx \&In Ta \&No Ta \&No Ta n
825 .It Sx \&Lb Ta \&No Ta \&No Ta 1
826 .It Sx \&Li Ta Yes Ta Yes Ta n
827 .It Sx \&Lk Ta Yes Ta Yes Ta n
828 .It Sx \&Lp Ta \&No Ta \&No Ta 0
829 .It Sx \&Ms Ta Yes Ta Yes Ta >0
830 .It Sx \&Mt Ta Yes Ta Yes Ta >0
831 .It Sx \&Nm Ta Yes Ta Yes Ta n
832 .It Sx \&No Ta Yes Ta Yes Ta 0
833 .It Sx \&Ns Ta Yes Ta Yes Ta 0
834 .It Sx \&Nx Ta Yes Ta Yes Ta n
835 .It Sx \&Os Ta \&No Ta \&No Ta n
836 .It Sx \&Ot Ta \&No Ta \&No Ta n
837 .It Sx \&Ox Ta Yes Ta Yes Ta n
838 .It Sx \&Pa Ta Yes Ta Yes Ta n
839 .It Sx \&Pf Ta Yes Ta Yes Ta 1
840 .It Sx \&Pp Ta \&No Ta \&No Ta 0
841 .It Sx \&Rv Ta \&No Ta \&No Ta n
842 .It Sx \&Sm Ta \&No Ta \&No Ta 1
843 .It Sx \&St Ta \&No Ta Yes Ta 1
844 .It Sx \&Sx Ta Yes Ta Yes Ta >0
845 .It Sx \&Sy Ta Yes Ta Yes Ta >0
846 .It Sx \&Tn Ta Yes Ta Yes Ta >0
847 .It Sx \&Ud Ta \&No Ta \&No Ta 0
848 .It Sx \&Ux Ta Yes Ta Yes Ta n
849 .It Sx \&Va Ta Yes Ta Yes Ta n
850 .It Sx \&Vt Ta Yes Ta Yes Ta >0
851 .It Sx \&Xr Ta Yes Ta Yes Ta >0
852 .It Sx \&br Ta \&No Ta \&No Ta 0
853 .It Sx \&sp Ta \&No Ta \&No Ta 1
854 .El
855 .Sh REFERENCE
856 This section is a canonical reference of all macros, arranged
857 alphabetically.
858 For the scoping of individual macros, see
859 .Sx MACRO SYNTAX .
860 .Ss \&%A
861 Author name of an
862 .Sx \&Rs
863 block.
864 Multiple authors should each be accorded their own
865 .Sx \%%A
866 line.
867 Author names should be ordered with full or abbreviated forename(s)
868 first, then full surname.
869 .Ss \&%B
870 Book title of an
871 .Sx \&Rs
872 block.
873 This macro may also be used in a non-bibliographic context when
874 referring to book titles.
875 .Ss \&%C
876 Publication city or location of an
877 .Sx \&Rs
878 block.
879 .Pp
880 .Em Remarks :
881 this macro is not implemented in
882 .Xr groff 1 .
883 .Ss \&%D
884 Publication date of an
885 .Sx \&Rs
886 block.
887 This should follow the reduced or canonical form syntax described in
888 .Sx Dates .
889 .Ss \&%I
890 Publisher or issuer name of an
891 .Sx \&Rs
892 block.
893 .Ss \&%J
894 Journal name of an
895 .Sx \&Rs
896 block.
897 .Ss \&%N
898 Issue number (usually for journals) of an
899 .Sx \&Rs
900 block.
901 .Ss \&%O
902 Optional information of an
903 .Sx \&Rs
904 block.
905 .Ss \&%P
906 Book or journal page number of an
907 .Sx \&Rs
908 block.
909 .Ss \&%Q
910 Institutional author (school, government, etc.) of an
911 .Sx \&Rs
912 block.
913 Multiple institutional authors should each be accorded their own
914 .Sx \&%Q
915 line.
916 .Ss \&%R
917 Technical report name of an
918 .Sx \&Rs
919 block.
920 .Ss \&%T
921 Article title of an
922 .Sx \&Rs
923 block.
924 This macro may also be used in a non-bibliographical context when
925 referring to article titles.
926 .Ss \&%U
927 URI of reference document.
928 .Ss \&%V
929 Volume number of an
930 .Sx \&Rs
931 block.
932 .Ss \&Ac
933 Close an
934 .Sx \&Ao
935 block.
936 Does not have any tail arguments.
937 .Ss \&Ad
938 Memory address.
939 Do not use this for postal addresses.
940 .Pp
941 Examples:
942 .D1 \&.Ad [0,$]
943 .D1 \&.Ad 0x00000000
944 .Ss \&An
945 Author name.
946 Requires either the name of an author or one of the following arguments:
947 .Pp
948 .Bl -tag -width "-nosplitX" -offset indent -compact
949 .It Fl split
950 Start a new output line before each subsequent invocation of
951 .Sx \&An .
952 .It Fl nosplit
953 The opposite of
954 .Fl split .
955 .El
956 .Pp
957 The default is
958 .Fl nosplit .
959 The effect of selecting either of the
960 .Fl split
961 modes ends at the beginning of the
962 .Em AUTHORS
963 section.
964 In the
965 .Em AUTHORS
966 section, the default is
967 .Fl nosplit
968 for the first author listing and
969 .Fl split
970 for all other author listings.
971 .Pp
972 Examples:
973 .D1 \&.An -nosplit
974 .D1 \&.An Kristaps Dzonsons \&Aq kristaps@bsd.lv
975 .Ss \&Ao
976 Begin a block enclosed by angle brackets.
977 Does not have any head arguments.
978 .Pp
979 Examples:
980 .D1 \&.Fl -key= \&Ns \&Ao \&Ar val \&Ac
981 .Pp
982 See also
983 .Sx \&Aq .
984 .Ss \&Ap
985 Inserts an apostrophe without any surrounding whitespace.
986 This is generally used as a grammatical device when referring to the verb
987 form of a function.
988 .Pp
989 Examples:
990 .D1 \&.Fn execve \&Ap d
991 .Ss \&Aq
992 Encloses its arguments in angle brackets.
993 .Pp
994 Examples:
995 .D1 \&.Fl -key= \&Ns \&Aq \&Ar val
996 .Pp
997 .Em Remarks :
998 this macro is often abused for rendering URIs, which should instead use
999 .Sx \&Lk
1000 or
1001 .Sx \&Mt ,
1002 or to note pre-processor
1003 .Dq Li #include
1004 statements, which should use
1005 .Sx \&In .
1006 .Pp
1007 See also
1008 .Sx \&Ao .
1009 .Ss \&Ar
1010 Command arguments.
1011 If an argument is not provided, the string
1012 .Dq file ...\&
1013 is used as a default.
1014 .Pp
1015 Examples:
1016 .D1 \&.Fl o \&Ns \&Ar file1
1017 .D1 \&.Ar
1018 .D1 \&.Ar arg1 , arg2 .
1019 .Ss \&At
1020 Formats an AT&T version.
1021 Accepts one optional argument:
1022 .Pp
1023 .Bl -tag -width "v[1-7] | 32vX" -offset indent -compact
1024 .It Cm v[1-7] | 32v
1025 A version of
1026 .At .
1027 .It Cm V[.[1-4]]?
1028 A version of
1029 .At V .
1030 .El
1031 .Pp
1032 Note that these arguments do not begin with a hyphen.
1033 .Pp
1034 Examples:
1035 .D1 \&.At
1036 .D1 \&.At V.1
1037 .Pp
1038 See also
1039 .Sx \&Bsx ,
1040 .Sx \&Bx ,
1041 .Sx \&Dx ,
1042 .Sx \&Fx ,
1043 .Sx \&Nx ,
1044 .Sx \&Ox ,
1045 and
1046 .Sx \&Ux .
1047 .Ss \&Bc
1048 Close a
1049 .Sx \&Bo
1050 block.
1051 Does not have any tail arguments.
1052 .Ss \&Bd
1053 Begin a display block.
1054 Its syntax is as follows:
1055 .Bd -ragged -offset indent
1056 .Pf \. Sx \&Bd
1057 .Fl Ns Ar type
1058 .Op Fl offset Ar width
1059 .Op Fl compact
1060 .Ed
1061 .Pp
1062 Display blocks are used to select a different indentation and
1063 justification than the one used by the surrounding text.
1064 They may contain both macro lines and free-form text lines.
1065 By default, a display block is preceded by a vertical space.
1066 .Pp
1067 The
1068 .Ar type
1069 must be one of the following:
1070 .Bl -tag -width 13n -offset indent
1071 .It Fl centered
1072 Centre-justify each line.
1073 Using this display type is not recommended; many
1074 .Nm
1075 implementations render it poorly.
1076 .It Fl filled
1077 Left- and right-justify the block.
1078 .It Fl literal
1079 Do not justify the block at all.
1080 Preserve white space as it appears in the input.
1081 .It Fl ragged
1082 Only left-justify the block.
1083 .It Fl unfilled
1084 An alias for
1085 .Fl literal .
1086 .El
1087 .Pp
1088 The
1089 .Ar type
1090 must be provided first.
1091 Additional arguments may follow:
1092 .Bl -tag -width 13n -offset indent
1093 .It Fl offset Ar width
1094 Indent the display by the
1095 .Ar width ,
1096 which may be one of the following:
1097 .Bl -item
1098 .It
1099 One of the pre-defined strings
1100 .Cm indent ,
1101 the width of standard indentation;
1102 .Cm indent-two ,
1103 twice
1104 .Cm indent ;
1105 .Cm left ,
1106 which has no effect;
1107 .Cm right ,
1108 which justifies to the right margin; or
1109 .Cm center ,
1110 which aligns around an imagined centre axis.
1111 .It
1112 A macro invocation, which selects a predefined width
1113 associated with that macro.
1114 The most popular is the imaginary macro
1115 .Ar \&Ds ,
1116 which resolves to
1117 .Sy 6n .
1118 .It
1119 A width using the syntax described in
1120 .Sx Scaling Widths .
1121 .It
1122 An arbitrary string, which indents by the length of this string.
1123 .El
1124 .Pp
1125 When the argument is missing,
1126 .Fl offset
1127 is ignored.
1128 .It Fl compact
1129 Do not assert vertical space before the display.
1130 .El
1131 .Pp
1132 Examples:
1133 .Bd -literal -offset indent
1134 \&.Bd \-literal \-offset indent \-compact
1135 Hello world.
1136 \&.Ed
1137 .Ed
1138 .Pp
1139 See also
1140 .Sx \&D1
1141 and
1142 .Sx \&Dl .
1143 .Ss \&Bf
1144 Change the font mode for a scoped block of text.
1145 Its syntax is as follows:
1146 .Bd -ragged -offset indent
1147 .Pf \. Sx \&Bf
1148 .Oo
1149 .Fl emphasis | literal | symbolic |
1150 .Cm \&Em | \&Li | \&Sy
1151 .Oc
1152 .Ed
1153 .Pp
1154 The
1155 .Fl emphasis
1156 and
1157 .Cm \&Em
1158 argument are equivalent, as are
1159 .Fl symbolic
1160 and
1161 .Cm \&Sy ,
1162 and
1163 .Fl literal
1164 and
1165 .Cm \&Li .
1166 Without an argument, this macro does nothing.
1167 The font mode continues until broken by a new font mode in a nested
1168 scope or
1169 .Sx \&Ef
1170 is encountered.
1171 .Pp
1172 See also
1173 .Sx \&Li ,
1174 .Sx \&Ef ,
1175 .Sx \&Em ,
1176 and
1177 .Sx \&Sy .
1178 .Ss \&Bk
1179 Keep the output generated from each macro input line together
1180 on one single output line.
1181 Line breaks in free-form text lines are unaffected.
1182 The syntax is as follows:
1183 .Pp
1184 .D1 Pf \. Sx \&Bk Fl words
1185 .Pp
1186 The
1187 .Fl words
1188 argument is required; additional arguments are ignored.
1189 .Pp
1190 The following example will not break within each
1191 .Sx \&Op
1192 macro line:
1193 .Bd -literal -offset indent
1194 \&.Bk \-words
1195 \&.Op Fl f Ar flags
1196 \&.Op Fl o Ar output
1197 \&.Ek
1198 .Ed
1199 .Pp
1200 Be careful in using over-long lines within a keep block!
1201 Doing so will clobber the right margin.
1202 .Ss \&Bl
1203 Begin a list.
1204 Lists consist of items started by the
1205 .Sx \&It
1206 macro, containing a head or a body or both.
1207 The list syntax is as follows:
1208 .Bd -ragged -offset indent
1209 .Pf \. Sx \&Bl
1210 .Fl Ns Ar type
1211 .Op Fl width Ar val
1212 .Op Fl offset Ar val
1213 .Op Fl compact
1214 .Op HEAD ...
1215 .Ed
1216 .Pp
1217 The list
1218 .Ar type
1219 is mandatory and must be specified first.
1220 The
1221 .Fl width
1222 and
1223 .Fl offset
1224 arguments accept
1225 .Sx Scaling Widths
1226 or use the length of the given string.
1227 The
1228 .Fl offset
1229 is a global indentation for the whole list, affecting both item heads
1230 and bodies.
1231 For those list types supporting it, the
1232 .Fl width
1233 argument requests an additional indentation of item bodies,
1234 to be added to the
1235 .Fl offset .
1236 Unless the
1237 .Fl compact
1238 argument is specified, list entries are separated by vertical space.
1239 .Pp
1240 A list must specify one of the following list types:
1241 .Bl -tag -width 12n -offset indent
1242 .It Fl bullet
1243 No item heads can be specified, but a bullet will be printed at the head
1244 of each item.
1245 Item bodies start on the same output line as the bullet
1246 and are indented according to the
1247 .Fl width
1248 argument.
1249 .It Fl column
1250 A columnated list.
1251 The
1252 .Fl width
1253 argument has no effect; instead, each argument specifies the width
1254 of one column, using either the
1255 .Sx Scaling Widths
1256 syntax or the string length of the argument.
1257 If the first line of the body of a
1258 .Fl column
1259 list is not an
1260 .Sx \&It
1261 macro line,
1262 .Sx \&It
1263 contexts spanning one input line each are implied until an
1264 .Sx \&It
1265 macro line is encountered, at which point items start being interpreted as
1266 described in the
1267 .Sx \&It
1268 documentation.
1269 .It Fl dash
1270 Like
1271 .Fl bullet ,
1272 except that dashes are used in place of bullets.
1273 .It Fl diag
1274 Like
1275 .Fl inset ,
1276 except that item heads are not parsed for macro invocations.
1277 .\" but with additional formatting to the head.
1278 .It Fl enum
1279 A numbered list.
1280 Formatted like
1281 .Fl bullet ,
1282 except that cardinal numbers are used in place of bullets,
1283 starting at 1.
1284 .It Fl hang
1285 Like
1286 .Fl tag ,
1287 except that the first lines of item bodies are not indented, but follow
1288 the item heads like in
1289 .Fl inset
1290 lists.
1291 .It Fl hyphen
1292 Synonym for
1293 .Fl dash .
1294 .It Fl inset
1295 Item bodies follow items heads on the same line, using normal inter-word
1296 spacing.
1297 Bodies are not indented, and the
1298 .Fl width
1299 argument is ignored.
1300 .It Fl item
1301 No item heads can be specified, and none are printed.
1302 Bodies are not indented, and the
1303 .Fl width
1304 argument is ignored.
1305 .It Fl ohang
1306 Item bodies start on the line following item heads and are not indented.
1307 The
1308 .Fl width
1309 argument is ignored.
1310 .It Fl tag
1311 Item bodies are indented according to the
1312 .Fl width
1313 argument.
1314 When an item head fits inside the indentation, the item body follows
1315 this head on the same output line.
1316 Otherwise, the body starts on the output line following the head.
1317 .El
1318 .Pp
1319 See also
1320 .Sx \&El
1321 and
1322 .Sx \&It .
1323 .Ss \&Bo
1324 Begin a block enclosed by square brackets.
1325 Does not have any head arguments.
1326 .Pp
1327 Examples:
1328 .Bd -literal -offset indent -compact
1329 \&.Bo 1 ,
1330 \&.Dv BUFSIZ \&Bc
1331 .Ed
1332 .Pp
1333 See also
1334 .Sx \&Bq .
1335 .Ss \&Bq
1336 Encloses its arguments in square brackets.
1337 .Pp
1338 Examples:
1339 .D1 \&.Bq 1 , \&Dv BUFSIZ
1340 .Pp
1341 .Em Remarks :
1342 this macro is sometimes abused to emulate optional arguments for
1343 commands; the correct macros to use for this purpose are
1344 .Sx \&Op ,
1345 .Sx \&Oo ,
1346 and
1347 .Sx \&Oc .
1348 .Pp
1349 See also
1350 .Sx \&Bo .
1351 .Ss \&Brc
1352 Close a
1353 .Sx \&Bro
1354 block.
1355 Does not have any tail arguments.
1356 .Ss \&Bro
1357 Begin a block enclosed by curly braces.
1358 Does not have any head arguments.
1359 .Pp
1360 Examples:
1361 .Bd -literal -offset indent -compact
1362 \&.Bro 1 , ... ,
1363 \&.Va n \&Brc
1364 .Ed
1365 .Pp
1366 See also
1367 .Sx \&Brq .
1368 .Ss \&Brq
1369 Encloses its arguments in curly braces.
1370 .Pp
1371 Examples:
1372 .D1 \&.Brq 1 , ... , \&Va n
1373 .Pp
1374 See also
1375 .Sx \&Bro .
1376 .Ss \&Bsx
1377 Format the BSD/OS version provided as an argument, or a default value if
1378 no argument is provided.
1379 .Pp
1380 Examples:
1381 .D1 \&.Bsx 1.0
1382 .D1 \&.Bsx
1383 .Pp
1384 See also
1385 .Sx \&At ,
1386 .Sx \&Bx ,
1387 .Sx \&Dx ,
1388 .Sx \&Fx ,
1389 .Sx \&Nx ,
1390 .Sx \&Ox ,
1391 and
1392 .Sx \&Ux .
1393 .Ss \&Bt
1394 Prints
1395 .Dq is currently in beta test .
1396 .Ss \&Bx
1397 Format the BSD version provided as an argument, or a default value if no
1398 argument is provided.
1399 .Pp
1400 Examples:
1401 .D1 \&.Bx 4.4
1402 .D1 \&.Bx
1403 .Pp
1404 See also
1405 .Sx \&At ,
1406 .Sx \&Bsx ,
1407 .Sx \&Dx ,
1408 .Sx \&Fx ,
1409 .Sx \&Nx ,
1410 .Sx \&Ox ,
1411 and
1412 .Sx \&Ux .
1413 .Ss \&Cd
1414 Kernel configuration declaration.
1415 This denotes strings accepted by
1416 .Xr config 8 .
1417 .Pp
1418 Examples:
1419 .D1 \&.Cd device le0 at scode?
1420 .Pp
1421 .Em Remarks :
1422 this macro is commonly abused by using quoted literals to retain
1423 whitespace and align consecutive
1424 .Sx \&Cd
1425 declarations.
1426 This practise is discouraged.
1427 .Ss \&Cm
1428 Command modifiers.
1429 Useful when specifying configuration options or keys.
1430 .Pp
1431 Examples:
1432 .D1 \&.Cm ControlPath
1433 .D1 \&.Cm ControlMaster
1434 .Pp
1435 See also
1436 .Sx \&Fl .
1437 .Ss \&D1
1438 One-line indented display.
1439 This is formatted by the default rules and is useful for simple indented
1440 statements.
1441 It is followed by a newline.
1442 .Pp
1443 Examples:
1444 .D1 \&.D1 \&Fl abcdefgh
1445 .Pp
1446 See also
1447 .Sx \&Bd
1448 and
1449 .Sx \&Dl .
1450 .Ss \&Db
1451 Switch debugging mode.
1452 Its syntax is as follows:
1453 .Pp
1454 .D1 Pf \. Sx \&Db Cm on | off
1455 .Pp
1456 This macro is ignored by
1457 .Xr mandoc 1 .
1458 .Ss \&Dc
1459 Close a
1460 .Sx \&Do
1461 block.
1462 Does not have any tail arguments.
1463 .Ss \&Dd
1464 Document date.
1465 This is the mandatory first macro of any
1466 .Nm
1467 manual.
1468 Its syntax is as follows:
1469 .Pp
1470 .D1 Pf \. Sx \&Dd Op Ar date
1471 .Pp
1472 The
1473 .Ar date
1474 may be either
1475 .Ar $\&Mdocdate$ ,
1476 which signifies the current manual revision date dictated by
1477 .Xr cvs 1 ,
1478 or instead a valid canonical date as specified by
1479 .Sx Dates .
1480 If a date does not conform or is empty, the current date is used.
1481 .Pp
1482 Examples:
1483 .D1 \&.Dd $\&Mdocdate$
1484 .D1 \&.Dd $\&Mdocdate: July 21 2007$
1485 .D1 \&.Dd July 21, 2007
1486 .Pp
1487 See also
1488 .Sx \&Dt
1489 and
1490 .Sx \&Os .
1491 .Ss \&Dl
1492 One-line intended display.
1493 This is formatted as literal text and is useful for commands and
1494 invocations.
1495 It is followed by a newline.
1496 .Pp
1497 Examples:
1498 .D1 \&.Dl % mandoc mdoc.7 \e(ba less
1499 .Pp
1500 See also
1501 .Sx \&Bd
1502 and
1503 .Sx \&D1 .
1504 .Ss \&Do
1505 Begin a block enclosed by double quotes.
1506 Does not have any head arguments.
1507 .Pp
1508 Examples:
1509 .Bd -literal -offset indent -compact
1510 \&.Do
1511 April is the cruellest month
1512 \&.Dc
1513 \e(em T.S. Eliot
1514 .Ed
1515 .Pp
1516 See also
1517 .Sx \&Dq .
1518 .Ss \&Dq
1519 Encloses its arguments in
1520 .Dq typographic
1521 double-quotes.
1522 .Pp
1523 Examples:
1524 .Bd -literal -offset indent -compact
1525 \&.Dq April is the cruellest month
1526 \e(em T.S. Eliot
1527 .Ed
1528 .Pp
1529 See also
1530 .Sx \&Qq ,
1531 .Sx \&Sq ,
1532 and
1533 .Sx \&Do .
1534 .Ss \&Dt
1535 Document title.
1536 This is the mandatory second macro of any
1537 .Nm
1538 file.
1539 Its syntax is as follows:
1540 .Bd -ragged -offset indent
1541 .Pf \. Sx \&Dt
1542 .Oo
1543 .Ar title
1544 .Oo
1545 .Ar section
1546 .Op Ar volume | arch
1547 .Oc
1548 .Oc
1549 .Ed
1550 .Pp
1551 Its arguments are as follows:
1552 .Bl -tag -width Ds -offset Ds
1553 .It Ar title
1554 The document's title (name), defaulting to
1555 .Dq UNKNOWN
1556 if unspecified.
1557 It should be capitalised.
1558 .It Ar section
1559 The manual section.
1560 This may be one of
1561 .Ar 1
1562 .Pq utilities ,
1563 .Ar 2
1564 .Pq system calls ,
1565 .Ar 3
1566 .Pq libraries ,
1567 .Ar 3p
1568 .Pq Perl libraries ,
1569 .Ar 4
1570 .Pq devices ,
1571 .Ar 5
1572 .Pq file formats ,
1573 .Ar 6
1574 .Pq games ,
1575 .Ar 7
1576 .Pq miscellaneous ,
1577 .Ar 8
1578 .Pq system utilities ,
1579 .Ar 9
1580 .Pq kernel functions ,
1581 .Ar X11
1582 .Pq X Window System ,
1583 .Ar X11R6
1584 .Pq X Window System ,
1585 .Ar unass
1586 .Pq unassociated ,
1587 .Ar local
1588 .Pq local system ,
1589 .Ar draft
1590 .Pq draft manual ,
1591 or
1592 .Ar paper
1593 .Pq paper .
1594 It should correspond to the manual's filename suffix and defaults to
1595 .Dq 1
1596 if unspecified.
1597 .It Ar volume
1598 This overrides the volume inferred from
1599 .Ar section .
1600 This field is optional, and if specified, must be one of
1601 .Ar USD
1602 .Pq users' supplementary documents ,
1603 .Ar PS1
1604 .Pq programmers' supplementary documents ,
1605 .Ar AMD
1606 .Pq administrators' supplementary documents ,
1607 .Ar SMM
1608 .Pq system managers' manuals ,
1609 .Ar URM
1610 .Pq users' reference manuals ,
1611 .Ar PRM
1612 .Pq programmers' reference manuals ,
1613 .Ar KM
1614 .Pq kernel manuals ,
1615 .Ar IND
1616 .Pq master index ,
1617 .Ar MMI
1618 .Pq master index ,
1619 .Ar LOCAL
1620 .Pq local manuals ,
1621 .Ar LOC
1622 .Pq local manuals ,
1623 or
1624 .Ar CON
1625 .Pq contributed manuals .
1626 .It Ar arch
1627 This specifies a specific relevant architecture.
1628 If
1629 .Ar volume
1630 is not provided, it may be used in its place, else it may be used
1631 subsequent that.
1632 It, too, is optional.
1633 It must be one of
1634 .Ar alpha ,
1635 .Ar amd64 ,
1636 .Ar amiga ,
1637 .Ar arc ,
1638 .Ar arm ,
1639 .Ar armish ,
1640 .Ar aviion ,
1641 .Ar hp300 ,
1642 .Ar hppa ,
1643 .Ar hppa64 ,
1644 .Ar i386 ,
1645 .Ar landisk ,
1646 .Ar loongson ,
1647 .Ar luna88k ,
1648 .Ar mac68k ,
1649 .Ar macppc ,
1650 .Ar mvme68k ,
1651 .Ar mvme88k ,
1652 .Ar mvmeppc ,
1653 .Ar pmax ,
1654 .Ar sgi ,
1655 .Ar socppc ,
1656 .Ar sparc ,
1657 .Ar sparc64 ,
1658 .Ar sun3 ,
1659 .Ar vax ,
1660 or
1661 .Ar zaurus .
1662 .El
1663 .Pp
1664 Examples:
1665 .D1 \&.Dt FOO 1
1666 .D1 \&.Dt FOO 4 KM
1667 .D1 \&.Dt FOO 9 i386
1668 .Pp
1669 See also
1670 .Sx \&Dd
1671 and
1672 .Sx \&Os .
1673 .Ss \&Dv
1674 Defined variables such as preprocessor constants.
1675 .Pp
1676 Examples:
1677 .D1 \&.Dv BUFSIZ
1678 .D1 \&.Dv STDOUT_FILENO
1679 .Pp
1680 See also
1681 .Sx \&Er .
1682 .Ss \&Dx
1683 Format the DragonFly BSD version provided as an argument, or a default
1684 value if no argument is provided.
1685 .Pp
1686 Examples:
1687 .D1 \&.Dx 2.4.1
1688 .D1 \&.Dx
1689 .Pp
1690 See also
1691 .Sx \&At ,
1692 .Sx \&Bsx ,
1693 .Sx \&Bx ,
1694 .Sx \&Fx ,
1695 .Sx \&Nx ,
1696 .Sx \&Ox ,
1697 and
1698 .Sx \&Ux .
1699 .Ss \&Ec
1700 Close a scope started by
1701 .Sx \&Eo .
1702 Its syntax is as follows:
1703 .Pp
1704 .D1 Pf \. Sx \&Ec Op Ar TERM
1705 .Pp
1706 The
1707 .Ar TERM
1708 argument is used as the enclosure tail, for example, specifying \e(rq
1709 will emulate
1710 .Sx \&Dc .
1711 .Ss \&Ed
1712 End a display context started by
1713 .Sx \&Bd .
1714 .Ss \&Ef
1715 End a font mode context started by
1716 .Sx \&Bf .
1717 .Ss \&Ek
1718 End a keep context started by
1719 .Sx \&Bk .
1720 .Ss \&El
1721 End a list context started by
1722 .Sx \&Bl .
1723 .Pp
1724 See also
1725 .Sx \&Bl
1726 and
1727 .Sx \&It .
1728 .Ss \&Em
1729 Denotes text that should be emphasised.
1730 Note that this is a presentation term and should not be used for
1731 stylistically decorating technical terms.
1732 .Pp
1733 Examples:
1734 .D1 \&.Em Warnings!
1735 .D1 \&.Em Remarks :
1736 .Pp
1737 See also
1738 .Sx \&Bf ,
1739 .Sx \&Sy ,
1740 and
1741 .Sx \&Li .
1742 .Ss \&En
1743 This macro is obsolete and not implemented in
1744 .Xr mandoc 1 .
1745 .Ss \&Eo
1746 An arbitrary enclosure.
1747 Its syntax is as follows:
1748 .Pp
1749 .D1 Pf \. Sx \&Eo Op Ar TERM
1750 .Pp
1751 The
1752 .Ar TERM
1753 argument is used as the enclosure head, for example, specifying \e(lq
1754 will emulate
1755 .Sx \&Do .
1756 .Ss \&Er
1757 Display error constants.
1758 .Pp
1759 Examples:
1760 .D1 \&.Er EPERM
1761 .D1 \&.Er ENOENT
1762 .Pp
1763 See also
1764 .Sx \&Dv .
1765 .Ss \&Es
1766 This macro is obsolete and not implemented.
1767 .Ss \&Ev
1768 Environmental variables such as those specified in
1769 .Xr environ 7 .
1770 .Pp
1771 Examples:
1772 .D1 \&.Ev DISPLAY
1773 .D1 \&.Ev PATH
1774 .Ss \&Ex
1775 Insert a standard sentence regarding exit values.
1776 Its syntax is as follows:
1777 .Pp
1778 .D1 Pf \. Sx \&Ex Fl std Op Ar utility
1779 .Pp
1780 When
1781 .Ar utility
1782 is not specified, the document's name set by
1783 .Sx \&Nm
1784 is used.
1785 .Pp
1786 See also
1787 .Sx \&Rv .
1788 .Ss \&Fa
1789 Function argument.
1790 Its syntax is as follows:
1791 .Bd -ragged -offset indent
1792 .Pf \. Sx \&Fa
1793 .Op Cm argtype
1794 .Cm argname
1795 .Ed
1796 .Pp
1797 This may be invoked for names with or without the corresponding type.
1798 It is also used to specify the field name of a structure.
1799 Most often, the
1800 .Sx \&Fa
1801 macro is used in the
1802 .Em SYNOPSIS
1803 within
1804 .Sx \&Fo
1805 section when documenting multi-line function prototypes.
1806 If invoked with multiple arguments, the arguments are separated by a
1807 comma.
1808 Furthermore, if the following macro is another
1809 .Sx \&Fa ,
1810 the last argument will also have a trailing comma.
1811 .Pp
1812 Examples:
1813 .D1 \&.Fa \(dqconst char *p\(dq
1814 .D1 \&.Fa \(dqint a\(dq \(dqint b\(dq \(dqint c\(dq
1815 .D1 \&.Fa foo
1816 .Pp
1817 See also
1818 .Sx \&Fo .
1819 .Ss \&Fc
1820 End a function context started by
1821 .Sx \&Fo .
1822 .Ss \&Fd
1823 Historically used to document include files.
1824 This usage has been deprecated in favour of
1825 .Sx \&In .
1826 Do not use this macro.
1827 .Pp
1828 See also
1829 .Sx MANUAL STRUCTURE
1830 and
1831 .Sx \&In .
1832 .Ss \&Fl
1833 Command-line flag.
1834 Used when listing arguments to command-line utilities.
1835 Prints a fixed-width hyphen
1836 .Sq \-
1837 directly followed by each argument.
1838 If no arguments are provided, a hyphen is printed followed by a space.
1839 If the argument is a macro, a hyphen is prefixed to the subsequent macro
1840 output.
1841 .Pp
1842 Examples:
1843 .D1 \&.Fl a b c
1844 .D1 \&.Fl \&Pf a b
1845 .D1 \&.Fl
1846 .D1 \&.Op \&Fl o \&Ns \&Ar file
1847 .Pp
1848 See also
1849 .Sx \&Cm .
1850 .Ss \&Fn
1851 A function name.
1852 Its syntax is as follows:
1853 .Bd -ragged -offset indent
1854 .Pf \. Ns Sx \&Fn
1855 .Op Cm functype
1856 .Cm funcname
1857 .Op Oo Cm argtype Oc Cm argname
1858 .Ed
1859 .Pp
1860 Function arguments are surrounded in parenthesis and
1861 are delimited by commas.
1862 If no arguments are specified, blank parenthesis are output.
1863 .Pp
1864 Examples:
1865 .D1 \&.Fn "int funcname" "int arg0" "int arg1"
1866 .D1 \&.Fn funcname "int arg0"
1867 .D1 \&.Fn funcname arg0
1868 .Bd -literal -offset indent -compact
1869 \&.Ft functype
1870 \&.Fn funcname
1871 .Ed
1872 .Pp
1873 See also
1874 .Sx MANUAL STRUCTURE
1875 and
1876 .Sx \&Ft .
1877 .Ss \&Fo
1878 Begin a function block.
1879 This is a multi-line version of
1880 .Sx \&Fn .
1881 Its syntax is as follows:
1882 .Pp
1883 .D1 Pf \. Sx \&Fo Cm funcname
1884 .Pp
1885 Invocations usually occur in the following context:
1886 .Bd -ragged -offset indent
1887 .Pf \. Sx \&Ft Cm functype
1888 .br
1889 .Pf \. Sx \&Fo Cm funcname
1890 .br
1891 .Pf \. Sx \&Fa Oo Cm argtype Oc Cm argname
1892 .br
1893 \.\.\.
1894 .br
1895 .Pf \. Sx \&Fc
1896 .Ed
1897 .Pp
1898 A
1899 .Sx \&Fo
1900 scope is closed by
1901 .Pp
1902 See also
1903 .Sx MANUAL STRUCTURE ,
1904 .Sx \&Fa ,
1905 .Sx \&Fc ,
1906 and
1907 .Sx \&Ft .
1908 .Ss \&Ft
1909 A function type.
1910 Its syntax is as follows:
1911 .Pp
1912 .D1 Pf \. Sx \&Ft Cm functype
1913 .Pp
1914 Examples:
1915 .D1 \&.Ft int
1916 .Bd -literal -offset indent -compact
1917 \&.Ft functype
1918 \&.Fn funcname
1919 .Ed
1920 .Pp
1921 See also
1922 .Sx MANUAL STRUCTURE ,
1923 .Sx \&Fn ,
1924 and
1925 .Sx \&Fo .
1926 .Ss \&Fx
1927 Format the
1928 .Fx
1929 version provided as an argument, or a default value
1930 if no argument is provided.
1931 .Pp
1932 Examples:
1933 .D1 \&.Fx 7.1
1934 .D1 \&.Fx
1935 .Pp
1936 See also
1937 .Sx \&At ,
1938 .Sx \&Bsx ,
1939 .Sx \&Bx ,
1940 .Sx \&Dx ,
1941 .Sx \&Nx ,
1942 .Sx \&Ox ,
1943 and
1944 .Sx \&Ux .
1945 .Ss \&Hf
1946 This macro is obsolete and not implemented.
1947 .Ss \&Ic
1948 Designate an internal or interactive command.
1949 This is similar to
1950 .Sx \&Cm
1951 but used for instructions rather than values.
1952 .Pp
1953 Examples:
1954 .D1 \&.Ic hash
1955 .D1 \&.Ic alias
1956 .Pp
1957 Note that using
1958 .Sx \&Bd Fl literal
1959 or
1960 .Sx \&D1
1961 is preferred for displaying code; the
1962 .Sx \&Ic
1963 macro is used when referring to specific instructions.
1964 .Ss \&In
1965 An
1966 .Dq include
1967 file.
1968 In the
1969 .Em SYNOPSIS
1970 section (only if invoked as the line macro), the first argument is
1971 preceded by
1972 .Dq #include ,
1973 the arguments is enclosed in angle brackets.
1974 .Pp
1975 Examples:
1976 .D1 \&.In sys/types
1977 .Pp
1978 See also
1979 .Sx MANUAL STRUCTURE .
1980 .Ss \&It
1981 A list item.
1982 The syntax of this macro depends on the list type.
1983 .Pp
1984 Lists
1985 of type
1986 .Fl hang ,
1987 .Fl ohang ,
1988 .Fl inset ,
1989 and
1990 .Fl diag
1991 have the following syntax:
1992 .Pp
1993 .D1 Pf \. Sx \&It Cm args
1994 .Pp
1995 Lists of type
1996 .Fl bullet ,
1997 .Fl dash ,
1998 .Fl enum ,
1999 .Fl hyphen
2000 and
2001 .Fl item
2002 have the following syntax:
2003 .Pp
2004 .D1 Pf \. Sx \&It
2005 .Pp
2006 with subsequent lines interpreted within the scope of the
2007 .Sx \&It
2008 until either a closing
2009 .Sx \&El
2010 or another
2011 .Sx \&It .
2012 .Pp
2013 The
2014 .Fl tag
2015 list has the following syntax:
2016 .Pp
2017 .D1 Pf \. Sx \&It Op Cm args
2018 .Pp
2019 Subsequent lines are interpreted as with
2020 .Fl bullet
2021 and family.
2022 The line arguments correspond to the list's left-hand side; body
2023 arguments correspond to the list's contents.
2024 .Pp
2025 The
2026 .Fl column
2027 list is the most complicated.
2028 Its syntax is as follows:
2029 .Pp
2030 .D1 Pf \. Sx \&It Op Cm args
2031 .Pp
2032 The
2033 .Cm args
2034 are phrases, a mix of macros and text corresponding to a line column,
2035 delimited by tabs or the special
2036 .Sq \&Ta
2037 pseudo-macro.
2038 Lines subsequent the
2039 .Sx \&It
2040 are interpreted within the scope of the last phrase.
2041 Calling the pseudo-macro
2042 .Sq \&Ta
2043 will open a new phrase scope (this must occur on a macro line to be
2044 interpreted as a macro).
2045 Note that the tab phrase delimiter may only be used within the
2046 .Sx \&It
2047 line itself.
2048 Subsequent this, only the
2049 .Sq \&Ta
2050 pseudo-macro may be used to delimit phrases.
2051 Furthermore, note that quoted sections propagate over tab-delimited
2052 phrases on an
2053 .Sx \&It ,
2054 for example,
2055 .Pp
2056 .D1 .It \(dqcol1 ; <TAB> col2 ;\(dq \&;
2057 .Pp
2058 will preserve the semicolon whitespace except for the last.
2059 .Pp
2060 See also
2061 .Sx \&Bl .
2062 .Ss \&Lb
2063 Specify a library.
2064 The syntax is as follows:
2065 .Pp
2066 .D1 Pf \. Sx \&Lb Cm library
2067 .Pp
2068 The
2069 .Cm library
2070 parameter may be a system library, such as
2071 .Cm libz
2072 or
2073 .Cm libpam ,
2074 in which case a small library description is printed next to the linker
2075 invocation; or a custom library, in which case the library name is
2076 printed in quotes.
2077 This is most commonly used in the
2078 .Em SYNOPSIS
2079 section as described in
2080 .Sx MANUAL STRUCTURE .
2081 .Pp
2082 Examples:
2083 .D1 \&.Lb libz
2084 .D1 \&.Lb mdoc
2085 .Ss \&Li
2086 Denotes text that should be in a literal font mode.
2087 Note that this is a presentation term and should not be used for
2088 stylistically decorating technical terms.
2089 .Pp
2090 See also
2091 .Sx \&Bf ,
2092 .Sx \&Sy ,
2093 and
2094 .Sx \&Em .
2095 .Ss \&Lk
2096 Format a hyperlink.
2097 Its syntax is as follows:
2098 .Pp
2099 .D1 Pf \. Sx \&Lk Cm uri Op Cm name
2100 .Pp
2101 Examples:
2102 .D1 \&.Lk http://bsd.lv "The BSD.lv Project"
2103 .D1 \&.Lk http://bsd.lv
2104 .Pp
2105 See also
2106 .Sx \&Mt .
2107 .Ss \&Lp
2108 Synonym for
2109 .Sx \&Pp .
2110 .Ss \&Ms
2111 Display a mathematical symbol.
2112 Its syntax is as follows:
2113 .Pp
2114 .D1 Pf \. Sx \&Ms Cm symbol
2115 .Pp
2116 Examples:
2117 .D1 \&.Ms sigma
2118 .D1 \&.Ms aleph
2119 .Ss \&Mt
2120 Format a
2121 .Dq mailto:
2122 hyperlink.
2123 Its syntax is as follows:
2124 .Pp
2125 .D1 Pf \. Sx \&Mt Cm address
2126 .Pp
2127 Examples:
2128 .D1 \&.Mt discuss@manpages.bsd.lv
2129 .Ss \&Nd
2130 A one line description of the manual's content.
2131 This may only be invoked in the
2132 .Em SYNOPSIS
2133 section subsequent the
2134 .Sx \&Nm
2135 macro.
2136 .Pp
2137 Examples:
2138 .D1 \&.Sx \&Nd mdoc language reference
2139 .D1 \&.Sx \&Nd format and display UNIX manuals
2140 .Pp
2141 The
2142 .Sx \&Nd
2143 macro technically accepts child macros and terminates with a subsequent
2144 .Sx \&Sh
2145 invocation.
2146 Do not assume this behaviour: some
2147 .Xr whatis 1
2148 database generators are not smart enough to parse more than the line
2149 arguments and will display macros verbatim.
2150 .Pp
2151 See also
2152 .Sx \&Nm .
2153 .Ss \&Nm
2154 The name of the manual page, or \(em in particular in section 1, 6,
2155 and 8 pages \(em of an additional command or feature documented in
2156 the manual page.
2157 When first invoked, the
2158 .Sx \&Nm
2159 macro expects a single argument, the name of the manual page.
2160 Usually, the first invocation happens in the
2161 .Em NAME
2162 section of the page.
2163 The specified name will be remembered and used whenever the macro is
2164 called again without arguments later in the page.
2165 The
2166 .Sx \&Nm
2167 macro uses
2168 .Sx Block full-implicit
2169 semantics when invoked as the first macro on an input line in the
2170 .Em SYNOPSIS
2171 section; otherwise, it uses ordinary
2172 .Sx In-line
2173 semantics.
2174 .Pp
2175 Examples:
2176 .Bd -literal -offset indent
2177 \&.Sh SYNOPSIS
2178 \&.Nm cat
2179 \&.Op Fl benstuv
2180 \&.Op Ar
2181 .Ed
2182 .Pp
2183 In the
2184 .Em SYNOPSIS
2185 of section 2, 3 and 9 manual pages, use the
2186 .Sx \&Fn
2187 macro rather than
2188 .Sx \&Nm
2189 to mark up the name of the manual page.
2190 .Ss \&No
2191 A
2192 .Dq noop
2193 macro used to terminate prior macro contexts.
2194 .Pp
2195 Examples:
2196 .D1 \&.Sx \&Fl ab \&No cd \&Fl ef
2197 .Ss \&Ns
2198 Suppress a space.
2199 Following invocation, text is interpreted as free-form text until a
2200 macro is encountered.
2201 .Pp
2202 Examples:
2203 .D1 \&.Fl o \&Ns \&Ar output
2204 .Pp
2205 See also
2206 .Sx \&No
2207 and
2208 .Sx \&Sm .
2209 .Ss \&Nx
2210 Format the
2211 .Nx
2212 version provided as an argument, or a default value if
2213 no argument is provided.
2214 .Pp
2215 Examples:
2216 .D1 \&.Nx 5.01
2217 .D1 \&.Nx
2218 .Pp
2219 See also
2220 .Sx \&At ,
2221 .Sx \&Bsx ,
2222 .Sx \&Bx ,
2223 .Sx \&Dx ,
2224 .Sx \&Fx ,
2225 .Sx \&Ox ,
2226 and
2227 .Sx \&Ux .
2228 .Ss \&Oc
2229 Close multi-line
2230 .Sx \&Oo
2231 context.
2232 .Ss \&Oo
2233 Multi-line version of
2234 .Sx \&Op .
2235 .Pp
2236 Examples:
2237 .Bd -literal -offset indent -compact
2238 \&.Oo
2239 \&.Op Fl flag Ns Ar value
2240 \&.Oc
2241 .Ed
2242 .Ss \&Op
2243 Command-line option.
2244 Used when listing options to command-line utilities.
2245 Prints the argument(s) in brackets.
2246 .Pp
2247 Examples:
2248 .D1 \&.Op \&Fl a \&Ar b
2249 .D1 \&.Op \&Ar a | b
2250 .Pp
2251 See also
2252 .Sx \&Oo .
2253 .Ss \&Os
2254 Document operating system version.
2255 This is the mandatory third macro of
2256 any
2257 .Nm
2258 file.
2259 Its syntax is as follows:
2260 .Pp
2261 .D1 Pf \. Sx \&Os Op Cm system Op Cm version
2262 .Pp
2263 The optional
2264 .Cm system
2265 parameter specifies the relevant operating system or environment.
2266 Left unspecified, it defaults to the local operating system version.
2267 This is the suggested form.
2268 .Pp
2269 Examples:
2270 .D1 \&.Os
2271 .D1 \&.Os KTH/CSC/TCS
2272 .D1 \&.Os BSD 4.3
2273 .Pp
2274 See also
2275 .Sx \&Dd
2276 and
2277 .Sx \&Dt .
2278 .Ss \&Ot
2279 Unknown usage.
2280 .Pp
2281 .Em Remarks :
2282 this macro has been deprecated.
2283 .Ss \&Ox
2284 Format the
2285 .Ox
2286 version provided as an argument, or a default value
2287 if no argument is provided.
2288 .Pp
2289 Examples:
2290 .D1 \&.Ox 4.5
2291 .D1 \&.Ox
2292 .Pp
2293 See also
2294 .Sx \&At ,
2295 .Sx \&Bsx ,
2296 .Sx \&Bx ,
2297 .Sx \&Dx ,
2298 .Sx \&Fx ,
2299 .Sx \&Nx ,
2300 and
2301 .Sx \&Ux .
2302 .Ss \&Pa
2303 A file-system path.
2304 .Pp
2305 Examples:
2306 .D1 \&.Pa /usr/bin/mandoc
2307 .D1 \&.Pa /usr/share/man/man7/mdoc.7
2308 .Pp
2309 See also
2310 .Sx \&Lk .
2311 .Ss \&Pc
2312 Close parenthesised context opened by
2313 .Sx \&Po .
2314 .Ss \&Pf
2315 Removes the space
2316 .Pq Dq prefix
2317 between its arguments.
2318 Its syntax is as follows:
2319 .Pp
2320 .D1 Pf \. \&Pf Cm prefix suffix
2321 .Pp
2322 The
2323 .Cm suffix
2324 argument may be a macro.
2325 .Pp
2326 Examples:
2327 .D1 \&.Pf \e. \&Sx \&Pf \&Cm prefix suffix
2328 .Ss \&Po
2329 Multi-line version of
2330 .Sx \&Pq .
2331 .Ss \&Pp
2332 Break a paragraph.
2333 This will assert vertical space between prior and subsequent macros
2334 and/or text.
2335 .Ss \&Pq
2336 Parenthesised enclosure.
2337 .Pp
2338 See also
2339 .Sx \&Po .
2340 .Ss \&Qc
2341 Close quoted context opened by
2342 .Sx \&Qo .
2343 .Ss \&Ql
2344 Format a single-quoted literal.
2345 See also
2346 .Sx \&Qq
2347 and
2348 .Sx \&Sq .
2349 .Ss \&Qo
2350 Multi-line version of
2351 .Sx \&Qq .
2352 .Ss \&Qq
2353 Encloses its arguments in
2354 .Dq typewriter
2355 double-quotes.
2356 Consider using
2357 .Sx \&Dq .
2358 .Pp
2359 See also
2360 .Sx \&Dq ,
2361 .Sx \&Sq ,
2362 and
2363 .Sx \&Qo .
2364 .Ss \&Re
2365 Close an
2366 .Sx \&Rs
2367 block.
2368 Does not have any tail arguments.
2369 .Ss \&Rs
2370 Begin a bibliographic
2371 .Pq Dq reference
2372 block.
2373 Does not have any head arguments.
2374 The block macro may only contain
2375 .Sx \&%A ,
2376 .Sx \&%B ,
2377 .Sx \&%C ,
2378 .Sx \&%D ,
2379 .Sx \&%I ,
2380 .Sx \&%J ,
2381 .Sx \&%N ,
2382 .Sx \&%O ,
2383 .Sx \&%P ,
2384 .Sx \&%Q ,
2385 .Sx \&%R ,
2386 .Sx \&%T ,
2387 .Sx \&%U ,
2388 and
2389 .Sx \&%V
2390 child macros (at least one must be specified).
2391 .Pp
2392 Examples:
2393 .Bd -literal -offset indent -compact
2394 \&.Rs
2395 \&.%A J. E. Hopcroft
2396 \&.%A J. D. Ullman
2397 \&.%B Introduction to Automata Theory, Languages, and Computation
2398 \&.%I Addison-Wesley
2399 \&.%C Reading, Massachusettes
2400 \&.%D 1979
2401 \&.Re
2402 .Ed
2403 .Pp
2404 If an
2405 .Sx \&Rs
2406 block is used within a SEE ALSO section, a vertical space is asserted
2407 before the rendered output, else the block continues on the current
2408 line.
2409 .Ss \&Rv
2410 Inserts text regarding a function call's return value.
2411 This macro must consist of the
2412 .Fl std
2413 argument followed by an optional
2414 .Ar function .
2415 If
2416 .Ar function
2417 is not provided, the document's name as stipulated by the first
2418 .Sx \&Nm
2419 is provided.
2420 .Pp
2421 See also
2422 .Sx \&Ex .
2423 .Ss \&Sc
2424 Close single-quoted context opened by
2425 .Sx \&So .
2426 .Ss \&Sh
2427 Begin a new section.
2428 For a list of conventional manual sections, see
2429 .Sx MANUAL STRUCTURE .
2430 These sections should be used unless it's absolutely necessary that
2431 custom sections be used.
2432 .Pp
2433 Section names should be unique so that they may be keyed by
2434 .Sx \&Sx .
2435 .Pp
2436 See also
2437 .Sx \&Pp ,
2438 .Sx \&Ss ,
2439 and
2440 .Sx \&Sx .
2441 .Ss \&Sm
2442 Switches the spacing mode for output generated from macros.
2443 Its syntax is as follows:
2444 .Pp
2445 .D1 Pf \. Sx \&Sm Cm on | off
2446 .Pp
2447 By default, spacing is
2448 .Cm on .
2449 When switched
2450 .Cm off ,
2451 no white space is inserted between macro arguments and between the
2452 output generated from adjacent macros, but free-form text lines
2453 still get normal spacing between words and sentences.
2454 .Ss \&So
2455 Multi-line version of
2456 .Sx \&Sq .
2457 .Ss \&Sq
2458 Encloses its arguments in
2459 .Dq typewriter
2460 single-quotes.
2461 .Pp
2462 See also
2463 .Sx \&Dq ,
2464 .Sx \&Qq ,
2465 and
2466 .Sx \&So .
2467 .Ss \&Ss
2468 Begin a new sub-section.
2469 Unlike with
2470 .Sx \&Sh ,
2471 there's no convention for sub-sections.
2472 Conventional sections, as described in
2473 .Sx MANUAL STRUCTURE ,
2474 rarely have sub-sections.
2475 .Pp
2476 Sub-section names should be unique so that they may be keyed by
2477 .Sx \&Sx .
2478 .Pp
2479 See also
2480 .Sx \&Pp ,
2481 .Sx \&Sh ,
2482 and
2483 .Sx \&Sx .
2484 .Ss \&St
2485 Replace an abbreviation for a standard with the full form.
2486 The following standards are recognised:
2487 .Pp
2488 .Bl -tag -width "-p1003.1g-2000X" -compact
2489 .It \-p1003.1-88
2490 .St -p1003.1-88
2491 .It \-p1003.1-90
2492 .St -p1003.1-90
2493 .It \-p1003.1-96
2494 .St -p1003.1-96
2495 .It \-p1003.1-2001
2496 .St -p1003.1-2001
2497 .It \-p1003.1-2004
2498 .St -p1003.1-2004
2499 .It \-p1003.1-2008
2500 .St -p1003.1-2008
2501 .It \-p1003.1
2502 .St -p1003.1
2503 .It \-p1003.1b
2504 .St -p1003.1b
2505 .It \-p1003.1b-93
2506 .St -p1003.1b-93
2507 .It \-p1003.1c-95
2508 .St -p1003.1c-95
2509 .It \-p1003.1g-2000
2510 .St -p1003.1g-2000
2511 .It \-p1003.1i-95
2512 .St -p1003.1i-95
2513 .It \-p1003.2-92
2514 .St -p1003.2-92
2515 .It \-p1003.2a-92
2516 .St -p1003.2a-92
2517 .It \-p1387.2-95
2518 .St -p1387.2-95
2519 .It \-p1003.2
2520 .St -p1003.2
2521 .It \-p1387.2
2522 .St -p1387.2
2523 .It \-isoC
2524 .St -isoC
2525 .It \-isoC-90
2526 .St -isoC-90
2527 .It \-isoC-amd1
2528 .St -isoC-amd1
2529 .It \-isoC-tcor1
2530 .St -isoC-tcor1
2531 .It \-isoC-tcor2
2532 .St -isoC-tcor2
2533 .It \-isoC-99
2534 .St -isoC-99
2535 .It \-iso9945-1-90
2536 .St -iso9945-1-90
2537 .It \-iso9945-1-96
2538 .St -iso9945-1-96
2539 .It \-iso9945-2-93
2540 .St -iso9945-2-93
2541 .It \-ansiC
2542 .St -ansiC
2543 .It \-ansiC-89
2544 .St -ansiC-89
2545 .It \-ansiC-99
2546 .St -ansiC-99
2547 .It \-ieee754
2548 .St -ieee754
2549 .It \-iso8802-3
2550 .St -iso8802-3
2551 .It \-ieee1275-94
2552 .St -ieee1275-94
2553 .It \-xpg3
2554 .St -xpg3
2555 .It \-xpg4
2556 .St -xpg4
2557 .It \-xpg4.2
2558 .St -xpg4.2
2559 .St -xpg4.3
2560 .It \-xbd5
2561 .St -xbd5
2562 .It \-xcu5
2563 .St -xcu5
2564 .It \-xsh5
2565 .St -xsh5
2566 .It \-xns5
2567 .St -xns5
2568 .It \-xns5.2
2569 .St -xns5.2
2570 .It \-xns5.2d2.0
2571 .St -xns5.2d2.0
2572 .It \-xcurses4.2
2573 .St -xcurses4.2
2574 .It \-susv2
2575 .St -susv2
2576 .It \-susv3
2577 .St -susv3
2578 .It \-svid4
2579 .St -svid4
2580 .El
2581 .Ss \&Sx
2582 Reference a section or sub-section.
2583 The referenced section or sub-section name must be identical to the
2584 enclosed argument, including whitespace.
2585 .Pp
2586 Examples:
2587 .D1 \&.Sx MANUAL STRUCTURE
2588 .Ss \&Sy
2589 Format enclosed arguments in symbolic
2590 .Pq Dq boldface .
2591 Note that this is a presentation term and should not be used for
2592 stylistically decorating technical terms.
2593 .Pp
2594 See also
2595 .Sx \&Bf ,
2596 .Sx \&Li ,
2597 and
2598 .Sx \&Em .
2599 .Ss \&Tn
2600 Format a tradename.
2601 .Pp
2602 Examples:
2603 .D1 \&.Tn IBM
2604 .Ss \&Ud
2605 Prints out
2606 .Dq currently under development .
2607 .Ss \&Ux
2608 Format the UNIX name.
2609 Accepts no argument.
2610 .Pp
2611 Examples:
2612 .D1 \&.Ux
2613 .Pp
2614 See also
2615 .Sx \&At ,
2616 .Sx \&Bsx ,
2617 .Sx \&Bx ,
2618 .Sx \&Dx ,
2619 .Sx \&Fx ,
2620 .Sx \&Nx ,
2621 and
2622 .Sx \&Ox .
2623 .Ss \&Va
2624 A variable name.
2625 .Pp
2626 Examples:
2627 .D1 \&.Va foo
2628 .D1 \&.Va const char *bar ;
2629 .Ss \&Vt
2630 A variable type.
2631 This is also used for indicating global variables in the
2632 .Em SYNOPSIS
2633 section, in which case a variable name is also specified.
2634 Note that it accepts
2635 .Sx Block partial-implicit
2636 syntax when invoked as the first macro in the
2637 .Em SYNOPSIS
2638 section, else it accepts ordinary
2639 .Sx In-line
2640 syntax.
2641 .Pp
2642 Note that this should not be confused with
2643 .Sx \&Ft ,
2644 which is used for function return types.
2645 .Pp
2646 Examples:
2647 .D1 \&.Vt unsigned char
2648 .D1 \&.Vt extern const char * const sys_signame[] \&;
2649 .Pp
2650 See also
2651 .Sx MANUAL STRUCTURE
2652 and
2653 .Sx \&Va .
2654 .Ss \&Xc
2655 Close a scope opened by
2656 .Sx \&Xo .
2657 .Ss \&Xo
2658 Open an extension scope.
2659 This macro originally existed to extend the 9-argument limit of troff;
2660 since this limit has been lifted, the macro has been deprecated.
2661 .Ss \&Xr
2662 Link to another manual
2663 .Pq Qq cross-reference .
2664 Its syntax is as follows:
2665 .Pp
2666 .D1 Pf \. Sx \&Xr Cm name section
2667 .Pp
2668 The
2669 .Cm name
2670 and
2671 .Cm section
2672 are the name and section of the linked manual.
2673 If
2674 .Cm section
2675 is followed by non-punctuation, an
2676 .Sx \&Ns
2677 is inserted into the token stream.
2678 This behaviour is for compatibility with
2679 .Xr groff 1 .
2680 .Pp
2681 Examples:
2682 .D1 \&.Xr mandoc 1
2683 .D1 \&.Xr mandoc 1 \&;
2684 .D1 \&.Xr mandoc 1 \&Ns s behaviour
2685 .Ss \&br
2686 Emits a line-break.
2687 This macro should not be used; it is implemented for compatibility with
2688 historical manuals.
2689 .Pp
2690 Consider using
2691 .Sx \&Pp
2692 in the event of natural paragraph breaks.
2693 .Ss \&sp
2694 Emits vertical space.
2695 This macro should not be used; it is implemented for compatibility with
2696 historical manuals.
2697 Its syntax is as follows:
2698 .Pp
2699 .D1 Pf \. Sx \&sp Op Cm height
2700 .Pp
2701 The
2702 .Cm height
2703 argument must be formatted as described in
2704 .Sx Scaling Widths .
2705 If unspecified,
2706 .Sx \&sp
2707 asserts a single vertical space.
2708 .Sh COMPATIBILITY
2709 This section documents compatibility between mandoc and other other
2710 troff implementations, at this time limited to GNU troff
2711 .Pq Qq groff .
2712 The term
2713 .Qq historic groff
2714 refers to groff versions before the
2715 .Pa doc.tmac
2716 file re-write
2717 .Pq somewhere between 1.15 and 1.19 .
2718 .Pp
2719 Heirloom troff, the other significant troff implementation accepting
2720 \-mdoc, is similar to historic groff.
2721 .Pp
2722 .Bl -dash -compact
2723 .It
2724 An empty
2725 .Sq \&Dd
2726 macro in groff prints
2727 .Dq Epoch .
2728 In mandoc, it resolves to the current date.
2729 .It
2730 The \es (font size), \em (font colour), and \eM (font filling colour)
2731 font decoration escapes are all discarded in mandoc.
2732 .It
2733 Old groff fails to assert a newline before
2734 .Sx \&Bd Fl ragged compact .
2735 .It
2736 groff behaves inconsistently when encountering
2737 .Pf non- Sx \&Fa
2738 children of
2739 .Sx \&Fo
2740 regarding spacing between arguments.
2741 In mandoc, this is not the case: each argument is consistently followed
2742 by a single space and the trailing
2743 .Sq \&)
2744 suppresses prior spacing.
2745 .It
2746 groff behaves inconsistently when encountering
2747 .Sx \&Ft
2748 and
2749 .Sx \&Fn
2750 in the
2751 .Em SYNOPSIS :
2752 at times newline(s) are suppressed depending on whether a prior
2753 .Sx \&Fn
2754 has been invoked.
2755 In mandoc, this is not the case.
2756 See
2757 .Sx \&Ft
2758 and
2759 .Sx \&Fn
2760 for the normalised behaviour.
2761 .It
2762 Historic groff does not break before an
2763 .Sx \&Fn
2764 when not invoked as the line macro in the
2765 .Em SYNOPSIS
2766 section.
2767 .It
2768 Historic groff formats the
2769 .Sx \&In
2770 badly: trailing arguments are trashed and
2771 .Em SYNOPSIS
2772 is not specially treated.
2773 .It
2774 groff does not accept the
2775 .Sq \&Ta
2776 pseudo-macro as a line macro.
2777 mandoc does.
2778 .It
2779 The comment syntax
2780 .Sq \e\."
2781 is no longer accepted.
2782 .It
2783 In groff, the
2784 .Sx \&Pa
2785 macro does not format its arguments when used in the FILES section under
2786 certain list types.
2787 mandoc does.
2788 .It
2789 Historic groff does not print a dash for empty
2790 .Sx \&Fl
2791 arguments.
2792 mandoc and newer groff implementations do.
2793 .It
2794 groff behaves irregularly when specifying
2795 .Sq \ef
2796 .Sx Text Decoration
2797 within line-macro scopes.
2798 mandoc follows a consistent system.
2799 .It
2800 In mandoc, negative scaling units are truncated to zero; groff would
2801 move to prior lines.
2802 Furthermore, the
2803 .Sq f
2804 scaling unit, while accepted, is rendered as the default unit.
2805 .It
2806 In quoted literals, groff allowed pairwise double-quotes to produce a
2807 standalone double-quote in formatted output.
2808 This idiosyncratic behaviour is not applicable in mandoc.
2809 .It
2810 Display offsets
2811 .Sx \&Bd
2812 .Fl offset Ar center
2813 and
2814 .Fl offset Ar right
2815 are disregarded in mandoc.
2816 Furthermore, troff specifies a
2817 .Fl file Ar file
2818 argument that is not supported in mandoc.
2819 Lastly, since text is not right-justified in mandoc (or even groff),
2820 .Fl ragged
2821 and
2822 .Fl filled
2823 are aliases, as are
2824 .Fl literal
2825 and
2826 .Fl unfilled .
2827 .It
2828 Historic groff has many un-callable macros.
2829 Most of these (excluding some block-level macros) are now callable.
2830 .It
2831 The vertical bar
2832 .Sq \(ba
2833 made historic groff
2834 .Qq go orbital
2835 but has been a proper delimiter since then.
2836 .It
2837 .Sx \&It Fl nested
2838 is assumed for all lists (it wasn't in historic groff): any list may be
2839 nested and
2840 .Fl enum
2841 lists will restart the sequence only for the sub-list.
2842 .It
2843 Some manuals use
2844 .Sx \&Li
2845 incorrectly by following it with a reserved character and expecting the
2846 delimiter to render.
2847 This is not supported in mandoc.
2848 .It
2849 In groff, the
2850 .Sx \&Cd ,
2851 .Sx \&Er ,
2852 .Sx \&Ex ,
2853 and
2854 .Sx \&Rv
2855 macros were stipulated only to occur in certain manual sections.
2856 mandoc does not have these restrictions.
2857 .It
2858 Newer groff and mandoc print
2859 .Qq AT&T UNIX
2860 prior to unknown arguments of
2861 .Sx \&At ;
2862 older groff did nothing.
2863 .El
2864 .Sh SEE ALSO
2865 .Xr mandoc 1 ,
2866 .Xr mandoc_char 7
2867 .Sh AUTHORS
2868 The
2869 .Nm
2870 reference was written by
2871 .An Kristaps Dzonsons Aq kristaps@bsd.lv .