texlive[66133] branches/branch2022.final/Master/texmf-dist: mismath

commits+karl at tug.org commits+karl at tug.org
Fri Feb 24 22:34:48 CET 2023


Revision: 66133
          http://tug.org/svn/texlive?view=revision&revision=66133
Author:   karl
Date:     2023-02-24 22:34:48 +0100 (Fri, 24 Feb 2023)
Log Message:
-----------
mismath (24feb23) (branch)

Modified Paths:
--------------
    branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/README.md
    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/tex/latex/mismath/mismath.sty

Modified: branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/README.md
===================================================================
--- branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/README.md	2023-02-24 21:34:32 UTC (rev 66132)
+++ branches/branch2022.final/Master/texmf-dist/doc/latex/mismath/README.md	2023-02-24 21:34:48 UTC (rev 66133)
@@ -6,6 +6,7 @@
 The package provides some mathematical macros to typeset:
 - mathematical constants e, i, pi in upright shape (automatically) as recommended by ISO 80000-2,
 - vectors with beautiful arrow and adjusted norm,
+- tensors,
 - some standard operator names,
 - improved spacings in mathematical formulas,
 - systems of equations and small matrices,

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-24 21:34:32 UTC (rev 66132)
+++ branches/branch2022.final/Master/texmf-dist/source/latex/mismath/mismath.dtx	2023-02-24 21:34:48 UTC (rev 66133)
@@ -20,7 +20,7 @@
 %<*package> 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{mismath}   
-    [2023/02/19 v2.4 .dtx mismath file]
+    [2023/02/24 v2.5 .dtx mismath file]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -32,7 +32,7 @@
 \usepackage[ibrackets]{mismath}
 %\usepackage{amssymb} incompatible with mathdesign
 \usepackage{multicol}
-\usepackage[Euler]{upgreek}
+\usepackage[Symbol]{upgreek}
 \usepackage{sectsty}
 \usepackage{xcolor}
 \usepackage{spacingtricks}
@@ -43,7 +43,7 @@
 \definecolor{darkbrown}{rgb}{0.5,0.1,0.1}
 \allsectionsfont{\color{darkbrown}}
 \MathUp{i} \pinumber[piup]
-% enumber=false because I need italicized e in vectors section
+% I need italicized e in vectors section
 % For using in this doc only:
 \usepackage[LGR,T1]{fontenc}
 \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
@@ -71,7 +71,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{660}
+% \CheckSum{634}
 %
 % \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
