From 1e45d661b659c3025746d3a41119300ab90d1dcd Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 28 Jul 2023 03:01:08 +0000 Subject: CTAN sync 202307280301 --- macros/latex/contrib/mismath/mismath.dtx | 846 +++++++++++++++++-------------- 1 file changed, 458 insertions(+), 388 deletions(-) (limited to 'macros/latex/contrib/mismath/mismath.dtx') diff --git a/macros/latex/contrib/mismath/mismath.dtx b/macros/latex/contrib/mismath/mismath.dtx index f8224c848f..108f3e1b75 100644 --- a/macros/latex/contrib/mismath/mismath.dtx +++ b/macros/latex/contrib/mismath/mismath.dtx @@ -20,7 +20,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{mismath} - [2023/03/05 v2.7 .dtx mismath file] + [2023/07/27 v2.8 .dtx mismath file] % %<*driver> \documentclass{ltxdoc} @@ -69,7 +69,7 @@ % % \fi % -% \CheckSum{618} +% \CheckSum{624} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -193,13 +193,17 @@ % - special (not generic) warning when loading babel with russian % (\C will not be defined in that case)} % +% \changes{v2.8}{2023/07/26}{ +% - Some small changes in the documentation +% - New macro `onlymathC' designed for using '\C' when Russian language is loaded} +% % \GetFileInfo{mismath.sty} % % \title{\textsf{mismath}\\ Miscellaneous mathematical macros\thanks{This document % corresponds to \textsf{mismath}~\fileversion, dated \filedate. % Thanks to François Bastouil for help in English translation.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{March 5, 2023} +% \date{July 27, 2023} % % \maketitle % \tableofcontents @@ -210,67 +214,68 @@ % superseded by ISO~80000-2:2009, mathematical constants $\e$, $\i$, $\pi$ % should be typeset in roman (upright shape) and not in italic (sloping shape) like % variables (see~\cite{TYPMA}~\cite{NIST}~\cite{SI}~\cite{ICTNS}). -% This package provides some tools to achieve this (automatically). +% This package provides some tools to achieve this automatically. % % \medskip -% Even if it is recommended to typeset vectors names +% Even though it is recommended to typeset vectors names % in bold italic style~\cite{NIST}~\cite{ICTNS}, % they are often represented with arrows -% (particularly in school documents or in physics). -% To draw pretty arrows above vectors, we use the \textsf{esvect} package -% by Eddie Saudrais~\cite{VECT} -% and we provide a few more macros related to vectors with arrows, -% in particular to improve the typesetting of the norm: $\norm{\vect{AB}}$ +% (especially in school documents or in physics). +% To draw visually appealing arrows above vectors, we use the \textsf{esvect} package +% by Eddie Saudrais~\cite{VECT}. +% Additionally we provide a few more macros related to vectors with arrows, +% particularly to enhance the typesetting of the norm: $\norm{\vect{AB}}$ % instead of \LaTeX\ version $\lVert\vect{AB}\rVert$ which is not vertically adjusted, -% or worse $\left\Vert \vect{AB} \right\Vert$ (and even ugly with Latin Modern font family). +% or worse $\left\Vert \vect{AB} \right\Vert$. % % \smallskip -% The package also provides other macros for: +% The package also offers other macros for: % \begin{itemize} % \item tensors, -% \item some standard operator names, +% \item some common operator names, % \item a few useful aliases, -% \item improving some spacing in mathematical formulas, +% \item enhancing spacing in mathematical formulas, % \item systems of equations and small matrices, -% \item displaymath in double columns for long calculation. +% \item displaymath in double columns for lengthy calculations. % \end{itemize} % -% To avoid incompatibility, -% most of our macros will be defined only -% if there is not another command with the same name in the packages loaded +% To avoid compatibility issues, +% most of our macros will only be defined +% if there isn't already a command with the same name in the packages loaded % before \textsf{mismath}. If a macro is already defined, -% a warning message will be produced and the \textsf{mismath} definition -% will simply be ignored. To keep the \textsf{mismath} command or the other one, use -% |\let\|\meta{command}|\relax|, before loading \textsf{mismath}, or after. -% If the other one is defined with |\AtBeginDocument|, do the same for +% a warning message will be displayed and the \textsf{mismath} definition +% will be ignored. If you wish to keep the existing command or the \textsf{mismath} command, +% you can use |\let\|\meta{command}|\relax|, before loading \textsf{mismath}, or after. +% If the other command is defined with |\AtBeginDocument|, you should do the same for % |\let\|\meta{command}|\relax| and for loading mismath. % % \medskip % \DescribeEnv{\oarg{options}} -% The \textsf{amsmath} package is loaded by \textsf{mismath} without option. -% For using \textsf{amsmath} with options (see~\cite{AMS}), -% these options can be added when calling \textsf{mismath}, or -% \textsf{amsmath} can be loaded -% with the required options before \textsf{mismath}. +% The \textsf{mismath} package loads the \textsf{amsmath} package without any options. +% If you want to use \textsf{amsmath} with specific options (refer to~\cite{AMS}), +% you can include these options when calling \textsf{mismath}, or +% you can load \textsf{amsmath} +% with the desired options before loading \textsf{mismath}. % % \medskip -% \textsf{mismath} loads also the package -% \textsf{mathtools} by Morten Høgholm and Lars Madsen~\cite{TOOL}. -% It provides many useful macros and improvements of \textsf{amsmath} package. +% In addition \textsf{mismath} loads the \textsf{mathtools} package +% by Morten Høgholm and Lars Madsen~\cite{TOOL}. +% This package offers numerous helpful macros and improvements of the \textsf{amsmath} package. % % \medskip -% A recommendation, seldom observed, is to typeset uppercase Greek letters in italic shape -% like other variables~\cite{ICTNS}. This is automatically done with the packages -% \textsf{fixmath} by Walter Schmidt~\cite{FIXM}, +% A recommendation, although rarely followed, is to typeset uppercase +% Greek letters in italic shape, +% similar to other variables~\cite{ICTNS}. This can be automatically achieved with packages +% such as \textsf{fixmath} by Walter Schmidt~\cite{FIXM}, % \textsf{isomath} by Günter Milde~\cite{ISOM} % or \textsf{pm-isomath} by Claudio Beccari~\cite{PMISO} and optionally with many others -% (for instance \textsf{mathpazo} or \textsf{mathptmx} with the option \texttt{slantedGreek}), -% but this feature is not implemented here because this rule is conflicting -% to the one used in France where all mathematics capitals -% have to be typeset in upright shape -% \footnote{The \textsf{frenchmath} package~\cite{FR} -% takes this rule into account.}. -% The choice of loading or not one of these packages remains thus to the user. +% (such as \textsf{mathpazo} or \textsf{mathptmx} with the option \texttt{slantedGreek}). +% However this feature is not implemented here due to a conflicting rule in France, +% where all capital letters in mathematics +% are required to be typeset in upright shape +% \footnote{By using the \textsf{frenchmath} package~\cite{FR}, +% you can ensure that the recommended french rule is followed in your document.}. +% The decision to load any of these packages is left to the user's discretion. % % \section{Usage} % @@ -278,154 +283,165 @@ % % \DescribeMacro{\mathup} % As for classic functions identifiers, \emph{predefined} mathematical constants -% should be typeset in upright shape (generally in roman family), -% even if this practice is not really common and tedious -% to respect. First we provide the |\mathup| macro, which is better than |\mathrm| -% \footnote{\texttt{\bslash mathup} -% is based on \texttt{\bslash operatorfont} -% (from \textsf{amsopn} package, automatically loaded by \textsf{amsmath}). -% The \textsf{beamer} -% package uses a default sans serif math font, but \texttt{\bslash mathrm} -% produces a font with serif in \textsf{beamer}. Therefore -% using \texttt{\bslash mathup} is better than \texttt{\bslash mathrm}.}, -% to set any math text in upright shape, so on can write +% should be typeset in upright shape (typically in roman family), +% even though this practice is not very common and can be tedious +% to adhere to. A first solution is to use the |\mathup| macro, +% which is superior to |\mathrm| +% \footnote{The \texttt{\bslash mathup} macro is based on \texttt{\bslash operatorfont}, +% which comes from the +% \textsf{amsopn} package, automatically loaded by \textsf{amsmath}. +% In \textsf{beamer}, the default math font is sans serif, +% but \texttt{\bslash mathrm} produces a font with serifs, which might not match the +% overall style of the presentation. Hence, using \texttt{\bslash mathup} is indeed +% a better choice in \textsf{beamer} presentations to ensure that mathematical +% constants are typeset in upright shape and consistent +% with the default sans serif math font.}, +% for setting any math text in upright shape. For example you can use % |\mathup{e}| to get the Euler's number. % % \medskip % \DescribeMacro{\e} \DescribeMacro{\i} \DescribeMacro{\j} -% To avoid to stuff a document that contains many $\e$ or $\i$ constants -% with |\mathup{e}| or |\mathup{i}|, -% the package provides |\e| command for Euler's number -% and |\i| or |\j| for imaginary numbers. -% Let's notice that |\i| and |\j| already exist in \LaTeX: -% using in LR mode, they produce `\extrafont{\i,\ \j}' without the point, -% so you can place accents on them, and in mathematical mode they produce -% ``\texttt{LaTeX Warning: Command \bslash i invalid in math mode on input line} \meta{line}''. -% The new definition of |\i| and |\j| concerns only the mathematical mode. +% To avoid cluttering a document that contains many occurrences of Euler's number (e) +% or imaginary numbers (i) with |\mathup{e}| or |\mathup{i}|, +% the package provides the |\e| command for Euler’s number +% and |\i| or |\j| for imaginary numbers. +% Let us notice that |\i| and |\j| already exist in LaTeX. In LR (left-to-right) mode, +% they produce `\extrafont{\i,\ \j}' without the dot, allowing you to place accents on them. +% However, in mathematical mode, they produce the warning +% ``\texttt{LaTeX Warning: Command \bslash i invalid in math mode on input line} +% \meta{line}''. +% With the new definition provided by the package, |\i| and |\j| will be redefined +% specifically for mathematical mode. % % \medskip % \DescribeMacro{\MathUp} -% Nevertheless, it can be tiresome to type a lot of backslashes -% for these constants, in a document -% with many formulas containing $\e$, $\i$ or $\j$. -% So a way is proposed here to free of it with the macro -% |\MathUp|\marg{char}. -% For instance when |\MathUp{e}| is called, -% any future occurrence of $\e$ will then automatically be set in roman, -% without the need to type |\e|. -% The effect is global or local if used inside an environment or braces. -% This macro can also be called in the preamble for applying -% from the beginning of the document. -% Thanks to this powerful macro, you can bring a document up to the standards afterwards. -% In fact |\MathUp| can apply to any valid but single character (we will see another -% use of it with probability in section \ref{operators}). +% Indeed, typing a lot of backslashes for constants like $\e$, $\i$, or $\j$ +% in a document with numerous formulas can become tiresome. +% To alleviate this, the package proposes a powerful solution with the macro |\MathUp|\marg{char}. +% For example, when |\MathUp{e}| is called, any subsequent occurrence of $\e$ +% will automatically be set in roman (upright shape), +% without the need to type |\e| explicitly. The effect of this macro +% can be either global or local, depending on whether it is used outside or inside an +% environment or braces. +% Furthermore, you can call this macro in the preamble to apply the change +% from the beginning of the document. This powerful feature allows you +% to bring a document up to the standards effortlessly. +% In fact, |\MathUp| can be applied to any valid single character, +% offering flexibility for various use cases (another use of it with probability +% will be presented in section \ref{operators}). % % \medskip % \DescribeMacro{\MathIt} -% When there are other $\mathit{e}$, $\mathit{i}$ or $j$ as variables, -% you can still get italicized -% $\mathit{e}$, $\mathit{i}$ or $\mathit{j}$ with \LaTeX\ commands -% |\mathit| or |\mathnormal|, useful for a single use. -% But you can also use the inverse switch |\MathIt|\marg{char}, -% with a global effect, or a local one if used inside an environment or braces. -% As |\MathUp|, it can be used for any single character. +% When there are other occurrences of $\mathit{e}$, $\mathit{i}$ or $j$ as variables, +% you can still obtain italicized $\mathit{e}$, $\mathit{i}$ or $\mathit{j}$ using \LaTeX\ +% commands |\mathit| or |\mathnormal|, which are useful for a single use. +% However, you also have the option to use the inverse switch |\MathIt|\marg{char}, +% which has a global effect when used outside environments or braces, +% or a local effect when used inside them. +% Similar to |\MathUp|, |\MathIt| can be applied to any single character. % % \medskip % \DescribeMacro{\MathNumbers} \DescribeMacro{\MathNormal} -% These macros allow to set upright or normal typesetting for several letters -% in a single command, \eg -% |\MathNumbers{e,i}| is equivalent to |\MathUp{e}\MathUp{i}|. -% In |\MathNumbers| the comma separator can be changed or deleted. -% This macro has no effect on other letters than e, i or j. -% On the other hand |\MathNormal| can be used for probability also -% (see section \ref{operators}) -% and can take any comma separated list argument. +% These macros enable you to set upright or normal (italic) typesetting +% for multiple letters in a single command. +% For instance, |\MathNumbers{e,i}| is equivalent to |\MathUp{e}\MathUp{i}|. +% In |\MathNumbers|, the comma separator between letters can be modified +% or removed as needed. In fact, this macro only affects the letters e, i, or j; +% it has no effect on other characters. +% On the other hand, |\MathNormal| can be utilized for probability as well +% (refer to section \ref{operators}), and it accepts any comma-separated list of arguments. +% This means you can apply the normal italic math mode typesetting to various letters +% at once using |\MathNormal|. % % \medskip % \DescribeMacro{\pinumber[\meta{command}]} % The mathematical constant $\pi$ should also be typeset in upright shape -% (see~\cite{TYPMA}, \cite{NIST}, \cite{ICTNS}), which differs from italicized $\itpi$. -% This recommendation is even less observed than the one concerning -% $\e$ and $\i$~\cite{TYPMA}. -% Several packages allow to typeset mathematical Greek letters in upright shape, -% let us mention \textsf{upgreek}~\cite{GREEK}, \textsf{mathdesign}~\cite{DESIGN} -% (used here), \textsf{kpfonts}~\cite{KPF}, \textsf{fourier}~\cite{FOUR}, +% (see~\cite{TYPMA}, \cite{NIST}, \cite{ICTNS}), which is different from italicized $\itpi$. +% However, this recommendation is even less commonly followed compared to the one +% concerning $\e$ and $\i$~\cite{TYPMA}. +% Several packages enable the typesetting of mathematical Greek letters in upright shape. +% Notably, let us mention \textsf{upgreek}~\cite{GREEK}, \textsf{mathdesign}~\cite{DESIGN} +% (used in the present document), \mbox{\textsf{kpfonts}}~\cite{KPF}, \textsf{fourier}~\cite{FOUR}, % \textsf{libertinust1math}, % \textsf{pxgreeks}, \textsf{txgreeks}, \textsf{libgreek}, etc. -% A special mention for \textsf{lgrmath} of Jean-François Burnol~\cite{LGR} -% which allow to use, in math mode, any Greek LGR-encoded font. +% A special mention goes to \textsf{lgrmath} of Jean-François Burnol~\cite{LGR} +% which allows the use of any Greek LGR-encoded font in math mode. % These packages provide commands like |\uppi| (\textsf{upgreek}), % |\piup| (\textsf{mathdesign}, \textsf{kpfonts}, \textsf{lgrmath}), % |\otherpi| (\textsf{fourier}), etc. % \footnote{They also have options to typeset all the Greek lowercase % letters in upright shape by default, but this in not our goal here.} -% To preserve default sloped lowercase Greek letters except for pi, and to -% avoid typing a lot of |\uppi| or |\piup|, we provide the +% To preserve default italic style for lowercase Greek letters, +% with the exception of pi, and to +% avoid the need to type a lot of |\uppi| or |\piup|, we offer the % macro |\pinumber|[\meta{command}]. -% It redefines |\pi| to match -% the optional command name given (without backslash), for instance |piup|, -% assuming the appropriate package has been loaded before. +% This macro redefines |\pi| to match +% the optional command name provided (without a backslash), such as |piup|, +% assuming that the appropriate package has been loaded beforehand. % -% By calling preliminary |\MathNumbers{ei}\pinumber[piup]| -% (and with the \textsf{mathdesign} package loaded) -% you can get for instance: +% By using the preliminary code |\MathNumbers{ei}\pinumber[piup]| +% (assuming the \textsf{mathdesign} package is loaded) +% you can achieve the following result: % \begin{center} -% |$e^{i\pi} = -1$| \quad yields \quad $\e^{i\pi}=-1$. +% |$e^{i\pi} = -1$| \quad which yields \quad $\e^{i\pi}=-1$. % \end{center} % -% When calling |\pinumber| without argument -% it defines |\pi| with the default LGR font encoding of Greek letters -% to produce $\mypi$. In that case the appropriate option \texttt{LGR} -% for the \textsf{fontenc} package will be automatically loaded, -% provided that the command is called in the preamble (first). -% The pi character will look the same as the one supplied with +% When you call |\pinumber| without any argument, +% it defines |\pi| using the default LGR font encoding for Greek letters, +% resulting in the character $\mypi$. In this case the appropriate option \texttt{LGR} +% for the \textsf{fontenc} package will be automatically loaded +% if the |\pinumber| command is called in the preamble (at least the first time it is used). +% The pi character obtained with this setting will look the same as the one provided by % Günter Milde's \textsf{textalpha} package~\cite{ALPHA}. -% This $\mypi$ is particularly suitable +% This $\mypi$ character is particularly well-suited % for use with the default Computer Modern or Latin Modern font family -% \footnote{This default $\mypi$ doesn't fit well with many text fonts, -% more bold than Computer Modern; -% the \textsf{upgreek} package~\cite{GREEK} provides often a better $\uppi$ -% (with the \texttt{Symbol} option using Adobe Symbol font) -% that fits well with several text fonts, for instance Times.}. +% \footnote{This default $\mypi$ character may not always fit well with various text fonts, +% especially those that are bolder or different from the default Computer Modern font. +% The \textsf{upgreek} package~\cite{GREEK} provides a better $\uppi$ character +% with the Symbol option, utilizing the Adobe Symbol font. This $\uppi$ character +% matches well with several text fonts, such as Times.}. % % \medskip % \DescribeMacro{\itpi} -% When activating |\pinumber|, the original italic $\itpi$ -% is still available with |\itpi|. +% When you activate |\pinumber|, the original italic $\itpi$ +% is still accessible using |\itpi|. % % \DescribeMacro{\pinormal} -% In fact |\pinumber| acts as a switch and there is also an inverse switch, -% |\pinormal|, that can be called anywhere. +% In fact |\pinumber| acts as a switch, enabling the upright $\pi$. +% Additionally, there is an inverse switch, +% |\pinormal|, which you can call anywhere to revert to the original behavior +% of the |\pi| command (italic $\itpi$). % % \subsection{Vectors (and tensors)} % % \DescribeMacro{\vect} % By default, the |\vect| command -% \footnote{As for many macros of this package, -% the definition will take effect only if this macro is not defined before -% by another package.}, +% \footnote{The definition of most macros in this package, +% will only take effect if the macro has not been previously +% defined by another package. This ensures compatibility and avoids conflicts +% when using the \textsf{mismath} package with other \LaTeX\ packages.}, % produces vectors with arrows -% (thanks to the \textsf{esvect} package of Eddie Saudrais +% (thanks to the \textsf{esvect} package by Eddie Saudrais % \footnote{\textsf{esvect} provides the \texttt{\bslash vv} macro % used by \texttt{\bslash vect}.}) % which are more elegant than those produced by \LaTeX's |\overrightarrow| command. % The \textsf{esvect} package has an optional argument -% (one letter between \texttt{a} and \texttt{h}) defining -% the required type of arrow (see~\cite{VECT}). +% (a single letter between \texttt{a} and \texttt{h}) to define +% the desired type of arrow (see~\cite{VECT}). % In \textsf{mismath}, \textsf{esvect} is loaded with the option \texttt{b}: % |\vect{AB}| gives $\vect{AB}$. -% To choose another type of arrow, \textsf{esvect} must be called -% with the required option \emph{before} \textsf{mismath}, -% \eg |\usepackage[d]{esvect}| -% will give the arrows produced by default in~\cite{VECT}. +% If you wish to use a different type of arrow, you must call \textsf{esvect} +% with the appropriate option \emph{before} loading \textsf{mismath}. +% For example, using |\usepackage[d]{esvect}| +% will provide the arrows produced by default in~\cite{VECT}. % % \medskip % \DescribeMacro{\boldvect} -% The |\vect| macro allow to typeset vector's names using bold italic -% (according to ISO recommendation~\cite{NIST}~\cite{SI}) rather than arrows. -% For this, calling |\boldvect| will modify the behavior of |\vect|, -% globally or locally, depending on where |\boldvect| -% is placed:\\[1ex] +% The |\vect| macro allows vector names to be typeset using bold italic font, +% as recommended by ISO~\cite{NIST}~\cite{SI}, instead of using arrows. +% By using the |\boldvect| command, you can modify the behavior of |\vect| +% locally or globally, depending on its placement in the document (inside or outside +% a group or an environment):\\[1ex] % \begin{minipage}{8cm} % \begin{verbatim} %\[ \boldvect \vect{v} @@ -438,44 +454,49 @@ % % \DescribeMacro{\boldvectcommand} % By default |\boldvect| uses the |\boldsymbol| command -% \footnote{\texttt{\bslash mathbf} gives upright bold font, -% even if used in combination with \texttt{\bslash mathit}.} -% from \textsf{amsbsy} package, loaded by \textsf{amsmath}. -% But other packages producing bold italic can be preferred, \eg -% |\mathbold| from \textsf{fixmath} -% package or |\mathbfit| from \textsf{isomath} -% or \texttt{\bslash bm} from \textsf{bm} package. -% For that, redefine |\boldvectcommand|, for instance, after loading \textsf{fixmath}: +% \footnote{\texttt{\bslash mathbf} produces upright bold font, +% even when used in combination with \texttt{\bslash mathit}.} +% from the \textsf{amsbsy} package, which is automatically loaded by \textsf{amsmath}. +% However, you may prefer other packages that produce bold italic fonts, +% such as \textsf{fixmath} with the |\mathbold| command, +% \textsf{isomath} with |\mathbfit| +% or \textsf{bm} with the \texttt{\bslash bm} command. +% To use an alternative command, redefine |\boldvectcommand|, +% for instance after loading \textsf{fixmath}: % \begin{center} |\renewcommand\boldvectcommand{\mathbold}|. \end{center} % -% According to ISO rules, symbols for matrices are also in bold italic, -% so you can use the same |\boldvectcommand| or create another alias. +% According to ISO rules, symbols for matrices are also in bold italic. +% Therefore you can use the same |\boldvectcommand| or create another alias. % % \medskip % \DescribeMacro{\arrowvect} -% At any moment, you can get back to the default behavior with the inverse switch +% At any moment, you can revert to the default behavior using the inverse switch % |\arrowvect|. -% These switches can be placed anywhere: -% inside mathematical mode or inside an environment (with local effect) or outside -% (with global effect). +% These switches can be placed anywhere, whether +% inside mathematical mode or within an environment (with a local effect) or outside +% (with a global effect). % % \medskip % \DescribeMacro{\hvect} % When vectors with arrows are typeset side by side, -% arrows can be set up a bit higher (with a vertical phantom box containing $t$) -% to avoid inelegant effects: +% the arrows can be set up slightly higher using |\hvect| +% (which places a vertical phantom box containing ``$t$'') +% to avoid inelegant effects. For example, writing % \begin{itemize} % \item $\vect{AB}=\hvect{u}+ \vect{AC}$, obtained with |\hvect{u}|, % is better than $\vect{AB}=\vect{u}+ \vect{AC}$; % \item $\hvect{a} \cdot \vect{b}=0$, obtained with |\hvect{a}|, % is better thant $\vect{a} \cdot \vect{b}=0$. % \end{itemize} -% The |\boldvect| and |\arrowvect| switches have the same effect on |\hvect| than on |\vect|, -% and so have \texttt{boldvect} and \texttt{arrowvect} options. +% This adjustment ensures a more visually pleasing appearance when vectors +% with arrows are combined in an equation. +% The |\boldvect| and |\arrowvect| switches have the same effect on |\hvect| +% as they do on |\vect|. % % \DescribeMacro{\hvec} % In a similar way, |\hvec| raises the little arrow produced by -% the \LaTeX\ command |\vec| (from height of $t$ letter): +% the \LaTeX\ command |\vec|, to the height of the letter ``$t$'' +% (but |\boldvect| have no effect here): % \begin{itemize} % \item $\mathcal{P}=\vec{f}\cdot\hvec{v}$, obtained with |\hvec{v}|, % is better than $\mathcal{P}=\vec{f}\cdot\vec{v}$. @@ -484,36 +505,39 @@ % \end{itemize} % % \DescribeMacro{\norm} -% The norm of a vector is classically produced by the delimiters |\lVert| and |\rVert| -% (rather than \texttt{\bslash}$\mid$) or |\left\Vert| and |\right\Vert| -% for delimiters adapting to the content. Unfortunately, these delimiters +% The norm of a vector is conventionally represented using the delimiters |\lVert| and |\rVert| +% (or \texttt{\bslash}$\mid$ unless a plus (+) or minus (-) sign follows the opening delimiter) +% or |\left\Vert| and |\right\Vert| +% for adaptive delimiters. Unfortunately, these delimiters % are always vertically centered, relatively to the middle of the base line, % whereas vectors with arrows are asymmetric objects. % The code |$\norm{\vec{h}}$| raises a smaller double bar to produce $\norm{\vec{h}}$ % instead of $\left\Vert \vec{h} \right\Vert$. % Let's notice that the height of the bars don't adjust to content, % but however to context: main text, subscripts or exponents, -% \eg $\e^{\norm{\vec{h}}}$. +% \eg $\e^{\norm{\vec{h}}}$. +% This macro is useful only for arguments of special height, such as $\vec{h}$ or $\vect{AB}$ +% and may give bad results in other situations. % % \medskip % \DescribeMacro{\mathbfsfit}\DescribeMacro{\tensor} -% For tensors symbols, ISO rules recommend to use +% For tensors symbols, ISO rules recommend using % sans serif bold italic, but there -% is no such math alphabet in \TeX\ default mathematical style. -% \textsf{mismath} defines this alphabet -% (assuming the font encoding and package you use permits it), +% is no such math alphabet in the default \TeX\ mathematical style. +% However, the \textsf{mismath} package defines this alphabet +% (assuming the font encoding and package you use permits it) % and provides the macro |\mathbfsfit| or its alias |\tensor|. -% So |\tensor{T}| produces $\tensor{T}$. +% By using |\tensor{T}| you can produce $\tensor{T}$. % % \subsection{Standard operator names}\label{operators} % % \DescribeMacro{\di} -% The \emph{differential} operator should be typeset in upright shape and not in -% italic, to make it different from variables +% The \emph{differential} operator should be typeset in upright shape, not in +% italics, to distinguish it from variables % (as mentioned in \cite{TYPMA}~\cite{NIST}~\cite{ICTNS}~\cite{LSHORT}). -% For this, we provide the |\di| command. -% See the following examples (notice the thin spaces before the d, -% as for classic function's names): \\ +% To achieve this, we provide the |\di| command. +% Take a look at the following examples (notice the thin spaces before the d, +% just like with classic function's names): \\ % \begin{minipage}[t]{7cm} % \begin{verbatim} %\[ \iint xy\di x\di y \] @@ -533,15 +557,15 @@ % \[m\frac{\di^2x}{\di t^2}+h\frac{\di x}{\di t}+kx=0\] % \end{minipage} % -% This command can also stand for \emph{distance} (hence its name): -% \[\lambda\di(A,\mathcal{F})+\mu\di(B,\mathcal{H}).\] +% This command can also represent \emph{distance} (hence its name): +% \[\lambda\di(A, \mathcal{F})+\mu\di(B, \mathcal{H}).\] % % \DescribeMacro{\P} \DescribeMacro{\E} % To refer to probability % \footnote{\LaTeX\ provides also \texttt{\bslash Pr} which gives $\Pr$.} -% and expectation the proper use is to typeset capital letters $\P$, $\E$ -% in roman as for any standard function identifier. -% This is obtained with |\P| and |\E|. +% and expectation the proper use is to typeset the capital letters $\P$, $\E$ +% in roman just like any standard function identifier. +% This can be achieved with |\P| and |\E| commands. % % \DescribeMacro{\Par} % The |\P| command already existed to refer to the end of paragraph symbol \Par\ @@ -550,29 +574,29 @@ % \medskip % \DescribeMacro{\V} % Variance is generally denoted by $\var$ or $\Var$ (see table below), -% but some authors prefer to use $\V$, produced by |\V|. +% but some authors prefer to use $\V$, which can be produced using |\V|. % % \DescribeMacro{\MathProba}\DescribeMacro{\MathNormal} % In the same way as for $\e$, $\i$ or $\j$, you can use |\MathUp{P}|, |\MathUp{E}| % or |\MathUp{V}| to avoid typing many |\P|, |\E| or |\V|. -% But you can also do that in a single command with |\MathProba|, -% for example |\MathProba{P,E}| and we get the inverse switch with +% However you can also achieve this in a single command with |\MathProba|, +% for example |\MathProba{P,E}|. We get the inverse switch with % |\MathIt| for any individual letter or |\MathNormal| for a list. % % \medskip % \DescribeMacro{\probastyle} -% Some authors use ``blackboard bold'' font -% to represent probability, expectation and variance: $\mathbb{P}, \mathbb{E}, \mathbb{V}$. -% The |\probastyle| macro sets the appearance of |\P|, |\E| and |\V|: -% for instance |\renewcommand\probastyle{\mathbb}| -% \footnote{As for \texttt{\bslash boldvect} and \texttt{\bslash arrowvect}, -% effect is local to the container environment.} +% Some authors use ``blackboard bold'' font to represent probability, expectation +% and variance: $\mathbb{P}, \mathbb{E}, \mathbb{V}$. +% The |\probastyle| macro sets the appearance of |\P|, |\E| and |\V|. +% For instance |\renewcommand\probastyle{\mathbb}| +% \footnote{The effect of this redefinition is global or local to the container environment +% in which it is used.} % brings the previous ``openwork'' letters. -% |\mathbb| comes from \textsf{amsfonts} package -% (loaded by \textsf{amssymb} -% but also available standalone) -% which has to be called in the preamble. +% The |\mathbb| command comes from \textsf{amsfonts} package +% (loaded by \textsf{amssymb} but also available standalone) +% which needs to be called in the preamble. % +% \medskip % The following standard operator names are defined in \textsf{mismath}: % \begin{center} % \begin{tabular}{rlrlrl} @@ -594,27 +618,29 @@ % $\boldvect \grad, \curl, \rot$. % For the variance, the covariance and the identity function, % two notations are proposed, with or without a first capital letter, -% because they are both very common. +% because both are very common. % On the other hand, `$\im$' stands for the image of a linear transformation % (like `$\ker$' for the kernel) % whereas `$\Im$' is the imaginary part of a complex number. -% Notice that |\div| already exist ($\div$) and |\span| is a \TeX\ primitive +% Please note that |\div| already exists ($\div$) and |\span| is a \TeX\ primitive % (used in |\multicolumn|); -% they haven't been redefined, therefore the macros |\divg| (divergence) -% and |\spa| (span of a set of vectors) ; -% |\Z| is used for the set of integers (see \ref{aliases}), therefore we used |\Zu|, +% they haven't been redefined. Therefore the provided macros are called |\divg| (divergence) +% and |\spa| (span of a set of vectors). +% Furthermore |\Z| is used to denote the set of integers (see \ref{aliases}), +% which is why we used |\Zu|, % to designate the center of a group: $\Zu(G)$ (from German Zentrum). % %\medskip % \DescribeMacro{\oldRe} \DescribeMacro{\oldIm} -% The |\Re| and |\Im| macros already existed, to refer to real and imaginary part +% The |\Re| and |\Im| macros already existed to refer to real and imaginary part % of a complex number, producing outdated symbols $\oldRe$ and $\oldIm$. -% They have been redefined according to actual use, as mentioned in the above table, -% but it's still possible to get the old symbols with |\oldRe| and |\oldIm|. +% However, they have been redefined according to current usage, +% as mentioned in the above table. Nevertheless, +% it is still possible to obtain the old symbols with |\oldRe| and |\oldIm|. % % \medskip -% Some (inverse) circular or hyperbolic functions, missing -% in \LaTeX, are also provided by \textsf{mismath}: +% The package \textsf{mismath} also provides some (inverse) circular or hyperbolic functions, +% that are missing in \LaTeX: % \begin{center} % \begin{tabular}{rlrlrl} % |\arccot| & $\arccot$\qquad\mbox{} & |\arsinh| & $\arsinh$\qquad\mbox{} @@ -635,62 +661,70 @@ % that classic sets of numbers are typeset in bold roman: % $\R, \C, \Z, \N, \Q$, % whereas ``openwork'' letters ($\mathbb{R}, \mathbb{Z}, \ldots$) -% are reserved for writing at blackboard~\cite{LSHORT}; -% and likewise to designate a field: $\F$ or $\K$ (Körper in German). -% We get these symbols with the macros -% \footnote{The \texttt{\bslash C} macro is incompatible with \texttt{russian} option -% of \textsf{babel}; it will not be redefined in that case.}: +% are reserved for writing at the blackboard~\cite{LSHORT}. +% Similarly, to designate a field we use $\F$ or $\K$ (Körper in German). +% We get obtain these symbols with the following macros: % \begin{center} % |\R|, |\C|, |\Z|, |\N|, |\Q|, |\F|, |\K|. % \end{center} % % \DescribeMacro{\mathset} -% The |\mathset| command enables to change the behavior of all these macros in a global way: -% by default, |\mathset| is an alias for |\mathbf|, but if you prefer openwork letters, -% just place |\renewcommand\mathset{\mathbb}| where you want, for instance in the preamble, -% after loading \textsf{amsfonts} package (which provides the ``blackboard bold'' typeface, +% The |\mathset| command enables you to change the behavior +% of all these macros in a global way. +% By default, |\mathset| is an alias for |\mathbf|, but if you prefer openwork letters, +% you can simply place |\renewcommand\mathset{\mathbb}| where you want, +% for instance in the preamble after loading the \textsf{amsfonts} package +% (which provides the ``blackboard bold'' typeface, % also loaded by \textsf{amssymb}). % +% \smallskip +% \DescribeMacro{\onlymathC} +% The macro |\onlymathC| is designed for cases when |\C| is already defined, +% but only in text mode (usually when loading the Russian language with \textsf{babel} +% or \textsf{polyglossia}). The macro preserves the original definition for text mode +% and allows you to use |\C| for the complex number set in math mode. +% For this purpose, simply call |\onlymathC| once in the preamble or anywhere in the document. +% % \medskip % \DescribeMacro{\ds} -% The |\displaystyle| command being very common, the |\ds| alias is provided. -% Not only it eases typing but also it makes source code more readable. +% The |\displaystyle| command is very common, so the |\ds| alias is provided. +% Not only it eases typing but also it makes source code more readable. % % \medskip % Symbols with limits behave differently for in-line formulas or for displayed equations. -% In the latter case, ``limits'' are put under or above whereas for in-line math mode, -% they are placed on the right, as subscript or exponent. Compare: +% In the latter case, ``limits'' are placed under or above the symbol +% whereas for in-line math mode, +% they are placed on the right, as a subscript or exponent. Compare: % $\zeta(s)=\sum_{n=1}^{\infty }\frac{1}{n^s}$ with % \[\zeta(s)=\sum_{n=1}^{\infty}\frac{1}{n^s}.\] % % \DescribeMacro{\dlim} \DescribeMacro{\dsum} \DescribeMacro{\dprod} % \DescribeMacro{\dcup} \DescribeMacro{\dcap} % With in-line math mode, displaymath behavior can be forced with |\displaystyle| -% or its alias |\ds|, but then, all the rest of the current mathematical -% environment will be set in displaymath mode too (in the previous example, -% the fraction will be expanded). -% Just as the \textsf{amsmath} command |\dfrac| -% only transforms the required fraction in display style, we can limit -% the display style effect to the affected symbol, by using the following macros: +% or its alias |\ds|. However, when using these commands, all the rest of the current +% mathematical environment will be set in displaymath mode +% (as shown in the previous example, where the fraction will be expanded). +% To limit the display style effect to the affected symbol only, +% similar the the \textsf{amsmath} command |\dfrac|, +% we can use the following macros: % |\dlim|, |\dsum|, |\dprod|, |\dcup|, |\dcap|. % So % \begin{center} -% |$\dlim_{x\to +\infty}\frac{1}{x}$| \quad gives \quad $\dlim_{x \to +\infty}\frac{1}{x}$. +% |$\dlim_{x\to +\infty}\frac{1}{x}$| \quad yields \quad $\dlim_{x \to +\infty}\frac{1}{x}$. % \end{center} % % \DescribeMacro{\lbar} \DescribeMacro{\hlbar} % Large bars over expressions are obtained with |\overline| -% or, shorter, its alias |\lbar|, to get for instance $\lbar{z_1z_2}$. -% Such as for vectors, you can raise the bar (from the height of $h$) with -% the |\hlbar| command, in order to correct uneven bars heights. +% or its alias |\lbar|, to get for instance $\lbar{z_1z_2}$. +% Similar to vectors, you can raise the bar (from the height of ``$h$'') with +% the |\hlbar| command, to correct uneven bars heights. % \begin{center} % $\lbar{z+z'}=\hlbar{z}+\lbar{z'}$, obtained with |\hlbar{z}|, % is better than $\lbar{z+z'}=\lbar{z}+\lbar{z'}$. % \end{center} % -% \pagebreak % \DescribeMacro{\eqdef} \DescribeMacro{\eqdef*} -% The |\eqdef| macro writes equality symbol topped with `def' +% The |\eqdef| macro writes the equality symbol topped with `def' % or with `$\scriptstyle \Delta$' for |\eqdef*| % (thanks to the \LaTeX\ command |\stackrel|): % @@ -718,9 +752,9 @@ % \DescribeMacro{\unbr} % |\unbr| is an alias for |\underbrace| % \footnote{The \textsf{mathtools} package by Morten Høgholm -% and Lars Madsen~\cite{TOOL} provides a new improved version -% of \texttt{\bslash underbrace} command (as many other usefull macros); -% it is loaded by \textsf{mismath}.}, +% and Lars Madsen~\cite{TOOL} provides a new and improved version +% of the \texttt{\bslash underbrace} command, along with many other usefull macros. +% It is loaded by \textsf{mismath}.}, % making source code more compact.\\[2ex] % \begin{minipage}{7.5cm} % \begin{verbatim} @@ -739,22 +773,22 @@ % % \DescribeMacro{\then} % The |\then| macro produces the symbol $\Longrightarrow$ surrounded by large spaces -% as the standard macro |\iff| does it with $\Longleftrightarrow$. -% In a similar way, |\txt|, \DescribeMacro{\txt} +% just like the standard macro |\iff| does it with $\Longleftrightarrow$. +% Similarly, the |\txt|, \DescribeMacro{\txt} % based on the |\text| macro from the \textsf{amstext} package % (loaded by \textsf{amsmath}), % leaves em quad spaces (|\quad|) around the text. See the following example: % \begin{center} -% |\[ \ln x=a \then x=\e^a \txt{rather than}| \\ +% |\[ \ln x=a \then x=\e^a, \txt{rather than}| \\ % | \ln x=a \Longrightarrow x=\e^a \]| \\[1ex] -% $ \ln x=a \then x=\e^a \txt{rather than} \ln x=a \Longrightarrow x=\e^a$ +% $ \ln x=a \then x=\e^a, \txt{rather than} \ln x=a \Longrightarrow x=\e^a$ % \end{center} % % \DescribeMacro{\mul} -% The multiplication symbol obtained with |\times| produces the same spacing than addition +% The multiplication symbol obtained with |\times| produces the same spacing as addition % or subtraction operators, whereas division obtained with $/$ is closer to its operands. -% This actually hides the priority of the multiplication on $+$ and $-$. -% This is why we provide the |\mul| macro, behaving like $/$ +% This actually hides the priority of multiplication over $+$ and $-$. +% That's why we provide the |\mul| macro, behaving like $/$ % (ordinary symbol) and leaving less space around than |\times|: % \begin{center} % $\lambda+\alpha \mul b-\beta \mul c$, obtained with |\mul|, @@ -763,9 +797,9 @@ % % When using |\mul| before a function name or around a |\left...\right| structure, % the space may be too large on one side of |\mul|. -% To get the same amount of space on the two sides of |\mul|, +% To ensure the same amount of space on both sides of |\mul|, % you can use thin negative spaces |\!| -% or enclose the function or the structure with braces: +% or enclose the function or structure with braces: % \begin{center} % $x\mul{\sin x}$, obtained with |x\mul{\sin x}|, is slightly better than $x\mul\sin x$.\\[1ex] % |$\sin\!{\left( \frac{\pi}{3} \right)} \mul 2$| \quad gives\\ @@ -780,30 +814,31 @@ % \DescribeMacro{\pow} % In the same way, when typesetting an exponent after a closing \emph{big} % parenthesis produced by |\right)|, -% the exponent is little to far from the parenthesis. -% The command |\pow|\marg{expr}\marg{pow} sets -% \meta{expr} between parentheses and puts the exponent \meta{pow} +% the exponent appears to be a little to far from the parenthesis. +% To address this issue, the |\pow|\marg{expr}\marg{pow} command is provided, which sets +% \meta{expr} between parentheses and adjusts the positioning of the exponent \meta{pow} % slightly closer to the right parenthesis -% \footnote{This macro gives bad results with normal sized parenthesis.}. +% \footnote{This macro gives bad results with normal-sized parenthesis.}. % Compare: -% \[ \e^a \sim\pow{1+\frac{a}{n}}{n} \txt{may be better than} +% \[ \e^a \sim\pow{1+\frac{a}{n}}{n} \txt{which may be better than} % \e^a \sim\left(1+\frac{a}{n}\right)^{n}.\] % % \DescribeMacro{\abs} -% Absolute value (or modular for a complex number) should be typeset with -% |\lvert| \ldots |\rvert| rather than $\mid$ which doesn't respect correct -% spaces for delimiters; for bars whose height has to adapt to content, -% we use |\left\vert| \ldots |\right\vert| or, more simply, -% the |\abs|\{\ldots\} command which is equivalent +% The correct typesetting of absolute value (or modular for a complex number) is achieved +% using |\lvert| \ldots |\rvert|, rather than $\mid$, as the latter doesn't maintain +% proper spacing in some situations (when a sign follows the open delimiter). +% For bars whose height has to adapt to the content, +% we can use |\left\vert| \ldots |\right\vert| or, more simply, +% the |\abs|\{\ldots\} command, which is equivalent % \footnote{Another solution is to define \texttt{\bslash abs} -% with the \texttt{\bslash DeclarePairedDelimiter} command +% using the \texttt{\bslash DeclarePairedDelimiter} command % from the \textsf{mathtools} package~\cite{TOOL}.}. % % \medskip % \DescribeMacro{\lfrac} -% This macro behaves like |\frac| -% but with thick spaces around the arguments, -% so the corresponding fraction bar is perceptibly a little bit longer:\\ +% The |\lfrac| macro behaves like |\frac| +% but with thicker spaces around the arguments, +% making the corresponding fraction bar slightly longer:\\ % \begin{minipage}[t]{8cm} % \begin{verbatim} %\[ \lbar{Z} = @@ -816,18 +851,18 @@ % % \medskip % \DescribeMacro{[ibrackets]} -% Open intervals are usually represented with parenthesis, \eg $(0, +\infty)$, -% but sometimes we find also -% square brackets, for example in French mathematics. -% In that case the space around them is often unsuitable, -% \eg $x \in \mathclose{]} 0, +\infty[$. -% We have redefined brackets in the \textsf{ibrackets} package~\cite{BRACKET} +% Open intervals are commonly represented with parenthesis, \eg $(0, +\infty)$, +% but sometimes square brackets are used, especially in French mathematics: $]0, +\infty[$. +% In that specific case, the space around the square brackets is often inappropriate, +% as in the expression $x \in \mathclose{]} 0, +\infty[$. +% To address this issue, we have redefined the brackets in the \textsf{ibrackets} +% package~\cite{BRACKET} % which can be optionally % \footnote{This functionality is optional because it causes -% error when using a command defined by +% errors when using a command defined by % \texttt{\bslash DeclarePairedDelimiter}~\cite{TOOL} with square brackets.} -% loaded by \textsf{mismath} with \texttt{ibrackets} package option -% \footnote{It's the only option of the \textsf{mismath} package.}. +% loaded by \textsf{mismath} using the \texttt{ibrackets} package option +% \footnote{It is the only option specific to the \textsf{mismath} package.}. % % Simply type |$x\in ]-\pi,0[ \cup ]2\pi,3\pi[$| to get % \begin{align*} @@ -836,34 +871,38 @@ % x\in \mathclose{]}-\pi, 0 \mathopen{[} \cup \mathclose{]} 2\pi, 3\pi \mathopen{[} % &\mbox{\quad without \textsf{ibrackets}}. % \end{align*} -% In our code, $[$ and $]$ symbols become ``active'' +% In our code, the symbols $[$ and $]$ % and are not defined by default as delimiters. -% Thereby a line break could occur between the two brackets, but +% Therefore, a line break could occur between the two brackets. However, % it is always possible to transform them -% into delimiters with |\left| and |\right|. +% into delimiters using |\left| and |\right|. % -% With \textsf{ibrackets}: a bracket becomes an ordinary character -% but an open delimiter when it is immediately followed by a + or - character. -% Thus, when the left bound contains an operator sign, +% With the \textsf{ibrackets} package, brackets are set as ``active'' characters, +% behaving like ordinary characters in most cases. +% However, when a bracket is \emph{immediately} followed by a + or - character, +% it becomes an open delimiter. +% Therefore, when the left bound contains an operator sign, % \emph{you don't have to leave a space between the first bracket and the sign}, -% otherwise, the spaces surrounding the operator will be too large: -% \eg |$x \in ] -\infty, 0]$| yields $x \in ] -\infty, 0]$. -% Contrariwise, when you want to write algebra on intervals then +% otherwise, the spaces surrounding the operator will be too large. +% For example if you write |$x \in ] -\infty, 0]$|, it yields $x \in ] -\infty, 0]$ +% instead of $x \in ]-\infty, 0]$. +% Conversely, when dealing with algebraic expressions involving intervals, % \emph{you must leave a blank space between the second bracket and the} +/- -% \emph{operations}, -% \eg |$[a, b] + [c, d]$| yields $[a, b] + [c, d]$ +% \emph{operations}. +% For instance |$[a, b] + [c, d]$| yields $[a, b] + [c, d]$ % but |$[a, b]+ [c, d]$| yields $[a, b]+ [c, d]$. % -% Let us also mention other approaches with the |\interval| macro +% Besides, there are other approaches, for example the |\interval| macro % from the \textsf{interval} package~\cite{INT}, % or |\DeclarePairedDelimiters| from the \textsf{mathtools} package~\cite{TOOL} % (but the latter is incompatible with \textsf{ibrackets} -% for brackets management). +% for managing brackets). % % \subsection{Environments for systems of equations and small matrices} % % \DescribeEnv{system} -% The \texttt{system} environment produces a system of equations:\\ +% The \texttt{system} environment, defined in the \textsf{mismath} package, +% is used to represent a system of equations:\\ % \begin{minipage}[t]{6.5cm} % \begin{verbatim} %$\begin{system} @@ -877,22 +916,28 @@ % % \medskip % \DescribeMacro{\systemsep} -% This first example could also have been produced with \texttt{cases} environment -% from \textsf{amsmath} package, although \texttt{cases} places mathematical expressions -% closer to the bracket (which makes sense considering it's use). -% |\systemsep| enables to set the gap between the bracket and the expressions, -% set by default to |\medspace|. This gap may be reduced, for instance: -% |\renewcommand{\systemsep}{\thinspace}|, -% or enlarged with |\thickspace| (and with |\renewcommand\systemsep}{}| -% we obtain what \texttt{cases} do). +% This first example could also have been achieved using the \texttt{cases} environment +% from the \textsf{amsmath} package, although \texttt{cases} places mathematical expressions +% closer to the bracket. +% The |\systemsep| command allows you to adjust the gap between +% the bracket and the expressions. +% By default, the gap is set to |\medspace|. You can reduce the gap by redefining the command, +% for instance: |\renewcommand{\systemsep}{\thinspace}|. +% Alternatively you can increase the gap using |\thickspace| +% (and with |\renewcommand\systemsep}{}| you can achieve the same spacing as the +% \texttt{cases} environment). +% The |\systemsep| command allows for greater flexibility in adjusting the spacing +% within the \texttt{system} environment. % % \medskip % \DescribeEnv{system\oarg{coldef}} % By default, a system is written like an \texttt{array} environment with only one column, -% left aligned. The environment has an optional argument to create several columns, -% specifying their alignment, with the same syntax than the \texttt{array} environment of -% \LaTeX : |\begin{system}[cl]| produces a two-column system, the first one being centered, -% the second being left aligned, such as in the following example:\\ +% left aligned. However the \texttt{system} environment has an optional +% argument that allows to create systems with multiple columns, +% specifying their alignment using the same syntax as the \texttt{array} environment in +% \LaTeX. For instance, using |\begin{system}[cl]| will produce a two-column system, +% with the first column centered and +% the second column left-aligned, as shown in the following example:\\ % \begin{minipage}[t]{7cm} % \begin{verbatim} %$\begin{system}[cl] @@ -906,13 +951,16 @@ % \end{minipage} % % \DescribeMacro{\systemstretch} -% Default spacing between the lines of a \texttt{system} environment has been slightly -% enlarged compared to the one from \texttt{array} environments (from 1.2 factor). -% This spacing may be changed by typing |\renewcommand{\systemstretch}|\marg{stretch}, -% inside the current mathematical environment (for a local change) or outside -% (for a global change). By default, stretch's value is 1.2. -% In addition we can use the end of line with a spacing option such -% as it has been done above with |\\[1ex]|. +% The default spacing between the lines of a \texttt{system} environment has been slightly +% enlarged compared to the one used in \texttt{array} environments (using a factor of 1.2). +% This can be adjusted by using +% |\renewcommand{\systemstretch}|\marg{stretch}, where \meta{stretch} is the desired value +% for the spacing. You can place this command +% inside the current mathematical environment for a local change, or outside +% for a global change. The default value for is 1.2. +% Furthermore you can also use the end of the line with a spacing option, as +% demonstrated above with |\\[1ex]|, to control the spacing between specific lines in +% the system. % % Another example with |\begin{system}[rl@{\quad}l]| % \footnote{\texttt{@\{\ldots\}} sets inter-column space.}: @@ -928,41 +976,45 @@ % \end{system} % \end{equation*} % -% Let's mention the \textsf{systeme} package~\cite{SYST} which deals with linear systems -% with a lighter syntax and automatic alignments on $+$, $-$, $=$, -% and also the \textsf{spalign} package~\cite{SPAL} which moreover produces nice alignments -% for matrices (with spaces and semi­colons as de­lim­iters). +% Let's also mention the \textsf{systeme} package~\cite{SYST} which provides +% a lighter syntax and automatic alignments for linear systems. +% Additionally, there is the \textsf{spalign} package~\cite{SPAL}, +% which offers a convenient and easy syntax for systems and matrices with +% visually appealing alignments. % % \medskip % \DescribeEnv{spmatrix} -% The \textsf{amsmath} package provides various environments to typeset matrices: -% for instance \texttt{pmatrix} surrounds the matrix with parenthesis -% or \texttt{smallmatrix} typesets a small matrix that can even be inserted -% in a text line. We provide a combination of the two with \texttt{spmatrix}:\\ +% The \textsf{amsmath} package offers several environments to typeset matrices : +% For example, the \texttt{pmatrix} environment surrounds the matrix with parenthesis, +% and the \texttt{smallmatrix} environment creates a smaller matrix suitable for insertion +% within a text line. We provide a combination of the these both +% functionalities with the \texttt{spmatrix} environment: % |$\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$| yielding % $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$. % -% The \textsf{mathtools} package enhance \textsf{amsmath} matrices environments -% and provides also a small matrix environment with parenthesis. -% Furthermore, with starred version |\begin{psmallmatrix*}|\oarg{col}, +% The \textsf{mathtools} package enhances the \textsf{amsmath} matrix environments +% and also provides a small matrix environment with parenthesis: \texttt{psmallmatrix}. +% Moreover, with the starred version |\begin{psmallmatrix*}|\oarg{col}, % you can choose the alignment inside the columns (\texttt{c}, \texttt{l} or \texttt{r}). -% But sadly, the space before the left parenthesis is too narrow -% regarding to the space inside the parenthesis. -% Compare previous $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$ -% with $\vec{u}\begin{psmallmatrix}-1\\2\end{psmallmatrix}$. +% However, the space before the left parenthesis is unfortunately too narrow +% compared to the space inside the parenthesis. +% To illustrate this, consider the following comparison: +% $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$ (using \textsf{mismath}'s \texttt{spmatrix}) +% vs.\@ $\vec{u}\begin{psmallmatrix}-1\\2\end{psmallmatrix}$ +% (using \textsf{mathtools} \texttt{psmallmatrix}). % % \medskip -% For typesetting various kind of matrices, let's mention the awesome +% For typesetting various kinds of matrices, let's mention the excellent % \textsf{nicematrix} package by François Pantigny~\cite{NMATX}. % % \subsection{Displaymath in double columns} % % \DescribeEnv{mathcols} -% The \texttt{mathcols} environment enables to arrange -% ``long'' calculation in double columns, separated with a central rule, +% The \texttt{mathcols} environment allows you to arrange +% ``long'' calculations in double columns, separated with a central rule, % as shown in the following example. -% But the \textsf{multicol} package must be loaded in the preamble. -% It activates the mathematical mode +% However, to use this feature, the \textsf{multicol} package must be loaded in the preamble. +% The \texttt{mathcols} environment activates mathematical mode % in display style and with an \texttt{aligned} environment. % \begin{mathcols} % & \frac{1}{2 \mul {\pow{\frac{1}{4}}{n}} + 1} \geq 0.999 \\ @@ -976,8 +1028,9 @@ % \end{mathcols} % % \DescribeMacro{\changecol} -% The |\changecol| macro causes a change of column; -% alignment is produced using the classic delimiters |&| and |\\|. +% The |\changecol| macro is used to switch to the next column, +% and an alignment within the column is done using the classic delimiters +% |&| to separate entries and |\\| to start a new row. % % \begin{verbatim} %\begin{mathcols} @@ -995,12 +1048,14 @@ % \vspace{-4ex} % \subsection{Deprecated commands} % -% Here we present a summary table of deprecated commands, used until version 2.2. -% They produce a warning message but are still working and will be maintained for now. -% These deprecated commands -% worked only in the preamble, globally, and there was no inverse switch. -% Therefore they are replaced by the more powerful and more general -% macro |\MathUp| which can be placed anywhere and has an inverse switch |\MathIt|. +% Here is a summary table of the deprecated commands that were used until version 2.2. +% These commands are still functional and will be maintained for the time being, +% but they do produce a warning message. +% They used to work only in the preamble, affecting the entire document globally, +% and lacked an inverse switch. +% As a result, these deprecated commands are now being replaced by the more +% versatile and powerful |\MathUp| macro, which can be used anywhere +% in the document or preamble and has an inverse switch |\MathIt|. % % \begin{center} % \setlength{\extrarowheight}{1pt} @@ -1017,16 +1072,18 @@ % \end{center} % % \medskip -% |\MathNumbers| may be used instead of |\MathUp| with an argument containing +% You can also utilize|\MathNumbers| instead of |\MathUp| with an argument containing % all the constants you want to be typeset in roman (among `e, i, j'). -% And |\MathProba{P,E}| may be used instead of |\MathUp{P}\MathUp{E}| -% and you can add also V in its argument to refer to variance. +% Additionally |\MathProba{P,E}| can be used instead of |\MathUp{P}\MathUp{E}|, +% and you can include V in its argument to refer to variance. % % \medskip -% In version 2.3 we tried a way to replace these deprecated commands -% by package options based on keyval. This less efficient method is abandoned. -% And thus the command |\mismathset| is obsolete. -% Another command, |\paren|, used before version 2.0, is no longer supported. +% In version 2.3 we attempted to replace these deprecated commands +% with package options based on keyval. However, we found that this method was +% less efficient and have decided to abandon it. +% As a result, the command |\mismathset| is now obsolete. +% Additionally, the command, |\paren|, which was used before version 2.0, +% is no longer supported. % % \StopEventually{} % \section{Implementation} @@ -1046,14 +1103,15 @@ \ifmm@ibrackets\RequirePackage{ibrackets}\fi % \end{macrocode} -% The above conditional packages loading avoids ``option clash'' errors if these packages -% have been previously loaded with other options. +% The above conditional packages loading prevents ``option clash'' errors in case +% these packages have been previously loaded previously with different options. % % \medskip % \DescribeMacro{\bslash} -% The |\bslash| macro comes from Frank Mittelbach's \textsf{doc.sty} package. -% It can also be used in other documents instead of |\textbackslash| -% (which doesn't work inside warnings). +% The |\bslash| macro originates from Frank Mittelbach's \textsf{doc.sty} package. +% It can be employed in other documents as an alternative to |\textbackslash|, +% especially in situations where |\textbackslash| does not work correctly, such as +% inside warning messages. % \begin{macrocode} {\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % \bslash command @@ -1061,9 +1119,9 @@ % % \medskip % \DescribeMacro{\mm@warning} \DescribeMacro{\mm@macro} \DescribeMacro{\mm@operator} -% The three following internal macros are meta commands for -% conditional macro definition with a warning message if the macro already exists. -% They should be useful in other packages. +% The next three internal macros serve as meta commands for +% conditionally defining macros while providing a warning message if the macro already exists. +% These macros can be useful in other packages as well. % \medskip % \begin{macrocode} \newcommand\mm@warning[1]{ @@ -1085,10 +1143,10 @@ % % To produce the correct upright shape font when working % with the \textsf{beamer} package, you don't have to use |\mathrm| -% but |\mathup| (based on |\operatorfont| from the \textsf{amsopn} package). -% This command works also fine with other sans serif fonts like \textsf{cmbright}. +% but rather |\mathup| (based on |\operatorfont| from the \textsf{amsopn} package). +% This command also works fine with other sans serif fonts like \textsf{cmbright}. % -% Moreover for \textsf{beamer}, which changes the family default font (sans serif) +% Moreover for \textsf{beamer}, which changes the default font family (sans serif) % |\e|, |\i|, |\j| have no effect without |\AtBeginDocument|. % % |\AtBeginDocument| is also necessary to redefine |\i| when calling @@ -1103,16 +1161,16 @@ % \end{macrocode} % -% The following macros are switches that transform in roman vs italic any chosen letter -% in math mode. They can be used anywhere. -% To get a letter in roman instead of italic, we have to change the -% digit of mathcode that represent the family: 1 to 0. +% The following macros are switches that transform any chosen letter in math mode +% to roman or italic style. These switches can be used anywhere in the document or preamble. +% To obtain a letter in roman style instead of italic, we need to change the +% mathcode digit that represents the font family: 1 to 0. % % For example, except for \LuaLaTeX, mathcode of the `e' letter is: -% `e="7165 (decimal 29029), the second digit `1' meaning ``italic''. -% To get a roman `e', we have to change his mathcode in "7065. +% `e="7165 (decimal 29029), with the second digit `1' indicating ``italic'' style. +% To get a roman `e', we need to change its mathcode to "7065. % -% When called in the preamble, |\AtBeginDocument| is necessary +% When used in the preamble, it is necessary to call |\AtBeginDocument| % for using with the \textsf{beamer} package. % In the preamble, |\math@family{#1}{0}| is equivalent to \\ % |\DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}|. @@ -1165,15 +1223,17 @@ \newcommand*\MathIt[1]{\MathFamily{#1}{1}} % \end{macrocode} -% On the same model we could also create some other macros to set any letter -% in bold or sans serif, but unfortunately there is no family number associated by default -% to these typefaces. It depends on the font package that is loaded and -% it can also depend on which |\DeclareSymbolFont| is used. +% With a similar approach we could also create additional macros to set any letter +% in bold or sans serif. However, there is no default family number associated +% with these typefaces. The family number depends on the font package being loaded and +% may vary depending on specific |\DeclareSymbolFont| used. +% Therefore, setting letters in bold or sans serif requires additional consideration +% and may not have a straightforward solution. % % \medskip -% In complement to |\MathUp| and |\MathIt|, we provide the two following commands -% to set in roman a group of letters among `e, i, j' for mathematical constants -% or `P, E, V' for probability operators. +% In addition to |\MathUp| and |\MathIt|, we also offer the following two commands +% to set a group of letters in roman typeface: one for for mathematical constants, +% among `e, i, j', and the other for probability operators, among or `P, E, V'. % % \medskip % \begin{macrocode} @@ -1191,18 +1251,20 @@ % \end{macrocode} % \DescribeMacro{\apply} -% The inverse global switch |\MathNormal| acts on any comma separated list -% thanks to the |\apply| macro which works as follows: -% |\apply\macro{comma,list}| expands to |\macro{comma}\macro{list}|. -% We could also use |\apply\MathUp{e,i,j}| instead of |\MathNumbers{e,i,j}|. -% I found this macro on Tex RSSing.com by searching +% With the inverse global switch |\MathNormal|, you can apply the normal (italic) style +% on any comma-separated list of characters. This is achieved using +% the |\apply| macro, for example |\apply\macro{arg1,arg2}| +% expands to |\macro{arg1}\macro{arg2}|. +% So using |\apply\MathUp{e,i,j}| is equivalent to |\MathUp{e}\MathUp{i}\MathUp{j}|. +% I discovered this powerfull macro on Tex RSSing.com by searching for % ``TeX How to iterate over a comma separated list?'' -% The answer was given by ``wipet'' on 2021/02/26. -% I don't know who is wipet but I thank him for this powerful macro! -% Unfortunately usual loop instructions like |\@for| or |\foreach| do not work -% and produce the error message ``!~Improper alphabetic constant''. -% Indeed |\def\letter{A} \MathUp{\letter}| fails, -% the control sequence |\letter| is not considered as the single character `A'. +% The answer was provided by a user named ``wipet'' on 2021/02/26. +% I don't know who is wipet but I am grateful for his contribution, +% as this macro allows us to accomplish the task that +% usual loop instructions like |\@for| or |\foreach| cannot achieve due to +% errors like ``!~Improper alphabetic constant''. +% For instance, if you try |\def\letter{A} \MathUp{\letter}| it will fail +% because the control sequence |\letter| is not considered as the single character `A'. % % \medskip % \begin{macrocode} @@ -1218,10 +1280,10 @@ % \end{macrocode} % % The following commands are deprecated but still work. -% They were intended to set some letters in upright shape by default -% in math mode, but worked only in the preamble. -% This is now managed by the more powerful |\MathUp| command. -% The old commands are maintained for now for compatibility reasons. +% They were intended to set some letters in upright shape +% in math mode, but only worked in the preamble. +% This is now managed by the more powerful |\MathUp| command, and +% the old commands are maintained for compatibility reasons. % \medskip % % \begin{macrocode} @@ -1252,11 +1314,11 @@ % \end{macrocode} % -% The Greek letter pi must be managed in a different way. The switches are called +% The Greek letter pi must be handled differently. The switches are called % |\pinumber| and |\pinormal|. -% When given without argument, |\pinumber| uses the LGR font encoding. +% When given without an argument, |\pinumber| uses the LGR font encoding. % A particularity of the \textsf{fontenc} package is that it can be loaded -% several times with different options without ``option clash'' error. +% several times with different options without triggering an ``option clash'' error. % \medskip % \begin{macrocode} \newcommand*\pinumber[1][]{ @@ -1277,16 +1339,16 @@ \let\savedpi\pi \fi }{ - \@ifundefined{#1}{ - \PackageWarning{mismath}{% - Value #1 must be a valid - command name\MessageBreak for pinumber, - but command \bslash #1\space - is undefined.\MessageBreak - Perhaps a missing package} - }{\renewcommand{\pi}{% - \csname #1\endcsname} - } + \@ifundefined{#1}{ + \PackageWarning{mismath}{% + Value #1 must be a valid + command name\MessageBreak for pinumber, + but command \bslash #1\space + is undefined.\MessageBreak + Perhaps a missing package} + }{\renewcommand{\pi}{% + \csname #1\endcsname} + } } } @@ -1327,7 +1389,7 @@ % \end{macrocode} % -% And now all the other commands. +% Classic identifiers are presented below. % \medskip % \begin{macrocode} \mm@macro{di}{\mathop{}\!\mathup{d}} @@ -1381,13 +1443,20 @@ \mm@operator[bigo]{\bigo}{O} \mm@operator[lito]{\lito}{o} +% \end{macrocode} +% And finally we present the remaining macros. +% +% With Cyrillic languages, the command |\C| may already be defined (only for text mode). +% Thus, it will not be redefined by \textsf{mismath}. However, one may still want +% to use our |\C| macro only for math mode without interfering the definition of +% the text |\C|, therefore the |\onlymathC| macro. +% \medskip +% \begin{macrocode} \mm@macro{mathset}{\mathbf} \mm@macro{R}{\mathset{R}} -\@ifpackagewith{babel}{russian}{ - \PackageWarningNoLine{mismath}{Option russian of babel - is loaded\MessageBreak - Command \bslash C will not be redefined} - }{\mm@macro{C}{\mathset{C}}} +\mm@macro{C}{\mathset{C}} +\providecommand\onlymathC{\let\oldC\C + \renewcommand{\C}{\TextOrMath{\oldC}{\mathset{C}}} } \mm@macro{N}{\mathset{N}} \mm@macro{Z}{\mathset{Z}} \mm@macro{Q}{\mathset{Q}} @@ -1412,9 +1481,10 @@ \mm@macro{iif}{if and only if\xspace} % \end{macrocode} -% We used |\mathurm| before |\Delta| in the case of defining capital Greek letters -% in italic (for example with the \textsf{fixmath} package). -% Without |\mbox{}|, space produced by |\| in macro |\then| would be suppressed in tables. +% Above, we have used |\mathrm| before |\Delta| in case of defining capital Greek letters +% in italics (for example with the \textsf{fixmath} package). +% The use of |\mbox{}| ensures that the space produced by |\| in the |\then| macro +% is not suppressed in tables. % \medskip % \begin{macrocode} \mm@macro{then}{\ \Longrightarrow \ \mbox{} } -- cgit v1.2.3