Debian Codegraph @

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

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2019-2024 by Antoine Missier <[email protected]>
4 %
5 % This file may be distributed and/or modified under the conditions of
6 % the LaTeX Project Public License, either version 1.3 of this license
7 % or (at your option) any later version. The latest version of this
8 % license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.3 or later is part of all distributions of LaTeX version
13 % 2005/12/01 or later.
14 % \fi
15 %
16 % \iffalse
17 %<*driver>
18 \ProvidesFile{mismath.dtx}
19 %</driver>
20 %<*package>
21 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
22 \ProvidesPackage{mismath}
23 [2025/10/08 v3.2 .dtx Miscellaneous mathematical macros]
24 %</package>
25 %<*driver>
26 \documentclass{ltxdoc}
27 \usepackage[utf8]{inputenc} % run through XeLaTeX
28 \usepackage[T1]{fontenc}
29 \usepackage[english]{babel}
30 %\usepackage{fontspec}
31 \usepackage{fourier} % in case of font change, modify 2.1 (3rd §)
32 \usepackage[ibrackets,decimalcomma,otherReIm]{mismath}
33 %\usepackage{amssymb} % unnecessary with fourier
34 \usepackage{multicol}
35 \usepackage{sectsty}
36 \usepackage{xcolor}
37 \usepackage[pifont]{spacingtricks}
38 \usepackage{array}
39 \usepackage{metalogo} % for logos of XeLaTeX et LuaLaTeX
40
41 \definecolor{darkbrown}{rgb}{0.5,0.1,0.1}
42 \allsectionsfont{\color{darkbrown}}
43
44 % Next command is used for showing original Latin Modern \i and \j in text mode:
45 %\DeclareTextFontCommand{\extrafont}{\fontfamily{lmr}\selectfont} % useless with fourier
46
47 % The following commands provide several shapes for pi
48 \DeclareFontEncoding{LGR}{}{}
49 \def\pilmr{\text{\usefont{LGR}{lmr}{m}{n}\symbol{112}}}
50 \def\piAlegreya{\text{\usefont{LGR}{Alegreya-LF}{m}{n}\symbol{112}}}
51 \def\piCochineal{\text{\usefont{LGR}{Cochineal-LF}{m}{n}\symbol{112}}}
52 \def\piLibSerif{\text{\usefont{LGR}{LibertinusSerif-LF}{m}{n}\symbol{112}}}
53 \def\piLibSans{\text{\usefont{LGR}{LibertinusSans-LF}{m}{n}\symbol{112}}}
54 \def\pilmss{\text{\usefont{LGR}{lmss}{m}{n}\symbol{112}}}
55 \def\pigentium{\text{\usefont{LGR}{gentium}{m}{n}\symbol{112}}}
56 \def\pilato{\text{\usefont{LGR}{lato-LF}{m}{n}\symbol{112}}}
57 \DeclareFontFamily{U}{eur}{\skewchar\font'177}
58 \DeclareFontShape{U}{eur}{m}{n}{%
59 <-6> eurm5 <6-8> eurm7 <8-> eurm10}{}
60 \def\piEuler{\text{\usefont{U}{eur}{m}{n}\symbol{"19}}}
61 \def\piSymbol{\text{\usefont{U}{psy}{m}{n}\symbol{`p}}}
62 \def\piCharter{\text{\usefont{OML}{mdbch}{m}{n}\symbol{"19}}}
63 \def\pikp{\text{\usefont{U}{jkpmia}{m}{it}\symbol{"19}}}
64 \pinumber[otherpi] % fourier
65 \def\pipx{\text{\usefont{U}{pxmia}{m}{it}\symbol{"19}}}
66 \def\pitx{\text{\usefont{U}{txmia}{m}{it}\symbol{"19}}}
67
68 \let\updelta\otherdelta
69
70 \DisableCrossrefs
71 %\CodelineIndex
72 %\RecordChanges
73
74 \usepackage{hyperref}
75 \hypersetup{%
76 colorlinks,
77 linkcolor=blue,
78 citecolor=red,
79 pdftitle={mismath},
80 pdfsubject={LaTeX package},
81 pdfauthor={Antoine Missier}
82 }
83 \begin{document}
84 \DocInput{mismath.dtx}
85 %\PrintChanges
86 %\PrintIndex
87 \end{document}
88 %</driver>
89 % \fi
90 %
91 % \GetFileInfo{mismath.sty}
92 %
93 % \title{Miscellaneous mathematical macros \\The \textsf{mismath} package\thanks{This document
94 % corresponds to \textsf{mismath}~\fileversion, dated \filedate.
95 % Thanks to François Bastouil for initial help in English translation.}}
96 % \author{Antoine Missier \\ \texttt{[email protected]}}
97 % \date{October 8, 2025}
98 %
99 % \maketitle
100 % \tableofcontents
101 %
102 % \section{Introduction}
103 %
104 % According to the International Standards ISO~31-0:1992 to ISO~31-13:1992
105 % (superseded by ISO~80000-2:2009), mathematical \emph{constants} $\e$, $\i$, $\pi$
106 % should be typeset in roman (upright shape) and not in italic like
107 % variables (see~\cite{TYPMA}~\cite{NIST}~\cite{SI}~\cite{ICTNS}).
108 % This package provides some tools to achieve this automatically.
109 %
110 % \medskip
111 % Even though it is recommended to typeset vectors names
112 % in bold italic style~\cite{NIST}~\cite{ICTNS},
113 % they are often represented with arrows,
114 % especially in school documents or in physics.
115 % To draw nice arrows above vectors, we use the \textsf{esvect} package
116 % by Eddie Saudrais~\cite{VECT}.
117 % Additionally we provide a few more macros related to vectors with arrows,
118 % particularly to improve the typesetting of the norm: $\norm{\vect{AB}}$
119 % instead of the \LaTeX\ version $\lVert\vect{AB}\rVert$, which is not vertically adjusted,
120 % or worse $\left\Vert \vect{AB} \right\Vert$ (when using |\left|\ldots |\right|).
121 %
122 % \smallskip
123 % The package also offers other macros to typeset:
124 % \begin{itemize}
125 % \item tensors in sans serif bold italic shape
126 % (ISO recommendation~\cite{TYPMA}~\cite{NIST}~\cite{SI}),
127 % \item some standard operator names,
128 % \item several commands with useful aliases,
129 % \item improved spacings in mathematical formulas,
130 % \item systems of equations and small matrices,
131 % \item displaymath in double columns for lengthy calculations with short expressions.
132 % \end{itemize}
133 %
134 % To avoid compatibility issues, most of our macros will only be defined
135 % if there isn't already a command with the same name in the packages loaded
136 % before \textsf{mismath}. If a macro is already defined,
137 % a warning message will be displayed and the \textsf{mismath} definition
138 % will be ignored. If you wish to keep the \textsf{mismath} or the existing command,
139 % you can use |\let\|\meta{command}|\relax|, before loading \textsf{mismath}, or after.
140 %
141 % \medskip
142 % \DescribeEnv{\oarg{options}}
143 % The \textsf{mismath} package loads the \textsf{mleftright}
144 % \footnote{The \textsf{mleftright} package defines variants \texttt{\string \mleft}
145 % and \texttt{\string \mright} of \texttt{\string \left} and \texttt{\string \right}.}
146 % package by Heiko Oberdiek~\cite{MLR} and also \textsf{mathtools}
147 % \footnote{The \textsf{mathtools} package offers numerous helpful macros and improvements
148 % of the \textsf{amsmath} package.}
149 % by Morten Høgholm and Lars Madsen~\cite{TOOL} which in turn loads
150 % the \mbox{\textsf{amsmath}} package~\cite{AMS}.
151 % If you want to use \mbox{\textsf{amsmath}} or \textsf{mathtools} with specific options,
152 % you can include these options as options of \mbox{\textsf{mismath}}, or
153 % you can load \textsf{amsmath} or \textsf{mathtools}
154 % with the desired options before loading \mbox{\textsf{mismath}}.
155 % When using the package \mbox{\textsf{unicode-math}}~\cite{UNIC}, \textsf{mismath}
156 % should be loaded before \textsf{unicode-math}, just like \textsf{amsmath}.
157 %
158 % \medskip
159 % An ISO recommendation, although rarely followed, is to typeset uppercase
160 % Greek letters in italic shape,
161 % as for other variables~\cite{ICTNS}. This is automatically achieved,
162 % for some particular fonts, with packages
163 % such as \textsf{fixmath} by Walter Schmidt~\cite{FIXM},
164 % \mbox{\textsf{isomath}} by Günter Milde~\cite{ISOM}
165 % or \textsf{pm-isomath} by Claudio Beccari~\cite{PMISO} and optionally with many others
166 % (such as \textsf{mathpazo} or \textsf{mathptmx} with the option \texttt{slantedGreek}).
167 % When running through \LuaLaTeX\ or \XeLaTeX\ you can also get this result
168 % with the option \mbox{\texttt{math-style=ISO}} provided
169 % by the \textsf{unicode-math} package.
170 % We also have the new \mbox{\textsf{mathgreeks}} package~\cite{MGREEK} which offers
171 % a wide range of fonts and different settings with Greek letters.
172 % However this feature is not implemented here due to a conflicting rule in France,
173 % where all capital letters in mathematics
174 % are required to be typeset in upright shape
175 % \footnote{The \textsf{frenchmath} package~\cite{FR}
176 % ensures to follow the recommended French rules.}.
177 % The user is free to choose loading one of these packages or not.
178 %
179 %
180 % \section{Usage}
181 %
182 % \subsection{Mathematical constants}
183 %
184 % \DescribeMacro{\mathup}
185 % As for classic functions identifiers, \emph{predefined} mathematical constants
186 % should be typeset in upright shape (typically in roman family),
187 % but this practice is not sufficiently respected, probably because it's a bit tedious.
188 % A first solution is to use the |\mathup| macro,
189 % which is preferable to |\mathrm|
190 % \footnote{The \texttt{\string \mathup} macro is based on \texttt{\string \operatorfont},
191 % which comes from the
192 % \textsf{amsopn} package, automatically loaded by \textsf{amsmath}.
193 % In \textsf{beamer}, the default math font is sans serif,
194 % but \texttt{\string \mathrm} produces a font with serifs, which might not match the
195 % overall style of the presentation. Hence, using \texttt{\string \mathup} is indeed
196 % a better choice in \textsf{beamer} presentations to ensure that mathematical
197 % constants are typeset in upright shape and consistent
198 % with the default sans serif math font.},
199 % for setting any group of letters in roman. For example you can use
200 % |\mathup{e}| to get the Euler's number.
201 %
202 % \pagebreak
203 % \DescribeMacro{\e} \DescribeMacro{\i} \DescribeMacro{\j}
204 % To avoid cluttering a document that contains many occurrences of Euler's number $\e$,
205 % or imaginary number $\i$, with |\mathup{e}| or |\mathup{i}|,
206 % the package provides the |\e| command for Euler's number
207 % and |\i| or |\j| for imaginary numbers.
208 % Let us notice that |\i| and |\j| already exist in \LaTeX. In LR (left-to-right) mode,
209 % they produce \mbox{`\i,\ \j'} without the dot,
210 % allowing you to place accents on them.
211 % However, in mathematical mode, they produce the warning
212 % ``\texttt{LaTeX Warning: Command \string \i\space invalid in math mode on input line}
213 % \meta{line}''.
214 % With the new definition provided by the package, |\i| and |\j| will be redefined
215 % specifically for mathematical mode.
216 %
217 % \medskip
218 % \DescribeMacro{\MathUp}
219 % Indeed, typing a lot of backslashes for constants like $\e$, $\i$, or $\j$
220 % in a document with numerous formulas using them can become tiresome.
221 % To alleviate this, the package proposes another solution
222 % with the macro |\MathUp|\marg{char}.
223 % For example, when |\MathUp{e}| is called, any subsequent occurrence of $\e$
224 % will automatically be set in roman (upright shape),
225 % without the need to type |\e| explicitly. The effect of this macro
226 % can be either global or local, depending on whether it is used outside or inside an
227 % environment or braces.
228 % Furthermore, you can also call this macro in the preamble, then the change will apply
229 % from the beginning of the document. This powerful command allows you
230 % to bring a document up to the standards effortlessly and without changing anything
231 % in your mathematical formulas.
232 % In fact, |\MathUp| can be applied to any valid single character,
233 % offering flexibility for various use cases
234 % \footnote{Another use of it with probability
235 % will be presented in section \ref{operators}.}.
236 %
237 % \medskip
238 % \DescribeMacro{\MathIt}
239 % When there are other occurrences of $e$, $i$ or $j$ as variables,
240 % you can still obtain italicized $e$, $i$ or $j$ using \LaTeX\
241 % commands |\mathit| or |\mathnormal|, which are useful for a single use.
242 % However, you also have the option to use the inverse switch |\MathIt|\marg{char},
243 % which has a global effect when used outside environments or braces,
244 % or a local effect when used inside them.
245 % Similar to |\MathUp|, |\MathIt| can be applied to any single character.
246 %
247 % \medskip
248 % \DescribeMacro{\MathNumbers} \DescribeMacro{\MathNormal}
249 % These macros enable you to set upright or normal (italic) typesetting
250 % for multiple letters in a single command.
251 % For instance, |\MathNumbers{e,i}| is equivalent to |\MathUp{e}\MathUp{i}|.
252 % In |\MathNumbers|, the comma separator between letters can be modified
253 % or removed as needed. In fact, this macro only affects the letters e, i, or j;
254 % it has no effect on other characters.
255 % On the other hand, |\MathNormal| accepts any comma-separated list of arguments.
256 % This means you can apply the normal italic math mode typesetting to various letters
257 % at once using |\MathNormal|.
258 %
259 % \medskip
260 % \DescribeMacro{\enumber}\DescribeMacro{\inumber}\DescribeMacro{\jnumber}
261 % These three commands, used until version 2.2 but only functioning within the preamble,
262 % serve now as aliases for the commands |\MathUp{e}|, |\MathUp{i}| or |\MathUp{j}|,
263 % so they can be used anywhere
264 % in the document or preamble and has an inverse switch with |\MathIt|.
265 %
266 % \medskip
267 % \DescribeMacro{\pinumber[\meta{option}]}
268 % The constant $\pi$ should also be typeset in upright shape
269 % (see~\cite{TYPMA}, \cite{NIST}, \cite{ICTNS}), which is different from italicized $\itpi$.
270 % However, this recommendation is even less commonly followed compared to the one
271 % concerning $\e$ and $\i$~\cite{TYPMA}.
272 % Thanks to the |\pinumber| command, the italic $\itpi$ will be replaced
273 % with an upright $\pi$
274 % each time |\pi| is called. Thus |\pinumber| makes your document compliant with standards
275 % without changing the source code of your mathematical formulas.
276 % It functions in two different ways.
277 %
278 % \begin{enumerate}
279 % \item You can load a Greek letters package that provides the glyphs in upright shape.
280 % There are many available.
281 % Notably, let us mention \textsf{upgreek}~\cite{GREEK},
282 % \mbox{\textsf{mathdesign}}~\cite{DESIGN},
283 % \mbox{\textsf{kpfonts}}~\cite{KPF},
284 % \mbox{\textsf{fourier}}~\cite{FOUR} (used in the present document), but also
285 % \mbox{\textsf{pxgreeks}} (using \textsf{pxfonts}~\cite{PX}), \mbox{\textsf{txgreeks}}
286 % (using \textsf{txfonts}~\cite{TX})
287 % \footnote{When using \textsf{pxgreeks} or \textsf{txgreeks},
288 % they should be loaded \emph{after} \textsf{mismath} to avoid an error
289 % due to conflict with the existing macros \texttt{\string\iint}, \texttt{\string\iiint},
290 % \texttt{\string\iiiint}, \texttt{\string\idotsint} in \textsf{amsmath}.},
291 % \mbox{\textsf{libertinust1math}}~\cite{LIB}, \textsf{libgreek}, etc.
292 % A special mention goes to \textsf{lgrmath} of Jean-François Burnol~\cite{LGR}
293 % which allows the use of any Greek LGR-encoded font in math mode,
294 % an idea taken up in \textsf{mathgreeks}~\cite{MGREEK}.
295 % Also note \textsf{newtxmath}~\cite{NTX} which has several font options.
296 % These packages provide commands like |\uppi| (\textsf{upgreek}, \textsf{mathgreeks}),
297 % |\piup| (\textsf{mathdesign}, \textsf{kpfonts}, \textsf{lgrmath}),
298 % |\otherpi| (\textsf{fourier}), etc.
299 % \footnote{They have also options to typeset all the Greek lowercase
300 % letters in upright shape by default, but this in not our goal here.}
301 %
302 % In this case, |\pinumber| must be called in the preamble
303 % with an optional argument being the name of the command, \emph{without the backslash},
304 % giving access to the upright pi:
305 % \texttt{piup}, \texttt{uppi}, \texttt{otherpi}\ldots
306 % However, installing such a Greek letters package will modify
307 % all the other Greek letter glyphs.
308 % ^^A even if, except for pi, they will be in italics.
309 %
310 % By calling in the preamble |\MathNumbers{ei}\pinumber[otherpi]|
311 % (assuming the \textsf{fourier} package is loaded),
312 % you can achieve the following result:
313 % \begin{center}
314 % |$e^{i\pi} = -1$| \quad yields \quad $\e^{\i\pi}=-1$.
315 % \end{center}
316 %
317 % \item Without installing a package, it is possible to change only the glyph of pi
318 % without altering the other Greek letters,
319 % which are typically in italics.
320 %
321 % In this case, |\pinumber| must be called in the preamble with an optional argument
322 % of the \texttt{key=value} type. The key name corresponds to a package
323 % providing the same glyph.
324 % The following table summarizes the available options.
325 % When a key is given without a value, |\pinumber| will choose a default value
326 % specified in the text list following the table.
327 %
328 % \begin{center}
329 % \setlength{\extrarowheight}{1pt}
330 % \begin{tabular}{>{\ttfamily}l>{$}c<{$}}
331 % \hline
332 % {\normalfont Option} lgrmath=... & \mbox{Result} \\
333 % \hline
334 % Alegreya-LF & \piAlegreya \\
335 % Cochineal-LF & \piCochineal \\
336 % LibertinusSerif-LF & \piLibSerif \\
337 % LibertinusSans-LF & \piLibSans \\
338 % lmr & \pilmr \\
339 % lmss & \pilmss \\
340 % gentium & \pigentium\\
341 % lato-LF & \pilato \\
342 % \hline
343 % \end{tabular}
344 % \qquad
345 % \begin{tabular}{>{\ttfamily}l>{$}c<{$}}
346 % \hline
347 % \normalfont Other options & \mbox{Result} \\
348 % \hline
349 % fontspec=\ldots & \ldots \\
350 % upgreek=Euler & \piEuler \\
351 % upgreek=Symbol & \piSymbol \\
352 % mathdesign & \piCharter \\
353 % kpfonts & \pikp \\
354 % fourier & \pi\\
355 % pxfonts & \pipx \\
356 % txfonts & \pitx \\
357 % \hline
358 % \end{tabular}
359 % \end{center}
360 %
361 % \medskip
362 % \begin{itemize}
363 %
364 % \item With the \texttt{lgrmath} key, we actually have numerous possibilities
365 % for values (any Greek letters math font in LGR encoding).
366 % The documentation of the \textsf{lgrmath}
367 % package explains how to check an visualize all available fonts on your distribution.
368 % We have only presented eight of them. The default value is \texttt{lmr}.
369 % Other interesting values are \texttt{NotoSerif-LF}, \texttt{Clara-TLF},
370 % \texttt{droidserif}, \texttt{fct}, \texttt{llcmss}.
371 %
372 % \item When |\pinumber| is called without an argument in the preamble,
373 % it corresponds to the option \texttt{lgrmath=lmr}.
374 % This $\pilmr$ character is well-suited
375 % for use with the Latin Modern font family
376 % \footnote{It will look the same as the one provided by \texttt{lgrmath=cmr} or by
377 % Günter Milde's \textsf{textalpha} package~\cite{ALPHA}.}.
378 %
379 % \item With the \texttt{fontspec} key, there are also many possible values,
380 % corresponding to the TrueType or OpenType fonts installed on your system
381 % (works with \LuaLaTeX\ or \XeLaTeX).
382 % See the \textsf{mathgreeks} documentation for examples.
383
384 % \item With the \texttt{upgreek} key, the default value is \texttt{Symbol}.
385 % There is a third possible value, \texttt{Symbolsmallscale},
386 % which provides the same character as \texttt{Symbol} but reduced in size by 10\,\%.
387 %
388 % \item With the \texttt{mathdesign} key, there are actually 3 possible values:
389 % \texttt{Utopia}, \texttt{Garamond} or \texttt{Charter} (the default value),
390 % but the glyphs obtained for pi look quite similar.
391 %
392 % \item With the \texttt{kpfonts} key, we have two possible values:
393 % \texttt{normal} (default) and \texttt{light}. The option \texttt{kpfonts=light}
394 % provides a slightly less bold character.
395 %
396 % \item The last keys, \texttt{fourier} (based on Utopia), \texttt{pxfonts}
397 % (based on Palatino),
398 % \texttt{txfonts} (based on Times)
399 % are booleans whose default value is \texttt{true} (when called).
400 % The \texttt{txfonts} key yields the same glyph than \texttt{lgrmath=txr}.
401 %
402 % \end{itemize}
403 % \end{enumerate}
404 %
405 % The \textsf{unicode-math} package~\cite{UNIC} provides |\uppi|, so you can use
406 % |\pinumber[uppi]| to produce automatic upright pi in the selected math font,
407 % but a math font must have been explicitly chosen with |\setmathfont|.
408 % You can also use the \texttt{fontspec} key option,
409 % \eg |\pinumber[fontspec=STIX Two Math]|,
410 % to obtain pi in any font
411 % that is supported by \textsf{unicode-math}.
412 %
413 % For other fonts, it can be quite complicated to make Greek letters packages
414 % work with \textsf{unicode-math}. In any case, such a package must be loaded
415 % after \textsf{unicode-math} and in |\AtBeginDocument|.
416 % However, |\pinumber| supports \textsf{unicode-math} very well with any previous
417 % \texttt{key=value} option, by calling |\pinumber|\oarg{option}
418 % after \textsf{unicode-math}.
419 %
420 % \medskip
421 % \DescribeMacro{\itpi}
422 % When you activate |\pinumber|, the original italic $\itpi$
423 % is still accessible using |\itpi|.
424 %
425 % \medskip
426 % \DescribeMacro{\pinormal}
427 % In fact, |\pinumber| is a toggle, with its inverse toggle being |\pinormal|.
428 % The latter restores the |\pi| command to its default behavior.
429 % Thus, |\pinumber| can be used anywhere in the document (like |\pinormal|),
430 % but then without arguments and provided it has been initially called in the preamble,
431 % according to the procedures outlined above.
432 %
433 % \subsection{Vectors (and tensors)}
434 %
435 % \DescribeMacro{\vect}
436 % By default, the |\vect| command
437 % \footnote{The definition of most macros in this package,
438 % will only take effect if the macro has not been previously
439 % defined by another package. This ensures compatibility and avoids conflicts
440 % when using the \textsf{mismath} package with other \LaTeX\ packages.},
441 % produces vectors with arrows
442 % (thanks to the \textsf{esvect} package by Eddie Saudrais
443 % \footnote{\textsf{esvect} provides the \texttt{\string \vv} macro
444 % used by \texttt{\string \vect}.})
445 % which are more elegant than those produced by \LaTeX's |\overrightarrow| command.
446 % The \textsf{esvect} package has an optional argument
447 % (a single letter between \texttt{a} and \texttt{h}) to define
448 % the desired type of arrow (see~\cite{VECT}).
449 % In \textsf{mismath}, \textsf{esvect} is loaded with the option \texttt{b}:
450 % |\vect{AB}| gives $\vect{AB}$.
451 % If you wish to use a different type of arrow, you must call \textsf{esvect}
452 % with the appropriate option \emph{before} loading \textsf{mismath}.
453 % For example, using |\usepackage[d]{esvect}|
454 % will provide the same arrows that are used by default in~\cite{VECT}.
455 %
456 % \medskip
457 % \DescribeMacro{\boldvect}
458 % The |\vect| macro allows vector names to be typeset using bold italic font,
459 % as recommended by ISO~\cite{NIST}~\cite{SI}, instead of using arrows.
460 % To achieve this, call the |\boldvect| command, it will modify the behavior of |\vect|
461 % locally or globally, depending on its placement in the document (inside or outside
462 % a group or an environment):\\[2ex]
463 % \begin{minipage}{8cm}
464 % \begin{verbatim}
465 %\[ \boldvect \vect{v}
466 % =\lambda\vect{e}_x+\mu\vect{e}_y \]
467 % \end{verbatim}
468 % \end{minipage}
469 % \begin{minipage}{4cm}\vspace{-2ex}
470 % $\boldvect \vect{v}=\lambda\vect{e}_x +\mu\vect{e}_y$
471 % \end{minipage}
472 %
473 % \DescribeMacro{\boldvectcommand}
474 % By default |\boldvect| uses the |\boldsymbol| command
475 % \footnote{\texttt{\string \mathbf} produces upright bold font,
476 % even when used in combination with \texttt{\string \mathit}.}
477 % from the \textsf{amsbsy} package, which is automatically loaded by \textsf{amsmath}.
478 % However, you may prefer other packages that produce bold italic fonts,
479 % such as \textsf{fixmath} with the |\mathbold| command,
480 % \textsf{isomath} with |\mathbfit|
481 % or \textsf{bm} with the |\bm| command;
482 % \textsf{unicode-math} provides the |\symbfit| command.
483 % To use an alternative command instead of |\boldsymbol| in \mbox{\textsf{mismath}},
484 % redefine |\boldvectcommand|,
485 % for instance if \textsf{fixmath} is loaded:
486 %
487 % \medskip
488 % \centeredline{|\renewcommand\boldvectcommand{\mathbold}|}
489 %
490 % \medskip
491 % According to ISO rules, symbols for matrices are also in bold italic.
492 % Therefore you can also use |\vect| with |\boldvect| for matrices, or create another alias.
493 %
494 % \medskip
495 % \DescribeMacro{\arrowvect}
496 % At any moment, you can revert to the default behavior using the inverse switch
497 % |\arrowvect|.
498 % These switches can be placed anywhere, whether
499 % inside mathematical mode or within an environment (with a local effect) or outside
500 % (with a global effect).
501 %
502 % \medskip
503 % \DescribeMacro{\hvect}
504 % When vectors with arrows are typeset side by side,
505 % the arrows can be set up slightly higher using |\hvect|
506 % (which places a vertical phantom box containing `$A$')
507 % to prevent inelegant effects. For example, writing
508 % \begin{itemize}
509 % \item $\vect{AB}=\hvect{u} + \vect{AC}$, obtained with |\hvect{u}|,
510 % looks better than $\vect{AB}=\vect{u}+ \vect{AC}$;
511 % \item $\hvect{a} \cdot \vect{b}=0$, obtained with |\hvect{a}|,
512 % looks better than $\vect{a} \cdot \vect{b}=0$.
513 % \end{itemize}
514 % This adjustment ensures a nicer appearance when vectors
515 % with arrows are combined in an equation
516 % \footnote{For a fine tuning you can also use the \texttt{\string\vstrut} or
517 % \texttt{\string\cstrut} macros from the \textsf{spacingtricks} package~\cite{SPA}.}.
518 % The |\boldvect| and |\arrowvect| switches have the same effect on |\hvect|
519 % as they do on |\vect|.
520 %
521 % \DescribeMacro{\hvec}
522 % In a similar way, |\hvec| raises the little arrow produced by
523 % the \LaTeX\ command |\vec|, to the height of the letter `$A$'
524 % (but |\boldvect| have no effect on |\vec| nor |\hvec|):
525 % \begin{itemize}
526 % \item $\mathcal{P}=\vec{f}\cdot\hvec{v}$, obtained with |\hvec{v}|,
527 % seems better than $\mathcal{P}=\vec{f}\cdot\vec{v}$;
528 % ^^A (the result of |\vec| with \textsf{fourier} may be bad with high letters, \eg $\vec{h}$)
529 % \item $\vec{f} =m \hvec{a}$, obtained with |\hvec{a}|,
530 % seems better than $\vec{f} =m \vec{a}$.
531 % \end{itemize}
532 %
533 % \DescribeMacro{\norm}
534 % The norm of a vector is conventionally represented using the delimiters |\lVert| and |\rVert|
535 % (or |\|$\mid$ unless a plus (+) or minus (-) sign follows the opening delimiter)
536 % or |\left\Vert| and |\right\Vert|
537 % for adaptive delimiters. Unfortunately, these delimiters
538 % are always vertically centered, relatively to the mathematical center line,
539 % whereas vectors with arrows are asymmetric objects.
540 % The code |$\norm{\vec{h}}$| raises the double bar to produce $\norm{\vec{h}}$
541 % instead of $\Vert\vec{h}\Vert$ or $\left\Vert \vec{h} \right\Vert$.
542 % Let's notice that the height of the bars don't adjust to content,
543 % but however to context: main text, subscripts or exponents,
544 % \eg $X^{\norm{\vec{h}}}$.
545 % This macro is useful only for arguments of special height, such as $\vec{h}$ or $\vect{AB}$
546 % and may give bad results in other situations.
547 %
548 % \medskip
549 % \DescribeMacro{\mathbfsfit}\DescribeMacro{\tensor}
550 % For tensors symbols, ISO rules recommend using
551 % sans serif bold italic, but there
552 % is no such math alphabet in the default \LaTeX\ mathematical style.
553 % However, the \mbox{\textsf{mismath}} package defines this alphabet
554 % (assuming the font encoding and package you use permits it)
555 % and provides the macro |\mathbfsfit| or its alias |\tensor|.
556 % By writing |\tensor{S}\otimes\tensor{T}|, you get $\tensor{S}\otimes\tensor{T}$.
557 %
558 % \subsection{Standard operator names}\label{operators}
559 %
560 % \DescribeMacro{\di}
561 % The \emph{differential} operator should be typeset in upright shape, not in
562 % italics, to distinguish it from variables
563 % (as mentioned in \cite{TYPMA}~\cite{NIST}~\cite{ICTNS}~\cite{LSHORT}).
564 % To achieve this, we provide the |\di| command.
565 % Take a look at the following examples (notice the thin spaces before the d,
566 % just like with classic function's names): \\[2ex]
567 % \begin{minipage}{7cm}
568 % \begin{verbatim}
569 %\[ \iint xy\di x\di y \]
570 % \end{verbatim}
571 % \end{minipage}
572 % \begin{minipage}{5cm}
573 % \[ \iint xy\di x\di y \]
574 % \end{minipage}
575 % \\[0.5ex]
576 % \begin{minipage}{7cm}
577 % \begin{verbatim}
578 %\[ m\frac{\di^2x}{\di t^2}
579 % + h\frac{\di x}{\di t} + kx = 0 \]
580 % \end{verbatim}
581 % \end{minipage}
582 % \begin{minipage}{5cm}
583 % \[m\frac{\di^2x}{\di t^2}+h\frac{\di x}{\di t}+kx=0\]
584 % \end{minipage}
585 %
586 % The command |\di| can also represent the \emph{distance}, hence its name:
587 % \[\di(u, \cmmathcal{H}) = \frac{\abs{\langle u,v\rangle}}{\lVert v \rVert}.\]
588 %
589 % \DescribeMacro{\opDelta} \DescribeMacro{\opdelta}
590 % Two other `difference' operators allow for expressing variations ($\opDelta$)
591 % or small variations ($\opdelta$).
592 % They are obtained using the |\opDelta| and |\opdelta| commands.
593 % \begin{align*}
594 % \opDelta f \approx \opDelta h = f'(x_0) \opDelta x &&
595 % \frac{\opdelta T}{T}=\frac{1}{2}\frac{\opdelta l}{l} &&
596 % h= \opdelta x\opdelta y
597 % \end{align*}
598 %
599 % Like |\di|, these operators use specific spacing and are typeset using
600 % the upright Greek letters given by |\updelta| and |\upDelta|.
601 % By default |\upDelta| is an alias for |\Delta| (which is supposed to be in upright shape);
602 % |\updelta| is not provided by \textsf{mismath} but can be obtained with
603 % other packages such as \textsf{mathgreeks}~\cite{MGREEK},
604 % \mbox{\textsf{unicode-math}}~\cite{UNIC},
605 % or as an alias for the upright delta provided by other fonts
606 % \footnote{With \textsf{fourier} (without the \texttt{upright} option) we have used
607 % \texttt{\string\let\string\updelta\string\otherdelta}.}.
608 %
609 % \DescribeMacro{\P} \DescribeMacro{\E}
610 % To refer to probability
611 % \footnote{\LaTeX\ provides also \texttt{\string \Pr} which gives $\Pr$.}
612 % and expectation the proper use is to typeset the capital letters $\P$, $\E$
613 % in roman just like any standard function identifier.
614 % This can be achieved with |\P| and |\E| commands.
615 %
616 % \medskip
617 % \DescribeMacro{\Par}
618 % The |\P| command already existed to refer to the `end of paragraph' symbol (\Par)
619 % and has been redefined, but this symbol can still be obtained with |\Par|.
620 %
621 % \medskip
622 % \DescribeMacro{\V}
623 % Variance is generally denoted by $\var$ or $\Var$ (see the following table),
624 % but some authors prefer to use $\V$, which can be produced using |\V|.
625 %
626 % \DescribeMacro{\MathProba}\DescribeMacro{\MathNormal}
627 % As for $\e$, $\i$ or $\j$, you can use |\MathUp{P}|, |\MathUp{E}|
628 % or |\MathUp{V}| to avoid typing many |\P|, |\E| or |\V|.
629 % However you can also achieve this in a single command with |\MathProba|,
630 % for example |\MathProba{PE}|. We get the inverse toggle with
631 % |\MathIt| for any individual letter or |\MathNormal| for a comma-separated list.
632 %
633 % \medskip
634 % \DescribeMacro{\probastyle}
635 % Some authors use double-struck font shape to represent probability, expectation
636 % and variance: $\mathbb{P}, \mathbb{E}, \mathbb{V}$.
637 % The |\probastyle| macro sets the appearance of |\P|, |\E| and |\V|.
638 % For instance |\renewcommand\probastyle{\mathbb}|
639 % \footnote{The effect of this redefinition is global or local to the container environment
640 % in which it is used.}
641 % brings the double-struck letters.
642 % The |\mathbb| command is provided by \textsf{amsfonts} package
643 % (which needs to be loaded in the preamble), but also by other complete math font
644 % packages such as \mbox{\textsf{mathdesign}}, \textsf{kpfonts}, \textsf{fourier},
645 % \textsf{unicode-math}\ldots
646 % \hypertarget{nofunction}{}
647 %
648 % \pagebreak
649 % The following standard operator names are defined in \textsf{mismath}:
650 % \begin{center}
651 % \begin{tabular}{rlrlrl}
652 % |\adj| & $\adj$ \qquad\mbox{} & |\End| & $\End$ \qquad\mbox{} & |\Res| & $\Res$ \\
653 % |\Aut| & $\Aut$ & |\erf| & $\erf$ & |\rot| & $\rot$ \\
654 % |\codim| & $\codim$ & |\grad| & $\grad$ & |\sgn| & $\sgn$ \\
655 % |\coker| & $\coker$ & |\id| & $\id$ & |\sinc| & $\sinc$ \\
656 % |\Conv| & $\Conv$ & |\Id| & $\Id$ & |\spa| & $\spa$ \\
657 % |\Cov| & $\Cov$ & |\im| & $\im$ & |\tr| & $\tr$ \\
658 % |\cov| & $\cov$ & |\lb| & $\lb$ & |\var| & $\var$ \\
659 % |\curl| & $\curl$ & |\lcm| & $ \lcm$ & |\Var| & $\Var$ \\
660 % |\divg| & $\divg$ & |\rank| & $\rank$ & |\Zu| & $\Zu$
661 % \end{tabular}
662 % \end{center}
663 %
664 % By default, operators returning vectors, |\grad| and |\curl| (or its synonym |\rot|
665 % rather used in Europe), are written with an arrow on the top.
666 % When |\boldvect| is activated, they are typeset in bold style:
667 % $\boldvect \grad, \curl, \rot$.
668 % For the variance, the covariance and the identity function,
669 % two notations are proposed, with or without a first capital letter,
670 % because both are very common.
671 % Please note that |\div| already exists ($\div$) and |\span| is a \TeX\ primitive;
672 % they haven't been redefined. Therefore the provided macros are called |\divg| (divergence)
673 % and |\spa| (span of a set of vectors).
674 % Furthermore |\Z| is used to denote the set of integers (see \ref{aliases}),
675 % which is why we propose |\Zu|,
676 % to designate the center of a group: $\Zu(G)$ (from German Zentrum).
677 %
678 % \medskip
679 % The \textsf{mismath} package also provides some (inverse) circular or hyperbolic functions,
680 % that are missing in \LaTeX:
681 % \begin{center}
682 % \begin{tabular}{rlrlrl}
683 % |\arccot| & $\arccot$\qquad\mbox{} & |\arsinh| & $\arsinh$\qquad\mbox{}
684 % & |\arcoth| & $\arcoth$ \\
685 % |\sech| & $\sech$ & |\arcosh| & $\arcosh$ & |\arsech| & $\arsech$ \\
686 % |\csch| & $\csch$ & |\artanh| & $\artanh$ & |\arcsch| & $\arcsch$
687 % \end{tabular}
688 % \end{center}
689 %
690 % \DescribeMacro{[nofunction]}
691 % Some may find that the definition of all these operators and functions is not useful
692 % for their needs. So, the definitions of standard operators and functions in both
693 % previous tables can be disabled with the \texttt{nofunction} option.
694 % \hypertarget{classicReIm}{}
695 %
696 % \medskip
697 % \DescribeMacro{\Re} \DescribeMacro{\Im}
698 % The |\Re| and |\Im| macros refer to real and imaginary part
699 % of a complex number. They have been redefined to produce $\mathup{Re}$ and $\mathup{Im}$,
700 % in place of outdated symbols $\oldRe$ and $\oldIm$.
701 % Nevertheless, it is still possible to obtain the old symbols
702 % with |\oldRe| and |\oldIm|.
703 %
704 % \DescribeMacro{[otherReIm]}
705 % An alternative notation $\Re$, $\Im$ is provided by invoking the \texttt{otherReIm}
706 % package option,
707 % \DescribeMacro{[classicReIm]}
708 % whereas the \texttt{classicReIm} option deactivates these redefinitions.
709 %
710 % \DescribeMacro{\bigO} \DescribeMacro{\bigo} \DescribeMacro{\lito}
711 % Asymptotic comparison operators (in Bachmann-Landau notation) are obtained with
712 % |\bigO| or |\bigo| and |\lito| commands. The first one uses
713 % the |\cmmathcal| alphabet and the last two compose the letters `O' and `o' in
714 % roman, as for any operator:
715 % \[ n^2+\bigO(n\log n) \txt{or} n^2+\bigo(n\log n)\txt{and}
716 % \e^x=1+x+\frac{x^2}{2}+\lito\bigl(x^2\bigr).\]
717 %
718 % \subsection{A few useful aliases} \label{aliases}
719 %
720 % In the tradition of Bourbaki and D.~Knuth, proper use requires
721 % that classic sets of numbers are typeset in bold roman:
722 % $\R, \C, \Z, \N, \Q$,
723 % whereas double-struck letters
724 % ($\mathbb{R}, \mathbb{C}, \mathbb{Z}, \mathbb{N}, \mathbb{Q}$)
725 % are reserved for writing at the blackboard~\cite{LSHORT}.
726 % Similarly, to designate a field we use $\F$ or $\K$ (Körper in German).
727 % We obtain these symbols with the following macros:
728 % \begin{center}
729 % |\R|, |\C|, |\Z|, |\N|, |\Q|, |\F|, |\K|.
730 % \end{center}
731 %
732 % \smallskip
733 % \DescribeMacro{\mathset}
734 % The |\mathset| command enables you to change the behavior
735 % of all these macros in a global way.
736 % By default, |\mathset| is an alias for |\mathbf|, but if you prefer double-struck letters,
737 % you can simply use |\renewcommand\mathset{\mathbb}| (with local effect within
738 % an environment or a pair of curly braces).
739 %
740 % \smallskip
741 % \DescribeMacro{\onlymathC}
742 % The macro |\onlymathC| is designed for cases when |\C| is already defined,
743 % but only in text mode (usually with the Russian language). Then you get the message:
744 % ``\texttt{Command \string\C\space invalid in math mode}''.
745 % This macro preserves the original definition for text mode
746 % and allows you to use |\C| for the complex number set in math mode.
747 % Simply call |\onlymathC| once in the preamble or anywhere in the document.
748 %
749 % \medskip
750 % \DescribeMacro{\ds}
751 % The |\displaystyle| command is very common, so the |\ds| alias is provided.
752 % Not only it eases typing but also it makes source code more readable.
753 %
754 % \medskip
755 % Symbols with limits behave differently for in-line formulas or for displayed equations.
756 % In the latter case, `limits' are placed under or above the symbol
757 % whereas for in-line math mode,
758 % they are placed on the right, as a subscript or exponent. Compare:
759 % $\zeta(s)=\sum_{n=1}^{\infty }\frac{1}{n^s}$ with
760 % \[\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}.\]
761 %
762 % \DescribeMacro{\dlim} \DescribeMacro{\dsum} \DescribeMacro{\dprod}
763 % \DescribeMacro{\dcup} \DescribeMacro{\dcap}
764 % With in-line math mode, displaymath can be forced with |\displaystyle|
765 % or its alias |\ds|. However, when using these commands, all the rest of the current
766 % mathematical environment will be set in displaymath mode
767 % (as shown in the previous example, where the fraction is expanded).
768 % To limit the display style effect to the affected symbol only,
769 % similar to the \textsf{amsmath} command |\dfrac|,
770 % we can use the following macros:
771 % |\dlim|, |\dsum|, |\dprod|, |\dcup|, |\dcap|.
772 % So
773 % \begin{center}
774 % |$\dlim_{x\to +\infty}\frac{1}{x}$| \quad yields \quad $\dlim_{x \to +\infty}\frac{1}{x}$.
775 % \end{center}
776 %
777 % \DescribeMacro{\lbar} \DescribeMacro{\hlbar}
778 % Large bars over expressions are obtained with |\overline|
779 % or its alias |\lbar|, to get for instance $\lbar{z_1z_2}$.
780 % Similar to vectors, you can raise the bar (from the height of `$A$') with
781 % the |\hlbar| command, to correct uneven bars heights.
782 % \begin{center}
783 % $\lbar{z+z'}=\hlbar{z}+\lbar{z'}$, obtained with |\hlbar{z}|,
784 % looks better than $\lbar{z+z'}=\lbar{z}+\lbar{z'}$.
785 % \end{center}
786 %
787 % \DescribeMacro{\eqdef} \DescribeMacro{\eqdef*}
788 % The |\eqdef| macro writes the equality symbol topped with `def',
789 % or with `$\scriptstyle \Delta$' for |\eqdef*|
790 % (thanks to the \LaTeX\ command |\stackrel|):\\[2ex]
791 % \begin{minipage}{7cm}
792 % \begin{verbatim}
793 %\[ \e^{\i\theta} \eqdef
794 % \cos\theta + \i\sin\theta \]
795 % \end{verbatim}
796 % \end{minipage}
797 % \begin{minipage}{5cm}\vspace{-3ex}
798 % \[\e^{\i\theta}\eqdef\cos\theta + \i\sin\theta\]
799 % \end{minipage}
800 %
801 % \noindent\begin{minipage}{7cm}
802 % \begin{verbatim}
803 %\[ \e^{\i\theta} \eqdef*
804 % \cos\theta + \i\sin\theta \]
805 % \end{verbatim}
806 % \end{minipage}
807 % \begin{minipage}{5cm}\vspace{-3ex}
808 % \[\e^{\i\theta}\eqdef*\cos\theta + \i\sin\theta\]
809 % \end{minipage}
810 %
811 % \DescribeMacro{\unbr}
812 % |\unbr| is an alias for |\underbrace|
813 % \footnote{The \textsf{mathtools} package by Morten Høgholm
814 % and Lars Madsen~\cite{TOOL} provides a new and improved version
815 % of the \texttt{\string \underbrace} command, along with many other useful macros.
816 % It is loaded by \textsf{mismath}.},
817 % making source code more compact.\\[2ex]
818 % \begin{minipage}{6.4cm}
819 % \begin{verbatim}
820 %\[ (QAP)^n = \unbr{QAP\mul QAP\mul
821 % \cdots\mul QAP}_{n\text{ times}} \]
822 % \end{verbatim}
823 % \end{minipage}
824 % \begin{minipage}{6cm}\vspace{-3ex}
825 % \[ (QAP)^n = \unbr{QAP\mul QAP\mul\cdots\mul QAP}_{n\text{ times}} \]
826 % \end{minipage}
827 %
828 % \DescribeMacro{\iif}
829 % |\iif| is an alias for ``\iif'', to be used in text mode.
830 %
831 % \medskip
832 % \DescribeMacro{\then}
833 % This macro produces the symbol $\Longrightarrow$ surrounded by large spaces,
834 % like the standard macro |\iff| does it with $\Longleftrightarrow$.
835 % It's just an alias for the \textsf{amsmath} |\implies| macro.
836 %
837 % \subsection{Improved spacing in mathematical formulas}
838 %
839 % \DescribeMacro{\txt}
840 % The |\txt| macro, based on |\text| from the \textsf{amstext} package
841 % (loaded by \textsf{amsmath}),
842 % leaves em quad spaces (|\quad|) around the text. See the following example:
843 % \begin{center}
844 % |\[ \ln x=a \then x=\e^a, \txt{rather than}| \\
845 % | \ln x=a \Longrightarrow x=\e^a \]| \\[1ex]
846 % $ \ln x=a \then x=\e^a, \txt{rather than} \ln x=a \Longrightarrow x=\e^a$
847 % \end{center}
848 %
849 % \DescribeMacro{\mul}
850 % The multiplication symbol obtained with |\times| produces the same spacing as addition
851 % or subtraction operators, whereas division obtained with $/$ is closer to its operands.
852 % This actually hides the priority of multiplication over $+$ and $-$.
853 % That's why we provide the |\mul| macro, to avoid the large space surrounding |\times|:
854 % \begin{center}
855 % $\lambda+\alpha \mul b-\beta \mul c$, obtained with |\mul|,
856 % looks better than $\lambda+\alpha \times b-\beta \times c$.
857 % \end{center}
858 %
859 % Using |\mul| before a function name works also fine (since v3.1) without the need
860 % of curly braces to avoid the additional space before the operator name:
861 % |$x\mul\sin x$| yields $x\mul{\sin x}$.
862 %
863 % \medskip
864 % When using a |\left| \ldots |\right| structure,
865 % \TeX\ sets additional surrounding space in some situations.
866 % The \textsf{mleftright}~\cite{MLR} package, loaded by \textsf{mismath},
867 % offers the variants |\mleft| and |\mright|
868 % to address these spacing issues of inner formulas.
869 % It also provides the |\mleftright| macro that redefines |\left| as |\mleft|
870 % and |\right| as |\mright|.
871 %
872 % \begin{center}
873 % Compare $\sin\left(\frac{\pi}{3}\right)\mul 2$ with
874 % $\sin\mleft(\frac{\pi}{3}\mright)\mul 2$ obtained with
875 % |$\sin\mleft(\frac{\pi}{3}\mright)}\mul 2$|.
876 % \end{center}
877 %
878 % \DescribeMacro{\pow}
879 % In the same way, when typesetting an exponent after a closing \emph{big}
880 % parenthesis produced by |\right)|,
881 % the exponent appears to be a little to far from the parenthesis.
882 % To address this issue, the |\pow|\marg{expr}\marg{pow} command is provided
883 % \footnote{This macro gives bad results with \emph{normal-sized} parenthesis.},
884 % which places \meta{expr} in a pair of parenthesis and
885 % sets the positioning of the exponent \meta{pow}
886 % slightly closer to the right parenthesis.
887 % Compare:
888 % \[ \e^a =\lim_{n \to +\infty}\pow{1+\frac{a}{n}}{n}
889 % \txt{obtained with \texttt{\string \pow}, rather than}
890 % \e^a =\lim_{n \to +\infty}\left(1+\frac{a}{n}\right)^{n}.\]
891 %
892 % \DescribeMacro{\abs} \DeleteShortVerb{\|}
893 % The \cs{abs} command typesets the absolute value while properly managing the spacing,
894 % which \texttt{|}\ldots\texttt{|} does not. Compare $\abs{-x}$,
895 % obtained with \cs{abs}, to $|-x|$ without.
896 % Using the delimiters \cs{lvert} and \cs{rvert} presents another issue when
897 % the absolute value follows a function name; \eg \verb@\ln\lvert x\rvert@ yields
898 % $\ln \lvert x\rvert$
899 % instead of $\ln\abs{x}$ (with \verb@\ln\abs{x}@).
900 % Moreover, with \cs{abs}, the size of the delimiters adapts to the content
901 % \footnote{We could also define \texttt{\string \abs}
902 % using \texttt{\string \DeclarePairedDelimiter}
903 % from the \mbox{\textsf{mathtools}} package~\cite{TOOL}.}.
904 % \MakeShortVerb{\|}
905 %
906 % \medskip
907 % \DescribeMacro{\lfrac}
908 % The |\lfrac| macro behaves like |\frac|
909 % but with additional spacing around the arguments,
910 % making the corresponding fraction bar slightly longer.
911 % This macro has an optional parameter |\lfrac|\oarg{space}\marg{num}\marg{denom}
912 % to adjust the length of the fraction bar. The optional \meta{space} argument must be given
913 % with \emph{math units} (\texttt{mu});
914 % the default value is \texttt{7mu} (equivalent to |\:\,|).
915 % See the following examples;
916 % the last one is obtained with |\lfrac[4mu]{1}{\sqrt{x}}|.
917 % \[ \lbar{Z} = \lfrac{\lbar{z_1-z_2}}{\lbar{z_1+z_2}} \qquad
918 % u(x)= \lfrac{\frac{1-2x}{5}}{x^2+1} \qquad
919 % y'+xy=\lfrac[4mu]{1}{\sqrt{x}}
920 % \]
921 % \pagebreak ^^A to get footnotes at the right page
922 % \hypertarget{ibrackets}{}
923 %
924 % \DescribeMacro{[ibrackets]}
925 % Open intervals are commonly represented with parenthesis, \eg $(0, +\infty)$,
926 % but sometimes square brackets are used, especially in French mathematics: $]0, +\infty[$.
927 % In that case, the space around the square brackets is generally inappropriate,
928 % as in the expression $x \in \mathclose{]} 0, +\infty[$.
929 % To address this issue, we have redefined the brackets in the \mbox{\textsf{ibrackets}}
930 % package~\cite{BRACKET}.
931 % This one can be optionally
932 % loaded by \textsf{mismath} using the \texttt{ibrackets} package option.
933 % Thus |$x\in ]-\pi,0[ \cup ]2\pi,3\pi[$|
934 % \begin{align*}
935 % \mbox{yields \ }
936 % x\in ]-\pi, 0[ \cup ]2\pi, 3\pi[ & \mbox{\ with \textsf{ibrackets}}, \\
937 % \mbox{instead of \ }
938 % x\in \mathclose{]}-\pi, 0 \mathopen{[} \cup
939 % \mathclose{]} 2\pi, 3\pi \mathopen{[}
940 % &\mbox{\ without \textsf{ibrackets}}.
941 % \end{align*}
942 %
943 % In our code, the symbols $[$ and $]$ are set as `active' characters,
944 % behaving like ordinary characters and not as delimiters in most cases.
945 % Therefore, a line break could occur between the two brackets, but
946 % it is always possible to transform them
947 % into delimiters using |\left| and |\right|.
948 %
949 % However, when a bracket is \emph{immediately} followed by a + or - character,
950 % it becomes an open delimiter.
951 % Therefore, when the left bound contains an operator sign,
952 % \emph{you don't have to leave a space between the first bracket and the sign},
953 % otherwise, the spaces surrounding the operator will be too large.
954 % For example if you write |$x \in ] -\infty, 0]$|, it yields $x \in ] -\infty, 0]$
955 % instead of $x \in ]-\infty, 0]$.
956 % Conversely, when dealing with algebraic expressions involving intervals,
957 % \emph{you must leave a blank space between the second bracket and the} +/-
958 % \emph{operation}.
959 % For instance |$[a,b] +[c,d]$| yields $[a,b] +[c,d]$
960 % but |$[a,b]+ [c,d]$| yields $[a, b]+ [c, d]$.
961 %
962 % \medskip
963 % Note that there are other ways to proceed,
964 % for example with |\interval|,
965 % from the \textsf{interval} package~\cite{INT},
966 % or with |\DeclarePairedDelimiter|
967 % \footnote{You cannot use \texttt{\string\DeclarePairedDelimiter} with square brackets
968 % when \textsf{ibrackets} is loaded.}
969 % from \mbox{\textsf{mathtools}}~\cite{TOOL}.
970 % \hypertarget{decimalcomma}{}
971 %
972 % \medskip
973 %\DescribeMacro{[decimalcomma]}
974 % In many countries, except notably in English-speaking countries,
975 % the comma is used as a decimal separator for numbers.
976 % However, in the math mode of \LaTeX, the comma is always, by default,
977 % treated as a punctuation symbol and therefore is followed by a space.
978 % This is appropriate in intervals: |$[a,b]$| results in $[a,b]$,
979 % but not for numbers where the comma represents the decimal separator.
980 % For example, |$12,5$| is displayed as $12, 5$ instead of $12{,}5$.
981 %
982 % Two very convenient packages allow handling the decimal comma in math mode:
983 % \textsf{icomma} by Walter Schmidt~\cite{ICOMMA} and
984 % \textsf{ncccomma} by Alexander I.~Rozhenko~\cite{NCC}.
985 % The second package takes a more generic approach,
986 % however it poses several compatibility issues,
987 % in particular when running through Lua\LaTeX, using \textsf{unicode-math}
988 % and calling |\setmathfont|.
989 % Therefore we propose the \textsf{decimalcomma} package~\cite{DEC},
990 % functionally identical to that of \textsf{ncccomma} but
991 % without the aforementioned incompatibility.
992 % It can be loaded by \textsf{mismath} using the \texttt{decimalcomma}
993 % package option.
994 %
995 % \subsection{Environments for systems of equations and small matrices}
996 %
997 % \DescribeEnv{system}
998 % The \texttt{system} environment, defined in the \textsf{mismath} package,
999 % is used to represent a system of equations:\\[2ex]
1000 % \begin{minipage}{6.5cm}
1001 % \begin{verbatim}
1002 %\[ \begin{system}
1003 % x=1+2t \\ y=2-t \\ z=-3-t
1004 % \end{system} \]
1005 % \end{verbatim}
1006 % \end{minipage}
1007 % \begin{minipage}{5cm} \vspace{-3ex}
1008 % \[ \begin{system} x=1+2t \\ y=2-t \\z=-3-t \end{system} \]
1009 % \end{minipage}
1010 %
1011 % \medskip
1012 % \DescribeMacro{\systemsep}
1013 % This first example could also have been achieved using the \texttt{cases} environment
1014 % from the \textsf{amsmath} package, although \texttt{cases} places mathematical expressions
1015 % closer to the curly brace.
1016 % The |\systemsep| length allows to adjust the gap between
1017 % the bracket and the math expressions.
1018 % By default, the gap is set to |\medspace|. You can reduce this gap by redefining
1019 % the command, \eg |\renewcommand{\systemsep}{\thinspace}|.
1020 % Alternatively you can increase the gap using |\thickspace|;
1021 % the same spacing as of the \texttt{cases} environment
1022 % being obtained with |\renewcommand{\systemsep}{}|.
1023 % So the |\systemsep| command allows for greater flexibility in adjusting the spacing
1024 % within the \texttt{system} environment.
1025 %
1026 % \medskip
1027 % \DescribeEnv{system\oarg{coldef}}
1028 % By default, a system is written like an \texttt{array} environment with only one column,
1029 % left aligned. However the \texttt{system} environment has an optional
1030 % argument that allows to create systems with multiple columns,
1031 % specifying their alignment using the same syntax as the \texttt{array} environment in
1032 % \LaTeX. For instance, using |\begin{system}[cl]| will produce a two-column system,
1033 % with the first column centered and
1034 % the second column left-aligned, as shown in the following example:\\[2ex]
1035 % \begin{minipage}{7cm}
1036 % \begin{verbatim}
1037 %\[ \begin{system}[cl]
1038 % y & =\dfrac{1}{2}x-2 \\[1ex]
1039 % (x,y) & \neq (0,-2)
1040 % \end{system} \]
1041 % \end{verbatim}
1042 % \end{minipage}
1043 % \begin{minipage}{5cm}\vspace{-2ex}
1044 % \[ \begin{system}[cl] y&=\dfrac{1}{2}x-2 \\[1ex] (x,y)&\neq (0,-2) \end{system}\]
1045 % \end{minipage}
1046 %
1047 % \DescribeMacro{\systemstretch}
1048 % The default spacing between the lines of a \texttt{system} environment has been slightly
1049 % enlarged compared to the one used in \texttt{array} environments (using a factor of 1.2).
1050 % This can be adjusted by using
1051 % |\renewcommand{\systemstretch}|\marg{stretch}, where \meta{stretch} is the desired factor
1052 % for the spacing. You can place this command
1053 % inside the current mathematical environment for a local change, or outside
1054 % for a global change. The default value for is 1.2.
1055 % Furthermore you can also use the end of the line with a spacing option, as
1056 % demonstrated above with |\\[1ex]|, to control the spacing between specific lines in
1057 % the system.
1058 %
1059 % Another example with |\begin{system}[rl@{\quad}l]|
1060 % \footnote{\texttt{@\{\ldots\}} sets inter-column space.}:
1061 % \begin{equation*}
1062 % \begin{system}[rl@{\quad}l]
1063 % x+3y+5z&=0 & R_1\\ 2x+2y-z&=3 & R_2\\ 3x-y+z&=2 & R_3
1064 % \end{system}
1065 % \iff
1066 % \begin{system}[rl@{\quad}l]
1067 % x+3y+5z&=0 & R_1\\
1068 % 4y+11z&=3 & R_2 \gets 2R_1-R_2 \\
1069 % 5y+7z&=-1 & R_3 \gets \frac{1}{2}\left(3R_1-R_3\right)
1070 % \end{system}
1071 % \end{equation*}
1072 %
1073 % Let's also mention the \textsf{systeme} package~\cite{SYST} which provides
1074 % a lighter syntax and automatic alignments for linear systems.
1075 % Additionally, there is the \textsf{spalign} package~\cite{SPAL},
1076 % which offers a convenient and easy syntax for systems and matrices with
1077 % visually appealing alignments.
1078 %
1079 % \medskip
1080 % \DescribeEnv{spmatrix}
1081 % The \textsf{amsmath} package offers several environments to typeset matrices :
1082 % For example, the \texttt{pmatrix} environment surrounds the matrix with parenthesis,
1083 % and the \texttt{smallmatrix} environment creates a smaller matrix suitable for insertion
1084 % within a text line. We provide a combination of the these both
1085 % functionalities with the \texttt{spmatrix} environment:
1086 % |$\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$| yielding
1087 % $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$.
1088 %
1089 % The \textsf{mathtools} package enhances the \textsf{amsmath} matrix environments
1090 % and also provides a small matrix environment with parenthesis: \texttt{psmallmatrix}.
1091 % Moreover, with the starred version |\begin{psmallmatrix*}|\oarg{col},
1092 % you can choose the alignment inside the columns (\texttt{c}, \texttt{l} or \texttt{r}).
1093 % However, the space before the left parenthesis is unfortunately too narrow
1094 % compared to the space inside the parenthesis.
1095 % To illustrate this, consider the following comparison:
1096 % $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$ (using \textsf{mismath}'s \texttt{spmatrix})
1097 % vs.\@ $\vec{u}\begin{psmallmatrix}-1\\2\end{psmallmatrix}$
1098 % (using \textsf{mathtools} \texttt{psmallmatrix}).
1099 %
1100 % \medskip
1101 % For typesetting various kinds of matrices, let's mention the excellent
1102 % \textsf{nicematrix} package by François Pantigny~\cite{NMATX}.
1103 %
1104 % \subsection{Displaymath in double columns}
1105 %
1106 % \DescribeEnv{mathcols}
1107 % The \texttt{mathcols} environment allows you to arrange
1108 % lengthy calculations with short expressions across two columns
1109 % separated by a vertical line,
1110 % as shown in the following example.
1111 % However, to use this feature, the \textsf{multicol} package must be loaded in the preamble.
1112 % The \texttt{mathcols} environment activates mathematical mode
1113 % in display style and uses the \texttt{aligned} environment (from \textsf{amsmath}).
1114 % \begin{mathcols}
1115 % & \frac{1}{2 \mul {\pow{\frac{1}{4}}{n}} + 1} \geq 0.999 \\
1116 % \iff\ & 1 \geq 1.998 \pow{\frac{1}{4}}{n} + 0.999 \\
1117 % \iff\ & 0.001 \geq \frac{1.998}{4^n} \\
1118 % \changecol
1119 % & \iff 4^n \geq 1998 \\
1120 % & \iff n \ln 4 \geq \ln(1998) \\
1121 % & \iff n \geq \frac{\ln(1998)}{\ln 4} \approx 5.4 \\
1122 % & \iff n \geq 6
1123 % \end{mathcols}
1124 %
1125 % \DescribeMacro{\changecol}
1126 % The |\changecol| macro is used to switch to the next column,
1127 % and alignments within the columns is done using the classic delimiters
1128 % |&|, to separate entries, and |\\|, to start a new row.
1129 %
1130 % \begin{verbatim}
1131 %\begin{mathcols}
1132 % & \frac{1}{2 \mul {\pow{\frac{1}{4}}{n}} + 1} \geq 0.999 \\
1133 % \iff\ & 1 \geq 1.998 \pow{\frac{1}{4}}{n} + 0.999 \\
1134 % \iff\ & 0.001 \geq \frac{1.998}{4^n} \\
1135 %\changecol
1136 % & \iff 4^n \geq 1998 \\
1137 % & \iff n \ln 4 \geq \ln(1998) \\
1138 % & \iff n \geq \frac{\ln(1998)}{\ln 4} \approx 5.4 \\
1139 % & \iff n \geq 6
1140 %\end{mathcols}
1141 % \end{verbatim}
1142 %
1143 % \vspace{-4ex}
1144 % \subsection{Summary of the package options}
1145 %
1146 % The following table summarizes the possible package options.
1147 % You can add to them any option you want to pass to \textsf{amsmath} or \textsf{mathtools}.
1148 % The hyperlinks (in blue) redirect to the paragraphs in the documentation
1149 % where these options are described.
1150 % \begin{center}
1151 % \setlength{\extrarowheight}{1pt}
1152 % \begin{tabular}{>{\ttfamily}ll}
1153 % \hline
1154 % \normalfont Option & \mbox{Effect} \\
1155 % \hline
1156 % \hyperlink{nofunction}{nofunction} & don't load some additional function definitions \\
1157 % \hyperlink{classicReIm}{otherReIm} & typesets |\Re| and |\Im| as $\Re$ and $\Im$ \\
1158 % \hyperlink{classicReIm}{classicReIm} & preserves |\Re| and |\Im| as $\oldRe$ and $\oldIm$ \\
1159 % \hyperlink{ibrackets}{ibrackets} & loads the \textsf{ibrackets} package\\
1160 % \hyperlink{decimalcomma}{decimalcomma} & loads the \textsf{decimalcomma} package \\
1161 % \hline
1162 % \end{tabular}
1163 % \end{center}
1164 % \StopEventually{}
1165 %
1166 % \section{Implementation}
1167 %
1168 % We load certain packages conditionally to avoid `option clash' errors in cases
1169 % where these packages have been previously loaded with other options.
1170 % The \textsf{amsmath} package is loaded by \textsf{mathtools}.
1171 % The \textsf{xparse} package provides |\NewDocumentCommand|,
1172 % redefined in \LaTeX3 kernel. So this package is obsolete
1173 % with the October 2020 \LaTeX\ release.
1174 % \begin{macrocode}
1175 \newif\ifmm@ibrackets % initialized to false
1176 \DeclareOption{ibrackets}{\mm@ibracketstrue}
1177 \newif\ifmm@decimalcomma
1178 \DeclareOption{decimalcomma}{\mm@decimalcommatrue}
1179 \newif\ifmm@nofunction
1180 \DeclareOption{nofunction}{\mm@nofunctiontrue}
1181 \newif\ifmm@otherReIm
1182 \DeclareOption{otherReIm}{\mm@otherReImtrue}
1183 \newif\ifmm@classicReIm
1184 \DeclareOption{classicReIm}{\mm@classicReImtrue}
1185 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{mathtools}}
1186 \ProcessOptions \relax
1187
1188 %\@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}}
1189 \@ifpackageloaded{mathtools}{}{\RequirePackage{mathtools}}
1190 \@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}}
1191 \RequirePackage{mleftright}
1192 \RequirePackage{ifthen}
1193 \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
1194 \IfFormatAtLeastTF{2020-10-01}{}{\RequirePackage{xparse}}
1195 % xparse provides \NewDocumentCommand, now in LaTeX3
1196 \RequirePackage{xspace} % for \iif command
1197 \RequirePackage{iftex}
1198 \RequirePackage{etoolbox} % provides \AtEndPreamble
1199 \RequirePackage{xkeyval} % for \pinumber options
1200
1201 % \end{macrocode}
1202 %
1203 % The package \textsf{unicode-math} causes some compatibility issues
1204 % with \textsf{ibrackets} and \textsf{decimalcomma}: theses packages
1205 % must be loaded \emph{after} \textsf{unicode-math},
1206 % but \textsf{mismath} (like \textsf{amsmath}) should be loaded \emph{before}
1207 % \textsf{unicode-math}.
1208 % And to complicate matters, \mbox{\textsf{unicode-math}} defines all its commands
1209 % by |\AtBeginDocument|.
1210 % Therefore we used the command |\AtEndPreamble|, from the \textsf{etoolbox} package,
1211 % which makes the job (because both \textsf{ibrackets} and \textsf{decimalcomma}
1212 % work also in |\AtBeginDocument|).
1213 %
1214 % Moreover the command |\mathbfsfit| (used for tensors) is already defined
1215 % in \textsf{unicode-math} and will not be redefined if \textsf{unicode-math}
1216 % is loaded.
1217 % \begin{macrocode}
1218 \@ifpackageloaded{unicode-math}{
1219 \PackageWarningNoLine{mismath}{The package unicode-math\MessageBreak
1220 should be loaded after mismath}
1221 }{}
1222 \newif\ifmm@unicodemath
1223 \newif\ifmm@multicol
1224 \AtEndPreamble{% necessary to work with unicode-math
1225 \ifmm@decimalcomma\RequirePackage{decimalcomma}\fi
1226 \ifmm@ibrackets\RequirePackage{ibrackets}\fi
1227 \@ifpackageloaded{multicol}{\mm@multicoltrue}{}
1228 \@ifpackageloaded{unicode-math}{\mm@unicodemathtrue}{
1229 \DeclareMathAlphabet{\mathbfsfit}{\encodingdefault}%
1230 {\sfdefault}{bx}{it}}
1231 }
1232
1233 % \end{macrocode}
1234 %
1235 % \medskip
1236 % \DescribeMacro{\bslash}
1237 % The |\bslash| macro originates from Frank Mittelbach's \textsf{doc.sty} package.
1238 % It can be employed in other documents as an alternative to |\textbackslash|,
1239 % especially in situations where |\textbackslash| does not work correctly, such as
1240 % inside warning messages.
1241 % \begin{macrocode}
1242 {\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % \bslash command
1243
1244 % \end{macrocode}
1245 %
1246 % \DescribeMacro{\mm@warning} \DescribeMacro{\mm@macro} \DescribeMacro{\mm@operator}
1247 % The next three internal macros serve as meta commands for
1248 % conditionally defining macros while providing a warning message if the macro already exists.
1249 %
1250 % \medskip
1251 % \begin{macrocode}
1252 \newcommand\mm@warning[1]{
1253 \PackageWarningNoLine{mismath}{Command \bslash #1 already exist
1254 \MessageBreak and will not be redefined}
1255 }
1256 \newcommand\mm@macro[2]{
1257 \@ifundefined{#1}{
1258 \expandafter\def\csname #1\endcsname{#2}
1259 }{\mm@warning{#1}}
1260 }
1261 \NewDocumentCommand\mm@operator{O{#3}mm}{%
1262 \@ifundefined{#1}{
1263 \DeclareMathOperator{#2}{#3}
1264 }{\mm@warning{#1}}
1265 }
1266
1267 % \end{macrocode}
1268 %
1269 % To produce the correct upright shape font when working
1270 % with the \textsf{beamer} package, you don't have to use |\mathrm|
1271 % but rather |\mathup| (based on |\operatorfont| from the \textsf{amsopn} package).
1272 % This command also works fine with other sans serif fonts like \textsf{cmbright}.
1273 %
1274 % Moreover for \textsf{beamer}, which changes the default font family (to sans serif),
1275 % |\e|, |\i|, |\j| have no effect without |\AtBeginDocument| and
1276 % |\AtBeginDocument| is also necessary to redefine |\i| when calling
1277 % the \textsf{hyperref} package which overwrites the |\i| definition.
1278 % \medskip
1279 % \begin{macrocode}
1280 \@ifundefined{mathup}{
1281 \providecommand*{\mathup}[1]{{\operatorfont #1}}
1282 }{\mm@warning{mathup} } % also in kpfonts and unicode-math
1283 \mm@macro{e}{\mathup{e}}
1284 \AtBeginDocument{\let\oldi\i \let\oldj\j
1285 \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
1286 \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} }
1287
1288 % \end{macrocode}
1289 %
1290 % \DescribeMacro{\MathFamily}
1291 % The following macros |\MathUp| and |\MathIt| are toggles that transform
1292 % any chosen letter in math mode to roman or italic style.
1293 % These switches can be used anywhere in the document or the preamble.
1294 % They are based on the generic macro |\MathFamily|.
1295 % To obtain a letter in roman style instead of italic, we need to change the
1296 % mathcode digit that represents the font family: 1 to 0.
1297 %
1298 % For example, except for \LuaLaTeX, mathcode of the `e' letter is:
1299 % e="7165 (decimal 29029), with the second digit `1' indicating ``italic'' style.
1300 % To get a roman `e', we need to change its mathcode to "7065.
1301 %
1302 % When used in the preamble, we call |\MathFamily| by |\AtBeginDocument|
1303 % for working with the \textsf{beamer} package.
1304 % Let's notice that |\MathFamily| has an erratic behavior when \textsf{unicode-math}
1305 % is loaded, but fortunately, in that case, the |\DeclareMathSymbol| can be
1306 % used instead, even outside the preamble.
1307 % \medskip
1308 % \begin{macrocode}
1309 \newcount\mm@charcode
1310 \newcount\mm@charclass
1311 \newcount\mm@charfam
1312 \newcount\mm@charslot
1313
1314 \newcommand*\MathFamily[2]{%
1315 \mm@charfam=#2
1316 \ifluatex
1317 \mm@charclass=\Umathcharclass`#1
1318 %\mm@charfam=\Umathcharfam`#1
1319 \mm@charslot=\Umathcharslot`#1
1320 \Umathcode`#1= \mm@charclass \mm@charfam \mm@charslot
1321 \else
1322 \mm@charcode=\mathcode`#1
1323 % extract charclass
1324 \@tempcnta=\mm@charcode
1325 \divide\@tempcnta by "1000
1326 \multiply\@tempcnta by "1000 % charclass
1327 \mm@charclass=\@tempcnta
1328 % extract charslot
1329 \@tempcnta=\mm@charcode
1330 \@tempcntb=\mm@charcode
1331 \divide\@tempcnta by "100
1332 \multiply\@tempcnta by "100 % charclass + charfam
1333 \advance\@tempcntb by -\@tempcnta % charslot
1334 \mm@charslot=\@tempcntb
1335 % construct charcode
1336 \mm@charcode=\mm@charclass
1337 \multiply\mm@charfam by "100
1338 \advance\mm@charcode by \mm@charfam
1339 \advance\mm@charcode by \mm@charslot
1340 \mathcode`#1=\mm@charcode
1341 \fi
1342 }
1343
1344 \newcommand*\MathUp[1]{%
1345 \ifx\@onlypreamble\@notprerr % not in preamble
1346 \ifmm@unicodemath
1347 \DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}
1348 \else
1349 \MathFamily{#1}{0}
1350 \fi
1351 \else % in preamble
1352 \AtBeginDocument{
1353 \ifmm@unicodemath
1354 \DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}
1355 \else
1356 \MathFamily{#1}{0}
1357 \fi
1358 }
1359 \fi
1360 }
1361
1362 \newcommand*\MathIt[1]{%
1363 \ifx\@onlypreamble\@notprerr % not in preamble
1364 \ifmm@unicodemath
1365 \DeclareMathSymbol{#1}{\mathalpha}{letters}{`#1}
1366 \else
1367 \MathFamily{#1}{1}
1368 \fi
1369 \else % in preamble
1370 \AtBeginDocument{
1371 \ifmm@unicodemath
1372 \DeclareMathSymbol{#1}{\mathalpha}{letters}{`#1}
1373 \else
1374 \MathFamily{#1}{1}
1375 \fi
1376 }
1377 \fi
1378 }
1379
1380 % \end{macrocode}
1381 % With a similar approach we could also create additional macros to set any letter
1382 % in bold or sans serif. However, there is no default family number associated
1383 % with these typefaces. The family number depends on the font package being loaded and
1384 % may vary depending on specific |\DeclareSymbolFont| used.
1385 % Therefore, setting letters in bold or sans serif requires additional consideration
1386 % and may not have a straightforward solution.
1387 %
1388 % \medskip
1389 % In addition to |\MathUp| and |\MathIt|, we also offer the following command
1390 % to set a group of letters, among `e, i, j', in roman typeface.
1391 % \begin{macrocode}
1392 \newcommand*\MathNumbers[1]{%
1393 \in@{e}{#1} \ifin@ \MathUp{e} \fi
1394 \in@{i}{#1} \ifin@ \MathUp{i} \fi
1395 \in@{j}{#1} \ifin@ \MathUp{j} \fi
1396 }
1397
1398 % \end{macrocode}
1399 % \DescribeMacro{\apply}
1400 % With the inverse switch |\MathNormal|, you can apply the normal (italic) style
1401 % on any comma-separated list of characters. This is achieved using
1402 % the |\apply| macro, \eg |\apply\macro{arg1,arg2}|
1403 % expands to |\macro{arg1}\macro{arg2}|.
1404 % Thus |\apply\MathUp{e,i,j}| is equivalent to |\MathUp{e}\MathUp{i}\MathUp{j}|.
1405 % I discovered this powerfull macro on \texttt{iterate190.rssing.com} by searching for
1406 % ``TeX How to iterate over a comma separated list''.
1407 % The answer was posted under the pseudonym `wipet' on 2021/02/26.
1408 % Let its author, Petr Ol\v{s}ák, be thanked.
1409 % This macro allows to accomplish tasks that
1410 % usual loop instructions like |\@for| or |\foreach| cannot achieve due to
1411 % errors like ``\texttt{!~Improper alphabetic constant}''.
1412 % For instance, if you try |\def\letter{A} \MathUp{\letter}| it will fail
1413 % because the control sequence |\letter| is not strictly
1414 % equivalent here to the single character `A'.
1415 %
1416 % \medskip
1417 % \begin{macrocode}
1418 \def\apply#1#2{\apply@#1#2,\apply@,}
1419 \def\apply@#1#2,{\ifx\apply@#2\empty
1420 \else #1{#2}\afterfi@{\apply@#1}\fi}
1421 \def\afterfi@#1#2\fi{\fi#1}
1422
1423 \newcommand*\MathNormal[1]{% list argument
1424 \apply\MathIt{#1}
1425 }
1426
1427 % \end{macrocode}
1428 %
1429 % The following commands were used originally (until version 2.2)
1430 % to set the math letters e, i or j in upright shape,
1431 % but only worked in the preamble.
1432 % This is now managed by the more powerful |\MathUp| command, but
1433 % the old commands are maintained as alias for |\MathUp|.
1434 % \medskip
1435 %
1436 % \begin{macrocode}
1437 \newcommand{\enumber}{\MathUp{e}}
1438 \newcommand{\inumber}{\MathUp{i}}
1439 \newcommand{\jnumber}{\MathUp{j}}
1440
1441 % \end{macrocode}
1442 %
1443 % Obtaining an upright Greek letter $\pi$ must be handled differently.
1444 % The toggles are called |\pinumber| and |\pinormal|
1445 % and can be used anywhere in the document.
1446 %
1447 % But |\pinumber| must be called first in the preamble with an optional argument.
1448 % This argument can be a valid command name that produces an upright pi letter
1449 % (after having loading an appropriate package).
1450 % Compatibility with \textsf{unicode-math} is a bit tricky!
1451 % When given without an argument in the preamble,
1452 % |\pinumber| uses an LGR font encoding called \texttt{lmr}.
1453 % A new feature (v2.11) for |\pinumber| is provided with keyval options to
1454 % use many other Greek pi letters without loading
1455 % a whole package, thus without altering the other (italic) Greek letters.
1456 % We achieve this with |\DeclareSymbolFont| and |\DeclareMathSymbol|.
1457 % We just have to know the `name' of the desired symbol font.
1458 %
1459 % \medskip
1460 % \begin{macrocode}
1461 \newif\ifmm@lgr
1462 \define@cmdkey{pifonts}[mm@]{lgrmath}[lmr]{\mm@lgrtrue}
1463 \newif\ifmm@upgreek
1464 \define@choicekey{pifonts}{upgreek}[\mm@upgreek@option]%
1465 {Euler,Symbol,Symbolsmallscale}[Symbol]{\mm@upgreektrue}
1466 \newif\ifmm@mathdesign
1467 \define@choicekey{pifonts}{mathdesign}[\mm@mathdesign@option]%
1468 {Utopia,Garamond,Charter}[Charter]{\mm@mathdesigntrue}
1469 \newif\ifmm@kpfonts
1470 \define@choicekey{pifonts}{kpfonts}[\mm@kp@option]%
1471 {normal,light}[normal]{\mm@kpfontstrue}
1472 \define@boolkeys{pifonts}[mm@]{fourier,pxfonts,txfonts}[true]
1473 \newif\ifmm@fontspec
1474 \define@cmdkey{pifonts}[mm@]{fontspec}[GFS Didot]{\mm@fontspectrue}
1475
1476 \newcommand*\pifonts[1]{%
1477 \setkeys{pifonts}{#1}
1478 \let\pi\relax
1479
1480 \ifmm@lgr
1481 \DeclareFontEncoding{LGR}{}{}
1482 \DeclareSymbolFont{mmupgr}{LGR}{\mm@lgrmath}{m}{n}
1483 % may work with bold (b) instead of m
1484 \DeclareMathSymbol{\pi}{\mathord}{mmupgr}{112}
1485
1486 \else\ifmm@fontspec
1487 \@ifpackageloaded{fontspec}{}{
1488 \PackageError{mismath}{\string\pinumber\space with
1489 the `fontspec' option\MessageBreak
1490 needs the fontspec package,\MessageBreak
1491 which must be run with LuaLaTeX or XeLaTeX}{}
1492 }
1493 \newfontfamily\mismathgreekfont{\mm@fontspec}[NFSSFamily=mgr]
1494 \DeclareSymbolFont{mmupgr}{TU}{mgr}{m}{n}
1495 \Umathchardef\pi="7 \symmmupgr "03C0
1496
1497 \else\ifmm@upgreek
1498 \ifdefstring{\mm@upgreek@option}{Euler}{
1499 \DeclareFontFamily{U}{eur}{\skewchar\font'177}
1500 \DeclareFontShape{U}{eur}{m}{n}{%
1501 <-6> eurm5 <6-8> eurm7 <8-> eurm10}{}
1502 \DeclareSymbolFont{mmupgr}{U}{eur}{m}{n}
1503 \DeclareMathSymbol{\pi}{\mathord}{mmupgr}{"19}
1504 }{
1505 \ifdefstring{\mm@upgreek@option}{Symbol}{
1506 \DeclareSymbolFont{mmupgr}{U}{psy}{m}{n}
1507 \DeclareMathSymbol{\pi}{\mathord}{mmupgr}{`p}
1508 }{
1509 \ifdefstring{\mm@upgreek@option}{Symbolsmallscale}{
1510 \DeclareFontFamily{U}{fsy}{}
1511 \DeclareFontShape{U}{fsy}{m}{n}{<->s*[.9]psyr}{}
1512 \DeclareSymbolFont{mmupgr}{U}{fsy}{m}{n}
1513 \DeclareMathSymbol{\pi}{\mathord}{mmupgr}{`p}
1514 }{}}}
1515
1516 \else\ifmm@mathdesign
1517 \ifdefstring{\mm@mathdesign@option}{Utopia}{
1518 \DeclareSymbolFont{mmupgr}{OML}{mdput}{m}{n}
1519 }{
1520 \ifdefstring{\mm@mathdesign@option}{Garamond}{
1521 \DeclareSymbolFont{mmupgr}{OML}{mdugm}{m}{n}
1522 }{
1523 \ifdefstring{\mm@mathdesign@option}{Charter}{
1524 \DeclareSymbolFont{mmupgr}{OML}{mdbch}{m}{n}
1525 }{}}}
1526
1527 \else\ifmm@fourier
1528 \DeclareFontEncoding{FML}{}{}
1529 \DeclareSymbolFont{mmupgr}{FML}{futm}{m}{it}
1530
1531 \else\ifmm@kpfonts
1532 \ifdefstring{\mm@kp@option}{normal}{
1533 \DeclareSymbolFont{mmupgr}{U}{jkpmia}{m}{it}
1534 }{
1535 \ifdefstring{\mm@kp@option}{light}{
1536 \DeclareSymbolFont{mmupgr}{U}{jkplmia}{m}{it}
1537 }{}}
1538
1539 \else\ifmm@pxfonts
1540 \DeclareSymbolFont{mmupgr}{U}{pxmia}{m}{it}
1541
1542 \else\ifmm@txfonts
1543 \DeclareSymbolFont{mmupgr}{U}{txmia}{m}{it}
1544
1545 \fi\fi\fi\fi\fi
1546 \DeclareMathSymbol{\pi}{\mathord}{mmupgr}{"19}
1547 \fi\fi\fi
1548 }
1549
1550 \newcommand*\pinumber[1][]{%
1551 \ifthenelse{\equal{#1}{}}{% no argument given
1552 \ifx\@onlypreamble\@notprerr % not in preamble
1553 \@ifundefined{savedpi}{
1554 \PackageWarning{mismath}{%
1555 \string\pinumber\space
1556 must be used in the preamble first}
1557 }{\let\pi\savedpi}
1558 \else % in the preamble
1559 \AtEndPreamble{\AtBeginDocument{
1560 \let\itpi\pi
1561 \pifonts{lgrmath}
1562 \let\savedpi\pi
1563 }}
1564 \fi
1565 }{% command name or keyval options, necessarily in the preamble
1566 \AtEndPreamble{\AtBeginDocument{% must be here with unicode-math
1567 \let\itpi\pi
1568 \@ifundefined{#1}{%
1569 \pifonts{#1}
1570 }{
1571 \ifmm@unicodemath
1572 \ifthenelse{\equal{#1}{uppi}}{% or "1D70B
1573 \renewcommand\pi{\symup{\symbol{"03C0}}}
1574 \renewcommand\itpi{\symit{\symbol{"03C0}}}
1575 }{\renewcommand{\pi}{\csname #1\endcsname}}
1576 \else
1577 \renewcommand{\pi}{\csname #1\endcsname}
1578 \fi
1579 }
1580 \let\savedpi\pi
1581 }}
1582 }
1583 }
1584
1585 \newcommand{\pinormal}{%
1586 \@ifundefined{itpi}{
1587 \PackageWarning{mismath}{Command \string\itpi\space undefined,
1588 \MessageBreak
1589 use \string\pinumber\space in the preamble first}
1590 }{
1591 \ifmm@unicodemath
1592 \@ifundefined{savedpi}{
1593 \PackageError{mismath}{Before using \string \pinormal,
1594 \MessageBreak
1595 you must call \string\pinumber\space in the preamble}{}}
1596 \fi
1597 \let\pi\itpi
1598 }
1599 }
1600
1601 % \end{macrocode}
1602 % When |\pinumber|\oarg{keyval} has been called, you can also get
1603 % some other mathematical constants using Greek letters in the same font (\texttt{mmupgr})
1604 % \eg $\othergamma$, the Euler-Mascheroni constant:
1605 % \begin{verbatim}
1606 % \let\gamma\relax
1607 % \DeclareMathSymbol{\gamma}{\mathord}{mmupgr}{"0D}
1608 % \end{verbatim}
1609 % \vspace{-2ex}
1610 % If \textsf{unicode-math} is used, you must put these commands inside
1611 % |\AtBeginDocument|.
1612 % The hexadecimal code |"0D| depends on the option passed to |\pinumber|
1613 % in the preamble (see the command |\pifonts| above and search in package docs).
1614 % And to get the golden ratio $\othervarphi$:
1615 % \begin{verbatim}
1616 % \let\varphi\relax
1617 % \DeclareMathSymbol{\varphi}{\mathord}{mmupgr}{"27}
1618 % \end{verbatim}
1619 % \vspace{-2ex}
1620 % I you want to preserve the original $\gamma$ or $\varphi$,
1621 % you can define |\upgamma| or |\upvarphi| instead.
1622 %
1623 % \medskip
1624 % Commands for vectors and tensors follow.
1625 % \medskip
1626 % \begin{macrocode}
1627 \newboolean{arrowvect}
1628 \setboolean{arrowvect}{true}
1629 \newcommand{\arrowvect}{\setboolean{arrowvect}{true}}
1630 \newcommand{\boldvect}{\setboolean{arrowvect}{false}}
1631 \newcommand{\boldvectcommand}{\boldsymbol} % from amsbsy package
1632 \mm@macro{vect}{\ifthenelse{\boolean{arrowvect}}{
1633 \vv}{\boldvectcommand}} % doesn't work well with \if... \fi
1634 \newcommand*{\hvect}[1]{\vect{\vphantom{A}#1}}
1635 \newcommand*{\hvec}[1]{\vec{\vphantom{A}#1}}
1636
1637 \newcommand*{\@norm}[1]{
1638 \mbox{\raisebox{1.75pt}{\small$\bigl\Vert$}} #1
1639 \mbox{\raisebox{1.75pt}{\small$\bigr\Vert$}} }
1640 % works better than with relative length
1641 \newcommand*{\@@norm}[1]{
1642 \mbox{\footnotesize\raisebox{1pt}{$\Vert$}} #1
1643 \mbox{\footnotesize\raisebox{1pt}{$\Vert$}} }
1644 \newcommand*{\@@@norm}[1]{
1645 \mbox{\tiny\raisebox{1pt}{$\Vert$}} #1
1646 \mbox{\tiny\raisebox{1pt}{$\Vert$}} }
1647 \@ifundefined{norm}{\providecommand*{\norm}[1]{
1648 \mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}}
1649 }
1650 }{\mm@warning{norm}} % bad result with libertinust1math
1651
1652 \newcommand{\tensor}{\mathbfsfit} % isomath uses \mathsfbfit
1653
1654 % \end{macrocode}
1655 %
1656 % `Operators', as for example common function names, are generally defined
1657 % using the |\DeclareMathOperator| command or |\operatorname| for occasional use.
1658 % Operators are then typeset in roman (upright) shape and with appropriate thin space
1659 % before and after the operator name.
1660 % However, for the `differential' operator d, no space should be left after it
1661 % to obtain, for example, `$\di x$' instead of `$\operatorname{d} x$'.
1662 %
1663 % \medskip
1664 % Two other operators, suggested by `quark67', representing differences
1665 % or variations are defined by the macros |\opDelta| and |\opdelta|.
1666 % They use the Greek letters $\upDelta$ and $\updelta$ with appropriate spacing,
1667 % similar to |\di|.
1668 % By default |\upDelta| will be an alias for |\Delta|.
1669 % Generally, the uppercase Delta is upright
1670 % unless a package is loaded to change this, but the lowercase delta
1671 % is italic by default.
1672 %
1673 % To use the |\opdelta| macro, it is therefore necessary
1674 % to load a package that provides the lowercase delta in upright shape,
1675 % such as \textsf{mathgreeks} or \textsf{unicode-math},
1676 % or you can use the same symbol font \texttt{mmupgr} as seen above for the upright pi
1677 % (if |\pinumber|\oarg{keyval} has been called previously).
1678 % So you could get the upright delta with:
1679 % \begin{verbatim}
1680 % \DeclareMathSymbol{\updelta}{\mathord}{mmupgr}{"0E}
1681 % \end{verbatim} \vspace{-2ex}
1682 % The hexadecimal code |"0E| depends on the option passed to |\pinumber|.
1683 % If you have loaded a package that provides upright shapes of Delta and delta,
1684 % it may be necessary to create new aliases for |\upDelta| or |\updelta|,
1685 % \eg |\let\updelta\|\meta{mydelta}.
1686 % \begin{macrocode}
1687 \mm@macro{di}{\operatorname{d}\mathopen{}}
1688 \mm@macro{upDelta}{\Delta}
1689 \mm@macro{opDelta}{\operatorname{\upDelta}\mathopen{}}
1690 \mm@macro{opdelta}{\operatorname{\updelta}\mathopen{}}
1691
1692 % \end{macrocode}
1693 % For the field of probability, we provide the macros |\P|, |\E|, and |\V|,
1694 % which are defined as operators. They are typeset in normal roman font,
1695 % but can be changed to double-struck style (or another style) if desired.
1696 % \begin{macrocode}
1697 \newcommand\probastyle{}
1698 \let\Par\P % end of paragraph symbol
1699 \renewcommand{\P}{\operatorname{\probastyle{P}}}
1700 \mm@macro{E}{\operatorname{\probastyle{E}}}
1701 \mm@macro{V}{\operatorname{\probastyle{V}}}
1702
1703 \newcommand*\MathProba[1]{%
1704 \in@{P}{#1} \ifin@ \MathUp{P} \fi
1705 \in@{E}{#1} \ifin@ \MathUp{E} \fi
1706 \in@{V}{#1} \ifin@ \MathUp{V} \fi
1707 }
1708
1709 % \end{macrocode}
1710 % Classic operators or function identifiers are presented below. They will be defined only
1711 % if the option \texttt{nofunction} has not been activated.
1712 % As for |\DeclareMathOperator| both arguments are generally similar.
1713 % \medskip
1714 % \begin{macrocode}
1715 \ifmm@nofunction\else
1716 \mm@operator{\adj}{adj}
1717 \mm@operator{\Aut}{Aut}
1718 \mm@operator{\codim}{codim}
1719 \mm@operator{\coker}{coker}
1720 \mm@operator{\Conv}{Conv}
1721 \mm@operator{\cov}{cov}
1722 \mm@operator{\Cov}{Cov}
1723 \mm@macro{curl}{\operatorname{\vect{\mathup{curl}}}}
1724 \mm@operator[divg]{\divg}{div}
1725
1726 \mm@operator{\End}{End}
1727 \mm@operator{\erf}{erf}
1728 \mm@macro{grad}{\operatorname{\vect{\mathup{grad}}}}
1729 \mm@operator{\id}{id} % mathop or mathord?
1730 \mm@operator{\Id}{Id}
1731 \mm@operator{\im}{im}
1732 \mm@operator{\lb}{lb}
1733 \mm@operator{\lcm}{lcm}
1734 \mm@operator{\rank}{rank}
1735
1736 \mm@operator{\Res}{Res}
1737 \mm@macro{rot}{\operatorname{\vect{\mathup{rot}}}}
1738 \mm@operator{\sgn}{sgn}
1739 \mm@operator{\sinc}{sinc}
1740 \mm@operator[spa]{\spa}{span}
1741 \mm@operator{\tr}{tr}
1742 \mm@operator{\var}{var}
1743 \mm@operator{\Var}{Var}
1744 \mm@operator[Zu]{\Zu}{Z}
1745
1746 \mm@operator{\arccot}{arccot}
1747 \mm@operator{\sech}{sech}
1748 \mm@operator{\csch}{csch}
1749 \mm@operator{\arsinh}{arsinh}
1750 \mm@operator{\arcosh}{arcosh}
1751 \mm@operator{\artanh}{artanh}
1752 \mm@operator{\arcoth}{arcoth}
1753 \mm@operator{\arsech}{arsech}
1754 \mm@operator{\arcsch}{arcsch}
1755 \fi
1756
1757 % \end{macrocode}
1758 %
1759 % The |\mathcal| alphabet, from the original Computer Modern font family,
1760 % is used here to produce $\Re$, $\Im$ and $\bigO$.
1761 % Several font packages redefine this alphabet producing glyphs that may seem less
1762 % suitable for the commands below.
1763 % We have therefore retained the original |\cmmathcal| math alphabet,
1764 % which can be used for other letters.
1765 % If \textsf{unicode-math} is called, it will redefine the commands |\Re| and |\Im|
1766 % in |\AtBeginDocument|, hence the use of |\AtEndPreamble{\AtBeginDocument{|\ldots
1767 % to ensure that the \textsf{mismath} redefinitions occur after the actions
1768 % of \textsf{unicode-math}.
1769 %
1770 % \begin{macrocode}
1771 \DeclareFontFamily{U}{cmsy}{\skewchar\font48 }
1772 \DeclareFontShape{U}{cmsy}{m}{n}{% from mathalpha
1773 <-5.5> cmsy5%
1774 <5.5-6.5> cmsy6%
1775 <6.5-7.5> cmsy7%
1776 <7.5-8.5> cmsy8%
1777 <8.5-9.5> cmsy9%
1778 <9.5-> cmsy10}{}
1779 \DeclareMathAlphabet{\cmmathcal}{U}{cmsy}{m}{n}
1780
1781 \AtEndPreamble{\AtBeginDocument{
1782 \ifmm@classicReIm\else
1783 \let\oldRe\Re
1784 \let\oldIm\Im
1785 \ifmm@otherReIm
1786 \renewcommand{\Re}{\cmmathcal{R}\mathit{e}}
1787 \renewcommand{\Im}{\cmmathcal{I}\mathit{m}}
1788 \else
1789 \renewcommand{\Re}{\operatorname{Re}}
1790 \renewcommand{\Im}{\operatorname{Im}}
1791 \fi\fi
1792 }}
1793
1794 \mm@operator[bigO]{\bigO}{\cmmathcal{O}}
1795 \mm@operator[bigo]{\bigo}{O}
1796 \mm@operator[lito]{\lito}{o}
1797
1798 % \end{macrocode}
1799 % And finally we present the remaining macros.
1800 %
1801 % With Cyrillic languages, the command |\C| may already be defined
1802 % but works only in text mode.
1803 % Then, it will not be redefined by \textsf{mismath}. However, the command
1804 % |\onlymathC| allows to use our |\C| macro in math mode,
1805 % without interfering the definition of the text |\C| that is already defined.
1806 %
1807 % When using \XeTeX\ or \LuaTeX\ engines with the \textsf{hyperref} package,
1808 % |\C| will be already defined and
1809 % you get the message ``\texttt{Command \string\C\space unavailable in encoding TU}''.
1810 % Therefore |\onlymathC| is automatically called in that case.
1811 % \medskip
1812 % \begin{macrocode}
1813 \mm@macro{mathset}{\mathbf}
1814 \mm@macro{R}{\mathset{R}}
1815 \mm@macro{C}{\mathset{C}}
1816 \AtBeginDocument{% \iftutex = LuaTex or XeTeX engines
1817 \@ifpackageloaded{hyperref}{\iftutex\onlymathC\fi}{} }
1818 \providecommand\onlymathC{\let\oldC\C
1819 \renewcommand{\C}{\TextOrMath{\oldC}{\mathset{C}}} }
1820 \mm@macro{N}{\mathset{N}}
1821 \mm@macro{Z}{\mathset{Z}}
1822 \mm@macro{Q}{\mathset{Q}}
1823 \mm@macro{F}{\mathset{F}}
1824 \mm@macro{K}{\mathset{K}}
1825
1826 \mm@macro{ds}{\displaystyle}
1827 \mm@macro{dlim}{\lim\limits}
1828 \mm@macro{dsum}{\sum\limits}
1829 \mm@macro{dprod}{\prod\limits}
1830 \mm@macro{dcup}{\bigcup\limits}
1831 \mm@macro{dcap}{\bigcap\limits}
1832
1833 \mm@macro{lbar}{\overline}
1834 \@ifundefined{hlbar}{
1835 \providecommand*{\hlbar}[1]{\overline{\vphantom{A}#1}}}{
1836 \mm@warning{hlbar} }
1837 \newcommand\@eqdef{\stackrel{\mathup{def}}{=}}
1838 \newcommand\@@eqdef{\stackrel{\upDelta}{=}}
1839 \mm@macro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}}
1840 \mm@macro{unbr}{\underbrace}
1841 \mm@macro{iif}{if and only if\xspace}
1842 \mm@macro{then}{\implies}
1843
1844 \@ifundefined{txt}{
1845 \providecommand*{\txt}[1]{\quad\text{#1}\quad} }{
1846 \mm@warning{txt} }
1847 \mm@macro{mul}{\mathclose{}\mathord{\times}\mathopen{}}
1848 \@ifundefined{pow}{
1849 \providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{
1850 \mm@warning{pow} }
1851 % \end{macrocode}
1852 % For |\abs|, the |\left...\right| structure is inserted within a pair of curly braces
1853 % to prevent incorrect spacing before the first delimiter when it follows a function name,
1854 % in cases where the package \textsf{mleftright} is used
1855 % with the command |\mleftright| activated.
1856 % This issue was pointed out by `quark67'.
1857 % \begin{macrocode}
1858 \@ifundefined{abs}{
1859 \providecommand*{\abs}[1]{{\left\vert#1\right\vert}} }{
1860 \mm@warning{abs} }
1861 \@ifundefined{lfrac}{
1862 \providecommand*{\lfrac}[3][7mu]{%
1863 \frac{\mkern#1#2\mkern#1}{\mkern#1#3\mkern#1}} }{
1864 \mm@warning{lfrac} }
1865
1866 \newcommand{\systemstretch}{1.2}
1867 \newcommand{\systemsep}{\medspace}
1868 \newenvironment{system}[1][l]{
1869 \renewcommand{\arraystretch}{\systemstretch}
1870 \setlength{\arraycolsep}{0.15em}
1871 \left\{\begin{array}{@{\systemsep}#1@{}} %
1872 }{\end{array}\right.}
1873
1874 \newenvironment{spmatrix}{
1875 \left(\begin{smallmatrix}
1876 }{\end{smallmatrix}\right)}
1877
1878 \newenvironment{mathcols}{% needs multicol package
1879 \ifmm@multicol
1880 \renewcommand{\columnseprule}{0.1pt}
1881 \begin{multicols}{2}
1882 \par\noindent\hfill
1883 \begin{math}\begin{aligned}\displaystyle
1884 \else
1885 \PackageError{mismath}{The mathcols environment
1886 needs the multicol package}{Call the package multicol
1887 in your preamble.}
1888 \fi
1889 }{ \end{aligned}\end{math} \hfill\mbox{}
1890 \end{multicols}
1891 }
1892 \newcommand{\changecol}{%
1893 \end{aligned}\end{math} \hfill\mbox{}
1894 \par\noindent\hfill
1895 \begin{math}\begin{aligned}\displaystyle}
1896 % \end{macrocode}
1897 %
1898 % \section*{Change History}
1899 %
1900 % \begin{multicols}{2}\begin{raggedright}
1901 % \renewcommand\changes[3]{\item[#1 \ (#2)] \mbox{}\\ #3}
1902 % \setlength{\compactlistindent}{-1em}
1903 % \begin{list}{}{\setlength\labelwidth{1.4em}\setlength{\leftmargin}{2em}
1904 % \setlength{\parsep}{0pt}}
1905 %
1906 % \changes{v0.1}{2011/12/27}{First personal version.}
1907 %
1908 % \changes{v1.0}{2019/04/11}{Initial published version.}
1909 %
1910 % \changes{v1.1}{2019/04/20}{
1911 % Changing the default font for \cs{pinumber} from Euler to Symbol.}
1912 %
1913 % \changes{v1.2}{2019/04/27}{
1914 % \begin{compactlist}
1915 % \item commands \cs{enumber}, \cs{inumber}, \cs{jnumber} in \cs{AtBeginDocument}\\
1916 % \hand works fine with \textsf{beamer} now,
1917 % \item new general \cs{mm@operator} macro,
1918 % \item using \cs{mathup} instead of \cs{mathrm},
1919 % \item including \textsf{mathtools},
1920 % \item in \cs{DeclareSymbolFont} 'Roman' changed to 'up',
1921 % \item changes in the documentation,
1922 % \item replacing \cs{PEroman} by \cs{PEupright}.
1923 % \end{compactlist}}
1924 %
1925 % \changes{v1.3}{2019/05/08}{
1926 % \begin{compactlist}
1927 % \item using \cs{bslash} in the internal \cs{mm@warning} macro
1928 % to type out a control sequence whose name is given as parameter,
1929 % \item including the \textsf{mathfixs} package,
1930 % \item many corrections in the documentation.
1931 % \end{compactlist}}
1932 %
1933 % \changes{v1.4}{2019/05/22}{
1934 % In \cs{DeclareSymbolFont} 'up' chan\-ged to 'UpSh'
1935 % to prevent incompatibility with \textsf{unicode-math}.}
1936 %
1937 % \changes{v1.5}{2019/05/30}{
1938 % \begin{compactlist}
1939 % \item a solution for using \cs{mul} with \cs{frac} \hand use braces,
1940 % \item addition of the \cs{paren} macro.
1941 % \end{compactlist}}
1942 %
1943 % \changes{v1.6}{2019/09/06}{
1944 % Removing the \textsf{mathfixs} package because of problems with fractions.}
1945 %
1946 % \changes{v1.7}{2019/12/27}{
1947 % Adding a table of contents to the documentation.}
1948 %
1949 % \changes{v1.8}{2020/11/15}{
1950 % Small changes in the documentation, in particular
1951 % an incompatibility is mentioned when using `i' with accent in \textsf{beamer} titles:
1952 % (use \texttt{\textbackslash\textasciicircum i} instead of î).}
1953 %
1954 % \changes{v1.9}{2022/10/17}{
1955 % \begin{compactlist}
1956 % \item in \cs{DeclareSymbolFont} 'UpSh' replaced by 'operators'
1957 % \item\cs{PackageWarning} replaced by \cs{PackageWarningNoLine} for existing macros,
1958 % \item \cs{thickspace} replaces \cs{medspace} in \cs{lfrac},
1959 % \item changing the documentation font: from lmodern to Palatino (\textsf{mathpazo}).
1960 % \end{compactlist}}
1961 %
1962 % \changes{v1.10}{2022/10/25}{
1963 % \cs{pinumber} code updated to prevent incompatibility
1964 % with the new version of the \textsf{frenchmath} package
1965 % (in which the default 'upgreek' option has been changed from Symbol to Euler).}
1966 %
1967 % \changes{v2.0}{2022/11/11}{
1968 % \begin{compactlist}
1969 % \item enhancing \cs{pinumber} to use other Greek letters packages
1970 % (it is no longer compatible with the older),
1971 % \item \cs{paren} has been removed (useless),
1972 % \item \cs{hvect} and \cs{hlbar} have been slightly modified (\cs{phantom}\texttt{\{t\}}
1973 % instead of \cs{phantom}\texttt{\{h\}}),
1974 % \item several changes in the documentation
1975 % (now the Charter font is used, with the \textsf{mathdesign} package).
1976 % \end{compactlist}}
1977 %
1978 % \changes{v2.1}{2022/12/26}{
1979 % \begin{compactlist}
1980 % \item including the \textsf{ibrackets} package to improve
1981 % the management of square brackets,
1982 % \item new macros \cs{codim}, \cs{sinc}, \cs{var}, \cs{eqdef*},
1983 % \item removing the warning for the obsolete \cs{paren} command,
1984 % \item a small change in the \cs{norm} command (bars in small size),
1985 % \item several changes in documentation.
1986 % \end{compactlist}}
1987 %
1988 % \changes{v2.2}{2023/01/06}{
1989 % New option \texttt{ibrackets} to load the \textsf{ibrackets} package
1990 % \emph{optionally} because of errors
1991 % when using \cs{DeclarePairedDelimiter} with square brackets.}
1992 %
1993 % \changes{v2.3}{2023/02/09}{
1994 % Introducing keyval options as an alternative to \cs{enumber},
1995 % \cs{inumber}, \cs{jnumber}, \cs{PEupright},
1996 % and also for using ibrackets, \cs{boldvect} and \cs{arrowvect}.}
1997 %
1998 % \changes{v2.4}{2023/02/18}{
1999 % \begin{compactlist}
2000 % \item new powerful macros \cs{MathUp}, \cs{MathIt},
2001 % (and \cs{MathNumbers}, \cs{MathProba}, \cs{MathNormal}),
2002 % \item keyval options are no longer useful and have been removed,
2003 % \item loading the package \textsf{ifthen} has been forgotten in v2.3
2004 % (causing possible issues),
2005 % \item no more incompatibility when using `i' with accent in \textsf{beamer} titles.
2006 % \end{compactlist}}
2007 %
2008 % \changes{v2.5}{2023/02/23}{
2009 % \begin{compactlist}
2010 % \item unification of the code of \cs{MathUp} and \cs{MathIt},
2011 % \item a new powerful macro \cs{apply} is used in \cs{MathNormal} to act on a list,
2012 % \item new \cs{tensor} command.
2013 % \end{compactlist}}
2014 %
2015 % \changes{v2.6}{2023/03/01}{
2016 % \begin{compactlist}
2017 % \item bug fix in \cs{mm@macro},
2018 % \item solving incompatibility of the \cs{C} macro when using \textsf{babel} with Russian
2019 % (thanks to Murray Eisenberg for this bug report on TeX StackExchange),
2020 % \item \cs{mathrm} added in the macro \cs{eqdef*}.
2021 % \end{compactlist}}
2022 %
2023 % \changes{v2.7}{2023/03/05}{
2024 % \begin{compactlist}
2025 % \item macros for sets of numbers (\cs{R}, \cs{C}\ldots) now available only in math mode
2026 % (following remarks by David Carlisle and Enrico Gregorio),
2027 % \item special warning when loading \textsf{babel} with Russian
2028 % (\cs{C} will not be defined in that case).
2029 % \end{compactlist}}
2030 %
2031 % \changes{v2.8}{2023/07/26}{
2032 % New macro \cs{onlymathC} designed for using \cs{C} in pmath mode
2033 % when Russian language is loaded.}
2034 %
2035 % \changes{v2.9}{2023/12/19}{
2036 % New option \texttt{decimalcomma}.}
2037 %
2038 % \changes{v2.10}{2024/02/20}{
2039 % \begin{compactlist}
2040 % \item better compatibility with \textsf{unicode-math}:
2041 % for the options \texttt{ibrackets}, \texttt{decimalcomma}
2042 % and the commands \cs{MathUp}, \cs{MathIt},
2043 % \item explicit error message when using \texttt{mathcols}
2044 % without loading the \textsf{multicol} package.
2045 % \end{compactlist}}
2046 %
2047 % \changes{v2.11}{2024/02/26}{
2048 % \begin{compactlist}\setlength\compactlistindent{-0.5em}
2049 % \item enhancements of the \cs{pinumber} macro with keyval options:
2050 % \begin{compactlist}[\dash]
2051 % \item no necessity to load a Greek letters package,
2052 % \item improvements of compatibility with \textsf{unicode-math};
2053 % \end{compactlist}
2054 % \item changing the font to Adobe Utopia with the package \textsf{fourier}.
2055 % \end{compactlist}}
2056 %
2057 % \changes{v2.12}{2024/02/29}{
2058 % \begin{compactlist}
2059 % \item the \textsf{xparse} package has been removed by mistake in v2.11,
2060 % causing some compatibility issues, it is loaded again by \textsf{mismath},
2061 % \item improvements to make \cs{pinumber} work better with \textsf{unicode-math}.
2062 % \end{compactlist}}
2063 %
2064 % \changes{v3.0}{2024/03/15}{
2065 % \begin{compactlist}
2066 % \item rewriting the \cs{pinumber} command with a new \cs{pifonts} macro,
2067 % \item presenting other \texttt{lgrmath} values for \cs{pinumber} in the doc,
2068 % \item The \cs{C} macro is now inside \cs{AtBeginDocument},
2069 % \item \textsf{amsmath} isn't loaded explicitly because \textsf{mathtools} loads it,
2070 % \item bug fix with options \texttt{decimalcomma} and \texttt{ibrackets},
2071 % \item new option \texttt{nofunction} to lighten the package loading,
2072 % \item addition of macros \cs{coker} and \cs{Res} as standard operator names,
2073 % \item new option \texttt{classicReIm} to deactivate \cs{Im} and \cs{Re} redefinition,
2074 % \item new option \texttt{otherReIm} to provide an alternative writing
2075 % with \texttt{cmsy} font,
2076 % \item removing the \cs{PEupright} command,
2077 % \item default space in the \cs{lfrac} macro increased from \texttt{\textbackslash:}
2078 % (5mu) to 7mu,
2079 % \item new optional parameter for adjusting the space in \cs{lfrac},
2080 % \item changing the \cs{vphantom} argument in \cs{hvect}, \cs{hvec} and \cs{lbar}
2081 % from `t' to `A', looks better.
2082 % \end{compactlist}}
2083 %
2084 % \changes{v3.1}{2024/06/16}{
2085 % \begin{compactlist}\setlength\compactlistindent{-0.5em}
2086 % \item adding a change history,
2087 % \item bug fix with the \cs{C} macro when using \textsf{hyperref} with
2088 % \LuaTeX{} or \XeTeX{} engines,
2089 % \item the $\upDelta$ produced in \cs{eqdef*} is now obtained with \cs{upDelta}
2090 % (\cs{mathrm}, used before, doesn't work generally),
2091 % \item several relevant suggestions and remarks by `quark67':
2092 % \begin{compactlist}[\dash]
2093 % \item new macros for variations \cs{opDelta} and small variations \cs{opdelta},
2094 % \item redefinition of \cs{then} as an alias for \cs{implies},
2095 % \item improvement of the \cs{abs} macro,
2096 % \item including the \textsf{mleftright} package;
2097 % \end{compactlist}
2098 % \item new implementation of \cs{di},
2099 % \item improvement of the \cs{mul} macro.
2100 % \end{compactlist}}
2101 %
2102 % \changes{v3.2}{2025/10/08}{
2103 % \begin{compactlist}
2104 % \item conditional loading of the \textsf{xparse} package since it is obsolete
2105 % with the October 2020 \LaTeX\ release,
2106 % \item when used in the preamble \cs{pinumber} in now called within \cs{AtEndPreamble}
2107 % to preserve its effect when used in combination with the \textsf{mathgreeks} package.
2108 % \end{compactlist}}
2109 %
2110 % \end{list}\end{raggedright}
2111 % \end{multicols}
2112 %
2113 % \begin{thebibliography}{35}
2114 % \begin{raggedright}
2115 % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according
2116 % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), No.~1.
2117 % \url{http://www.tug.org/TUGboat/tb18-1/tb54becc.pdf}.
2118 % \bibitem{NIST} \emph{Typefaces for Symbols in Scientific Manuscripts},
2119 % \url{https://www.physics.nist.gov/cuu/pdf/typefaces.pdf}.
2120 % \bibitem{SI} \emph{Guide for the Use of the International System of Units (SI)},
2121 % NIST (National Institute of Standards and Technology), updated March 4, 2020
2122 % \url{https://www.nist.gov/pml/special-publication-811}.
2123 % \bibitem{ICTNS} \emph{On the Use of Italic and up Fonts for Symbols in Scientific Text},
2124 % I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee
2125 % on Terminology, Nomenclature and Symbols), dec 1999,
2126 % \url{https://old.iupac.org/standing/idcns/italic-roman_dec99.pdf}.
2127 % \bibitem{VECT} \emph{\textsf{esvect} -- Typesetting vectors with beautiful
2128 % arrow with \LaTeXe}, Eddie Saudrais, CTAN, v1.3 2013/07/11.
2129 % \bibitem{MLR} \emph{The \textsf{mleftright} package}, Heiko Oberdiek, CTAN, v1.2 2019/12/03.
2130 % \bibitem{TOOL} \emph{The \textsf{mathtools} package}, Morten Høgholm, Lars Madsen, CTAN,
2131 % v1.29 2022/06/29.
2132 % \bibitem{AMS} \emph{\textsf{amsmath} -- \AmS\ mathmatical facilities for \LaTeX},
2133 % Frank Mittelbach, Rainer Schöpf, Michael Downes, Davis M.~Jones, David Carlisle,
2134 % CTAN, v2.17n 2022/04/08.
2135 % \bibitem{UNIC} \emph{Experimental Unicode mathematical typesetting:
2136 % The \textsf{unicode-math} package}, Will Robertson, Philipp Stephani, Joseph Wright,
2137 % Khaled Hosny, and others, CTAN, v0.8r 2023/08/13.
2138 % \bibitem{FIXM} \emph{The \textsf{fixmath} package for \LaTeXe}, Walter Schmidt,
2139 % CTAN, v0.9 2000/04/11.
2140 % \bibitem{ISOM} \emph{\textsf{isomath} -- Mathematical style for science and technology},
2141 % Günter Milde, CTAN, v0.6.1 2012/09/04.
2142 % \bibitem{PMISO} \emph{\textsf{PM-ISOmath}, The Poor Man ISO math bundle},
2143 % the \textsf{pm-isomath} package by Claudio Beccari, CTAN, v1.2.00 2021/08/04.
2144 % \bibitem{MGREEK} \emph{The \textsf{mathgreeks} package}, Antoine Missier, CTAN,
2145 % v1.2 2024/05/07.
2146 % \bibitem{GREEK} \emph{The \textsf{upgreek} package for \LaTeXe}, Walter Schmidt,
2147 % CTAN, v2.0 2003/02/12.
2148 % \bibitem{DESIGN} \emph{The \textsf{mathdesign} package},
2149 % Paul Pichaureau, CTAN, v2.31 2013/08/29.
2150 % \bibitem{KPF} \emph{\textsf{Kp-Fonts} -- The Johannes Kepler project},
2151 % Christophe Caignaert, CTAN, v3.34 20/09/2022.
2152 % \bibitem{FOUR} \textsf{Fourier-GUT\hspace{-0.1em}\emph{enberg}},
2153 % Michel Bovani, CTAN, v1.3 2005/01/30.
2154 % \bibitem{PX} \emph{\textsf{PX Fonts} -- Palatino-like fonts in support of mathematics},
2155 % Young Ryu, CTAN, 2000/12/14.
2156 % \bibitem{TX} \emph{\textsf{TX Fonts} -- Times-like fonts in support of mathematics},
2157 % Young Ryu, CTAN, 2000/12/15.
2158 % \bibitem{LIB} \emph{The LibertinusT1 Math Package}, Michael Sharpe, CTAN, v2.0.4 2024/01/14.
2159 % \bibitem{LGR} \emph{The \textsf{lgrmath} package}, Jean-François B., CTAN, v1.0 2022/11/16.
2160 % \bibitem{NTX} \emph{New TX font package}, Micahel Sharpe, CTAN, v1.735 2024/03/01.
2161 % \bibitem{ALPHA} \emph{The \textsf{textalpha} package}
2162 % (part of the \textsf{greek-fontenc} bundle), Günter Milde, CTAN, v2.1 2022/06/14.
2163 % \bibitem{SPA} \emph{The \textsf{spacingtricks} package}, Antoine Missier, CTAN,
2164 % v1.8 2023/12/06.
2165 % \bibitem{BRACKET} \emph{Intelligent brackets -- The \textsf{ibrackets} package},
2166 % Antoine Missier, CTAN, v1.2, 2023/07/26.
2167 % \bibitem{INT} \emph{The \textsf{interval} package}, Lars Madsen, CTAN,
2168 % v0.4 2019/03/06.
2169 % \bibitem{ICOMMA} \emph{The \textsf{icomma} package for \LaTeXe},
2170 % Walter Schmidt, CTAN, v2.0 2002/03/10.
2171 % \bibitem{NCC} \emph{The \textsf{ncccomma} package}, Alexander I.~Rozhenko,
2172 % CTAN, v1.0 2005/02/10.
2173 % \bibitem{DEC} \emph{The \textsf{decimalcomma} package}, Antoine Missier,
2174 % CTAN, v1.4 2023/12/30.
2175 % \bibitem{SYST} \emph{L'extension pour \TeX\ et \LaTeX\ \textsf{systeme}},
2176 % Christian Tellechea, CTAN, v0.32 2019/01/13.
2177 % \bibitem{SPAL} \emph{The \textsf{spalign} package}, Joseph Rabinoff, CTAN, 2016/10/05.
2178 % \bibitem{NMATX} \emph{The package \textsf{nicematrix}}, François Pantigny, CTAN,
2179 % v6.14 2023/02/18.
2180 % \bibitem{FR} \emph{L'extension \textsf{frenchmath}}, Antoine Missier, CTAN, v3.0 2024/05/04.
2181 % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe},
2182 % the \textsf{lshort} package by
2183 % Tobias Oetiker, Hubert Partl, Irene Hyna and Elisabeth Schlegl, CTAN, v6.4 2021/04/09.
2184 % \url{http://tug.ctan.org/info/lshort/english/lshort.pdf}.
2185 % \bibitem{COMP} \emph{The \LaTeX\ Companion}, Frank Mittelbach, Michel Goossens,
2186 % Johannes Braams, David Carlisle, Chris Rowley, 2nd edition, Pearson Education, 2004.
2187 % \end{raggedright}
2188 % \end{thebibliography}
2189
2190 % \Finale
2191 \endinput