14.03.2013 Views

symbols-a4

symbols-a4

symbols-a4

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

\makeatletter<br />

\def\moverlay{\mathpalette\mov@rlay}<br />

\def\mov@rlay#1#2{\leavevmode\vtop{%<br />

\baselineskip\z@skip \lineskiplimit-\maxdimen<br />

\ialign{\hfil$#1##$\hfil\cr#2\crcr}}}<br />

\makeatother<br />

The \makeatletter and \makeatother commands are needed to coerce L ATEX into accepting “@” as<br />

part of a macro name. \moverlay takes a list of <strong>symbols</strong> separated by \cr (TEX’s equivalent of<br />

L ATEX’s \\). For example, the \topbot command defined on page 105 could have been expressed as<br />

“\moverlay{\top\cr\bot}” and the \neswarrow command defined on the previous page could have been<br />

expressed as “\moverlay{\nearrow\cr\swarrow}”.<br />

The basic concept behind \moverlay’s implementation is that \moverlay typesets the given <strong>symbols</strong> in a<br />

table that utilizes a zero \baselineskip. This causes every row to be typeset at the same vertical position.<br />

See The TEXbook [Knu86a] for explanations of the TEX primitives used by \moverlay.<br />

Modifying L ATEX-generated <strong>symbols</strong><br />

Oftentimes, <strong>symbols</strong> composed in the L ATEX 2ε source code can be modified with minimal effort to produce<br />

useful variations. For example, fontdef.dtx composes the \ddots symbol (see Table 189 on page 63) out of<br />

three periods, raised 7 pt., 4 pt., and 1 pt., respectively:<br />

\def\ddots{\mathinner{\mkern1mu\raise7\p@<br />

\vbox{\kern7\p@\hbox{.}}\mkern2mu<br />

\raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}}<br />

\p@ is a L ATEX 2ε shortcut for “pt” or “1.0pt”. The remaining commands are defined in The<br />

TEXbook [Knu86a]. To draw a version of \ddots with the dots going along the opposite diagonal, we merely<br />

have to reorder the \raise7\p@, \raise4\p@, and \raise\p@:<br />

\makeatletter<br />

\def\revddots{\mathinner{\mkern1mu\raise\p@<br />

\vbox{\kern7\p@\hbox{.}}\mkern2mu<br />

\raise4\p@\hbox{.}\mkern2mu\raise7\p@\hbox{.}\mkern1mu}}<br />

\makeatother<br />

\revddots is essentially identical to the mathdots package’s \iddots command or the yhmath package’s \adots<br />

command.<br />

Producing complex accents<br />

Accents are a special case of combining existing <strong>symbols</strong> to make new <strong>symbols</strong>. While various tables in<br />

this document show how to add an accent to an existing symbol, some applications, such as transliterations<br />

from non-Latin alphabets, require multiple accents per character. For instance, the creator of pdfTEX<br />

writes his name as “Hàn Th ´ ê Thành”. The dblaccnt package enables LATEX to stack accents, as in “H\‘an<br />

Th\’{\^e} Th\‘anh” (albeit not in the OT1 font encoding). In addition, the wsuipa package defines \diatop<br />

and \diaunder macros for putting one or more diacritics or accents above or below a given character. For<br />

example, \diaunder[{\diatop[\’|\=]}|\textsubdot{r}] produces “´¯r ”. See the wsuipa documentation for<br />

more information.<br />

˙<br />

The accents package facilitates the fabrication of accents in math mode. Its \accentset command enables<br />

any character to be used as an accent. For instance, \accentset{\star}{f} produces “ ⋆<br />

f ” and<br />

\accentset{e}{X} produces “ e<br />

X”. \underaccent does the same thing, but places the accent beneath the<br />

character. This enables constructs like \underaccent{\tilde}{V}, which produces “ V ”. accents provides<br />

other accent-related features as well; see the documentation for more information.<br />

˜<br />

Creating extensible <strong>symbols</strong><br />

A relatively simple example of creating extensible <strong>symbols</strong> stems from a comp.text.tex post by Donald<br />

Arseneau (June 2003). The following code defines an equals sign that extends as far to the right as possible,<br />

just like L ATEX’s \hrulefill command:<br />

107

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

Saved successfully!

Ooh no, something went wrong!