The wasysym macro package for L^{A}TEX 2ε

Axel Kielhorn

version v2.0 – 2003/10/30

1 Introduction

This file defines the package wasysym which makes some additional characters available that come from the wasy fonts. These fonts were provided by Roland Waldi, Universität Karlsruhe, Germany. Notice that the present macro package requires version 2 (1992) of these fonts. It is not 100 % compatible to the old version 1 from 1989. I have provided no compatibility mode for the old fonts! If some characters come out wrong or are missing, you have to upgrade.

Some of the symbols below are already provided in the T1 or TS1 (textcompanion) encodings, and wasysm serves only to make them available also with the traditional (OT1-encoded) CM-Roman fonts. Other symbols are provided in the AMS symbol fonts, too, and can be accessed using either the amssymb or the

amsfonts package.

2 The symbols

2.1 Various math symbols

The following commands are valid in math mode only:

     \Join ⨝ \Box □ \Diamond ◇ \leadsto ↝ \sqsubset ⊏
     \sqsupset ⊐ \lhd ⊲ \unlhd ⊴ \LHD ◄ \rhd ⊳ \unrhd ⊵
     \RHD ► \apprle ≲ \apprge ≳ \wasypropto ∝ \invneg ⌐ \ocircle ◯
     \logof ⍟

2.2 Integrals

The wasy fonts provide a set of integral sybols, which comprises multiple integrals and surface integrals, too.

• Loading the package with the option [integrals] makes the following integrals available:

         \int ∫ \iint ∬ \iiint ∭ \oint ∮ \oiint ∯

Notice that the style of the \int and \oint is changed, as compared with standard L^{A}TEX, and matches the other integral symbols. This works with or without the amsmath package, and the sequence of loading does not matter.

• If you prefer to stay with the integral symbols provided by L^{A}TEX(and possibly amsmath), but need other symbols from the wasy fonts, load the package with the option [nointegrals]. Doing so will neither alter any existing integral symbols nor add new ones.

• Loading the package without an option or with the option [compat1] makes the following commands for integrals available:

    \varint ∫ \iint ∬ \iiint ∭ \varoint ∮ \oiint ∯

This is compatible with the behavior of wasysym version 1.x, but the package will not cooperate well with amsmath then.

2.3 General symbols

\male ♂ \female ♀ \currency ¤ \phone ☎ \recorder ⌕ \clock 🕒
\lightning ↯ \pointer ⇨ \RIGHTarrow ► \LEFTarrow ◄ \UParrow ▲
\DOWNarrow ▼ \diameter ⌀ \invdiameter ⍉ \varangle ∢ \wasylozenge ⌑
\kreuz ✠ \smiley ☺ \frownie ☹ \blacksmiley ☻ \sun ☼
\checked ✓ \bell 🔔 \ataribox   \cent ¢ \permil ‰ \brokenvert ¦
\wasytherefore ∴ \Bowtie ⨝ \agemO ℧

2.4 Electrical and physical symbols

\AC ∼ \HF ∼ ∼ \VHF ≋ \photon ∼∼∼∼ \gluon

2.5 Polygons and stars

\Square □ \XBox ⊠ \CheckedBox □ ✓ \hexagon ⎔ \varhexagon ⬡
\pentagon ⬠ \octagon    \hexstar ✶ \varhexstar ✶ \davidsstar ✡

2.6 Music notes

\eighthnote ♪ \quarternote ♩ \halfnote 𝅗𝅥 \fullnote 𝅝 \twonotes ♫

2.7 Various circles

\Circle ◯ \CIRCLE ● \Leftcircle    \LEFTCIRCLE ◖ \Rightcircle
\RIGHTCIRCLE ◗ \LEFTcircle ◖ ◯ \RIGHTcircle ◗ ◯ \leftturn ↺
\rightturn ↻

2.8 Phonetic symbols

\dh ð \DH D \thorn þ \Thorn Þ \openo ɔ \inve ə

T1-encoded fonts normally include Eth characters of their own. The wasy package tries to provide them in the OT1 encoding, too. by “faking” them. This should work with the Computer Modern fonts, but may fail with others.

