1 MANDOC_CHAR(5) Standards, Environments, and Macros MANDOC_CHAR(5) 2 3 NAME 4 mandoc_char - mandoc special characters 5 6 DESCRIPTION 7 This page documents the mandoc_roff(5) escape sequences accepted by 8 mandoc(1) to represent special characters in mdoc(5) and man(5) 9 documents. 10 11 The rendering depends on the mandoc(1) output mode; it can be inspected 12 by calling man(1) on the mandoc_char manual page with different -T 13 arguments. In ASCII output, the rendering of some characters may be hard 14 to interpret for the reader. Many are rendered as descriptive strings 15 like "<integral>", "<degree>", or "<Gamma>", which may look ugly, and 16 many are replaced by similar ASCII characters. In particular, accented 17 characters are usually shown without the accent. For that reason, try to 18 avoid using any of the special characters documented here except those 19 discussed in the DESCRIPTION, unless they are essential for explaining 20 the subject matter at hand, for example when documenting complicated 21 mathematical functions. 22 23 In particular, in English manual pages, do not use special-character 24 escape sequences to represent national language characters in author 25 names; instead, provide ASCII transcriptions of the names. 26 27 Dashes and Hyphens 28 In typography there are different types of dashes of various width: the 29 hyphen (-), the en-dash (-), the em-dash (--), and the mathematical minus 30 sign (-). 31 32 Hyphens are used for adjectives; to separate the two parts of a compound 33 word; or to separate a word across two successive lines of text. The 34 hyphen does not need to be escaped: 35 36 blue-eyed 37 lorry-driver 38 39 The en-dash is used to separate the two elements of a range, or can be 40 used the same way as an em-dash. It should be written as `\(en': 41 42 pp. 95\(en97. 43 Go away \(en or else! 44 45 The em-dash can be used to show an interruption or can be used the same 46 way as colons, semi-colons, or parentheses. It should be written as 47 `\(em': 48 49 Three things \(em apples, oranges, and bananas. 50 This is not that \(em rather, this is that. 51 52 In mandoc_roff(5) documents, the minus sign is normally written as `\-'. 53 In manual pages, some style guides recommend to also use `\-' if an ASCII 54 0x2d "hyphen-minus" output glyph that can be copied and pasted is desired 55 in output modes supporting it, for example in -T utf8 and -T html. But 56 currently, no practically relevant manual page formatter actually 57 requires that subtlety, so in manual pages just write plain `-' to 58 represent hyphen, minus, and hyphen-minus. 59 60 If a word on a text input line contains a hyphen, a formatter may decide 61 to insert an output line break after the hyphen if that helps filling the 62 current output line, but the whole word would overflow the line. If it 63 is important that the word is not broken across lines in this way, a 64 zero-width space (`\&') can be inserted before or after the hyphen. 65 While mandoc(1) never breaks the output line after hyphens adjacent to a 66 zero-width space, after any of the other dash- or hyphen-like characters 67 represented by escape sequences, or after hyphens inside words in macro 68 arguments, other software may not respect these rules and may break the 69 line even in such cases. 70 71 Some mandoc_roff(5) implementations contains dictionaries allowing to 72 break the line at syllable boundaries even inside words that contain no 73 hyphens. Such automatic hyphenation is not supported by mandoc(1), which 74 only breaks the line at whitespace, and inside words only after existing 75 hyphens. 76 77 Spaces 78 To separate words in normal text, for indenting and alignment in literal 79 context, and when none of the following special cases apply, just use the 80 normal space character (` '). 81 82 When filling text, output lines may be broken between words, i.e. at 83 space characters. To prevent a line break between two particular words, 84 use the unpaddable non-breaking space escape sequence (`\ ') instead of 85 the normal space character. For example, the input string "number\ 1" 86 will be kept together as "number 1" on the same output line. 87 88 On request and macro lines, the normal space character serves as an 89 argument delimiter. To include whitespace into arguments, quoting is 90 usually the best choice; see the MACRO SYNTAX section in mandoc_roff(5). 91 In some cases, using the non-breaking space escape sequence (`\ ') may be 92 preferable. 93 94 To escape macro names and to protect whitespace at the end of input 95 lines, the zero-width space (`\&') is often useful. For example, in 96 mdoc(5), a normal space character can be displayed in single quotes in 97 either of the following ways: 98 99 .Sq " " 100 .Sq \ \& 101 102 Quotes 103 On request and macro lines, the double-quote character (`"') is handled 104 specially to allow quoting. One way to prevent this special handling is 105 by using the `\(dq' escape sequence. 106 107 Note that on text lines, literal double-quote characters can be used 108 verbatim. All other quote-like characters can be used verbatim as well, 109 even on request and macro lines. 110 111 Accents 112 In output modes supporting such special output characters, for example -T 113 pdf, and sometimes less consistently in -T utf8, some mandoc_roff(5) 114 formatters convert the following ASCII input characters to the following 115 Unicode special output characters: 116 117 ` U+2018 left single quotation mark 118 ' U+2019 right single quotation mark 119 ~ U+02DC small tilde 120 ^ U+02C6 modifier letter circumflex 121 122 In prose, this automatic substitution is often desirable; but when these 123 characters have to be displayed as plain ASCII characters, for example in 124 source code samples, they require escaping to render as follows: 125 126 \(ga U+0060 grave accent 127 \(aq U+0027 apostrophe 128 \(ti U+007E tilde 129 \(ha U+005E circumflex accent 130 131 Periods 132 The period (`.') is handled specially at the beginning of an input line, 133 where it introduces a mandoc_roff(5) request or a macro, and when 134 appearing alone as a macro argument in mdoc(5). In such situations, 135 prepend a zero-width space (`\&.') to make it behave like normal text. 136 137 Do not use the `\.' escape sequence. It does not prevent special 138 handling of the period. 139 140 Backslashes 141 To include a literal backslash (`\') into the output, use the (`\e') 142 escape sequence. 143 144 Note that doubling it (`\\') is not the right way to output a backslash. 145 Because mandoc(1) does not implement full mandoc_roff(5) functionality, 146 it may work with mandoc(1), but it may have weird effects on complete 147 mandoc_roff(5) implementations. 148 149 SPECIAL CHARACTERS 150 Special characters are encoded as `\X' (for a one-character escape), 151 `\(XX' (two-character), and `\[N]' (N-character). For details, see the 152 Special Characters subsection of the mandoc_roff(5) manual. 153 154 Spacing: 155 Input Description 156 `\ ' unpaddable non-breaking space 157 \~ paddable non-breaking space 158 \0 unpaddable, breaking digit-width space 159 \| one-sixth \(em narrow space, zero width in nroff mode 160 \^ one-twelfth \(em half-narrow space, zero width in nroff 161 \& zero-width space 162 \% zero-width space allowing hyphenation 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 O circle 178 \(bu o bullet 179 \(dd <**> double dagger 180 \(dg <*> dagger 181 \(lz <> lozenge 182 \(sq [] white square 183 \(ps <paragraph> paragraph 184 \(sc <section> section 185 \(lh <= left hand 186 \(rh => right hand 187 \(at @ at 188 \(sh # hash (pound) 189 \(CR <cr> carriage return 190 \(OK \/ check mark 191 \(CL <club> club suit 192 \(SP <spade> spade suit 193 \(HE <heart> heart suit 194 \(DI <diamond> diamond suit 195 196 Legal symbols: 197 Input Rendered Description 198 \(co (C) copyright 199 \(rg (R) registered 200 \(tm 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 v down arrow 270 \(ua ^ up arrow 271 \(va ^v 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 v down double-arrow 277 \(vA ^=v up-down double-arrow 278 \(an - horizontal arrow extension 279 280 Logical: 281 Input Rendered Description 282 \(AN ^ logical and 283 \(OR v logical or 284 \[tno] ~ logical not (text font) 285 \(no ~ logical not (special font) 286 \(te <there exists> 287 existential quantifier 288 \(fa <for all> universal quantifier 289 \(st <such that> such that 290 \(tf <therefore> therefore 291 \(3d <therefore> therefore 292 \(or | bitwise or 293 294 Mathematical: 295 Input Rendered Description 296 \- - minus (text font) 297 \(mi - minus (special font) 298 + + plus (text font) 299 \(pl + plus (special font) 300 \(-+ -+ minus-plus 301 \[t+-] +- plus-minus (text font) 302 \(+- +- plus-minus (special font) 303 \(pc . center-dot 304 \[tmu] x multiply (text font) 305 \(mu x multiply (special font) 306 \(c* x circle-multiply 307 \(c+ + circle-plus 308 \[tdi] / divide (text font) 309 \(di / divide (special font) 310 \(f/ / fraction 311 \(** * asterisk 312 \(<= <= less-than-equal 313 \(>= >= greater-than-equal 314 \(<< << much less 315 \(>> >> much greater 316 \(eq = equal 317 \(!= != not equal 318 \(== == equivalent 319 \(ne !== not equivalent 320 \(ap ~ tilde operator 321 \(|= -~ asymptotically equal 322 \(=~ =~ approximately equal 323 \(~~ ~~ almost equal 324 \(~= ~= almost equal 325 \(pt <proportional to> 326 proportionate 327 \(es {} empty set 328 \(mo <element of> 329 element 330 \(nm <not element of> 331 not element 332 \(sb <proper subset> 333 proper subset 334 \(nb <not subset> 335 not subset 336 \(sp <proper superset> 337 proper superset 338 \(nc <not superset> 339 not superset 340 \(ib <subset or equal> 341 reflexive subset 342 \(ip <superset or equal> 343 reflexive superset 344 \(ca <intersection> 345 intersection 346 \(cu <union> union 347 \(/_ <angle> angle 348 \(pp <perpendicular> 349 perpendicular 350 \(is <integral> integral 351 \[integral] <integral> integral 352 \[sum] <sum> summation 353 \[product] <product> product 354 \[coproduct] <coproduct> coproduct 355 \(gr <nabla> gradient 356 \(sr <sqrt> square root 357 \[sqrt] <sqrt> square root 358 \(lc |~ left-ceiling 359 \(rc ~| right-ceiling 360 \(lf |_ left-floor 361 \(rf _| right-floor 362 \(if <infinity> infinity 363 \(Ah <Aleph> aleph 364 \(Im <Im> imaginary 365 \(Re <Re> real 366 \(wp P Weierstrass p 367 \(pd <del> partial differential 368 \(-h /h Planck constant over 2<pi> 369 \[hbar] /h Planck constant over 2<pi> 370 \(12 1/2 one-half 371 \(14 1/4 one-fourth 372 \(34 3/4 three-fourths 373 \(18 1/8 one-eighth 374 \(38 3/8 three-eighths 375 \(58 5/8 five-eighths 376 \(78 7/8 seven-eighths 377 \(S1 ^1 superscript 1 378 \(S2 ^2 superscript 2 379 \(S3 ^3 superscript 3 380 381 Ligatures: 382 Input Rendered Description 383 \(ff ff ff ligature 384 \(fi fi fi ligature 385 \(fl fl fl ligature 386 \(Fi ffi ffi ligature 387 \(Fl ffl ffl ligature 388 \(AE AE AE 389 \(ae ae ae 390 \(OE OE OE 391 \(oe oe oe 392 \(ss ss German eszett 393 \(IJ IJ IJ ligature 394 \(ij ij ij ligature 395 396 Accents: 397 Input Rendered Description 398 \(a" " Hungarian umlaut 399 \(a- - macron 400 \(a. . dotted 401 \(a^ ^ circumflex 402 \(aa ' acute 403 \' ' acute 404 \(ga ` grave 405 \` ` grave 406 \(ab ` breve 407 \(ac , cedilla 408 \(ad " dieresis 409 \(ah v caron 410 \(ao o ring 411 \(a~ ~ tilde 412 \(ho , ogonek 413 \(ha ^ hat (ASCII character) 414 \(ti ~ tilde (ASCII character) 415 416 Accented letters: 417 Input Rendered Description 418 \('A A acute A 419 \('E E acute E 420 \('I I acute I 421 \('O O acute O 422 \('U U acute U 423 \('a a acute a 424 \('e e acute e 425 \('i i acute i 426 \('o o acute o 427 \('u u acute u 428 \(`A A grave A 429 \(`E E grave E 430 \(`I I grave I 431 \(`O O grave O 432 \(`U U grave U 433 \(`a a grave a 434 \(`e e grave e 435 \(`i i grave i 436 \(`o i grave o 437 \(`u u grave u 438 \(~A A tilde A 439 \(~N N tilde N 440 \(~O O tilde O 441 \(~a a tilde a 442 \(~n n tilde n 443 \(~o o tilde o 444 \(:A A dieresis A 445 \(:E E dieresis E 446 \(:I I dieresis I 447 \(:O O dieresis O 448 \(:U U dieresis U 449 \(:a a dieresis a 450 \(:e e dieresis e 451 \(:i i dieresis i 452 \(:o o dieresis o 453 \(:u u dieresis u 454 \(:y y dieresis y 455 \(^A A circumflex A 456 \(^E E circumflex E 457 \(^I I circumflex I 458 \(^O O circumflex O 459 \(^U U circumflex U 460 \(^a a circumflex a 461 \(^e e circumflex e 462 \(^i i circumflex i 463 \(^o o circumflex o 464 \(^u u circumflex u 465 \(,C C cedilla C 466 \(,c c cedilla c 467 \(/L L stroke L 468 \(/l l stroke l 469 \(/O O stroke O 470 \(/o o stroke o 471 \(oA A ring A 472 \(oa a ring a 473 474 Special letters: 475 Input Rendered Description 476 \(-D Dh Eth 477 \(Sd dh eth 478 \(TP Th Thorn 479 \(Tp th thorn 480 \(.i i dotless i 481 \(.j j dotless j 482 483 Currency: 484 Input Rendered Description 485 \(Do $ dollar 486 \(ct c cent 487 \(Eu EUR Euro symbol 488 \(eu EUR Euro symbol 489 \(Ye Y yen 490 \(Po GBP pound 491 \(Cs x Scandinavian 492 \(Fn f florin 493 494 Units: 495 Input Rendered Description 496 \(de <degree> degree 497 \(%0 <permille> per-thousand 498 \(fm ' minute 499 \(sd '' second 500 \(mc <micro> micro 501 \(Of a Spanish female ordinal 502 \(Om o Spanish masculine ordinal 503 504 Greek letters: 505 Input Rendered Description 506 \(*A A Alpha 507 \(*B B Beta 508 \(*G <Gamma> Gamma 509 \(*D <Delta> Delta 510 \(*E E Epsilon 511 \(*Z Z Zeta 512 \(*Y H Eta 513 \(*H <Theta> Theta 514 \(*I I Iota 515 \(*K K Kappa 516 \(*L <Lambda> Lambda 517 \(*M M Mu 518 \(*N N Nu 519 \(*C <Xi> Xi 520 \(*O O Omicron 521 \(*P <Pi> Pi 522 \(*R P Rho 523 \(*S <Sigma> Sigma 524 \(*T T Tau 525 \(*U Y Upsilon 526 \(*F <Phi> Phi 527 \(*X X Chi 528 \(*Q <Psi> Psi 529 \(*W <Omega> Omega 530 \(*a <alpha> alpha 531 \(*b <beta> beta 532 \(*g <gamma> gamma 533 \(*d <delta> delta 534 \(*e <epsilon> epsilon 535 \(*z <zeta> zeta 536 \(*y <eta> eta 537 \(*h <theta> theta 538 \(*i <iota> iota 539 \(*k <kappa> kappa 540 \(*l <lambda> lambda 541 \(*m <mu> mu 542 \(*n <nu> nu 543 \(*c <xi> xi 544 \(*o o omicron 545 \(*p <pi> pi 546 \(*r <rho> rho 547 \(*s <sigma> sigma 548 \(*t <tau> tau 549 \(*u <upsilon> upsilon 550 \(*f <phi> phi 551 \(*x <chi> chi 552 \(*q <psi> psi 553 \(*w <omega> omega 554 \(+h <theta> theta variant 555 \(+f <phi> phi variant 556 \(+p <pi> pi variant 557 \(+e <epsilon> epsilon variant 558 \(ts <sigma> sigma terminal 559 560 PREDEFINED STRINGS 561 Predefined strings are inherited from the macro packages of historical 562 troff implementations. They are not recommended for use, as they differ 563 across implementations. Manuals using these predefined strings are 564 almost certainly not portable. 565 566 Their syntax is similar to special characters, using `\*X' (for a 567 one-character escape), `\*(XX' (two-character), and `\*[N]' 568 (N-character). For details, see the Predefined Strings subsection of the 569 mandoc_roff(5) manual. 570 571 Input Rendered Description 572 \*(Ba | vertical bar 573 \*(Ne != not equal 574 \*(Ge >= greater-than-equal 575 \*(Le <= less-than-equal 576 \*(Gt > greater-than 577 \*(Lt < less-than 578 \*(Pm +- plus-minus 579 \*(If infinity infinity 580 \*(Pi pi pi 581 \*(Na NaN NaN 582 \*(Am & ampersand 583 \*R (R) restricted mark 584 \*(Tm (Tm) trade mark 585 \*q " double-quote 586 \*(Rq " right-double-quote 587 \*(Lq " left-double-quote 588 \*(lp ( right-parenthesis 589 \*(rp ) left-parenthesis 590 \*(lq " left double-quote 591 \*(rq " right double-quote 592 \*(ua ^ up arrow 593 \*(va ^v up-down arrow 594 \*(<= <= less-than-equal 595 \*(>= >= greater-than-equal 596 \*(aa ' acute 597 \*(ga ` grave 598 \*(Px POSIX POSIX standard name 599 \*(Ai ANSI ANSI standard name 600 601 UNICODE CHARACTERS 602 The escape sequences 603 604 \[uXXXX] and \C'uXXXX' 605 606 are interpreted as Unicode codepoints. The codepoint must be in the 607 range above U+0080 and less than U+10FFFF. For compatibility, the 608 hexadecimal digits `A' to `F' must be given as uppercase characters, and 609 points must be zero-padded to four characters; if greater than four 610 characters, no zero padding is allowed. Unicode surrogates are not 611 allowed. 612 613 NUMBERED CHARACTERS 614 For backward compatibility with existing manuals, mandoc(1) also supports 615 the 616 617 \N'number' 618 619 escape sequence, inserting the character number from the current 620 character set into the output. Of course, this is inherently non- 621 portable and is already marked as deprecated in the Heirloom roff manual. 622 For example, do not use \N'34', use \(dq, or even the plain `"' character 623 where possible. 624 625 COMPATIBILITY 626 This section documents compatibility between mandoc and other troff 627 implementations, at this time limited to GNU troff ("groff"). 628 629 - The \N'' escape sequence is limited to printable characters; in 630 groff, it accepts arbitrary character numbers. 631 - In -Tascii, the \(ss, \(nm, \(nb, \(nc, \(ib, \(ip, \(pp, \[sum], 632 \[product], \[coproduct], \(gr, \(-h, and \(a. special characters 633 render differently between mandoc and groff. 634 - In -Thtml, the \(~=, \(nb, and \(nc special characters render 635 differently between mandoc and groff. 636 - The -Tps and -Tpdf modes format like -Tascii instead of rendering 637 glyphs as in groff. 638 - The \[radicalex], \[sqrtex], and \(ru special characters have been 639 omitted from mandoc either because they are poorly documented or they 640 have no known representation. 641 642 SEE ALSO 643 mandoc(1), man(5), mandoc_roff(5), mdoc(5) 644 645 AUTHORS 646 The mandoc_char manual page was written by Kristaps Dzonsons 647 <kristaps@bsd.lv>. 648 649 CAVEATS 650 The predefined string `\*(Ba' mimics the behaviour of the `|' character 651 in mdoc(5); thus, if you wish to render a vertical bar with no side 652 effects, use the `\(ba' escape. 653 654 illumos August 8, 2018 illumos