Debian Codegraph @

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

raw
1 %
2 % \iffalse meta-comment
3 %
4 % mathfixs.dtx Copyright (C) 2018-2026 Niklas Beisert
5 %
6 % This work may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in
10 % https://www.latex-project.org/lppl.txt
11 % and version 1.3c or later is part of all distributions of LaTeX
12 % version 2008 or later.
13 %
14 % This work has the LPPL maintenance status `maintained'.
15 %
16 % The Current Maintainer of this work is Niklas Beisert.
17 %
18 % This work consists of the files mathfixs.dtx and mathfixs.ins
19 % and the derived files mathfixs.sty and mathfixs-samp.tex.
20 %
21 %<package|sample>\NeedsTeXFormat{LaTeX2e}[1996-12-01]
22 %<package>\ProvidesPackage{mathfixs}[2026-04-08 v1.2.1 various fixes for math mode]
23 %<sample>\ProvidesFile{mathfixs-samp.tex}[2026-04-08 v1.2.1 sample for mathfixs]
24 %<source>\ProvidesFile{mathfixs-src.tex}[2026-04-08 v1.2.1 mathfixs source code documentation]
25 %<manual>\ProvidesFile{mathfixs.tex}[2026-04-08 v1.2.1 mathfixs reference manual]
26 %<*main|manual|source>
27 \def\thepkg/{mathfixs}\def\thedate/{2026-04-08}\def\theversion/{v1.2.1}
28 \def\thecopyright/{2018\texorpdfstring{--}{-}2026 Niklas Beisert}
29 %<*main>
30 \ProvidesFile{\thepkg/.dtx}[\thedate/ \theversion/ \thepkg/ package main file]
31 %</main>
32 \PassOptionsToClass{10pt,a4paper}{article}
33 \documentclass{ltxdoc}
34
35 \usepackage[margin=35mm]{geometry}
36 \usepackage[hyperindex=false]{hyperref}
37 \usepackage{hyperxmp}
38 \usepackage[usenames]{color}
39 \usepackage{longtable}
40
41 \usepackage{amssymb,bbm,dsfont}
42 \IfFileExists{bbold.sty}{}{\GenericWarning{please install package `bbold'}}
43 \DeclareMathAlphabet{\mathbbold}{U}{bbold}{m}{n}
44 \DeclareMathAlphabet{\mathdss}{U}{dsss}{m}{n}
45 \IfFileExists{upgreek.sty}{\usepackage[Symbolsmallscale]{upgreek}}{%
46 \def\uppi{\mathrm{\pi}}}
47
48 %<*main>
49 \title{The \markpkg{\thepkg/} Package}
50 \hypersetup{pdftitle={The \thepkg/ Package}}
51 \hypersetup{pdfsubject={Documentation for the LaTeX2e Package \thepkg/}}
52 %</main>
53 %<manual>\title{The \markpkg{\thepkg/} Package\\Reference Manual}
54 %<manual>\hypersetup{pdftitle={The \thepkg/ Package -- Reference Manual}}
55 %<manual>\hypersetup{pdfsubject={Reference Manual for the LaTeX2e Package \thepkg/}}
56 %<source>\title{The \markpkg{\thepkg/} Package\\Source Code Documentation}
57 %<source>\hypersetup{pdftitle={The \thepkg/ Package -- Source Code Documentation}}
58 %<source>\hypersetup{pdfsubject={Documented Source for the LaTeX2e Package \thepkg/}}
59 \author{Niklas Beisert\\[2ex]
60 Institut f\"ur Theoretische Physik\\
61 Eidgen\"ossische Technische Hochschule Z\"urich\\
62 Wolfgang-Pauli-Strasse 27, 8093 Z\"urich, Switzerland\\[1ex]
63 \href{mailto:[email protected]}
64 {\texttt{[email protected]}}}
65 \hypersetup{pdfauthor={Niklas Beisert}}
66 \date{\theversion/: \markdate{\thedate/}\\[1ex]
67 \url{https://ctan.org/pkg/\thepkg/}\\[0.5ex]
68 \url{https://github.com/nbeisert/latex-pkg-nb}}
69
70 \hypersetup{pdflang={en-UK}}
71 \hypersetup{pdfurl={https://ctan.org/pkg/\thepkg/}}
72 \hypersetup{pdfcopyright={Copyright \thecopyright/.
73 This work may be distributed and/or modified under the
74 conditions of the LaTeX Project Public License, either version 1.3
75 of this license or (at your option) any later version.}}
76 \hypersetup{pdflicenseurl={https://www.latex-project.org/lppl.txt}}
77 \hypersetup{pdfcontactaddress={ETH Zurich, ITP, HIT K,
78 Wolfgang-Pauli-Strasse 27}}
79 \hypersetup{pdfcontactpostcode={8093}}
80 \hypersetup{pdfcontactcity={Zurich}}
81 \hypersetup{pdfcontactcountry={Switzerland}}
82 \hypersetup{pdfcontactemail={[email protected]}}
83 \hypersetup{pdfcontacturl={https://people.phys.ethz.ch/\xmptilde nbeisert/}}
84
85 \hypersetup{keeppdfinfo=true}
86 \hypersetup{pdfsource={}}
87 \AddToHook{begindocument/before}{\hypersetup{colorlinks=false}}
88 \hypersetup{urlbordercolor={.5 1 1}}
89 \hypersetup{linkbordercolor={1 .7 .7}}
90 \AddToHook{begindocument/before}{\hypersetup{pdfstartview=FitH}}
91
92 \parskip1ex
93 \parindent0pt
94 \edef\itemize{\unexpanded\expandafter{\itemize}\parskip0pt}
95
96 \newcommand{\markpkg}[1]{\textsf{#1}}
97 \newcommand{\markdate}[1]{\textsf{#1}}
98 \newcommand{\secref}[1]{\hyperref[#1]{section \ref*{#1}}}
99 \newcommand{\ctanref}[2]{\href{https://ctan.org/#1}{#2}}
100 \newcommand{\ctanpkg}[1]{\ctanref{pkg/#1}{\markpkg{#1}}}
101
102 \def\verbbar{\texttt{\char"7C}}
103 \def\verbpkg{\texttt{\thepkg/}}
104 \def\thepkgctan/{\ctanpkg{\thepkg/}}
105
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 \begin{document}
110
111 \maketitle
112
113 \begin{abstract}\noindent
114 \markpkg{mathfixs} is a \LaTeXe{} package
115 to fix some odd behaviour in math mode such as
116 spacing around fractions and roots,
117 math symbols within bold text
118 as well as
119 capital Greek letters.
120 It also adds some related macros.
121 \end{abstract}
122
123 \begingroup
124 \parskip0ex
125 \tableofcontents
126 \endgroup
127
128
129 %<*main|manual>
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132 \section{Introduction}
133
134 Undoubtedly, \TeX{} and \LaTeX{} are excellent at
135 producing visually appealing mathematical expressions.
136 However, some commonly used macros produce output which
137 sometimes appears unbalanced under certain conditions.
138 Depending on the level of sophistication, such artefacts
139 are typically either ignored or fixed by some manual adjustments
140 wherever they appear.
141 This package addresses some of the issues
142 encountered commonly (by the author),
143 and provides fixes or additional macros to handle such situations.
144 At present the package is mainly concerned with:
145 %
146 \begin{itemize}
147 \item
148 spacing of fractions, roots and symbols
149 \item
150 alternative versions of fractions
151 \item
152 representation of (capital) Greek letters
153 \item
154 math symbols within bold text
155 \end{itemize}
156 %
157 Additional fixes and features may be added
158 to the package in later versions.
159 All of these features can be selected and customised
160 to some extent to accommodate for the desired style.
161
162
163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165 \section{Usage}
166
167 To use the package \ctanpkg{mathfixs} add the command
168 %
169 \begin{center}
170 |\usepackage{mathfixs}|
171 \end{center}
172 %
173 to the preamble of your \LaTeX{} document.
174 Furthermore you must select the desired features explicitly
175 as described below, otherwise the package will have no effect.
176 This is to avoid having to agree on
177 all the provided features and to allow for forward compatibility:
178 the package should remain open for future extensions
179 which may modify the default behaviour in an unintended fashion.
180
181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 \subsection{Package Features}
183
184 \DescribeMacro{\ProvideMathFix}
185 Features and options can be selected by the commands:
186 %
187 \begin{longtable}{rl}
188 &|\usepackage[|\textit{opts}|]{mathfixs}|
189 \\
190 or&|\PassOptionsToPackage{|\textit{opts}|}{mathfixs}|
191 \\
192 or&|\ProvideMathFix{|\textit{opts}|}|
193 \end{longtable}
194 %
195 |\PassOptionsToPackage| must be used before |\usepackage|;
196 |\ProvideMathFix| must be used afterwards.
197 Note that if |\ProvideMathFix| is invoked within a block,
198 its definitions are valid only locally within the block.
199 \textit{opts} is a comma-separated list of features or options.
200 The available features and options are described below.
201
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203 \subsection{Fractions}
204
205 The package offers some improvements for the spacing of fractions
206 as well as definitions to typeset small rational numbers.
207
208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209 \paragraph{Feature \texttt{frac}.}
210 \DescribeMacro{frac}
211 %
212 In many situations, \LaTeX{} typesets fractions with an
213 insufficient amount of surrounding space.
214 For example, the space between two consecutive fractions
215 almost make them appear as a single one:
216 %
217 \begin{center}
218 |x\frac{a+b}{c+d}\frac{e}{f}.|
219 \quad$\longrightarrow$\quad
220 $\displaystyle x\frac{a+b}{c+d}\frac{e}{f}.$
221 \end{center}
222 %
223 Also the space towards other symbols and punctuation marks
224 arguably is too small.
225 To make expressions more legible, sequences of fractions
226 are often coded with various custom spaces
227 (`|\,|', `|\:|', `|\;|', `|\ |', `|~|', etc.)
228 inserted, e.g.
229 %
230 \begin{center}
231 |x\,\frac{a+b}{c+d}\;\frac{e}{f}\ .|
232 \quad$\longrightarrow$\quad
233 $\displaystyle x\,\frac{a+b}{c+d}\;\frac{e}{f}\ .$
234 \end{center}
235 %
236 This looks better, but requires a lot of intervention
237 and depends very much on personal conventions.
238
239 The underlying technical reason for the shortcoming in spacing
240 around fractions
241 is that the latter are defined
242 to have the math class of ordinary objects (|\mathord|)
243 which results in no surrounding space.
244 A simple resolution is to assign the math class
245 of inner objects (|\mathinner|) to fractions
246 as described in the \markpkg{\TeX{}book}, e.g.
247 %
248 \begin{center}
249 |x\mathinner{\frac{a+b}{c+d}}\mathinner{\frac{e}{f}}.|
250 \end{center}
251 %
252 Inner objects behave almost like ordinary objects,
253 but some space is added between them and
254 other inner or ordinary objects, e.g.:
255 %
256 \[
257 x\mathinner{\frac{a+b}{c+d}}\mathinner{\frac{e}{f}}.
258 \]
259 %
260 Importantly, no space is added between inner objects
261 and the ends of the math expression or subexpression in parentheses.
262 Also, no space is generated
263 in the script styles (|\|[|script|]|scriptstyle|).
264
265 \DescribeMacro{\frac}
266 The feature |frac| redefines the macro |\frac|
267 such that all fractions have the inner math class
268 producing some surrounding space in selected situations, e.g.:
269 %
270 \begin{center}
271 |x\frac{a+b}{c+d}\frac{e}{f}.|
272 \quad$\longrightarrow$\quad
273 $\displaystyle x\mathinner{\frac{a+b}{c+d}}\mathinner{\frac{e}{f}}.$
274 \end{center}
275 %
276 This makes adding custom space around fractions
277 unnecessary in almost all situations,
278 and leads to a rather uniform appearance
279 without further adjustments.
280
281 \DescribeMacro{\genfrac}
282 \DescribeMacro{\dfrac}
283 \DescribeMacro{\tfrac}
284 The macro |\genfrac| of the package \ctanpkg{amsmath}
285 is modified suitably when the latter is loaded.
286 This also affects the macros |\dfrac| and |\tfrac| for fractions
287 in styles |\displaystyle| and |\textstyle|, respectively.
288 For |\genfrac| fractions with delimiters,
289 the inner math class is not applied
290 because the default math class is appropriate.
291
292 Note that when the |frac| feature is used,
293 spaces around fractions can be eliminated by using:
294 %
295 \begin{center}
296 |\mathord{\frac{|\textit{num}|}{|\textit{denom}|}}|
297 \end{center}
298 %
299 or simply (a block enclosed by braces |{|\ldots|}|
300 is considered an object with ordinary math class):
301 %
302 \begin{center}
303 |{\frac{|\textit{num}|}{|\textit{denom}|}}|
304 \end{center}
305 %
306 Furthermore, note that unlike the original macro |\frac|,
307 the redefined macro must be enclosed in a block
308 when passed as an argument. For example, |x^\frac{1}{2}|
309 produces an error and must be written as |x^{\frac{1}{2}}|.
310
311 \DescribeMacro{fracclass}
312 \DescribeMacro{fracdelimclass}
313 The option |fracclass=|\textit{class}
314 can be used to customise the math class of fractions
315 to any desired command \textit{class} accepting
316 the expression for the fraction as its single parameter.
317 Likewise, the option |fracdelimclass=|\textit{class}
318 customises the math class of fractions with delimiters
319 generated by |\genfrac| such as |\|[|d|\verbbar|t|]|binom|.
320
321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322 \paragraph{Feature \texttt{rfrac}.}
323 \DescribeMacro{rfrac}
324 %
325 Rational numbers as coefficients to
326 some simple terms often stick out visually
327 from displayed math expressions, e.g.:
328 %
329 \[
330 \frac{1}{2}x^2 + \frac{1}{6} y^3 + \frac{1}{4} x^2 y^2
331 \]
332 %
333 Arguably, typesetting such fractions in text style
334 has a more uniform appearance:
335 %
336 \[
337 {\textstyle\frac{1}{2}}x^2
338 + {\textstyle\frac{1}{6}} y^3
339 + {\textstyle\frac{1}{4}} x^2 y^2
340 \]
341 %
342
343 \DescribeMacro{\rfrac}
344 The feature |rfrac| defines the macro |\rfrac|
345 to typeset a fraction in text style or smaller.
346 It is similar to |\tfrac| of the package \ctanpkg{amsmath},
347 but it will not choose text style when in the script styles
348 and it will not produce surrounding space
349 when the feature |frac| is used.
350 The optional argument |rfrac={\|\textit{cmd}|}| specifies
351 an alternative command name |\|\textit{cmd} for |\rfrac|.
352
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354 \paragraph{Feature \texttt{vfrac}.}
355 \DescribeMacro{vfrac}
356 \DescribeMacro{\vfrac}
357 %
358 Common or vulgar fractions such as $^1\!/\!_2$
359 can be typeset in a simple fashion
360 as a superscript numerator followed by a slash
361 and a subscript denominator.
362 The spacing around the slash should be reduced
363 to join the expression.
364 The package provides this representation
365 as the feature |vfrac| defining the macro |\vfrac|.
366 It is similar to |\nicefrac| of the package \ctanpkg{nicefrac}
367 or the more advanced implementation |\sfrac| of the package \ctanpkg{xfrac}.
368 As vulgar fractions are often (mainly) used within plain text,
369 the macro |\vfrac| also works in text mode.
370 The optional argument |vfrac={\|\textit{cmd}|}| specifies
371 an alternative command name |\|\textit{cmd} for |\vfrac|.
372
373 \DescribeMacro{vfracclass}
374 \DescribeMacro{vfracskippre}
375 \DescribeMacro{vfracskippost}
376 The option |vfracclass=|\textit{class}
377 can be used to customise the math class of the vulgar fraction.
378 The options |vfracskippre=|\textit{muskip}
379 and |vfracskippost=|\textit{muskip}
380 defines the (negative) skip around the slash
381 (must be given in math units |mu|).
382
383 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
384 \subsection{Roots}
385
386 The \TeX{} implementations of radicals, mostly those with exponents,
387 have some uneven spacing, e.g.:
388 %
389 \[
390 y\sqrt{x}z,\qquad
391 y\sqrt[]{x}z,\qquad
392 y\sqrt[i]{x}z,\qquad
393 y\sqrt[n]{x}z,\qquad
394 y\sqrt[3]{x}z,\qquad
395 y\sqrt[123]{x}z
396 \]
397 %
398 They work best if no exponent is specified
399 or if the exponent is a single numerical digit.
400 The spacing is slightly different if the exponent is $n$ or $i$.
401
402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403 \paragraph{Feature \texttt{root}.}
404 \DescribeMacro{root}
405 \DescribeMacro{\sqrt}
406 \DescribeMacro{\root}
407 %
408 The package provides an alternative mechanism for the
409 placement of the exponent next to the radical.
410 It first measures the extents of the exponent
411 and the radical sign and then places them accordingly.
412 It also adds some space at the end of the radicand.
413 The refined definition produces the following representation
414 without further spacing adjustments
415 %
416 \[
417 y\sqrt{x\mskip2mu}z,\qquad
418 y\sqrt{x\mskip2mu}z,\qquad
419 y\mskip5mu
420 \sqrt[{\makebox[0pt][r]{$\scriptscriptstyle i$}}]{x\mskip2mu}z,\qquad
421 y\mskip5mu
422 \sqrt[{\makebox[0pt][r]{$\scriptscriptstyle n$}}]{x\mskip2mu}z,\qquad
423 y\mskip5mu
424 \sqrt[{\makebox[0pt][r]{$\scriptscriptstyle 3$}}]{x\mskip2mu}z,\qquad
425 y\mskip-5mu
426 \sqrt[123]{x\mskip2mu}z
427 \]
428 %
429
430 \DescribeMacro{rootclass}
431 \DescribeMacro{rootskipend}
432 \DescribeMacro{rootskippre}
433 \DescribeMacro{rootskippost}
434 The option |rootclass=|\textit{class}
435 can be used to customise the math class of the root.
436 The option |rootskipend=|\textit{muskip}
437 defines the additional skip at the end of the radicand
438 within the radical (must be given in math units |mu|).
439 The options |rootskippre=|\textit{muskip}
440 and |rootskippost=|\textit{muskip}
441 define additional skip around the radical.
442
443 \DescribeMacro{rootclose}
444 The option |rootclose| adds a closing mark
445 to the end of the top bar of radicals:
446 %
447 \[
448 \setbox0\hbox{$\sqrt{a\mskip2mu}$}\copy0\lower\fontdimen8\textfont3
449 \hbox{\vrule width\fontdimen8\textfont3 height \ht0 depth -0.8\ht0}
450 \]
451 %
452 The optional argument |rootclose=|\textit{height}
453 specifies the starting height with a default value of $0.8$.
454
455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
456 \subsection{Space Representing Multiplication Signs}
457
458 Mathematical expressions regularly omit explicit multiplication signs
459 between factors, e.g.\ $x^2yz$. All is well unless
460 some of the factors are compound expressions such as
461 $\Delta x$ or differentials $dx$ (or $\mathrm{d}x$)
462 where additional space is typically inserted by
463 commands like `|\,|'.
464
465 A simple method to declare (or define) compound expressions
466 with a suitable amount of surrounding space
467 is to encapsulate them in a |\mathinner| block, e.g.
468 %
469 \begin{center}
470 |12c\mathinner{\Delta x}\mathinner{\Delta y}z|
471 \quad$\longrightarrow$\quad
472 $12c\mathinner{\Delta x}\mathinner{\Delta y}$
473 \\
474 |\int x\mathinner{dx}|
475 \quad$\longrightarrow$\quad
476 $\displaystyle\int x\mathinner{dx}$
477 \end{center}
478 %
479 Importantly, |\mathinner| will not add any space
480 at the ends of an expression
481 (or a subexpression in parentheses).
482
483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
484 \paragraph{Feature \texttt{multskip}.}
485 \DescribeMacro{multskip}
486 \DescribeMacro{\.}
487 %
488 Furthermore, the package provides the feature |multskip|
489 to encode a space representing an omitted multiplication sign
490 by the short command `|\.|', e.g.:
491 %
492 \begin{center}
493 |12c\.\Delta x\.\Delta y\.z|
494 \qquad or\qquad
495 |\int x\.dx|
496 \end{center}
497 %
498 The macro `|\.|' produces some amount of space in math mode
499 (while retaining its original definition as an accent in text mode)
500 and by default it is equivalent to `|\,|'.
501 However, the macro `|\.|' is intended to describe this space unambiguously
502 as a multiplication sign.
503 In particular, the amount of space can be configured by
504 the option |multskip=|\textit{muskip} (given in math units |mu|),
505 or the command could be customised further
506 to a visually different representation.
507
508 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
509 \subsection{Greek Letters}
510
511 \TeX{} defines Greek letters in math mode somewhat differently
512 from Latin letters. The following two features redefine
513 to the standard \TeX{} Greek letters.
514
515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
516 \paragraph{Feature \texttt{greekcaps}.}
517 \DescribeMacro{greekcaps}
518 %
519 Capital Greek letters are declared as operators instead of plain letters,
520 and therefore they are typeset in an upright shape.
521 To typeset them in italic shape
522 (as all the other letters representing variables)
523 one can use |\mathnormal|,
524 but this may be tedious if most capital Greek letters in a document
525 actually represent variables.
526
527 The feature |greekcaps| redefines the 11 capital Greek letters
528 |\Gamma|, |\Delta|, |\Theta|, |\Lambda|, |\Xi|, |\Pi|,
529 |\Sigma|, |\Upsilon|, |\Phi|, |\Psi| and |\Omega|
530 provided by \TeX{} to have a default italic shape.
531 Upright capital Greek letters remain accessible
532 by switching to the upright shape using |\mathrm|
533 or by declaring them as part of an operator,
534 e.g.\ |\operatorname| or |\DeclareMathOperator|
535 (package \ctanpkg{amsopt} within \ctanpkg{amsmath}).
536
537 The optional argument |greekcaps=|\textit{pre} will
538 instead define the macros |\|\textit{pre}|Gamma|, etc.,
539 and keep the original definitions.
540
541 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
542 \paragraph{Feature \texttt{greeklower}.}
543 \DescribeMacro{greeklower}
544 %
545 Lowercase Greek letters are fixed to the default math italic
546 font because (unfortunately) no upright counterparts exist
547 in the Compute Modern family of fonts.
548
549 The feature |greeklower| redefines the 23 lowercase Greek letters
550 |\alpha|, \ldots, |\omega|
551 as well as their 6 variants
552 |\varepsilon|, |\vartheta|, |\varpi|, |\varphi|, |\varrho| and |\varsigma|
553 defined by \TeX{}
554 to be elements of the regular math alphabet.
555 This allows them to be typeset in different font series
556 such as |\mathbold| described below.
557 However, when trying to cast them in upright shape
558 they will be typeset as altogether different symbols,
559 e.g.\ |\mathrm{\alpha}| becomes the ligature `ff'
560 which occupies the same slot in the \TeX{} font encodings OML vs.\ OT1.
561 Hence, some caution is needed when this feature is used.
562 Note that math font redefinitions may clash with this feature.
563
564 The optional argument |greeklower=|\textit{pre} will
565 instead define the macros |\|\textit{pre}|alpha|, etc.,
566 and keep the original definitions.
567
568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
569 \subsection{Bold Fonts}
570
571 Combining bold fonts and math mode in \LaTeX\ sometimes
572 yields unintuitive results.
573 The following two features assist
574 the intuitive use of bold fonts in math mode.
575
576 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
577 \paragraph{Feature \texttt{autobold}.}
578 \DescribeMacro{autobold}
579 %
580 Sectioning commands such as |\chapter|, |\section|, |\paragraph|,
581 etc., but also |\maketitle| often change the font series to bold.
582 However, any math symbols contained in the titles
583 are typeset in the regular, non-bold series by default leading to
584 a non-uniform appearance or calling for further manual adjustments
585 using |\boldmath|.
586 One might argue that it is bad practice to have math symbols in titles
587 in the first place,
588 but this point of view perhaps does not apply universally.
589
590 \DescribeMacro{\bfseries}
591 \DescribeMacro{\mdseries}
592 The feature |autobold| overwrites the \LaTeX{} font commands
593 |\bfseries|, |\mdseries| as well as |\normalfont|
594 to automatically switch the math fonts to their bold version.
595 Derived commands such as |\section|, etc., will also
596 switch the math fonts to the bold series.
597
598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
599 \paragraph{Feature \texttt{mathbold}.}
600 \DescribeMacro{mathbold}
601 \DescribeMacro{\mathbold}
602 %
603 The feature |mathbold| defines a bold italic math font |\mathbold|.
604 To typeset bold italic letters simply use |\mathbold{abc}|.
605 To make this work for lowercase Greek letters as well,
606 the feature |greeklower| must be activated.
607 The optional argument |mathbold={\|\textit{cmd}|}| specifies
608 an alternative command name |\|\textit{cmd} for |\mathbold|,
609 e.g.\ |mathbold={\mathbit}|.
610
611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
612 \subsection{Mathematical Functions and Operators}
613
614 \LaTeX\ defines many basic standard mathematical functions and operators,
615 see below.
616 The following features fill some gaps in the collection of functions
617 and they provide worthwhile alternative representations for some
618 functions and operators. All of the following features require
619 that the package \ctanpkg{amsopn} (part of \ctanpkg{amsmath})
620 is loaded \emph{before} \ctanpkg{mathfixs}.
621
622 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
623 \paragraph{Native \LaTeX{} Functions and Operators.}
624
625 As a reference, \LaTeX{} supplies the following functions and operators.
626 All of them are overwritten by \ctanpkg{amsopn} within \ctanpkg{amsmath}.
627
628 Exponential and logarithm functions:
629 %
630 \begin{longtable}{lll}
631 macro & output & description \\
632 \hline
633 |\exp| & $\exp$ & exponential function \\
634 |\log| & $\log$ & logarithm function \\
635 |\lg| & $\lg$ & common logarithm function \\
636 |\ln| & $\ln$ & natural logarithm function \\
637 \end{longtable}
638
639 Trigonometric functions:
640 %
641 \begin{longtable}{lll}
642 macro & output & description \\
643 \hline
644 |\sin| & $\sin$ & sine function \\
645 |\cos| & $\cos$ & cosine function \\
646 |\tan| & $\tan$ & tangent function \\
647 |\cot| & $\cot$ & cotangent function \\
648 |\sec| & $\sec$ & secant function \\
649 |\csc| & $\csc$ & cosecant function \\
650 |\arcsin| & $\arcsin$ & inverse sine function \\
651 |\arccos| & $\arccos$ & inverse cosine function \\
652 |\arctan| & $\arctan$ & inverse tangent function \\
653 \end{longtable}
654
655 Hyperbolic functions:
656 %
657 \begin{longtable}{lll}
658 macro & output & description \\
659 \hline
660 |\sinh| & $\sinh$ & hyperbolic sine function \\
661 |\cosh| & $\cosh$ & hyperbolic cosine function \\
662 |\tanh| & $\tanh$ & hyperbolic tangent function \\
663 |\coth| & $\coth$ & hyperbolic cotangent function \\
664 \end{longtable}
665
666 Extremal values:
667 %
668 \begin{longtable}{lll}
669 macro & output & description \\
670 \hline
671 |\max| & $\max$ & maximum of a set \\
672 |\min| & $\min$ & minimum of a set \\
673 |\sup| & $\sup$ & supremum of a set \\
674 |\inf| & $\inf$ & infimum of a set \\
675 \end{longtable}
676
677 Limits:
678 %
679 \begin{longtable}{lll}
680 macro & output & description \\
681 \hline
682 |\lim| & $\lim$ & limit operator \\
683 |\limsup| & $\limsup$ & limit superior operator \\
684 |\liminf| & $\liminf$ & limit inferior operator \\
685 |\injlim| & inj\,lim & ? (\ctanpkg{amsopn}/\ctanpkg{amsmath} only) \\
686 |\projlim| & proj\,lim & ? (\ctanpkg{amsopn}/\ctanpkg{amsmath} only) \\
687 \end{longtable}
688
689 Assorted functions and operators:
690 %
691 \begin{longtable}{lll}
692 macro & output & description \\
693 \hline
694 |\arg| & $\arg$ & argument of a complex number \\
695 |\det| & $\det$ & determinant of a matrix \\
696 |\ker| & $\ker$ & kernel of a map \\
697 |\dim| & $\dim$ & dimension of \ldots \\
698 |\deg| & $\deg$ & degree of \ldots \\
699 |\gcd| & $\gcd$ & greatest common divisor \\
700 |\hom| & $\hom$ & ? \\
701 |\Pr| & $\Pr$ & ? \\
702 \end{longtable}
703
704 Modulo statements:
705 %
706 \begin{longtable}{lll}
707 macro & output & description \\
708 \hline
709 |\bmod| & $X \bmod Y$ & modulo statement \\
710 |\pmod| & $X \pmod Y$ & modulo statement in parentheses \\
711 |\mod| & $X\mkern18mu \bmod Y$ & modulo statement with space
712 (\ctanpkg{amsmath} only) \\
713 \end{longtable}
714
715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
716 \paragraph{Feature \texttt{genop}.}
717 \DescribeMacro{genop}
718 \DescribeMacro{...}
719 %
720 The package defines several
721 additional mathematical functions, operators and symbols
722 which are not included in the \LaTeX\ macro library.
723 These may be provided by other packages as well,
724 or they can easily be defined by |\DeclareMathOperator|
725 or used by |\operatorname|.
726 Nevertheless, it is convenient to have these objects declared
727 by a simple switch rather than by issuing a formal \LaTeX{} clause.
728
729 The additional macros are grouped by category
730 and each category is included as a feature.
731 The first category describes
732 assorted mathematical functions, operators and symbols.
733 Further categories are provided in the following paragraphs.
734
735 In order to evade clashes, the package allows to
736 individually select the desired definitions
737 from the assorted section
738 with optionally defined macro names:
739 %
740 \begin{longtable}{llll}
741 feature & macro & output & description \\
742 \hline
743 |sgn| & |\sgn| & sgn & signum function \\
744 |res| & |\res| & res & residue operator \\
745 |lcm| & |\lcm| & lcm & least common multiple \\
746 |span| & |\Span| & span & span \\
747 |diag| & |\diag| & diag & diagonal matrix \\
748 |spec| & |\spec| & spec & spectrum \\
749 |const| & |\const| & const & anything constant \\
750 \hline
751 |genop| & & & all of the above
752 \end{longtable}
753 %
754 The following two-letter operators
755 and some additional ones
756 are not included in the above class
757 and must be implemented individually:
758 %
759 \begin{longtable}{llll}
760 feature & macro & output & description \\
761 \hline
762 |id| & |\id| & id & identity map \\
763 |tr| & |\tr| & tr & trace \\
764 |ad| & |\ad| & ad & adjoint (action) \\
765 |Vol| & |\Vol| & Vol & Volume \\
766 \end{longtable}
767 %
768
769 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
770 \paragraph{Feature \texttt{reim}.}
771 \DescribeMacro{reim}
772 \DescribeMacro{\Re}
773 \DescribeMacro{\Im}
774 %
775 \LaTeX{} assigns the symbols `$\Re$' and `$\Im$' to projectors
776 to the real and imaginary parts of complex numbers.
777 Another established representation for these projectors is given by
778 `Re' and `Im'.
779 The feature |reim| overwrites the predefined macros |\Re| and |\Im|
780 with a textual representation:
781 %
782 \begin{longtable}{lll}
783 macro & output & description \\
784 \hline
785 |\Re| & Re & real part of a complex number \\
786 |\Im| & Im & imaginary part of a complex number \\
787 \end{longtable}
788 %
789 The optional argument |reim={\|\textit{cmdr}|\|\textit{cmdi}|}| specifies
790 alternative command names |\|\textit{cmdr} and |\|\textit{cmdi}
791 for |\Re| and |\Im|.
792 The feature |reim*| restores the predefined representation for |\Re| and |\Im|.
793
794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
795 \paragraph{Feature \texttt{trig}.}
796 \DescribeMacro{trig}
797 \DescribeMacro{\arccot}
798 \DescribeMacro{\arcsec}
799 \DescribeMacro{\arccsc}
800 %
801 \LaTeX{} defines most trigonometric functions and their inverses
802 like $\sin$, $\cos$ and $\arctan$, but three of their inverses are omitted.
803 The feature |trig| supplies the remaining
804 three inverse trigonometric functions:
805 \begin{longtable}{lll}
806 macro & output & description \\
807 \hline
808 |\arccot| & arccot & inverse cotangent function \\
809 |\arcsec| & arcsec & inverse secant function \\
810 |\arccsc| & arccsc & inverse cosecant function \\
811 \end{longtable}
812
813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
814 \paragraph{Feature \texttt{hyp}.}
815 \DescribeMacro{hyp}
816 \DescribeMacro{\sech}
817 \DescribeMacro{\csch}
818 \DescribeMacro{\ar...h}
819 %
820 \LaTeX{} defines four hyperbolic functions $\sinh$, $\cosh$ and $\tanh$,
821 but two of them and all inverses are omitted.
822 The feature |hyp| supplies the remaining two hyperbolic functions
823 along with all inverse hypberbolic functions:
824 \begin{longtable}{lll}
825 macro & output & description \\
826 \hline
827 |\sech| & sech & hyperbolic secant function \\
828 |\csch| & csch & hyperbolic cosecant function \\
829 |\arsinh| & arsinh & inverse hyperbolic sine function \\
830 |\arcosh| & arcosh & inverse hyperbolic cosine function \\
831 |\artanh| & artanh & inverse hyperbolic tangent function \\
832 |\arcoth| & arcoth & inverse hyperbolic cotangent function \\
833 |\arsech| & arsech & inverse hyperbolic secant function \\
834 |\arcsch| & arcsch & inverse hyperbolic cosecant function \\
835 \end{longtable}
836
837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
838 \paragraph{Feature \texttt{mapchar}.}
839 \DescribeMacro{mapchar}
840 %
841 The feature |mapchar| supplies further characteristics of maps:
842 %
843 \begin{longtable}{lll}
844 macro & output & description \\
845 \hline
846 |\dom| & dom & domain \\
847 |\codom| & codom & codomain \\
848 |\supp| & supp & support \\
849 |\im| & im & image \\
850 |\coker| & coker & cokernel \\
851 |\rank| & rank & rank \\
852 \end{longtable}
853 %
854 The optional argument |mapchar={\|\textit{cmdim}|}| specifies
855 an alternative command name |\|\textit{cmdim} for |\im|
856 which has only two letters and might easily clash with other definitions.
857
858 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
859 \paragraph{Feature \texttt{mapclass}.}
860 \DescribeMacro{mapclass}
861 %
862 The feature |mapclass| supplies symbols for the sets of
863 homomorphisms, endomorphisms, isomorphisms and automorphisms
864 as classes/categories of structure-preserving maps:
865 %
866 \begin{longtable}{lll}
867 macro & output & description \\
868 \hline
869 |\Hom| & Hom & homomorphisms \\
870 |\End| & End & endomorphisms \\
871 |\Isom| & Isom & isomorphisms \\
872 |\Aut| & Aut & automorphisms
873 \end{longtable}
874
875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
876 \paragraph{Feature \texttt{vecdiff}.}
877 \DescribeMacro{vecdiff}
878 \DescribeMacro{vecrot}
879 %
880 The feature |vecdiff| supplies the three common differential operators
881 gradient, divergence and curl for vectors:
882 %
883 \begin{longtable}{llll}
884 macro & output & description \\
885 \hline
886 |\grad| & grad & gradient \\
887 |\div| & div & divergence \\
888 |\curl| & curl & curl \\
889 |\curl| & rot & curl (alternative form using |vecdiff*| or |vecrot|) \\
890 \end{longtable}
891 %
892 The feature |vecrot|[|={\|\textit{cmd}|}|]
893 supplies the alternative form `rot' for curl/rotor on top of |\curl|
894 with the option to specify an alternative command name.
895 The feature |lapl|, see below, supplies the Laplace operator.
896
897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
898 \subsection{Particular Symbols}
899
900 The package provides a couple of standard mathematical symbols.
901 Of course, users can be trusted to define these symbols themselves
902 or, more likely, use them straight away.
903 Nevertheless, here we go \ldots
904
905 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
906 \paragraph{Mathematical Constants.}
907 \DescribeMacro{econst}
908 \DescribeMacro{iunit}
909 \DescribeMacro{piconst}
910 \DescribeMacro{unitel}
911 %
912 Three of the most relevant mathematical constants are Euler's number $e$,
913 the imaginary unit $i$ and the circle's constant $\pi$
914 (with the relation $e^{i\pi}=-1$).
915 The unit element of some algebraic structure similarly deserves mention
916 as it could be typeset in various forms.
917 The package provides macros for these
918 with diverse representations:
919 %
920 \begin{longtable}{llll}
921 feature & macro & output & description \\
922 \hline
923 |econst| & |\econst| & e & Euler's number (upright) \\
924 |econst*| & & $e$ & \quad (math italic) \\
925 |iunit| & |\iunit| & i & imaginary unit (upright) \\
926 |iunit*| & & $i$ & \quad (math italic) \\
927 |iunit*nb| & & $\mathring{\imath}$ & \quad (NB's silly circle version) \\
928 |piconst| & |\piconst| & $\uppi$ & circle constant $\pi$
929 (upright, if only \ldots) \\
930 |piconst*| & & $\pi$ & \quad (math italic) \\
931 |unitel1| & |\unitel| & $\mathds{1}$ & unit element (doublestroke `1')\\
932 |unitel1*| & & $1$ & \quad (plain `1') \\
933 |unitel|\textit{var} & & & \quad (variants, see table below) \\
934 \end{longtable}
935 %
936 Each macro and representation is provided as an individual feature
937 \textit{feature}[|={\|\textit{cmd}|}|]
938 which offers the option to customise the macro name to |\|\textit{cmd}
939 (or use several representations side-by-side).
940 The following table lists variants for the unit element representation.
941 %
942 \begin{longtable}{l@{\hspace{2em}}c@{\hspace{0.5em}}l@%
943 {\hspace{2em}}c@{\hspace{0.5em}}l@{\hspace{2em}}c@{\hspace{0.5em}}l}
944 & \multicolumn{2}{l}{output/\textit{var}}
945 & \multicolumn{2}{l}{output/\textit{var}}
946 & \multicolumn{2}{l}{output/\textit{var}}
947 \\\hline
948 \markpkg{dsfont} `$\mathds{1}$' &
949 $\mathds{1}$ & |1ds| (default) &
950 $\mathds{1}$ & |1dsr| (serif) &
951 $\mathdss{1}$ & |1dss| (sans)
952 \\
953 \markpkg{bbm} `$\mathbbm{1}$' &
954 $\mathbbm{1}$ & |1bbm| (serif) &
955 $\mathbbmss{1}$ & |1bbmss| (sans) &
956 $\mathbbmtt{1}$ & |1bbmtt| (typewriter)
957 \\
958 \markpkg{bbold} `$\mathbbold{1}$' &
959 $\mathbbold{1}$ & |1bbold| (sans)
960 \\
961 bold `1' &
962 $\mathbf{1}$ & |1bf| (extended) &
963 \def\bfdefault{b}\textbf{1} & |1bfb| (narrower) &
964 \def\bfdefault{bx}\textbf{1} & |1bfbx| (extended)
965 \\
966 letter `e' &
967 $\mathrm{e}$ & |e| &
968 $e$ & |e*|
969 \\
970 letter `E' &
971 $\mathrm{E}$ & |E| &
972 $E$ & |E*|
973 \\
974 `I' / `id' &
975 $\mathrm{I}$ & |I| &
976 $I$ & |I*| &
977 id & |id|
978 \end{longtable}
979 %
980 The doublestroke/blackboard bold representations
981 require installation of the further packages
982 \markpkg{dsfont}/\ctanpkg{doublestroke},
983 \ctanpkg{bbm}/\ctanpkg{bbm-macros} and/or \ctanpkg{bbold}.
984 Inclusion of the packages in your document is not required,
985 as \ctanpkg{mathfixs} will try to include the fonts anyway.
986 The default form |unitel1| will pick the first available form
987 from the above packages and resort to the bold form otherwise.
988
989 \DescribeMacro{econstclass}
990 As Euler's number is commonly used within exponentiation
991 which looks dense in compound expressions
992 (e.g.\ $2e^{\sin x}F$),
993 |\econst| is defined as |\mathinner|
994 which adds some space around the exponentiation in such a situation
995 (e.g.\ $2\mathinner{e}^{\sin x}F$).
996 Use |{\econst}| if such spacing is undesired.
997 The option |econstclass=|\textit{class}
998 can be used to customise the math class of |\econst|.
999
1000 An upright version of |\pi| needs to be supplied
1001 for the feature |piconst| to work properly.
1002 If the macro |\uppi| from the package \ctanpkg{upgreek}
1003 in the bundle \ctanpkg{was} is available
1004 at the time of loading, it will be used.
1005 Otherwise an upright |\pi| can be supplied by package \ctanpkg{unicode-math}.
1006 Note that the feature |piconst| (without |*|) may interfere
1007 with the feature |greeklower|.
1008
1009 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1010 \paragraph{Derivative Symbols.}
1011 \DescribeMacro{der}
1012 \DescribeMacro{diff}
1013 %
1014 The package provides some assorted elementary symbols and compounds:
1015 %
1016 \begin{longtable}{llll}
1017 feature & macro & output & description \\
1018 \hline
1019 |der| & |\der| & d & derivative symbol (upright) \\
1020 |der*| & |\der| & $d$ & derivative symbol (math italic) \\
1021 |diff| & |\diff{|$x$|}| & d$x$ & coordinate differential (upright) \\
1022 |diff*| & |\diff{|$x$|}| & $dx$ & coordinate differential (math italic) \\
1023 \end{longtable}
1024 %
1025 Each macro and representation is provided as an individual feature
1026 \textit{feature}[|={\|\textit{cmd}|}|]
1027 which offers the option to customise the macro name to |\|\textit{cmd}.
1028
1029 The coordinate differential |\diff| is meant to be used
1030 within integrals and as a differential form,
1031 and it can be used in the denominator of differentiation expressions.
1032 In all of these, it is understood as a compound which should be
1033 separated from surrounding symbols.
1034 Therefore |\diff{|$x$|}| is declared as |\mathinner|
1035 which adds spacing where needed.
1036
1037 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1038 \paragraph{Conjugation Operations.}
1039 \DescribeMacro{trans}
1040 \DescribeMacro{hconj}
1041 \DescribeMacro{conj}
1042 %
1043 The package provides macros for the matrix and vector operations
1044 transposition, hermitian conjugation, complex conjugation and dualisation
1045 in various representations:
1046 %
1047 \begin{longtable}{llll}
1048 feature & macro & output & description \\
1049 \hline
1050 |trans| & |\trans| & $^\top{}$ & transposition (|\top|) \\
1051 |trans*| & & $^\intercal$ &
1052 \quad alternate symbol (|\intercal|, requires \markpkg{amssymb})\\
1053 |transT| & & $^\mathsf{T}$ & \quad letter `T' \\
1054 |transT*| & & $^\mathsf{\scriptscriptstyle T}$ &
1055 \quad letter `T' (|\scriptscriptsize|) \\
1056 |transt| & & $^\mathsf{t}$ & \quad letter `t' \\
1057 |hconj| & |\hconj| & $^\dagger$ & hermitian conjugation (|\dagger|) \\
1058 |hconjH| & & $^\mathsf{H}$ & \quad letter `H' \\
1059 |hconjH*| & & $^\mathsf{\scriptscriptstyle H}$ &
1060 \quad letter `H' (|\scriptscriptsize|) \\
1061 |hconjh| & & $^\mathsf{h}$ & \quad letter `h' \\
1062 |conj| & |\conj| & $^*$ & complex conjugation (|\ast|) \\
1063 |dual| & |\dual| & $^*$ & dualisation (|\ast|) \\
1064 \end{longtable}
1065 %
1066 The macros are intended to be used within superscripts.
1067 Each macro and representation is provided as an individual feature
1068 \textit{feature}[|={\|\textit{cmd}|}|]
1069 which offers the option to customise the macro name to |\|\textit{cmd}.
1070
1071 \DescribeMacro{transfont}
1072 The default font for letter representations of transposition
1073 and hermitian conjugation is |\mathsf|;
1074 it can be adjusted by |transfont={|\textit{mathfont}|}|.
1075
1076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1077 \paragraph{Assorted Symbols.}
1078 %
1079 The package provides some assorted elementary symbols and compounds:
1080 %
1081 \begin{longtable}{llll}
1082 feature & macro & output & description \\
1083 \hline
1084 |order| & |\order| & $o$ & anything of order less than \\
1085 |Order| & |\Order| & $O$ & anything of order at most \\
1086 |Order*| & |\Order| & $\mathcal{O}$ & anything of order at most
1087 (calligraphic) \\
1088 |lapl| & |\lapl| & $\mathnormal{\Delta}$ & Laplace operator \\
1089 |defeq| & |\defeq| & $\mathrel{\mathop:}=$ & is defined as \\
1090 |eqdef| & |\eqdef| & $=\mathrel{\mathop:}$ & defines \\
1091 |dualop| & |\dualop| & $\star$ & dual operator (e.g.\ Hodge) \\
1092 |dualop*| & |\dualop| & $\ast$ & dual operator (alternative form) \\
1093 \end{longtable}
1094 %
1095 Each macro and representation is provided as an individual feature
1096 \textit{feature}[|={\|\textit{cmd}|}|]
1097 which offers the option to customise the macro name to |\|\textit{cmd}.
1098
1099 The defining symbols |\defeq| and |\eqdef| both typeset
1100 the colon to be vertically aligned with the equation sign.
1101
1102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1103 \paragraph{Number Sets.}
1104 \DescribeMacro{numset}
1105 \DescribeMacro{numsetfont}
1106 %
1107 The feature |numset| provides the macro |\numset|
1108 to typeset a number set such as the integers
1109 which is commonly denoted by a (blackboard) bold letter
1110 such as $\mathbb{Z}$ or $\mathbf{Z}$.
1111 The feature |numset={\|\textit{cmd}|}|
1112 offers the option to customise the macro name to |\|\textit{cmd}.
1113 The default font for this feature is |\mathbb| of \ctanpkg{amssymb}
1114 if available at the time of loading, otherwise |\mathbf|;
1115 it can be adjusted by |numsetfont={|\textit{mathfont}|}|.
1116
1117 \DescribeMacro{numsets}
1118 The standard number fields are provided by the feature |numsets|
1119 as follows:
1120 %
1121 \begin{longtable}{llll}
1122 macro & output & description \\
1123 \hline
1124 |\Natural| & $\mathbb{N}$ & set of natural numbers \\
1125 |\Integer| & $\mathbb{Z}$ & field of integer numbers \\
1126 |\Rational| & $\mathbb{Q}$ & field of rational numbers \\
1127 |\Real| & $\mathbb{R}$ & field of real numbers \\
1128 |\Complex| & $\mathbb{C}$ & field of complex numbers \\
1129 |\Quaternion| & $\mathbb{H}$ & skew field of quaternions \\
1130 |\Octonion| & $\mathbb{O}$ & division algebra of octonions \\
1131 \end{longtable}
1132 %
1133
1134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1135 \paragraph{Standard Groups.}
1136 \DescribeMacro{grp}
1137 %
1138 The feature |grp| provides the macro |\grp|
1139 to typeset a group name
1140 which is commonly denoted by upright (mostly capital) letters
1141 such as $\mathrm{GL}$ or $\mathrm{SO}$.
1142 The feature |grp={\|\textit{cmd}|}|
1143 offers the option to customise the macro name to |\|\textit{cmd}.
1144 The feature |groups| defines a couple of common group names.
1145
1146 \DescribeMacro{grpfin}
1147 The basic finite groups are provided by the feature |grpfin|
1148 as follows:
1149 %
1150 \begin{longtable}{llll}
1151 macro & output & description \\
1152 \hline
1153 |\grpcyc| & Z & cyclic group \\
1154 |\grpcyc| & C & cyclic group (alternative form using |grpcycC| or |grpfin*|) \\
1155 |\grpdih| & D & dihedral group \\
1156 |\grpperm| & S & permutation group \\
1157 |\grpalt| & A & alternating group \\
1158 \end{longtable}
1159 %
1160 \DescribeMacro{grplie}
1161 The basic groups of Lie type are provided by the feature |grplie|
1162 as follows:
1163 %
1164 \begin{longtable}{llll}
1165 macro & output & description \\
1166 \hline
1167 |\grpGL| & GL & general linear group \\
1168 |\grpSL| & SL & special linear group \\
1169 |\grpPGL| & PGL & projective linear group \\
1170 |\grpPSL| & PSL & projective special linear group \\
1171 |\grpU| & U & unitary group \\
1172 |\grpSU| & SU & special unitary group \\
1173 |\grpPU| & PU & projective unitary group \\
1174 |\grpPSU| & PSU & projective special unitary group \\
1175 |\grpO| & O & orthogonal group \\
1176 |\grpSO| & SO & special orthogonal group \\
1177 |\grpPSO| & PSO & projective special orthogonal group \\
1178 |\grpSpin| & Spin & spin group \\
1179 |\grpPin| & Pin & pin group \\
1180 |\grpSp| & Sp & symplectic group \\
1181 |\grpMp| & Mp & metaplectic group \\
1182 \end{longtable}
1183 %
1184 \DescribeMacro{grpdynkin}
1185 The seven classes of groups associated to Dynkin diagrams
1186 are provided by the feature |grpdynkin|
1187 as follows:
1188 %
1189 \begin{longtable}{llll}
1190 macro & output & description \\
1191 \hline
1192 |\grpA| & A & group of type A \\
1193 |\grpB| & B & group of type B \\
1194 |\grpC| & C & group of type C \\
1195 |\grpD| & D & group of type D \\
1196 |\grpE| & E & group of (exceptional) type E \\
1197 |\grpF| & F & group of (exceptional) type F \\
1198 |\grpG| & G & group of (exceptional) type G \\
1199 \end{longtable}
1200 %
1201
1202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1204 \section{Information}
1205
1206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1207 \subsection{Copyright}
1208
1209 Copyright \copyright{} \thecopyright/
1210
1211 This work may be distributed and/or modified under the
1212 conditions of the \LaTeX{} Project Public License, either version 1.3
1213 of this license or (at your option) any later version.
1214 The latest version of this license is in
1215 \url{https://www.latex-project.org/lppl.txt}
1216 and version 1.3c or later is part of all distributions of \LaTeX{}
1217 version 2008 or later.
1218
1219 This work has the LPPL maintenance status `maintained'.
1220
1221 The Current Maintainer of this work is Niklas Beisert.
1222
1223 This work consists of the files
1224 |README.txt|, \verbpkg|.ins| and \verbpkg|.dtx|
1225 as well as the derived files listed below.
1226
1227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1228 \subsection{Files and Installation}
1229
1230 The package consists of the files:
1231 %
1232 \begin{longtable}{ll}
1233 |README.txt| & readme file \\
1234 \verbpkg|.ins| & installation file \\
1235 \verbpkg|.dtx| & source file \\
1236 \verbpkg|.sty| & package file \\
1237 \verbpkg|-samp.tex| & sample file \\
1238 \verbpkg|.pdf| & documentation \\
1239 \end{longtable}
1240 %
1241 The distribution consists of the files
1242 |README.txt|, \verbpkg|.ins| and \verbpkg|.dtx|.
1243 %
1244 \begin{itemize}
1245 \item
1246 Run \LaTeX{} on \verbpkg|.ins| to create the package \verbpkg|.sty|
1247 and further documentation files.
1248 \item
1249 Copy the file \verbpkg|.sty| to an appropriate directory of your \LaTeX{}
1250 distribution, e.g.\ \textit{texmf-root}|/tex/latex/|\verbpkg.
1251 \item
1252 Alternatively, you may copy \verbpkg|.sty| to your project directory.
1253 \item
1254 Run (pdf)\LaTeX{} on \verbpkg|.dtx|
1255 to compile the documentation \verbpkg|.pdf| (this file).
1256 \end{itemize}
1257
1258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1259 \subsection{Related CTAN Packages}
1260
1261 The package is related to other packages available at CTAN:
1262 %
1263 \begin{itemize}
1264 \item
1265 This package uses the package \ctanpkg{keyval}
1266 to process the options for the package, environments and macros.
1267 Compatibility with the \ctanpkg{keyval} package
1268 has been tested with v1.15 (\markdate{2014-10-28}).
1269 \item
1270 This package is designed to be compatible with
1271 the package \ctanpkg{amsmath}.
1272 To prevent \ctanpkg{amsmath} from overwriting some features,
1273 it should be loaded \emph{before} the present package.
1274 Compatibility with the \ctanpkg{amsmath} package
1275 has been tested with v2.17a (\markdate{2017-09-02}).
1276 \item
1277 This package reproduces the functionality of the
1278 package \ctanpkg{fixmath} v0.9 (\markdate{2000-04-11})
1279 from the bundle \ctanpkg{was}.
1280 \item
1281 Functionality to typeset common fractions is also provided by
1282 the packages \ctanpkg{nicefrac}
1283 from the bundle \ctanpkg{units}
1284 and \ctanpkg{xfrac}
1285 offering a more advanced implementation.
1286 \item
1287 This package cooperates with the package \ctanpkg{beamer}
1288 in not changing colours for the root exponent.
1289 Compatibility with the \ctanpkg{beamer} package
1290 has been tested with v3.77 (\markdate{2026-01-22}).
1291 \end{itemize}
1292
1293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 \iffalse
1295 \subsection{Feature Suggestions}
1296
1297 The following is a list of features which may be useful for future
1298 versions of this package:
1299 %
1300 \begin{itemize}
1301 \item
1302 set of elliptic functions and constants
1303 \item
1304 improvement for vector accent plancement
1305 \item
1306 \mathup: no need as \mathrm does just that in whatever font
1307 \item
1308 alternative representations for some operators
1309 \end{itemize}
1310
1311 \fi
1312
1313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1314 \subsection{Revision History}
1315
1316 \iffalse
1317
1318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1319 \paragraph{vN.N.N+:} \markdate{20YY-MM-DD}
1320
1321 \begin{itemize}
1322 \item
1323 \ldots
1324 \end{itemize}
1325
1326 \fi
1327
1328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1329 \paragraph{v1.2.1:} \markdate{2026-04-08}
1330
1331 \begin{itemize}
1332 \item
1333 catch upright pi at end of preamble
1334 \item
1335 fixed error due to open conditional statements
1336 \end{itemize}
1337
1338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1339 \paragraph{v1.2:} \markdate{2026-03-23}
1340
1341 \begin{itemize}
1342 \item
1343 added unit element |\unitel| in various representations
1344 \item
1345 adjoint action |\ad|, volume |\Vol| and dual operator |\dualop|
1346 \item
1347 added transposition |\trans|, hermitian conjugation |\hconj|,
1348 complex conjugation |\conj| and dualisation |\dual|
1349 \item
1350 added standard finite and Lie groups |\grp|\ldots
1351 \item
1352 fix for not applying |math text| colour for root exponent in \ctanpkg{beamer}
1353 \item
1354 use |\muexpr| to protect muskip expressions
1355 \item
1356 use elementary register manipulations
1357 \item
1358 package maintenance
1359 \end{itemize}
1360
1361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1362 \paragraph{v1.1.3:} \markdate{2025-03-25}
1363
1364 \begin{itemize}
1365 \item
1366 declared more features as robust commands (for use in titles, captions, etc.;
1367 thanks to Jon\'a\v{s} Dujava for bug report)
1368 \item
1369 maintenance and manual update
1370 \end{itemize}
1371
1372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1373 \paragraph{v1.12:} \markdate{2024-11-18}
1374
1375 \begin{itemize}
1376 \item
1377 fixed loading without \ctanpkg{amsmath}
1378 \end{itemize}
1379
1380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1381 \paragraph{v1.11:} \markdate{2024-10-25}
1382
1383 \begin{itemize}
1384 \item
1385 fixed misspelled definition |\End|
1386 \end{itemize}
1387
1388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1389 \paragraph{v1.1:} \markdate{2024-10-23}
1390
1391 \begin{itemize}
1392 \item
1393 added feature |genop| for additional functions, operators and symbols
1394 \item
1395 added feature |reim| to change the definitions
1396 of |\Re| and |\Im| to `Re' and `Im'
1397 \item
1398 added features |trig| and |hyp| to complete the definitions
1399 of trigonometric and hypberbolic functions
1400 \item
1401 added feature |mapchar| to represent characteristics of maps
1402 \item
1403 added feature |mapclass| to represent structure-preserving maps
1404 \item
1405 added feature |vecdiff| to represent vector differential operators
1406 \item
1407 added representation for mathematical constants $e$, $i$, $\pi$
1408 \item
1409 added features |der| and |diff| to represent derivative symbols
1410 \item
1411 added assorted symbols
1412 \item
1413 added feature |numset| and |numset| to represent number sets
1414 \end{itemize}
1415
1416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1417 \paragraph{v1.01:} \markdate{2018-12-30}
1418
1419 \begin{itemize}
1420 \item
1421 fix for |\vfrac| in aligned math
1422 \end{itemize}
1423
1424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1425 \paragraph{v1.0:} \markdate{2018-01-17}
1426
1427 \begin{itemize}
1428 \item
1429 first version published on CTAN
1430 \end{itemize}
1431
1432 %</main|manual>
1433 %<*main>
1434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1436 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1437
1438 \appendix
1439 %</main>
1440 %<*main|source>
1441 \raggedright
1442 \settowidth\MacroIndent{\rmfamily\scriptsize 000\ }
1443
1444 \DocInput{\thepkg/.dtx}
1445 %</main|source>
1446
1447 \end{document}
1448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1450 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1451 %</main|manual|source>
1452 % \fi
1453 %
1454 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1455 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1456 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1457 %
1458 %
1459 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1460 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1461 % \section{Sample}
1462 % \iffalse
1463 %<*sample>
1464 % \fi
1465 %
1466 % In this section we provide an example of how to use
1467 % some of the \ctanpkg{mathfixs} features.
1468 % We also test the behaviour in some special cases.
1469 %
1470 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1471 % \paragraph{Preamble.}
1472 %
1473 % Standard document class:
1474 % \begin{macrocode}
1475 \documentclass[12pt]{article}
1476 % \end{macrocode}
1477
1478 % Use package \ctanpkg{geometry} to adjust the page layout,
1479 % adjust the paragraph shape:
1480 % \begin{macrocode}
1481 \usepackage{geometry}
1482 \geometry{layout=a4paper}
1483 \geometry{paper=a4paper}
1484 \geometry{margin=3cm}
1485 \parindent0pt
1486 % \end{macrocode}
1487
1488 % Include \ctanpkg{amsmath}, \ctanpkg{amssymb}
1489 % and the \ctanpkg{mathfixs} package:
1490 % \begin{macrocode}
1491 \RequirePackage{amsmath,amssymb}
1492 \RequirePackage[autobold]{mathfixs}
1493 % \end{macrocode}
1494
1495 % Declare features to be implemented globally:
1496 % \begin{macrocode}
1497 \ProvideMathFix{greekcaps,mathbold}
1498 \ProvideMathFix{frac,rfrac,vfrac}
1499 \ProvideMathFix{multskip}
1500 \ProvideMathFix{der,diff}
1501 % \end{macrocode}
1502
1503 % Start document body:
1504 % \begin{macrocode}
1505 \begin{document}
1506 % \end{macrocode}
1507
1508 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1509 % \paragraph{Fractions.}
1510 % \begin{macrocode}
1511 \paragraph{Fractions.}
1512 % \end{macrocode}
1513
1514 % Fraction spacing:
1515 % \begin{macrocode}
1516 \[
1517 x\frac{a+b}{c+d}\frac{e}{f}.
1518 \]
1519 % \end{macrocode}
1520
1521 % Vulgar fractions:
1522 % \begin{macrocode}
1523 Recipe for $\approx 3$ pancakes (scale accordingly):
1524 Whisk together one large egg, $\vfrac{1}{8} \ell$ milk,
1525 $50\mathinner{\mathrm{g}}$ flour
1526 (mix \vfrac{2}{3} wholemeal flour and \vfrac{1}{3} white flour); fry in pan.
1527 Feel free to use more flour than indicated.
1528 % \end{macrocode}
1529
1530 % Rational numbers:
1531 % \begin{macrocode}
1532 \[
1533 \rfrac{1}{2}x^2 + \rfrac{1}{6} y^3 + \rfrac{1}{4} x^2 y^2
1534 \]
1535 % \end{macrocode}
1536
1537 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1538 % \paragraph{Radicals.}
1539 % \begin{macrocode}
1540 \paragraph{Radicals.}
1541 % \end{macrocode}
1542
1543 % Original radicals spacing:
1544 % \begin{macrocode}
1545 \[
1546 y\sqrt{x}z,\qquad
1547 y\sqrt[]{x}z,\qquad
1548 y\sqrt[i]{x}z,\qquad
1549 y\sqrt[n]{x}z,\qquad
1550 y\sqrt[3]{x}z,\qquad
1551 y\sqrt[123]{x}z
1552 \]
1553 % \end{macrocode}
1554
1555 % Radicals spacing
1556 % (feature introduced in document body):
1557 % \begin{macrocode}
1558 \ProvideMathFix{root}
1559 \[
1560 y\sqrt{x}z,\qquad
1561 y\sqrt[]{x}z,\qquad
1562 y\sqrt[i]{x}z,\qquad
1563 y\sqrt[n]{x}z,\qquad
1564 y\sqrt[3]{x}z,\qquad
1565 y\sqrt[123]{x}z
1566 \]
1567 % \end{macrocode}
1568
1569 % Radicals with closing mark
1570 % (using a locally defined option):
1571 % \begin{macrocode}
1572 \[
1573 \ProvideMathFix{rootclose}
1574 y\sqrt{x}z,\qquad
1575 y\sqrt[]{x}z,\qquad
1576 y\sqrt[i]{x}z,\qquad
1577 y\sqrt[n]{x}z,\qquad
1578 y\sqrt[3]{x}z,\qquad
1579 y\sqrt[123]{x}z
1580 \]
1581 % \end{macrocode}
1582
1583 % Radicals with class |\mathinner|:
1584 % \begin{macrocode}
1585 \[
1586 \ProvideMathFix{rootclass={\mathinner}}
1587 y\sqrt{x}z,\qquad
1588 y\sqrt[]{x}z,\qquad
1589 y\sqrt[i]{x}z,\qquad
1590 y\sqrt[n]{x}z,\qquad
1591 y\sqrt[3]{x}z,\qquad
1592 y\sqrt[123]{x}z
1593 \]
1594 % \end{macrocode}
1595
1596 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1597 % \paragraph{Spaces Representing Multiplication and Derivative Symbols.}
1598 % \begin{macrocode}
1599 \paragraph{Spaces Representing Multiplication and Derivative Symbols.}
1600 % \end{macrocode}
1601
1602 % Explicit spacing:
1603 % \begin{macrocode}
1604 \[
1605 \int x\.\der x
1606 \]
1607 % \end{macrocode}
1608
1609 % Implicit spacing:
1610 % \begin{macrocode}
1611 \[
1612 \int x\diff{x}
1613 \]
1614 % \end{macrocode}
1615
1616 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1617 % \paragraph{Greek Letters.}
1618 % \begin{macrocode}
1619 \paragraph{Greek Letters.}
1620 % \end{macrocode}
1621
1622 % Capital letters:
1623 % \begin{macrocode}
1624 \[
1625 \Gamma \qquad
1626 \mathrm{\Gamma} \qquad
1627 c\operatorname{\Gamma}(x)
1628 \]
1629 % \end{macrocode}
1630
1631 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1632 % \paragraph{Bold Text with Math Symbols.}
1633 % \begin{macrocode}
1634 \paragraph{Bold Text with Math Symbols: $abc123\alpha\Gamma$.}
1635 % \end{macrocode}
1636
1637 % Bold text:
1638 % \begin{macrocode}
1639 \[
1640 aG\alpha\Gamma
1641 \qquad\mathbold{aG\alpha\Gamma}
1642 \qquad\ProvideMathFix{greeklower}\mathbold{aG\alpha\Gamma}
1643 \]
1644 % \end{macrocode}
1645
1646 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1647 % \paragraph{Real and Imaginary Parts.}
1648 % \begin{macrocode}
1649 \paragraph{Real and Imaginary Parts.}
1650 % \end{macrocode}
1651
1652 % Change representation for |\Re| and |\Im|:
1653 % \begin{macrocode}
1654 \[
1655 \Re(z),\Im(z)
1656 \qquad\ProvideMathFix{reim}
1657 \Re(z),\Im(z)
1658 \qquad\ProvideMathFix{reim={\nRe\nIm}}
1659 \nRe(z),\nIm(z)
1660 \]
1661 % \end{macrocode}
1662
1663 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1664 % \paragraph{Functions, Operators, Symbols.}
1665 % \begin{macrocode}
1666 \paragraph{Functions, Operators, Symbols.}
1667 % \end{macrocode}
1668
1669 % Some examples of vector differential operators:
1670 % \begin{macrocode}
1671 \[
1672 \ProvideMathFix{vecdiff,lapl,defeq}
1673 \lapl f=\div\grad f,
1674 \qquad
1675 \lapl v=\grad\div v-\curl\curl v,
1676 \]
1677 % \end{macrocode}
1678 % Some examples of mathematical constants:
1679 % \begin{macrocode}
1680 \[
1681 \ProvideMathFix{econst,iunit,piconst}
1682 \econst^{\iunit\piconst}=-1,
1683 \qquad
1684 \ProvideMathFix{econst*,iunit*,piconst*}
1685 \econst^{\iunit\piconst}=-1,
1686 \qquad
1687 \ProvideMathFix{econst,defeq,iunit*nb,numsets}
1688 z\defeq x+\iunit y=r\econst^{\iunit\theta}\in\Complex,
1689 \quad x,y,r,\theta\in\Real
1690 \]
1691 % \end{macrocode}
1692 % Some examples of operators and symbols:
1693 % \begin{macrocode}
1694 \[
1695 \ProvideMathFix{res,hyp,iunit*,piconst*}
1696 \res_{z=\iunit \piconst n} \csch(z)=(-1)^n
1697 \]
1698 % \end{macrocode}
1699
1700 % End of document body:
1701 % \begin{macrocode}
1702 \end{document}
1703 % \end{macrocode}
1704 % \iffalse
1705 %</sample>
1706 % \fi
1707 %
1708 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1709 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1710 % \section{Implementation}
1711 % \iffalse
1712 %<*package>
1713 % \fi
1714 %
1715 % In this section we describe the package \verbpkg|.sty|.
1716
1717 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1718 % \paragraph{Required Packages.}
1719 %
1720 % The package loads the package
1721 % \ctanpkg{keyval}
1722 % if not yet present.
1723 % \ctanpkg{keyval} is used for extended options processing:
1724 % \begin{macrocode}
1725 \RequirePackage{keyval}
1726 % \end{macrocode}
1727
1728 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1729 % \paragraph{General Definitions.}
1730 %
1731 % \macro{\mafx@letcs}
1732 % \macro{\mafx@mathopfont}
1733 % Define some auxiliary macros for the package.
1734 % |\mafx@letcs| makes a |\let| assignment on the csname |#1|.
1735 % |\mafx@mathopfont| encapsules |\operator@font| within a block.
1736 % \begin{macrocode}
1737 \def\mafx@letcs#1{\expandafter\let\csname#1\endcsname}
1738 \DeclareRobustCommand{\mafx@mathopfont}[1]{{\operator@font#1}}
1739 % \end{macrocode}
1740
1741 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1742 % \paragraph{Automatically Bold Maths.}
1743 %
1744 % \macro{\bfseries}
1745 % \macro{\mdseries}
1746 % \macro{\normalfont}
1747 % Define replacements for |\bfseries|, |\mdseries| and |\normalfont|
1748 % by appending |\boldmath| or |\unboldmath|
1749 % (if not already in math mode where font selection works differently).
1750 % The chain of |\expandafter| directives fills in the original definition:
1751 % \begin{macrocode}
1752 \expandafter\DeclareRobustCommand\expandafter\mafx@bfseries\expandafter
1753 {\bfseries\ifmmode\else\boldmath\fi}
1754 \expandafter\DeclareRobustCommand\expandafter\mafx@mdseries\expandafter
1755 {\mdseries\ifmmode\else\unboldmath\fi}
1756 \expandafter\DeclareRobustCommand\expandafter\mafx@normalfont\expandafter
1757 {\normalfont\ifmmode\else\unboldmath\fi}
1758 % \end{macrocode}
1759
1760 % \macro{autobold}
1761 % Implement the |autobold| fix:
1762 % \begin{macrocode}
1763 \define@key{mafx@}{autobold}[]{%
1764 \let\bfseries=\mafx@bfseries
1765 \let\mdseries=\mafx@mdseries
1766 \let\normalfont=\mafx@normalfont
1767 }
1768 % \end{macrocode}
1769
1770 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1771 % \paragraph{Bold Italic Math.}
1772 %
1773 % \macro{mathbold}
1774 % \macro{\mathbold}
1775 % Define a new math alphabet |\mathbold|
1776 % as the bold series and italic shape
1777 % of the standard computer modern math font
1778 % (see package \ctanpkg{fixmath}):
1779 %
1780 % \begin{macrocode}
1781 \DeclareMathAlphabet{\mafx@mathbold}{OML}{cmm}{b}{it}
1782 % \end{macrocode}
1783
1784 % \macro{autobold}
1785 % Implement |\mathbold| (or alterantive macro name):
1786 % \begin{macrocode}
1787 \define@key{mafx@}{mathbold}[\mathbold]{\let#1=\mafx@mathbold}
1788 % \end{macrocode}
1789
1790 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1791 % \paragraph{Spacing Adjustment for Fractions.}
1792 %
1793 % Save primitive definition of |\over| into |\@@over|
1794 % (compatible with \ctanpkg{amsmath}):
1795 %
1796 % \begin{macrocode}
1797 \ifdefined\@@over\else\let\@@over=\over\fi
1798 % \end{macrocode}
1799
1800 % Define math class selectors for fractions (without/with delimiters):
1801 % \begin{macrocode}
1802 \let\mafx@frac@class=\mathinner
1803 \def\mafx@frac@delimclass{\mathopen{}\mathclose}
1804 % \end{macrocode}
1805
1806 % \macro{\frac}
1807 % Define replacement for |\frac| which uses a configurable
1808 % math class selector:
1809 % \begin{macrocode}
1810 \DeclareRobustCommand{\mafx@frac}[2]{%
1811 \mafx@frac@class{\begingroup#1\endgroup\@@over#2}}
1812 % \end{macrocode}
1813
1814 % \macro{\genfrac}
1815 % Define replacement for |\@genfrac| (called by |\genfrac|)
1816 % which uses the appropriate math class selector.
1817 % If the package \ctanpkg{amsmath} is not loaded, this definition will
1818 % have no impact:
1819 % \begin{macrocode}
1820 \DeclareRobustCommand{\mafx@@genfrac}[5]{\begingroup
1821 \ifx#2\@@overwithdelims\let\mafx@frac@class\mafx@frac@delimclass\fi
1822 \ifx#2\@@abovewithdelims\let\mafx@frac@class\mafx@frac@delimclass\fi
1823 \ifx#2\@@atopwithdelims\let\mafx@frac@class\mafx@frac@delimclass\fi
1824 \mafx@frac@class{#1{\begingroup#4\endgroup#2#3\relax#5}}%
1825 \endgroup}
1826 % \end{macrocode}
1827
1828 % \macro{frac}
1829 % Implement the replacement for |\frac| and |\genfrac|:
1830 % \begin{macrocode}
1831 \define@key{mafx@}{frac}[]{%
1832 \let\frac=\mafx@frac
1833 \let\@genfrac=\mafx@@genfrac
1834 }
1835 % \end{macrocode}
1836
1837 % \macro{fracclass}
1838 % \macro{fracdelimclass}
1839 % Configure the math classes for fractions (without/with delimiters):
1840 % \begin{macrocode}
1841 \define@key{mafx@}{fracclass}{\def\mafx@frac@class{#1}}
1842 \define@key{mafx@}{fracdelimclass}{\def\mafx@frac@delimclass{#1}}
1843 % \end{macrocode}
1844
1845 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1846 % \paragraph{Small Fractions.}
1847 %
1848 % \macro{\rfrac}
1849 % Define a fraction in text style or smaller
1850 % using the ordinary math class (no surrounding space), e.g.: $\frac{1}{2}$:
1851 % \begin{macrocode}
1852 \DeclareRobustCommand{\mafx@rfrac}[2]{{\mathchoice
1853 {\textstyle{\begingroup#1\endgroup\@@over#2}}%
1854 {\begingroup#1\endgroup\@@over#2}%
1855 {\begingroup#1\endgroup\@@over#2}%
1856 {\begingroup#1\endgroup\@@over#2}}}
1857 % \end{macrocode}
1858
1859 % \macro{rfrac}
1860 % Implement |\rfrac| (or alternative macro name):
1861 % \begin{macrocode}
1862 \define@key{mafx@}{rfrac}[\rfrac]{\let#1=\mafx@rfrac}
1863 % \end{macrocode}
1864
1865 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1866 % \paragraph{Vulgar Fractions.}
1867 %
1868 % Define the math class and spacing parameters as (negative) spaces
1869 % around the dividing slash:
1870 % \begin{macrocode}
1871 \let\mafx@vfrac@class=\mathinner
1872 \def\mafx@vfrac@preskip{\thinmuskip}
1873 \def\mafx@vfrac@postskip{0.6667\thinmuskip}
1874 % \end{macrocode}
1875 %
1876 % \macro{\vfrac}
1877 % Define a vulgar representation of a rational number, e.g.: $^1\!/\!_2$.
1878 % Automatically switch to math mode if in text mode:
1879 % \begin{macrocode}
1880 \DeclareRobustCommand{\mafx@vfrac}[2]{\ifmmode
1881 \mafx@vfrac@class{\textstyle
1882 ^{#1}\mkern-\muexpr\mafx@vfrac@preskip\relax
1883 /\mkern-\muexpr\mafx@vfrac@postskip\relax_{#2}}%
1884 \else$\mafx@vfrac{#1}{#2}$\fi}
1885 % \end{macrocode}
1886
1887 % \macro{vfrac}
1888 % Implement |\vfrac| (or alternative macro name):
1889 % \begin{macrocode}
1890 \define@key{mafx@}{vfrac}[\vfrac]{\let#1=\mafx@vfrac}
1891 % \end{macrocode}
1892
1893 % \macro{vfracclass}
1894 % \macro{vfracskippre}
1895 % \macro{vfracskippost}
1896 % Define configurable skip parameters for |\vfrac|:
1897 % \begin{macrocode}
1898 \define@key{mafx@}{vfracclass}{\def\mafx@vfrac@class{#1}}
1899 \define@key{mafx@}{vfracskippre}{\def\mafx@vfrac@preskip{#1}}
1900 \define@key{mafx@}{vfracskippost}{\def\mafx@vfrac@postskip{#1}}
1901 % \end{macrocode}
1902
1903 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1904 % \paragraph{Interaction with \markpkg{beamerbasecolor}.}
1905 %
1906 % Suppress changing colors in inner math structures
1907 % when \ctanpkg{beamer} class is loaded:
1908 % \begin{macrocode}
1909 \let\mafx@beamerbasecolor@fix\@empty
1910 \AddToHook{package/beamerbasecolor/after}{%
1911 \def\mafx@beamerbasecolor@fix{\donotcoloroutermaths}}
1912 % \end{macrocode}
1913
1914 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1915 % \paragraph{Spacing Adjustment for Roots.}
1916 %
1917 % Define some parameters for the improved root macros.
1918 % |\mafx@root@close| stores the relative height
1919 % where the closing bar for the radical starts;
1920 % empty disables the closing bar.
1921 % |\mafx@root@class| stores the math class for a root.
1922 % |\mafx@root@endskip| stores space to be added after the radicant
1923 % but within the radical in math units.
1924 % |\mafx@root@preskip| and |\mafx@root@postskip| store space to be added
1925 % before or after the radical sign:
1926 % \begin{macrocode}
1927 \let\mafx@root@close=\@empty
1928 \def\mafx@root@class{}
1929 \def\mafx@root@endskip{0.6667\thinmuskip}
1930 \def\mafx@root@preskip{0mu}
1931 \def\mafx@root@postskip{0.3333\thinmuskip}
1932 % \end{macrocode}
1933
1934 % \macro{\sqrt}
1935 % Replacement for |\sqrt| which passes an
1936 % empty first argument instead of calling |\sqrtsign|:
1937 % \begin{macrocode}
1938 \DeclareRobustCommand\mafx@sqrt{\@ifnextchar[\@sqrt{\@sqrt[]}}
1939 \def\mafx@@sqrt[#1]{\root#1\of}
1940 % \end{macrocode}
1941
1942 % \macro{\root}
1943 % Replacement for |\root| \ldots|\of|
1944 % which stores the |\leftroot| and |\uproot| parameters
1945 % specified in the exponent (see package \ctanpkg{amsmath}).
1946 % It does so by first storing them in global parameters
1947 % and then converting them to local ones to avoid
1948 % interference with nested radicals.
1949 % As usual, the macro then passes on to |\r@@t|
1950 % with |\mathpalette|:
1951 % \begin{macrocode}
1952 \def\mafx@root#1\of{%
1953 \setbox\rootbox\hbox{\mafx@beamerbasecolor@fix$\m@th\scriptscriptstyle{%
1954 \gdef\mafx@gleftroot{0}\gdef\mafx@guproot{0}%
1955 \def\leftroot##1{\gdef\mafx@gleftroot{##1}}%
1956 \def\uproot##1{\gdef\mafx@guproot{##1}}%
1957 #1}$}%
1958 \let\mafx@leftroot=\mafx@gleftroot
1959 \let\mafx@uproot=\mafx@guproot
1960 \mathpalette\r@@t}
1961 % \end{macrocode}
1962
1963 % The replacement for |\r@@t| typesets the radical by
1964 % placing the exponent in an elevated box.
1965 % First, select desirect math class:
1966 % \begin{macrocode}
1967 \def\mafx@r@@t#1#2{\mafx@root@class{%
1968 % \end{macrocode}
1969 % Determine the font selector for the current style:
1970 % \begin{macrocode}
1971 \ifx#1\scriptstyle\let\mafx@tmp@fontsel=\scriptfont\else
1972 \ifx#1\scriptscriptstyle\let\mafx@tmp@fontsel=\scriptscriptfont\else
1973 \let\mafx@tmp@fontsel=\textfont\fi\fi
1974 % \end{macrocode}
1975 % Generate a radical with empty radicand in cramped style
1976 % (see package \ctanpkg{mathtools})
1977 % at the desired height and depth and store in a box
1978 % for subsequent measurements:
1979 % \begin{macrocode}
1980 \sbox\z@{$\m@th#1\nulldelimiterspace=\z@\radical\z@{#2}$}%
1981 \dimen@\ht\z@
1982 \ifx#1\displaystyle
1983 \advance\dimen@-\fontdimen8\textfont3\relax
1984 \advance\[email protected]\fontdimen5\textfont2\relax
1985 \else
1986 \advance\[email protected]\fontdimen8\mafx@tmp@fontsel3\relax
1987 \fi
1988 \setbox\z@=\hbox{$\m@th#1\sqrtsign{%
1989 \vrule width\z@ height\dimen@ depth\dp\z@}$}%
1990 % \end{macrocode}
1991 % Shift to start of exponent box such that end
1992 % will reside at 60\% of radical sign.
1993 % Do not shift if exponent box is sufficiently wide:
1994 % \begin{macrocode}
1995 \dimen@\dimexpr0.6\wd\z@-\wd\rootbox\relax
1996 \ifdim\dimen@>\z@\else\dimen@\z@\fi
1997 \kern\dimen@
1998 % \end{macrocode}
1999 % Compute elevation of exponent box as 60\% of radical sign.
2000 % Add length specified by |\uproot|:
2001 % \begin{macrocode}
2002 \setbox\@ne=\hbox{$\m@th#1\mskip\muexpr\mafx@uproot mu\relax$}%
2003 \dimen@\dimexpr0.6\ht\[email protected]\dp\z@+\wd\@ne\relax
2004 % \end{macrocode}
2005 % Place exponent box and return to intended start of radical sign:
2006 % \begin{macrocode}
2007 \mkern-\muexpr\mafx@leftroot mu\relax
2008 \raise\dimen@\copy\rootbox
2009 \mkern\muexpr\mafx@leftroot mu\relax
2010 \kern-0.6\wd\z@
2011 % \end{macrocode}
2012 % Place radical adding extra kernings |\mafx@root@preskip| and
2013 % |\mafx@root@endskip|:
2014 % \begin{macrocode}
2015 \mkern\muexpr\mafx@root@preskip\relax
2016 \sqrtsign{#2\mskip\muexpr\mafx@root@endskip\relax}%
2017 % \end{macrocode}
2018 % Add a closing bar to the radical,
2019 % see \url{http://en.wikibooks.org/wiki/LaTeX/Mathematics}.
2020 % If |\mafx@root@close| is empty, ignore.
2021 % Determine the thickness of the rule as font dimension x8.
2022 % Draw a vertical rule starting from relative height |\mafx@root@close|
2023 % of the radical:
2024 % \begin{macrocode}
2025 \ifx\mafx@root@close\@empty\else
2026 \dimen@\fontdimen8\mafx@tmp@fontsel3\relax
2027 \lower\dimen@\hbox{%
2028 \vrule width\dimen@ height\ht\z@ depth -\mafx@root@close\ht\z@}%
2029 \fi
2030 % \end{macrocode}
2031 % Finally, add kerning |\mafx@root@postskip|:
2032 % \begin{macrocode}
2033 \mkern\mafx@root@postskip}}
2034 % \end{macrocode}
2035
2036 % \macro{root}
2037 % Implement replacement |\sqrt| and |\root|:
2038 % \begin{macrocode}
2039 \define@key{mafx@}{root}[]{%
2040 \let\sqrt=\mafx@sqrt
2041 \let\@sqrt=\mafx@@sqrt
2042 \let\root=\mafx@root
2043 \let\r@@t=\mafx@r@@t
2044 }
2045 % \end{macrocode}
2046
2047 % \macro{rootclose}
2048 % \macro{rootclass}
2049 % \macro{rootskipend}
2050 % \macro{rootskippre}
2051 % \macro{rootskipbefore}
2052 % Define configurable parameters for alternative root:
2053 % \begin{macrocode}
2054 \define@key{mafx@}{rootclose}[0.8]{\def\mafx@root@close{#1}}
2055 \define@key{mafx@}{rootclass}{\let\mafx@root@class=#1}
2056 \define@key{mafx@}{rootskipend}{\def\mafx@root@endskip{#1}}
2057 \define@key{mafx@}{rootskippre}{\def\mafx@root@preskip{#1}}
2058 \define@key{mafx@}{rootskippost}{\def\mafx@root@postskip{#1}}
2059 % \end{macrocode}
2060
2061 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2062 % \paragraph{Space Representing Multiplication.}
2063 %
2064 % \macro{\.}
2065 % Define |\.| to represent a thin math skip when in math mode.
2066 % Retain original definition as an accent in text mode.
2067 % Switch is performed by temporarily storing the appropriate macro
2068 % which is subsequently issued so that the correct number of
2069 % arguments are fetched:
2070 % \begin{macrocode}
2071 \let\mafx@old@dot=\.
2072 \def\mafx@dot@skip{\thinmuskip}
2073 \def\mafx@dot{\mskip\muexpr\mafx@dot@skip\relax}
2074 \DeclareRobustCommand{\mafx@per@dot}{%
2075 \ifmmode\expandafter\mafx@dot\else\expandafter\mafx@old@dot\fi}
2076 % \end{macrocode}
2077
2078 % \macro{multskip}
2079 % Implement definition of |\.|:
2080 % \begin{macrocode}
2081 \define@key{mafx@}{multskip}[\thinmuskip]{%
2082 \let\.=\mafx@per@dot
2083 \def\mafx@dot@skip{#1}%
2084 }
2085 % \end{macrocode}
2086
2087 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2088 % \paragraph{Italic Capital Greek Letters.}
2089 %
2090 % \macro{\Gamma}
2091 % \macro{...}
2092 % Define capital Greek letters as letters
2093 % (instead of the default assignment as operators).
2094 % This implementation follows the package \ctanpkg{fixmath}:
2095 % \begin{macrocode}
2096 \DeclareMathSymbol{\mafx@Gamma}{\mathalpha}{letters}{0}
2097 \DeclareMathSymbol{\mafx@Delta}{\mathalpha}{letters}{1}
2098 \DeclareMathSymbol{\mafx@Theta}{\mathalpha}{letters}{2}
2099 \DeclareMathSymbol{\mafx@Lambda}{\mathalpha}{letters}{3}
2100 \DeclareMathSymbol{\mafx@Xi}{\mathalpha}{letters}{4}
2101 \DeclareMathSymbol{\mafx@Pi}{\mathalpha}{letters}{5}
2102 \DeclareMathSymbol{\mafx@Sigma}{\mathalpha}{letters}{6}
2103 \DeclareMathSymbol{\mafx@Upsilon}{\mathalpha}{letters}{7}
2104 \DeclareMathSymbol{\mafx@Phi}{\mathalpha}{letters}{8}
2105 \DeclareMathSymbol{\mafx@Psi}{\mathalpha}{letters}{9}
2106 \DeclareMathSymbol{\mafx@Omega}{\mathalpha}{letters}{10}
2107 % \end{macrocode}
2108
2109 % \macro{greekcaps}
2110 % Implement italic capital Greek letters.
2111 % The optional argument is used as a prefix for the definitions:
2112 % \begin{macrocode}
2113 \define@key{mafx@}{greekcaps}[]{%
2114 \mafx@letcs{#1Gamma}=\mafx@Gamma
2115 \mafx@letcs{#1Delta}=\mafx@Delta
2116 \mafx@letcs{#1Theta}=\mafx@Theta
2117 \mafx@letcs{#1Lambda}=\mafx@Lambda
2118 \mafx@letcs{#1Xi}=\mafx@Xi
2119 \mafx@letcs{#1Pi}=\mafx@Pi
2120 \mafx@letcs{#1Sigma}=\mafx@Sigma
2121 \mafx@letcs{#1Upsilon}=\mafx@Upsilon
2122 \mafx@letcs{#1Phi}=\mafx@Phi
2123 \mafx@letcs{#1Psi}=\mafx@Psi
2124 \mafx@letcs{#1Omega}=\mafx@Omega
2125 }
2126 % \end{macrocode}
2127
2128 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2129 % \paragraph{Lowercase Greek Letters in Standard Math Type.}
2130 %
2131 % \macro{\alpha}
2132 % \macro{...}
2133 % Define lowercase Greek letters in standard type |\mathalpha|
2134 % (instead of the default assiment |\mathord|).
2135 % This implementation follows the package \ctanpkg{fixmath}:
2136 % \begin{macrocode}
2137 \DeclareMathSymbol{\mafx@alpha}{\mathalpha}{letters}{11}
2138 \DeclareMathSymbol{\mafx@beta}{\mathalpha}{letters}{12}
2139 \DeclareMathSymbol{\mafx@gamma}{\mathalpha}{letters}{13}
2140 \DeclareMathSymbol{\mafx@delta}{\mathalpha}{letters}{14}
2141 \DeclareMathSymbol{\mafx@epsilon}{\mathalpha}{letters}{15}
2142 \DeclareMathSymbol{\mafx@zeta}{\mathalpha}{letters}{16}
2143 \DeclareMathSymbol{\mafx@eta}{\mathalpha}{letters}{17}
2144 \DeclareMathSymbol{\mafx@theta}{\mathalpha}{letters}{18}
2145 \DeclareMathSymbol{\mafx@iota}{\mathalpha}{letters}{19}
2146 \DeclareMathSymbol{\mafx@kappa}{\mathalpha}{letters}{20}
2147 \DeclareMathSymbol{\mafx@lambda}{\mathalpha}{letters}{21}
2148 \DeclareMathSymbol{\mafx@mu}{\mathalpha}{letters}{22}
2149 \DeclareMathSymbol{\mafx@nu}{\mathalpha}{letters}{23}
2150 \DeclareMathSymbol{\mafx@xi}{\mathalpha}{letters}{24}
2151 \DeclareMathSymbol{\mafx@pi}{\mathalpha}{letters}{25}
2152 \DeclareMathSymbol{\mafx@rho}{\mathalpha}{letters}{26}
2153 \DeclareMathSymbol{\mafx@sigma}{\mathalpha}{letters}{27}
2154 \DeclareMathSymbol{\mafx@tau}{\mathalpha}{letters}{28}
2155 \DeclareMathSymbol{\mafx@upsilon}{\mathalpha}{letters}{29}
2156 \DeclareMathSymbol{\mafx@phi}{\mathalpha}{letters}{30}
2157 \DeclareMathSymbol{\mafx@chi}{\mathalpha}{letters}{31}
2158 \DeclareMathSymbol{\mafx@psi}{\mathalpha}{letters}{32}
2159 \DeclareMathSymbol{\mafx@omega}{\mathalpha}{letters}{33}
2160 \DeclareMathSymbol{\mafx@varepsilon}{\mathalpha}{letters}{34}
2161 \DeclareMathSymbol{\mafx@vartheta}{\mathalpha}{letters}{35}
2162 \DeclareMathSymbol{\mafx@varpi}{\mathalpha}{letters}{36}
2163 \DeclareMathSymbol{\mafx@varphi}{\mathalpha}{letters}{39}
2164 \DeclareMathSymbol{\mafx@varrho}{\mathalpha}{letters}{37}
2165 \DeclareMathSymbol{\mafx@varsigma}{\mathalpha}{letters}{38}
2166 % \end{macrocode}
2167
2168 % \macro{greeklower}
2169 % Implement standard type lowercase Greek letters.
2170 % The optional argument is used as a prefix for the definitions:
2171 % \begin{macrocode}
2172 \define@key{mafx@}{greeklower}[]{%
2173 \mafx@letcs{#1alpha}=\mafx@alpha
2174 \mafx@letcs{#1beta}=\mafx@beta
2175 \mafx@letcs{#1gamma}=\mafx@gamma
2176 \mafx@letcs{#1delta}=\mafx@delta
2177 \mafx@letcs{#1epsilon}=\mafx@epsilon
2178 \mafx@letcs{#1zeta}=\mafx@zeta
2179 \mafx@letcs{#1eta}=\mafx@eta
2180 \mafx@letcs{#1theta}=\mafx@theta
2181 \mafx@letcs{#1iota}=\mafx@iota
2182 \mafx@letcs{#1kappa}=\mafx@kappa
2183 \mafx@letcs{#1lambda}=\mafx@lambda
2184 \mafx@letcs{#1mu}=\mafx@mu
2185 \mafx@letcs{#1nu}=\mafx@nu
2186 \mafx@letcs{#1xi}=\mafx@xi
2187 \mafx@letcs{#1pi}=\mafx@pi
2188 \mafx@letcs{#1rho}=\mafx@rho
2189 \mafx@letcs{#1sigma}=\mafx@sigma
2190 \mafx@letcs{#1tau}=\mafx@tau
2191 \mafx@letcs{#1upsilon}=\mafx@upsilon
2192 \mafx@letcs{#1phi}=\mafx@phi
2193 \mafx@letcs{#1chi}=\mafx@chi
2194 \mafx@letcs{#1psi}=\mafx@psi
2195 \mafx@letcs{#1omega}=\mafx@omega
2196 \mafx@letcs{#1varepsilon}=\mafx@varepsilon
2197 \mafx@letcs{#1vartheta}=\mafx@vartheta
2198 \mafx@letcs{#1varpi}=\mafx@varpi
2199 \mafx@letcs{#1varphi}=\mafx@varphi
2200 \mafx@letcs{#1varrho}=\mafx@varrho
2201 \mafx@letcs{#1varsigma}=\mafx@varsigma
2202 }
2203 % \end{macrocode}
2204
2205 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2206 % \paragraph{Assorted Functions, Operators, Symbols.}
2207 %
2208 % The following definitions require \ctanpkg{amsopn}:
2209 % \begin{macrocode}
2210 \ifdefined\DeclareMathOperator
2211 % \end{macrocode}
2212
2213 % Define macros for assorted functions, operators, symbols:
2214 % \begin{macrocode}
2215 \DeclareMathOperator{\mafx@sgn}{sgn}
2216 \DeclareMathOperator*{\mafx@res}{res}
2217 \DeclareMathOperator{\mafx@lcm}{lcm}
2218 \DeclareMathOperator{\mafx@span}{span}
2219 \DeclareMathOperator{\mafx@diag}{diag}
2220 \DeclareMathOperator{\mafx@spec}{spec}
2221 \DeclareMathOperator{\mafx@const}{const}
2222 \DeclareMathOperator{\mafx@id}{id}
2223 \DeclareMathOperator{\mafx@tr}{tr}
2224 \DeclareMathOperator{\mafx@ad}{ad}
2225 \DeclareMathOperator{\mafx@Vol}{Vol}
2226 % \end{macrocode}
2227
2228 % Implement assorted functions, operators and symbols individually
2229 % with the option to adjust their macro names:
2230 % \begin{macrocode}
2231 \define@key{mafx@}{sgn}[\sgn]{\let#1=\mafx@sgn}
2232 \define@key{mafx@}{res}[\res]{\let#1=\mafx@res}
2233 \define@key{mafx@}{lcm}[\lcm]{\let#1=\mafx@lcm}
2234 \define@key{mafx@}{diag}[\diag]{\let#1=\mafx@diag}
2235 \define@key{mafx@}{span}[\Span]{\let#1=\mafx@span}
2236 \define@key{mafx@}{spec}[\spec]{\let#1=\mafx@spec}
2237 \define@key{mafx@}{const}[\const]{\let#1=\mafx@const}
2238 \define@key{mafx@}{id}[\id]{\let#1=\mafx@id}
2239 \define@key{mafx@}{tr}[\tr]{\let#1=\mafx@tr}
2240 \define@key{mafx@}{ad}[\ad]{\let#1=\mafx@ad}
2241 \define@key{mafx@}{Vol}[\Vol]{\let#1=\mafx@Vol}
2242 % \end{macrocode}
2243 %
2244 % \macro{genop}
2245 % Implement all assorted functions, operators and symbols:
2246 % \begin{macrocode}
2247 \define@key{mafx@}{genop}[]{%
2248 \ProvideMathFix{sgn,res,lcm,diag,span,spec,const}%
2249 }
2250 % \end{macrocode}
2251
2252 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2253 % \paragraph{Real and Imaginary Part Projectors in Text Form.}
2254 %
2255 % \macro{\Re}
2256 % \macro{\Im}
2257 % Define a different notation for real and imaginary part projectors are the
2258 % textual symbols `Re' and `Im':
2259 % \begin{macrocode}
2260 \let\mafx@orgRe=\Re
2261 \let\mafx@orgIm=\Im
2262 \DeclareMathOperator{\mafx@Re}{Re}
2263 \DeclareMathOperator{\mafx@Im}{Im}
2264 % \end{macrocode}
2265
2266 % \macro{reim}
2267 % Implement textual notation for \verb+\Re+ and \verb+\Im+:
2268 % \begin{macrocode}
2269 \define@key{mafx@}{reim}[\Re\Im]{%
2270 \expandafter\let\@firstoftwo#1=\mafx@Re
2271 \expandafter\let\@secondoftwo#1=\mafx@Im
2272 }
2273 \define@key{mafx@}{reim*}[\Re\Im]{%
2274 \expandafter\let\@firstoftwo#1=\mafx@orgRe
2275 \expandafter\let\@secondoftwo#1=\mafx@orgIm
2276 }
2277 % \end{macrocode}
2278
2279 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2280 % \paragraph{Remaining Inverse Trigonometric Functions.}
2281 %
2282 % \macro{\arccot}
2283 % \macro{\arcsec}
2284 % \macro{\arccsc}
2285 % Define remaining inverse trigonometric functions
2286 % and their inverses:
2287 % \begin{macrocode}
2288 \DeclareMathOperator{\mafx@arccot}{arccot}
2289 \DeclareMathOperator{\mafx@arcsec}{arcsec}
2290 \DeclareMathOperator{\mafx@arccsc}{arccsc}
2291 % \end{macrocode}
2292
2293 % \macro{trig}
2294 % Implement remaining trigonometric functions:
2295 % \begin{macrocode}
2296 \define@key{mafx@}{trig}[]{%
2297 \let\arccot=\mafx@arccot
2298 \let\arcsec=\mafx@arcsec
2299 \let\arccsc=\mafx@arccsc
2300 }
2301 % \end{macrocode}
2302
2303 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2304 % \paragraph{Remaining Hyperbolic Functions.}
2305 %
2306 % \macro{\sech}
2307 % \macro{\csch}
2308 % \macro{\ar...h}
2309 % Define remaining hyperbolic functions
2310 % and their inverses:
2311 % \begin{macrocode}
2312 \DeclareMathOperator{\mafx@sech}{sech}
2313 \DeclareMathOperator{\mafx@csch}{csch}
2314 \DeclareMathOperator{\mafx@arsinh}{arsinh}
2315 \DeclareMathOperator{\mafx@arcosh}{arcosh}
2316 \DeclareMathOperator{\mafx@artanh}{artanh}
2317 \DeclareMathOperator{\mafx@arcoth}{arcoth}
2318 \DeclareMathOperator{\mafx@arsech}{arsech}
2319 \DeclareMathOperator{\mafx@arcsch}{arcsch}
2320 % \end{macrocode}
2321
2322 % \macro{hyp}
2323 % Implement remaining hyperbolic functions:
2324 % \begin{macrocode}
2325 \define@key{mafx@}{hyp}[]{%
2326 \let\sech=\mafx@sech
2327 \let\csch=\mafx@csch
2328 \let\arsinh=\mafx@arsinh
2329 \let\arcosh=\mafx@arcosh
2330 \let\artanh=\mafx@artanh
2331 \let\arcoth=\mafx@arcoth
2332 \let\arsech=\mafx@arsech
2333 \let\arcsch=\mafx@arcsch
2334 }
2335 % \end{macrocode}
2336
2337 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2338 % \paragraph{Characteristics of Maps.}
2339 %
2340 % Define macros for characteristics of maps:
2341 % \begin{macrocode}
2342 \DeclareMathOperator{\mafx@dom}{dom}
2343 \DeclareMathOperator{\mafx@supp}{supp}
2344 \DeclareMathOperator{\mafx@codom}{codom}
2345 \DeclareMathOperator{\mafx@im}{im}
2346 \DeclareMathOperator{\mafx@rank}{rank}
2347 \DeclareMathOperator{\mafx@coker}{coker}
2348 % \end{macrocode}
2349
2350 % Implement characteristics of maps
2351 % with the option to adjust the macro name for |\im|
2352 % to evade potential clashes for two letter definition:
2353 % \begin{macrocode}
2354 \define@key{mafx@}{mapchar}[\im]{%
2355 \let\dom=\mafx@dom
2356 \let\supp=\mafx@supp
2357 \let\codom=\mafx@codom
2358 \let#1=\mafx@im
2359 \let\rank=\mafx@rank
2360 \let\coker=\mafx@coker
2361 }
2362 % \end{macrocode}
2363
2364 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2365 % \paragraph{Classes of Structure-Preserving Maps.}
2366 %
2367 % \macro{\Hom}
2368 % \macro{\End}
2369 % \macro{\Isom}
2370 % \macro{\Aut}
2371 % Define classes of structure-preserving maps:
2372 % \begin{macrocode}
2373 \DeclareMathOperator{\mafx@Hom}{Hom}
2374 \DeclareMathOperator{\mafx@End}{End}
2375 \DeclareMathOperator{\mafx@Isom}{Isom}
2376 \DeclareMathOperator{\mafx@Aut}{Aut}
2377 % \end{macrocode}
2378
2379 % \macro{mapclass}
2380 % Implement classes of structure-preserving maps:
2381 % \begin{macrocode}
2382 \define@key{mafx@}{mapclass}[]{%
2383 \let\Hom=\mafx@Hom
2384 \let\End=\mafx@End
2385 \let\Isom=\mafx@Isom
2386 \let\Aut=\mafx@Aut
2387 }
2388 % \end{macrocode}
2389
2390 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2391 % \paragraph{Differential Operators for Vectors.}
2392 %
2393 % \macro{\grad}
2394 % \macro{\div}
2395 % \macro{\curl}
2396 % Define differential operators gradient, divergence and curl
2397 % (alternative form rot):
2398 % \begin{macrocode}
2399 \DeclareMathOperator{\mafx@grad}{grad}
2400 \DeclareMathOperator{\mafx@div}{div}
2401 \DeclareMathOperator{\mafx@curl}{curl}
2402 \DeclareMathOperator{\mafx@rot}{rot}
2403 % \end{macrocode}
2404
2405 % \macro{vecdiff}
2406 % \macro{vecdiff*}
2407 % \macro{vecrot}
2408 % Implement differential operators for vectors individually
2409 % with the option to adjust their macro names.
2410 % Implement alternative rot for curl/rotor
2411 % with the option to adjust its macro name:
2412 % \begin{macrocode}
2413 \define@key{mafx@}{vecdiff}[]{%
2414 \let\grad=\mafx@grad
2415 \let\div=\mafx@div
2416 \let\curl=\mafx@curl
2417 }
2418 \define@key{mafx@}{vecdiff*}[]{%
2419 \let\grad=\mafx@grad
2420 \let\div=\mafx@div
2421 \let\curl=\mafx@rot
2422 }
2423 \define@key{mafx@}{vecrot}[\curl]{\let#1=\mafx@rot}
2424 % \end{macrocode}
2425
2426 % The above definitions required \ctanpkg{amsopn}:
2427 % \begin{macrocode}
2428 \fi
2429 % \end{macrocode}
2430
2431 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2432 % \paragraph{Mathematical Constants.}
2433 %
2434 % Try to declare upright and italic lowercase pi.
2435 % Use |\uppi| for upright |\pi| if available,
2436 % otherwise use plain |\pi| hoping for availability of an upright version:
2437 % \begin{macrocode}
2438 \def\mafx@piup{\operator@font\pi}
2439 \def\mafx@piit{\mathnormal{\pi}}
2440 \AddToHook{begindocument/end}{%
2441 \ifdefined\uppi\def\mafx@piup{\uppi}%
2442 \else\ifdefined\symup\def\mafx@piup{\symup{\pi}}\fi\fi
2443 \ifdefined\symit\def\mafx@piit{\symit{\pi}}\fi
2444 }
2445 % \end{macrocode}
2446 %
2447 % Declare some math alphabets for blackboard bold unit element:
2448 % \begin{macrocode}
2449 \DeclareMathAlphabet{\mafx@mathbfb}{OT1}{cmr}{b}{n}
2450 \DeclareMathAlphabet{\mafx@mathbfbx}{OT1}{cmr}{bx}{n}
2451 \ifdefined\bbfamily\let\mafx@mathbbold=\mathbb\else\IfFileExists{bbold.sty}{%
2452 \DeclareMathAlphabet{\mafx@mathbbold}{U}{bbold}{m}{n}}{}\fi
2453 \ifdefined\mathds\let\mafx@mathds=\mathds\else\IfFileExists{dsfont.sty}{%
2454 \DeclareMathAlphabet{\mafx@mathds}{U}{dsrom}{m}{n}}{}\fi
2455 \IfFileExists{dsfont.sty}{%
2456 \DeclareMathAlphabet{\mafx@mathdsr}{U}{dsrom}{m}{n}
2457 \DeclareMathAlphabet{\mafx@mathdss}{U}{dsss}{m}{n}
2458 }{}
2459 \ifdefined\mathbbm\let\mafx@mathds=\mathds\else\IfFileExists{bbm.sty}{%
2460 \DeclareMathAlphabet{\mafx@mathbbm}{U}{bbm}{m}{n}
2461 \SetMathAlphabet\mafx@mathbbm{bold}{U}{bbm}{bx}{n}
2462 \DeclareMathAlphabet{\mafx@mathbbmss}{U}{bbmss}{m}{n}
2463 \SetMathAlphabet\mafx@mathbbmss{bold}{U}{bbmss}{bx}{n}
2464 \DeclareMathAlphabet{\mafx@mathbbmtt}{U}{bbmtt}{m}{n}
2465 }{}\fi
2466 \ifdefined\mafx@mathds\let\mafx@mathbb=\mafx@mathds
2467 \else\ifdefined\mafx@mathbbm\let\mafx@mathbb=\mafx@mathbbm
2468 \else\ifdefined\mafx@mathbbold\let\mafx@mathbb=\mafx@mathbold
2469 \else\let\mafx@mathbb=\mathbf\fi\fi\fi
2470 % \end{macrocode}
2471
2472 % \macro{\econst}
2473 % \macro{\iunit}
2474 % \macro{\piconst}
2475 % \macro{\unitel}
2476 % Define macros for mathematical constants:
2477 % \begin{macrocode}
2478 \let\mafx@econst@class=\mathinner
2479 \DeclareRobustCommand{\mafx@econstup}{\mafx@econst@class{\operator@font e}}
2480 \DeclareRobustCommand{\mafx@econstit}{\mafx@econst@class{\mathnormal{e}}}
2481 \DeclareRobustCommand{\mafx@iunitup}{{\operator@font i}}
2482 \DeclareRobustCommand{\mafx@iunitit}{{\mathnormal{i}}}
2483 \DeclareRobustCommand{\mafx@iunitnb}{{\mathnormal{\mathring\imath}}}
2484 \DeclareRobustCommand{\mafx@piconstup}{{\mafx@piup}}
2485 \DeclareRobustCommand{\mafx@piconstit}{{\mafx@piit}}
2486 \DeclareRobustCommand{\mafx@unitelbb}{{\mafx@mathbb{1}}}
2487 \DeclareRobustCommand{\mafx@unitelds}{{\mafx@mathds{1}}}
2488 \DeclareRobustCommand{\mafx@uniteldsr}{{\mafx@mathdsr{1}}}
2489 \DeclareRobustCommand{\mafx@uniteldss}{{\mafx@mathdss{1}}}
2490 \DeclareRobustCommand{\mafx@unitelbbold}{{\mafx@mathbbold{1}}}
2491 \DeclareRobustCommand{\mafx@unitelbbm}{{\mafx@mathbbm{1}}}
2492 \DeclareRobustCommand{\mafx@unitelbbmss}{{\mafx@mathbbmss{1}}}
2493 \DeclareRobustCommand{\mafx@unitelbbmtt}{{\mafx@mathbbmtt{1}}}
2494 \DeclareRobustCommand{\mafx@unitelbf}{{\mathbf{1}}}
2495 \DeclareRobustCommand{\mafx@unitelbfb}{{\mafx@mathbfb{1}}}
2496 \DeclareRobustCommand{\mafx@unitelbfbx}{{\mafx@mathbfbx{1}}}
2497 \DeclareRobustCommand{\mafx@uniteleup}{{\operator@font e}}
2498 \DeclareRobustCommand{\mafx@uniteleit}{{\mathnormal{e}}}
2499 \DeclareRobustCommand{\mafx@unitelEup}{{\operator@font E}}
2500 \DeclareRobustCommand{\mafx@unitelEit}{{\mathnormal{E}}}
2501 \DeclareRobustCommand{\mafx@unitelIup}{{\operator@font I}}
2502 \DeclareRobustCommand{\mafx@unitelIit}{{\mathnormal{I}}}
2503 \DeclareRobustCommand{\mafx@unitelid}{{\operator@font id}}
2504 \DeclareRobustCommand{\mafx@unitels}{{\operator@font1}}
2505 % \end{macrocode}
2506
2507 % \macro{econst}
2508 % \macro{numsetclass}
2509 % \macro{iunit}
2510 % \macro{piconst}
2511 % \macro{unitel}
2512 % Implement mathematical constants individually
2513 % with the option to adjust their macro names:
2514 % \begin{macrocode}
2515 \define@key{mafx@}{econst}[\econst]{\let#1=\mafx@econstup}
2516 \define@key{mafx@}{econst*}[\econst]{\let#1=\mafx@econstit}
2517 \define@key{mafx@}{econstclass}{\let\mafx@econst@class=#1}
2518 \define@key{mafx@}{iunit}[\iunit]{\let#1=\mafx@iunitup}
2519 \define@key{mafx@}{iunit*}[\iunit]{\let#1=\mafx@iunitit}
2520 \define@key{mafx@}{iunit*nb}[\iunit]{\let#1=\mafx@iunitnb}
2521 \define@key{mafx@}{piconst}[\piconst]{\let#1=\mafx@piconstup}
2522 \define@key{mafx@}{piconst*}[\piconst]{\let#1=\mafx@piconstit}
2523 \define@key{mafx@}{unitel1}[\unitel]{\let#1=\mafx@unitelbb}
2524 \define@key{mafx@}{unitel1ds}[\unitel]{\let#1=\mafx@unitelds}
2525 \define@key{mafx@}{unitel1dsr}[\unitel]{\let#1=\mafx@uniteldsr}
2526 \define@key{mafx@}{unitel1dss}[\unitel]{\let#1=\mafx@uniteldss}
2527 \define@key{mafx@}{unitel1bbm}[\unitel]{\let#1=\mafx@unitelbbm}
2528 \define@key{mafx@}{unitel1bbmss}[\unitel]{\let#1=\mafx@unitelbbmss}
2529 \define@key{mafx@}{unitel1bbmtt}[\unitel]{\let#1=\mafx@unitelbbmtt}
2530 \define@key{mafx@}{unitel1bbold}[\unitel]{\let#1=\mafx@unitelbbold}
2531 \define@key{mafx@}{unitel1bf}[\unitel]{\let#1=\mafx@unitelbf}
2532 \define@key{mafx@}{unitel1bfb}[\unitel]{\let#1=\mafx@unitelbfb}
2533 \define@key{mafx@}{unitel1bfbx}[\unitel]{\let#1=\mafx@unitelbfbx}
2534 \define@key{mafx@}{unitel1*}[\unitel]{\let#1=\mafx@unitels}
2535 \define@key{mafx@}{unitele}[\unitel]{\let#1=\mafx@uniteleup}
2536 \define@key{mafx@}{unitele*}[\unitel]{\let#1=\mafx@uniteleit}
2537 \define@key{mafx@}{unitelE}[\unitel]{\let#1=\mafx@unitelEup}
2538 \define@key{mafx@}{unitelE*}[\unitel]{\let#1=\mafx@unitelEit}
2539 \define@key{mafx@}{unitelI}[\unitel]{\let#1=\mafx@unitelIup}
2540 \define@key{mafx@}{unitelI*}[\unitel]{\let#1=\mafx@unitelIit}
2541 \define@key{mafx@}{unitelid}[\unitel]{\let#1=\mafx@unitelid}
2542 % \end{macrocode}
2543
2544 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2545 % \paragraph{Derivative Symbols.}
2546 %
2547 % Define macros for derivative symbols:
2548 % \begin{macrocode}
2549 \DeclareRobustCommand{\mafx@derup}{{\operator@font d}}
2550 \DeclareRobustCommand{\mafx@derit}{{\mathnormal{d}}}
2551 \DeclareRobustCommand{\mafx@diffup}[1]{\mathinner{\mafx@derup#1}}
2552 \DeclareRobustCommand{\mafx@diffit}[1]{\mathinner{\mafx@derit#1}}
2553 % \end{macrocode}
2554
2555 % Implement derivative symbols individually
2556 % with the option to adjust their macro names:
2557 % \begin{macrocode}
2558 \define@key{mafx@}{der}[\der]{\let#1=\mafx@derup}
2559 \define@key{mafx@}{der*}[\der]{\let#1=\mafx@derit}
2560 \define@key{mafx@}{diff}[\diff]{\let#1=\mafx@diffup}
2561 \define@key{mafx@}{diff*}[\diff]{\let#1=\mafx@diffit}
2562 % \end{macrocode}
2563
2564 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2565 % \paragraph{Assorted Symbols.}
2566 %
2567 % Define macros for assorted symbols:
2568 % \begin{macrocode}
2569 \DeclareRobustCommand{\mafx@order}{\mathnormal{o}}
2570 \DeclareRobustCommand{\mafx@Order}{\mathnormal{O}}
2571 \DeclareRobustCommand{\mafx@OrderCal}{\mathcal{O}}
2572 \DeclareRobustCommand{\mafx@defeq}{\mathrel{\mathop:}=}
2573 \DeclareRobustCommand{\mafx@eqdef}{=\mathrel{\mathop:}}
2574 \DeclareRobustCommand{\mafx@lapl}{\mathnormal{\Delta}}
2575 \DeclareRobustCommand{\mafx@dualop}{\star}
2576 % \end{macrocode}
2577
2578 % Implement assorted symbols individually
2579 % with the option to adjust their macro names:
2580 % \begin{macrocode}
2581 \define@key{mafx@}{order}[\order]{\let#1=\mafx@order}
2582 \define@key{mafx@}{Order}[\Order]{\let#1=\mafx@Order}
2583 \define@key{mafx@}{Order*}[\Order]{\let#1=\mafx@OrderCal}
2584 \define@key{mafx@}{defeq}[\defeq]{\let#1=\mafx@defeq}
2585 \define@key{mafx@}{eqdef}[\eqdef]{\let#1=\mafx@eqdef}
2586 \define@key{mafx@}{lapl}[\lapl]{\let#1=\mafx@lapl}
2587 \define@key{mafx@}{dualop}[\dualop]{\let#1=\mafx@dualop}
2588 % \end{macrocode}
2589
2590 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2591 % \paragraph{Number Sets.}
2592 %
2593 % \macro{\numset}
2594 % Define macros for number sets.
2595 % Use default font |\mathbb| if available, otherwise |\mathbf|:
2596 % \begin{macrocode}
2597 \ifdefined\mathbb
2598 \let\mafx@numset@font=\mathbb
2599 \else
2600 \let\mafx@numset@font=\mathbf
2601 \fi
2602 \DeclareRobustCommand{\mafx@numset}{\mafx@numset@font}
2603 \DeclareRobustCommand{\mafx@numsetZ}{\mafx@numset{Z}}
2604 \DeclareRobustCommand{\mafx@numsetQ}{\mafx@numset{Q}}
2605 \DeclareRobustCommand{\mafx@numsetR}{\mafx@numset{R}}
2606 \DeclareRobustCommand{\mafx@numsetC}{\mafx@numset{C}}
2607 \DeclareRobustCommand{\mafx@numsetH}{\mafx@numset{H}}
2608 \DeclareRobustCommand{\mafx@numsetN}{\mafx@numset{N}}
2609 \DeclareRobustCommand{\mafx@numsetO}{\mafx@numset{O}}
2610 % \end{macrocode}
2611
2612 % \macro{numset}
2613 % \macro{numsetfont}
2614 % \macro{numsets}
2615 % Implement number set font and a collection of standard number sets by name:
2616 % \begin{macrocode}
2617 \define@key{mafx@}{numset}[\numset]{\let#1=\mafx@numset}
2618 \define@key{mafx@}{numsetfont}{\let\mafx@numset@font=#1}
2619 \define@key{mafx@}{numsets}[]{%
2620 \let\Integer=\mafx@numsetZ
2621 \let\Rational=\mafx@numsetQ
2622 \let\Real=\mafx@numsetR
2623 \let\Complex=\mafx@numsetC
2624 \let\Quaternion=\mafx@numsetH
2625 \let\Natural=\mafx@numsetN
2626 \let\Octonion=\mafx@numsetO
2627 }
2628 % \end{macrocode}
2629
2630 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2631 % \paragraph{Groups.}
2632 %
2633 % \macro{\grp}
2634 % Define macros for Lie groups.
2635 % Use oeprator font |\operator@font|:
2636 % \begin{macrocode}
2637 \DeclareRobustCommand{\mafx@grp}[1]{\mafx@mathopfont{#1}}
2638 % \end{macrocode}
2639
2640 % Define macros for basic finite groups.
2641 % Use oeprator font |\operator@font|:
2642 % \begin{macrocode}
2643 \DeclareRobustCommand{\mafx@grp@perm}{\mafx@grp{S}}
2644 \DeclareRobustCommand{\mafx@grp@alt}{\mafx@grp{A}}
2645 \DeclareRobustCommand{\mafx@grp@dih}{\mafx@grp{D}}
2646 \DeclareRobustCommand{\mafx@grp@cycZ}{\mafx@grp{Z}}
2647 \DeclareRobustCommand{\mafx@grp@cycC}{\mafx@grp{C}}
2648 % \end{macrocode}
2649
2650 % Define macros for groups of Lie type:
2651 % \begin{macrocode}
2652 \DeclareRobustCommand{\mafx@grp@GL}{\mafx@grp{GL}}
2653 \DeclareRobustCommand{\mafx@grp@SL}{\mafx@grp{SL}}
2654 \DeclareRobustCommand{\mafx@grp@PGL}{\mafx@grp{PGL}}
2655 \DeclareRobustCommand{\mafx@grp@PSL}{\mafx@grp{PSL}}
2656 \DeclareRobustCommand{\mafx@grp@U}{\mafx@grp{U}}
2657 \DeclareRobustCommand{\mafx@grp@SU}{\mafx@grp{SU}}
2658 \DeclareRobustCommand{\mafx@grp@PU}{\mafx@grp{PU}}
2659 \DeclareRobustCommand{\mafx@grp@PSU}{\mafx@grp{PSU}}
2660 \DeclareRobustCommand{\mafx@grp@O}{\mafx@grp{O}}
2661 \DeclareRobustCommand{\mafx@grp@SO}{\mafx@grp{SO}}
2662 \DeclareRobustCommand{\mafx@grp@PSO}{\mafx@grp{PSO}}
2663 \DeclareRobustCommand{\mafx@grp@Spin}{\mafx@grp{Spin}}
2664 \DeclareRobustCommand{\mafx@grp@Pin}{\mafx@grp{Pin}}
2665 \DeclareRobustCommand{\mafx@grp@Sp}{\mafx@grp{Sp}}
2666 \DeclareRobustCommand{\mafx@grp@Mp}{\mafx@grp{Mp}}
2667 % \end{macrocode}
2668
2669 % Define macros for groups related to Dynkin diagrams:
2670 % \begin{macrocode}
2671 \DeclareRobustCommand{\mafx@grp@A}{\mafx@grp{A}}
2672 \DeclareRobustCommand{\mafx@grp@B}{\mafx@grp{B}}
2673 \DeclareRobustCommand{\mafx@grp@C}{\mafx@grp{C}}
2674 \DeclareRobustCommand{\mafx@grp@D}{\mafx@grp{D}}
2675 \DeclareRobustCommand{\mafx@grp@E}{\mafx@grp{E}}
2676 \DeclareRobustCommand{\mafx@grp@F}{\mafx@grp{F}}
2677 \DeclareRobustCommand{\mafx@grp@G}{\mafx@grp{G}}
2678 % \end{macrocode}
2679
2680 % \macro{grp}
2681 % \macro{grpfin}
2682 % \macro{grpcycC}
2683 % \macro{grplie}
2684 % \macro{grpdynkin}
2685 % Implement Lie group and a collection of standard Lie groups by name:
2686 % \begin{macrocode}
2687 \define@key{mafx@}{grp}[\grp]{\let#1=\mafx@grp}
2688 \define@key{mafx@}{grpfin}[]{%
2689 \let\grpperm=\mafx@grp@perm
2690 \let\grpalt=\mafx@grp@alt
2691 \let\grpdih=\mafx@grp@dih
2692 \let\grpcyc=\mafx@grp@cycZ
2693 }
2694 \define@key{mafx@}{grpfin*}[]{%
2695 \let\grpperm=\mafx@grp@perm
2696 \let\grpalt=\mafx@grp@alt
2697 \let\grpdih=\mafx@grp@dih
2698 \let\grpcyc=\mafx@grp@cycC
2699 }
2700 \define@key{mafx@}{grpcycC}[\grpcyc]{\let#1=\mafx@grp@cycC}
2701 \define@key{mafx@}{grplie}[]{%
2702 \let\grpGL=\mafx@grp@GL
2703 \let\grpSL=\mafx@grp@SL
2704 \let\grpPGL=\mafx@grp@PGL
2705 \let\grpPSL=\mafx@grp@PSL
2706 \let\grpU=\mafx@grp@U
2707 \let\grpSU=\mafx@grp@SU
2708 \let\grpPU=\mafx@grp@PU
2709 \let\grpPSU=\mafx@grp@PSU
2710 \let\grpO=\mafx@grp@U
2711 \let\grpSO=\mafx@grp@SO
2712 \let\grpPSO=\mafx@grp@PSO
2713 \let\grpSpin=\mafx@grp@Spin
2714 \let\grpPin=\mafx@grp@Pin
2715 \let\grpSp=\mafx@grp@Sp
2716 \let\grpMp=\mafx@grp@Mp
2717 }
2718 \define@key{mafx@}{grpdynkin}[]{%
2719 \let\grpA=\mafx@grp@A
2720 \let\grpB=\mafx@grp@B
2721 \let\grpC=\mafx@grp@C
2722 \let\grpD=\mafx@grp@D
2723 \let\grpE=\mafx@grp@E
2724 \let\grpF=\mafx@grp@F
2725 \let\grpG=\mafx@grp@G
2726 }
2727 % \end{macrocode}
2728
2729 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2730 % \paragraph{Conjugation Operations.}
2731 %
2732 % \macro{\trans}
2733 % \macro{\hconj}
2734 % \macro{\conj}
2735 % Define macros for conjugation operations:
2736 % \begin{macrocode}
2737 \def\mafx@miniscript#1{\mathchoice%
2738 {\textstyle#1}{\textstyle#1}{\scriptscriptstyle#1}{\scriptscriptstyle#1}}
2739 \let\mafx@trans@font=\mathsf
2740 \DeclareRobustCommand{\mafx@transt}{{\mafx@trans@font{t}}}
2741 \DeclareRobustCommand{\mafx@transT}{{\mafx@trans@font{T}}}
2742 \DeclareRobustCommand{\mafx@transTs}{{\mafx@trans@font{\mafx@miniscript T}}}
2743 \DeclareRobustCommand{\mafx@hconjh}{{\mafx@trans@font{h}}}
2744 \DeclareRobustCommand{\mafx@hconjH}{{\mafx@trans@font{H}}}
2745 \DeclareRobustCommand{\mafx@hconjHs}{{\mafx@trans@font{\mafx@miniscript H}}}
2746 \DeclareRobustCommand{\mafx@trans}{\top}
2747 \DeclareRobustCommand{\mafx@transi}{\intercal}
2748 \DeclareRobustCommand{\mafx@hconj}{\dagger}
2749 \DeclareRobustCommand{\mafx@conj}{\ast}
2750 \DeclareRobustCommand{\mafx@dual}{\ast}
2751 % \end{macrocode}
2752
2753 % \macro{trans}
2754 % \macro{hconj}
2755 % \macro{conj}
2756 % Implement conjugation operations individually
2757 % with the option to adjust their macro names:
2758 % \begin{macrocode}
2759 \define@key{mafx@}{transfont}{\let\mafx@trans@font=#1}
2760 \define@key{mafx@}{trans}[\trans]{\let#1=\mafx@trans}
2761 \define@key{mafx@}{trans*}[\trans]{\let#1=\mafx@transi}
2762 \define@key{mafx@}{transT}[\trans]{\let#1=\mafx@transT}
2763 \define@key{mafx@}{transT*}[\trans]{\let#1=\mafx@transTs}
2764 \define@key{mafx@}{transt}[\trans]{\let#1=\mafx@transt}
2765 \define@key{mafx@}{hconj}[\hconj]{\let#1=\mafx@hconj}
2766 \define@key{mafx@}{hconjH}[\hconj]{\let#1=\mafx@hconjH}
2767 \define@key{mafx@}{hconjH*}[\hconj]{\let#1=\mafx@hconjHs}
2768 \define@key{mafx@}{hconjh}[\hconj]{\let#1=\mafx@hconjh}
2769 \define@key{mafx@}{conj}[\conj]{\let#1=\mafx@conj}
2770 \define@key{mafx@}{dual}[\dual]{\let#1=\mafx@dual}
2771 % \end{macrocode}
2772
2773 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2774 % \paragraph{Package Options.}
2775 %
2776 % \macro{\ProvideMathFix}
2777 % Implement a particular fix or option:
2778 % \begin{macrocode}
2779 \newcommand{\ProvideMathFix}[1]{\setkeys{mafx@}{#1}}
2780 % \end{macrocode}
2781
2782 % Pass undeclared options on to \ctanpkg{keyval} processing:
2783 % \begin{macrocode}
2784 \DeclareOption*{\expandafter\ProvideMathFix\expandafter{\CurrentOption}}
2785 % \end{macrocode}
2786 %
2787 % Process package options:
2788 % \begin{macrocode}
2789 \ProcessOptions
2790 % \end{macrocode}
2791
2792 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2793 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2794 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2795 % \iffalse
2796 %</package>
2797 % \fi
2798 %
2799 \endinput