The characters produced by \thorn, \Thorn, \openo and \inve match only the CM-Roman typeface and do not change with the surrounding font family or shape.

2.9 Astronomical symbols

\vernal ♈ \ascnode ☊ \descnode ☋ \fullmoon ◯ \newmoon ●
\leftmoon ☾ \rightmoon ☽ \astrosun ⊙ \mercury ☿ \venus ♀
\earth ♁ \mars ♂ \jupiter ♃ \saturn ♄ \uranus ⛢ \neptune ♆
\pluto ♇

2.10 Astrological symbols and the zodiacal symbols

\aries ♈ \taurus ♉ \gemini ♊ \cancer ♋ \leo ☊ \virgo ♍
\libra ♎ \scorpio ♏ \sagittarius ♐ \capricornus ♑ \aquarius ♒
\pisces ♓ \conjunction ☌ \opposition ☍

2.11 APL symbols

\APLstar ★ \APLlog ⍟ \APLbox ⎕ \APLup △ \APLdown ▽ \APLinput ⍞
\APLcomment ⍝ \APLinv ÷ ⎕ \APLuparrowbox ⍐ \APLdownarrowbox ⍗
\APLleftarrowbox ⍇ \APLrightarrowbox ⍈ \notbackslash \ −
\notslash / − \APLnot∼ \APLvert | \APLcirc ∘ \APLminus −

3 Changes over version 1.x

• The \Dh command has finally been abolished.

• The macros \LEFTcircle, \RIGHTcircle, \CheckedBox and \APLinv start

with \leavevmode now, so that they work properly at the beginning of a paragraph.

• Use of the wasy-style integral symbols can be controlled via the options

[compat1], [integrals] and [nointegrals], with [compat1] being the

default.

• When loaded with the [integrals] or [nointegrals] option, the package will not clash with amsmath.

4 The docstrip modules

The following modules are used in the implementation to direct docstrip in generating the external files:

driver  produce a documentation driver file
package produce a package file
fd  produce a font definition file
fdvar  produce a .fd file for use with scalable fonts

5 The Implementation

5.1 The macro package

With the version 1.x of wasysym, the definitions of the multiple integrals would depend on whether amsmath was loaded additionally, and whether it was loaded before or after wasysym. Redefinition of all integrals so as to exhibit the same style was only possible through the (almost) undocumented macros \newint and \newamsint. Similar problems would also arise with the Fourier math fonts. This behavior was hard to understand and somewhat unfortunate…

Three options are now introduced to control the (re)definiton of the integral macros and a “version 1 compatibility mode”:

1 ⟨∗package⟩

2 \newif\ifwasy@integrals
3 \newif\ifwasy@compatibility
4 \DeclareOption{compat1}{%
5 \wasy@compatibilitytrue\wasy@integralsfalse}%
6 \DeclareOption{integrals}{%
7 \wasy@compatibilityfalse\wasy@integralstrue}%
8 \DeclareOption{nointegrals}{%
9 \wasy@compatibilityfalse\wasy@integralsfalse}%
10 \ExecuteOptions{compat1}
11 \ProcessOptions\relax

• By default or with the option [compat1], version 2 will behave just as ver-

sion 1, i.e. the macros \varint, \iint, \iiint, \varoint and \oiint are

defined at load time.

• With the option [nointegrals], the meaning of any “standard” or AMS integral macros remains unchanged, and the additional wasy integrals cannot be used. Thus, one can use the other wasy symbols without altering the integral signs.

• With the option [integrals], the standard and (if applicable) AMS integral macros are redefined to match the style of the additional wasy integrals. The definitions are deferred until \begin{document}, so that other package cannot interfere. The redefined integral macros will cooperate with the amsmath package, if it is loaded additionally.

• The undocumented commands \newint and \newamsint, too, may turn on the redefinition of the integral commands.

The following two macros serve to actually (re)define the integrals. The first one is to be used if the amsmath package is not loaded:

