]> git.cameronkatri.com Git - mandoc.git/blob - mdoc.7
All macro-invocations, for consistency, begin with `.' in documentation.
[mandoc.git] / mdoc.7
1 .\" $Id: mdoc.7,v 1.16 2009/03/26 16:23:22 kristaps Exp $
2 .\"
3 .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@openbsd.org>
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the
7 .\" above copyright notice and this permission notice appear in all
8 .\" copies.
9 .\"
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 .\" WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 .\" AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 .\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 .\" PERFORMANCE OF THIS SOFTWARE.
18 .\"
19 .Dd $Mdocdate: March 26 2009 $
20 .Dt mdoc 7
21 .Os
22 .\" SECTION
23 .Sh NAME
24 .Nm mdoc
25 .Nd mdoc language reference
26 .\" SECTION
27 .Sh DESCRIPTION
28 The
29 .Nm mdoc
30 language is used to format
31 .Bx
32 .Ux
33 manuals. In this reference document, we describe the syntax, ontology
34 and structure of the
35 .Nm
36 language.
37 .\" PARAGRAPH
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. Other lines are interpreted within the scope of
45 prior macros:
46 .Bd -literal -offset XXX
47 \&.Sh Macro lines change control state.
48 Other lines are interpreted within the current state.
49 .Ed
50 .\" PARAGRAPH
51 .Pp
52 Macros are two- or three-character sequences whose scope rules, rules
53 that dictate handling of subsequent-line or same-line arguments, are
54 governed by one of five classifications described in this document.
55 .\" SECTION
56 .Sh INPUT ENCODING
57 .Nm
58 documents may contain only graphable 7-bit ASCII characters, the space
59 character
60 .Sq \ ,
61 and, in certain circumstances, the tab character
62 .Sq \et .
63 All manuals must have
64 .Sq \en
65 line termination.
66 .Pp
67 The only time a blank line is acceptable is within
68 the context of
69 .Sq \&.Bd \-literal
70 or
71 .Sq \&.Bd \-unfilled .
72 .Pp
73 Tab characters
74 .Pq \et
75 are only acceptable when delimiting
76 .Sq \&.Bl \-column
77 and in
78 .Sq \&.Bd \-literal
79 or
80 .Sq \&.Bd \-unfilled
81 contexts.
82 .\" SUB-SECTION
83 .Ss Reserved Characters
84 Within a macro line, the following characters are reserved:
85 .Bl -tag -width 12n -offset XXXX -compact
86 .It \&.
87 .Pq period
88 .It \&,
89 .Pq comma
90 .It \&:
91 .Pq colon
92 .It \&;
93 .Pq semicolon
94 .It \&(
95 .Pq left-parenthesis
96 .It \&)
97 .Pq right-parenthesis
98 .It \&[
99 .Pq left-bracket
100 .It \&]
101 .Pq right-bracket
102 .It \&?
103 .Pq question
104 .It \&!
105 .Pq exclamation
106 .El
107 .\" PARAGRAPH
108 .Pp
109 Use of reserved characters is described in
110 .Sx Closure .
111 For general non-reserved use, characters must either be escaped with a
112 non-breaking space
113 .Pq Sq \e&
114 or, if applicable, an appropriate escape-sequence used.
115 .\" SUB-SECTION
116 .Ss Special Characters
117 Special character sequences begin with the escape character
118 .Sq \e
119 followed by either an open-parenthesis
120 .Sq \&(
121 for two-character sequences; an open-bracket
122 .Sq \&[
123 for n-character sequences (terminated at a close-bracket
124 .Sq \&] ) ;
125 or a single one-character sequence.
126 .Pp
127 Characters may alternatively be escaped by a slash-asterisk,
128 .Sq \e* ,
129 with the same combinations as described above. This form is deprecated.
130 .Pp
131 The following is a table of all available escapes.
132 .Pp
133 Grammatic:
134 .Bl -tag -width 12n -offset "XXXX" -compact
135 .It \e(em
136 .Pq em-dash
137 .It \e(en
138 .Pq en-dash
139 .It \e-
140 .Pq hyphen
141 .It \e\e
142 .Pq back-slash
143 .It \e'
144 .Pq apostrophe
145 .It \e`
146 .Pq back-tick
147 .It \e
148 .Pq space
149 .It \e.
150 .Pq period
151 .It \e(r!
152 .Pq upside-down exclamation
153 .It \e(r?
154 .Pq upside-down question
155 .El
156 .\" PARAGRAPH
157 .Pp
158 Enclosures:
159 .Bl -tag -width 12n -offset "XXXX" -compact
160 .It \e(lh
161 .Pq left hand
162 .It \e(rh
163 .Pq right hand
164 .It \e(Fo
165 .Pq left guillemet
166 .It \e(Fc
167 .Pq right guillemet
168 .It \e(fo
169 .Pq left guilsing
170 .It \e(fc
171 .Pq right guilsing
172 .It \e(rC
173 .Pq right brace
174 .It \e(lC
175 .Pq left brace
176 .It \e(ra
177 .Pq right angle
178 .It \e(la
179 .Pq left angle
180 .It \e(rB
181 .Pq right bracket
182 .It \e(lB
183 .Pq left bracket
184 .It \eq
185 .Pq double-quote
186 .It \e(lq
187 .Pq left double-quote
188 .It \e(Lq
189 .Pq left double-quote, deprecated
190 .It \e(rq
191 .Pq right double-quote
192 .It \e(Rq
193 .Pq right double-quote, deprecated
194 .It \e(oq
195 .Pq left single-quote
196 .It \e(aq
197 .Pq right single-quote
198 .It \e(Bq
199 .Pq right low double-quote
200 .It \e(bq
201 .Pq right low single-quote
202 .El
203 .\" PARAGRAPH
204 .Pp
205 Indicatives:
206 .Bl -tag -width 12n -offset "XXXX" -compact
207 .It \e(<-
208 .Pq left arrow
209 .It \e(->
210 .Pq right arrow
211 .It \e(ua
212 .Pq up arrow
213 .It \e(da
214 .Pq down arrow
215 .It \e(<>
216 .Pq left-right arrow
217 .It \e(lA
218 .Pq left double-arrow
219 .It \e(rA
220 .Pq right double-arrow
221 .It \e(uA
222 .Pq up double-arrow
223 .It \e(dA
224 .Pq down double-arrow
225 .It \e(hA
226 .Pq left-right double-arrow
227 .El
228 .\" PARAGRAPH
229 .Pp
230 Mathematical:
231 .Bl -tag -width 12n -offset "XXXX" -compact
232 .It \e(es
233 .Pq empty set
234 .It \e(ca
235 .Pq intersection
236 .It \e(cu
237 .Pq union
238 .It \e(gr
239 .Pq gradient
240 .It \e(pd
241 .Pq partial differential
242 .It \e(ap
243 .Pq similarity
244 .It \e(=)
245 .Pq proper superset
246 .It \e((=
247 .Pq proper subset
248 .It \e(eq
249 .Pq equals
250 .It \e(di
251 .Pq division
252 .It \e(mu
253 .Pq multiplication
254 .It \e(pl
255 .Pq addition
256 .It \e(nm
257 .Pq not element
258 .It \e(mo
259 .Pq element
260 .It \e(Im
261 .Pq imaginary
262 .It \e(Re
263 .Pq real
264 .It \e(Ah
265 .Pq aleph
266 .It \e(te
267 .Pq existential quantifier
268 .It \e(fa
269 .Pq universal quantifier
270 .It \e(AN
271 .Pq logical AND
272 .It \e(OR
273 .Pq logical OR
274 .It \e(no
275 .Pq logical NOT
276 .It \e(st
277 .Pq such that
278 .It \e(tf
279 .Pq therefore
280 .It \e(~~
281 .Pq approximate
282 .It \e(~=
283 .Pq approximately equals
284 .It \e(=~
285 .Pq congruent
286 .It \e(Gt
287 .Pq greater-than, deprecated
288 .It \e(Lt
289 .Pq less-than, deprecated
290 .It \e(<=
291 .Pq less-than-equal
292 .It \e(Le
293 .Pq less-than-equal, deprecated
294 .It \e(>=
295 .Pq greater-than-equal
296 .It \e(Ge
297 .Pq greater-than-equal
298 .It \e(==
299 .Pq equal
300 .It \e(!=
301 .Pq not equal
302 .It \e(Ne
303 .Pq not equal, deprecated
304 .It \e(if
305 .Pq infinity
306 .It \e(If
307 .Pq infinity, deprecated
308 .It \e(na
309 .Pq NaN , an extension
310 .It \e(Na
311 .Pq NaN, deprecated
312 .It \e(+-
313 .Pq plus-minus
314 .It \e(Pm
315 .Pq plus-minus, deprecated
316 .It \e(**
317 .Pq asterisk
318 .El
319 .\" PARAGRAPH
320 .Pp
321 Ligatures:
322 .Bl -tag -width 12n -offset "XXXX" -compact
323 .It \e(ss
324 .Pq German eszett
325 .It \e(AE
326 .Pq upper-case AE
327 .It \e(ae
328 .Pq lower-case AE
329 .It \e(OE
330 .Pq upper-case OE
331 .It \e(oe
332 .Pq lower-case OE
333 .It \e(ff
334 .Pq ff ligature
335 .It \e(fi
336 .Pq fi ligature
337 .It \e(fl
338 .Pq fl ligature
339 .It \e(Fi
340 .Pq ffi ligature
341 .It \e(Fl
342 .Pq ffl ligature
343 .El
344 .\" PARAGRAPH
345 .Pp
346 Diacritics and letters:
347 .Bl -tag -width 12n -offset "XXXX" -compact
348 .It \e(ga
349 .Pq grave accent
350 .It \e(aa
351 .Pq accute accent
352 .It \e(a"
353 .Pq umlaut accent
354 .It \e(ad
355 .Pq dieresis accent
356 .It \e(a~
357 .Pq tilde accent
358 .It \e(a^
359 .Pq circumflex accent
360 .It \e(ac
361 .Pq cedilla accent
362 .It \e(ad
363 .Pq dieresis accent
364 .It \e(ah
365 .Pq caron accent
366 .It \e(ao
367 .Pq ring accent
368 .It \e(ho
369 .Pq hook accent
370 .It \e(ab
371 .Pq breve accent
372 .It \e(a-
373 .Pq macron accent
374 .It \e(-D
375 .Pq upper-case eth
376 .It \e(Sd
377 .Pq lower-case eth
378 .It \e(TP
379 .Pq upper-case thorn
380 .It \e(Tp
381 .Pq lower-case thorn
382 .It \e('A
383 .Pq upper-case acute A
384 .It \e('E
385 .Pq upper-case acute E
386 .It \e('I
387 .Pq upper-case acute I
388 .It \e('O
389 .Pq upper-case acute O
390 .It \e('U
391 .Pq upper-case acute U
392 .It \e('a
393 .Pq lower-case acute a
394 .It \e('e
395 .Pq lower-case acute e
396 .It \e('i
397 .Pq lower-case acute i
398 .It \e('o
399 .Pq lower-case acute o
400 .It \e('u
401 .Pq lower-case acute u
402 .It \e(`A
403 .Pq upper-case grave A
404 .It \e(`E
405 .Pq upper-case grave E
406 .It \e(`I
407 .Pq upper-case grave I
408 .It \e(`O
409 .Pq upper-case grave O
410 .It \e(`U
411 .Pq upper-case grave U
412 .It \e(`a
413 .Pq lower-case grave a
414 .It \e(`e
415 .Pq lower-case grave e
416 .It \e(`i
417 .Pq lower-case grave i
418 .It \e(`o
419 .Pq lower-case grave o
420 .It \e(`u
421 .Pq lower-case grave u
422 .It \e(~A
423 .Pq upper-case tilde A
424 .It \e(~N
425 .Pq upper-case tilde N
426 .It \e(~O
427 .Pq upper-case tilde O
428 .It \e(~a
429 .Pq lower-case tilde a
430 .It \e(~n
431 .Pq lower-case tilde n
432 .It \e(~o
433 .Pq lower-case tilde o
434 .It \e(:A
435 .Pq upper-case dieresis A
436 .It \e(:E
437 .Pq upper-case dieresis E
438 .It \e(:I
439 .Pq upper-case dieresis I
440 .It \e(:O
441 .Pq upper-case dieresis O
442 .It \e(:U
443 .Pq upper-case dieresis U
444 .It \e(:a
445 .Pq lower-case dieresis a
446 .It \e(:e
447 .Pq lower-case dieresis e
448 .It \e(:i
449 .Pq lower-case dieresis i
450 .It \e(:o
451 .Pq lower-case dieresis o
452 .It \e(:u
453 .Pq lower-case dieresis u
454 .It \e(:y
455 .Pq lower-case dieresis y
456 .It \e(^A
457 .Pq upper-case circumflex A
458 .It \e(^E
459 .Pq upper-case circumflex E
460 .It \e(^I
461 .Pq upper-case circumflex I
462 .It \e(^O
463 .Pq upper-case circumflex O
464 .It \e(^U
465 .Pq upper-case circumflex U
466 .It \e(^a
467 .Pq lower-case circumflex a
468 .It \e(^e
469 .Pq lower-case circumflex e
470 .It \e(^i
471 .Pq lower-case circumflex i
472 .It \e(^o
473 .Pq lower-case circumflex o
474 .It \e(^u
475 .Pq lower-case circumflex u
476 .It \e(,C
477 .Pq upper-case cedilla C
478 .It \e(,c
479 .Pq lower-case cedilla c
480 .It \e(/L
481 .Pq upper-case stroke L
482 .It \e(/l
483 .Pq lower-case stroke l
484 .It \e(/O
485 .Pq upper-case stroke O
486 .It \e(/o
487 .Pq lower-case stroke o
488 .It \e(oA
489 .Pq upper-case ring A
490 .It \e(oa
491 .Pq lower-case ring a
492 .El
493 .\" PARAGRAPH
494 .Pp
495 Monetary:
496 .Bl -tag -width 12n -offset "XXXX" -compact
497 .It \e(Cs
498 .Pq Scandinavian
499 .It \e(Do
500 .Pq dollar
501 .It \e(Po
502 .Pq pound
503 .It \e(Ye
504 .Pq yen
505 .It \e(Fn
506 .Pq florin
507 .It \e(ct
508 .Pq cent
509 .El
510 .\" PARAGRAPH
511 .Pp
512 Special symbols:
513 .Bl -tag -width 12n -offset "XXXX" -compact
514 .It \e(de
515 .Pq degree
516 .It \e(ps
517 .Pq paragraph
518 .It \e(sc
519 .Pq section
520 .It \e(dg
521 .Pq dagger
522 .It \e(dd
523 .Pq double dagger
524 .It \e(ci
525 .Pq circle
526 .It \e(ba
527 .Pq bar
528 .It \e(bb
529 .Pq broken bar
530 .It \e(Ba
531 .Pq bar, deprecated
532 .It \e(co
533 .Pq copyright
534 .It \e(rg
535 .Pq registered
536 .It \e(tm
537 .Pq trademarked
538 .It \e&
539 .Pq non-breaking space
540 .It \ee
541 .Pq escape
542 .It \e(Am
543 .Pq ampersand, deprecated
544 .El
545 .\" SECTION
546 .Sh ONTOLOGY
547 Macros are classified in an ontology described by their scope rules.
548 Some macros are allowed to deviate from their classifications to
549 preserve backward-compatibility with old macro combinations still found
550 in the manual corpus. These are specifically noted on a per-macro
551 basis.
552 .\" SUB-SECTION
553 .Ss Scope
554 .Bl -inset
555 .\" LIST-ITEM
556 .It Em Block
557 macros enclose other block macros, in-line macros or text, and
558 may span multiple lines.
559 .Bl -inset -offset XXXX
560 .\" LIST-ITEM
561 .It Em Full-block
562 macros always span multiple lines. They consist of zero or
563 more
564 .Qq heads ,
565 subsequent macros or text on the same line following invocation; an
566 optional
567 .Qq body ,
568 which spans subsequent lines of text or macros; and an optional
569 .Qq tail ,
570 macros or text on the same line following closure.
571 .\" LIST-ITEM
572 .It Em Partial-block
573 macros may span multiple lines. They consists of a optional
574 .Qq head ,
575 text immediately following invocation; always a
576 .Qq body ,
577 text or macros following the head on the same and subsequent lines; and
578 optionally a
579 .Qq tail ,
580 text immediately following closure.
581 .\" LIST-ITEM
582 .It Em In-line
583 macros may only enclose text and span at most a single line.
584 .El
585 .El
586 .\" SUB-SECTION
587 .Ss Closure
588 Closure of a macro's scope depends first on its classification, then
589 on whether it's parsable. In this table,
590 .Sq BFE
591 refers to block full-explicit and so on.
592 .\" PARAGRAPH
593 .Pp
594 .Bl -tag -width 12n -offset XXXX -compact
595 .It BPE , BFE
596 corresponding explicit closure macro
597 .It BFI
598 end-of-file or a corresponding implicit closure macro
599 .It BPI
600 end-of-line (body may be closed by >0 space-separated
601 .Sx Reserved Characters ,
602 although block scope will still be open)
603 .It INL
604 end-of-line
605 .El
606 .\" PARAGRAPH
607 .Pp
608 If a macro (block or in-line) is parsable, it may also be closed out by
609 one of the following scenarios (unless specifically noted otherwise):
610 .\" PARAGRAPH
611 .Pp
612 .Bl -dash -offset XXXX -compact
613 .It
614 a sequence of >0 space-separated
615 .Sx Reserved Characters ,
616 .It
617 another macro,
618 .It
619 end-of-line, or
620 .It
621 completion of a set number of arguments.
622 .El
623 .\" PARAGRAPH
624 .Pp
625 If >0 space-separated
626 .Sx Reserved Characters
627 are followed by non-reserved characters, the behaviour differs per
628 macro. In general, scope of the macro is closed and re-opened:
629 subsequent tokens are interpreted as if the scope had just been opened.
630 In other circumstances, scope is simply closed out.
631 .\" SECTION
632 .Sh SYNTAX
633 Macros are generally two and at times three characters in length. The
634 syntax of macro invocation depends on its classification.
635 .Qq \-arg
636 refers to the macro arguments (which may contain zero or more values).
637 In these illustrations,
638 .Sq \&.Yo
639 opens the scope of a macro, and if specified,
640 .Sq \&.Yc
641 closes it out (closure may be implicit at end-of-line or end-of-file).
642 .\" PARAGRAPH
643 .Pp
644 Block full-explicit (may contain head, body, tail).
645 .Bd -literal -offset XXXX
646 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB
647 \(lBbody...\(rB
648 \&.Yc \(lBtail...\(rB
649 .Ed
650 .\" PARAGRAPH
651 .Pp
652 Block full-implicit (may contain zero or more heads, body, no tail).
653 .Bd -literal -offset XXXX
654 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
655 \(lBbody...\(rB
656 \&.Yc
657 .Ed
658 .\" PARAGRAPH
659 .Pp
660 Block partial-explicit (may contain head, multi-line body, tail).
661 .Bd -literal -offset XXXX
662 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB
663 \(lBbody...\(rB
664 \&.Yc \(lBtail...\(rB
665
666 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB \
667 \(lBbody...\(rB \&Yc \(lBtail...\(rB
668 .Ed
669 .\" PARAGRAPH
670 .Pp
671 Block partial-implicit (no head, body, no tail). Note that the body
672 section may be followed by zero or more
673 .Sx Reserved Words .
674 These are in the block scope, but not in the body scope.
675 .Bd -literal -offset XXXX
676 \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBreserved...\(rB
677 .Ed
678 .\" PARAGRAPH
679 .Pp
680 In-lines have \(>=0 scoped arguments.
681 .Bd -literal -offset XXX
682 \&.Yy \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB
683
684 \&.Yy \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
685 .Ed
686 .\"
687 .Sh MACROS
688 This section contains a complete list of all
689 .Nm
690 macros, arranged ontologically. A
691 .Qq callable
692 macro is may be invoked subsequent to the initial macro-line macro. A
693 .Qq parsable
694 macro may be followed by further (ostensibly callable) macros.
695 .\" SUB-SECTION
696 .Ss Block full-implicit
697 The head of these macros follows invocation; the body is the content of
698 subsequent lines prior to closure. None of these macros have tails;
699 some
700 .Po
701 .Sq \&.It \-bullet ,
702 .Sq \-hyphen ,
703 .Sq \-dash ,
704 .Sq \-enum ,
705 .Sq \-item
706 .Pc
707 don't have heads.
708 .Pp
709 .Bl -column "MacroX" "CallableX" "ParsableX" "Closing" -compact -offset XXXX
710 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Closing
711 .It \&.Sh Ta \&No Ta \&No Ta \&.Sh
712 .It \&.Ss Ta \&No Ta \&No Ta \&.Sh, \&.Ss
713 .It \&.It Ta \&No Ta Yes Ta \&.It, \&.El
714 .El
715 .\" SUB-SECTION
716 .Ss Block full-explicit
717 None of these macros are callable or parsed. The last column indicates
718 the explicit scope rules. All contains bodies, some may contain heads
719 .Pq So \&Bf Sc .
720 .Pp
721 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXX" -compact -offset XXXX
722 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
723 .It \&.Bd Ta \&No Ta \&No Ta closed by \&.Ed
724 .It \&.Ed Ta \&No Ta \&No Ta opened by \&.Bd
725 .It \&.Bl Ta \&No Ta \&No Ta closed by \&.El
726 .It \&.El Ta \&No Ta \&No Ta opened by \&.Bl
727 .It \&.Bf Ta \&No Ta \&No Ta closed by \&.Ef
728 .It \&.Ef Ta \&No Ta \&No Ta opened by \&.Bf
729 .It \&.Bk Ta \&No Ta \&No Ta closed by \&.Ek
730 .It \&.Ek Ta \&No Ta \&No Ta opened by \&.Bk
731 .El
732 .\" SUB-SECTION
733 .Ss Block partial-implicit
734 All of these are callable and parsed for further macros. Their scopes
735 close at the invocation's end-of-line.
736 .Pp
737 .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset XXXX
738 .It Em Macro Ta Em Callable Ta Em Parsable
739 .It \&.Aq Ta Yes Ta Yes
740 .It \&.Op Ta Yes Ta Yes
741 .It \&.Bq Ta Yes Ta Yes
742 .It \&.Dq Ta Yes Ta Yes
743 .It \&.Pq Ta Yes Ta Yes
744 .It \&.Qq Ta Yes Ta Yes
745 .It \&.Sq Ta Yes Ta Yes
746 .It \&.Brq Ta Yes Ta Yes
747 .It \&.D1 Ta \&No Ta \&Yes
748 .It \&.Dl Ta \&No Ta Yes
749 .It \&.Ql Ta Yes Ta Yes
750 .El
751 .\" PARAGRAPH
752 .Pp
753 The
754 .Sq \&.Op
755 may be broken by
756 .Sq \&.Oc
757 as in the following example:
758 .Bd -literal -offset XXXX
759 \&.Oo
760 \&.Op Fl a Oc
761 .Ed
762 .Pp
763 In the above example, the scope of
764 .Sq \&.Op
765 is technically broken by
766 .Sq \&.Oc ,
767 however, due to the overwhelming existence of this sequence, it's
768 allowed.
769 .\" SUB-SECTION
770 .Ss Block partial-explicit
771 Each of these contains at least a body and, in limited circumstances, a
772 head
773 .Pq So \&.Fo Sc , So \&.Eo Sc
774 and/or tail
775 .Pq So \&.Ec Sc .
776 .Pp
777 .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset XXXX
778 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
779 .It \&.Ao Ta Yes Ta Yes Ta closed by \&.Ac
780 .It \&.Ac Ta Yes Ta Yes Ta opened by \&.Ao
781 .It \&.Bc Ta Yes Ta Yes Ta closed by \&.Bo
782 .It \&.Bo Ta Yes Ta Yes Ta opened by \&.Bc
783 .It \&.Pc Ta Yes Ta Yes Ta closed by \&.Po
784 .It \&.Po Ta Yes Ta Yes Ta opened by \&.Pc
785 .It \&.Do Ta Yes Ta Yes Ta closed by \&.Dc
786 .It \&.Dc Ta Yes Ta Yes Ta opened by \&.Do
787 .It \&.Xo Ta Yes Ta Yes Ta closed by \&.Xc
788 .It \&.Xc Ta Yes Ta Yes Ta opened by \&.Xo
789 .It \&.Bro Ta Yes Ta Yes Ta closed by \&.Brc
790 .It \&.Brc Ta Yes Ta Yes Ta opened by \&.Bro
791 .It \&.Oc Ta Yes Ta Yes Ta closed by \&.Oo
792 .It \&.Oo Ta Yes Ta Yes Ta opened by \&.Oc
793 .It \&.So Ta Yes Ta Yes Ta closed by \&.Sc
794 .It \&.Sc Ta Yes Ta Yes Ta opened by \&.So
795 .It \&.Fc Ta Yes Ta Yes Ta opened by \&.Fo
796 .It \&.Fo Ta \&No Ta \&No Ta closed by \&.Fc
797 .It \&.Ec Ta Yes Ta Yes Ta opened by \&.Eo
798 .It \&.Eo Ta Yes Ta Yes Ta closed by \&.Ec
799 .It \&.Qc Ta Yes Ta Yes Ta opened by \&.Oo
800 .It \&.Qo Ta Yes Ta Yes Ta closed by \&.Oc
801 .It \&.Re Ta \&No Ta \&No Ta opened by \&.Rs
802 .It \&.Rs Ta \&No Ta \&No Ta closed by \&.Re
803 .El
804 .\" SUB-SECTION
805 .Ss In-line
806 In-line macros have only text children. If a number (or inequality) of
807 arguments is
808 .Pq n ,
809 then the macro accepts an arbitrary number of arguments.
810 .Pp
811 .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset XXXX
812 .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
813 .It \&.Dd Ta \&No Ta \&No Ta >0
814 .It \&.Dt Ta \&No Ta \&No Ta n
815 .It \&.Os Ta \&No Ta \&No Ta n
816 .It \&.Pp Ta \&No Ta \&No Ta 0
817 .It \&.Ad Ta Yes Ta Yes Ta n
818 .It \&.An Ta \&No Ta Yes Ta n
819 .It \&.Ar Ta Yes Ta Yes Ta n
820 .It \&.Cd Ta Yes Ta \&No Ta >0
821 .It \&.Cm Ta Yes Ta Yes Ta n
822 .It \&.Dv Ta Yes Ta Yes Ta n
823 .It \&.Er Ta Yes Ta Yes Ta >0
824 .It \&.Ev Ta Yes Ta Yes Ta n
825 .It \&.Ex Ta \&No Ta \&No Ta 0
826 .It \&.Fa Ta Yes Ta Yes Ta n
827 .It \&.Fd Ta \&No Ta \&No Ta >0
828 .It \&.Fl Ta Yes Ta Yes Ta n
829 .It \&.Fn Ta Yes Ta Yes Ta >0
830 .It \&.Ft Ta \&No Ta Yes Ta n
831 .It \&.Ic Ta Yes Ta Yes Ta >0
832 .It \&.In Ta \&No Ta \&No Ta n
833 .It \&.Li Ta Yes Ta Yes Ta n
834 .It \&.Nd Ta \&No Ta \&No Ta n
835 .It \&.Nm Ta Yes Ta Yes Ta n
836 .It \&.Ot Ta \&No Ta \&No Ta n
837 .It \&.Pa Ta Yes Ta Yes Ta n
838 .It \&.Rv Ta \&No Ta \&No Ta 0
839 .It \&.St Ta \&No Ta Yes Ta 1
840 .It \&.Va Ta Yes Ta Yes Ta n
841 .It \&.Vt Ta Yes Ta Yes Ta >0
842 .It \&.Xr Ta Yes Ta Yes Ta >0, <3
843 .It \&.%A Ta \&No Ta \&No Ta >0
844 .It \&.%B Ta \&No Ta \&No Ta >0
845 .It \&.%C Ta \&No Ta \&No Ta >0
846 .It \&.%D Ta \&No Ta \&No Ta >0
847 .It \&.%I Ta \&No Ta \&No Ta >0
848 .It \&.%J Ta \&No Ta \&No Ta >0
849 .It \&.%N Ta \&No Ta \&No Ta >0
850 .It \&.%O Ta \&No Ta \&No Ta >0
851 .It \&.%P Ta \&No Ta \&No Ta >0
852 .It \&.%R Ta \&No Ta \&No Ta >0
853 .It \&.%T Ta \&No Ta \&No Ta >0
854 .It \&.%V Ta \&No Ta \&No Ta >0
855 .It \&.At Ta Yes Ta Yes Ta 1
856 .It \&.Bsx Ta Yes Ta Yes Ta n
857 .It \&.Bx Ta Yes Ta Yes Ta n
858 .It \&.Db Ta \&No Ta \&No Ta 1
859 .It \&.Em Ta Yes Ta Yes Ta n
860 .It \&.Fx Ta Yes Ta Yes Ta n
861 .It \&.Ms Ta \&No Ta Yes Ta >0
862 .It \&.No Ta Yes Ta Yes Ta 0
863 .It \&.Ns Ta Yes Ta Yes Ta 0
864 .It \&.Nx Ta Yes Ta Yes Ta n
865 .It \&.Ox Ta Yes Ta Yes Ta n
866 .It \&.Pf Ta \&No Ta Yes Ta 1
867 .It \&.Sm Ta \&No Ta \&No Ta 1
868 .It \&.Sx Ta Yes Ta Yes Ta >0
869 .It \&.Sy Ta Yes Ta Yes Ta >0
870 .It \&.Tn Ta Yes Ta Yes Ta >0
871 .It \&.Ux Ta Yes Ta Yes Ta n
872 .It \&.Dx Ta Yes Ta Yes Ta n
873 .It \&.Bt Ta \&No Ta \&No Ta 0
874 .It \&.Hf Ta \&No Ta \&No Ta n
875 .It \&.Fr Ta \&No Ta \&No Ta n
876 .It \&.Ud Ta \&No Ta \&No Ta 0
877 .It \&.Lb Ta \&No Ta \&No Ta 1
878 .It \&.Ap Ta Yes Ta Yes Ta 0
879 .It \&.Lp Ta \&No Ta \&No Ta 0
880 .It \&.Lk Ta \&No Ta Yes Ta >0
881 .It \&.Mt Ta \&No Ta Yes Ta >0
882 .It \&.Es Ta \&No Ta \&No Ta 0
883 .It \&.En Ta \&No Ta \&No Ta 0
884 .El
885 .Pp
886 The
887 .Sq \&.Ot ,
888 .Sq \&.Fr ,
889 .Sq \&.Es
890 and
891 .Sq \&.En ,
892 macros are obsolete.
893 .\" SECTION
894 .Sh COMPATIBILITY
895 The mdoc language was traditionally a
896 .Qq roff
897 macro package; most existing manuals were written with mdoc syntax
898 dictated by system-dependent roff installations. This section documents
899 compatibility with these systems.
900 .Pp
901 .Bl -dash -compact
902 .\" LIST-ITEM
903 .It
904 .Sq \&.Fo
905 and
906 .Sq \&.St
907 historically weren't always callable. Both are now correctly callable.
908 .\" LIST-ITEM
909 .It
910 .Sq \&.It \-nested
911 is assumed for all lists: any list may be nested and
912 .Sq \-enum
913 lists will restart the sequence only for the sub-list.
914 .\" LIST-ITEM
915 .It
916 .Sq \&.It \-column
917 syntax where column widths may be preceeded by other arguments (instead
918 of proceeded) is not supported.
919 .\" LIST-ITEM
920 .It
921 The
922 .Sq \&.At
923 macro only accepts a single parameter.
924 .\" LIST-ITEM
925 .It
926 The system-name macros (
927 .Ns Sq \&.At ,
928 .Sq \&.Bsx ,
929 .Sq \&.Bx ,
930 .Sq \&.Fx ,
931 .Sq \&.Nx ,
932 .Sq \&.Ox ,
933 and
934 .Sq \&.Ux )
935 are callable.
936 .\" LIST-ITEM
937 .It
938 Some manuals use
939 .Sq \&.Li
940 incorrectly by following it with a reserved character and expecting the
941 delimiter to render. This is not supported.
942 .\" LIST-ITEM
943 .It
944 .Sq \&.Cd
945 is callable.
946 .El
947 .\" SECTION
948 .Sh SEE ALSO
949 .Xr mandoc 1
950 .\" SECTION
951 .Sh AUTHORS
952 The
953 .Nm
954 utility was written by
955 .An Kristaps Dzonsons Aq kristaps@openbsd.org .
956 .\" SECTION
957 .Sh CAVEATS
958 There are several ambiguous parts of mdoc.
959 .Pp
960 .Bl -dash -compact
961 .\" LIST-ITEM
962 .It
963 .Sq \&.Fa
964 should be
965 .Sq \&.Va
966 as function arguments are variables.
967 .\" LIST-ITEM
968 .It
969 .Sq \&.Ft
970 should be
971 .Sq \&.Vt
972 as function return types are still types. Furthermore, the
973 .Sq \&.Ft
974 should be removed and
975 .Sq \&.Fo ,
976 which ostensibly follows it, should follow the same convention as
977 .Sq \&.Va .
978 .\" LIST-ITEM
979 .It
980 .Sq \&.Va
981 should formalise that only one or two arguments are acceptable: a
982 variable name and optional, preceeding type.
983 .\" LIST-ITEM
984 .It
985 .Sq \&.Fd
986 is ambiguous. It's commonly used to indicate an include file in the
987 synopsis section.
988 .Sq \&.In
989 should be used, instead.
990 .\" LIST-ITEM
991 .It
992 Only the
993 .Sq \-literal
994 argument to
995 .Sq \&.Bd
996 makes sense. The remaining ones should be removed.
997 .\" LIST-ITEM
998 .It
999 The
1000 .Sq \&.Xo
1001 and
1002 .Sq \&.Xc
1003 macros should be deprecated.
1004 .\" LIST-ITEM
1005 .It
1006 The
1007 .Sq \&.Dt
1008 macro lacks clarity. It should be absolutely clear which title will
1009 render when formatting the manual page.
1010 .\" LIST-ITEM
1011 .It
1012 A
1013 .Sq \&.Lx
1014 should be provided for Linux (\(`a la
1015 .Sq \&.Ox ,
1016 .Sq \&.Nx
1017 etc.).
1018 .\" LIST-ITEM
1019 .It
1020 There's no way to refer to references in
1021 .Sq \&.Rs/.Re
1022 blocks.
1023 .El