@@ -92,90 +92,96 @@
 % \changes{v0.1}{2011/12/27}{First personal version}
 %
 % \changes{v1.0}{2019/04/11}{
-%     - Initial published version: creating dtx and ins files}
+%    - Initial published version: creating dtx and ins files}
 %
 % \changes{v1.1}{2019/04/20}{
-%     - Some forgotten french 'et' -> 'and', citecolor=blue,
-%     - changing the default font for pinumber Euler -> Symbol}
+%    - Some forgotten french 'et' -> 'and', citecolor=blue,
+%    - changing the default font for pinumber Euler -> Symbol}
 %
 % \changes{v1.2}{2019/04/26}{
-%     - Works fine with beamer now, 
-%     - AtBeginDocument for enumber, inumber, jnumber, 
-%     - creating general mm at operator macro, 
-%     - using mathup instead of mathrm}
+%    - Works fine with beamer now, 
+%    - AtBeginDocument for enumber, inumber, jnumber, 
+%    - 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, 
-%     - replacing the PEroman macro by PEupright}
+%    - Added mathtools package, 
+%    - font definition Roman -> up, 
+%    - changes in documentation, 
+%    - replacing the PEroman macro by PEupright}
 %
 % \changes{v1.3}{2019/05/05}{
-%     - Using bslash in the internal mm at warning macro, 
-%     - loading of mathfixs package}
+%    - Using bslash in the internal mm at warning macro, 
+%    - loading of mathfixs package}
 % \changes{v1.3}{2019/05/08}{
-%     - Many corrections in documentation}
+%    - Many corrections in documentation}
 %
 % \changes{v1.4}{2019/05/22}{
-%     - Changing font definition up -> UpSh, due to incompatibility with unicode-math}
+%    - Changing font definition up -> UpSh, due to incompatibility with unicode-math}
 %
 % \changes{v1.5}{2019/05/30}{
-%     - A solution for using mul with frac -> braces, 
-%     - addition of paren macro}
+%    - A solution for using mul with frac -> braces, 
+%    - addition of paren macro}
 % \changes{v1.5}{2019/06/22}{
-%     - Small corrections in documentation}
+%    - Small corrections in documentation}
 %
 % \changes{v1.6}{2019/09/06}{
-%     - Removing mathfixs package, problems with fractions}
+%    - Removing mathfixs package, problems with fractions}
 %
 % \changes{v1.7}{2019/12/27}{
-%     - Adding a table of contents to the documentation}
+%    - Adding a table of contents to the documentation}
 %
 % \changes{v1.8}{2020/11/15}{
-%     - Incompatibility mentioned when using `i' with accent in beamer titles -> use \^i, 
-%     - small changes in documentation}
+%    - Incompatibility mentioned when using `i' with accent in beamer titles -> use \^i, 
+%    - small changes in documentation}
 %
 % \changes{v1.9}{2020/10/17}{
-%     - UpSh replaced by "operators" font in math mode, 
-%     - PackageWarning `command exist' replaced by PackageWarningNoLine,
-%     - medspace replaced by thickspace in the lfrac command,
-%     - changing font in documentation, lmodern -> Palatino (mathpazo)}
+%    - UpSh replaced by "operators" font in math mode, 
+%    - PackageWarning `command exist' replaced by PackageWarningNoLine,
+%    - medspace replaced by thickspace in the lfrac command,
+%    - changing font in documentation, lmodern -> Palatino (mathpazo)}
 %
 % \changes{v1.10}{2020/10/25}{\
-%     - pinumber command code adapted to avoid incompatibility with the new frenchmath, 
-%     - default option (in upgreek) changed from Symbol to Euler.}
+%    - pinumber command code adapted to avoid incompatibility with the new frenchmath, 
+%    - default option (in upgreek) changed from Symbol to Euler.}
 %
 % \changes{v2.0}{2022/11/11}{
-%     - pinumber command has been improved to use other Greek letter packages,
-%         (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 (with the package mathdesign)}
+%    - pinumber command has been improved to use other Greek letter packages,
+%        (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 (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,
-%     - several changes in documentation}
+%    - 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,
+%    - several changes in documentation}
 %
 % \changes{v2.2}{2023/01/06}{
-%      - Loading of ibrackets package is now optional, due to an error
-%         when using DeclarePairedDelimiter with square brackets.}
+%    - Loading of ibrackets package is now optional, due to an error
+%        when using DeclarePairedDelimiter with square brackets.}
 %
 % \changes{v2.3}{2023/02/06}{
-%      - Introducing keyval options for enumber, inumber, jnumber, PEupright
-%          (corresponding old commands are maintained for now),
-%      - and also for ibrackets, boldvect and arrowvect}
+%    - Introducing keyval options for enumber, inumber, jnumber, PEupright
+%        (corresponding old commands are maintained for now),
+%    - and also for ibrackets, boldvect and arrowvect}
 % \changes{v2.3}{2023/02/09}{
-%     - Documentation update}
+%    - 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}
+%    - 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}
 %
+% \changes{v2.5}{2023/02/23}{
+%    - Unification of the code of MathUp and MathIt,
+%    - a powerful macro `apply' is used in MathNormal to act on a list,
+%    - a new `tensor' command,
+%    - small changes in the documentation}
+%
 % \GetFileInfo{mismath.sty}
 %
 % \title{\textsf{mismath}\\ Miscellaneous mathematical macros\thanks{This document
@@ -182,7 +188,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 19, 2023}
+% \date{February 24, 2023}
 %
 % \maketitle
 % \tableofcontents
@@ -210,6 +216,7 @@
 % \smallskip
 % The package also provides other macros for:
 % \begin{itemize}
+% \item tensors,
 % \item some standard operator names,
 % \item a few useful aliases,
 % \item improving some spacing in mathematical formulas,
@@ -284,7 +291,7 @@
 % 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
+% The new definition of |\i| and |\j| concerns only the mathematical mode.
 %
 % \medskip
 % \DescribeMacro{\MathUp} 
@@ -309,17 +316,19 @@
 % 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},
