diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-27 20:47:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-27 20:47:21 +0000 |
commit | a200374e62cb010d82318683000436acea14105a (patch) | |
tree | 296b7fa53b9619d6e3b5cfe1782ae8d5e6076487 /Master/texmf-dist/source | |
parent | 6038d144f86e1ae787a211aefdecff1bed966fa6 (diff) |
mismath (27feb24)
git-svn-id: svn://tug.org/texlive/trunk@70201 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/mismath/mismath.dtx | 487 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mismath/mismath.ins | 2 |
2 files changed, 341 insertions, 148 deletions
diff --git a/Master/texmf-dist/source/latex/mismath/mismath.dtx b/Master/texmf-dist/source/latex/mismath/mismath.dtx index b40e0d7211b..f69aaeaffe0 100644 --- a/Master/texmf-dist/source/latex/mismath/mismath.dtx +++ b/Master/texmf-dist/source/latex/mismath/mismath.dtx @@ -20,18 +20,18 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{mismath} - [2024/02/20 v2.10 .dtx Miscellaneous mathematical macros] + [2024/02/26 v2.11 .dtx Miscellaneous mathematical macros] %</package> %<*driver> \documentclass{ltxdoc} -\usepackage[utf8]{inputenc} +%\usepackage[utf8]{inputenc} % running through XeLaTeX \usepackage[T1]{fontenc} \usepackage[english]{babel} -\usepackage[charter]{mathdesign} % in case of font change, modify 2.1 (3rd §) -\usepackage[ibrackets]{mismath} -%\usepackage{amssymb} incompatible with mathdesign +\usepackage{fontspec} +\usepackage{fourier} % in case of font change, modify 2.1 (3rd §) +\usepackage[ibrackets,decimalcomma]{mismath} +%\usepackage{amssymb} % unnecessary with fourier \usepackage{multicol} -\usepackage[Symbol]{upgreek} \usepackage{sectsty} \usepackage{xcolor} \usepackage{spacingtricks} @@ -40,12 +40,26 @@ \definecolor{darkbrown}{rgb}{0.5,0.1,0.1} \allsectionsfont{\color{darkbrown}} -\MathUp{i} \pinumber[piup] -% I need italicized e in vectors section -% For using in this doc only: -\usepackage[LGR,T1]{fontenc} -\DeclareSymbolFont{UpGr}{LGR}{lmr}{m}{n} -\DeclareMathSymbol{\mypi}\mathalpha{UpGr}{"70} +% The following commands provides several shapes of pi +% the maximum number of authorized math fonts is reached +\DeclareFontEncoding{LGR}{}{} +\DeclareSymbolFont{lgrlmr}{LGR}{lmr}{m}{n} +\DeclareMathSymbol{\pilmr}{\mathalpha}{lgrlmr}{112} +\DeclareSymbolFont{lgrAlegreya}{LGR}{Alegreya-LF}{m}{n} +\DeclareMathSymbol{\piAlegreya}{\mathalpha}{lgrAlegreya}{112} +\DeclareSymbolFont{lgrCochineal}{LGR}{Cochineal-LF}{m}{n} +\DeclareMathSymbol{\piCochineal}{\mathalpha}{lgrCochineal}{112} +\pinumber[upgreek=Euler] +\DeclareSymbolFont{upgreekSymbol}{U}{psy}{m}{n} +\DeclareMathSymbol{\piSymbol}{\mathord}{upgreekSymbol}{`p} +\DeclareSymbolFont{mdCharter}{OML}{mdbch}{m}{n} +\DeclareMathSymbol{\piCharter}{\mathord}{mdCharter}{"19} +\DeclareSymbolFont{kp}{U}{jkpmia}{m}{it} +\DeclareMathSymbol{\pikp}{\mathord}{kp}{"19} +\DeclareSymbolFont{px}{U}{pxmia}{m}{it} +\DeclareMathSymbol{\pipx}{\mathord}{px}{"19} +\DeclareSymbolFont{tx}{U}{txmia}{m}{it} +\DeclareMathSymbol{\pitx}{\mathord}{tx}{"19} % For showing original \i and \j in text mode: \DeclareTextFontCommand{\extrafont}{\fontfamily{lmr}\selectfont} @@ -69,7 +83,7 @@ %</driver> % \fi % -% \CheckSum{691} +% \CheckSum{807} % % \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 @@ -143,10 +157,10 @@ % - 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, +% - pinumber command has been improved to use other Greek letters 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), +% - hvect and hlbar have been slightly modified (phantom t instead of phantom h), % - several changes in documentation, % - now using the Charter font (with the package mathdesign)} % @@ -182,7 +196,7 @@ % % \changes{v2.6}{2023/03/01}{ % - A bug correction in mm@macro -% - incompatibility of \C macro solved, when using babel with russian +% - incompatibility of \C macro solved, when using babel with Russian % (thanks to Murray Eisenberg for this bug report on TeX StackExchange) % - mathrm added in macro eqdef* (useful if italicized Greek uppercase Delta) % - Tiny changes in the documentation} @@ -206,36 +220,41 @@ % for the options ibrackets, decimalcomma and the commands MathUp, MathIt % - Explicit error message when using mathcols without loading the multicol package} % +% \changes{v2.11}{2024/02/22}{ +% - Enhancements of the pinumber macro with keyval options: +% * no necessity to load a Greek letters package +% * improvements of compatibility with unicode-math} +% % \GetFileInfo{mismath.sty} % -% \title{\textsf{mismath}\\ Miscellaneous mathematical macros\thanks{This document +% \title{Miscellaneous mathematical macros \\The \textsf{mismath} package\thanks{This document % corresponds to \textsf{mismath}~\fileversion, dated \filedate. % Thanks to François Bastouil for initial help in English translation.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{February 20, 2024} +% \date{February 26, 2024} % % \maketitle % \tableofcontents % % \section{Introduction} % -% According to the International Standards ISO~31-0:1992 to ISO~31-13:1992, -% superseded by ISO~80000-2:2009, mathematical constants $\e$, $\i$, $\pi$ -% should be typeset in roman (upright shape) and not in italic (sloping shape) like +% According to the International Standards ISO~31-0:1992 to ISO~31-13:1992 +% (superseded by ISO~80000-2:2009), mathematical \emph{constants} $\e$, $\i$, $\otherpi$ +% should be typeset in roman (upright shape) and not in italic like % variables (see~\cite{TYPMA}~\cite{NIST}~\cite{SI}~\cite{ICTNS}). % This package provides some tools to achieve this automatically. % % \medskip % Even though it is recommended to typeset vectors names % in bold italic style~\cite{NIST}~\cite{ICTNS}, -% they are often represented with arrows -% (especially in school documents or in physics). -% To draw visually appealing arrows above vectors, we use the \textsf{esvect} package +% they are often represented with arrows, +% especially in school documents or in physics. +% To draw nice arrows above vectors, we use the \textsf{esvect} package % by Eddie Saudrais~\cite{VECT}. % Additionally we provide a few more macros related to vectors with arrows, % particularly to enhance the typesetting of the norm: $\norm{\vect{AB}}$ -% instead of \LaTeX\ version $\lVert\vect{AB}\rVert$ which is not vertically adjusted, -% or worse $\left\Vert \vect{AB} \right\Vert$. +% instead of the \LaTeX\ version $\lVert\vect{AB}\rVert$, which is not vertically adjusted, +% or worse $\left\Vert \vect{AB} \right\Vert$ (when using |\left|\ldots |\right|). % % \smallskip % The package also offers other macros for: @@ -286,7 +305,9 @@ % are required to be typeset in upright shape % \footnote{The \textsf{frenchmath} package~\cite{FR} % ensures to follow the recommended French rules.}. -% ^^A The decision to load any of these packages is left to the user's discretion. +% When running through \LuaLaTeX\ or \XeLaTeX\ you can also get this result by +% setting the option \mbox{\texttt{math-style=ISO}} in the \textsf{unicode-math} package. +% % % \section{Usage} % @@ -295,9 +316,9 @@ % \DescribeMacro{\mathup} % As for classic functions identifiers, \emph{predefined} mathematical constants % should be typeset in upright shape (typically in roman family), -% even though this practice is not very common and can be tedious -% to adhere to. A first solution is to use the |\mathup| macro, -% which is superior to |\mathrm| +% but this practice is not sufficiently respected, probably because it's a bit tedious. +% A first solution is to use the |\mathup| macro, +% which is preferable to |\mathrm| % \footnote{The \texttt{\string \mathup} macro is based on \texttt{\string \operatorfont}, % which comes from the % \textsf{amsopn} package, automatically loaded by \textsf{amsmath}. @@ -307,7 +328,7 @@ % a better choice in \textsf{beamer} presentations to ensure that mathematical % constants are typeset in upright shape and consistent % with the default sans serif math font.}, -% for setting any math text in upright shape. For example you can use +% for setting any group of letters in roman. For example you can use % |\mathup{e}| to get the Euler's number. % % \medskip @@ -317,7 +338,8 @@ % the package provides the |\e| command for Euler’s number % and |\i| or |\j| for imaginary numbers. % Let us notice that |\i| and |\j| already exist in LaTeX. In LR (left-to-right) mode, -% they produce `\extrafont{\i,\ \j}' without the dot, allowing you to place accents on them. +% they produce \mbox{`\extrafont{\i,\ \j}'} without the dot, +% allowing you to place accents on them. % However, in mathematical mode, they produce the warning % ``\texttt{LaTeX Warning: Command \string \i\space invalid in math mode on input line} % \meta{line}''. @@ -328,7 +350,8 @@ % \DescribeMacro{\MathUp} % Indeed, typing a lot of backslashes for constants like $\e$, $\i$, or $\j$ % in a document with numerous formulas can become tiresome. -% To alleviate this, the package proposes a powerful solution with the macro |\MathUp|\marg{char}. +% To alleviate this, the package proposes a powerful solution +% with the macro |\MathUp|\marg{char}. % For example, when |\MathUp{e}| is called, any subsequent occurrence of $\e$ % will automatically be set in roman (upright shape), % without the need to type |\e| explicitly. The effect of this macro @@ -343,8 +366,8 @@ % % \medskip % \DescribeMacro{\MathIt} -% When there are other occurrences of $\mathit{e}$, $\mathit{i}$ or $j$ as variables, -% you can still obtain italicized $\mathit{e}$, $\mathit{i}$ or $\mathit{j}$ using \LaTeX\ +% When there are other occurrences of $e$, $i$ or $j$ as variables, +% you can still obtain italicized $e$, $i$ or $j$ using \LaTeX\ % commands |\mathit| or |\mathnormal|, which are useful for a single use. % However, you also have the option to use the inverse switch |\MathIt|\marg{char}, % which has a global effect when used outside environments or braces, @@ -365,17 +388,23 @@ % at once using |\MathNormal|. % % \medskip -% \DescribeMacro{\pinumber[\meta{command}]} -% The mathematical constant $\pi$ should also be typeset in upright shape +% \DescribeMacro{\pinumber[\meta{option}]} +% The mathematical constant $\otherpi$ should also be typeset in upright shape % (see~\cite{TYPMA}, \cite{NIST}, \cite{ICTNS}), which is different from italicized $\itpi$. % However, this recommendation is even less commonly followed compared to the one % concerning $\e$ and $\i$~\cite{TYPMA}. -% Several packages enable the typesetting of mathematical Greek letters in upright shape. -% Notably, let us mention \textsf{upgreek}~\cite{GREEK}, \textsf{mathdesign}~\cite{DESIGN} -% (used in the present document), \mbox{\textsf{kpfonts}}~\cite{KPF}, -% \textsf{fourier}~\cite{FOUR}, -% \textsf{libertinust1math}, -% \textsf{pxgreeks}, \textsf{txgreeks} +% The |\pinumber| command replaces the italic $\itpi$ with an upright $\otherpi$ +% each time |\pi| is called. It functions in two different ways. +% +% \begin{enumerate} +% \item You can install a Greek letters package that provides the glyphs in upright shape. +% There are many available. +% Notably, let us mention \textsf{upgreek}~\cite{GREEK}, +% \mbox{\textsf{mathdesign}}~\cite{DESIGN}, +% \mbox{\textsf{kpfonts}}~\cite{KPF}, +% \mbox{\textsf{fourier}}~\cite{FOUR} (used in the present document), +% \mbox{\textsf{libertinust1math}}, +% \mbox{\textsf{pxgreeks}}, \mbox{\textsf{txgreeks}} % \footnote{When using \textsf{pxgreeks} or \textsf{txgreeks}, % they should be loaded \emph{after} \textsf{mismath} to avoid an error % due to conflict with the existing macros \texttt{\string\iint}, \texttt{\string\iiint}, @@ -386,52 +415,115 @@ % These packages provide commands like |\uppi| (\textsf{upgreek}), % |\piup| (\textsf{mathdesign}, \textsf{kpfonts}, \textsf{lgrmath}), % |\otherpi| (\textsf{fourier}), etc. -% \footnote{They also have options to typeset all the Greek lowercase +% \footnote{They have also options to typeset all the Greek lowercase % letters in upright shape by default, but this in not our goal here.} -% To preserve default italic style for lowercase Greek letters, -% with the exception of pi, and to -% avoid the need to type a lot of |\uppi| or |\piup|, we offer the -% macro |\pinumber|[\meta{command}]. -% This macro redefines |\pi| to match -% the optional command name provided (without a backslash), such as |piup|, -% assuming that the appropriate package has been loaded beforehand -% \footnote{The macro \texttt{\string \pinumber} doesn't work with -% \textsf{unicode-math}, but, with this package, you can use \texttt{\string \uppi} instead -% (or set all greek lowercase letters in upright shape with the option -% \texttt{math-style=french}).}. -% -% By using the preliminary code |\MathNumbers{ei}\pinumber[piup]| -% (assuming the \textsf{mathdesign} package is loaded) +% +% In this case, |\pinumber| must be called in the preamble +% with the name of the command (without the backslash) giving access to the upright pi +% (piup, uppi, otherpi \ldots) as the argument for the optional parameter. +% However, installing such a Greek letters package will modify +% all the other Greek letter glyphs. +% ^^A even if, except for pi, they will be in italics. +% +% By using the preliminary code |\MathNumbers{ei}\pinumber[otherpi]| +% (assuming the \textsf{fourier} package is loaded) % you can achieve the following result: % \begin{center} -% |$e^{i\pi} = -1$| \quad which yields \quad $\e^{i\pi}=-1$. +% |$e^{i\pi} = -1$| \quad yields \quad $\e^{\i\otherpi}=-1$. +% \end{center} +% +% \item Without installing a package, it is possible to change only the glyph of pi +% without altering the original glyphs for the other Greek letters, +% which are typically in italics. +% ^^A The original pi will still be accessible with |\itpi|. +% +% In this case, |\pinumber| must be called in the preamble with an optional argument +% of the \texttt{key=value} type. The key name corresponds to a package +% providing the same glyph. +% When a key is given without a value, |\pinumber| will choose a default value +% specified below (depending on the key) . +% The following table summarizes the available options. +% +% \begin{center} +% \setlength{\extrarowheight}{1pt} +% \begin{tabular}{>{\ttfamily}l>{$}c<{$}} +% \hline +% \normalfont Option & \mbox{Result} \\ +% \hline +% lgrmath=lmr & \pilmr \\ +% lgrmath=Alegreya-LF & \piAlegreya \\ +% lgrmath=Cochineal-LF & \piCochineal \\ +% lgrmath=\ldots & \ldots\\ +% upgreek=Euler & \pi \\ +% upgreek=Symbol & \piSymbol \\ +% \hline +% \end{tabular} +% \qquad +% \begin{tabular}{>{\ttfamily}l>{$}c<{$}} +% \hline +% \normalfont Option & \mbox{Result} \\ +% \hline +% mathdesign & \piCharter \\ +% fourier & \otherpi\\ +% kpfonts & \pikp \\ +% pxfonts & \pipx \\ +% txfonts & \pitx \\ +% & \\ +% \hline +% \end{tabular} % \end{center} % -% When you call |\pinumber| without any argument, -% it defines |\pi| using the default LGR font encoding for Greek letters, -% resulting in the character $\mypi$. In this case the appropriate option \texttt{LGR} -% for the \textsf{fontenc} package will be automatically loaded -% if the |\pinumber| command is called in the preamble (at least the first time it is used). -% The pi character obtained with this setting will look the same as the one provided by -% Günter Milde's \textsf{textalpha} package~\cite{ALPHA}. -% This $\mypi$ character is particularly well-suited -% for use with the default Computer Modern or Latin Modern font family -% \footnote{This default $\mypi$ character may not always fit well with various text fonts, -% especially those that are bolder or different from the default Computer Modern font. -% The \textsf{upgreek} package~\cite{GREEK} provides a better $\uppi$ character -% with the Symbol option, utilizing the Adobe Symbol font. This $\uppi$ character -% matches well with several text fonts, such as Times.}. +% \begin{itemize} +% \item With the \texttt{lgrmath} key, we actually have numerous possibilities +% for values (any Greek letters math fonts in LGR encoding). +% The documentation of the \textsf{lgrmath} +% package explains how to check an visualize all available fonts on your distribution. +% We have only presented three of them. The default value is \texttt{lmr}. +% +% \item With the \texttt{upgreek} key, the default value is \texttt{Symbol}. +% There is a third possible value, \texttt{Symbolsmallscale}, +% which provides the same character as \texttt{Symbol} but reduced in size by 10\,\%. +% +% \item With the \texttt{mathdesign} key, there are actually 3 possible values: +% \texttt{Utopia}, \texttt{Garamond}, or \texttt{Charter} (default value), +% but the glyphs obtained for pi look very similar. +% +% \item With the \texttt{kpfonts} key, we have two possible values: +% \texttt{normal} (default) and \texttt{light}. The option \texttt{kpfonts=light} +% provides a slightly less bold character. +% +% \item The keys \texttt{pxfonts} (based on Palatino) and \texttt{txfonts} (based on Times) +% are booleans whose default value is \texttt{true} (when called). +% +% \item When |\pinumber| is called without an argument in the preamble, +% it corresponds to the option \texttt{lgrmath=lmr}. +% This $\pilmr$ character is particularly well-suited +% for use with the default Computer Modern or Latin Modern font family. +% \footnote{It will look the same as the one provided by +% Günter Milde's \textsf{textalpha} package~\cite{ALPHA}.}. +% \end{itemize} +% \end{enumerate} +% +% If \textsf{unicode-math} is used (which provides |\uppi|), the command |\pinumber[uppi]| +% will not work, and it can be quite complicated to make some Greek letters packages work. +% In any case, this package must be loaded after \textsf{unicode-math} and in +% |\AtBeginDocument|. +% However, \textsf{unicode-math} supports |\pinumber| very well with the +% previous key=value options, by calling |\pinumber[option]| after +% \mbox{\textsf{unicode-math}}. % % \medskip % \DescribeMacro{\itpi} % When you activate |\pinumber|, the original italic $\itpi$ % is still accessible using |\itpi|. % +% \medskip % \DescribeMacro{\pinormal} -% In fact |\pinumber| acts as a switch, enabling the upright $\pi$. -% Additionally, there is an inverse switch, -% |\pinormal|, which you can call anywhere to revert to the original behavior -% of the |\pi| command (italic $\itpi$). +% In fact, |\pinumber| is a toggle, with its inverse toggle being |\pinormal|. +% The latter restores the |\pi| command to its default behavior. +% Thus, |\pinumber| can be used anywhere in the document (like |\pinormal|), +% but then without arguments and provided it has been initially called in the preamble, +% according to the procedures outlined above. % % \subsection{Vectors (and tensors)} % @@ -532,22 +624,22 @@ % (or |\|$\mid$ unless a plus (+) or minus (-) sign follows the opening delimiter) % or |\left\Vert| and |\right\Vert| % for adaptive delimiters. Unfortunately, these delimiters -% are always vertically centered, relatively to the middle of the base line, +% are always vertically centered, relatively to the mathematical center line, % whereas vectors with arrows are asymmetric objects. % The code |$\norm{\vec{h}}$| raises a smaller double bar to produce $\norm{\vec{h}}$ -% instead of $\left\Vert \vec{h} \right\Vert$. +% instead of $\Vert\vec{h}\Vert$ or $\left\Vert \vec{h} \right\Vert$. % Let's notice that the height of the bars don't adjust to content, % but however to context: main text, subscripts or exponents, % \eg $\e^{\norm{\vec{h}}}$. % This macro is useful only for arguments of special height, such as $\vec{h}$ or $\vect{AB}$ % and may give bad results in other situations. % -% \medskip +% \pagebreak % \DescribeMacro{\mathbfsfit}\DescribeMacro{\tensor} % For tensors symbols, ISO rules recommend using % sans serif bold italic, but there -% is no such math alphabet in the default \TeX\ mathematical style. -% However, the \textsf{mismath} package defines this alphabet +% is no such math alphabet in the default \LaTeX\ mathematical style. +% However, the \mbox{\textsf{mismath}} package defines this alphabet % (assuming the font encoding and package you use permits it) % and provides the macro |\mathbfsfit| or its alias |\tensor|. % By using |\tensor{T}| you can produce $\tensor{T}$. @@ -590,6 +682,7 @@ % in roman just like any standard function identifier. % This can be achieved with |\P| and |\E| commands. % +% \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|. @@ -599,11 +692,12 @@ % Variance is generally denoted by $\var$ or $\Var$ (see table below), % but some authors prefer to use $\V$, which can be produced using |\V|. % +% \medskip % \DescribeMacro{\MathProba}\DescribeMacro{\MathNormal} -% In the same way as for $\e$, $\i$ or $\j$, you can use |\MathUp{P}|, |\MathUp{E}| +% As for $\e$, $\i$ or $\j$, you can use |\MathUp{P}|, |\MathUp{E}| % or |\MathUp{V}| to avoid typing many |\P|, |\E| or |\V|. % However you can also achieve this in a single command with |\MathProba|, -% for example |\MathProba{P,E}|. We get the inverse switch with +% for example |\MathProba{P,E}|. We get the inverse toggle with % |\MathIt| for any individual letter or |\MathNormal| for a list. % % \medskip @@ -614,7 +708,7 @@ % For instance |\renewcommand\probastyle{\mathbb}| % \footnote{The effect of this redefinition is global or local to the container environment % in which it is used.} -% brings the previous ``openwork'' letters. +% brings the previous ``double-struck'' letters. % The |\mathbb| command comes from \textsf{amsfonts} package % (loaded by \textsf{amssymb} but also available standalone) % which needs to be called in the preamble. @@ -679,17 +773,20 @@ % % \subsection{A few useful aliases} \label{aliases} % +% \onlymathC % In the tradition of Bourbaki and D.~Knuth, proper use requires % that classic sets of numbers are typeset in bold roman: % $\R, \C, \Z, \N, \Q$, -% whereas ``openwork'' letters ($\mathbb{R}, \mathbb{Z}, \ldots$) +% whereas ``double-barred'' or ``openwork'' letters +% ($\mathbb{R}, \mathbb{C}, \mathbb{Z}, \ldots$) % are reserved for writing at the blackboard~\cite{LSHORT}. % Similarly, to designate a field we use $\F$ or $\K$ (Körper in German). -% We get obtain these symbols with the following macros: +% We obtain these symbols with the following macros: % \begin{center} % |\R|, |\C|, |\Z|, |\N|, |\Q|, |\F|, |\K|. % \end{center} % +% \medskip % \DescribeMacro{\mathset} % The |\mathset| command enables you to change the behavior % of all these macros in a global way. @@ -776,13 +873,13 @@ % of the \texttt{\string \underbrace} command, along with many other useful macros. % It is loaded by \textsf{mismath}.}, % making source code more compact.\\[2ex] -% \begin{minipage}{6.8cm} +% \begin{minipage}{6.4cm} % \begin{verbatim} %\[ (QAP)^n = \unbr{QAP\mul QAP\mul % \cdots\mul QAP}_{n\text{ times}} \] % \end{verbatim} % \end{minipage} -% \begin{minipage}{6.2cm}\vspace{-3ex} +% \begin{minipage}{6cm}\vspace{-3ex} % \[ (QAP)^n = \unbr{QAP\mul QAP\mul\cdots\mul QAP}_{n\text{ times}} \] % \end{minipage} % @@ -850,8 +947,8 @@ % For bars whose height has to adapt to the content, % we can use |\left\vert| \ldots |\right\vert| or, more simply, % the |\abs|\{\ldots\} command, which is equivalent -% \footnote{Another solution is to define \texttt{\string \abs} -% using the \texttt{\string \DeclarePairedDelimiter} command +% \footnote{We could also define \texttt{\string \abs} +% using \texttt{\string \DeclarePairedDelimiter} % from the \mbox{\textsf{mathtools}} package~\cite{TOOL}.}. % % \medskip @@ -876,8 +973,8 @@ % In that specific case, the space around the square brackets is often inappropriate, % as in the expression $x \in \mathclose{]} 0, +\infty[$. % To address this issue, we have redefined the brackets in the \textsf{ibrackets} -% package~\cite{BRACKET} -% which can be optionally +% package~\cite{BRACKET}. +% This one can be optionally % \footnote{This functionality is optional because there is a conflict % when using another command for open intervals with square brackets defined by % \texttt{\string \DeclarePairedDelimiter} from \textsf{mathtools}~\cite{TOOL}.} @@ -885,9 +982,10 @@ % Thus |$x\in ]-\pi,0[ \cup ]2\pi,3\pi[$| % \begin{align*} % \mbox{yields \ } -% x\in ]-\pi, 0[ \cup ]2\pi, 3\pi[ & \mbox{\ with \textsf{ibrackets}}, \\ +% x\in ]-\otherpi, 0[ \cup ]2\otherpi, 3\otherpi[ & \mbox{\ with \textsf{ibrackets}}, \\ % \mbox{instead of \ } -% x\in \mathclose{]}-\pi, 0 \mathopen{[} \cup \mathclose{]} 2\pi, 3\pi \mathopen{[} +% x\in \mathclose{]}-\otherpi, 0 \mathopen{[} \cup +% \mathclose{]} 2\otherpi, 3\otherpi \mathopen{[} % &\mbox{\ without \textsf{ibrackets}}. % \end{align*} % @@ -907,7 +1005,7 @@ % Conversely, when dealing with algebraic expressions involving intervals, % \emph{you must leave a blank space between the second bracket and the} +/- % \emph{operation}. -% For instance |$[a,b] + [c,d]$| yields $[a,b] + [c,d]$ +% For instance |$[a,b] +[c,d]$| yields $[a,b] +[c,d]$ % but |$[a,b]+ [c,d]$| yields $[a, b]+ [c, d]$. % % Besides, there are other approaches, for example the |\interval| macro @@ -931,7 +1029,7 @@ % \textsf{ncccomma} by Alexander I.~Rozhenko~\cite{NCC}. % The second package takes a more generic approach, % however it poses several compatibility issues, -% in particular when compiling with Lua\LaTeX, using \textsf{unicode-math} +% in particular when running through Lua\LaTeX, using \textsf{unicode-math} % and calling |\setmathfont|. % Therefore we propose the \textsf{decimalcomma} package~\cite{DEC}, % functionally identical to that of \textsf{ncccomma} but with lighter code @@ -961,13 +1059,13 @@ % This first example could also have been achieved using the \texttt{cases} environment % from the \textsf{amsmath} package, although \texttt{cases} places mathematical expressions % closer to the bracket. -% The |\systemsep| command allows you to adjust the gap between +% The |\systemsep| length allows you to adjust the gap between % the bracket and the expressions. -% By default, the gap is set to |\medspace|. You can reduce the gap by redefining the command, -% for instance: |\renewcommand{\systemsep}{\thinspace}|. +% By default, the gap is set to |\medspace|. You can reduce this gap by redefining +% the command, \eg: |\renewcommand{\systemsep}{\thinspace}|. % Alternatively you can increase the gap using |\thickspace| -% (and with |\renewcommand\systemsep}{}| you can achieve the same spacing as the -% \texttt{cases} environment). +% and the same spacing as of the \texttt{cases} environment +% is obtained with |\renewcommand\systemsep}{}|. % The |\systemsep| command allows for greater flexibility in adjusting the spacing % within the \texttt{system} environment. % @@ -1108,16 +1206,17 @@ % |\enumber| & |\MathUp{e}| \\ % |\inumber| & |\MathUp{i}| \\ % |\jnumber| & |\MathUp{j}| \\ -% |\PEupright| & |\MathUp{P}\MathUp{E}| \\ +% |\PEupright| & |\MathProba{PE}| \\ % \hline % \end{tabular} % \end{center} % % \medskip -% You can also utilize|\MathNumbers| instead of |\MathUp| with an argument containing +% You can also utilize |\MathNumbers| instead of |\MathUp| with an argument containing % all the constants you want to be typeset in roman (among `e, i, j'). -% Additionally |\MathProba{P,E}| can be used instead of |\MathUp{P}\MathUp{E}|, -% and you can include V in its argument to refer to variance. +% +% Additionally you can include V in the argument of |\MathProba| to refer to variance, +% (or even use |\MathUp{P}\MathUp{E}|). % % \medskip % In version 2.3 we attempted to replace these old commands @@ -1143,19 +1242,20 @@ \@ifpackageloaded{mathtools}{}{\RequirePackage{mathtools}} \@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}} \RequirePackage{ifthen} -\RequirePackage{xparse} % provides \NewDocumentCommand +%\RequirePackage{xparse} % provides \NewDocumentCommand, now in LaTeX3 \RequirePackage{xspace} \RequirePackage{iftex} \RequirePackage{etoolbox} % provides \AtEndPreamble +\RequirePackage{xkeyval} % \end{macrocode} % % The package \textsf{unicode-math} causes some compatibility issues -% with the options ibrackets or decimalcomma: the respective packages +% with the options \texttt{ibrackets} or \texttt{decimalcomma}: the respective packages % must be loaded \emph{after} \textsf{unicode-math}, % but \textsf{mismath} (like \textsf{amsmath}) must be loaded \emph{before} % \textsf{unicode-math}. -% And to complicate matters, \textsf{unicode-math} defines (or redefines) all its commands +% And to complicate matters, \textsf{unicode-math} defines all its commands % by |\AtBeginDocument|. % Therefore we used the command |\AtBeginDocument| within % |\AtEndPreamble| (from the \textsf{etoolbox} package). @@ -1413,58 +1513,151 @@ \newcommand{\PEupright}{ \PackageWarning{mismath}{Old command \string\PEupright\space is used. \MessageBreak - It can be replaced by \string\MathUp{P}\space - and \string\MathUp{E}} + It can be replaced by \string\MathProba{PE}} \MathUp{P}\MathUp{E} } % \end{macrocode} % -% Obtaining an upright Greek letter $\pi$ must be handled differently. -% The switches are called |\pinumber| and |\pinormal|. -% When given without an argument, |\pinumber| uses the LGR font encoding. -% A particularity of the \textsf{fontenc} package is that it can be loaded -% several times with different options without triggering an ``option clash'' error. -% This macro doesn't work with \textsf{unicode-math}, which provides -% the |\uppi| command but it cannot be redefined in |\pi|. +% Obtaining an upright Greek letter $\otherpi$ must be handled differently. +% The switches are called |\pinumber| and |\pinormal| +% and can be used anywhere in the document. +% +% But |\pinumber| must be called first in the preamble with an optional argument. +% This argument can be a valid command name that produces an upright pi letter +% (after having loading an appropriate package). +% When given without an argument in the preamble, +% |\pinumber| uses an LGR font encoding called \texttt{lmr}. +% A new feature (v2.11) is to use |\pinumber| with a keyval option to +% use many other Greek pi letters without loading +% a whole package, thus without altering the other (italic) Greek letters. +% We achieve this with |\DeclareSymbolFont| and |\DeclareMathSymbol|. +% We just have to know the ``name'' of the desired symbol font. +% Compatibility with \textsf{unicode-math} is a bit tricky! +% % \medskip % \begin{macrocode} -\newcommand*\pinumber[1][]{ - \ifmm@unicodemath - \PackageError{mismath}{Command \string\pinumber\space - is incompatible with unicode-math. \MessageBreak - Use \string\uppi\space to get the upright pi}{} - \fi - \@ifundefined{itpi}{\let\itpi\pi}{} - \ifthenelse{\equal{#1}{}}{ +\newif\ifmm@lgr +\define@cmdkey{pinumber}[mm@]{lgrmath}[lmr]{\mm@lgrtrue} +\newif\ifmm@upgreek +\define@choicekey{pinumber}{upgreek}[\mm@upgreek@option]% + {Euler,Symbol,Symbolsmallscale}[Symbol]{\mm@upgreektrue} +\newif\ifmm@mathdesign +\define@choicekey{pinumber}{mathdesign}[\mm@mathdesign@option]% + {Utopia,Garamond,Charter}[Charter]{\mm@mathdesigntrue} +\define@boolkey{pinumber}[mm@]{fourier}[true]{} +\newif\ifmm@kpfonts +\define@choicekey{pinumber}{kpfonts}[\mm@kp@option]% + {normal,light}[normal]{\mm@kpfontstrue} +\define@boolkey{pinumber}[mm@]{pxfonts}[true]{} +\define@boolkey{pinumber}[mm@]{txfonts}[true]{} + +\newcommand*\pinumber[1][]{% + \ifthenelse{\equal{#1}{}}{% no argument given \ifx\@onlypreamble\@notprerr % not in preamble \@ifundefined{savedpi}{ \PackageWarning{mismath}{% - \string\pinumber\space without argument\MessageBreak - must be used in the preamble first\MessageBreak - to load LGR fontenc for upright pi} + \string\pinumber\space + must be used in the preamble first} }{\let\pi\savedpi} \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 + \AtBeginDocument{\let\itpi\pi}% must be here with unicode-math + \AtEndPreamble{\AtBeginDocument{ + %\let\itpi\pi + \let\pi\relax + \DeclareFontEncoding{LGR}{}{} + \DeclareSymbolFont{mm@grup}{LGR}{lmr}{m}{n} + \DeclareMathSymbol{\pi}\mathalpha{mm@grup}{"70} + \let\savedpi\pi + }} \fi - }{ - \@ifundefined{#1}{ - \PackageWarning{mismath}{% - #1 must be a valid command name\MessageBreak - for pinumber, but command \bslash #1 - is undefined.\MessageBreak - Perhaps a missing package} - }{\renewcommand{\pi}{% - \csname #1\endcsname} - } + }{% command name or keyval options, necessarily in the preamble + \AtBeginDocument{\let\itpi\pi}% must be here with unicode-math + \AtEndPreamble{\AtBeginDocument{ + \@ifundefined{#1}{% + \setkeys{pinumber}{#1} + \let\pi\relax + \ifmm@lgr + \DeclareFontEncoding{LGR}{}{} + \DeclareSymbolFont{mm@grup}{LGR}{\mm@lgrmath}{m}{n} + % may work with bold (b) instead of m + \DeclareMathSymbol{\pi}{\mathalpha}{mm@grup}{112} + + \else\ifmm@upgreek + \ifdefstring{\mm@upgreek@option}{Euler}{ + \DeclareFontFamily{U}{eur}{\skewchar\font'177} + \DeclareFontShape{U}{eur}{m}{n}{% + <-6> eurm5 <6-8> eurm7 <8-> eurm10}{} + \DeclareFontShape{U}{eur}{b}{n}{% + <-6> eurb5 <6-8> eurb7 <8-> eurb10}{} + \DeclareSymbolFont{mm@grup}{U}{eur}{m}{n} + \DeclareMathSymbol{\pi}{\mathord}{mm@grup}{"19} % 25 + }{ + \ifdefstring{\mm@upgreek@option}{Symbol}{ + \DeclareSymbolFont{mm@grup}{U}{psy}{m}{n} + \DeclareMathSymbol{\pi}{\mathord}{mm@grup}{`p} + }{ + \ifdefstring{\mm@upgreek@option}{Symbolsmallscale}{ + \DeclareFontFamily{U}{fsy}{} + \DeclareFontShape{U}{fsy}{m}{n}{<->s*[.9]psyr}{} + \DeclareSymbolFont{mm@grup}{U}{fsy}{m}{n} + \DeclareMathSymbol{\pi}{\mathord}{mm@grup}{`p} + }{}}} + + \else\ifmm@mathdesign + \ifdefstring{\mm@mathdesign@option}{Utopia}{ + \DeclareSymbolFont{mm@grup}{OML}{mdput}{m}{n} + }{ + \ifdefstring{\mm@mathdesign@option}{Garamond}{ + \DeclareSymbolFont{mm@grup}{OML}{mdugm}{m}{n} + }{ + \ifdefstring{\mm@mathdesign@option}{Charter}{ + \DeclareSymbolFont{mm@grup}{OML}{mdbch}{m}{n} + }{}}} + + \else\ifmm@fourier + \DeclareFontEncoding{FML}{}{} + \DeclareSymbolFont{mm@grup}{FML}{futm}{m}{it} + + \else\ifmm@kpfonts + \ifdefstring{\mm@kp@option}{normal}{ + \DeclareSymbolFont{mm@grup}{U}{jkpmia}{m}{it} + }{ + \ifdefstring{\mm@kp@option}{light}{ + \DeclareSymbolFont{mm@grup}{U}{jkplmia}{m}{it} + }} + + \else\ifmm@pxfonts + \DeclareSymbolFont{mm@grup}{U}{pxmia}{m}{it} + + \else\ifmm@txfonts + \DeclareSymbolFont{mm@grup}{U}{txmia}{m}{it} + \fi\fi\fi\fi\fi + + \DeclareMathSymbol{\pi}{\mathord}{mm@grup}{"19} + \fi\fi + + \let\savedpi\pi + }{\renewcommand{\pi}{\csname #1\endcsname}\let\savedpi\pi} + }} } -} +} -\newcommand{\pinormal}{\@ifundefined{itpi}{}{\let\pi\itpi}} +\newcommand{\pinormal}{% + \@ifundefined{itpi}{ + \PackageWarning{mismath}{Command \string\itpi\space undefined, + \MessageBreak + use \string\pinumber\space in the preamble first} + }{ + \ifmm@unicodemath + \@ifundefined{savedpi}{ + \PackageError{mismath}{Before using \string \pinormal, + \MessageBreak + you must call \string\pinumber\space in the preamble}{}} + \fi + \let\pi\itpi + } +} % \end{macrocode} % @@ -1702,7 +1895,7 @@ % \bibitem{SPAL} \emph{The \textsf{spalign} package}, Joseph Rabinoff, CTAN, 2016/10/05. % \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.8 2024/01/22. +% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}, Antoine Missier, CTAN, v2.10 2024/02/25. % \bibitem{BRACKET} \emph{Intelligent brackets -- The \textsf{ibrackets} package}, % Antoine Missier, CTAN, v1.2, 2023/07/26. % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe}, diff --git a/Master/texmf-dist/source/latex/mismath/mismath.ins b/Master/texmf-dist/source/latex/mismath/mismath.ins index 5a39f8da297..b57ee6b828b 100644 --- a/Master/texmf-dist/source/latex/mismath/mismath.ins +++ b/Master/texmf-dist/source/latex/mismath/mismath.ins @@ -46,7 +46,7 @@ and version 1.3 or later is part of all distributions of LaTeX version \Msg{* mismath.sty *} \Msg{* *} \Msg{* To produce the documentation run the file mismath.dtx *} -\Msg{* through LaTeX. *} +\Msg{* through XeLaTeX or LuaLaTeX. *} \Msg{* *} \Msg{* Happy TeXing! *} \Msg{* *} |