MANDOC_CHAR(7)
๐ MANDOC_CHAR(7) ๐
โจ NAME โจ
mandoc_char โ mandoc special characters ๐
๐ DESCRIPTION ๐
okay bestie, so this page is literally the guide to all the roff(7) escape sequences that mandoc(1) accepts to represent special characters in mdoc(7) and man(7) documents. no cap. โจ
The rendering depends on the mandoc(1) output mode; you can inspect it by calling man(1) on the mandoc_char manual page with different -T arguments. In ASCII output, the rendering of some characters may be hard to interpret for the reader. Many are rendered as descriptive strings like "<integral>", "<degree>", or "<Gamma>", which may look ugly, and many are replaced by similar ASCII characters. In particular, accented characters are usually shown without the accent. For that reason, try to avoid using any of the special characters documented here except those discussed in the โDESCRIPTIONโ, unless they are essential for explaining the subject matter at hand, for example when documenting complicated mathematical functions. ๐ญ
In particular, in English manual pages, do not use special-character escape sequences to represent national language characters in author names; instead, provide ASCII transcriptions of the names. periodt. ๐
๐ Dashes and Hyphens ๐
In typography there are different types of dashes of various width: the hyphen (โ), the en-dash (โ), the em-dash (โ), and the mathematical minus sign (โ). โจ
Hyphens are used for adjectives; to separate the two parts of a compound word; or to separate a word across two successive lines of text. The hyphen does not need to be escaped:
blue-eyed
lorry-driver
The en-dash is used to separate the two elements of a range, or can be used the same way as an em-dash. It should be written as \(en:
pp. 95\(en97.
Go away \(en or else!
The em-dash can be used to show an interruption or can be used the same way as colons, semi-colons, or parentheses. It should be written as \(em:
Three things \(em apples, oranges, and bananas.
This is not that \(em rather, this is that.
In roff(7) documents, the minus sign is normally written as \-. In manual pages, some style guides recommend to also use \- if an ASCII 0x2d โhyphen-minusโ output glyph that can be copied and pasted is desired in output modes supporting it, for example in -T utf8 and -T html. But currently, no practically relevant manual page formatter requires that subtlety, so in manual pages, it is sufficient to write plain - to represent hyphen, minus, and hyphen-minus. ๐ซถ
If a word on a text input line contains a hyphen, a formatter may decide to insert an output line break after the hyphen if that helps filling the current output line, but the whole word would overflow the line. If it is important that the word is not broken across lines in this way, a zero-width space (\&) can be inserted before or after the hyphen. While mandoc(1) never breaks the output line after hyphens adjacent to a zero-width space, after any of the other dash- or hyphen-like characters represented by escape sequences, or after hyphens inside words in macro arguments, other software may not respect these rules and may break the line even in such cases. ๐ญ
Some roff(7) implementations contains dictionaries allowing to break the line at syllable boundaries even inside words that contain no hyphens. Such automatic hyphenation is not supported by mandoc(1), which only breaks the line at whitespace, and inside words only after existing hyphens. ๐
๐ง Spaces ๐ง
To separate words in normal text, for indenting and alignment in literal context, and when none of the following special cases apply, just use the normal space character ( ). ๐ธ
When filling text, output lines may be broken between words, i.e. at space characters. To prevent a line break between two particular words, use the unpaddable non-breaking space escape sequence (\ ) instead of the normal space character. For example, the input string โnumber\ 1โ will be kept together as โnumber 1โ on the same output line. โจ
On request and macro lines, the normal space character serves as an argument delimiter. To include whitespace into arguments, quoting is usually the best choice; see the MACRO SYNTAX section in roff(7). In some cases, using the non-breaking space escape sequence (\ ) may be preferable.
To escape macro names and to protect whitespace at the end of input lines, the zero-width space (\&) is often useful. For example, in mdoc(7), a normal space character can be displayed in single quotes in either of the following ways:
.Sq " "
.Sq \ \&
๐ Quotes ๐
On request and macro lines, the double-quote character (") is handled specially to allow quoting. One way to prevent this special handling is by using the \(dq escape sequence. ๐
Note that on text lines, literal double-quote characters can be used verbatim. All other quote-like characters can be used verbatim as well, even on request and macro lines. ๐ฆ
๐ Accents ๐
In output modes supporting such special output characters, for example -T pdf, and sometimes less consistently in -T utf8, some roff(7) formatters convert the following ASCII input characters to the following Unicode special output characters:
` U+2018 left single quotation mark
' U+2019 right single quotation mark
~ U+02DC small tilde
^ U+02C6 modifier letter circumflex
In prose, this automatic substitution is often desirable; but when these characters have to be displayed as plain ASCII characters, for example in source code samples, they require escaping to render as follows:
\(ga U+0060 grave accent
\(aq U+0027 apostrophe
\(ti U+007E tilde
\(ha U+005E circumflex accent
โญ Periods โญ
The period (.) is handled specially at the beginning of an input line, where it introduces a roff(7) request or a macro, and when appearing alone as a macro argument in mdoc(7). In such situations, prepend a zero-width space (\&.) to make it behave like normal text. โจ
Do not use the \. escape sequence. It does not prevent special handling of the period. ๐
๐ฆ Backslashes ๐ฆ
To include a literal backslash (\) into the output, use the (\e) escape sequence. ๐
Note that doubling it (\\) is not the right way to output a backslash. Because mandoc(1) does not implement full roff(7) functionality, it may work with mandoc(1), but it may have weird effects on complete roff(7) implementations. ๐ญ
๐ฅ SPECIAL CHARACTERS ๐ฅ
Special characters are encoded as \X (for a one-character escape), \(XX (two-character), and \[N] (N-character). For details, see the Special Characters subsection of the roff(7) manual. โจ
Spaces, non-breaking unless stated otherwise:
\โ unpaddable space\~โ paddable space\0โ digit-width space\|โ one-sixth\(emnarrow space, zero width in nroff mode\^โ one-twelfth\(emhalf-narrow space, zero width in nroff\&โ zero-width space\)โ zero-width space transparent to end-of-sentence detection\%โ zero-width space allowing hyphenation\:โ zero-width space allowing line break
Lines:
\(baโ|โ bar\(brโโโ box rule\(ulโ_โ underscore\(ruโ_โ underscore (width0.5m)\(rnโโพโ overline\(bbโยฆโ broken bar\(slโ/โ forward slash\(rsโ\โ backward slash
Text markers:
\(ciโโโ circle\(buโโขโ bullet\(ddโโกโ double dagger\(dgโโโ dagger\(lzโโโ lozenge\(sqโโกโ white square\(psโยถโ paragraph\(scโยงโ section\(lhโโโ left hand\(rhโโโ right hand\(atโ@โ at\(shโ#โ hash (pound)\(CRโโตโ carriage return\(OKโโโ check mark\(CLโโฃโ club suit\(SPโโโ spade suit\(HEโโฅโ heart suit\(DIโโฆโ diamond suit
Legal symbols:
\(coโยฉโ copyright\(rgโยฎโ registered\(tmโโขโ trademarked
Punctuation:
\(emโโโ em-dash\(enโโโ en-dash\(hyโโโ hyphen\eโ\โ back-slash\.โ.โ period\(r!โยกโ upside-down exclamation\(r?โยฟโ upside-down question
Quotes:
\(Bqโโโ right low double-quote\(bqโโโ right low single-quote\(lqโโโ left double-quote\(rqโโโ right double-quote\(oqโโโ left single-quote\(cqโโโ right single-quote\(aqโ'โ apostrophe quote (ASCII character)\(dqโ"โ double quote (ASCII character)\(Foโยซโ left guillemet\(Fcโยปโ right guillemet\(foโโนโ left single guillemet\(fcโโบโ right single guillemet
Brackets ๐
okay so brackets, braces, and angle things โ here's the full roster, bestie. Input, rendered, description. No cap.
\(lBโ[โ left bracket\(rBโ]โ right bracket\(lCโ{โ left brace\(rCโ}โ right brace\(laโโจโ left angle\(raโโฉโ right angle\(bvโโชโ brace extension (special font)\[braceex]โโชโ brace extension\[bracketlefttp]โโกโ top-left hooked bracket\[bracketleftbt]โโฃโ bottom-left hooked bracket\[bracketleftex]โโขโ left hooked bracket extension\[bracketrighttp]โโคโ top-right hooked bracket\[bracketrightbt]โโฆโ bottom-right hooked bracket\[bracketrightex]โโฅโ right hooked bracket extension\(ltโโงโ top-left hooked brace\[bracelefttp]โโงโ top-left hooked brace\(lkโโจโ mid-left hooked brace\[braceleftmid]โโจโ mid-left hooked brace\(lbโโฉโ bottom-left hooked brace\[braceleftbt]โโฉโ bottom-left hooked brace\[braceleftex]โโชโ left hooked brace extension\(rtโโซโ top-left hooked brace\[bracerighttp]โโซโ top-right hooked brace\(rkโโฌโ mid-right hooked brace\[bracerightmid]โโฌโ mid-right hooked brace\(rbโโญโ bottom-right hooked brace\[bracerightbt]โโญโ bottom-right hooked brace\[bracerightex]โโชโ right hooked brace extension\[parenlefttp]โโโ top-left hooked parenthesis\[parenleftbt]โโโ bottom-left hooked parenthesis\[parenleftex]โโโ left hooked parenthesis extension\[parenrighttp]โโโ top-right hooked parenthesis\[parenrightbt]โโโ bottom-right hooked parenthesis\[parenrightex]โโโ right hooked parenthesis extension
Arrows ๐น
direction is everything, periodt.
\(<-โโโ left arrow\(->โโโ right arrow\(<>โโโ left-right arrow\(daโโโ down arrow\(uaโโโ up arrow\(vaโโโ up-down arrow\(lAโโโ left double-arrow\(rAโโโ right double-arrow\(hAโโโ left-right double-arrow\(uAโโโ up double-arrow\(dAโโโ down double-arrow\(vAโโโ up-down double-arrow\(anโโฏโ horizontal arrow extension
Logical ๐ง
logic but make it typography, iykyk.
\(ANโโงโ logical and\(ORโโจโ logical or\[tno]โยฌโ logical not (text font)\(noโยฌโ logical not (special font)\(teโโโ existential quantifier\(faโโโ universal quantifier\(stโโโ such that\(tfโโดโ therefore\(3dโโดโ therefore\(orโ|โ bitwise or
Mathematical โ
math girlies, this one's for you. all the operators, sets, and fancy fractions. slay.
\-โ-โ minus (text font)\(miโโโ minus (special font)+โ+โ plus (text font)\(plโ+โ plus (special font)\(-+โโโ minus-plus\[t+-]โยฑโ plus-minus (text font)\(+-โยฑโ plus-minus (special font)\(pcโยทโ center-dot\[tmu]โรโ multiply (text font)\(muโรโ multiply (special font)\(c*โโโ circle-multiply\(c+โโโ circle-plus\[tdi]โรทโ divide (text font)\(diโรทโ divide (special font)\(f/โโโ fraction\(**โโโ asterisk\(<=โโคโ less-than-equal\(>=โโฅโ greater-than-equal\(<<โโชโ much less\(>>โโซโ much greater\(eqโ=โ equal\(!=โโโ not equal\(==โโกโ equivalent\(neโโขโ not equivalent\(apโโผโ tilde operator\(|=โโโ asymptotically equal\(=~โโโ approximately equal\(~~โโโ almost equal\(~=โโโ almost equal\(ptโโโ proportionate\(esโโโ empty set\(moโโโ element\(nmโโโ not element\(sbโโโ proper subset\(nbโโโ not subset\(spโโโ proper superset\(ncโโโ not superset\(ibโโโ reflexive subset\(ipโโโ reflexive superset\(caโโฉโ intersection\(cuโโชโ union\(/_โโโ angle\(ppโโฅโ perpendicular\(isโโซโ integral\[integral]โโซโ integral\[sum]โโโ summation\[product]โโโ product\[coproduct]โโโ coproduct\(grโโโ gradient\(srโโโ square root\[sqrt]โโโ square root\(lcโโโ left-ceiling\(rcโโโ right-ceiling\(lfโโโ left-floor\(rfโโโ right-floor\(ifโโโ infinity\(Ahโโตโ aleph\(Imโโโ imaginary\(Reโโโ real\(wpโโโ Weierstrass p\(pdโโโ partial differential\(-hโโโ Planck constant over 2ฯ\[hbar]โโโ Planck constant over 2ฯ\(12โยฝโ one-half\(14โยผโ one-fourth\(34โยพโ three-fourths\(18โโ โ one-eighth\(38โโ โ three-eighths\(58โโ โ five-eighths\(78โโ โ seven-eighths\(S1โยนโ superscript 1\(S2โยฒโ superscript 2\(S3โยณโ superscript 3
Ligatures โจ
when two letters are so close they become one, it's giving soulmates.
\(ffโffโ ff ligature\(fiโfiโ fi ligature\(flโflโ fl ligature\(Fiโffiโ ffi ligature\(Flโfflโ ffl ligature\(AEโรโ AE\(aeโรฆโ ae\(OEโลโ OE\(oeโลโ oe\(ssโรโ German eszett\(IJโฤฒโ IJ ligature\(ijโฤณโ ij ligature
Accents ๐
accents, for when you want to put a little hat on your letters.
\(a"โหโ Hungarian umlaut\(a-โยฏโ macron\(a.โหโ dotted\(a^โ^โ circumflex\(aaโยดโ acute\'โยดโ acute\(gaโ`โ grave- **
`\** โ` `` โ grave \(abโหโ breve\(acโยธโ cedilla\(adโยจโ dieresis\(ahโหโ caron\(aoโหโ ring\(a~โ~โ tilde\(hoโหโ ogonek\(haโ^โ hat (ASCII character)\(tiโ~โ tilde (ASCII character)
๐ Accented letters ๐
okay bestie, these are the accented-letter escapes, and we're listing every single one because half a list is not the vibe ๐
\('Aโรโ acute A\('Eโรโ acute E\('Iโรโ acute I\('Oโรโ acute O\('Uโรโ acute U\('Yโรโ acute Y\('aโรกโ acute a\('eโรฉโ acute e\('iโรญโ acute i\('oโรณโ acute o\('uโรบโ acute u\('yโรฝโ acute y\(`Aโรโ grave A\(`Eโรโ grave E\(`Iโรโ grave I\(`Oโรโ grave O\(`Uโรโ grave U\(`aโรโ grave a\(`eโรจโ grave e\(`iโรฌโ grave i\(`oโรฌโ grave o\(`uโรนโ grave u\(~Aโรโ tilde A\(~Nโรโ tilde N\(~Oโรโ tilde O\(~aโรฃโ tilde a\(~nโรฑโ tilde n\(~oโรตโ tilde o\(:Aโรโ dieresis A\(:Eโรโ dieresis E\(:Iโรโ dieresis I\(:Oโรโ dieresis O\(:Uโรโ dieresis U\(:aโรคโ dieresis a\(:eโรซโ dieresis e\(:iโรฏโ dieresis i\(:oโรถโ dieresis o\(:uโรผโ dieresis u\(:yโรฟโ dieresis y\(^Aโรโ circumflex A\(^Eโรโ circumflex E\(^Iโรโ circumflex I\(^Oโรโ circumflex O\(^Uโรโ circumflex U\(^aโรขโ circumflex a\(^eโรชโ circumflex e\(^iโรฎโ circumflex i\(^oโรดโ circumflex o\(^uโรปโ circumflex u\(,Cโรโ cedilla C\(,cโรงโ cedilla c\(/Lโลโ stroke L\(/lโลโ stroke l\(/Oโรโ stroke O\(/oโรธโ stroke o\(oAโรโ ring A\(oaโรฅโ ring a
๐ธ Special letters ๐ธ
these are the little letter besties that aren't just accent remixes, okay? ๐ฆ
\(-Dโรโ Eth\(Sdโรฐโ eth\(TPโรโ Thorn\(Tpโรพโ thorn\(.iโฤฑโ dotless i\(.jโศทโ dotless j
๐ Currency ๐
money moves only, bestie ๐ธโจ
\(Doโ$โ dollar\(ctโยขโ cent\(Euโโฌโ Euro symbol\(euโโฌโ Euro symbol\(Yeโยฅโ yen\(Poโยฃโ pound\(Csโยคโ Scandinavian\(Fnโฦโ florin
๐ง Units ๐ง
for when you need to measure the vibe precisely ๐
\(deโยฐโ degree\(%0โโฐโ per-thousand\(fmโโฒโ minute\(sdโโณโ second\(mcโยตโ micro\(Ofโยชโ Spanish female ordinal\(Omโยบโ Spanish masculine ordinal
๐ฅ Greek letters ๐ฅ
the classics, the icons, the alphabet that ate ๐
\(*Aโฮโ Alpha\(*Bโฮโ Beta\(*Gโฮโ Gamma\(*Dโฮโ Delta\(*Eโฮโ Epsilon\(*Zโฮโ Zeta\(*Yโฮโ Eta\(*Hโฮโ Theta\(*Iโฮโ Iota\(*Kโฮโ Kappa\(*Lโฮโ Lambda\(*Mโฮโ Mu\(*Nโฮโ Nu\(*Cโฮโ Xi\(*Oโฮโ Omicron\(*Pโฮโ Pi\(*Rโฮกโ Rho\(*Sโฮฃโ Sigma\(*Tโฮคโ Tau\(*Uโฮฅโ Upsilon\(*Fโฮฆโ Phi\(*Xโฮงโ Chi\(*Qโฮจโ Psi\(*Wโฮฉโ Omega\(*aโฮฑโ alpha\(*bโฮฒโ beta\(*gโฮณโ gamma\(*dโฮดโ delta\(*eโฮตโ epsilon\(*zโฮถโ zeta\(*yโฮทโ eta\(*hโฮธโ theta\(*iโฮนโ iota\(*kโฮบโ kappa\(*lโฮปโ lambda\(*mโฮผโ mu\(*nโฮฝโ nu\(*cโฮพโ xi\(*oโฮฟโ omicron\(*pโฯโ pi\(*rโฯโ rho\(*sโฯโ sigma\(*tโฯโ tau\(*uโฯโ upsilon\(*fโฯโ phi\(*xโฯโ chi\(*qโฯโ psi\(*wโฯโ omega\(+hโฯโ theta variant\(+fโฯโ phi variant\(+pโฯโ pi variant\(+eโฯตโ epsilon variant\(tsโฯโ sigma terminal
๐ PREDEFINED STRINGS ๐
Predefined strings are inherited from the macro packages of historical troff implementations. They are not recommended for use, as they differ across implementations. Manuals using these predefined strings are almost certainly not portable ๐ญ
Their syntax is similar to special characters, using \*X (for a one-character escape), \*(XX (two-character), and \*[N] (N-character).
\*(Baโ|โ vertical bar\*(Neโโโ not equal\*(Geโโฅโ greater-than-equal\*(Leโโคโ less-than-equal\*(Gtโ>โ greater-than\*(Ltโ<โ less-than\*(Pmโยฑโ plus-minus\*(Ifโโโ infinity\*(Piโฯโ pi\*(NaโNaNโ NaN\*(Amโ&โ ampersand\*Rโ (blank) โ restricted mark\*(Tmโ (blank) โ trade mark\*qโ"โ double-quote\*(Rqโโโ right-double-quote\*(Lqโโโ left-double-quote\*(lpโ(โ right-parenthesis\*(rpโ)โ left-parenthesis\*(lqโ (blank) โ left double-quote\*(rqโ (blank) โ right double-quote\*(uaโโโ up arrow\*(vaโ (blank) โ up-down arrow\*(<=โโคโ less-than-equal\*(>=โโฅโ greater-than-equal\*(aaโยดโ acute\*(gaโ`โ grave\*(PxโPOSIXโ POSIX standard name\*(AiโANSIโ ANSI standard name
๐ฆ UNICODE CHARACTERS ๐ฆ
The escape sequences
\[uXXXX] and \C'uXXXX'
are interpreted as Unicode codepoints. The codepoint must be in the range above U+0080 and less than U+10FFFF. For compatibility, the hexadecimal digits โAโ to โFโ must be given as uppercase characters, and points must be zero-padded to four characters; if greater than four characters, no zero padding is allowed. Unicode surrogates are not allowed.
๐ฅ NUMBERED CHARACTERS ๐ฅ
For backward compatibility with existing manuals, mandoc(1) also supports the
\N'number' and \[charnumber]
escape sequences, inserting the character number from the current character set into the output. Of course, this is inherently non-portable and is already marked as deprecated in the Heirloom roff manual; on top of that, the second form is a GNU extension. For example, do not use \N'34' or \[char34], use \(dq, or even the plain โ"โ character where possible.
๐ COMPATIBILITY ๐
This section documents compatibility between mandoc and other troff implementations, at this time limited to GNU troff ("groff").
- The
\N''escape sequence is limited to printable characters; ingroff, it accepts arbitrary character numbers. - In
-Tascii, the\(ss,\(nm,\(nb,\(nc,\(ib,\(ip,\(pp,\[sum],\[product],\[coproduct],\(gr,\(-h, and\(a.special characters render differently betweenmandocandgroff. - In
-Thtml, the\(~=,\(nb, and\(ncspecial characters render differently betweenmandocandgroff. - The
-Tpsand-Tpdfmodes format like-Tasciiinstead of rendering glyphs as ingroff. - The
\[radicalex],\[sqrtex], and\(ruspecial characters have been omitted frommandoceither because they are poorly documented or they have no known representation.
๐ SEE ALSO ๐
mandoc(1), man(7), mdoc(7), roff(7)
๐ AUTHORS ๐
The mandoc_char manual page was written by Kristaps Dzonsons <kristaps@bsd.lv>.
๐ CAVEATS ๐
The predefined string โ\*(Baโ mimics the behaviour of the โ|โ character in mdoc(7); thus, if you wish to render a vertical bar with no side effects, use the โ\(baโ escape.
and that's the whole vibe check, bestie ๐ this page came from Debian, dated October 31, 2020, and it's literally MANDOC_CHAR(7) ๐ฆโจ
๐ฆ where this page comes from
- alpine 3.22: mandoc-doc 1.14.6-r13 ยท ISC
- alpine 3.23: mandoc-doc 1.14.6-r14 ยท ISC
- alpine 3.24: mandoc-doc 1.14.6-r15 ยท ISC
- arch rolling: mandoc 1.14.6-5 ยท ISC
- debian trixie: mandoc 1.14.6-4 ยท ISC
- epel 10: mandoc 1.14.6-11.el10_1 ยท ISC AND BSD-2-Clause AND BSD-3-Clause
- epel 9: mandoc 1.14.6-2.el9 ยท ISC
- fedora 43: mandoc 1.14.6-12.fc43 ยท ISC AND BSD-2-Clause AND BSD-3-Clause
- fedora 44: mandoc 1.14.6-13.fc44 ยท ISC AND BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: mandoc 1.14.6
- nixpkgs unstable: mandoc 1.14.6
- opensuse-leap 16.0: mandoc 1.14.6-160000.2.2 ยท ISC
- opensuse-leap 16.0: mandoc 1.14.6-160000.2.2 ยท ISC
- opensuse-leap 16.0: mandoc 1.14.6-160000.2.2 ยท ISC
- opensuse-leap 16.0: mandoc 1.14.6-160000.2.2 ยท ISC
- ubuntu questing: mandoc 1.14.6-4
- ubuntu resolute: mandoc 1.14.6-4build1 ยท ISC
- ubuntu stonking: mandoc 1.14.6-4build1 ยท ISC
- Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org>
- Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- Copyright (c) 2011,2013,2015,2017-2020 Ingo Schwarze <schwarze@openbsd.org>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms