09.07.2015 Views

The Comprehensive LaTeX Symbol List

The Comprehensive LaTeX Symbol List

The Comprehensive LaTeX Symbol List

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

\makeatletter\def\equalsfill{$\m@th\mathord=\mkern-7mu\cleaders\hbox{$\!\mathord=\!$}\hfill\mkern-7mu\mathord=$}\makeatotherTEX’s \cleaders and \hfill primitives are the key to understanding \equalsfill’s extensibility. Essentially,\equalsfill repeats a box containing “=” plus some negative space until it fills the maximum availablehorizontal space. \equalsfill is intended to be used with L A TEX’s \stackrel command, which stacksone mathematical expression (slightly reduced in size) atop another. Hence, “\stackrel{a}{\rightarrow}”produces “ →” a and “X \stackrel{\text{definition}}{\hbox{\equalsfill}} Y” produces “X definition======= Y ”.If all that needs to extend are horizontal and vertical lines—as opposed to repeated symbols such as the“=” in the previous example—L A TEX’s array or tabular environments may suffice. Consider the followingcode (due to a February 1999 comp.text.tex post by Donald Arseneau) for typesetting annuities:\DeclareRobustCommand{\annu}[1]{_{%\def\arraystretch{0}%\setlength\arraycolsep{1pt}%\setlength\arrayrulewidth{.2pt}%\begin{array}[b]{@{}c|}\hline\\[\arraycolsep]%\scriptstyle #1%\end{array}%}}adjust thesetwo settingsOne can then use, e.g., “$A\annu{x:n}$” to produce “A x:n ”.A more complex example of composing accents is the following definition of extensible \overbracket,\underbracket, \overparenthesis, and \underparenthesis symbols, taken from a May 2002comp.text.tex post by Donald Arseneau:\makeatletter\def\overbracket#1{\mathop{\vbox{\ialign{##\crcr\noalign{\kern3\p@}\downbracketfill\crcr\noalign{\kern3\p@\nointerlineskip}$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}\def\underbracket#1{\mathop{\vtop{\ialign{##\crcr$\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\p@\nointerlineskip}\upbracketfill\crcr\noalign{\kern3\p@}}}}\limits}\def\overparenthesis#1{\mathop{\vbox{\ialign{##\crcr\noalign{\kern3\p@}\downparenthfill\crcr\noalign{\kern3\p@\nointerlineskip}$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}\def\underparenthesis#1{\mathop{\vtop{\ialign{##\crcr$\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\p@\nointerlineskip}\upparenthfill\crcr\noalign{\kern3\p@}}}}\limits}\def\downparenthfill{$\m@th\braceld\leaders\vrule\hfill\bracerd$}\def\upparenthfill{$\m@th\bracelu\leaders\vrule\hfill\braceru$}\def\upbracketfill{$\m@th\makesm@sh{\llap{\vrule\@height3\p@\@width.7\p@}}%\leaders\vrule\@height.7\p@\hfill\makesm@sh{\rlap{\vrule\@height3\p@\@width.7\p@}}$}\def\downbracketfill{$\m@th\makesm@sh{\llap{\vrule\@height.7\p@\@depth2.3\p@\@width.7\p@}}%\leaders\vrule\@height.7\p@\hfill\makesm@sh{\rlap{\vrule\@height.7\p@\@depth2.3\p@\@width.7\p@}}$}\makeatotherTable 283 showcases these accents. <strong>The</strong> TEXbook [Knu86a] or another book on TEX primitives is indispensiblefor understanding how the preceding code works. <strong>The</strong> basic idea is that \downparenthfill, \upparenthfill,\downbracketfill, and \upbracketfill do all of the work; they output a left symbol (e.g., \braceld [“{”]for \downparenthfill), a horizontal rule that stretches as wide as possible, and a right symbol (e.g., \bracerd[“{”] for \downparenthfill). \overbracket, \underbracket, \overparenthesis, and \underparenthesis95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!