texlive[65941] branches/branch2022.final/Master/texmf-dist: mismath
commits+karl at tug.org
commits+karl at tug.org
Sun Feb 19 22:06:25 CET 2023
Revision: 65941
http://tug.org/svn/texlive?view=revision&revision=65941
Author: karl
Date: 2023-02-19 22:06:25 +0100 (Sun, 19 Feb 2023)
Log Message:
-----------
mismath (19feb23) (branch)
Modified Paths:
--------------
branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/mismath.pdf
branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.dtx
branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.ins
branches/branch2022.final/Master/texmf-dist/tex/latex/mismath/mismath.sty
Modified: branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/mismath.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.dtx
===================================================================
--- branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.dtx 2023-02-19 21:06:05 UTC (rev 65940)
+++ branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.dtx 2023-02-19 21:06:25 UTC (rev 65941)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2019-2022 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+% Copyright (C) 2019-2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
%
% This file may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -20,7 +20,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{mismath}
- [2023/02/10 v2.3 .dtx mismath file]
+ [2023/02/19 v2.4 .dtx mismath file]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -38,10 +38,11 @@
\usepackage{spacingtricks}
\usepackage{centeredline}
\usepackage{array}
+\usepackage{metalogo} % for logos of XeLaTeX et LuaLaTeX
\definecolor{darkbrown}{rgb}{0.5,0.1,0.1}
\allsectionsfont{\color{darkbrown}}
-\mismathset{inumber, pinumber=piup}
+\MathUp{i} \pinumber[piup]
% enumber=false because I need italicized e in vectors section
% For using in this doc only:
\usepackage[LGR,T1]{fontenc}
@@ -70,7 +71,7 @@
%</driver>
% \fi
%
-% \CheckSum{528}
+% \CheckSum{660}
%
% \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
@@ -100,16 +101,16 @@
% \changes{v1.2}{2019/04/26}{
% - Works fine with beamer now,
% - AtBeginDocument for enumber, inumber, jnumber,
-% - creating general @moperator macro,
+% - creating general mm at operator macro,
% - using mathup instead of mathrm}
% \changes{v1.2}{2019/04/27}{
% - Added mathtools package,
% - font definition Roman -> up,
% - changes in documentation,
-% - removing the PEroman macro}
+% - replacing the PEroman macro by PEupright}
%
% \changes{v1.3}{2019/05/05}{
-% - Using bslash in the internal @mwarning macro,
+% - Using bslash in the internal mm at warning macro,
% - loading of mathfixs package}
% \changes{v1.3}{2019/05/08}{
% - Many corrections in documentation}
@@ -145,17 +146,17 @@
%
% \changes{v2.0}{2022/11/11}{
% - pinumber command has been improved to use other Greek letter packages,
-% (and by default LGR encoding), it is no longer compatible with the older,
+% (and LGR encoding pi by default), it is no longer compatible with the older,
% - paren command has been removed,
% - hvect and hlbar have been slighlty modified (phantom t instead of phantom h),
% - several changes in documentation,
-% - now using the Charter font (mathdesign)}
+% - now using the Charter font (with the package mathdesign)}
%
% \changes{v2.1}{2022/12/26}{
% - Improved management of square brackets with the ibrackets package,
% - new macros codim, sinc, var, eqdef*,
-% - removing the systematic warning for paren command
-% - a small change in norm command -> bars in small size
+% - removing the systematic warning for paren command,
+% - a small change in norm command -> bars in small size,
% - several changes in documentation}
%
% \changes{v2.2}{2023/01/06}{
@@ -164,11 +165,17 @@
%
% \changes{v2.3}{2023/02/06}{
% - Introducing keyval options for enumber, inumber, jnumber, PEupright
-% (corresponding old commands are maintained for now)
+% (corresponding old commands are maintained for now),
% - and also for ibrackets, boldvect and arrowvect}
% \changes{v2.3}{2023/02/09}{
% - Documentation update}
%
+% \changes{v2.4}{2023/02/18}{
+% - New powerful macros MathUp, MathIt and also MathNumbers, MathProba, MathNormal,
+% - keyval options are no longer useful and have been deleted,
+% - loading package ifthen has been forgotten in v2.3 (causing possible errors),
+% - no more incompatibility when using `i' with accent in beamer titles}
+%
% \GetFileInfo{mismath.sty}
%
% \title{\textsf{mismath}\\ Miscellaneous mathematical macros\thanks{This document
@@ -175,7 +182,7 @@
% corresponds to \textsf{mismath}~\fileversion, dated \filedate.
% Thanks to François Bastouil for help in English translation.}}
% \author{Antoine Missier \\ \texttt{antoine.missier at ac-toulouse.fr}}
-% \date{February 10, 2023}
+% \date{February 19, 2023}
%
% \maketitle
% \tableofcontents
@@ -211,10 +218,10 @@
% \end{itemize}
%
% To avoid incompatibility,
-% a large majority of our macros will be defined only
+% most of our macros will be defined only
% if there is not another command with the same name in the packages loaded
% before \textsf{mismath}. If a macro is already defined,
-% compilation will produce a warning message and \textsf{mismath} definition
+% a warning message will be produced and the \textsf{mismath} definition
% will simply be ignored. To keep \textsf{mismath} command,
% either load \textsf{mismath} before the other package
% with which it is in conflict for the name of that command
@@ -230,17 +237,6 @@
% with the required options before \textsf{mismath}.
%
% \medskip
-% \DescribeMacro{\mismathset}
-% \textsf{mismath} has its own options (see further and in section \ref{options}).
-% They are based on the \meta{key}=\meta{value} mechanism,
-% thanks to the \textsf{kvoptions} package by Heiko Oberdiek~\cite{KVO}. Most of them
-% are booleans and they can be called by their key name without typing `\texttt{=true}'.
-% \textsf{mismath} options can be set when calling the package, or later with the
-% macro |\mismathset|\marg{keyval list}, which is an alias for
-% |\setkeys{mismath}|\marg{keyval list}
-% from the \textsf{keyval} package by David Carlisle~\cite{KV}.
-%
-% \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.
@@ -261,14 +257,13 @@
%
% \section{Usage}
%
-% \subsection{Mathematical constants} \label{constants}
+% \subsection{Mathematical constants}
%
% \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. To avoid to stuff a document with |\mathrm{e}| or |\mathrm{i}|
-% (or better |\mathup{e}| and |\mathup{i}|
+% 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}).
@@ -275,9 +270,15 @@
% 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}.}),
+% using \texttt{\bslash mathup} is better than \texttt{\bslash mathrm}.},
+% to set any math text in upright shape, so on can write
+% |\mathup{e}| to get the Euler's number.
+%
+% \medskip
% \DescribeMacro{\e} \DescribeMacro{\i} \DescribeMacro{\j}
-% the package provides |\e| command for the base of the natural logarithm
+% 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,
@@ -284,29 +285,44 @@
% 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
-% \footnote{Due to this \texttt{\bslash i} command redefinition,
-% there is an incompatibility with
-% \textsf{beamer} when using i with accents in beamer titles.
-% A solution is to use the classic \texttt{\bslash \textasciicircum i}
-% command to produce î in beamer titles for example.}.
%
% \medskip
-% \DescribeMacro{[enumber]} \DescribeMacro{[inumber]} \DescribeMacro{[jnumber]}
-% Nevertheless, it can be tiresome to type a lot of backslashes in a document
-% with many formulas containing $\e$ or $\i$.
-% So a way is proposed here to free of it with the package options
-% |enumber|, |inumber| or |jnumber| :
-% $\e$, $i$ or $\j$ will then automatically be set in roman
-% in the whole document, no need to type |\e|, |\i| or |\j|,
-% as long as there are not many other $\mathit{e}$, $\mathit{i}$ or $j$ as variables.
-% However, you can still get italicized
-% $\mathit{e}$, $\mathit{i}$ or $\mathit{j}$ with \LaTeX\ command
-% |\mathit| or |\mathnormal|. These options are really handy and
-% thanks to them it is possible to bring a document up to the standards
-% afterwards.
+% \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}).
%
% \medskip
-% \DescribeMacro{[pinumber=\meta{command}]}
+% \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.
+%
+% \medskip
+% \DescribeMacro{\MathNumbers} \DescribeMacro{\MathNormal}
+% These macros allow to set upright or normal typesetting in a single command, \eg
+% |\MathNumbers{e,i}| is equivalent to |\MathUp{e}\MathUp{i}|.
+% The comma separator can be changed or deleted.
+% |\MathNumbers| has no effect on other letters than e, i or j
+% and |\MathNormal| can be used for probability also (see section \ref{operators}).
+%
+% \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
@@ -325,24 +341,24 @@
% 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
-% option [\texttt{pinumber=}\meta{command}].
-% This option redefines |\pi| to match
+% 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.
+% assuming the appropriate package has been loaded before.
%
-% By calling |\mismathset{enumber,inumber,pinumber=piup}| (\eg with \textsf{mathdesign})
-% in the preamble,
-% you can get for instance :
+% By calling preliminary |\MathNumbers{ei}\pinumber[piup]|
+% (and with the \textsf{mathdesign} package loaded)
+% you can get for instance:
% \begin{center}
% |$e^{i\pi} = -1$| \quad yields \quad $\e^{i\pi}=-1$.
% \end{center}
%
-% The \texttt{pinumber} option has a special value `star' : |pinumber=*|,
-% which defines |\pi| with the default LGR font encoding of Greek letters
-% to produce $\mypi$ (the appropriate option \texttt{LGR}
-% for the \textsf{fontenc} package will be automatically loaded).
-% It looks the same as the one supplied with
+% 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
% Günter Milde's \textsf{textalpha} package~\cite{ALPHA}.
% This $\mypi$ is particularly suitable
% for use with the default Computer Modern or Latin Modern font family
@@ -352,12 +368,17 @@
% and it has also a \texttt{Symbol} option (using Adobe Symbol font)
% that fits well with several text fonts, for instance Times.}.
%
+% \medskip
% \DescribeMacro{\itpi}
-% When using the |pinumber| option, the original italic $\itpi$
+% When activating |\pinumber|, the original italic $\itpi$
% is still available with |\itpi|.
%
-% \subsection{Vectors}\label{vectors}
+% \DescribeMacro{\pinormal}
+% In fact |\pinumber| acts as a switch and there is also an inverse switch,
+% |\pinormal|, that can be called anywhere.
%
+% \subsection{Vectors}
+%
% \DescribeMacro{\vect}
% By default, the |\vect| command
% \footnote{As for many macros of this package,
@@ -420,17 +441,6 @@
% (with global effect).
%
% \medskip
-% \DescribeMacro{[boldvect]}\DescribeMacro{[arrowvect]}
-% Instead of using these switches, you can also set package options
-% \texttt{boldvect} or \texttt{arrowvect}, when calling \textsf{mismath}
-% or with the |\mismathset| command.
-% The latter gives the same flexibility than the previous switches.
-% In fact \texttt{boldvect} and \texttt{arrowvect} options are linked booleans:
-% when one is set to \texttt{true}, the other will be \texttt{false}.
-% So \texttt{arrowvect=false} is equivalent to \texttt{boldvect}
-% (\texttt{=true} can be omitted).
-%
-% \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$)
@@ -444,7 +454,6 @@
% The |\boldvect| and |\arrowvect| switches have the same effect on |\hvect| than on |\vect|,
% and so have \texttt{boldvect} and \texttt{arrowvect} options.
%
-% \pagebreak
% \DescribeMacro{\hvec}
% In a similar way, |\hvec| raises the little arrow produced by
% the \LaTeX\ command |\vec| (from height of $t$ letter):
@@ -498,16 +507,13 @@
% This command can also stand for \emph{distance} (hence its name):
% \[\lambda\di(A,\mathcal{F})+\mu\di(B,\mathcal{H}).\]
%
-% \DescribeMacro{\P} \DescribeMacro{\E} \DescribeMacro{[PEupright]}
+% \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|.
-% In the same way as for $\e$ and $\i$, you can use \texttt{[PEupright]} as package option
-% to avoid typing many |\P| or |\E|.
%
-% \medskip
% \DescribeMacro{\Par}
% The |\P| command already existed to refer to the end of paragraph symbol \Par\
% and has been redefined, but this symbol can still be obtained with |\Par|.
@@ -517,6 +523,15 @@
% Variance is generally denoted by $\var$ or $\Var$ (see table below),
% but some authors prefer to use $\V$, produced by |\V|.
%
+% \pagebreak
+% \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
+% |\MathIt| for any individual letter or |\MathNormal| for a list
+% (among `P, E, V' or `e, i, j' exclusively).
+%
% \medskip
% \DescribeMacro{\probastyle}
% Some authors use ``blackboard bold'' font
@@ -531,7 +546,6 @@
% but also available standalone)
% which has to be called in the preamble.
%
-% \pagebreak
% The following standard operator names are defined in \textsf{mismath}:
% \begin{center}
% \begin{tabular}{rlrlrl}
@@ -583,6 +597,7 @@
% \end{tabular}
% \end{center}
%
+% \pagebreak
% \DescribeMacro{\bigO} \DescribeMacro{\bigo} \DescribeMacro{\lito}
% Asymptotic comparison operators (in Landau notation) are obtained with
% |\bigO| or |\bigo| and |\lito| commands:
@@ -692,8 +707,7 @@
% \DescribeMacro{\iif}
% |\iif| is an alias for ``\iif'', to be used in text mode.
%
-% \pagebreak
-% \subsection{Improved spacing in mathematical formulas}\label{spacing}
+% \subsection{Improved spacing in mathematical formulas}
%
% \DescribeMacro{\then}
% The |\then| macro produces the symbol $\Longrightarrow$ surrounded by large spaces
@@ -783,7 +797,8 @@
% \footnote{This functionality is optional because it causes
% error when using a command defined by
% \texttt{\bslash DeclarePairedDelimiter}~\cite{TOOL} with square brackets.}
-% loaded by \textsf{mismath} with \texttt{ibracket} package option.
+% loaded by \textsf{mismath} with \texttt{ibrackets} package option
+% \footnote{It's the only option of the \textsf{mismath} package.}.
%
% Simply type |$x\in ]-\pi,0[ \cup ]2\pi,3\pi[$| to get
% \begin{align*}
@@ -945,93 +960,60 @@
% \end{verbatim}
%
% \vspace{-4ex}
-% \subsection{Summary of available options and deprecated commands}\label{options}
+% \subsection{Deprecated commands}
%
-% Here we present a summary table of available options. Explanations of use
-% are given in the corresponding sections.
-% The default value for booleans is always \texttt{false} except for \texttt{arrowvect}.
-% Deprecated commands (used until version 2.3) are still working.
+% 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|.
%
-% \begin{center} \ttfamily
+% \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.
+%
+% \begin{center}
% \setlength{\extrarowheight}{1pt}
-% \begin{tabular}{llcc}
+% \begin{tabular}{ll}
% \hline
-% \textsf{Key} & \textsf{Possible values} & \textsf{See section} &
-% \textsf{Deprecated command} \\
+% \textsf{Deprecated command} & \textsf{New alternative} \\
% \hline
-% enumber & false, true & \ref{constants} & |\enumber| \\
-% inumber & false, true & \ref{constants} & |\inumber| \\
-% jnumber & false, true & \ref{constants} & |\jnumber| \\
-% pinumber & *, \meta{command} & \ref{constants} & |\pinumber|\oarg{command}\\
-% boldvect & false, true & \ref{operators} &\\
-% arrowvect & true, false & \ref{operators} & \\
-% PEupright & false, true & \ref{operators} & |\PEupright| \\
-% ibrackets & false, true & \ref{spacing} & \\
+% |\enumber| & |\MathUp{e}| \\
+% |\inumber| & |\MathUp{i}| \\
+% |\jnumber| & |\MathUp{j}| \\
+% |\PEupright| & |\MathUp{P}\MathUp{E}| \\
% \hline
% \end{tabular}
% \end{center}
%
-% For \texttt{pinumber}, there is no default value,
-% that means that |\pi| is still typeset in italic.
-% If you want it in upright shape, you have to load an appropriate package
-% and give a command name (without backslash) that produces an upright pi;
-% \texttt{pinumber=*} gives the upright $\mypi$ given by the LGR font encoding,
-% without having to load something.
+% \medskip
+% |\MathNumbers| may be used instead of |\MathUp| with an argument containing
+% all the constants you want to be typeset in roman (among `e, i, j').
+% And |\MathProba{PE}| may be used instead of |\MathUp{P}\MathUp{E}|
+% and you can add also V in its argument to refer to variance.
%
-% \enlargethispage{1ex}
% \medskip
-% For each option, you can set them when package calling: \eg
-% (with \textsf{upgreek})
+% Another command, |\paren|, used before version 2.0, is no longer supported.
%
-% \smallskip
-% \centeredline{|\usepackage[inumber,pinumber=uppi,boldvect]{mismath}|}
-%
-% \bigskip
-% \DescribeMacro{\mismathset}
-% You can also use the |\mismathset|\{\meta{keyval list}\}
-% command.
-% Nevertheless, only the option \texttt{boldvect} (or \texttt{arrowvect})
-% can be changed dynamically in the document body.
-% The others are usable in the preamble only
-% and will be processed once, at begin document.
-%
% \StopEventually{}
% \section{Implementation}
%
% \begin{macrocode}
-\RequirePackage{kvoptions}
-\DeclareBoolOption[false]{enumber}
-\DeclareBoolOption[false]{inumber}
-\DeclareBoolOption[false]{jnumber}
-\DeclareStringOption{pinumber}
-\DeclareBoolOption[true]{arrowvect}
-\DeclareComplementaryOption{boldvect}{arrowvect}
-\DeclareBoolOption[false]{PEupright}
-\DeclareBoolOption[false]{ibrackets}
-\DeclareDefaultOption{%
- \ifx\CurrentOptionValue\relax
- \PackageWarningNoLine{\@currname}{%
- Unknown option `\CurrentOption’\MessageBreak
- is passed to package `amsmath’}%
- % Pass the option to package amsmath.
- % Again it is better to expand \CurrentOption.
- \expandafter\PassOptionsToPackage
- \expandafter{\CurrentOption}{amsmath}%
- \else
- % Package amsmath does not take options with values.
- % We provide the standard LaTeX error.
- \@unknownoptionerror
- \fi }
-
-\ProcessKeyvalOptions*
-
+\newif\ifmm at ibrackets % initialized to false
+\DeclareOption{ibrackets}{\mm at ibracketstrue}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}
+\ProcessOptions \relax
\@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}}
\@ifpackageloaded{mathtools}{}{\RequirePackage{mathtools}}
\@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}}
+\RequirePackage{ifthen}
\RequirePackage{xspace}
+\RequirePackage{iftex}
+\ifmm at ibrackets\RequirePackage{ibrackets}\fi
% \end{macrocode}
-% The above conditional packages loading avoids ``option clash'' errors if the packages
+% The above conditional packages loading avoids ``option clash'' errors if these packages
% have been previously loaded with other options.
%
% \medskip
@@ -1045,146 +1027,246 @@
% \end{macrocode}
%
% \medskip
-% \DescribeMacro{\mismathset}
-% This macro allows to set keyval options not only when calling the package.
+% \DescribeMacro{\mm at warning} \DescribeMacro{\mm at macro} \DescribeMacro{\mm at 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.
+% \medskip
% \begin{macrocode}
-\def\mismathset#1{\setkeys{mismath}{#1}}
+\newcommand\mm at warning[1]{
+ \PackageWarningNoLine{mismath}{
+ Command \bslash #1 already exist and will not be redefined}
+}
+\newcommand\mm at macro[2]{
+ \@ifundefined{#1}{
+ \expandafter\def\csname #1\endcsname{#2}
+ }{\\mm at warning{#1}}
+}
+\newcommand\mm at operator[3][]{%
+ \ifthenelse{\equal{#1}{}}{\def\tempa{#3}}{\def\tempa{#1}}
+ \@ifundefined{\tempa}{
+ \DeclareMathOperator{#2}{#3}
+ }{\mm at warning{\tempa}}
+}
+
+% \end{macrocode}
+%
+% 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}.
+%
+% Moreover for \textsf{beamer}, which changes the family default font (sans serif)
+% $\e, \i, \j$ have no effect without |\AtBeginDocument|.
+%
+% |\AtBeginDocument| is also necessary to redefine |\i| when calling
+% the \textsf{hyperref} package which overwrites the |\i| definition.
+% \medskip
+% \begin{macrocode}
+\providecommand{\mathup}[1]{{\operatorfont #1}} % also in kpfonts
+\mm at macro{e}{\mathup{e}}
+\AtBeginDocument{\let\oldi\i \let\oldj\j
+ \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
+ \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} }
% \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.
+%
+% 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.
+%
+% When called in the preamble, |\AtBeginDocument| is necessary
+% for using with the \textsf{beamer} package.
+% In the preamble, |\@MathUp{#1}| is equivalent to \\
+% |\DeclareMathSymbol{#1}\mathalpha{operators}{`#1}|.
% \medskip
-% Options must be set in the preamble and are processed at begin document,
-% except \texttt{boldvect} or \texttt{arrowvect} which can be changed dynamically
-% anywhere in the document body.
+% \begin{macrocode}
+\newcount\mm at charcode
+\newcount\mm at charclass
+%\newcount\mm at charfam
+\newcount\mm at charslot
+
+\newcommand\@MathUp[1]{%
+ \ifluatex
+ \mm at charclass=\Umathcharclass`#1
+ %\mm at charfam=\Umathcharfam`#1
+ \mm at charslot=\Umathcharslot`#1
+ \Umathcode`#1= \mm at charclass 0 \mm at charslot
+ \else
+ \mm at charcode=\mathcode`#1
+ % extract charclass
+ \@tempcnta=\mm at charcode
+ \divide\@tempcnta by "1000
+ \multiply\@tempcnta by "1000 % charclass
+ \mm at charclass=\@tempcnta
+ % extract charslot
+ \@tempcnta=\mm at charcode
+ \@tempcntb=\mm at charcode
+ \divide\@tempcnta by "100
+ \multiply\@tempcnta by "100 % charclass + charfam
+ \advance\@tempcntb by -\@tempcnta % charslot
+ \mm at charslot=\@tempcntb
+ % construct charcode
+ \mm at charcode=\mm at charclass
+ \advance\mm at charcode by \mm at charslot % charfam is now 0
+ \mathcode`#1=\mm at charcode
+ \fi
+}
+
+\newcommand\MathUp[1]{%
+ \ifx\@onlypreamble\@notprerr
+ \@MathUp{#1}
+ \else % in the preamble
+ \AtBeginDocument{\@MathUp{#1}}
+ \fi
+}
+
+\newcommand\MathIt[1]{%
+ \ifluatex
+ \mm at charclass=\Umathcharclass`#1
+ %\mm at charfam=\Umathcharfam`#1
+ \mm at charslot=\Umathcharslot`#1
+ \Umathcode`#1= \mm at charclass 1 \mm at charslot
+ \else
+ \mm at charcode=\mathcode`#1
+ % extract charclass
+ \@tempcnta=\mm at charcode
+ \divide\@tempcnta by "1000
+ \multiply\@tempcnta by "1000 % charclass
+ \mm at charclass=\@tempcnta
+ % extract charslot
+ \@tempcnta=\mm at charcode
+ \@tempcntb=\mm at charcode
+ \divide\@tempcnta by "100
+ \multiply\@tempcnta by "100 % charclass + charfam
+ \advance\@tempcntb by -\@tempcnta % charslot
+ \mm at charslot=\@tempcntb
+ % construct charcode
+ \mm at charcode=\mm at charclass
+ \advance\mm at charcode by \mm at charslot
+ \advance\mm at charcode by "100 % sets charfam to 1
+ \mathcode`#1=\mm at charcode
+ \fi
+}
+
+% \end{macrocode}
%
-% Moreover for \textsf{beamer}, $\e, \i, \j$ must be typeset in
-% the family default font (sans serif) and this has no effect without the
-% |\AtBeginDocument|.
+% In complement to |\MathUp| and |\MathIt|, we provide the three following commands
+% to set in roman or italic a group of letters among `e, i, j' for mathematical constants
+% or `P, E, V' for probability operators.
+% \medskip
% \begin{macrocode}
-\AtBeginDocument{
- \ifmismath at enumber
- \DeclareMathSymbol{e}\mathalpha{operators}{`e} \fi
- \ifmismath at inumber
- \DeclareMathSymbol{i}\mathalpha{operators}{`i}\fi
- \ifmismath at jnumber
- \DeclareMathSymbol{j}\mathalpha{operators}{`j}\fi
- \ifthenelse{\equal{\mismath at pinumber}{}}{}{% else
- \@ifundefined{itpi}{\let\itpi\pi}{\@mwarning{itpi}}
- \ifthenelse{\equal{\mismath at pinumber}{*}}{
- \RequirePackage[LGR,T1]{fontenc}
- \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
- \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
- }{% else
- \@ifundefined{\mismath at pinumber}{
- \PackageWarningNoLine{mismath}{%
- Value \mismath at pinumber\space must be a valid
- command name\MessageBreak for pinumber option,
- but command \bslash \mismath at pinumber\space
- is undefined.\MessageBreak
- Perhaps a missing package}
- }{\renewcommand{\pi}{%
- \csname\mismath at pinumber\endcsname}
- }
- }}
- \ifmismath at PEupright
- \DeclareMathSymbol{P}\mathalpha{operators}{`P}
- \DeclareMathSymbol{E}\mathalpha{operators}{`E} \fi
- \ifmismath at ibrackets \RequirePackage{ibrackets} \fi
-
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{enumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{inumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{jnumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{pinumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{PEupright}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{ibrackets}
+\newcommand*\MathNumbers[1]{%
+ \in@{e}{#1} \ifin@ \MathUp{e} \fi
+ \in@{i}{#1} \ifin@ \MathUp{i} \fi
+ \in@{j}{#1} \ifin@ \MathUp{j} \fi
}
+\newcommand*\MathProba[1]{%
+ \in@{P}{#1} \ifin@ \MathUp{P} \fi
+ \in@{E}{#1} \ifin@ \MathUp{E} \fi
+ \in@{V}{#1} \ifin@ \MathUp{V} \fi
+}
+
+\newcommand*\MathNormal[1]{
+ \in@{e}{#1} \ifin@ \MathIt{e} \fi
+ \in@{i}{#1} \ifin@ \MathIt{i} \fi
+ \in@{j}{#1} \ifin@ \MathIt{j} \fi
+ \in@{P}{#1} \ifin@ \MathIt{P} \fi
+ \in@{E}{#1} \ifin@ \MathIt{E} \fi
+ \in@{V}{#1} \ifin@ \MathIt{V} \fi
+}
+
% \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. This is now managed by keyval options.
+% 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.
+% \medskip
+%
% \begin{macrocode}
\newcommand{\enumber}{%
\PackageWarning{mismath}{Command \string\enumber\space
is deprecated, \MessageBreak
- use `enumber' as package option instead}
- \mismath at enumbertrue
+ use \bslash MathUp{e} instead}
+ \MathUp{e}
}
\newcommand{\inumber}{%
\PackageWarning{mismath}{Command \string\inumber\space
is deprecated, \MessageBreak
- use `inumber' as package option instead}
- \mismath at inumbertrue
+ use \bslash MathUp{i} instead}
+ \MathUp{i}
}
\newcommand{\jnumber}{
\PackageWarning{mismath}{Command \string\jnumber\space
is deprecated, \MessageBreak
- use `jnumber' as package option instead}
- \mismath at jnumbertrue
+ use \bslash MathUp{j} instead}
+ \MathUp{j}
}
-\newcommand*{\pinumber}[1][*]{
- \PackageWarning{mismath}{Command \string\pinumber\space
- is deprecated,
- use `pinumber=#1'\MessageBreak as package option instead}
- \def\mismath at pinumber{#1}
-}
\newcommand{\PEupright}{
\PackageWarning{mismath}{Command \string\PEupright\space
is deprecated, \MessageBreak
- use `PEupright' as package option instead}
- \mismath at PEuprighttrue
+ use \bslash MathUp{P} and \bslash MathUp{R} instead}
+ \MathUp{P}\MathUp{E}
}
% \end{macrocode}
+%
+% The Greek letter pi must be managed in a different way. The switches are called
+% |\pinumber| and |\pinormal|.
% \medskip
-% \DescribeMacro{\@mwarning} \DescribeMacro{\@mmacro} \DescribeMacro{\@moperator}
-% 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.
% \begin{macrocode}
-\newcommand\@mwarning[1]{
- \PackageWarningNoLine{mismath}{
- Command \bslash #1 already exist and will not be redefined}
-}
-\newcommand\@mmacro[2]{
- \@ifundefined{#1}{
- \expandafter\def\csname #1\endcsname{#2}
- }{\@mwarning{#1}}
-}
-\newcommand\@moperator[3][]{% this macro is ugly, by default #1=#3
+\newcommand*\pinumber[1][]{
+ \@ifundefined{itpi}{\let\itpi\pi}{}
\ifthenelse{\equal{#1}{}}{
- \@ifundefined{#3}{
- \DeclareMathOperator{#2}{#3}
- }{\@mwarning{#3}}
+ \ifx\@onlypreamble\@notprerr
+ \@ifundefined{savedpi}{
+ \PackageWarning{mismath}{%
+ \bslash pinumber without argument\MessageBreak
+ must be used in the preamble first\MessageBreak
+ to load LGR fontenc for upright pi}
+ }{\let\pi\savedpi}
+ \else % in the preamble
+ \RequirePackage[LGR,T1]{fontenc}
+ \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
+ \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
+ \let\savedpi\pi
+ \fi
}{
\@ifundefined{#1}{
- \DeclareMathOperator{#2}{#3}
- }{\@mwarning{#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}
+ }
+ }
+}
+
+\newcommand{\pinormal}{\@ifundefined{itpi}{}{\let\pi\itpi}}
+
% \end{macrocode}
%
-% 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}.
-%
-% |\AtBeginDocument| is necessary to redefine |\i| when calling
-% the \textsf{hyperref} package which overwrites the |\i| definition.
-%
+% And now all the other commands.
% \medskip
% \begin{macrocode}
-\providecommand{\mathup}[1]{{\operatorfont #1}} % also in kpfonts
-\@mmacro{e}{\mathup{e}}
-\AtBeginDocument{\let\oldi\i \let\oldj\j
- \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
- \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} }
-
-\newcommand{\arrowvect}{\mismath at arrowvecttrue}
-\newcommand{\boldvect}{\mismath at arrowvectfalse}
+\newboolean{arrowvect}
+\setboolean{arrowvect}{true}
+\newcommand{\arrowvect}{\setboolean{arrowvect}{true}}
+\newcommand{\boldvect}{\setboolean{arrowvect}{false}}
\newcommand{\boldvectcommand}{\boldsymbol} % from amsbsy package
-\@mmacro{vect}{\ifthenelse{\boolean{mismath at arrowvect}}{
- \vv}{\boldvectcommand}} %\if \fi doesn't work well here
+\mm at macro{vect}{\ifthenelse{\boolean{arrowvect}}{
+ \vv}{\boldvectcommand}} % doesn't work well with \if... \fi
\newcommand*{\hvect}[1]{\vect{\vphantom{t}#1}}
\newcommand*{\hvec}[1]{\vec{\vphantom{t}#1}}
@@ -1201,105 +1283,103 @@
\@ifundefined{norm}{\providecommand*{\norm}[1]{
\mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}}
}
- }{\@mwarning{norm} } % bad result with libertinust1math
+ }{\mm at warning{norm} } % bad result with libertinust1math
-\@mmacro{di}{\mathop{}\!\mathup{d}}
+\mm at macro{di}{\mathop{}\!\mathup{d}}
\newcommand\probastyle{}
\let\Par\P % end of paragraph symbol
\renewcommand{\P}{\operatorname{\probastyle{P}}}
-\@mmacro{E}{\operatorname{\probastyle{E}}}
-\@mmacro{V}{\operatorname{\probastyle{V}}}
+\mm at macro{E}{\operatorname{\probastyle{E}}}
+\mm at macro{V}{\operatorname{\probastyle{V}}}
-\@moperator{\adj}{adj}
-\@moperator{\Aut}{Aut}
-\@moperator{\codim}{codim}
-\@moperator{\Conv}{Conv}
-\@moperator{\cov}{cov}
-\@moperator{\Cov}{Cov}
-\@mmacro{curl}{\operatorname{\vect{\mathup{curl}}}}
-\@moperator[divg]{\divg}{div}
-\@moperator{\End}{End}
+\mm at operator{\adj}{adj}
+\mm at operator{\Aut}{Aut}
+\mm at operator{\codim}{codim}
+\mm at operator{\Conv}{Conv}
+\mm at operator{\cov}{cov}
+\mm at operator{\Cov}{Cov}
+\mm at macro{curl}{\operatorname{\vect{\mathup{curl}}}}
+\mm at operator[divg]{\divg}{div}
+\mm at operator{\End}{End}
-\@moperator{\erf}{erf}
-\@mmacro{grad}{\operatorname{\vect{\mathup{grad}}}}
-\@moperator{\id}{id} % mathop or mathord ?
-\@moperator{\Id}{Id}
-\@moperator{\im}{im}
+\mm at operator{\erf}{erf}
+\mm at macro{grad}{\operatorname{\vect{\mathup{grad}}}}
+\mm at operator{\id}{id} % mathop or mathord ?
+\mm at operator{\Id}{Id}
+\mm at operator{\im}{im}
\let\oldIm\Im \renewcommand{\Im}{\operatorname{Im}}
-\@moperator{\lb}{lb}
-\@moperator{\lcm}{lcm}
+\mm at operator{\lb}{lb}
+\mm at operator{\lcm}{lcm}
-\@moperator{\rank}{rank}
+\mm at operator{\rank}{rank}
\let\oldRe\Re \renewcommand{\Re}{\operatorname{Re}}
-\@mmacro{rot}{\operatorname{\vect{\mathup{rot}}}}
-\@moperator{\sgn}{sgn}
-\@moperator{\sinc}{sinc}
-\@moperator[spa]{\spa}{span}
-\@moperator{\tr}{tr}
-\@moperator{\var}{var}
-\@moperator{\Var}{Var}
-\@moperator[Zu]{\Zu}{Z}
+\mm at macro{rot}{\operatorname{\vect{\mathup{rot}}}}
+\mm at operator{\sgn}{sgn}
+\mm at operator{\sinc}{sinc}
+\mm at operator[spa]{\spa}{span}
+\mm at operator{\tr}{tr}
+\mm at operator{\var}{var}
+\mm at operator{\Var}{Var}
+\mm at operator[Zu]{\Zu}{Z}
-\@moperator{\arccot}{arccot}
-\@moperator{\sech}{sech}
-\@moperator{\csch}{csch}
-\@moperator{\arsinh}{arsinh}
-\@moperator{\arcosh}{arcosh}
-\@moperator{\artanh}{artanh}
-\@moperator{\arcoth}{arcoth}
-\@moperator{\arsech}{arsech}
-\@moperator{\arcsch}{arcsch}
+\mm at operator{\arccot}{arccot}
+\mm at operator{\sech}{sech}
+\mm at operator{\csch}{csch}
+\mm at operator{\arsinh}{arsinh}
+\mm at operator{\arcosh}{arcosh}
+\mm at operator{\artanh}{artanh}
+\mm at operator{\arcoth}{arcoth}
+\mm at operator{\arsech}{arsech}
+\mm at operator{\arcsch}{arcsch}
-\@moperator[bigO]{\bigO}{\mathcal{O}}
-\@moperator[bigo]{\bigo}{O}
-\@moperator[lito]{\lito}{o}
+\mm at operator[bigO]{\bigO}{\mathcal{O}}
+\mm at operator[bigo]{\bigo}{O}
+\mm at operator[lito]{\lito}{o}
-\@mmacro{mathset}{\mathbf}
-\@mmacro{R}{\ensuremath{\mathset{R}}\xspace}
-\@mmacro{C}{\ensuremath{\mathset{C}}\xspace}
-\@mmacro{N}{\ensuremath{\mathset{N}}\xspace}
-\@mmacro{Z}{\ensuremath{\mathset{Z}}\xspace}
-\@mmacro{Q}{\ensuremath{\mathset{Q}}\xspace}
-\@mmacro{F}{\ensuremath{\mathset{F}}\xspace}
-\@mmacro{K}{\ensuremath{\mathset{K}}\xspace}
+\mm at macro{mathset}{\mathbf}
+\mm at macro{R}{\ensuremath{\mathset{R}}\xspace}
+\mm at macro{C}{\ensuremath{\mathset{C}}\xspace}
+\mm at macro{N}{\ensuremath{\mathset{N}}\xspace}
+\mm at macro{Z}{\ensuremath{\mathset{Z}}\xspace}
+\mm at macro{Q}{\ensuremath{\mathset{Q}}\xspace}
+\mm at macro{F}{\ensuremath{\mathset{F}}\xspace}
+\mm at macro{K}{\ensuremath{\mathset{K}}\xspace}
-\@mmacro{ds}{\displaystyle}
-\@mmacro{dlim}{\lim\limits}
-\@mmacro{dsum}{\sum\limits}
-\@mmacro{dprod}{\prod\limits}
-\@mmacro{dcup}{\bigcup\limits}
-\@mmacro{dcap}{\bigcap\limits}
+\mm at macro{ds}{\displaystyle}
+\mm at macro{dlim}{\lim\limits}
+\mm at macro{dsum}{\sum\limits}
+\mm at macro{dprod}{\prod\limits}
+\mm at macro{dcup}{\bigcup\limits}
+\mm at macro{dcap}{\bigcap\limits}
-\@mmacro{lbar}{\overline}
+\mm at macro{lbar}{\overline}
\@ifundefined{hlbar}{
\providecommand*{\hlbar}[1]{\overline{\vphantom{t}#1}}}{
- \@mwarning{hlbar} }
+ \mm at warning{hlbar} }
\newcommand\@eqdef{\stackrel{\mathup{def}}{=}}
\newcommand\@@eqdef{\stackrel{\Delta}{=}}
-\@mmacro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}}
-\@mmacro{unbr}{\underbrace}
-\@mmacro{iif}{if and only if\xspace}
+\mm at macro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}}
+\mm at macro{unbr}{\underbrace}
+\mm at macro{iif}{if and only if\xspace}
-\@mmacro{then}{\ \Longrightarrow \ \mbox{} }
% \end{macrocode}
-% Without |\mbox{}|, space produced by |\| would be suppressed in tables.
+% Without |\mbox{}|, space produced by |\| in macro |\then| would be suppressed in tables.
% \medskip
% \begin{macrocode}
+\mm at macro{then}{\ \Longrightarrow \ \mbox{} }
\@ifundefined{txt}{
\providecommand*{\txt}[1]{\quad\text{#1}\quad} }{
- \@mwarning{txt} }
-\@mmacro{mul}{\mathord{\times}}
-\providecommand\paren{\PackageWarning{mismath}{Command
- \bslash paren is no longer supported}}
+ \mm at warning{txt} }
+\mm at macro{mul}{\mathord{\times}}
\@ifundefined{pow}{
\providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{
- \@mwarning{pow} }
+ \mm at warning{pow} }
\@ifundefined{abs}{
\providecommand*{\abs}[1]{\left\vert#1\right\vert} }{
- \@mwarning{abs} }
+ \mm at warning{abs} }
\@ifundefined{lfrac}{
\providecommand*{\lfrac}[2]{\frac{\;#1\;}{\;#2\;}} }{
- \@mwarning{lfrac} }
+ \mm at warning{lfrac} }
\newcommand{\systemstretch}{1.2}
\newcommand{\systemsep}{\medspace}
@@ -1343,10 +1423,6 @@
% I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee
% on Terminology, Nomenclature and Symbols), dec 1999,
% \url{https://old.iupac.org/standing/idcns/italic-roman_dec99.pdf}.
-% \bibitem{KVO} \emph{The \textsf{kvoptions} package}, Heiko Oberdiek, CTAN,
-% v3.13 2019/11/29.
-% \bibitem{KV} \emph{The \textsf{keyval} package}, David Carlisle, CTAN,
-% v1.15 2014/10/28.
% \bibitem{VECT} \emph{\textsf{esvect} -- Typesetting vectors with beautiful
% arrow with \LaTeXe}, Eddie Saudrais, CTAN, v1.3 2013/07/11.
% \bibitem{AMS} \emph{\textsf{amsmath} -- \AmS\ mathmatical facilities for \LaTeX},
Modified: branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.ins
===================================================================
--- branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.ins 2023-02-19 21:06:05 UTC (rev 65940)
+++ branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.ins 2023-02-19 21:06:25 UTC (rev 65941)
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2019-2022 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+%% Copyright (C) 2019-2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -21,7 +21,7 @@
This is a generated file.
-Copyright (C) 2019-2022 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+Copyright (C) 2019-2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
Modified: branches/branch2022.final/Master/texmf-dist/tex/latex/mismath/mismath.sty
===================================================================
--- branches/branch2022.final/Master/texmf-dist/tex/latex/mismath/mismath.sty 2023-02-19 21:06:05 UTC (rev 65940)
+++ branches/branch2022.final/Master/texmf-dist/tex/latex/mismath/mismath.sty 2023-02-19 21:06:25 UTC (rev 65941)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2019-2022 by Antoine Missier <antoine.missier at ac-toulouse.fr>
+%% Copyright (C) 2019-2023 by Antoine Missier <antoine.missier at ac-toulouse.fr>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,143 +22,195 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{mismath}
- [2023/02/10 v2.3 .dtx mismath file]
-\RequirePackage{kvoptions}
-\DeclareBoolOption[false]{enumber}
-\DeclareBoolOption[false]{inumber}
-\DeclareBoolOption[false]{jnumber}
-\DeclareStringOption{pinumber}
-\DeclareBoolOption[true]{arrowvect}
-\DeclareComplementaryOption{boldvect}{arrowvect}
-\DeclareBoolOption[false]{PEupright}
-\DeclareBoolOption[false]{ibrackets}
-\DeclareDefaultOption{%
- \ifx\CurrentOptionValue\relax
- \PackageWarningNoLine{\@currname}{%
- Unknown option `\CurrentOption’\MessageBreak
- is passed to package `amsmath’}%
- % Pass the option to package amsmath.
- % Again it is better to expand \CurrentOption.
- \expandafter\PassOptionsToPackage
- \expandafter{\CurrentOption}{amsmath}%
- \else
- % Package amsmath does not take options with values.
- % We provide the standard LaTeX error.
- \@unknownoptionerror
- \fi }
-
-\ProcessKeyvalOptions*
-
+ [2023/02/19 v2.4 .dtx mismath file]
+\newif\ifmm at ibrackets % initialized to false
+\DeclareOption{ibrackets}{\mm at ibracketstrue}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}
+\ProcessOptions \relax
\@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}}
\@ifpackageloaded{mathtools}{}{\RequirePackage{mathtools}}
\@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}}
+\RequirePackage{ifthen}
\RequirePackage{xspace}
+\RequirePackage{iftex}
+\ifmm at ibrackets\RequirePackage{ibrackets}\fi
{\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % \bslash command
-\def\mismathset#1{\setkeys{mismath}{#1}}
+\newcommand\mm at warning[1]{
+ \PackageWarningNoLine{mismath}{
+ Command \bslash #1 already exist and will not be redefined}
+}
+\newcommand\mm at macro[2]{
+ \@ifundefined{#1}{
+ \expandafter\def\csname #1\endcsname{#2}
+ }{\\mm at warning{#1}}
+}
+\newcommand\mm at operator[3][]{%
+ \ifthenelse{\equal{#1}{}}{\def\tempa{#3}}{\def\tempa{#1}}
+ \@ifundefined{\tempa}{
+ \DeclareMathOperator{#2}{#3}
+ }{\mm at warning{\tempa}}
+}
-\AtBeginDocument{
- \ifmismath at enumber
- \DeclareMathSymbol{e}\mathalpha{operators}{`e} \fi
- \ifmismath at inumber
- \DeclareMathSymbol{i}\mathalpha{operators}{`i}\fi
- \ifmismath at jnumber
- \DeclareMathSymbol{j}\mathalpha{operators}{`j}\fi
- \ifthenelse{\equal{\mismath at pinumber}{}}{}{% else
- \@ifundefined{itpi}{\let\itpi\pi}{\@mwarning{itpi}}
- \ifthenelse{\equal{\mismath at pinumber}{*}}{
- \RequirePackage[LGR,T1]{fontenc}
- \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
- \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
- }{% else
- \@ifundefined{\mismath at pinumber}{
- \PackageWarningNoLine{mismath}{%
- Value \mismath at pinumber\space must be a valid
- command name\MessageBreak for pinumber option,
- but command \bslash \mismath at pinumber\space
- is undefined.\MessageBreak
- Perhaps a missing package}
- }{\renewcommand{\pi}{%
- \csname\mismath at pinumber\endcsname}
- }
- }}
- \ifmismath at PEupright
- \DeclareMathSymbol{P}\mathalpha{operators}{`P}
- \DeclareMathSymbol{E}\mathalpha{operators}{`E} \fi
- \ifmismath at ibrackets \RequirePackage{ibrackets} \fi
+\providecommand{\mathup}[1]{{\operatorfont #1}} % also in kpfonts
+\mm at macro{e}{\mathup{e}}
+\AtBeginDocument{\let\oldi\i \let\oldj\j
+ \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
+ \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} }
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{enumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{inumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{jnumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{pinumber}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{PEupright}
- \DisableKeyvalOption[action=warning,package=mismath]{mismath}{ibrackets}
+\newcount\mm at charcode
+\newcount\mm at charclass
+\newcount\mm at charslot
+
+\newcommand\@MathUp[1]{%
+ \ifluatex
+ \mm at charclass=\Umathcharclass`#1
+ %\mm at charfam=\Umathcharfam`#1
+ \mm at charslot=\Umathcharslot`#1
+ \Umathcode`#1= \mm at charclass 0 \mm at charslot
+ \else
+ \mm at charcode=\mathcode`#1
+ % extract charclass
+ \@tempcnta=\mm at charcode
+ \divide\@tempcnta by "1000
+ \multiply\@tempcnta by "1000 % charclass
+ \mm at charclass=\@tempcnta
+ % extract charslot
+ \@tempcnta=\mm at charcode
+ \@tempcntb=\mm at charcode
+ \divide\@tempcnta by "100
+ \multiply\@tempcnta by "100 % charclass + charfam
+ \advance\@tempcntb by -\@tempcnta % charslot
+ \mm at charslot=\@tempcntb
+ % construct charcode
+ \mm at charcode=\mm at charclass
+ \advance\mm at charcode by \mm at charslot % charfam is now 0
+ \mathcode`#1=\mm at charcode
+ \fi
}
+\newcommand\MathUp[1]{%
+ \ifx\@onlypreamble\@notprerr
+ \@MathUp{#1}
+ \else % in the preamble
+ \AtBeginDocument{\@MathUp{#1}}
+ \fi
+}
+
+\newcommand\MathIt[1]{%
+ \ifluatex
+ \mm at charclass=\Umathcharclass`#1
+ %\mm at charfam=\Umathcharfam`#1
+ \mm at charslot=\Umathcharslot`#1
+ \Umathcode`#1= \mm at charclass 1 \mm at charslot
+ \else
+ \mm at charcode=\mathcode`#1
+ % extract charclass
+ \@tempcnta=\mm at charcode
+ \divide\@tempcnta by "1000
+ \multiply\@tempcnta by "1000 % charclass
+ \mm at charclass=\@tempcnta
+ % extract charslot
+ \@tempcnta=\mm at charcode
+ \@tempcntb=\mm at charcode
+ \divide\@tempcnta by "100
+ \multiply\@tempcnta by "100 % charclass + charfam
+ \advance\@tempcntb by -\@tempcnta % charslot
+ \mm at charslot=\@tempcntb
+ % construct charcode
+ \mm at charcode=\mm at charclass
+ \advance\mm at charcode by \mm at charslot
+ \advance\mm at charcode by "100 % sets charfam to 1
+ \mathcode`#1=\mm at charcode
+ \fi
+}
+
+\newcommand*\MathNumbers[1]{%
+ \in@{e}{#1} \ifin@ \MathUp{e} \fi
+ \in@{i}{#1} \ifin@ \MathUp{i} \fi
+ \in@{j}{#1} \ifin@ \MathUp{j} \fi
+}
+
+\newcommand*\MathProba[1]{%
+ \in@{P}{#1} \ifin@ \MathUp{P} \fi
+ \in@{E}{#1} \ifin@ \MathUp{E} \fi
+ \in@{V}{#1} \ifin@ \MathUp{V} \fi
+}
+
+\newcommand*\MathNormal[1]{
+ \in@{e}{#1} \ifin@ \MathIt{e} \fi
+ \in@{i}{#1} \ifin@ \MathIt{i} \fi
+ \in@{j}{#1} \ifin@ \MathIt{j} \fi
+ \in@{P}{#1} \ifin@ \MathIt{P} \fi
+ \in@{E}{#1} \ifin@ \MathIt{E} \fi
+ \in@{V}{#1} \ifin@ \MathIt{V} \fi
+}
+
\newcommand{\enumber}{%
\PackageWarning{mismath}{Command \string\enumber\space
is deprecated, \MessageBreak
- use `enumber' as package option instead}
- \mismath at enumbertrue
+ use \bslash MathUp{e} instead}
+ \MathUp{e}
}
\newcommand{\inumber}{%
\PackageWarning{mismath}{Command \string\inumber\space
is deprecated, \MessageBreak
- use `inumber' as package option instead}
- \mismath at inumbertrue
+ use \bslash MathUp{i} instead}
+ \MathUp{i}
}
\newcommand{\jnumber}{
\PackageWarning{mismath}{Command \string\jnumber\space
is deprecated, \MessageBreak
- use `jnumber' as package option instead}
- \mismath at jnumbertrue
+ use \bslash MathUp{j} instead}
+ \MathUp{j}
}
-\newcommand*{\pinumber}[1][*]{
- \PackageWarning{mismath}{Command \string\pinumber\space
- is deprecated,
- use `pinumber=#1'\MessageBreak as package option instead}
- \def\mismath at pinumber{#1}
-}
\newcommand{\PEupright}{
\PackageWarning{mismath}{Command \string\PEupright\space
is deprecated, \MessageBreak
- use `PEupright' as package option instead}
- \mismath at PEuprighttrue
+ use \bslash MathUp{P} and \bslash MathUp{R} instead}
+ \MathUp{P}\MathUp{E}
}
-\newcommand\@mwarning[1]{
- \PackageWarningNoLine{mismath}{
- Command \bslash #1 already exist and will not be redefined}
-}
-\newcommand\@mmacro[2]{
- \@ifundefined{#1}{
- \expandafter\def\csname #1\endcsname{#2}
- }{\@mwarning{#1}}
-}
-\newcommand\@moperator[3][]{% this macro is ugly, by default #1=#3
+\newcommand*\pinumber[1][]{
+ \@ifundefined{itpi}{\let\itpi\pi}{}
\ifthenelse{\equal{#1}{}}{
- \@ifundefined{#3}{
- \DeclareMathOperator{#2}{#3}
- }{\@mwarning{#3}}
+ \ifx\@onlypreamble\@notprerr
+ \@ifundefined{savedpi}{
+ \PackageWarning{mismath}{%
+ \bslash pinumber without argument\MessageBreak
+ must be used in the preamble first\MessageBreak
+ to load LGR fontenc for upright pi}
+ }{\let\pi\savedpi}
+ \else % in the preamble
+ \RequirePackage[LGR,T1]{fontenc}
+ \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
+ \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
+ \let\savedpi\pi
+ \fi
}{
\@ifundefined{#1}{
- \DeclareMathOperator{#2}{#3}
- }{\@mwarning{#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}
+ }
}
}
-\providecommand{\mathup}[1]{{\operatorfont #1}} % also in kpfonts
-\@mmacro{e}{\mathup{e}}
-\AtBeginDocument{\let\oldi\i \let\oldj\j
- \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}}
- \renewcommand{\j}{\TextOrMath{\oldj}{\mathup{j}}} }
+\newcommand{\pinormal}{\@ifundefined{itpi}{}{\let\pi\itpi}}
-\newcommand{\arrowvect}{\mismath at arrowvecttrue}
-\newcommand{\boldvect}{\mismath at arrowvectfalse}
+\newboolean{arrowvect}
+\setboolean{arrowvect}{true}
+\newcommand{\arrowvect}{\setboolean{arrowvect}{true}}
+\newcommand{\boldvect}{\setboolean{arrowvect}{false}}
\newcommand{\boldvectcommand}{\boldsymbol} % from amsbsy package
-\@mmacro{vect}{\ifthenelse{\boolean{mismath at arrowvect}}{
- \vv}{\boldvectcommand}} %\if \fi doesn't work well here
+\mm at macro{vect}{\ifthenelse{\boolean{arrowvect}}{
+ \vv}{\boldvectcommand}} % doesn't work well with \if... \fi
\newcommand*{\hvect}[1]{\vect{\vphantom{t}#1}}
\newcommand*{\hvec}[1]{\vec{\vphantom{t}#1}}
@@ -174,101 +226,99 @@
\@ifundefined{norm}{\providecommand*{\norm}[1]{
\mathchoice{\@norm{#1}}{\@norm{#1}}{\@@norm{#1}}{\@@@norm{#1}}
}
- }{\@mwarning{norm} } % bad result with libertinust1math
+ }{\mm at warning{norm} } % bad result with libertinust1math
-\@mmacro{di}{\mathop{}\!\mathup{d}}
+\mm at macro{di}{\mathop{}\!\mathup{d}}
\newcommand\probastyle{}
\let\Par\P % end of paragraph symbol
\renewcommand{\P}{\operatorname{\probastyle{P}}}
-\@mmacro{E}{\operatorname{\probastyle{E}}}
-\@mmacro{V}{\operatorname{\probastyle{V}}}
+\mm at macro{E}{\operatorname{\probastyle{E}}}
+\mm at macro{V}{\operatorname{\probastyle{V}}}
-\@moperator{\adj}{adj}
-\@moperator{\Aut}{Aut}
-\@moperator{\codim}{codim}
-\@moperator{\Conv}{Conv}
-\@moperator{\cov}{cov}
-\@moperator{\Cov}{Cov}
-\@mmacro{curl}{\operatorname{\vect{\mathup{curl}}}}
-\@moperator[divg]{\divg}{div}
-\@moperator{\End}{End}
+\mm at operator{\adj}{adj}
+\mm at operator{\Aut}{Aut}
+\mm at operator{\codim}{codim}
+\mm at operator{\Conv}{Conv}
+\mm at operator{\cov}{cov}
+\mm at operator{\Cov}{Cov}
+\mm at macro{curl}{\operatorname{\vect{\mathup{curl}}}}
+\mm at operator[divg]{\divg}{div}
+\mm at operator{\End}{End}
-\@moperator{\erf}{erf}
-\@mmacro{grad}{\operatorname{\vect{\mathup{grad}}}}
-\@moperator{\id}{id} % mathop or mathord ?
-\@moperator{\Id}{Id}
-\@moperator{\im}{im}
+\mm at operator{\erf}{erf}
+\mm at macro{grad}{\operatorname{\vect{\mathup{grad}}}}
+\mm at operator{\id}{id} % mathop or mathord ?
+\mm at operator{\Id}{Id}
+\mm at operator{\im}{im}
\let\oldIm\Im \renewcommand{\Im}{\operatorname{Im}}
-\@moperator{\lb}{lb}
-\@moperator{\lcm}{lcm}
+\mm at operator{\lb}{lb}
+\mm at operator{\lcm}{lcm}
-\@moperator{\rank}{rank}
+\mm at operator{\rank}{rank}
\let\oldRe\Re \renewcommand{\Re}{\operatorname{Re}}
-\@mmacro{rot}{\operatorname{\vect{\mathup{rot}}}}
-\@moperator{\sgn}{sgn}
-\@moperator{\sinc}{sinc}
-\@moperator[spa]{\spa}{span}
-\@moperator{\tr}{tr}
-\@moperator{\var}{var}
-\@moperator{\Var}{Var}
-\@moperator[Zu]{\Zu}{Z}
+\mm at macro{rot}{\operatorname{\vect{\mathup{rot}}}}
+\mm at operator{\sgn}{sgn}
+\mm at operator{\sinc}{sinc}
+\mm at operator[spa]{\spa}{span}
+\mm at operator{\tr}{tr}
+\mm at operator{\var}{var}
+\mm at operator{\Var}{Var}
+\mm at operator[Zu]{\Zu}{Z}
-\@moperator{\arccot}{arccot}
-\@moperator{\sech}{sech}
-\@moperator{\csch}{csch}
-\@moperator{\arsinh}{arsinh}
-\@moperator{\arcosh}{arcosh}
-\@moperator{\artanh}{artanh}
-\@moperator{\arcoth}{arcoth}
-\@moperator{\arsech}{arsech}
-\@moperator{\arcsch}{arcsch}
+\mm at operator{\arccot}{arccot}
+\mm at operator{\sech}{sech}
+\mm at operator{\csch}{csch}
+\mm at operator{\arsinh}{arsinh}
+\mm at operator{\arcosh}{arcosh}
+\mm at operator{\artanh}{artanh}
+\mm at operator{\arcoth}{arcoth}
+\mm at operator{\arsech}{arsech}
+\mm at operator{\arcsch}{arcsch}
-\@moperator[bigO]{\bigO}{\mathcal{O}}
-\@moperator[bigo]{\bigo}{O}
-\@moperator[lito]{\lito}{o}
+\mm at operator[bigO]{\bigO}{\mathcal{O}}
+\mm at operator[bigo]{\bigo}{O}
+\mm at operator[lito]{\lito}{o}
-\@mmacro{mathset}{\mathbf}
-\@mmacro{R}{\ensuremath{\mathset{R}}\xspace}
-\@mmacro{C}{\ensuremath{\mathset{C}}\xspace}
-\@mmacro{N}{\ensuremath{\mathset{N}}\xspace}
-\@mmacro{Z}{\ensuremath{\mathset{Z}}\xspace}
-\@mmacro{Q}{\ensuremath{\mathset{Q}}\xspace}
-\@mmacro{F}{\ensuremath{\mathset{F}}\xspace}
-\@mmacro{K}{\ensuremath{\mathset{K}}\xspace}
+\mm at macro{mathset}{\mathbf}
+\mm at macro{R}{\ensuremath{\mathset{R}}\xspace}
+\mm at macro{C}{\ensuremath{\mathset{C}}\xspace}
+\mm at macro{N}{\ensuremath{\mathset{N}}\xspace}
+\mm at macro{Z}{\ensuremath{\mathset{Z}}\xspace}
+\mm at macro{Q}{\ensuremath{\mathset{Q}}\xspace}
+\mm at macro{F}{\ensuremath{\mathset{F}}\xspace}
+\mm at macro{K}{\ensuremath{\mathset{K}}\xspace}
-\@mmacro{ds}{\displaystyle}
-\@mmacro{dlim}{\lim\limits}
-\@mmacro{dsum}{\sum\limits}
-\@mmacro{dprod}{\prod\limits}
-\@mmacro{dcup}{\bigcup\limits}
-\@mmacro{dcap}{\bigcap\limits}
+\mm at macro{ds}{\displaystyle}
+\mm at macro{dlim}{\lim\limits}
+\mm at macro{dsum}{\sum\limits}
+\mm at macro{dprod}{\prod\limits}
+\mm at macro{dcup}{\bigcup\limits}
+\mm at macro{dcap}{\bigcap\limits}
-\@mmacro{lbar}{\overline}
+\mm at macro{lbar}{\overline}
\@ifundefined{hlbar}{
\providecommand*{\hlbar}[1]{\overline{\vphantom{t}#1}}}{
- \@mwarning{hlbar} }
+ \mm at warning{hlbar} }
\newcommand\@eqdef{\stackrel{\mathup{def}}{=}}
\newcommand\@@eqdef{\stackrel{\Delta}{=}}
-\@mmacro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}}
-\@mmacro{unbr}{\underbrace}
-\@mmacro{iif}{if and only if\xspace}
+\mm at macro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}}
+\mm at macro{unbr}{\underbrace}
+\mm at macro{iif}{if and only if\xspace}
-\@mmacro{then}{\ \Longrightarrow \ \mbox{} }
+\mm at macro{then}{\ \Longrightarrow \ \mbox{} }
\@ifundefined{txt}{
\providecommand*{\txt}[1]{\quad\text{#1}\quad} }{
- \@mwarning{txt} }
-\@mmacro{mul}{\mathord{\times}}
-\providecommand\paren{\PackageWarning{mismath}{Command
- \bslash paren is no longer supported}}
+ \mm at warning{txt} }
+\mm at macro{mul}{\mathord{\times}}
\@ifundefined{pow}{
\providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{
- \@mwarning{pow} }
+ \mm at warning{pow} }
\@ifundefined{abs}{
\providecommand*{\abs}[1]{\left\vert#1\right\vert} }{
- \@mwarning{abs} }
+ \mm at warning{abs} }
\@ifundefined{lfrac}{
\providecommand*{\lfrac}[2]{\frac{\;#1\;}{\;#2\;}} }{
- \@mwarning{lfrac} }
+ \mm at warning{lfrac} }
\newcommand{\systemstretch}{1.2}
\newcommand{\systemsep}{\medspace}
More information about the tex-live-commits
mailing list.