Debian Codegraph @

texmf-dist/source/latex/euler/euler.dtx

raw
1 % \iffalse
2 %
3 %% File `euler.dtx'.
4 %% Copyright (C) 1992 Frank Jensen. All rights reserved.
5 %% Copyright (C) 1993--1995 Frank Jensen and Frank Mittelbach.
6 %% All rights reserved.
7 %
8 % Please send error reports and suggestions for improvements to:
9 %
10 % Frank Jensen
11 % Aalborg University
12 % DK-9220 Aalborg \O
13 % Denmark
14 % Internet: <[email protected]>
15 %
16 % \fi
17
18 \def\fileversion{v2.5}
19 \def\filedate{1995/03/05}
20
21 % \CheckSum{606}
22 %% \CharacterTable
23 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
24 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
25 %% Digits \0\1\2\3\4\5\6\7\8\9
26 %% Exclamation \! Double quote \" Hash (number) \#
27 %% Dollar \$ Percent \% Ampersand \&
28 %% Acute accent \' Left paren \( Right paren \)
29 %% Asterisk \* Plus \+ Comma \,
30 %% Minus \- Point \. Solidus \/
31 %% Colon \: Semicolon \; Less than \<
32 %% Equals \= Greater than \> Question mark \?
33 %% Commercial at \@ Left bracket \[ Backslash \\
34 %% Right bracket \] Circumflex \^ Underscore \_
35 %% Grave accent \` Left brace \{ Vertical bar \|
36 %% Right brace \} Tilde \~}
37 %
38 % \iffalse
39 %<*driver>
40 \documentclass{ltxdoc}
41 \begin{document}
42 \DocInput{euler.dtx}
43 \end{document}
44 %</driver>
45 % \fi
46 %
47 % \newcommand\beton{\texttt{beton}}
48 % \newcommand\euler{\texttt{euler}}
49 % \newcommand\MF{Metafont}
50 %
51 % \title{The \euler\ package}
52 % \author{Frank Jensen\thanks{Updates by Frank Mittelbach.}}
53 % \date{\filedate}
54 %
55 % \maketitle
56 %
57 % \section{Introduction}
58 %
59 % The \euler\ package provides a setup for using the AMS Euler family
60 % of fonts for math in \LaTeX\ documents. The AMS Euler family was
61 % designed by Hermann Zapf, commissioned by the American Mathematical
62 % Society. ``The underlying philosophy of Zapf's Euler design was to
63 % capture the flavor of mathematics as it might be written by a
64 % mathematician with excellent handwriting.''~\cite{concrete-tug}
65 %
66 % The \euler\ package is based on Knuth's macros for the book
67 % ``Concrete Mathematics''~\cite{concrete}. Knuth's macros can be
68 % found through anonymous ftp to \texttt{labrea.\allowbreak
69 % stanford.edu}: look for the file \texttt{gkpmac.tex} in directory
70 % \texttt{pub/tex/local/lib}. The Euler fonts can be found through
71 % anonymous ftp to \texttt{e-math.ams.org}: look in directory
72 % \texttt{pub/tex/amsfonts}.
73 %
74 % The purpose of the \euler\ package is to provide the math part of
75 % the look of~\cite{concrete}. The other part (text fonts) is
76 % provided by the \beton\ package. The reason for creating two
77 % packages is to make it easy to use the Euler math fonts together
78 % with other text fonts (in particular, it appears that the Euler
79 % fonts match many of the popular PostScript fonts pretty well).
80 %
81 % Basically, the \euler\ package provides the same setup (the same
82 % definitions, math codes, etc.)\ as \texttt{gkpmac.tex} with respect
83 % to the Euler fonts. However, Knuth~\cite{concrete-tug} admits that
84 % the macros were written for one specific project, namely to typeset
85 % the ``Concrete Mathematics'' book~\cite{concrete}. So, the \euler\
86 % package actually does a little more than \texttt{gkpmac.tex}: for
87 % example, some `exotic' symbols, present in CM math italic, are
88 % missing from the Euler fonts; the \euler\ package takes care of this
89 % (whereas \texttt{gkpmac.tex} does not).
90 %
91 % The use of the \euler\ package requires a lot of care when entering
92 % the manuscript, since the package will cause, e.g., math numerals to
93 % come from the Euler Roman fonts; these numerals are easily
94 % distinguished from the normal text numerals. This implies that
95 % sloppy typing is clearly exposed: imagine how
96 % ``|$x$ is either 1 or $-1$|'' will appear when typeset! In general,
97 % the typist will in each case have to decide whether an input
98 % fragment is a math or a non-math entity. This holds true even for
99 % the tiniest details, such as punctuation characters (parentheses,
100 % colons, semicolons, commas, and periods).
101 %
102 % Finally, a few words about the technical quality of the fonts (there
103 % are no doubts about their artistic quality): The fonts are not tuned
104 % for low resolution rendering: I recommend at least 600dpi. The
105 % fonts employ none of the tuning machinery of CM: e.g., they do not
106 % use the `blacker' parameter specified in each \MF\ mode definition,
107 % indicating that they might look somewhat light on printers that
108 % normally require a large `blacker' value.
109 %
110 % \section{What the \euler\ package provides}
111 %
112 % The \euler\ package defines two new math alphabet identifiers,
113 % |\mathscr| (Euler Script, uppercase letters only) and |\mathfrak|
114 % (Euler Fraktur, both lowercase and uppercase letters).
115 %
116 % By default, the original meaning of |\mathcal| is preserved, but if
117 % the \euler\ package is loaded with the \texttt{mathcal} option,
118 % |\mathcal| will produce Euler Script letters instead of the usual
119 % Computer Modern calligraphic letters.
120 %
121 % Also, by default, the \euler\ package does not redefine the
122 % |\mathbf| math alphabet identifier; it will still produce bold CM
123 % letters and digits. However, loading the \euler\ package with the
124 % \texttt{mathbf} option will cause |\mathbf| to produce bold Euler
125 % Roman letters and digits. Another way to get bold symbols is to use
126 % the |\boldsymbol| command provided by the \texttt{amsbsy} package
127 % (part of AMS-\LaTeX).
128 %
129 % Some users do not like the |\hat| accent glyph present in the Euler
130 % fonts (the \euler\ package uses this accent glyph be default). To
131 % use the |\hat| accent glyph from the text font instead, load the
132 % \euler\ package with the \texttt{text-hat-accent} option.
133 %
134 % In \cite{concrete}, the space around relations in displays was
135 % increased (from `5mu plus 5mu' to `10mu minus 3mu'). The \euler\
136 % package does not change this space, since this is (for most cases)
137 % controlled by the \LaTeX\ \texttt{eqnarray} environment. Also,
138 % in~\cite{concrete}, displays are left justified with a suitable
139 % indentation; we leave such matters to the general layout.
140 %
141 % \StopEventually {
142 % \begin{thebibliography}{1}
143 % \bibitem{concrete}
144 % \textsc{R. L. Graham}, \textsc{D. E. Knuth}, and
145 % \textsc{O. Patashnik}.
146 % \newblock \textit{Concrete Mathematics}.
147 % \newblock Addison-Wesley, 1989.
148 % \bibitem{concrete-tug}
149 % \textsc{D. E. Knuth}.
150 % \newblock Typesetting Concrete Mathematics.
151 % \newblock \textsl{TUGboat} 10(1):31--36, 1989.
152 % \end{thebibliography}
153 % }
154 %
155 % \section{Hello world}
156 %
157 % First, we announce the package.
158 % \begin{macrocode}
159 %<*package>
160 \NeedsTeXFormat{LaTeX2e}[1994/12/01]
161 \ProvidesPackage{euler}[\filedate\space\fileversion]
162 \typeout{Package: `euler' \fileversion\space <\filedate> (FJ and FMi)}
163 % \end{macrocode}
164 %
165 % \section{Font and other definitions}
166 %
167 % The AMS Euler family consists of: Euler Roman (medium and bold),
168 % Euler Fraktur (medium and bold), Euler Script (medium and bold), and
169 % Euler Extension (medium only). The \texttt{.fd} files for these
170 % fonts are defined in the \texttt{amsfonts.fdd} file (part of the
171 % AMSFonts distribution).
172 %
173 % \subsection{Euler Roman}
174 %
175 % The Euler Roman fonts replace the Computer Modern Math Italic fonts,
176 % located in the `letters' math symbol font:
177 % \begin{macrocode}
178 \DeclareSymbolFont{letters}{U}{eur}{m}{n}
179 \SetSymbolFont{letters}{bold}{U}{eur}{b}{n}
180 % \end{macrocode}
181 %
182 % In math mode, digits should come from the Euler Roman fonts. As in
183 % standard \LaTeX, we assign the type |\mathalpha| to the digits which
184 % means that they will vary with math alphabets. One of the reasons
185 % for this is that footnote numbers are set in math mode, and we want
186 % these numbers to come from the text font; this is accomplished by
187 % setting the \TeX\ primitive |\fam| to zero. (See
188 % Section~\ref{footnotes} below.)
189 % \begin{macrocode}
190 \DeclareMathSymbol{0}\mathalpha{letters}{"30}
191 \DeclareMathSymbol{1}\mathalpha{letters}{"31}
192 \DeclareMathSymbol{2}\mathalpha{letters}{"32}
193 \DeclareMathSymbol{3}\mathalpha{letters}{"33}
194 \DeclareMathSymbol{4}\mathalpha{letters}{"34}
195 \DeclareMathSymbol{5}\mathalpha{letters}{"35}
196 \DeclareMathSymbol{6}\mathalpha{letters}{"36}
197 \DeclareMathSymbol{7}\mathalpha{letters}{"37}
198 \DeclareMathSymbol{8}\mathalpha{letters}{"38}
199 \DeclareMathSymbol{9}\mathalpha{letters}{"39}
200 % \end{macrocode}
201 % The uppercase greek letters are also taken from the Euler Roman
202 % fonts. We make them ordinary symbols (i.e., of type |\mathord|) as
203 % opposed to \texttt{plain.tex}, \texttt{gkpmac.tex}, and standard
204 % \LaTeX, which make them vary according to |\fam|.
205 % \begin{macrocode}
206 \DeclareMathSymbol\Gamma \mathord{letters}{"00}
207 \DeclareMathSymbol\Delta \mathord{letters}{"01}
208 \DeclareMathSymbol\Theta \mathord{letters}{"02}
209 \DeclareMathSymbol\Lambda \mathord{letters}{"03}
210 \DeclareMathSymbol\Xi \mathord{letters}{"04}
211 \DeclareMathSymbol\Pi \mathord{letters}{"05}
212 \DeclareMathSymbol\Sigma \mathord{letters}{"06}
213 \DeclareMathSymbol\Upsilon\mathord{letters}{"07}
214 \DeclareMathSymbol\Phi \mathord{letters}{"08}
215 \DeclareMathSymbol\Psi \mathord{letters}{"09}
216 \DeclareMathSymbol\Omega \mathord{letters}{"0A}
217 % \end{macrocode}
218 % Euler doesn't have the special variants of |\sigma| and |\rho|:
219 % \begin{macrocode}
220 \let\varsigma=\sigma
221 \let\varrho=\rho
222 % \end{macrocode}
223 %
224 % \begin{macro}{\mathbf}
225 % If the \euler\ package is loaded with the \texttt{mathbf}
226 % option, |\mathbf| should produce bold Euler Roman letters and
227 % digits.
228 % \begin{macrocode}
229 \DeclareOption{mathbf}
230 {\AtBeginDocument{\DeclareMathAlphabet\mathbf{U}{eur}{b}{n}}}
231 % \end{macrocode}
232 % \end{macro}
233 % Note the use of |\AtBeginDocument|; it ensures that the redefinition
234 % overrides the default settings (Section~\ref{text-fonts}).
235 %
236 % \subsection{Euler Fraktur}
237 %
238 % \begin{macro}{\mathfrak}
239 % The Euler Fraktur fonts get their own math symbol font. We define a
240 % math alphabet identifier---|\mathfrak|---to access this symbol font.
241 % For compatibility with previous versions of the \euler\
242 % package, we define |\frak| as an alias for |\mathfrak| (the
243 % \texttt{amsfonts} package also provides this alias).
244 % \begin{macrocode}
245 \DeclareSymbolFont{EulerFraktur}{U}{euf}{m}{n}
246 \SetSymbolFont{EulerFraktur}{bold}{U}{euf}{b}{n}
247 \DeclareSymbolFontAlphabet\mathfrak{EulerFraktur}
248 \@ifpackageloaded{amsfonts}{}{\newcommand\frak{\mathfrak}}
249 % \end{macrocode}
250 % \end{macro}
251 %
252 % The following characters come from the Euler Fraktur symbol font (as
253 % defined in \texttt{gkpmac.tex}):
254 % \begin{macrocode}
255 \DeclareMathSymbol{!}\mathord {EulerFraktur}{"21}
256 \DeclareMathSymbol{(}\mathopen {EulerFraktur}{"28}
257 \DeclareMathSymbol{)}\mathclose{EulerFraktur}{"29}
258 \DeclareMathSymbol{+}\mathbin {EulerFraktur}{"2B}
259 \DeclareMathSymbol{-}\mathbin {EulerFraktur}{"2D}
260 \DeclareMathSymbol{=}\mathrel {EulerFraktur}{"3D}
261 \DeclareMathSymbol{[}\mathopen {EulerFraktur}{"5B}
262 \DeclareMathSymbol{]}\mathclose{EulerFraktur}{"5D}
263 % \end{macrocode}
264 % There is a curious detail here: The type of `!' is |\mathclose| in
265 % \texttt{plain.tex} (and standard \LaTeX) but |\mathord| in
266 % \texttt{gkpmac.tex}. The reason for this is probably that one
267 % should not use Euler punctuation characters as part of the
268 % text,\footnote{In particular, one should watch out for punctuation
269 % characters in displays: Is, e.g., an exclamation point part of a
270 % formula or part of the text? (With Computer Modern, it didn't
271 % really matter, but it does matter with Euler!)} and punctuation
272 % characters in math are usually operators. E.g., in CSP
273 % (Communicating Sequential Processes), `!'~denotes an output
274 % operation, a tightly binding binary operator; there is usually no
275 % space around this operator (to indicate the high precedence).
276 %
277 % The Euler Fraktur symbol font contains more punctuation characters
278 % than defined above. We want to use these characters as they look
279 % better when they appear in math formulas (there are some strange
280 % looking formulas in~\cite{concrete}). Even if one may argue that,
281 % e.g., semicolon is most often used in the text sense (in displays),
282 % it is more consistent and easier to remember if everything in math
283 % mode is Euler.
284 % \begin{macrocode}
285 \DeclareMathSymbol{"}\mathord {EulerFraktur}{"7D}
286 \DeclareMathSymbol{&}\mathord {EulerFraktur}{"26}
287 \DeclareMathSymbol{:}\mathrel {EulerFraktur}{"3A}
288 \DeclareMathSymbol{;}\mathpunct{EulerFraktur}{"3B}
289 \DeclareMathSymbol{?}\mathord {EulerFraktur}{"3F}
290 \DeclareMathSymbol{^}\mathord {EulerFraktur}{"5E}
291 \DeclareMathSymbol{`}\mathord {EulerFraktur}{"12}
292 % \end{macrocode}
293 % Here, we also changed the type of `?' to |\mathord| to be consistent
294 % with the type of~`!'. Regarding the math codes assigned by
295 % \texttt{INITEX}: The Euler fonts do not have the glyphs for |\#|,
296 % |\$|, |\%|, and \texttt{@}, so these glyphs are still taken from the
297 % text fonts. Note also that we do not set the math code for the
298 % other quote character: it is active in math mode (code
299 % \texttt{"8000}); it produces primes (and should continue to do so).
300 % \begin{macrocode}
301 \DeclareMathDelimiter{(}{EulerFraktur}{"28}{largesymbols}{"00}
302 \DeclareMathDelimiter{)}{EulerFraktur}{"29}{largesymbols}{"01}
303 \DeclareMathDelimiter{[}{EulerFraktur}{"5B}{largesymbols}{"02}
304 \DeclareMathDelimiter{]}{EulerFraktur}{"5D}{largesymbols}{"03}
305 % \end{macrocode}
306 %
307 % \begin{macro}{\oldstylenums}
308 % \begin{macro}{\TextOldstyle}\begin{macro}{\MathOldstyle}
309 % We provide a new definition of the |\oldstylenums| macro: this
310 % definition allows us to modify the generation of non-aligning (aka
311 % ``oldstyle'') numerals in text and in math separately, using two
312 % hooks, |\TextOldstyle| and |\MathOldstyle|.
313 % \begin{macrocode}
314 \DeclareRobustCommand\oldstylenums[1]%
315 {\begingroup
316 \spaceskip\fontdimen\tw@\font
317 \TextOldstyle \MathOldstyle #1%
318 \endgroup}
319 % \end{macrocode}
320 % In math, the |\oldstylenums| macro should produce Euler oldstyle
321 % digits (located in the Euler Fraktur fonts):
322 % \begin{macrocode}
323 \def\MathOldstyle{\mathgroup\symEulerFraktur}
324 % \end{macrocode}
325 % By default, oldstyle digits in text come from the Computer Modern
326 % fonts:
327 % \begin{macrocode}
328 \providecommand\TextOldstyle{\usefont{OML}{cmm}\f@series{it}}
329 % \end{macrocode}
330 % \end{macro}\end{macro}\end{macro}
331 %
332 % \subsection{Euler Script}
333 %
334 % \begin{macro}{\mathscr}
335 % Like the Euler Fraktur fonts, the Euler Script fonts also get their
336 % own symbol font. We define a math alphabet
337 % identifier---|\mathscr|---to access this symbol font. For
338 % compatibility with previous versions of the \euler\ package,
339 % we define |\scr| as an alias for |\mathscr|.
340 % \begin{macrocode}
341 \DeclareSymbolFont{EulerScript}{U}{eus}{m}{n}
342 \SetSymbolFont{EulerScript}{bold}{U}{eus}{b}{n}
343 \DeclareSymbolFontAlphabet\mathscr{EulerScript}
344 \newcommand\scr{\mathscr}
345 % \end{macrocode}
346 % \end{macro}
347 %
348 % \begin{macro}{\mathcal}
349 % If the \euler\ package is loaded with the \texttt{mathcal}
350 % option, |\mathcal| should produce Euler Script letters.
351 % \begin{macrocode}
352 \DeclareOption{mathcal}{\renewcommand\mathcal{\mathscr}}
353 % \end{macrocode}
354 % \end{macro}
355 %
356 % The following is equivalent to the definitions in \texttt{gkpmac.tex}
357 % concerning the Euler Script fonts:
358 % \begin{macrocode}
359 \DeclareMathSymbol\aleph\mathord{EulerScript}{"40}
360 %\DeclareMathSymbol\equiv\mathrel{EulerScript}{"11}
361 %\let\cong=\equiv % lowres bars weren't spaced right
362 %\DeclareMathSymbol\leq \mathrel{EulerScript}{"14}
363 %\let\le=\leq % seems to have been eliminated
364 %\DeclareMathSymbol\geq \mathrel{EulerScript}{"15}
365 %\let\ge=\geq % ditto
366 \DeclareMathSymbol\Re \mathord{EulerScript}{"3C}
367 \DeclareMathSymbol\Im \mathord{EulerScript}{"3D}
368 % \end{macrocode}
369 % Knuth used a slightly different version of the Euler Script fonts
370 % that had special `$\le$' and `$\ge$' glyphs. Actually, the source
371 % for the AMS Euler Script medium (but not the bold) font also
372 % contains these glyphs; however, they are commented out (no
373 % explanation is given). The definitions of |\equiv| and |\cong| are
374 % also commented out in \texttt{gkpmac.tex} (with the reason as given
375 % above, i.e., problems with low resolution rendering).
376 % \begin{macrocode}
377 \DeclareMathDelimiter\vert
378 \mathord{EulerScript}{"6A}{largesymbols}{"0C}
379 \DeclareMathDelimiter\backslash
380 \mathord{EulerScript}{"6E}{largesymbols}{"0F}
381 % \end{macrocode}
382 %
383 % The Euler Script fonts constitute a partial replacement for the
384 % Computer Modern `symbols' math symbol fonts. (None of the remaining
385 % definitions in this section were included in \texttt{gkpmac.tex}.)
386 % \begin{macrocode}
387 %\DeclareMathSymbol{-}\mathbin{EulerScript}{"00} % already done
388 \DeclareMathSymbol{|}\mathord{EulerScript}{"6A}
389 \DeclareMathDelimiter{|}{EulerScript}{"6A}{largesymbols}{"0C}
390 % \end{macrocode}
391 % (The minus signs in the Euler Fraktur and Script fonts are
392 % identical, i.e., the sources are identical.)
393 % \begin{macrocode}
394 \DeclareMathSymbol\neg \mathord{EulerScript}{"3A}
395 \let\lnot=\neg
396 \DeclareMathSymbol\wedge \mathbin{EulerScript}{"5E}
397 \let\land=\wedge
398 \DeclareMathSymbol\vee \mathbin{EulerScript}{"5F}
399 \let\lor=\vee
400 \DeclareMathSymbol\setminus\mathbin{EulerScript}{"6E}
401 \DeclareMathSymbol\sim \mathrel{EulerScript}{"18}
402 \DeclareMathSymbol\mid \mathrel{EulerScript}{"6A}
403 \DeclareMathDelimiter\arrowvert
404 \mathord{EulerScript}{"6A}{largesymbols}{"3C} % ???
405 % \end{macrocode}
406 % (There are no |\approx| or |\simeq| to go with |\sim|.) In Plain
407 % \TeX\null, the characters |{|, |\|, and~|}| are assigned math codes
408 % (and |\| is also given a delimiter code); these are the only visible
409 % ASCII (7-bit) characters that we don't give a math code (we don't
410 % assign math codes to any of the invisible ASCII characters).
411 %
412 % The Euler Script fonts also contain a section sign~(\S):
413 % \begin{macrocode}
414 \DeclareMathSymbol\mathsection\mathord{EulerScript}{"78}
415 % \end{macrocode}
416 %
417 % \subsection{Euler Extension}
418 %
419 % We allocate a new symbol font group for this font:
420 % \begin{macrocode}
421 \DeclareSymbolFont{EulerExtension}{U}{euex}{m}{n}
422 % \end{macrocode}
423 % This font contains some alternative versions of some Computer Modern
424 % symbols. The \texttt{amsmath} package (part of AMS-\LaTeX)
425 % redefines the |\coprod|, |\prod|, and |\sum| symbols; to make the
426 % \euler\ package work correctly with the \texttt{amsmath}
427 % package, we need to take different actions depending on whether the
428 % \texttt{amsmath} package has been loaded before the \euler\
429 % package or not. Note: This will \emph{not} work with the
430 % \texttt{amstex} package.
431 % \begin{macrocode}
432 \@ifpackageloaded{amsmath}
433 {\DeclareMathSymbol\coprod@\mathop{EulerExtension}{"60}%
434 \DeclareMathSymbol\prod@ \mathop{EulerExtension}{"51}%
435 \DeclareMathSymbol\sum@ \mathop{EulerExtension}{"50}}
436 {\DeclareMathSymbol\coprod \mathop{EulerExtension}{"60}%
437 \DeclareMathSymbol\prod \mathop{EulerExtension}{"51}%
438 \DeclareMathSymbol\sum \mathop{EulerExtension}{"50}}
439 % \end{macrocode}
440 % We shall respectfully ask the user not to use the \texttt{amstex}
441 % package.
442 % \begin{macrocode}
443 \AtBeginDocument
444 {\@ifpackageloaded{amstex}%
445 {\PackageWarningNoLine{euler}{Please do not use `amstex'.
446 Use `amsmath' instead}{}}}
447 % \end{macrocode}
448 % \begin{macrocode}
449 \DeclareMathSymbol\intop \mathop {EulerExtension}{"52}
450 \DeclareMathSymbol\ointop \mathop {EulerExtension}{"48}
451 \DeclareMathSymbol\braceld\mathord{EulerExtension}{"7A}
452 \DeclareMathSymbol\bracerd\mathord{EulerExtension}{"7B}
453 \DeclareMathSymbol\bracelu\mathord{EulerExtension}{"7C}
454 \DeclareMathSymbol\braceru\mathord{EulerExtension}{"7D}
455 \DeclareMathSymbol\infty \mathord{EulerExtension}{"31}
456 % \end{macrocode}
457 % It is not enough to substitute the Euler integral sign for the
458 % Computer Modern integral sign, if we are using the \texttt{amsmath}
459 % package. The multiple integral signs will look bad. The following
460 % will make them look better.
461 % \begin{macrocode}
462 \AtBeginDocument
463 {\@ifpackageloaded{amsmath}%
464 {\def\intkern@{\mkern -6mu }%
465 \def\ints@#1{\mkern -3mu
466 \mathop{\mkern 3mu
467 \intop
468 \ifnum #1=\z@ \intdots@ \else
469 \intkern@
470 \ifnum #1>\tw@ \intop\intkern@
471 \ifnum #1>\thr@@ \intop\intkern@ \fi
472 \fi
473 \fi
474 \intop
475 }\ilimits@
476 }%
477 }{}}
478 % \end{macrocode}
479 % All Euler arrows come from the Euler Extension font:
480 % \begin{macrocode}
481 \DeclareMathSymbol\nearrow\mathrel{EulerExtension}{"25}
482 \DeclareMathSymbol\searrow\mathrel{EulerExtension}{"26}
483 \DeclareMathSymbol\nwarrow\mathrel{EulerExtension}{"2D}
484 \DeclareMathSymbol\swarrow\mathrel{EulerExtension}{"2E}
485 % \end{macrocode}
486 % \begin{macrocode}
487 \DeclareMathSymbol\Leftrightarrow\mathrel{EulerExtension}{"2C}
488 \DeclareMathSymbol\Leftarrow \mathrel{EulerExtension}{"28}
489 \DeclareMathSymbol\Rightarrow \mathrel{EulerExtension}{"29}
490 \DeclareMathSymbol\leftrightarrow\mathrel{EulerExtension}{"24}
491 \DeclareMathSymbol\leftarrow \mathrel{EulerExtension}{"20}
492 \let\gets=\leftarrow
493 \DeclareMathSymbol\rightarrow \mathrel{EulerExtension}{"21}
494 \let\to=\rightarrow
495 % \end{macrocode}
496 % \begin{macrocode}
497 \DeclareMathDelimiter\uparrow
498 \mathrel{EulerExtension}{"22}{largesymbols}{"78}
499 \DeclareMathDelimiter\downarrow
500 \mathrel{EulerExtension}{"23}{largesymbols}{"79}
501 \DeclareMathDelimiter\updownarrow
502 \mathrel{EulerExtension}{"6C}{largesymbols}{"3F}
503 \DeclareMathDelimiter\Uparrow
504 \mathrel{EulerExtension}{"2A}{largesymbols}{"7E}
505 \DeclareMathDelimiter\Downarrow
506 \mathrel{EulerExtension}{"2B}{largesymbols}{"7F}
507 \DeclareMathDelimiter\Updownarrow
508 \mathrel{EulerExtension}{"6D}{largesymbols}{"77}
509 % \end{macrocode}
510 % \begin{macrocode}
511 \DeclareMathSymbol\leftharpoonup \mathrel{EulerExtension}{"18}
512 \DeclareMathSymbol\leftharpoondown \mathrel{EulerExtension}{"19}
513 \DeclareMathSymbol\rightharpoonup \mathrel{EulerExtension}{"1A}
514 \DeclareMathSymbol\rightharpoondown\mathrel{EulerExtension}{"1B}
515 % \end{macrocode}
516 %
517 % Note the funny mixture of the Euler Script and Extension fonts:
518 % \begin{macrocode}
519 \DeclareMathDelimiter\lbrace
520 \mathopen{EulerScript}{"66}{EulerExtension}{"08}
521 \DeclareMathDelimiter\rbrace
522 \mathclose{EulerScript}{"67}{EulerExtension}{"09}
523 % \end{macrocode}
524 %
525 % \section{More math}
526 %
527 % Actually, we still need some Computer Modern fonts: We need the
528 % equals sign for long/extensible (horizontal) double arrows, and we
529 % need the minus sign for the single arrows! The Euler Extension font
530 % is based on the \MF\ code for Computer Modern, and we need the
531 % Computer Modern equals and minus signs to make long/extensible arrows.
532 %
533 % We allocate math alphabets to produce the equals and minus signs for
534 % arrows. Note that since Euler arrows are only available in medium
535 % weight (they come from the Euler Extension font which is only
536 % available in medium weight), we let all math versions of these math
537 % alphabets refer to medium weight fonts.
538 % \begin{macrocode}
539 \DeclareMathAlphabet\cm@equals@alphabet{OT1}{cmr}{m}{n}
540 \DeclareMathAlphabet\cm@minus@alphabet{OMS}{cmsy}{m}{n}
541 % \end{macrocode}
542 % Note that we use OT1 encoding for the |\cm@equals@alphabet|, even
543 % though T1 encoding may be the default for the users system.
544 %
545 % Also, note that we already have the Computer Modern \texttt{cmsy}
546 % family assigned to a symbol font (namely the `symbols' symbol font).
547 % However, taking the minus sign directly from this symbol font would
548 % make long/extensible arrows come out wrong in the `bold' math
549 % version. (It is perhaps ``overkill'' to allocate a math alphabet
550 % just for this purpose?)
551 %
552 % \begin{macro}{\Relbar}\begin{macro}{\relbar}
553 % The long arrows are made using the macros |\Relbar| (for double
554 % arrows) and |\relbar| (for single arrows). The standard \LaTeX\
555 % definitions of these macros use the `\texttt{=}' and `\texttt{-}'
556 % characters to produce the extension part of the long arrows. Since
557 % we have changed the math codes of these characters (they are now
558 % taken from the Euler Fraktur fonts in math mode), we have to
559 % redefine the |\Relbar| and |\relbar| macros.
560 % \begin{macrocode}
561 \def\Relbar{\mathrel{\cm@equals@alphabet{\mathchar"703D}}}
562 \def\cm@minus{{\cm@minus@alphabet{\mathchar"7000}}}
563 \def\relbar{\mathrel{\smash\cm@minus}}
564 % \smash, because - has the same height as +
565 % \end{macrocode}
566 % \end{macro}\end{macro}
567 %
568 % \begin{macro}{\leftarrowfill}\begin{macro}{\rightarrowfill}
569 % Unfortunately, since the definitions of the ``arrow-filling'' macros
570 % (|\leftarrowfill| and |\rightarrowfill|) in standard \LaTeX\ still
571 % use explicit minus signs (instead of |\relbar|), we also have to
572 % redefine those macros:
573 % \begin{macrocode}
574 \def\leftarrowfill
575 {$\m@th\mathord\leftarrow\mkern-6mu%
576 \cleaders\hbox{$\mkern-2mu\cm@minus\mkern-2mu$}\hfill
577 \mkern-6mu\cm@minus$}
578 \def\rightarrowfill
579 {$\m@th\cm@minus\mkern-6mu%
580 \cleaders\hbox{$\mkern-2mu\cm@minus\mkern-2mu$}\hfill
581 \mkern-6mu\mathord\rightarrow$}
582 % \end{macrocode}
583 % We have defined |\cm@minus| to produce a Computer Modern minus sign
584 % of type |\mathord|. We thereby save a few |\mathord| tokens
585 % (compared to the definitions of |\leftarrowfill| and
586 % |\rightarrowfill| in standard \LaTeX).
587 % \end{macro}\end{macro}
588 %
589 % There are a few symbols in the original Computer Modern Math Italic
590 % fonts that are not present in the Euler fonts. We simply take them
591 % from the CM fonts.
592 % \begin{macrocode}
593 \DeclareSymbolFont{cmmigroup}{OML}{cmm}{m}{it}
594 \SetSymbolFont{cmmigroup}{bold}{OML}{cmm}{b}{it}
595 \DeclareMathAccent\vec \mathord{cmmigroup}{"7E}
596 \DeclareMathSymbol\triangleleft \mathbin{cmmigroup}{"2F}
597 \DeclareMathSymbol\triangleright\mathbin{cmmigroup}{"2E}
598 \DeclareMathSymbol\star \mathbin{cmmigroup}{"3F}
599 \DeclareMathSymbol\lhook \mathrel{cmmigroup}{"2C}
600 \DeclareMathSymbol\rhook \mathrel{cmmigroup}{"2D}
601 \DeclareMathSymbol\flat \mathord{cmmigroup}{"5B}
602 \DeclareMathSymbol\natural \mathord{cmmigroup}{"5C}
603 \DeclareMathSymbol\sharp \mathord{cmmigroup}{"5D}
604 \DeclareMathSymbol\smile \mathrel{cmmigroup}{"5E}
605 \DeclareMathSymbol\frown \mathrel{cmmigroup}{"5F}
606 % \end{macrocode}
607 % Note that the arrow head of |\vec| is slanted; this looks a bit
608 % strange in combination with an upright font such as Euler Roman.
609 %
610 % Also, note that in the `bold' math version, arrows with hooks will
611 % come out wrong (the hooks will be bold, but the arrow heads will be
612 % of medium weight). This can be repaired in a similar way as the
613 % long/extensible arrows, but is it worth it to allocate a math
614 % alphabet just for this purpose?
615 %
616 % Finally, Knuth wanted a little extra space before the prime
617 % superscript:
618 % \begin{macrocode}
619 \begingroup
620 \catcode`\'=\active
621 \gdef'{^\bgroup\mskip2mu\prim@s} % more space before '
622 \endgroup
623 % \end{macrocode}
624 %
625 % Open question: The |\dots| and |\ldots| macros produce dots
626 % (periods) from the Euler fonts; the |\ddots| and |\vdots| macros
627 % produce dots from the text font; and the |\cdots| macro produces
628 % dots from the Computer Modern `symbols' math symbol font. Should we
629 % do something about this?
630 %
631 % \section{Text fonts in math}\label{text-fonts}
632 %
633 % The text fonts used in math through math alphabets and the
634 % `operators' symbol font should be the same as the fonts used for the
635 % main text. (It is now easy to replace the fonts for the `operators'
636 % symbol font, since the uppercase greek letters are now taken from
637 % the Euler Roman fonts.)
638 %
639 % In order to reduce the total number of fonts needed, we shall---if
640 % possible---use text fonts in the same encoding for both text and
641 % math. We therefore determine whether T1 encoding has been selected
642 % as the default encoding. We define a switch---|\ifCorkEncoding|---for
643 % that purpose.
644 % \begin{macrocode}
645 \newif\ifCorkEncoding
646 \edef\@tempa{\encodingdefault}\def\@tempb{T1}
647 \ifx\@tempa\@tempb
648 \CorkEncodingtrue
649 \else
650 \CorkEncodingfalse
651 \fi
652 % \end{macrocode}
653 % Note that we determine the encoding to use at the time the \euler\
654 % package is loaded (\emph{not} at the end of the preamble). This
655 % allows the user to retain OT1 encoding for text fonts used in math
656 % (other packages may depend on that) by selecting T1 encoding
657 % \emph{after} the \euler\ package has been loaded.
658 %
659 % We redefine the `operators' symbol font and all math alphabets
660 % defined by the \LaTeX\ kernel. Due to the current implementation of
661 % math accents that take their glyphs from text fonts, all text fonts
662 % must be used in a common encoding. The only \LaTeX\ `base' package
663 % that defines extra math alphabets is the \texttt{oldlfont} package.
664 % However, this package cannot be used together with the \euler\
665 % package (it allocates too many symbol fonts). In other words, the
666 % following setup should suffice for most users.
667 % \begin{macrocode}
668 \ifCorkEncoding
669 \AtBeginDocument
670 {\DeclareSymbolFont{operators}{T1}\rmdefault\mddefault\updefault
671 \SetSymbolFont{operators}{bold}{T1}\rmdefault\bfdefault\updefault
672 \DeclareMathAlphabet\mathbf{T1}\rmdefault\bfdefault\updefault
673 \DeclareMathAlphabet\mathsf{T1}\sfdefault\mddefault\updefault
674 \DeclareMathAlphabet\mathit{T1}\rmdefault\mddefault\itdefault
675 \DeclareMathAlphabet\mathtt{T1}\ttdefault\mddefault\updefault
676 \SetMathAlphabet\mathsf{bold}{T1}\sfdefault\bfdefault\updefault
677 \SetMathAlphabet\mathit{bold}{T1}\rmdefault\bfdefault\itdefault}
678 \else
679 \AtBeginDocument
680 {\DeclareSymbolFont{operators}{OT1}\rmdefault\mddefault\updefault
681 \SetSymbolFont{operators}{bold}{OT1}\rmdefault\bfdefault\updefault
682 \DeclareMathAlphabet\mathbf{OT1}\rmdefault\bfdefault\updefault
683 \DeclareMathAlphabet\mathsf{OT1}\sfdefault\mddefault\updefault
684 \DeclareMathAlphabet\mathit{OT1}\rmdefault\mddefault\itdefault
685 \DeclareMathAlphabet\mathtt{OT1}\ttdefault\mddefault\updefault
686 \SetMathAlphabet\mathsf{bold}{OT1}\sfdefault\bfdefault\updefault
687 \SetMathAlphabet\mathit{bold}{OT1}\rmdefault\bfdefault\itdefault}
688 \fi
689 % \end{macrocode}
690 % Note that we perform the setup at the end of the preamble (and not
691 % while the \euler\ package is being input). This implies that any
692 % changes made to, e.g., |\rmdefault| by a package loaded after the
693 % \euler\ package are seen.
694 %
695 % The standard \LaTeX\ math setup assumes that OT1 encoded text fonts
696 % are used in math. When using T1 encoded fonts, we have to redefine
697 % the macros that access accents from the text fonts.
698 % \begin{macrocode}
699 \ifCorkEncoding
700 \DeclareMathAccent\grave\mathalpha{operators}{"00}
701 \DeclareMathAccent\acute\mathalpha{operators}{"01}
702 \DeclareMathAccent\tilde\mathalpha{operators}{"03}
703 \DeclareMathAccent\ddot \mathalpha{operators}{"04}
704 \DeclareMathAccent\check\mathalpha{operators}{"07}
705 \DeclareMathAccent\breve\mathalpha{operators}{"08}
706 \DeclareMathAccent\bar \mathalpha{operators}{"09}
707 \DeclareMathAccent\dot \mathalpha{operators}{"0A}
708 \fi
709 % \end{macrocode}
710 %
711 % \begin{macro}{\hat}
712 % There is one more accent that is normally taken from the `operators'
713 % symbol font, namely the |\hat| accent. This is the only accent
714 % provided by the Euler fonts; we shall use this accent by default.
715 % (A curious fact is that Knuth devoted a fairly large portion of
716 % \texttt{gkpmac.tex} to the construction of a $\phi$ with a hat
717 % accent---using the |\widehat| macro).
718 % \begin{macrocode}
719 \DeclareMathAccent\hat\mathalpha{EulerFraktur}{"5E}
720 % \end{macrocode}
721 % However, some users do not like this |\hat| accent. They prefer the
722 % accent glyph to be taken from the text font (similar to the other
723 % accents).
724 % \begin{macrocode}
725 \DeclareOption{text-hat-accent}
726 {\ifCorkEncoding
727 \DeclareMathAccent\hat\mathalpha{operators}{"02}%
728 \else
729 \DeclareMathAccent\hat\mathalpha{operators}{"5E}%
730 \fi}
731 % \end{macrocode}
732 % \end{macro}
733 %
734 % \begin{macro}{\hbar}
735 % The |\hbar| macro in standard \LaTeX\ is composed of the letter~`h'
736 % from the `letters' symbol font and the macron (`bar') accent from
737 % the `operators' symbol font. With the `letters' symbol font now
738 % being Euler Roman, the bar is no longer positioned correctly. We
739 % choose the following definition (the \texttt{9mu} in the original
740 % definition has been changed to \texttt{8mu}):
741 % \begin{macrocode}
742 \ifCorkEncoding
743 \DeclareMathSymbol\euler@hbar\mathord{operators}{"09}
744 \else
745 \DeclareMathSymbol\euler@hbar\mathord{operators}{"16}
746 \fi
747 \def\hbar{{\euler@hbar\mkern-8muh}}
748 % \end{macrocode}
749 % \end{macro}
750 %
751 % \section{Footnotes}\label{footnotes}
752 %
753 % \begin{macro}{\@makefnmark}
754 % Footnote numbers are not math entities, so they should be produced
755 % by digits from the text font. Since footnote markers (whether they
756 % are numbers or symbols) are produced in math mode, we can accomplish
757 % this by selecting |\operator@font|; this will cause digits to be
758 % taken from the `operators' symbol font (which is the same as the
759 % font used for text; see previous section).
760 % \begin{macrocode}
761 \def\@makefnmark{\hbox{$\operator@font^{\@thefnmark}\m@th$}}
762 % \end{macrocode}
763 % \end{macro}
764 %
765 % \section{Processing options}
766 %
767 % Finally, we must remember to process the options:
768 % \begin{macrocode}
769 \ProcessOptions
770 %</package>
771 % \end{macrocode}
772 %
773 % \Finale
774 \endinput