+% 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
+% 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}|.
-% 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}).
+% 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.
 % 
 % \medskip
 % \DescribeMacro{\pinumber[\meta{command}]}
@@ -365,7 +374,7 @@
 % \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$
-% and it has also a \texttt{Symbol} option (using Adobe Symbol font) 
+% (with the \texttt{Symbol} option using Adobe Symbol font) 
 % that fits well with several text fonts, for instance Times.}.
 %
 % \medskip
@@ -377,7 +386,7 @@
 % In fact |\pinumber| acts as a switch and there is also an inverse switch, 
 % |\pinormal|, that can be called anywhere.
 %
-% \subsection{Vectors}
+% \subsection{Vectors (and tensors)}
 %
 % \DescribeMacro{\vect}
 % By default, the |\vect| command
@@ -422,15 +431,14 @@
 % 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
-% \texttt{\bslash bm} from \textsf{bm} package or |\mathbold| from \textsf{fixmath}
-% package or |\mathbfit| from \textsf{isomath}.
-% For that, redefine |\boldvectcommand|, for instance: 
+% |\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}: 
 % \begin{center} |\renewcommand\boldvectcommand{\mathbold}|. \end{center}
 %
-% By setting |\boldvectcommand| to |\mathbf|, |\vect| produces vectors 
-% in bold \emph{upright} shape, 
-% which tends to be used instead of bold \emph{italic},
-% but this is \emph{not} recommended.
+% According to ISO rules, symbols for matrices are also in bold italic,
+% so you can use the same |\boldvectcommand| or create another alias.
 %
 % \medskip
 % \DescribeMacro{\arrowvect}
@@ -476,6 +484,16 @@
 % but however to context: main text, subscripts or exponents, 
 % \eg $\e^{\norm{\vec{h}}}$.
 %
+% \medskip
+% \DescribeMacro{\mathbfsfit}\DescribeMacro{\tensor}
+% For tensors symbols, ISO rules recommend to use
+% 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), 
+% and provides the macro |\mathbfsfit| or its alias |\tensor|.
+% So |\tensor{T}| produces $\tensor{T}$.
+%
 % \subsection{Standard operator names}\label{operators}
 %
 % \DescribeMacro{\di}
@@ -523,14 +541,12 @@
 % 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).
+% |\MathIt| for any individual letter or |\MathNormal| for a list.
 %
 % \medskip
 % \DescribeMacro{\probastyle}
@@ -597,7 +613,6 @@
 % \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: 
@@ -792,7 +807,7 @@
 % 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 redefine brackets in the \textsf{ibrackets} package~\cite{BRACKET} 
+% We have redefined 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 
@@ -922,6 +937,10 @@
 % Compare previous $\vec{u}\begin{spmatrix}-1\\2\end{spmatrix}$
 % with $\vec{u}\begin{psmallmatrix}-1\\2\end{psmallmatrix}$.
 %
+% \medskip
+% For typesetting  various kind of matrices, let's mention the awesome 
+% \textsf{nicematrix} package by François Pantigny~\cite{NMATX}.
+%
 % \subsection{Displaymath in double columns}
 %
 % \DescribeEnv{mathcols}
@@ -969,10 +988,6 @@
 % Therefore they are replaced by the more powerful and more general 
 % macro |\MathUp| which can be placed anywhere and has an inverse switch |\MathIt|. 
 %
-% \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}{ll}
@@ -990,10 +1005,13 @@
 % \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 |\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.
 %
 % \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.
 %
 % \StopEventually{}
@@ -1082,21 +1100,22 @@
 %
 % 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}|.
+% In the preamble, |\math at family{#1}{0}| is equivalent to \\
+% |\DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}|.
 % \medskip
 %    \begin{macrocode}
 \newcount\mm at charcode
 \newcount\mm at charclass
