From 5eb36ac321647ea1d7118566b9520a0e8a622203 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 20 Feb 2023 03:04:50 +0000 Subject: CTAN sync 202302200304 --- macros/jptex/latex/platex/LICENSE | 2 +- macros/jptex/latex/platex/README.md | 2 +- macros/jptex/latex/platex/platexrelease.dtx | 19 +- macros/jptex/latex/platex/platexrelease.pdf | Bin 109693 -> 111387 bytes macros/jptex/latex/platex/plcore.dtx | 101 +++- macros/jptex/latex/platex/pldoc.pdf | Bin 1367858 -> 1376083 bytes macros/jptex/latex/platex/plvers.dtx | 8 +- macros/latex/contrib/mismath/mismath.dtx | 720 +++++++++++++++------------- macros/latex/contrib/mismath/mismath.ins | 4 +- macros/latex/contrib/mismath/mismath.pdf | Bin 265710 -> 266957 bytes 10 files changed, 519 insertions(+), 337 deletions(-) (limited to 'macros') diff --git a/macros/jptex/latex/platex/LICENSE b/macros/jptex/latex/platex/LICENSE index 592f89f5ee..ab54973a8c 100644 --- a/macros/jptex/latex/platex/LICENSE +++ b/macros/jptex/latex/platex/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2010 ASCII MEDIA WORKS -Copyright (c) 2016-2022 Japanese TeX Development Community +Copyright (c) 2016-2023 Japanese TeX Development Community All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/macros/jptex/latex/platex/README.md b/macros/jptex/latex/platex/README.md index 80a1542d3e..aa4ab92e7b 100644 --- a/macros/jptex/latex/platex/README.md +++ b/macros/jptex/latex/platex/README.md @@ -71,6 +71,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2022-12-15 +2023-02-19 Japanese TeX Development Community diff --git a/macros/jptex/latex/platex/platexrelease.dtx b/macros/jptex/latex/platex/platexrelease.dtx index a866eb0874..84a73c9b72 100644 --- a/macros/jptex/latex/platex/platexrelease.dtx +++ b/macros/jptex/latex/platex/platexrelease.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment %% File: platexrelease.dtx % -% Copyright (c) 2016-2022 Japanese TeX Development Community +% Copyright (c) 2016-2023 Japanese TeX Development Community % % This file is part of the pLaTeX2e system (community edition). % ------------------------------------------------------------- @@ -34,6 +34,7 @@ % \changes{v1.0n}{2020/03/28}{$B@h$K(Blatexrelease$B$,FI$_9~$^$l$F$$$?$i7Y9p(B} % \changes{v1.0o}{2021/02/13}{\cs{sourcepLaTeXdate} added % (sync with latexrelease.dtx 2021/01/23 v1.0l)} +% \changes{v1.0p}{2023/01/08}{latexrelease$B$,?7$7$$>l9g$O>o$K>e=q$-(B} % \fi % % \iffalse @@ -43,7 +44,7 @@ \ProvidesFile{platexrelease.dtx} % %\ProvidesPackage{platexrelease} - [2021/02/13 v1.0o latexrelease support for pLaTeX Kernel + [2023/01/08 v1.0p latexrelease support for pLaTeX Kernel (including releases up to \platexreleaseversion)] %<*driver> \RequirePackage{plautopatch} @@ -226,13 +227,19 @@ % % $BFI$_9~$s$@(B\Lpack{latexrelease}$B%Q%C%1!<%8$N%P!<%8%g%s$r3NG'$7!"(B % \Lpack{platexrelease}$B$,L$BP1~$N?7$7$$$b$N$G$"$C$?>l9g$K7Y9p$7$^$9!#(B +% $B$3$N>l9g$O!"(B\Lpack{latexrelease}$B$K$h$C$F(Bp\LaTeX{}$B$,>e=q$-$5$l$F(B +% $B2u$l$k$N$rKI$0$?$a!"LdEzL5MQ$G(Bp\LaTeX{}$B$G:FEY>e=q$-$7$^$9!#(B % \changes{v1.0b}{2016/02/16}{latexrelease$B$N%P!<%8%g%s3NG'$rF3F~(B} +% \changes{v1.0p}{2023/01/08}{latexrelease$B$,?7$7$$>l9g$O>o$K>e=q$-(B} % \begin{macrocode} \ifnum\expandafter\@parse@version\latexreleaseversion//00\@nil >\expandafter\@parse@version\p@known@latexreleaseversion//00\@nil \PackageWarningNoLine{platexrelease}{% Version of `latexrelease' is newer than\MessageBreak what `platexrelease' knows} + \let\pltx@maybe@gobble\@gobble +\else + \let\pltx@maybe@gobble\@firstofone \fi % \end{macrocode} % @@ -293,7 +300,7 @@ \ifnum\requestedpLaTeXdate=\currentpLaTeXdate \PackageWarningNoLine{platexrelease}{% Current format date selected, no patches applied} -\expandafter\endinput +\pltx@maybe@gobble{\expandafter\endinput} \fi % \end{macrocode} % @@ -308,7 +315,7 @@ The current package is for an older pLaTeX format:\MessageBreak pLaTeX \platexreleaseversion\space\MessageBreak Obtain a newer version of this package!} -\expandafter\endinput +\pltx@maybe@gobble{\expandafter\endinput} \fi % \end{macrocode} % @@ -322,7 +329,7 @@ The current package is for pLaTeX \platexreleaseversion:\MessageBreak It has no patches beyond that date\MessageBreak There may be an updated version\MessageBreak of this package available from CTAN} -\expandafter\endinput +\pltx@maybe@gobble{\expandafter\endinput} \fi % \end{macrocode} % @@ -352,6 +359,8 @@ of this package available from CTAN} some critical bugs. We advise you to\MessageBreak select another format date} \plIncludeInRelease{2017/10/28}{\PackageWarning}{pLaTeX Info}% + % * <2023-02-14> + % * <2021-11-15>+1 % * <2021-11-15> % * <2021-06-01>+2 % * <2021-06-01>+1 diff --git a/macros/jptex/latex/platex/platexrelease.pdf b/macros/jptex/latex/platex/platexrelease.pdf index 00987e078a..f9223b6dec 100644 Binary files a/macros/jptex/latex/platex/platexrelease.pdf and b/macros/jptex/latex/platex/platexrelease.pdf differ diff --git a/macros/jptex/latex/platex/plcore.dtx b/macros/jptex/latex/platex/plcore.dtx index 073138eebe..afb26bcc5b 100644 --- a/macros/jptex/latex/platex/plcore.dtx +++ b/macros/jptex/latex/platex/plcore.dtx @@ -3,7 +3,7 @@ % % Copyright 1994-2001 ASCII Corporation. % Copyright (c) 2010 ASCII MEDIA WORKS -% Copyright (c) 2016-2022 Japanese TeX Development Community +% Copyright (c) 2016-2023 Japanese TeX Development Community % % This file is part of the pLaTeX2e system (community edition). % ------------------------------------------------------------- @@ -137,13 +137,14 @@ % \changes{v1.3j}{2021/06/03}{$B4,La$7%3!<%I$N%(%i!<=$@5(B} % \changes{v1.3k}{2021/06/28}{$BFbIt(BUnicode$B$N;~$N$_$r8!=P(B} % \changes{v1.3l}{2021/12/08}{\LaTeXe~2021-11-15$B$KH<$&=$@5(B} +% \changes{v1.3m}{2023/02/14}{$B%U%m!<%H4D6-Fb$G$NAHJ}8~JQ99$r(Bplext$B$KM6F3(B} % \fi % % \iffalse %<*driver> \NeedsTeXFormat{pLaTeX2e} % \fi -\ProvidesFile{plcore.dtx}[2021/12/08 v1.3l pLaTeX core file] +\ProvidesFile{plcore.dtx}[2023/02/14 v1.3m pLaTeX core file] % \iffalse \RequirePackage{plautopatch} \documentclass[dvipdfmx,a4paper]{jltxdoc} @@ -485,6 +486,7 @@ % $B6XB'J8;z$X$NBP:v$rF~$l$F$$$^$9$,!"(Bplain \TeX{}$B8_49$N%7%s%W%k$J(B % $BL?Na$G$"$k(B|\break|$B$d(B|\nobreak|$B$K$O!"BP:v$r9T$$$^$;$s!#(B % +% % \subsection{$B%*%V%8%'%/%H$N=PNO=g=x(B} % $B%*%j%8%J%k$N(B\LaTeX{}$B$O!"%H%C%W%U%m!<%H!"K\J8!"5SCm!"%\%H%`%U%m!<%H(B % $B$N=gHV$G=PNO$7$^$9$1$l$I$b!"F|K\8lAHHG$G$O!"%H%C%W%U%m!<%H!"K\J8!"(B @@ -1738,9 +1740,102 @@ % {LaTeX2e original}% %% do nothing %\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +% +% \subsection{$B%U%m!<%H4D6-(B} +% $B?^(B(figure)$B$dI=(B(table)$B$H$$$C$?%U%m!<%H4D6-Fb$G$O(B +% $BAHJ}8~JQ99$r(B|\tate|$B$d(B|\yoko|$B$K$h$C$FD>@\JQ99$7$J$$$G$/$@$5$$!#(B +% $BBe$o$j$K(B\file{plext}$B%Q%C%1!<%8$,Ds6!$9$k(B +% |\layoutcaption| / |\layoutfloat| / |\pcaption|$B$H$$$C$?L?Na$r(B +% $B;H$&$H!"Nc$($P!V=D=q$-Cf$K2#=q$-$G?^I=%-%c%W%7%g%s$rA^F~!W$N$h$&$J(B +% $B<+M3$J;XDj$,$G$-$k$h$&$K$J$j$^$9!#(B(Issue \#95) +% \begin{macro}{\@floatboxreset} +% $B85$O(Bltfloat.dtx$B$GDj5A$5$l$F$$$^$9!#(B +% \changes{v1.3m}{2023/02/14}{$B%U%m!<%H4D6-Fb$G$NAHJ}8~JQ99$r(Bplext$B$KM6F3(B} +% \begin{macrocode} +%\plIncludeInRelease{2023/02/14}{\@floatboxreset} +%<*plcore|platexrelease> +\def\@floatboxreset{% + \pltx@save@float@dir % pLaTeX + \reset@font + \normalsize + \@setminipage +} +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}{\@floatboxreset} +% {Mention \layoutcaption}% +%\def\@floatboxreset{% +% \reset@font +% \normalsize +% \@setminipage +%} +%\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@endfloatbox} +% $B85$O(Bltfloat.dtx$B$GDj5A$5$l$F$$$^$9!#(B +% \begin{macrocode} +%\plIncludeInRelease{2023/02/14}{\@endfloatbox} +% {Mention \layoutcaption}% +%<*plcore|platexrelease> +\def\@endfloatbox{% + \par\vskip\z@skip %% \par\vskip\z@ added 15 Dec 87 + \@minipagefalse + \outer@nobreak + \pltx@check@float@dir % pLaTeX + \egroup %% end of vbox + \color@endbox +} +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}{\@endfloatbox} +% {Mention \layoutcaption}% +%\def\@endfloatbox{% +% \par\vskip\z@skip %% \par\vskip\z@ added 15 Dec 87 +% \@minipagefalse +% \outer@nobreak +% \egroup %% end of vbox +% \color@endbox +%} +%\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pltx@save@float@dir} +% \begin{macro}{\pltx@check@float@dir} +% \pLaTeX{}$B$K$h$kDI2CL?Na$G$9!#(B +% \begin{macrocode} +%\plIncludeInRelease{2023/02/14}{\pltx@check@float@dir} +% {Mention \layoutcaption}% +%<*plcore|platexrelease> +\def\pltx@save@float@dir{% + \edef\pltx@float@dir@first{\iftdir\tate\else\yoko\fi}} +\def\pltx@check@float@dir{% + \edef\pltx@float@dir@last{\iftdir\tate\else\yoko\fi}% + \ifx\pltx@float@dir@last\pltx@float@dir@first\else + \pltx@err@float@dir + \fi} +\def\pltx@err@float@dir{% + \@latex@error{Direction change inside float!?\MessageBreak + Use \noexpand\layoutcaption provided in + \string\usepackage{plext}}\@ehc +} +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}{\pltx@check@float@dir} +% {Mention \layoutcaption}% +%\let\pltx@save@float@dir\@undefined +%\let\pltx@check@float@dir\@undefined +%\let\pltx@err@float@dir\@undefined +%\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} +% \end{macro} % % % \subsection{$B5SCm%^%/%m(B} @@ -2277,6 +2372,7 @@ % \end{macrocode} % \end{macro} % +% % \subsection{$BMQ8l=8$N=PNO(B} % \LaTeX{}$B$K$O!"$J$<$+MQ8l=8$r=PNO$9$k$?$a$N%3%^%s%I$,$"$j$^$;$s$N$G!"(B % $BDI2C$r$7$^$9!#(B @@ -2310,6 +2406,7 @@ % \end{macro} % \end{macro} % +% % \subsection{tabular$B4D6-(B} % \LaTeX{}$B%+!<%M%k(B(lttab.dtx)$B$NL?Na72$r=$@5$7$^$9!#(B % diff --git a/macros/jptex/latex/platex/pldoc.pdf b/macros/jptex/latex/platex/pldoc.pdf index 078d173717..69d3856cd0 100644 Binary files a/macros/jptex/latex/platex/pldoc.pdf and b/macros/jptex/latex/platex/pldoc.pdf differ diff --git a/macros/jptex/latex/platex/plvers.dtx b/macros/jptex/latex/platex/plvers.dtx index 577d32b2be..79c7fc1db4 100644 --- a/macros/jptex/latex/platex/plvers.dtx +++ b/macros/jptex/latex/platex/plvers.dtx @@ -3,7 +3,7 @@ % % Copyright 1995-2006 ASCII Corporation. % Copyright (c) 2010 ASCII MEDIA WORKS -% Copyright (c) 2016-2022 Japanese TeX Development Community +% Copyright (c) 2016-2023 Japanese TeX Development Community % % This file is part of the pLaTeX2e system (community edition). % ------------------------------------------------------------- @@ -201,10 +201,10 @@ % %\edef\platexreleaseversion %<*plcore|platexrelease> - {2021-11-15} + {2023-02-14} % %<*plcore> -\def\ppatch@level{1} +\def\ppatch@level{0} % % \end{macrocode} % \end{macro} @@ -306,7 +306,7 @@ % \end{macrocode} % % \pLaTeXe{}$B$N%P!<%8%g%sI=<($r:n$j$^$9!#(B -% \changes{v1.2a}{2022-12-05}{|\space|$B$r$3$NCJ3,$GF~$l$k$N$O;_$a$?!#(B} +% \changes{v1.2a}{2022-12-05}{\cs{space}$B$r$3$NCJ3,$GF~$l$k$N$O;_$a$?(B} % \begin{macrocode} \ifnum\ppatch@level=0 \toks2={\pfmtname\space<\pfmtversion>}% diff --git a/macros/latex/contrib/mismath/mismath.dtx b/macros/latex/contrib/mismath/mismath.dtx index c610c4e976..f056c12d29 100644 --- a/macros/latex/contrib/mismath/mismath.dtx +++ b/macros/latex/contrib/mismath/mismath.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2019-2022 by Antoine Missier +% Copyright (C) 2019-2023 by Antoine Missier % % 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] % %<*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 @@ % % \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@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@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,18 +165,24 @@ % % \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 % 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{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,52 +257,72 @@ % % \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}). % 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, % 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{\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{[pinumber=\meta{command}]} +% \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,11 +368,16 @@ % 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 @@ -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 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 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. +% \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} \ttfamily +% \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. -% -% \enlargethispage{1ex} % \medskip -% For each option, you can set them when package calling: \eg -% (with \textsf{upgreek}) +% |\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. % -% \smallskip -% \centeredline{|\usepackage[inumber,pinumber=uppi,boldvect]{mismath}|} +% \medskip +% Another command, |\paren|, used before version 2.0, is no longer supported. % -% \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@ibrackets % initialized to false +\DeclareOption{ibrackets}{\mm@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@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@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. +% \medskip % \begin{macrocode} -\def\mismathset#1{\setkeys{mismath}{#1}} +\newcommand\mm@warning[1]{ + \PackageWarningNoLine{mismath}{ + Command \bslash #1 already exist and will not be redefined} +} +\newcommand\mm@macro[2]{ + \@ifundefined{#1}{ + \expandafter\def\csname #1\endcsname{#2} + }{\\mm@warning{#1}} +} +\newcommand\mm@operator[3][]{% + \ifthenelse{\equal{#1}{}}{\def\tempa{#3}}{\def\tempa{#1}} + \@ifundefined{\tempa}{ + \DeclareMathOperator{#2}{#3} + }{\mm@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@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@charcode +\newcount\mm@charclass +%\newcount\mm@charfam +\newcount\mm@charslot + +\newcommand\@MathUp[1]{% + \ifluatex + \mm@charclass=\Umathcharclass`#1 + %\mm@charfam=\Umathcharfam`#1 + \mm@charslot=\Umathcharslot`#1 + \Umathcode`#1= \mm@charclass 0 \mm@charslot + \else + \mm@charcode=\mathcode`#1 + % extract charclass + \@tempcnta=\mm@charcode + \divide\@tempcnta by "1000 + \multiply\@tempcnta by "1000 % charclass + \mm@charclass=\@tempcnta + % extract charslot + \@tempcnta=\mm@charcode + \@tempcntb=\mm@charcode + \divide\@tempcnta by "100 + \multiply\@tempcnta by "100 % charclass + charfam + \advance\@tempcntb by -\@tempcnta % charslot + \mm@charslot=\@tempcntb + % construct charcode + \mm@charcode=\mm@charclass + \advance\mm@charcode by \mm@charslot % charfam is now 0 + \mathcode`#1=\mm@charcode + \fi +} + +\newcommand\MathUp[1]{% + \ifx\@onlypreamble\@notprerr + \@MathUp{#1} + \else % in the preamble + \AtBeginDocument{\@MathUp{#1}} + \fi +} + +\newcommand\MathIt[1]{% + \ifluatex + \mm@charclass=\Umathcharclass`#1 + %\mm@charfam=\Umathcharfam`#1 + \mm@charslot=\Umathcharslot`#1 + \Umathcode`#1= \mm@charclass 1 \mm@charslot + \else + \mm@charcode=\mathcode`#1 + % extract charclass + \@tempcnta=\mm@charcode + \divide\@tempcnta by "1000 + \multiply\@tempcnta by "1000 % charclass + \mm@charclass=\@tempcnta + % extract charslot + \@tempcnta=\mm@charcode + \@tempcntb=\mm@charcode + \divide\@tempcnta by "100 + \multiply\@tempcnta by "100 % charclass + charfam + \advance\@tempcntb by -\@tempcnta % charslot + \mm@charslot=\@tempcntb + % construct charcode + \mm@charcode=\mm@charclass + \advance\mm@charcode by \mm@charslot + \advance\mm@charcode by "100 % sets charfam to 1 + \mathcode`#1=\mm@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@enumber - \DeclareMathSymbol{e}\mathalpha{operators}{`e} \fi - \ifmismath@inumber - \DeclareMathSymbol{i}\mathalpha{operators}{`i}\fi - \ifmismath@jnumber - \DeclareMathSymbol{j}\mathalpha{operators}{`j}\fi - \ifthenelse{\equal{\mismath@pinumber}{}}{}{% else - \@ifundefined{itpi}{\let\itpi\pi}{\@mwarning{itpi}} - \ifthenelse{\equal{\mismath@pinumber}{*}}{ - \RequirePackage[LGR,T1]{fontenc} - \DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n} - \DeclareMathSymbol{\pi}\mathalpha{UpGr}{"70} - }{% else - \@ifundefined{\mismath@pinumber}{ - \PackageWarningNoLine{mismath}{% - Value \mismath@pinumber\space must be a valid - command name\MessageBreak for pinumber option, - but command \bslash \mismath@pinumber\space - is undefined.\MessageBreak - Perhaps a missing package} - }{\renewcommand{\pi}{% - \csname\mismath@pinumber\endcsname} - } - }} - \ifmismath@PEupright - \DeclareMathSymbol{P}\mathalpha{operators}{`P} - \DeclareMathSymbol{E}\mathalpha{operators}{`E} \fi - \ifmismath@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@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@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@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@pinumber{#1} -} \newcommand{\PEupright}{ \PackageWarning{mismath}{Command \string\PEupright\space is deprecated, \MessageBreak - use `PEupright' as package option instead} - \mismath@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@arrowvecttrue} -\newcommand{\boldvect}{\mismath@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@arrowvect}}{ - \vv}{\boldvectcommand}} %\if \fi doesn't work well here +\mm@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@warning{norm} } % bad result with libertinust1math -\@mmacro{di}{\mathop{}\!\mathup{d}} +\mm@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@macro{E}{\operatorname{\probastyle{E}}} +\mm@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@operator{\adj}{adj} +\mm@operator{\Aut}{Aut} +\mm@operator{\codim}{codim} +\mm@operator{\Conv}{Conv} +\mm@operator{\cov}{cov} +\mm@operator{\Cov}{Cov} +\mm@macro{curl}{\operatorname{\vect{\mathup{curl}}}} +\mm@operator[divg]{\divg}{div} +\mm@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@operator{\erf}{erf} +\mm@macro{grad}{\operatorname{\vect{\mathup{grad}}}} +\mm@operator{\id}{id} % mathop or mathord ? +\mm@operator{\Id}{Id} +\mm@operator{\im}{im} \let\oldIm\Im \renewcommand{\Im}{\operatorname{Im}} -\@moperator{\lb}{lb} -\@moperator{\lcm}{lcm} +\mm@operator{\lb}{lb} +\mm@operator{\lcm}{lcm} -\@moperator{\rank}{rank} +\mm@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@macro{rot}{\operatorname{\vect{\mathup{rot}}}} +\mm@operator{\sgn}{sgn} +\mm@operator{\sinc}{sinc} +\mm@operator[spa]{\spa}{span} +\mm@operator{\tr}{tr} +\mm@operator{\var}{var} +\mm@operator{\Var}{Var} +\mm@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@operator{\arccot}{arccot} +\mm@operator{\sech}{sech} +\mm@operator{\csch}{csch} +\mm@operator{\arsinh}{arsinh} +\mm@operator{\arcosh}{arcosh} +\mm@operator{\artanh}{artanh} +\mm@operator{\arcoth}{arcoth} +\mm@operator{\arsech}{arsech} +\mm@operator{\arcsch}{arcsch} -\@moperator[bigO]{\bigO}{\mathcal{O}} -\@moperator[bigo]{\bigo}{O} -\@moperator[lito]{\lito}{o} +\mm@operator[bigO]{\bigO}{\mathcal{O}} +\mm@operator[bigo]{\bigo}{O} +\mm@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@macro{mathset}{\mathbf} +\mm@macro{R}{\ensuremath{\mathset{R}}\xspace} +\mm@macro{C}{\ensuremath{\mathset{C}}\xspace} +\mm@macro{N}{\ensuremath{\mathset{N}}\xspace} +\mm@macro{Z}{\ensuremath{\mathset{Z}}\xspace} +\mm@macro{Q}{\ensuremath{\mathset{Q}}\xspace} +\mm@macro{F}{\ensuremath{\mathset{F}}\xspace} +\mm@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@macro{ds}{\displaystyle} +\mm@macro{dlim}{\lim\limits} +\mm@macro{dsum}{\sum\limits} +\mm@macro{dprod}{\prod\limits} +\mm@macro{dcup}{\bigcup\limits} +\mm@macro{dcap}{\bigcap\limits} -\@mmacro{lbar}{\overline} +\mm@macro{lbar}{\overline} \@ifundefined{hlbar}{ \providecommand*{\hlbar}[1]{\overline{\vphantom{t}#1}}}{ - \@mwarning{hlbar} } + \mm@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@macro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}} +\mm@macro{unbr}{\underbrace} +\mm@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@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@warning{txt} } +\mm@macro{mul}{\mathord{\times}} \@ifundefined{pow}{ \providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{ - \@mwarning{pow} } + \mm@warning{pow} } \@ifundefined{abs}{ \providecommand*{\abs}[1]{\left\vert#1\right\vert} }{ - \@mwarning{abs} } + \mm@warning{abs} } \@ifundefined{lfrac}{ \providecommand*{\lfrac}[2]{\frac{\;#1\;}{\;#2\;}} }{ - \@mwarning{lfrac} } + \mm@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}, diff --git a/macros/latex/contrib/mismath/mismath.ins b/macros/latex/contrib/mismath/mismath.ins index 8985defb61..2ed4bf317d 100644 --- a/macros/latex/contrib/mismath/mismath.ins +++ b/macros/latex/contrib/mismath/mismath.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2019-2022 by Antoine Missier +%% Copyright (C) 2019-2023 by Antoine Missier %% %% 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 +Copyright (C) 2019-2023 by Antoine Missier This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license diff --git a/macros/latex/contrib/mismath/mismath.pdf b/macros/latex/contrib/mismath/mismath.pdf index 0645cea7fb..d7f8025778 100644 Binary files a/macros/latex/contrib/mismath/mismath.pdf and b/macros/latex/contrib/mismath/mismath.pdf differ -- cgit v1.2.3