12 \def\wasy@setup{%
13  \let\int\wasy@int
14  \let\iint\wasy@iint
15  \let\iiint\wasy@iiint
16  \let\oint\wasy@oint
17  \let\oiint\wasy@oiint

18 }

With amsmath, it’s a bit more complicated:

19 \def\wasy@amssetup{%
20  \let\intop\wasy@int
21  \let\iintop\wasy@iint
22  \let\iiintop\wasy@iiint
23  \let\ointop\wasy@oint
24  \let\oiintop\wasy@oiint

25  \def\int{\DOTSI\intop\ilimits@}%
26  \def\iint{\DOTSI\iintop\ilimits@}%
27  \def\iiint{\DOTSI\iiintop\ilimits@}%
28  \def\oint{\DOTSI\ointop\ilimits@}%
29  \def\oiint{\DOTSI\oiintop\ilimits@}%
30  \def\intkern@{\mkern-8mu}

31 }

The old undocumented commands \newint and \newamsint are changed, so as to effect the same as the integrals option and issue a warning message:

32 \newcommand{\newint}{%
33 \PackageWarning{wasysym}{%
34 The command \protect\newint\space is obsolete.
35 \MessageBreak
36 Load the package with the option [integrals] instead}
37 \wasy@integralstrue}
38 \newcommand{\newamsint}{%
39 \PackageWarning{wasysym}{%
40 The command \protect\newamsint\space is obsolete.
41 \MessageBreak
42 Load the package with the option [integrals] instead.}
43 \wasy@integralstrue}

To access the wasy symbols in text mode I have defined them as a new fontfamily. Since I only take single characters but don’t want to write long text this is not an elegant approach. But it works and the symbols scale according to textsize, which is all I promised.

44 \def\wasyfamily{\fontencoding{U}\fontfamily{wasy}\selectfont}
45 \DeclareTextFontCommand{\textwasy}{\wasyfamily}

We declare a wasy math symbol font, too:

46 \DeclareSymbolFont{wasy}{U}{wasy}{m}{n}
47 \SetSymbolFont{wasy}{bold}{U}{wasy}{b}{n}

We declare a new command to generate overlayed symbols:

48 \def\wasy@over#1#2{{\setbox0\hbox{$#2$}\hbox to \wd0{\hss
49  $#1$\hss}\kern-\wd0\box0}}

Defining some special symbols:

50 \def\male       {\mbox{\wasyfamily\char26}}
51 \def\female     {\mbox{\wasyfamily\char25}}
52 \def\currency   {{\wasyfamily\char27}}
53 \def\phone      {{\wasyfamily\char7}}
54 \def\recorder   {{\wasyfamily\char6}}
55 \def\clock      {{\wasyfamily\char28}}
56 \def\lightning  {{\wasyfamily\char18}}
57 \def\pointer    {{\wasyfamily\char9}}
58 \def\RIGHTarrow {{\wasyfamily\char17}}
59 \def\LEFTarrow  {{\wasyfamily\char16}}
60 \def\UParrow    {{\wasyfamily\char75}}
61 \def\DOWNarrow  {{\wasyfamily\char76}}
62 \def\AC         {\mbox{\kern0.5pt\wasyfamily\char58\kern0.5pt}}
63 \def\HF         {\leavevmode
64  \lower0.9pt\hbox to 0pt{\kern0.5pt\wasyfamily\char58\hss}%
65  \raise0.9pt\hbox{\kern0.5pt\wasyfamily\char58\kern0.5pt}}
66 \def\VHF        {\mbox{\wasyfamily\char64}}