-%\newcount\mm at charfam
+\newcount\mm at charfam
 \newcount\mm at charslot
 
-\newcommand\@MathUp[1]{%
+\newcommand*\math at family[2]{%
+    \mm at charfam=#2
     \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
+        \Umathcode`#1= \mm at charclass \mm at charfam \mm at charslot
     \else
         \mm at charcode=\mathcode`#1
         % extract charclass
@@ -1113,52 +1132,35 @@
         \mm at charslot=\@tempcntb
         % construct charcode
         \mm at charcode=\mm at charclass
-        \advance\mm at charcode by \mm at charslot % charfam is now 0
+        \multiply\mm at charfam by "100
+        \advance\mm at charcode by \mm at charfam
+        \advance\mm at charcode by \mm at charslot
         \mathcode`#1=\mm at charcode
     \fi
 }
 
-\newcommand\MathUp[1]{%
+\newcommand*\MathFamily[2]{%
     \ifx\@onlypreamble\@notprerr
-        \@MathUp{#1}
-    \else % in the preamble
-        \AtBeginDocument{\@MathUp{#1}}
+        \math at family{#1}{#2}
+    \else % before \begin{document}
+        \AtBeginDocument{\math at family{#1}{#2}}
     \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*\MathUp[1]{\MathFamily{#1}{0}}
+\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.
 %
-% 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
+% \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.
+%
 % \medskip
 %    \begin{macrocode}
 \newcommand*\MathNumbers[1]{%
@@ -1173,13 +1175,30 @@
     \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}
+% \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 
+% ``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'.
+%
+% \medskip
+%    \begin{macrocode}
+\def\apply#1#2{\apply@#1#2,\apply@,}
+\def\apply@#1#2,{\ifx\apply@#2\empty
+    \else #1{#2}\afterfi@{\apply@#1}\fi}
+\def\afterfi@#1#2\fi{\fi#1}
+
+\newcommand*\MathNormal[1]{% list argument
+    \apply\MathIt{#1} 
 }
 
 %    \end{macrocode}
@@ -1187,7 +1206,7 @@
 % 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.
+% This is now managed by the more powerful |\MathUp| command.
 % The old commands are maintained for now for compatibility reasons.
 % \medskip
 %
@@ -1221,6 +1240,9 @@
 %
 % The Greek letter pi must be managed in a different way. The switches are called
 % |\pinumber| and |\pinormal|.
+% When given without 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.
 % \medskip
 %    \begin{macrocode}
 \newcommand*\pinumber[1][]{
@@ -1236,6 +1258,7 @@
       \else % in the preamble
         \RequirePackage[LGR,T1]{fontenc}
         \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
+        \let\pi\relax
         \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
         \let\savedpi\pi
       \fi
@@ -1257,7 +1280,7 @@
 
 %    \end{macrocode}
 %
-% And now all the other commands.
+% And now the commands for vectors (and tensors).
 % \medskip
 %    \begin{macrocode}
 \newboolean{arrowvect}
@@ -1285,6 +1308,14 @@
         }
     }{\mm at warning{norm} } % bad result with libertinust1math
 
+\DeclareMathAlphabet{\mathbfsfit}{\encodingdefault}{\sfdefault}{bx}{it}
+\newcommand{\tensor}{\mathbfsfit} % isomath uses \mathsfbfit
+
+%    \end{macrocode}
+%
+% And now all the other commands.
+% \medskip
+%    \begin{macrocode}
 \mm at macro{di}{\mathop{}\!\mathup{d}}
 \newcommand\probastyle{}
 \let\Par\P % end of paragraph symbol
@@ -1409,7 +1440,7 @@
 }   
 %    \end{macrocode}
 % \bigskip
-% \begin{thebibliography}{23}
+% \begin{thebibliography}{24}
 % \begin{raggedright}
 % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according 
 % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), No.~1.
@@ -1452,7 +1483,9 @@
 % \bibitem{SYST} \emph{L'extension pour \TeX\ et \LaTeX\ \textsf{systeme}},
 % Christian Tellechea, CTAN v0.32 2019/01/13.
 % \bibitem{SPAL} \emph{The \textsf{spalign} package}, Joseph Rabinoff, CTAN, 2016/10/05.
-% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}, Antoine Missier, CTAN, v2.4 2023/01/22.
+% \bibitem{NMATX} \emph{The package \textsf{nicematrix}}, François Pantigny, CTAN,
+% v6.14 2023/02/18.
+% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}, Antoine Missier, CTAN, v2.5 2023/02/24.
 % \bibitem{BRACKET} \emph{Intelligent brackets -- The \textsf{ibrackets} package}
 % Antoine Missier, CTAN, v1.1, 2022/12/26.
 % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe}, 

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-24 21:34:32 UTC (rev 66132)
+++ branches/branch2022.final/Master/texmf-dist/tex/latex/mismath/mismath.sty	2023-02-24 21:34:48 UTC (rev 66133)
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2005/12/01]
 \ProvidesPackage{mismath}
-    [2023/02/19 v2.4 .dtx mismath file]
+    [2023/02/24 v2.5 .dtx mismath file]
 \newif\ifmm at ibrackets % initialized to false
 \DeclareOption{ibrackets}{\mm at ibracketstrue}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{amsmath}}
@@ -61,14 +61,16 @@
 
 \newcount\mm at charcode
 \newcount\mm at charclass
+\newcount\mm at charfam
 \newcount\mm at charslot
 
-\newcommand\@MathUp[1]{%
+\newcommand*\math at family[2]{%
+    \mm at charfam=#2
     \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
+        \Umathcode`#1= \mm at charclass \mm at charfam \mm at charslot
     \else
         \mm at charcode=\mathcode`#1
         % extract charclass
@@ -85,46 +87,23 @@
         \mm at charslot=\@tempcntb
         % construct charcode
         \mm at charcode=\mm at charclass
-        \advance\mm at charcode by \mm at charslot % charfam is now 0
+        \multiply\mm at charfam by "100
+        \advance\mm at charcode by \mm at charfam
+        \advance\mm at charcode by \mm at charslot
         \mathcode`#1=\mm at charcode
     \fi
 }
 
-\newcommand\MathUp[1]{%
+\newcommand*\MathFamily[2]{%
     \ifx\@onlypreamble\@notprerr
-        \@MathUp{#1}
-    \else % in the preamble
-        \AtBeginDocument{\@MathUp{#1}}
+        \math at family{#1}{#2}
+    \else % before \begin{document}
+        \AtBeginDocument{\math at family{#1}{#2}}
     \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*\MathUp[1]{\MathFamily{#1}{0}}
+\newcommand*\MathIt[1]{\MathFamily{#1}{1}}
 
 \newcommand*\MathNumbers[1]{%
     \in@{e}{#1} \ifin@ \MathUp{e} \fi
@@ -138,13 +117,13 @@
     \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
+\def\apply#1#2{\apply@#1#2,\apply@,}
+\def\apply@#1#2,{\ifx\apply@#2\empty
+    \else #1{#2}\afterfi@{\apply@#1}\fi}
+\def\afterfi@#1#2\fi{\fi#1}
+
+\newcommand*\MathNormal[1]{% list argument
+    \apply\MathIt{#1}
 }
 
 \newcommand{\enumber}{%
@@ -185,6 +164,7 @@
       \else % in the preamble
         \RequirePackage[LGR,T1]{fontenc}
         \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n}
+        \let\pi\relax
         \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70}
         \let\savedpi\pi
       \fi
@@ -228,6 +208,9 @@
         }
     }{\mm at warning{norm} } % bad result with libertinust1math
 
+\DeclareMathAlphabet{\mathbfsfit}{\encodingdefault}{\sfdefault}{bx}{it}
+\newcommand{\tensor}{\mathbfsfit} % isomath uses \mathsfbfit
+
 \mm at macro{di}{\mathop{}\!\mathup{d}}
 \newcommand\probastyle{}
 \let\Par\P % end of paragraph symbol



More information about the tex-live-commits mailing list.