The Comprehensive LaTeX Symbol List - CTAN
The Comprehensive LaTeX Symbol List - CTAN
The Comprehensive LaTeX Symbol List - CTAN
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Producing complex accents<br />
Accents are a special case of combining existing symbols to make new symbols. While various tables in this<br />
document show how to add an accent to an existing symbol, some applications, such as transliterations from non-<br />
Latin alphabets, require multiple accents per character. For instance, the creator of pdfTEX writes his name as<br />
“Hàn Th ´ ê Thành”. <strong>The</strong> dblaccnt package enables LATEX to stack accents, as in “H\‘an Th\’{\^e} Th\‘anh” (albeit<br />
not in the OT1 font encoding). In addition, the wsuipa package defines \diatop and \diaunder macros for putting<br />
one or more diacritics or accents above or below a given character. For example, \diaunder[{\diatop[\’|\=]}|<br />
\textsubdot{r}] produces “´¯r ”. See the wsuipa documentation for more information.<br />
<strong>The</strong> accents package facilitates ˙ the fabrication of accents in math mode. Its \accentset command enables any<br />
character to be used as an accent. For instance, \accentset{\star}{f} produces “ ⋆<br />
f ” and \accentset{e}{X}<br />
produces “ e<br />
X”. \underaccent does the same thing, but places the accent beneath the character. This enables<br />
constructs like \underaccent{\tilde}{V}, which produces “ V ”. accents provides other accent-related features<br />
as well; see the documentation for more information.<br />
˜<br />
Creating extensible symbols<br />
A relatively simple example of creating extensible symbols stems from a comp.text.tex post by Donald Arseneau<br />
(June 2003). <strong>The</strong> following code defines an equals sign that extends as far to the right as possible, just like L ATEX’s<br />
\hrulefill command:<br />
\makeatletter<br />
\def\equalsfill{$\m@th\mathord=\mkern-7mu<br />
\cleaders\hbox{$\!\mathord=\!$}\hfill<br />
\mkern-7mu\mathord=$}<br />
\makeatother<br />
TEX’s \cleaders and \hfill primitives are the key to understanding \equalsfill’s extensibility. Essentially,<br />
\equalsfill repeats a box containing “=” plus some negative space until it fills the maximum available horizontal<br />
space. \equalsfill is intended to be used with LATEX’s \stackrel command, which stacks one mathematical<br />
expression (slightly reduced in size) atop another. Hence, “\stackrel{a}{\rightarrow}” produces “ a →” and “X<br />
\stackrel{\text{definition}}{\hbox{\equalsfill}} Y” produces “X definition<br />
======= Y ”.<br />
If all that needs to extend are horizontal and vertical lines—as opposed to repeated symbols such as the “=”<br />
in the previous example—LATEX’s array or tabular environments may suffice. Consider the following code (due<br />
to a February 1999 comp.text.tex post by Donald Arseneau and subsequent modifications by Billy Yu and Scott<br />
Pakin) for typesetting annuity and life-insurance symbols:<br />
\DeclareRobustCommand{\actuarial}[2][]{%<br />
\def\arraystretch{0}%<br />
\setlength\arraycolsep{0.5pt}%<br />
\setlength\arrayrulewidth{0.5pt}%<br />
\setbox0=\hbox{$\scriptstyle#1#2$}%<br />
\begin{array}[b]{*2{@{}>{\scriptstyle}c}|}<br />
\cline{2-2}%<br />
\rule[1.25pt]{0pt}{\ht0}%<br />
#1 & #2%<br />
\end{array}%<br />
}<br />
Using the preceding definition, one can type, e.g., “$a_{\actuarial{n}}$” to produce “an ” and<br />
“$a_{\actuarial[x:]{n}}$” to produce “ax:n ”<br />
A more complex example of composing accents is the following definition of extensible \overbracket,<br />
\underbracket, \overparenthesis, and \underparenthesis symbols, taken from a May 2002 comp.text.tex<br />
post by Donald Arseneau:<br />
118