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 unpaddable, breaking digit-width space
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 space
160 \% zero-width space allowing hyphenation
161
162 Lines:
163 Input Rendered Description
164 \(ba | bar
165 \(br │ box rule
166 \(ul _ underscore
167 \(ru _ underscore (width 0.5m)
168 \(rn ‾ overline
169 \(bb ¦ broken bar
170 \(sl / forward slash
171 \(rs \ backward slash
172
173 Text markers:
174 Input Rendered Description
175 \(ci ○ circle
176 \(bu · bullet
177 \(dd ‡ double dagger
178 \(dg † dagger
179 \(lz ◊ lozenge
180 \(sq □ white square
181 \(ps ¶ paragraph
182 \(sc § section
183 \(lh ☜ left hand
184 \(rh ☞ right hand
185 \(at @ at
186 \(sh # hash (pound)
187 \(CR ↵ carriage return
188 \(OK ✓ check mark
189 \(CL ♣ club suit
190 \(SP ♠ spade suit
191 \(HE ♥ heart suit
192 \(DI ♦ diamond suit
193
194 Legal symbols:
195 Input Rendered Description
196 \(co © copyright
197 \(rg ® registered
198 \(tm ™ trademarked
199
200 Punctuation:
201 Input Rendered Description
202 \(em — em-dash
203 \(en – en-dash
204 \(hy ‐ hyphen
205 \e \ back-slash
206 \. . period
207 \(r! ¡ upside-down exclamation
208 \(r? ¿ upside-down question
209
210 Quotes:
211 Input Rendered Description
212 \(Bq „ right low double-quote
213 \(bq ‚ right low single-quote
214 \(lq “ left double-quote
215 \(rq ” right double-quote
216 \(oq ‘ left single-quote
217 \(cq ’ right single-quote
218 \(aq ' apostrophe quote (ASCII character)
219 \(dq " double quote (ASCII character)
220 \(Fo « left guillemet
221 \(Fc » right guillemet
222 \(fo ‹ left single guillemet
223 \(fc › right single guillemet
224
225 Brackets:
226 Input Rendered Description
227 \(lB [ left bracket
228 \(rB ] right bracket
229 \(lC { left brace
230 \(rC } right brace
231 \(la ⟨ left angle
232 \(ra ⟩ right angle
233 \(bv ⎪ brace extension (special font)
234 \[braceex] ⎪ brace extension
235 \[bracketlefttp] ⎡ top-left hooked bracket
236 \[bracketleftbt] ⎣ bottom-left hooked bracket
237 \[bracketleftex] ⎢ left hooked bracket extension
238 \[bracketrighttp] ⎤ top-right hooked bracket
239 \[bracketrightbt] ⎦ bottom-right hooked bracket
240 \[bracketrightex] ⎥ right hooked bracket extension
241 \(lt ╭ top-left hooked brace
242 \[bracelefttp] ⎧ top-left hooked brace
243 \(lk ┥ mid-left hooked brace
244 \[braceleftmid] ⎨ mid-left hooked brace
245 \(lb ╰ bottom-left hooked brace
246 \[braceleftbt] ⎩ bottom-left hooked brace
247 \[braceleftex] ⎪ left hooked brace extension
248 \(rt ╮ top-left hooked brace
249 \[bracerighttp] ⎫ top-right hooked brace
250 \(rk ┝ mid-right hooked brace
251 \[bracerightmid] ⎬ mid-right hooked brace
252 \(rb ╯ bottom-right hooked brace
253 \[bracerightbt] ⎭ bottom-right hooked brace
254 \[bracerightex] ⎪ right hooked brace extension
255 \[parenlefttp] ⎛ top-left hooked parenthesis
256 \[parenleftbt] ⎝ bottom-left hooked parenthesis
257 \[parenleftex] ⎜ left hooked parenthesis extension
258 \[parenrighttp] ⎞ top-right hooked parenthesis
259 \[parenrightbt] ⎠ bottom-right hooked parenthesis
260 \[parenrightex] ⎟ right hooked parenthesis extension
261
262 Arrows:
263 Input Rendered Description
264 \(<- ← left arrow
265 \(-> → right arrow
266 \(<> ↔ left-right arrow
267 \(da ↓ down arrow
268 \(ua ↑ up arrow
269 \(va ↕ up-down arrow
270 \(lA ⇐ left double-arrow
271 \(rA ⇒ right double-arrow
272 \(hA ⇔ left-right double-arrow
273 \(uA ⇑ up double-arrow
274 \(dA ⇓ down double-arrow
275 \(vA ⇕ up-down double-arrow
276 \(an ⎯ horizontal arrow extension
277
278 Logical:
279 Input Rendered Description
280 \(AN ∧ logical and
281 \(OR ∨ logical or
282 \[tno] ¬ logical not (text font)
283 \(no ¬ logical not (special font)
284 \(te ∃ existential quantifier
285 \(fa ∀ universal quantifier
286 \(st ∋ such that
287 \(tf ∴ therefore
288 \(3d ∴ therefore
289 \(or | bitwise or
290
291 Mathematical:
292 Input Rendered Description
293 \- - minus (text font)
294 \(mi − minus (special font)
295 + + plus (text font)
296 \(pl + plus (special font)
297 \(-+ ∓ minus-plus
298 \[t+-] ± plus-minus (text font)
299 \(+- ± plus-minus (special font)
300 \(pc · center-dot
301 \[tmu] × multiply (text font)
302 \(mu × multiply (special font)
303 \(c* ⊗ circle-multiply
304 \(c+ ⊕ circle-plus
305 \[tdi] ÷ divide (text font)
306 \(di ÷ divide (special font)
307 \(f/ ⁄ fraction
308 \(** ∗ asterisk
309 \(<= ≤ less-than-equal
310 \(>= ≥ greater-than-equal
311 \(<< ≪ much less
312 \(>> ≫ much greater
313 \(eq = equal
314 \(!= ≠ not equal
315 \(== ≡ equivalent
316 \(ne ≢ not equivalent
317 \(ap ∼ tilde operator
318 \(|= ≃ asymptotically equal
319 \(=~ ≅ approximately equal
320 \(~~ ≈ almost equal
321 \(~= ≈ almost equal
322 \(pt ∝ proportionate
323 \(es ∅ empty set
324 \(mo ∈ element
325 \(nm ∉ not element
326 \(sb ⊂ proper subset
327 \(nb ⊄ not subset
328 \(sp ⊃ proper superset
329 \(nc ⊅ not superset
330 \(ib ⊆ reflexive subset
331 \(ip ⊇ reflexive superset
332 \(ca ∩ intersection
333 \(cu ∪ union
334 \(/_ ∠ angle
335 \(pp ⊥ perpendicular
336 \(is ∫ integral
337 \[integral] ∫ integral
338 \[sum] ∑ summation
339 \[product] ∏ product
340 \[coproduct] ∐ coproduct
341 \(gr ∇ gradient
342 \(sr √ square root
343 \[sqrt] √ square root
344 \(lc ⌈ left-ceiling
345 \(rc ⌉ right-ceiling
346 \(lf ⌊ left-floor
347 \(rf ⌋ right-floor
348 \(if ∞ infinity
349 \(Ah ℵ aleph
350 \(Im ℑ imaginary
351 \(Re ℜ real
352 \(wp ℘ Weierstrass p
353 \(pd ∂ partial differential
354 \(-h ℏ Planck constant over 2π
355 \[hbar] ℏ Planck constant over 2π
356 \(12 ½ one-half
357 \(14 ¼ one-fourth
358 \(34 ¾ three-fourths
359 \(18 ⅛ one-eighth
360 \(38 ⅜ three-eighths
361 \(58 ⅝ five-eighths
362 \(78 ⅞ seven-eighths
363 \(S1 ¹ superscript 1
364 \(S2 ² superscript 2
365 \(S3 ³ superscript 3
366
367 Ligatures:
368 Input Rendered Description
369 \(ff ff ff ligature
370 \(fi fi fi ligature
371 \(fl fl fl ligature
372 \(Fi ffi ffi ligature
373 \(Fl ffl ffl ligature
374 \(AE Æ AE
375 \(ae æ ae
376 \(OE Œ OE
377 \(oe œ oe
378 \(ss ß German eszett
379 \(IJ IJ IJ ligature
380 \(ij ij ij ligature
381
382 Accents:
383 Input Rendered Description
384 \(a" ˝ Hungarian umlaut
385 \(a- ¯ macron
386 \(a. ˙ dotted
387 \(a^ ^ circumflex
388 \(aa ´ acute
389 \' ´ acute
390 \(ga ` grave
391 \` ` grave
392 \(ab ˘ breve
393 \(ac ¸ cedilla
394 \(ad ¨ dieresis
395 \(ah ˇ caron
396 \(ao ˚ ring
397 \(a~ ~ tilde
398 \(ho ˛ ogonek
399 \(ha ^ hat (ASCII character)
400 \(ti ~ tilde (ASCII character)
401
402 Accented letters:
403 Input Rendered Description
404 \('A Á acute A
405 \('E É acute E
406 \('I Í acute I
407 \('O Ó acute O
408 \('U Ú acute U
409 \('a á acute a
410 \('e é acute e
411 \('i í acute i
412 \('o ó acute o
413 \('u ú acute u
414 \(`A À grave A
415 \(`E È grave E
416 \(`I Ì grave I
417 \(`O Ò grave O
418 \(`U Ù grave U
419 \(`a à grave a
420 \(`e è grave e
421 \(`i ì grave i
422 \(`o ì grave o
423 \(`u ù grave u
424 \(~A Ã tilde A
425 \(~N Ñ tilde N
426 \(~O Õ tilde O
427 \(~a ã tilde a
428 \(~n ñ tilde n
429 \(~o õ tilde o
430 \(:A Ä dieresis A
431 \(:E Ë dieresis E
432 \(:I Ï dieresis I
433 \(:O Ö dieresis O
434 \(:U Ü dieresis U
435 \(:a ä dieresis a
436 \(:e ë dieresis e
437 \(:i ï dieresis i
438 \(:o ö dieresis o
439 \(:u ü dieresis u
440 \(:y ÿ dieresis y
441 \(^A Â circumflex A
442 \(^E Ê circumflex E
443 \(^I Î circumflex I
444 \(^O Ô circumflex O
445 \(^U Û circumflex U
446 \(^a â circumflex a
447 \(^e ê circumflex e
448 \(^i î circumflex i
449 \(^o ô circumflex o
450 \(^u û circumflex u
451 \(,C Ç cedilla C
452 \(,c ç cedilla c
453 \(/L Ł stroke L
454 \(/l ł stroke l
455 \(/O Ø stroke O
456 \(/o ø stroke o
457 \(oA Å ring A
458 \(oa å ring a
459
460 Special letters:
461 Input Rendered Description
462 \(-D Ð Eth
463 \(Sd ð eth
464 \(TP Þ Thorn
465 \(Tp þ thorn
466 \(.i ı dotless i
467 \(.j ȷ dotless j
468
469 Currency:
470 Input Rendered Description
471 \(Do $ dollar
472 \(ct ¢ cent
473 \(Eu € Euro symbol
474 \(eu € Euro symbol
475 \(Ye ¥ yen
476 \(Po £ pound
477 \(Cs ¤ Scandinavian
478 \(Fn ƒ florin
479
480 Units:
481 Input Rendered Description
482 \(de ° degree
483 \(%0 ‰ per-thousand
484 \(fm ′ minute
485 \(sd ″ second
486 \(mc µ micro
487 \(Of ª Spanish female ordinal
488 \(Om º Spanish masculine ordinal
489
490 Greek letters:
491 Input Rendered Description
492 \(*A Α Alpha
493 \(*B Β Beta
494 \(*G Γ Gamma
495 \(*D Δ Delta
496 \(*E Ε Epsilon
497 \(*Z Ζ Zeta
498 \(*Y Η Eta
499 \(*H Θ Theta
500 \(*I Ι Iota
501 \(*K Κ Kappa
502 \(*L Λ Lambda
503 \(*M Μ Mu
504 \(*N Ν Nu
505 \(*C Ξ Xi
506 \(*O Ο Omicron
507 \(*P Π Pi
508 \(*R Ρ Rho
509 \(*S Σ Sigma
510 \(*T Τ Tau
511 \(*U Υ Upsilon
512 \(*F Φ Phi
513 \(*X Χ Chi
514 \(*Q Ψ Psi
515 \(*W Ω Omega
516 \(*a α alpha
517 \(*b β beta
518 \(*g γ gamma
519 \(*d δ delta
520 \(*e ε epsilon
521 \(*z ζ zeta
522 \(*y η eta
523 \(*h θ theta
524 \(*i ι iota
525 \(*k κ kappa
526 \(*l λ lambda
527 \(*m μ mu
528 \(*n ν nu
529 \(*c ξ xi
530 \(*o ο omicron
531 \(*p π pi
532 \(*r ρ rho
533 \(*s σ sigma
534 \(*t τ tau
535 \(*u υ upsilon
536 \(*f ϕ phi
537 \(*x χ chi
538 \(*q ψ psi
539 \(*w ω omega
540 \(+h ϑ theta variant
541 \(+f φ phi variant
542 \(+p ϖ pi variant
543 \(+e ϵ epsilon variant
544 \(ts ς sigma terminal
545
547 Predefined strings are inherited from the macro packages of historical
548 troff implementations. They are not recommended for use, as they differ
549 across implementations. Manuals using these predefined strings are
550 almost certainly not portable.
551
552 Their syntax is similar to special characters, using ‘\*X’ (for a
553 one-character escape), ‘\*(XX’ (two-character), and ‘\*[N]’
554 (N-character). For details, see the Predefined Strings subsection of the
555 roff(7) manual.
556
557 Input Rendered Description
558 \*(Ba | vertical bar
559 \*(Ne ≠ not equal
560 \*(Ge ≥ greater-than-equal
561 \*(Le ≤ less-than-equal
562 \*(Gt > greater-than
563 \*(Lt < less-than
564 \*(Pm ± plus-minus
565 \*(If ∞ infinity
566 \*(Pi π pi
567 \*(Na NaN NaN
568 \*(Am & ampersand
569 \*R restricted mark
570 \*(Tm trade mark
571 \*q " double-quote
572 \*(Rq ” right-double-quote
573 \*(Lq “ left-double-quote
574 \*(lp ( right-parenthesis
575 \*(rp ) left-parenthesis
576 \*(lq left double-quote
577 \*(rq right double-quote
578 \*(ua ↑ up arrow
579 \*(va up-down arrow
580 \*(<= ≤ less-than-equal
581 \*(>= ≥ greater-than-equal
582 \*(aa ´ acute
583 \*(ga ` grave
584 \*(Px POSIX POSIX standard name
585 \*(Ai ANSI ANSI standard name
586
588 The escape sequences
589
590 \[uXXXX] and \C'uXXXX'
591
592 are interpreted as Unicode codepoints. The codepoint must be in the
593 range above U+0080 and less than U+10FFFF. For compatibility, the hexa‐
594 decimal digits ‘A’ to ‘F’ must be given as uppercase characters, and
595 points must be zero-padded to four characters; if greater than four char‐
596 acters, no zero padding is allowed. Unicode surrogates are not allowed.
597
599 For backward compatibility with existing manuals, mandoc(1) also supports
600 the
601
602 \N'number'
603
604 escape sequence, inserting the character number from the current charac‐
605 ter set into the output. Of course, this is inherently non-portable and
606 is already marked as deprecated in the Heirloom roff manual. For exam‐
607 ple, do not use \N'34', use \(dq, or even the plain ‘"’ character where
608 possible.
609
611 This section documents compatibility between mandoc and other troff
612 implementations, at this time limited to GNU troff ("groff").
613
614 - The \N'' escape sequence is limited to printable characters; in
615 groff, it accepts arbitrary character numbers.
616 - In -Tascii, the \(ss, \(nm, \(nb, \(nc, \(ib, \(ip, \(pp, \[sum],
617 \[product], \[coproduct], \(gr, \(-h, and \(a. special characters
618 render differently between mandoc and groff.
619 - In -Thtml, the \(~=, \(nb, and \(nc special characters render differ‐
620 ently between mandoc and groff.
621 - The -Tps and -Tpdf modes format like -Tascii instead of rendering
622 glyphs as in groff.
623 - The \[radicalex], \[sqrtex], and \(ru special characters have been
624 omitted from mandoc either because they are poorly documented or they
625 have no known representation.
626
628 mandoc(1), man(7), mdoc(7), roff(7)
629
631 The mandoc_char manual page was written by Kristaps Dzonsons
632 <kristaps@bsd.lv>.
633
635 The predefined string ‘\*(Ba’ mimics the behaviour of the ‘|’ character
636 in mdoc(7); thus, if you wish to render a vertical bar with no side
637 effects, use the ‘\(ba’ escape.
638
639BSD June 20, 2019 BSD