67 \def\Square     {\mbox{$\Box$}}
68 \def\CheckedBox {\leavevmode\hbox to 0pt{\wasyfamily\char50\hss}%
69  \hbox{\wasyfamily\char8}}
70 \def\XBox       {\mbox{\wasyfamily\char52}}
71 \def\hexagon    {\mbox{\wasyfamily\char55}}
72 \def\pentagon   {\mbox{\wasyfamily\char68}}
73 \def\octagon    {\mbox{\wasyfamily\char56}}
74 \def\varhexagon {\mbox{\wasyfamily\char57}}
75 \def\hexstar    {\mbox{\wasyfamily\char65}}
76 \def\varhexstar {\mbox{\wasyfamily\char66}}
77 \def\davidsstar {\mbox{\wasyfamily\char67}}
78 \def\diameter   {\mbox{\wasyfamily\char31}}
79 \def\invdiameter{\mbox{\wasyfamily\char21}}
80 \def\varangle   {\mbox{\wasyfamily\char30}}
81 \def\wasylozenge{\mbox{\wasyfamily\char53}}
82 \def\kreuz      {\mbox{\wasyfamily\char54}}
83 \def\smiley     {\mbox{\wasyfamily\char44}}
84 \def\frownie    {\mbox{\wasyfamily\char47}}
85 \def\blacksmiley{\mbox{\wasyfamily\char45}}
86 \def\sun        {\mbox{\wasyfamily\char46}}
87 \def\checked    {\mbox{\wasyfamily\char8}}
88 \def\bell       {\mbox{\wasyfamily\char10}}
89 \def\eighthnote {\mbox{\wasyfamily\char11}}
90 \def\quarternote{\mbox{\wasyfamily\char12}}
91 \def\halfnote   {\mbox{\wasyfamily\char13}}
92 \def\fullnote   {\mbox{\wasyfamily\char14}}
93 \def\twonotes   {\mbox{\wasyfamily\char15}}
94 \def\brokenvert {\mbox{\wasyfamily\char124}}
95 \def\ataribox   {\mbox{\wasyfamily\char109}}
96 \def\wasytherefore{\mbox{\wasyfamily\char5}}
97 \def\Circle     {\mbox{\wasyfamily\char35}}
98 \def\CIRCLE     {\mbox{\wasyfamily\char32}}
99 \def\Leftcircle {\mbox{\wasyfamily\char73}}
100 \def\LEFTCIRCLE {\mbox{\wasyfamily\char71}}
101 \def\Rightcircle{\mbox{\wasyfamily\char74}}
102 \def\RIGHTCIRCLE{\mbox{\wasyfamily\char72}}
103 \def\LEFTcircle {\leavevmode%
104  \hbox to 0pt{\wasyfamily\char71\hss}%
105  \hbox{\wasyfamily\char35}}
106 \def\RIGHTcircle{\leavevmode%
107  \hbox to 0pt{\wasyfamily\char72\hss}%
108  \hbox{\wasyfamily\char35}}

Astronomy:

109 \def\vernal     {\mbox{\wasyfamily\char23}}
110 \def\ascnode    {\mbox{\wasyfamily\char19}}
111 \def\descnode   {\mbox{\wasyfamily\char20}}
112 \let\fullmoon   \Circle
113 \let\newmoon    \CIRCLE
114 \def\leftmoon   {\mbox{\wasyfamily\char36}}
115 \def\rightmoon  {\mbox{\wasyfamily\char37}}
116 \def\astrosun   {\mbox{$\odot$}}
117 \def\mercury    {\mbox{\wasyfamily\char39}}
118 \def\venus      {\leavevmode\raise0.2ex\hbox{\wasyfamily\char25}}
119 \def\earth      {\leavevmode\lower0.3ex\hbox{\wasyfamily\char38}}

120 \def\mars       {\leavevmode\lower0.2ex\hbox{\wasyfamily\char26}}
121 \def\jupiter    {\mbox{\wasyfamily\char88}}
122 \def\saturn     {\mbox{\wasyfamily\char89}}
123 \def\uranus     {\mbox{\wasyfamily\char90}}
124 \def\neptune    {\mbox{\wasyfamily\char91}}
125 \def\pluto      {\mbox{\wasyfamily\char92}}

The zodiac:

126 \let\aries      \vernal
127 \def\taurus     {\mbox{\wasyfamily\char93}}
128 \def\gemini     {\mbox{\wasyfamily\char94}}
129 \def\cancer     {\mbox{\wasyfamily\char95}}
130 \let\leo        \ascnode
131 \def\virgo      {\mbox{\wasyfamily\char96}}
132 \def\libra      {\mbox{\wasyfamily\char97}}
133 \def\scorpio    {\mbox{\wasyfamily\char98}}
134 \def\sagittarius{\mbox{\wasyfamily\char99}}
135 \def\capricornus{\mbox{\wasyfamily\char100}}
136 \def\aquarius   {\mbox{\wasyfamily\char101}}
137 \def\pisces     {\mbox{\wasyfamily\char102}}
138 \def\conjunction{{\wasyfamily\char86}}
139 \def\opposition {{\wasyfamily\char87}}

APL characters:

140 \def\APLstar    {\mbox{\wasyfamily\char69}}
141 \def\APLlog     {\mbox{\wasyfamily\char22}}
142 \def\APLbox     {\mbox{\wasyfamily\char126}}
143 \def\APLup      {\mbox{\wasyfamily\char0}}
144 \def\APLdown    {\mbox{\wasyfamily\char70}}
145 \def\APLinput   {\mbox{\wasyfamily\char125}}
146 \def\APLcomment {\mbox{\wasyfamily\char127}}
147 \def\APLinv     {{\leavevmode\hbox to 0pt{$\div$\hss}\APLbox}}
148 \def\APLuparrowbox{\mbox{\wasyfamily\char110}}
149 \def\APLdownarrowbox{\mbox{\wasyfamily\char111}}
150 \def\APLleftarrowbox{\mbox{\wasyfamily\char112}}
151 \def\APLrightarrowbox{\mbox{\wasyfamily\char113}}
152 \def\notbackslash{\wasy@over{\backslash}{-}}
153 \def\notslash   {\wasy@over{/}{-}}
154 \def\APLminus   {\leavevmode\raise0.7ex\hbox{$-$}}
155 \def\APLnot#1{\wasy@over{\sim}{#1}}
156 \def\APLcirc#1{\wasy@over{\circ}{#1}}
157 \def\APLvert#1{\wasy@over{\vert}{#1}}

Math symbols:

158 \def\Bowtie     {\mbox{\wasyfamily\char49}}
159 \def\leftturn   {\mbox{\wasyfamily\char34}}
160 \def\rightturn  {\mbox{\wasyfamily\char33}}

Particle physics:

161 \def\photon     {\mbox{\wasyfamily\char58\char58\char58\char58}}
162 \def\gluon      {\mbox{\wasyfamily\char81\char80\char80\char80%
163  \char80\char80\char80\char82}}

Miscellaneous:

164 \def\cent       {\mbox{\wasyfamily\char103}}
165 \def\permil     {\mbox{\wasyfamily\char104}}
166 \def\agemO      {{\wasyfamily\char48}}

Phonetic:

167 \def\thorn      {{\wasyfamily\char105}}
168 \def\Thorn      {{\wasyfamily\char106}}
169 \DeclareTextCommand{\dh}{OT1}{{\wasyfamily\char107}}
170 \DeclareTextCommand{\DH}{OT1}{\leavevmode{\rm\setbox0\hbox{D}%
171  \hbox to\wd0{\kern 0.04em\char32\hss D}}}
172 \def\openo      {{\wasyfamily\char108}}
173 \def\inve       {{\wasyfamily\char85}}

Because the lasy symbols are made an error in the format we have to undefine them before we can set them anew with \DeclareMathSymbol. Made the mathgroups more readable and changed \lhd and friends to be binary operators as in latexsym.

