14.03.2013 Views

symbols-a4

symbols-a4

symbols-a4

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.

In the preceding code, note the \ooalign call’s use of \hfil to horizontally center a minus sign (“−”) and<br />

a \circ (“◦”).<br />

As another example of \ooalign, consider the following code (due to Enrico Gregorio in a June 2007 post<br />

to comp.text.tex) that overlaps a \ni (“∋”) and two minus signs (“ −”) to produce “∋−”, an obscure variation<br />

on the infrequently used “3” symbol for “such that”discussed on page 103:<br />

\newcommand{\suchthat}{%<br />

\mathrel{\ooalign{$\ni$\cr\kern-1pt$-$\kern-6.5pt$-$}}}<br />

The slashed package, although originally designed for producing Feynman slashed-character notation, in<br />

fact facilitates the production of arbitrary overlapped <strong>symbols</strong>. The default behavior is to overwrite a given<br />

character with “/”. For example, \slashed{D} produces “ /D”. However, the \declareslashed command<br />

provides the flexibility to specify the mathematical context of the composite character (operator, relation,<br />

punctuation, etc., as will be discussed in Section 8.4), the overlapping symbol, horizontal and vertical adjustments<br />

in symbol-relative units, and the character to be overlapped. Consider, for example, the symbol for<br />

reduced quadrupole moment (“-I”). This can be declared as follows:<br />

\newcommand{\rqm}{{%<br />

\declareslashed{}{\text{-}}{0.04}{0}{I}\slashed{I}}}<br />

\declareslashed{·}{·}{·}{·}{I} affects the meaning of all subsequent \slashed{I} commands in the same<br />

scope. The preceding definition of \rqm therefore uses an extra set of curly braces to limit that scope to<br />

a single \slashed{I}. In addition, \rqm uses amstext’s \text macro (described on the next page) to make<br />

\declareslashed use a text-mode hyphen (“-”) instead of a math-mode minus sign (“−”) and to ensure that<br />

the hyphen scales properly in size in subscripts and superscripts. See slashed’s documentation (located in<br />

slashed.sty itself) for a detailed usage description of the \slashed and \declareslashed commands.<br />

Somewhat simpler than slashed is the centernot package. centernot provides a single command, \centernot,<br />

which, like \not, puts a slash over the subsequent mathematical symbol. However, instead of putting the slash<br />

at a fixed location, \centernot centers the slash over its argument. \centernot might be used, for example,<br />

to create a “does not imply” symbol:<br />

=⇒ \not\Longrightarrow<br />

vs.<br />

=⇒ \centernot\Longrightarrow<br />

See the centernot documentation for more information.<br />

Making new <strong>symbols</strong> work in superscripts and subscripts<br />

To make composite <strong>symbols</strong> work properly within subscripts and superscripts, you may need to use TEX’s<br />

\mathchoice primitive. \mathchoice evaluates one of four expressions, based on whether the current math<br />

style is display, text, script, or scriptscript. (See The TEXbook [Knu86a] for a more complete description.)<br />

For example, the following L ATEX code—posted to comp.text.tex by Torsten Bronger—composes<br />

a sub/superscriptable “⊥⊤” symbol out of \top and \bot (“⊤” and “⊥”):<br />

\def\topbotatom#1{\hbox{\hbox to 0pt{$#1\bot$\hss}$#1\top$}}<br />

\newcommand*{\topbot}{\mathrel{\mathchoice{\topbotatom\displaystyle}<br />

{\topbotatom\textstyle}<br />

{\topbotatom\scriptstyle}<br />

{\topbotatom\scriptscriptstyle}}}<br />

The following is another example that uses \mathchoice to construct <strong>symbols</strong> in different math modes.<br />

The code defines a principal value integral symbol, which is an integral sign with a line through it.<br />

\def\Xint#1{\mathchoice<br />

{\XXint\displaystyle\textstyle{#1}}%<br />

{\XXint\textstyle\scriptstyle{#1}}%<br />

{\XXint\scriptstyle\scriptscriptstyle{#1}}%<br />

{\XXint\scriptscriptstyle\scriptscriptstyle{#1}}%<br />

105

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

Saved successfully!

Ooh no, something went wrong!