1MANDOC_CHAR(7) BSD Miscellaneous Information Manual MANDOC_CHAR(7)
2
4 mandoc_char — mandoc special characters
5
7 This page documents the roff(7) escape sequences accepted by mandoc(1) to
8 represent special characters in mdoc(7) and man(7) documents.
9
10 The rendering depends on the mandoc(1) output mode; it can be inspected
11 by calling man(1) on the mandoc_char manual page with different -T argu‐
12 ments. In ASCII output, the rendering of some characters may be hard to
13 interpret for the reader. Many are rendered as descriptive strings like
14 "<integral>", "<degree>", or "<Gamma>", which may look ugly, and many are
15 replaced by similar ASCII characters. In particular, accented characters
16 are usually shown without the accent. For that reason, try to avoid
17 using any of the special characters documented here except those dis‐
18 cussed in the DESCRIPTION, unless they are essential for explaining the
19 subject matter at hand, for example when documenting complicated mathe‐
20 matical functions.
21
22 In particular, in English manual pages, do not use special-character
23 escape sequences to represent national language characters in author
24 names; instead, provide ASCII transcriptions of the names.
25
26 Dashes and Hyphens
27 In typography there are different types of dashes of various width: the
28 hyphen (‐), the en-dash (–), the em-dash (—), and the mathematical minus
29 sign (−).
30
31 Hyphens are used for adjectives; to separate the two parts of a compound
32 word; or to separate a word across two successive lines of text. The
33 hyphen does not need to be escaped:
34
35 blue-eyed
36 lorry-driver
37
38 The en-dash is used to separate the two elements of a range, or can be
39 used the same way as an em-dash. It should be written as ‘\(en’:
40
41 pp. 95\(en97.
42 Go away \(en or else!
43
44 The em-dash can be used to show an interruption or can be used the same
45 way as colons, semi-colons, or parentheses. It should be written as
46 ‘\(em’:
47
48 Three things \(em apples, oranges, and bananas.
49 This is not that \(em rather, this is that.
50
51 In roff(7) documents, the minus sign is normally written as ‘\-’. In
52 manual pages, some style guides recommend to also use ‘\-’ if an ASCII
53 0x2d “hyphen-minus” output glyph that can be copied and pasted is desired
54 in output modes supporting it, for example in -T utf8 and -T html. But
55 currently, no practically relevant manual page formatter actually
56 requires that subtlety, so in manual pages just write plain ‘-’ to repre‐
57 sent hyphen, minus, and hyphen-minus.
58
59 If a word on a text input line contains a hyphen, a formatter may decide
60 to insert an output line break after the hyphen if that helps filling the
61 current output line, but the whole word would overflow the line. If it
62 is important that the word is not broken across lines in this way, a
63 zero-width space (‘\&’) can be inserted before or after the hyphen.
64 While mandoc(1) never breaks the output line after hyphens adjacent to a
65 zero-width space, after any of the other dash- or hyphen-like characters
66 represented by escape sequences, or after hyphens inside words in macro
67 arguments, other software may not respect these rules and may break the
68 line even in such cases.
69
70 Some roff(7) implementations contains dictionaries allowing to break the
71 line at syllable boundaries even inside words that contain no hyphens.
72 Such automatic hyphenation is not supported by mandoc(1), which only
73 breaks the line at whitespace, and inside words only after existing
74 hyphens.
75
76 Spaces
77 To separate words in normal text, for indenting and alignment in literal
78 context, and when none of the following special cases apply, just use the
79 normal space character (‘ ’).
80
81 When filling text, output lines may be broken between words, i.e. at
82 space characters. To prevent a line break between two particular words,
83 use the unpaddable non-breaking space escape sequence (‘\ ’) instead of
84 the normal space character. For example, the input string “number\ 1”
85 will be kept together as “number 1” on the same output line.
86
87 On request and macro lines, the normal space character serves as an argu‐
88 ment delimiter. To include whitespace into arguments, quoting is usually
89 the best choice; see the MACRO SYNTAX section in roff(7). In some cases,
90 using the non-breaking space escape sequence (‘\ ’) may be preferable.
91
92 To escape macro names and to protect whitespace at the end of input
93 lines, the zero-width space (‘\&’) is often useful. For example, in
94 mdoc(7), a normal space character can be displayed in single quotes in
95 either of the following ways:
96
97 .Sq " "
98 .Sq \ \&
99
100 Quotes
101 On request and macro lines, the double-quote character (‘"’) is handled
102 specially to allow quoting. One way to prevent this special handling is
103 by using the ‘\(dq’ escape sequence.
104
105 Note that on text lines, literal double-quote characters can be used ver‐
106 batim. All other quote-like characters can be used verbatim as well,
107 even on request and macro lines.
108
109 Accents
110 In output modes supporting such special output characters, for example -T
111 pdf, and sometimes less consistently in -T utf8, some roff(7) formatters
112 convert the following ASCII input characters to the following Unicode
113 special output characters:
114
115 ` U+2018 left single quotation mark
116 ' U+2019 right single quotation mark
117 ~ U+02DC small tilde
118 ^ U+02C6 modifier letter circumflex
119
120 In prose, this automatic substitution is often desirable; but when these
121 characters have to be displayed as plain ASCII characters, for example in
122 source code samples, they require escaping to render as follows:
123
124 \(ga U+0060 grave accent
125 \(aq U+0027 apostrophe
126 \(ti U+007E tilde
127 \(ha U+005E circumflex accent
128
129 Periods
130 The period (‘.’) is handled specially at the beginning of an input line,
131 where it introduces a roff(7) request or a macro, and when appearing
132 alone as a macro argument in mdoc(7). In such situations, prepend a
133 zero-width space (‘\&.’) to make it behave like normal text.
134
135 Do not use the ‘\.’ escape sequence. It does not prevent special han‐
136 dling of the period.
137
138 Backslashes
139 To include a literal backslash (‘\’) into the output, use the (‘\e’)
140 escape sequence.
141
142 Note that doubling it (‘\\’) is not the right way to output a backslash.
143 Because mandoc(1) does not implement full roff(7) functionality, it may
144 work with mandoc(1), but it may have weird effects on complete roff(7)
145 implementations.
146
148 Special characters are encoded as ‘\X’ (for a one-character escape),
149 ‘\(XX’ (two-character), and ‘\[N]’ (N-character). For details, see the
150 Special Characters subsection of the roff(7) manual.
151
152 Spacing:
153 Input Description
154 ‘\ unpaddable non-breaking space’
155 \~ paddable non-breaking space
156 \0 digit-width space allowing line break
157 \| one-sixth \(em narrow space, zero width in nroff mode
158 \^ one-twelfth \(em half-narrow space, zero width in nroff
159 \& zero-width non-breaking space
160 \) zero-width space transparent to end-of-sentence detection
161 \% zero-width space allowing hyphenation
162 \: zero-width space allowing line break
163
164 Lines:
165 Input Rendered Description
166 \(ba | bar
167 \(br │ box rule
168 \(ul _ underscore
169 \(ru _ underscore (width 0.5m)
170 \(rn ‾ overline
171 \(bb ¦ broken bar
172 \(sl / forward slash
173 \(rs \ backward slash
174
175 Text markers:
176 Input Rendered Description
177 \(ci ○ circle
178 \(bu · bullet
179 \(dd ‡ double dagger
180 \(dg † dagger
181 \(lz ◊ lozenge
182 \(sq □ white square
183 \(ps ¶ paragraph
184 \(sc § section
185 \(lh ☜ left hand
186 \(rh ☞ right hand
187 \(at @ at
188 \(sh # hash (pound)
189 \(CR ↵ carriage return
190 \(OK ✓ check mark
191 \(CL ♣ club suit
192 \(SP ♠ spade suit
193 \(HE ♥ heart suit
194 \(DI ♦ diamond suit
195
196 Legal symbols:
197 Input Rendered Description
198 \(co © copyright
199 \(rg ® registered
200 \(tm ™ trademarked
201
202 Punctuation:
203 Input Rendered Description
204 \(em — em-dash
205 \(en – en-dash
206 \(hy ‐ hyphen
207 \e \ back-slash
208 \. . period
209 \(r! ¡ upside-down exclamation
210 \(r? ¿ upside-down question
211
212 Quotes:
213 Input Rendered Description
214 \(Bq „ right low double-quote
215 \(bq ‚ right low single-quote
216 \(lq “ left double-quote
217 \(rq ” right double-quote
218 \(oq ‘ left single-quote
219 \(cq ’ right single-quote
220 \(aq ' apostrophe quote (ASCII character)
221 \(dq " double quote (ASCII character)
222 \(Fo « left guillemet
223 \(Fc » right guillemet
224 \(fo ‹ left single guillemet
225 \(fc › right single guillemet
226
227 Brackets:
228 Input Rendered Description
229 \(lB [ left bracket
230 \(rB ] right bracket
231 \(lC { left brace
232 \(rC } right brace
233 \(la ⟨ left angle
234 \(ra ⟩ right angle
235 \(bv ⎪ brace extension (special font)
236 \[braceex] ⎪ brace extension
237 \[bracketlefttp] ⎡ top-left hooked bracket
238 \[bracketleftbt] ⎣ bottom-left hooked bracket
239 \[bracketleftex] ⎢ left hooked bracket extension
240 \[bracketrighttp] ⎤ top-right hooked bracket
241 \[bracketrightbt] ⎦ bottom-right hooked bracket
242 \[bracketrightex] ⎥ right hooked bracket extension
243 \(lt ╭ top-left hooked brace
244 \[bracelefttp] ⎧ top-left hooked brace
245 \(lk ┥ mid-left hooked brace
246 \[braceleftmid] ⎨ mid-left hooked brace
247 \(lb ╰ bottom-left hooked brace
248 \[braceleftbt] ⎩ bottom-left hooked brace
249 \[braceleftex] ⎪ left hooked brace extension
250 \(rt ╮ top-left hooked brace
251 \[bracerighttp] ⎫ top-right hooked brace
252 \(rk ┝ mid-right hooked brace
253 \[bracerightmid] ⎬ mid-right hooked brace
254 \(rb ╯ bottom-right hooked brace
255 \[bracerightbt] ⎭ bottom-right hooked brace
256 \[bracerightex] ⎪ right hooked brace extension
257 \[parenlefttp] ⎛ top-left hooked parenthesis
258 \[parenleftbt] ⎝ bottom-left hooked parenthesis
259 \[parenleftex] ⎜ left hooked parenthesis extension
260 \[parenrighttp] ⎞ top-right hooked parenthesis
261 \[parenrightbt] ⎠ bottom-right hooked parenthesis
262 \[parenrightex] ⎟ right hooked parenthesis extension
263
264 Arrows:
265 Input Rendered Description
266 \(<- ← left arrow
267 \(-> → right arrow
268 \(<> ↔ left-right arrow
269 \(da ↓ down arrow
270 \(ua ↑ up arrow
271 \(va ↕ up-down arrow
272 \(lA ⇐ left double-arrow
273 \(rA ⇒ right double-arrow
274 \(hA ⇔ left-right double-arrow
275 \(uA ⇑ up double-arrow
276 \(dA ⇓ down double-arrow
277 \(vA ⇕ up-down double-arrow
278 \(an ⎯ horizontal arrow extension
279
280 Logical:
281 Input Rendered Description
282 \(AN ∧ logical and
283 \(OR ∨ logical or
284 \[tno] ¬ logical not (text font)
285 \(no ¬ logical not (special font)
286 \(te ∃ existential quantifier
287 \(fa ∀ universal quantifier
288 \(st ∋ such that
289 \(tf ∴ therefore
290 \(3d ∴ therefore
291 \(or | bitwise or
292
293 Mathematical:
294 Input Rendered Description
295 \- - minus (text font)
296 \(mi − minus (special font)
297 + + plus (text font)
298 \(pl + plus (special font)
299 \(-+ ∓ minus-plus
300 \[t+-] ± plus-minus (text font)
301 \(+- ± plus-minus (special font)
302 \(pc · center-dot
303 \[tmu] × multiply (text font)
304 \(mu × multiply (special font)
305 \(c* ⊗ circle-multiply
306 \(c+ ⊕ circle-plus
307 \[tdi] ÷ divide (text font)
308 \(di ÷ divide (special font)
309 \(f/ ⁄ fraction
310 \(** ∗ asterisk
311 \(<= ≤ less-than-equal
312 \(>= ≥ greater-than-equal
313 \(<< ≪ much less
314 \(>> ≫ much greater
315 \(eq = equal
316 \(!= ≠ not equal
317 \(== ≡ equivalent
318 \(ne ≢ not equivalent
319 \(ap ∼ tilde operator
320 \(|= ≃ asymptotically equal
321 \(=~ ≅ approximately equal
322 \(~~ ≈ almost equal
323 \(~= ≈ almost equal
324 \(pt ∝ proportionate
325 \(es ∅ empty set
326 \(mo ∈ element
327 \(nm ∉ not element
328 \(sb ⊂ proper subset
329 \(nb ⊄ not subset
330 \(sp ⊃ proper superset
331 \(nc ⊅ not superset
332 \(ib ⊆ reflexive subset
333 \(ip ⊇ reflexive superset
334 \(ca ∩ intersection
335 \(cu ∪ union
336 \(/_ ∠ angle
337 \(pp ⊥ perpendicular
338 \(is ∫ integral
339 \[integral] ∫ integral
340 \[sum] ∑ summation
341 \[product] ∏ product
342 \[coproduct] ∐ coproduct
343 \(gr ∇ gradient
344 \(sr √ square root
345 \[sqrt] √ square root
346 \(lc ⌈ left-ceiling
347 \(rc ⌉ right-ceiling
348 \(lf ⌊ left-floor
349 \(rf ⌋ right-floor
350 \(if ∞ infinity
351 \(Ah ℵ aleph
352 \(Im ℑ imaginary
353 \(Re ℜ real
354 \(wp ℘ Weierstrass p
355 \(pd ∂ partial differential
356 \(-h ℏ Planck constant over 2π
357 \[hbar] ℏ Planck constant over 2π
358 \(12 ½ one-half
359 \(14 ¼ one-fourth
360 \(34 ¾ three-fourths
361 \(18 ⅛ one-eighth
362 \(38 ⅜ three-eighths
363 \(58 ⅝ five-eighths
364 \(78 ⅞ seven-eighths
365 \(S1 ¹ superscript 1
366 \(S2 ² superscript 2
367 \(S3 ³ superscript 3
368
369 Ligatures:
370 Input Rendered Description
371 \(ff ff ff ligature
372 \(fi fi fi ligature
373 \(fl fl fl ligature
374 \(Fi ffi ffi ligature
375 \(Fl ffl ffl ligature
376 \(AE Æ AE
377 \(ae æ ae
378 \(OE Œ OE
379 \(oe œ oe
380 \(ss ß German eszett
381 \(IJ IJ IJ ligature
382 \(ij ij ij ligature
383
384 Accents:
385 Input Rendered Description
386 \(a" ˝ Hungarian umlaut
387 \(a- ¯ macron
388 \(a. ˙ dotted
389 \(a^ ^ circumflex
390 \(aa ´ acute
391 \' ´ acute
392 \(ga ` grave
393 \` ` grave
394 \(ab ˘ breve
395 \(ac ¸ cedilla
396 \(ad ¨ dieresis
397 \(ah ˇ caron
398 \(ao ˚ ring
399 \(a~ ~ tilde
400 \(ho ˛ ogonek
401 \(ha ^ hat (ASCII character)
402 \(ti ~ tilde (ASCII character)
403
404 Accented letters:
405 Input Rendered Description
406 \('A Á acute A
407 \('E É acute E
408 \('I Í acute I
409 \('O Ó acute O
410 \('U Ú acute U
411 \('Y Ý acute Y
412 \('a á acute a
413 \('e é acute e
414 \('i í acute i
415 \('o ó acute o
416 \('u ú acute u
417 \('y ý acute y
418 \(`A À grave A
419 \(`E È grave E
420 \(`I Ì grave I
421 \(`O Ò grave O
422 \(`U Ù grave U
423 \(`a à grave a
424 \(`e è grave e
425 \(`i ì grave i
426 \(`o ì grave o
427 \(`u ù grave u
428 \(~A Ã tilde A
429 \(~N Ñ tilde N
430 \(~O Õ tilde O
431 \(~a ã tilde a
432 \(~n ñ tilde n
433 \(~o õ tilde o
434 \(:A Ä dieresis A
435 \(:E Ë dieresis E
436 \(:I Ï dieresis I
437 \(:O Ö dieresis O
438 \(:U Ü dieresis U
439 \(:a ä dieresis a
440 \(:e ë dieresis e
441 \(:i ï dieresis i
442 \(:o ö dieresis o
443 \(:u ü dieresis u
444 \(:y ÿ dieresis y
445 \(^A Â circumflex A
446 \(^E Ê circumflex E
447 \(^I Î circumflex I
448 \(^O Ô circumflex O
449 \(^U Û circumflex U
450 \(^a â circumflex a
451 \(^e ê circumflex e
452 \(^i î circumflex i
453 \(^o ô circumflex o
454 \(^u û circumflex u
455 \(,C Ç cedilla C
456 \(,c ç cedilla c
457 \(/L Ł stroke L
458 \(/l ł stroke l
459 \(/O Ø stroke O
460 \(/o ø stroke o
461 \(oA Å ring A
462 \(oa å ring a
463
464 Special letters:
465 Input Rendered Description
466 \(-D Ð Eth
467 \(Sd ð eth
468 \(TP Þ Thorn
469 \(Tp þ thorn
470 \(.i ı dotless i
471 \(.j ȷ dotless j
472
473 Currency:
474 Input Rendered Description
475 \(Do $ dollar
476 \(ct ¢ cent
477 \(Eu € Euro symbol
478 \(eu € Euro symbol
479 \(Ye ¥ yen
480 \(Po £ pound
481 \(Cs ¤ Scandinavian
482 \(Fn ƒ florin
483
484 Units:
485 Input Rendered Description
486 \(de ° degree
487 \(%0 ‰ per-thousand
488 \(fm ′ minute
489 \(sd ″ second
490 \(mc µ micro
491 \(Of ª Spanish female ordinal
492 \(Om º Spanish masculine ordinal
493
494 Greek letters:
495 Input Rendered Description
496 \(*A Α Alpha
497 \(*B Β Beta
498 \(*G Γ Gamma
499 \(*D Δ Delta
500 \(*E Ε Epsilon
501 \(*Z Ζ Zeta
502 \(*Y Η Eta
503 \(*H Θ Theta
504 \(*I Ι Iota
505 \(*K Κ Kappa
506 \(*L Λ Lambda
507 \(*M Μ Mu
508 \(*N Ν Nu
509 \(*C Ξ Xi
510 \(*O Ο Omicron
511 \(*P Π Pi
512 \(*R Ρ Rho
513 \(*S Σ Sigma
514 \(*T Τ Tau
515 \(*U Υ Upsilon
516 \(*F Φ Phi
517 \(*X Χ Chi
518 \(*Q Ψ Psi
519 \(*W Ω Omega
520 \(*a α alpha
521 \(*b β beta
522 \(*g γ gamma
523 \(*d δ delta
524 \(*e ε epsilon
525 \(*z ζ zeta
526 \(*y η eta
527 \(*h θ theta
528 \(*i ι iota
529 \(*k κ kappa
530 \(*l λ lambda
531 \(*m μ mu
532 \(*n ν nu
533 \(*c ξ xi
534 \(*o ο omicron
535 \(*p π pi
536 \(*r ρ rho
537 \(*s σ sigma
538 \(*t τ tau
539 \(*u υ upsilon
540 \(*f ϕ phi
541 \(*x χ chi
542 \(*q ψ psi
543 \(*w ω omega
544 \(+h ϑ theta variant
545 \(+f φ phi variant
546 \(+p ϖ pi variant
547 \(+e ϵ epsilon variant
548 \(ts ς sigma terminal
549
551 Predefined strings are inherited from the macro packages of historical
552 troff implementations. They are not recommended for use, as they differ
553 across implementations. Manuals using these predefined strings are
554 almost certainly not portable.
555
556 Their syntax is similar to special characters, using ‘\*X’ (for a
557 one-character escape), ‘\*(XX’ (two-character), and ‘\*[N]’
558 (N-character). For details, see the Predefined Strings subsection of the
559 roff(7) manual.
560
561 Input Rendered Description
562 \*(Ba | vertical bar
563 \*(Ne ≠ not equal
564 \*(Ge ≥ greater-than-equal
565 \*(Le ≤ less-than-equal
566 \*(Gt > greater-than
567 \*(Lt < less-than
568 \*(Pm ± plus-minus
569 \*(If ∞ infinity
570 \*(Pi π pi
571 \*(Na NaN NaN
572 \*(Am & ampersand
573 \*R restricted mark
574 \*(Tm trade mark
575 \*q " double-quote
576 \*(Rq ” right-double-quote
577 \*(Lq “ left-double-quote
578 \*(lp ( right-parenthesis
579 \*(rp ) left-parenthesis
580 \*(lq left double-quote
581 \*(rq right double-quote
582 \*(ua ↑ up arrow
583 \*(va up-down arrow
584 \*(<= ≤ less-than-equal
585 \*(>= ≥ greater-than-equal
586 \*(aa ´ acute
587 \*(ga ` grave
588 \*(Px POSIX POSIX standard name
589 \*(Ai ANSI ANSI standard name
590
592 The escape sequences
593
594 \[uXXXX] and \C'uXXXX'
595
596 are interpreted as Unicode codepoints. The codepoint must be in the
597 range above U+0080 and less than U+10FFFF. For compatibility, the hexa‐
598 decimal digits ‘A’ to ‘F’ must be given as uppercase characters, and
599 points must be zero-padded to four characters; if greater than four char‐
600 acters, no zero padding is allowed. Unicode surrogates are not allowed.
601
603 For backward compatibility with existing manuals, mandoc(1) also supports
604 the
605
606 \N'number' and \[charnumber]
607
608 escape sequences, inserting the character number from the current charac‐
609 ter set into the output. Of course, this is inherently non-portable and
610 is already marked as deprecated in the Heirloom roff manual; on top of
611 that, the second form is a GNU extension. For example, do not use \N'34'
612 or \[char34], use \(dq, or even the plain ‘"’ character where possible.
613
615 This section documents compatibility between mandoc and other troff
616 implementations, at this time limited to GNU troff ("groff").
617
618 - The \N'' escape sequence is limited to printable characters; in
619 groff, it accepts arbitrary character numbers.
620 - In -Tascii, the \(ss, \(nm, \(nb, \(nc, \(ib, \(ip, \(pp, \[sum],
621 \[product], \[coproduct], \(gr, \(-h, and \(a. special characters
622 render differently between mandoc and groff.
623 - In -Thtml, the \(~=, \(nb, and \(nc special characters render differ‐
624 ently between mandoc and groff.
625 - The -Tps and -Tpdf modes format like -Tascii instead of rendering
626 glyphs as in groff.
627 - The \[radicalex], \[sqrtex], and \(ru special characters have been
628 omitted from mandoc either because they are poorly documented or they
629 have no known representation.
630
632 mandoc(1), man(7), mdoc(7), roff(7)
633
635 The mandoc_char manual page was written by Kristaps Dzonsons
636 <kristaps@bsd.lv>.
637
639 The predefined string ‘\*(Ba’ mimics the behaviour of the ‘|’ character
640 in mdoc(7); thus, if you wish to render a vertical bar with no side
641 effects, use the ‘\(ba’ escape.
642
643BSD May 10, 2020 BSD