174 \let\mho\undefined
175 \let\sqsupset\undefined \let\Join\undefined
176 \let\lhd\undefined      \let\Box\undefined
177 \let\unlhd\undefined    \let\Diamond\undefined
178 \let\rhd\undefined      \let\leadsto\undefined
179 \let\unrhd\undefined    \let\sqsubset\undefined
180 \DeclareMathSymbol\mho     {\mathord}{wasy}{"30}
181 \DeclareMathSymbol\Join    {\mathrel}{wasy}{"31}
182 \DeclareMathSymbol\Box     {\mathord}{wasy}{"32}
183 \DeclareMathSymbol\Diamond {\mathord}{wasy}{"33}
184 \DeclareMathSymbol\leadsto {\mathrel}{wasy}{"3B}
185 \DeclareMathSymbol\sqsubset{\mathrel}{wasy}{"3C}
186 \DeclareMathSymbol\sqsupset{\mathrel}{wasy}{"3D}
187 \DeclareMathSymbol\lhd     {\mathbin}{wasy}{"01}
188 \DeclareMathSymbol\unlhd   {\mathbin}{wasy}{"02}
189 \DeclareMathSymbol\LHD     {\mathbin}{wasy}{"10}
190 \DeclareMathSymbol\rhd     {\mathbin}{wasy}{"03}
191 \DeclareMathSymbol\unrhd   {\mathbin}{wasy}{"04}
192 \DeclareMathSymbol\RHD     {\mathbin}{wasy}{"11}
193 \DeclareMathSymbol\apprle  {\mathrel}{wasy}{"3E}
194 \DeclareMathSymbol\apprge  {\mathrel}{wasy}{"3F}
195 \DeclareMathSymbol\wasypropto   {\mathrel}{wasy}{"1D}
196 \DeclareMathSymbol\invneg  {\mathrel}{wasy}{"18}
197 \DeclareMathSymbol\ocircle {\mathbin}{wasy}{"23}
198 \DeclareMathSymbol\logof   {\mathrel}{wasy}{"16}

Initially the integrals are defined with “harmless” names. i.e., no existing macros are overwritten:

199 \DeclareMathSymbol\wasy@int  {\mathop}{wasy}{"72}
200 \DeclareMathSymbol\wasy@iint {\mathop}{wasy}{"73}
201 \DeclareMathSymbol\wasy@iiint{\mathop}{wasy}{"74}
202 \DeclareMathSymbol\wasy@oint {\mathop}{wasy}{"75}
203 \DeclareMathSymbol\wasy@oiint{\mathop}{wasy}{"76}

Now let’s actually set up the integrals. In “compatibility mode” they are defined immediately at load time:

204 \ifwasy@compatibility
205 \let\varint\wasy@int
206 \let\iint\wasy@iint
207 \let\iiint\wasy@iiint
208 \let\varoint\wasy@oint
209 \let\oiint\wasy@oiint

210 \fi

If the option [integrals] was selected, the related definitions are executed only

 at \begin{document}. Notice that the commands \newint or \newamsint may

appear in the preamble and turn on the the redefinition of the integral macros.

211 \AtBeginDocument{%
212 \ifwasy@integrals
213  \@ifpackageloaded{amsmath}{\wasy@amssetup}{\wasy@setup}
214 \fi

215 } 216 ⟨/package⟩

5.2 The font definition files

The declarations, that have to go into the corresponding .fd files:

217 ⟨∗fd⟩

218 \DeclareFontFamily{U}{wasy}{}
219 \DeclareFontShape{U}{wasy}{m}{n}{ <5> <6> <7> <8> <9> gen * wasy
220  <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>wasy10  }{}
221 \DeclareFontShape{U}{wasy}{b}{n}{ <-10> sub * wasy/m/n
222 <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88>wasyb10 }{}
223 \DeclareFontShape{U}{wasy}{bx}{n}{ <-> sub * wasy/b/n}{}

224 ⟨/fd⟩ 225 ⟨∗fdvar⟩

226 \DeclareFontFamily{U}{wasy}{}
227 \DeclareFontShape{U}{wasy}{m}{n}{%
228 <5-6> wasy5
229 <6-7> wasy6
230 <7-8> wasy7
231 <8-9> wasy8
232 <9-10> wasy9
233 <10-> wasy10}{}
234 \DeclareFontShape{U}{wasy}{b}{n}{ <-10> sub * wasy/m/n
235 <10-> wasyb10 }{}
236 \DeclareFontShape{U}{wasy}{bx}{n}{ <-> sub * wasy/b/n}{}

237 ⟨/fdvar⟩

The next line goes into all files and in addition prevents docstrip from adding any further code from the main source file (such as a character table).

238 \endinput