texlive[74792] Master/texmf-dist: math-operator (30mar25)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 30 22:32:56 CEST 2025


Revision: 74792
          https://tug.org/svn/texlive?view=revision&revision=74792
Author:   karl
Date:     2025-03-30 22:32:56 +0200 (Sun, 30 Mar 2025)
Log Message:
-----------
math-operator (30mar25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/math-operator/README.txt
    trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_code.pdf
    trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_heading.tex
    trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_user_guide.tex
    trunk/Master/texmf-dist/doc/latex/math-operator/user_guide/math-operator_user_guide.pdf
    trunk/Master/texmf-dist/source/latex/math-operator/math-operator_code.dtx
    trunk/Master/texmf-dist/tex/latex/math-operator/math-operator.sty

Modified: trunk/Master/texmf-dist/doc/latex/math-operator/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/math-operator/README.txt	2025-03-30 00:49:07 UTC (rev 74791)
+++ trunk/Master/texmf-dist/doc/latex/math-operator/README.txt	2025-03-30 20:32:56 UTC (rev 74792)
@@ -1,10 +1,10 @@
-           LaTeX Package math-operator v. 1.0
+           LaTeX Package math-operator v. 1.1
                Installation Guide/README
                     Conrad Kosowsky
 
 
-This file is README.txt from version 1.0 of the free and
-open-source LaTeX package "math-operator," released February
+This file is README.txt from version 1.1 of the free and
+open-source LaTeX package "math-operator," released March
 2025. The operator package defines some one hundred and
 fifty math operator control sequences and provides an
 interface to define more. See the user guide for more

Modified: trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_heading.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_heading.tex	2025-03-30 00:49:07 UTC (rev 74791)
+++ trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_heading.tex	2025-03-30 20:32:56 UTC (rev 74792)
@@ -6,8 +6,8 @@
 %%
 %% math-operator_code.dtx  (with options: `heading')
 %% 
-%% This file is from version 1.0 of the free and open-source
-%% LaTeX package "math-operator," released February 2025.
+%% This file is from version 1.1 of the free and open-source
+%% LaTeX package "math-operator," released March 2025.
 %% 
 %% Copyright 2025 Conrad Kosowsky
 %% 
@@ -61,8 +61,8 @@
 \csname count@\endcsname\catcode`\@
 \makeatletter
 
-\def\packagedate{February 2025}
-\def\packageversion{1.0}
+\def\packagedate{March 2025}
+\def\packageversion{1.1}
 
 \let\@@section\section
 \def\section{\relax
@@ -106,6 +106,12 @@
   {\strut\par\vskip 5pt plus 1pt minus 3pt\relax
     \egroup\hfill\break\strut\ignorespacesafterend}
 \def\vrb#1{\expandafter\texttt\expandafter{\string#1}}
+\protected\def\XeTeX{X\kern-0.1em
+  \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
+  \TeX}
+\protected\def\XeLaTeX{X\kern-0.1em
+  \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
+  \LaTeX}
 \parskip=0pt
 
 {\large

Modified: trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_user_guide.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_user_guide.tex	2025-03-30 00:49:07 UTC (rev 74791)
+++ trunk/Master/texmf-dist/doc/latex/math-operator/math-operator_user_guide.tex	2025-03-30 20:32:56 UTC (rev 74792)
@@ -6,8 +6,8 @@
 %%
 %% math-operator_code.dtx  (with options: `user')
 %% 
-%% This file is from version 1.0 of the free and open-source
-%% LaTeX package "math-operator," released February 2025.
+%% This file is from version 1.1 of the free and open-source
+%% LaTeX package "math-operator," released March 2025.
 %% 
 %% Copyright 2025 Conrad Kosowsky
 %% 
@@ -68,6 +68,7 @@
   parsep=0pt,partopsep=0pt}
 \usepackage[colorlinks=true,allcolors=blue,implicit=false]{hyperref}
 \usepackage{amssymb}
+\usepackage{graphicx}
 \usepackage{multicol}
 \usepackage{shortvrb}
 \MakeShortVerb{|}
@@ -88,7 +89,7 @@
 \input math-operator_heading.tex
 \def\section#1#2{\@@section*{#1}\vskip-\medskipamount#2\par\bigskip}
 
-\noindent \LaTeX\ users will no doubt be familiar with the control sequences that produce special functions and operators such as |\sin|, |\cos|, or |\sup|. However, the \LaTeX\ kernel defines only about 30 such commands, and many less common but still widely used special functions remain undefined as a result. The \textsf{math-operator} package addresses this situation by defining control sequences for some hundred and fifty special functions and operators, divided into nine groups, and the package also provides an interface to define even more. The first three pages of this user guide describe how to use the package, and the remainder of the document lists the control sequences in each group. For documentation of the package code, please see |math-operator_code.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. I encourage users who are interested in this package to also consult the \textsf{amsopn} and \textsf{moremath} packages as they may be more useful for you.\footnote{\LaTeX3 Project and American Mathematical Society, ``amsopn---Typeset mathematical operator names,'' \href{https://ctan.org/pkg/amsopn}{\texttt{https://ctan.org/pkg/amsopn}}; Marcel Ilg, ``moremath---Additional commands for typesetting maths,'' \href{https://ctan.org/pkg/moremath}{\texttt{https://ctan.org/pkg/moremath}}.} Users who are looking specifically for operators in quantum mechanics should consult the \textsf{linop} and \textsf{phfqit} packages.\footnote{Johannes Weytjens, ``linop---Typeset linear operators as they appear in quantum theory or linear algebra,'' \href{https://ctan.org/pkg/linop}{\texttt{https://ctan.org/pkg/linop}}; Philippe Faist, ``phfqit---Macros for typesetting Quantum Information Theory,'' \href{https://ctan.org/pkg/phfqit}{\texttt{https://ctan.org/pkg/phfqit}}.}
+\noindent \LaTeX\ users will no doubt be familiar with the control sequences that produce special functions and operators such as |\sin|, |\cos|, or |\sup|. However, the \LaTeX\ kernel defines only about 30 such commands, and many less common but still widely used special functions remain undefined as a result. The \textsf{math-operator} package addresses this situation by defining control sequences for some hundred and fifty special functions and operators, divided into nine groups, and the package also provides an interface to define even more. The first pages of this user guide describe how to use the package, and the rest of the document lists the control sequences in each group. For documentation of the package code, please see |math-operator_code.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. I encourage users who are interested in this package to also consult the \textsf{amsopn} and \textsf{moremath} packages as they may be more useful for you.\footnote{\LaTeX3 Project and American Mathematical Society, ``amsopn---Typeset mathematical operator names,'' \href{https://ctan.org/pkg/amsopn}{\texttt{https://ctan.org/pkg/amsopn}}; Marcel Ilg, ``moremath---Additional commands for typesetting maths,'' \href{https://ctan.org/pkg/moremath}{\texttt{https://ctan.org/pkg/moremath}}.} Users who are looking specifically for operators in quantum mechanics should consult the \textsf{linop} and \textsf{phfqit} packages.\footnote{Johannes Weytjens, ``linop---Typeset linear operators as they appear in quantum theory or linear algebra,'' \href{https://ctan.org/pkg/linop}{\texttt{https://ctan.org/pkg/linop}}; Philippe Faist, ``phfqit---Macros for typesetting Quantum Information Theory,'' \href{https://ctan.org/pkg/phfqit}{\texttt{https://ctan.org/pkg/phfqit}}.}
 
 Users can load \textsf{math-operator} with the standard |\usepackage| syntax, and for each operator group, the package defines either all or no control sequences from that group during loading. Each operator group corresponds to two optional package arguments---one argument means define the control sequences of that group, and the other argument means avoid doing so. Table~1 lists the nine operator groups and their corresponding arguments. For every group, the package argument to define control sequences is a shortened version of the group name, and the package argument to avoid doing so is the same keyword prefaced by |no-|. By default, \textsf{math-operator} defines all control sequences that appear later in this document.
 
@@ -128,7 +129,7 @@
 \end{trivlist}
 The syntax and implementation of these macros is very similar to the \textsf{amsopn} package.
 
-The entries of Table~2 differ in the appearance of the resulting operator. The commands in the first column produce operators with medium text, and the commands in the second column produce operators with bold text. The difference between the rows is more subtle and boils down to the automatic spacing before and after the operator.\footnote{\TeX's eight classes of math subformulas are beyond the scope of this user guide, but in summary, the horizontal position of different characters in an equation depends on their math classes. See Donald Knuth, \textit{The TEXbook} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced TEXbook} (Springer, 1995), 256–258.} The macros from the first row instruct \TeX\ to treat the operator like an ordinary variable, so they are most appropriate for sets and categories. The macros from the second row instruct \TeX\ to horizontally position the operator like a summation or integral sign, and they are appropriate for functions and probability distributions. But if you are not overly fastidious, for most uses of this package other than category theory, you will probably be fine to just use |\DeclareMathOperator|.
+The entries of Table~2 differ in the appearance of the resulting operator. The commands in the first column produce operators with medium text, and the commands in the second column produce operators with bold text. The difference between the rows is more subtle and boils down to the automatic spacing before and after the operator.\footnote{\TeX's eight classes of math subformulas are beyond the scope of this user guide, but in summary, the horizontal position of different characters in an equation depends on their math classes. See Donald Knuth, \textit{The \TeX book} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced \TeX book} (Springer, 1995), 256–258.} The macros from the first row instruct \TeX\ to treat the operator like an ordinary variable, so they are most appropriate for sets and categories. The macros from the second row instruct \TeX\ to horizontally position the operator like a summation or integral sign, and they are appropriate for functions and probability distributions. But if you are not overly fastidious, for most uses of this package other than category theory, you will probably be fine to just use |\DeclareMathOperator|.
 
 The macros in Table~2 will happily redefine any operator commands, but they will not overwrite other control sequences unless you specifically tell them to do so. The count variable |\operatordefmode| controls the package behavior in this regard as follows:
 \begin{itemize}
@@ -153,14 +154,31 @@
 \end{trivlist}
 will put an overline above $xyz$ that is 90\% the length of $xyz$ and position it exactly halfway between the start of the $x$ and the end of the $z$.
 
-When |\overbar| does not have an asterisk (the default version of the command), the count variable |\operatorbaroffset| controls the horizontal placement of the line. As is standard in \TeX, this variable should take values between 0 and 1000, and \textsf{math-operator} divides |\operatorbaroffset| by 1000 to form a fraction. It then places the overline that fraction of the way across the top of the subformula. The default value is 800. For example, saying
+When |\overbar| does not have an asterisk (the default version of the command), the count variable |\overbaroffset| controls the horizontal placement of the line.\footnote{Version 1.0 of this package used \vrb\operatorbaroffset\ instead of \vrb\overbaroffset. To preserve backwards compatibility, \vrb\operatorbaroffset\ still works for this purpose. But please don't use \vrb\operatorbaroffset\ because I may take it out in a few years.} As is standard in \TeX, this variable should take values between 0 and 1000, and \textsf{math-operator} divides |\overbaroffset| by 1000 to form a fraction. It then places the overline that fraction of the way across the top of the subformula. The default value is 800. For example, saying
 \begin{trivlist}
-\item \hskip 2em\ttfamily |\operatorbaroffset=0|
+\item \hskip 2em\ttfamily |\overbaroffset=0|
 \end{trivlist}
-will make all following |\overbar| lines appear completely on the left side of the subformula, and an asterisk is equivalent to setting |\operatorbaroffset| to 500.
+will make all following |\overbar| lines appear completely on the left side of the subformula, and an asterisk is equivalent to setting |\overbaroffset| to 500.
 
-Finally, the package defines two other user-level commands. Because it may redefine |\P|, \textsf{math-operator} always defines |\pilcrow| to typeset the \P\ symbol in text and math modes. The macro |\operatorhyphen| will typeset a hyphen when used in the definition of an operator control sequence or in a local font-change command for math such as |\mathrm| or |\mathbf|. Using |\operatorhyphen| in any other situation will result in an error.
 
+Some operator names contain characters that are not letters, and \textsf{math-operator} provides three control sequences for non-letter characters: |\operatorhyphen| produces a hyphen, |\operatorsquared| produces a superscript 2, and |\operatorinverse| produces a superscript $-1$. If you use a Unicode font for the operator font, \textsf{math-operator} typesets these symbols in the operator font, and inside the bold commands from Table~2, they will be bold. Additionally, each command has a starred version that forces the characters to be bold no matter where they appear in an equation. If you do not use a Unicode font, the hyphen and the squared symbol will work the same way, but |\operatorinverse| instead typesets the contents of |\defaultinverse|, which is normally $-1$, without using the operator font and without using boldface in the starred version of the command.\footnote{This complication arises because the minus sign lives in different places depending on the encoding. In Unicode, the minus sign is U+2212, but that is not true for other font encodings in \TeX.} If you are in this situation and are unsatisfied with the formatting of your $-1$ expressions, I encourage you to redefine |\defaultinverse| to be more to your liking with |\def| or |\renewcommand|.
+
+A word about superscripts: I implemented the commands from Table~2 in a way that \TeX\ treats operator names as subformulas. This means that any super or subscripts will always appear after or above or below the operator, even if you end the operator name with a super or subscript. For example, if you define an inverse projection map as
+\begin{trivlist}
+\item \hskip 2em |\DeclareMathOperator{\projinv}{proj\operatorinverse}|
+\end{trivlist}
+in your document preamble and then attach a subscript as in
+\begin{trivlist}
+\item\hskip2em |\projinv_x|
+\end{trivlist}
+you will see $\mathop{\operator at font proj^{-1}}_x$ instead of $\mathop{\operator at font proj}^{-1}_x$. If your operator name ends with a super or subscript, I recommend putting everything before the final super or subscript into the appropriate command from Table~2 and then defining a separate macro using |\def| or |\newcommand|. For example, it is better to define an inverse projection map as
+\begin{trivlist}
+\item\hskip2em |\def\projinv{\proj\operatorinv}|
+\end{trivlist}
+rather than using |\DeclareMathOperator|. I took this approach in designing \textsf{math-operator}, so to redefine operators from this package that end in superscripts, you should use |\def| or |\renewcommand| instead of a control sequence from Table~2.
+
+Finally, because it may redefine |\P|, \textsf{math-operator} defines |\pilcrow| to typeset the \P\ symbol in text and math modes.
+
 \bigskip
 
 \centerline{***}
@@ -169,7 +187,7 @@
 \vskip-\medskipamount
 \vskip\z@
 
-\section{Blackboard Bold}{Note: to use the blackboard-bold commands listed here, you must load a package that defines \vrb\mathbb\space such as \textsf{amssymb} or \textsf{mathfont}, and that command should provide access to blackboard-bold characters. If you do not do so before using these control sequences, you'll get an error.}
+\section{Blackboard Bold}{Note: to use the blackboard-bold commands listed here, you must load a package that defines \vrb\mathbb\space such as \textsf{amssymb} or \textsf{mathfont}, and if you do not do so before using these control sequences, you'll get an error. I am assuming that \vrb\mathbb\space provides access to blackboard-bold letters.}
 
 \showop\N{$\mathbb N$}{Natural numbers}
 \showop\Z{$\mathbb Z$}{Integers}
@@ -181,7 +199,7 @@
 \showop\P{$\mathbb P$}{Probability}
 \showop\E{$\mathbb E$}{Expectation}
 
-\section{Categories}{I am not a category theorist, and serious category theorists who use this package will undoubtedly want to define more categories in their own documents using \vrb\DeclareBoldMathText. If I missed any common categories that should be on this list, I am very open to expanding it.}
+\section{Categories}{I am not a category theorist, and serious category theorists who use this package will undoubtedly want to define more categories in their own documents using \vrb\DeclareBoldMathText. If I missed any common categories that should be on this list, I am happy to expand it.}
 
 \showop{\Ab}{\textbf{Ab}}{Category of abelian groups}
 \showop{\Alg}{\textbf{Alg}}{Category of algebras}
@@ -206,8 +224,6 @@
 \showop{\cone}{cone}{Cone}
 \showop{\op}{$^{\operator at font op}$}{Opposite category}
 
-\vfil
-
 \section{Jacobi Elliptic Functions}{Pretty straightforward. If you load \textsf{math-operator} with |jacobi|, you won't be able to use \vrb\sc\ to change to a small-caps font. (But you shouldn't use \vrb\sc\ anyway because it's deprecated.)}
 
 \showop{\cd}{cd}{}
@@ -243,45 +259,40 @@
 
 \section{Overlining}{Loading \textsf{math-operator} with the |overbar| option tells the package to define \vrb\overbar. Below are two examples of this macro with \vrb\bar\space and \vrb\overline\space for comparison.}
 
-{\columnsep\z@
-\multicolsep\z@
-\begin{multicols}{2}
-\tabcolsep\z@
+\def\showbars#1#2#3#4{%
+  \noindent
+    \hb at xt@ 0.25\textwidth{#1\hfil}%
+    \hb at xt@ 0.25\textwidth{#2\hfil}%
+    \hb at xt@ 0.25\textwidth{#3\hfil}%
+    \hb at xt@ 0.25\textwidth{#4\hfil}\par}
 
-\setbox\@tempboxa\hbox{%
-  \setbox\@tempboxa\hbox{$a$}%
-  \@tempdima\wd\@tempboxa
-  \@tempdimb\ht\@tempboxa
-  \rlap{\box\@tempboxa}%
-  \hskip 0.16\@tempdima
-  $\overline{\vrule height \@tempdimb width \z@ depth \z@
-    \hskip 0.8\@tempdima}\m at th$}
+\showbars{\texttt{\string\bar\ a}}{$\bar a$}
+  {\texttt{\string\bar\ X}}{$\bar X$}
 
-\noindent\begin{tabular}{p{0.5\columnwidth}l}
-|\bar a| & $\bar a$\\
-|\overbar a| & \box\@tempboxa\\
-|\overline a| & $\overline a$
-\end{tabular}
+\showbars{\texttt{\string\overbar\ a}}
+  {\setbox\@tempboxa\hbox{%
+    \setbox\@tempboxa\hbox{$a$}%
+    \@tempdima\wd\@tempboxa
+    \@tempdimb\ht\@tempboxa
+    \hb at xt@\z@{\box\@tempboxa\hss}%
+    \hskip 0.16\@tempdima
+    $\overline{\vrule height \@tempdimb width \z@ depth \z@
+      \hskip 0.8\@tempdima}\m at th$}%
+    \box\@tempboxa}
+  {\texttt{\string\overbar\ X}}
+  {\setbox\@tempboxa\hbox{%
+    \setbox\@tempboxa\hbox{$X$}%
+    \@tempdima\wd\@tempboxa
+    \@tempdimb\ht\@tempboxa
+    \rlap{\box\@tempboxa}%
+    \hskip 0.16\@tempdima
+    $\overline{\vrule height \@tempdimb width \z@ depth \z@
+      \hskip 0.8\@tempdima}\m at th$}%
+    \box\@tempboxa}
 
-\columnbreak
+\showbars{\texttt{\string\overline\ a}}{$\overline a$}
+  {\texttt{\string\overline\ X}}{$\overline X$}
 
-\setbox\@tempboxa\hbox{%
-  \setbox\@tempboxa\hbox{$X$}%
-  \@tempdima\wd\@tempboxa
-  \@tempdimb\ht\@tempboxa
-  \rlap{\box\@tempboxa}%
-  \hskip 0.16\@tempdima
-  $\overline{\vrule height \@tempdimb width \z@ depth \z@
-    \hskip 0.8\@tempdima}\m at th$}
-
-\noindent\begin{tabular}{p{0.5\columnwidth}l}
-|\bar X| & $\bar X$\\
-|\overbar X| & \box\@tempboxa\\
-|\overline X| & $\overline X$
-\end{tabular}
-
-\end{multicols}\par}
-
 \section{Probability Distributions}{A selection of the most common probability distributions. For the normal distribution, if you type \vrb\Normal\ without the asterisk, you will see $\mathcal N$, and if you include the asterisk after \vrb\Normal, then \textsf{math-operator} will write out ``Normal.''}
 
 \showop{\Bernoulli}{Bernoulli}{}
@@ -347,11 +358,13 @@
 \showop{\curl}{curl}{Curl}
 \showop{\divop}{div}{Divergence}
 \showop{\grad}{grad}{Gradient}
+\showop{\Hess}{$\mathcal{H}$}{Hessian}
 \showop{\Hom}{Hom}{Collection of morphisms}
 \showop{\id}{id}{Identity}
 \showop{\Im}{Im}{Imaginary part}
 \showop{\varIm}{$\Im$}{Imaginary part\footnotemark}\footnotetext{In the \LaTeX\ kernel, \texttt{\string\Im} produces $\Im$, but I decided to change that since Im is more standard than $\Im$.}
 \showop{\img}{img}{Image}
+\showop{\Info}{$\mathcal{I}$}{Fisher Information}
 \showop{\interior}{int}{Interior}
 \showop{\lcm}{lcm}{Least common multiple}
 \showop{\Proj}{Proj}{Projective spectrum}
@@ -373,7 +386,7 @@
 \showop{\arccosh}{arccosh}{Inverse hyperbolic cosine}
 \showop{\arctanh}{arctanh}{Inverse hyperbolic tangent}
 \showop{\arccsch}{arccsch}{Inverse hyperbolic cosecant}
-\showop{\arcsech}{arcsech}{Invesse hyperbolic secant}
+\showop{\arcsech}{arcsech}{Inverse hyperbolic secant}
 \showop{\arccoth}{arccoth}{Inverse hyperbolic tangent}
 \showop{\arsinh}{arsinh}{Inverse hyperbolic sine}
 \showop{\arcosh}{arcosh}{Inverse hyperbolic cosine}

Modified: trunk/Master/texmf-dist/doc/latex/math-operator/user_guide/math-operator_user_guide.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/math-operator/math-operator_code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/math-operator/math-operator_code.dtx	2025-03-30 00:49:07 UTC (rev 74791)
+++ trunk/Master/texmf-dist/source/latex/math-operator/math-operator_code.dtx	2025-03-30 20:32:56 UTC (rev 74792)
@@ -1,9 +1,9 @@
 % \iffalse     ---!!! FIRST META-COMMENT !!!---
 % 
 % 
-% This file is operator_code.dtx from version 1.0
+% This file is operator_code.dtx from version 1.1
 % of the free and open-source LaTeX package "math-operator,"
-% released February 2025.
+% released March 2025.
 % 
 % Running Plain TeX on math-operator_code.dtx will
 % produce the following files:
@@ -37,8 +37,8 @@
 % \iffalse     ---!!! SECOND META-COMMENT !!!---
 % 
 % 
-% This file is from version 1.0 of the free and open-source
-% LaTeX package "math-operator," released February 2025.
+% This file is from version 1.1 of the free and open-source
+% LaTeX package "math-operator," released March 2025.
 % 
 % Copyright 2025 Conrad Kosowsky
 % 
@@ -126,8 +126,8 @@
 \askforoverwritefalse
 \preamble
 
-This file is from version 1.0 of the free and open-source
-LaTeX package "math-operator," released February 2025.
+This file is from version 1.1 of the free and open-source
+LaTeX package "math-operator," released March 2025.
 
 Copyright 2025 Conrad Kosowsky
 
@@ -234,7 +234,6 @@
   
   \section*{Index}
   
-  
   \input math-operator_code.ind
   
 \end{document}
@@ -242,7 +241,7 @@
 %<*code>
 % \fi
 % 
-% \CheckSum{1354}
+% \CheckSum{1465}
 % \init at checksum
 % 
 % \makeatother\CharacterTable
@@ -288,11 +287,13 @@
 %   \DeclareBoldMathOperator,\DeclareBoldMathText,\DeclareMathOperator,
 %   \@ifnextchar,\@operator at ofalse,\@operator at otrue,\if at operator@o,
 %   \@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\dimexpr,
-%   \setbox,\unhbox,\hskip,\ht,\wd,\dp,\hfil,\mathrm,\mathbf,\vrule}
+%   \setbox,\unhbox,\hskip,\ht,\wd,\dp,\hfil,\mathrm,\mathbf,\vrule,
+%   \mathchardef,\mathchar,\Umathchardef,\Uchar,\@bfop at false,\@bfop at true,
+%   \if at bfop@,\iffontchar}
 % 
 % 
 % 
-% \noindent This file documents the code for the \textsf{math-operator} package. It is not a user guide! If you are looking for instructions on how to typeset math operators in your equations, please see |math-operator_user_guide.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. The first two sections of this file deal with package setup and the commands to define new operators, and the remaining sections document the operators defined in this package. Section~3 covers several blackboard-bold letters, and Section~4 discusses categories. Section~5 deals with Jacobi elliptic functions, and Section~6 defines matrix groups and linear algebra operations. Section~7 defines the command to produce an overline. Section~8 defines a number of common probability distributions. Section~9 deals with special functions, and Section~10 covers other standard operators. Finally, Section~11 defines trigonometric functions. Version history and code index appear at the end of the document.
+% \noindent This file documents the code for the \textsf{math-operator} package. It is not a user guide! If you are looking for instructions on how to typeset math operators in your equations, please see |math-operator_user_guide.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. The first three sections of this file deal with package setup and the commands to define new operators, and the remaining sections document the operators defined in this package. Section~4 covers several blackboard-bold letters, and Section~5 discusses categories. Section~6 deals with Jacobi elliptic functions, and Section~7 defines matrix groups and linear algebra operations. Section~8 defines the command to produce an overline. Section~9 defines a number of common probability distributions. Section~10 deals with special functions, and Section~11 covers other standard operators. Finally, Section~12 defines trigonometric functions. Version history and code index appear at the end of the document.
 % 
 % 
 % 
@@ -302,7 +303,7 @@
 % \noindent We begin with package declaration. The first 59 lines of |operator.sty| are comments.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{operator}[2025/02/27 Package math-operator v. 1.0]
+\ProvidesPackage{math-operator}[2025/03/29 Package math-operator v. 1.1]
 %    \end{macrocode}
 % Create booleans that we'll use for option processing. One boolean per category of operator.
 %    \begin{macrocode}
@@ -365,14 +366,39 @@
 \newcount\operatordefmode
 \operatordefmode\@ne
 %    \end{macrocode}
-% It is helpful to have a command |\@operatorhyphen| that pulls a hyphen from the operator font because some operators contain a hyphen. (In particular, a number of probability distributions have hyphens in their names.) Typesetting a hyphen without |\textrm{|\dots|}| is complicated because |\operator at font| may not (probably won't) do anything to the |\mathcode| of hyphens, so just typing |-| will leave us with a minus sign instead of punctuation. Accordingly, we manually insert a hyphen using |\mathchar| or |\Umathchar|. The math character class is 0 (|\mathord|), and we take the family of the operator font from |\fam|. This means that |\@operatorhyphen| should appear only after |\operator at font|. Because bold operators with this package make use of \textsc h mode, we also make the command useable outside \textsc m mode, where it expands to the usual |-| character.
+% Boolean that is false in general and true whenever we are typesetting a bold operator.
 %    \begin{macrocode}
+\newif\if at bfop@
+\@bfop at false
+%    \end{macrocode}
+% 
+% \section{Extra User-Level Commands}
+% 
+% Some math operators contain characters other than letters, and we define control sequences to access three expressions from the operator font:
+% \begin{itemize}
+%   \item |\@operatorhyphen| typesets a hyphen in the |\fam|
+%   \item |\@operatortw@| typesets 2 in the |\fam|
+%   \item |\@operatorm at ne| typesets $-1$ possibly in the |\fam|
+% \end{itemize}
+% Later in this section, we define user-level wrappers around these control sequences, and the user-level commands for squared and inverse operators format the expression as a superscript. I am assuming that the operator font contains the appropriate glyphs in the encoding slots for hyphen, |1|, and |2|, so we can define |\@operatorhyphen| and |\@operatortw@| as |\mathalpha| characters using |\mathchardef| or |\Umathchardef|.
+%    \begin{macrocode}
+\def\defaultinverse{-1}
 \ifdefined\Umathchar
-  \protected\edef\@operatorhyphen{%
-      \Umathchar+0+\noexpand\the\fam+\number`\-\relax}
+  \Umathchardef\@operatorhyphen=+7+0+`\-\relax
+  \Umathchardef\@operatortw@=+7+0+`2\relax
 %    \end{macrocode}
-% For the case where |\Umathchar| is undefined, we have to convert |\number`\-| to hexadecimal, and we use the same approach as |\set at mathchar| from the \LaTeX\ kernel.
+% The minus sign is tricky because it may change its location depending on the encoding. For $-1$, we first check if the |\fam| contains a glyph in slot |"2212|. If yes, we typeset $-1$ in the operator font, and if not, we forget about the operator font entirely and typeset |\defaultinverse| (which is $-1$ by default) with $|\fam|=-1$.
 %    \begin{macrocode}
+  \edef\@operatorm at ne{%
+    \noexpand\iffontchar\textfont\fam"2212\relax
+      \Umathchar+0+\fam"2212\relax
+      \Umathchar+0+\fam+\number`1\relax
+    \noexpand\else
+      \begingroup\fam\m at ne\noexpand\defaultinverse\endgroup
+    \noexpand\fi}
+%    \end{macrocode}
+% For the case where |\Umathchar| is undefined, we have to convert encoding slots for the hyphen an two numbers into hexadecimal. We use the same approach as |\set at mathchar| from the \LaTeX\ kernel. First is the math-mode hyphen.
+%    \begin{macrocode}
 \else
   \begingroup
     \@tempcntb=\number`\-\relax
@@ -381,41 +407,111 @@
     \@tempcnta\count@
     \multiply\count@ by 16\relax
     \advance\@tempcntb by -\count@
-    \protected\xdef\@operatorhyphen{%
-      \mathchar"0%
-        \noexpand\hexnumber@\fam
-        \hexnumber@\@tempcnta
-        \hexnumber@\@tempcntb\relax}
+    \global\mathchardef\@operatorhyphen
+      "70\hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax
+%    \end{macrocode}
+% Next is 2.
+%    \begin{macrocode}
+    \@tempcntb=\number`2\relax
+    \count@\@tempcntb
+    \divide\count@ by 16\relax
+    \@tempcnta\count@
+    \multiply\count@ by 16\relax
+    \advance\@tempcntb by -\count@
+    \global\mathchardef\@operatortw@
+      "70\hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax
   \endgroup
+%    \end{macrocode}
+% For the inverse symbol, we just use |\defaultinverse|.
+%    \begin{macrocode}
+  \def\@operatorm at ne{\begingroup\fam\m at ne\defaultinverse\endgroup}
 \fi
 %    \end{macrocode}
-% We make two miscellaneous control sequences: first, a different name for pilcrow symbol (because \textsf{math-operator} may overwrite |\P|) and second, user-level access to the math-mode hyphen.
+% Now provide user-level access to those three control sequences. Each command has a starred version, which typesets the characters in bold if possible. The default, unstarred version can appear anywhere in an equation. The general idea behind both starred and unstarred versions is to first check whether |\if at bfop@| is true and then fill in values accordingly. When |\if at bfop@| is true, we can type a hyphen directly, and otherwise, we use |\@bfop at choices| or |\@operatorhyphen| depending on whether we want bold or medium weight.
 %    \begin{macrocode}
-\protected\def\pilcrow{\ifmmode\textparagraph\else\mathparagraph\fi}
-\protected\def\operatorhyphen{%
-  \mathchoice{}{}{}{}
-  \ifnum\fam=\m at ne
-    \PackageError{operator}
-      {Can't use\MessageBreak\string\operatorhyphen\space here}
-      {Your command was ignored.
-      I only know how to\MessageBreak
-      use \string\operatorhyphen\space
-      inside a math operator or\MessageBreak
-      a font-change command for math
-      such as \string\mathrm\MessageBreak
-      or \string\mathbf. (Technically, the
-      \string\fam\space needs to be\MessageBreak
-      something other than -1.)
-      To resolve this\MessageBreak
-      error, make sure \string\operatorhyphen\space
-      appears only\MessageBreak
-      in those settings.}
+\protected\def\operatorhyphen{\@ifstar
+  \@operatorhyphen at bf\@operatorhyphen@@}
+\def\@operatorhyphen at bf{%
+  \if at bfop@
+    -%
   \else
-    \@operatorhyphen
+    \mathchoice{}{}{}{}
+    {\@init at bfopfont\@bfop at choices{-}}
   \fi}
+\def\@operatorhyphen@@{%
+  \if at bfop@
+    -%
+  \else
+    {\operator at font\@operatorhyphen}
+  \fi}
 %    \end{macrocode}
+% Same thing for the power of 2. When |\if at bfop@| is true, we use a |\textsuperscript|, and when it is false, we expect to be in \textsc m mode and can use |^| directly.
+%    \begin{macrocode}
+\protected\def\operatorsquared{\@ifstar
+  \@operatorsquared at bf\@operatorsquared@@}
+\def\@operatorsquared at bf{%
+  \if at bfop@
+    \textsuperscript{2}%
+  \else
+    ^{\@init at bfopfont\@bfop at choices{2}}
+  \fi}
+\def\@operatorsquared@@{%
+  \if at bfop@
+    \textsuperscript{2}%
+  \else
+    ^{\operator at font\@operatortw@}
+  \fi}
+%    \end{macrocode}
+% And inverse operation. This control sequence is once again more complicated because of the issue with the minus sign. As in |\operatorsquared|, we use |\textsuperscript| and type out the $-1$ directly when |\if at bfop@| is true, and if that boolean is false, we use |^| and |\@bfop at choices| or |\@operatorm at ne|. Unlike with |\operatorsquared|, typing out $-1$ is involves checks to determine whether the font contains a minus sign in slot |"2212|. If yes, we type $-1$ with |\Uchar|, and if not, we use |\defaultinverse|.
+%    \begin{macrocode}
+\protected\def\operatorinverse{\@ifstar
+  \@operatorinverse at bf\@operatorinverse@@}
+\def\@operatorinverse at bf{%
+  \if at bfop@
+    \textsuperscript{%
+      \ifdefined\Uchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}%
+  \else
+    ^{\@init at bfopfont\@bfop at choices{%
+      \ifdefined\Uchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}}
+  \fi}
+\def\@operatorinverse@@{%
+  \if at bfop@
+    \textsuperscript{%
+      \ifdefined\Umathchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}%
+  \else
+    ^{\operator at font\@operatorm at ne}
+  \fi}
+%    \end{macrocode}
+% Finally, we make a new name for pilcrow symbol because \textsf{math-operator} may overwrite |\P|.
+%    \begin{macrocode}
+\protected\def\pilcrow{\ifmmode
+  \textparagraph\else\mathparagraph\fi}
+%    \end{macrocode}
 % 
-% 
 % \section{Defining New Operators}
 % 
 % 
@@ -459,7 +555,7 @@
 \def\@bfoperatorlim#1#2{%
   \make at newop@cmd{#1}
     {\protected\def#1{\mathchoice{}{}{}{}\@init at bfopfont
-      \mathop{\@bfop at choices{\kern\z@#2}}\limits}}}
+      \mathop{\@bfop at choices{#2}}\limits}}}
 %    \end{macrocode}
 % Same thing with |\nolimits|.
 %    \begin{macrocode}
@@ -466,7 +562,7 @@
 \def\@bfoperatornolim#1#2{%
   \make at newop@cmd{#1}
     {\protected\def#1{\mathchoice{}{}{}{}\@init at bfopfont
-      \mathop{\@bfop at choices{\kern\z@#2}}\nolimits}}}
+      \mathop{\@bfop at choices{#2}}\nolimits}}}
 %    \end{macrocode}
 % We store the list of control sequences that code for operators in |\operator at list|. Initially the macro contains the operator control sequences from the \LaTeX\ kernel.
 %    \begin{macrocode}
@@ -501,7 +597,7 @@
 % Error and warning messages for |\make at newop@cmd|.
 %    \begin{macrocode}
 \def\OperatorBadNameError#1{%
-  \PackageError{operator}{Invalid name\MessageBreak
+  \PackageError{math-operator}{Invalid name\MessageBreak
     "\detokenize{#1}" for new operator}
     {I was expecting the name of the new operator\MessageBreak
     to be a single control sequence, but instead\MessageBreak
@@ -510,11 +606,11 @@
     make sure the first argument of the operator\MessageBreak
     declaration is a single control sequence.\MessageBreak}}
 \def\OperatorCSDefWarning#1{%
-  \PackageWarning{operator}{Control sequence\MessageBreak
+  \PackageWarning{math-operator}{Control sequence\MessageBreak
     \string#1\space is already defined. Your\MessageBreak
     operator declaration was\MessageBreak ignored}}
 \def\OperatorCSDefError#1{%
-  \PackageError{operator}{Control sequence\MessageBreak
+  \PackageError{math-operator}{Control sequence\MessageBreak
     \string#1\space already defined. Your\MessageBreak
     operator declaration was ignored}
     {You tried to define the control sequence\MessageBreak
@@ -620,14 +716,23 @@
     \endgroup
   \fi}
 %    \end{macrocode}
-% The |\@bfop at choices| macro accepts a single argument, which should be the text of an operator to be typeset in bold. The |#1| argument goes inside an |\hbox| with a font-change command that depends on the current math style.
+% The |\@bfop at choices| macro accepts a single argument, which should be the text of an operator to be typeset in bold. The |#1| argument goes inside an |\hbox| with a font-change command that depends on the current math style. To keep things working properly in the \textsc{nfss}, we also update the internal macros that store the font information. The macro |\operator at update@font| calls |\split at name| on the current |\font|. We need to set the |\escapechar| to $-1$ because |\split at name| does not expect the leading backslash from the current |\font|.
 %    \begin{macrocode}
-\def\@bfop at choices#1{%
-  \mathchoice{\hbox{\@bfoptf#1}}
-    {\hbox{\@bfoptf#1}}
-    {\hbox{\@bfopsf#1}}
-    {\hbox{\@bfopssf#1}}}
+\def\operator at update@font{\begingroup
+    \escapechar\m at ne
+    \expandafter\expandafter\expandafter
+  \endgroup
+  \expandafter\expandafter\expandafter
+  \split at name\expandafter\string\the\font\@nil}
 %    \end{macrocode}
+% Now define |\@bfop at choices|. We initially set |\if at bfop@| to true. We don't have to reset it because |\@bfop at choices| always appears in a group, so this change is necessarily local.
+%    \begin{macrocode}
+\def\@bfop at choices#1{\@bfop at true
+  \mathchoice{\hbox{\@bfoptf\operator at update@font#1}}
+    {\hbox{\@bfoptf\operator at update@font#1}}
+    {\hbox{\@bfopsf\operator at update@font#1}}
+    {\hbox{\@bfopssf\operator at update@font#1}}}
+%    \end{macrocode}
 % Finally, we make the operator declaration commands preamble only. Is this necessary? Probably not, but operator declaration distinctly feels like something that should happen only in the preamble.
 %    \begin{macrocode}
 \@onlypreamble\DeclareMathText
@@ -650,7 +755,7 @@
 \wlog{}
 \if at operator@bb
   \@operatorinfo{Defining blackboard-bold letters.}
-  \def\NoBBError#1{\PackageError{operator}
+  \def\NoBBError#1{\PackageError{math-operator}
     {Missing \string\mathbb\space command}
     {It looks like you're trying to make\MessageBreak
     a blackbold-board "#1." However, I\MessageBreak
@@ -736,7 +841,7 @@
 % 
 % \section{Categories}
 % 
-% A selection of cagetories. Serious category theorists will undoubtedly want to declare their own categories beyond these.
+% A selection of categories. Serious category theorists will undoubtedly want to declare their own categories beyond these.
 %    \begin{macrocode}
 \if at operator@c
   \wlog{}
@@ -827,16 +932,20 @@
 % 
 % \section{Overlining}
 % 
-% In this section, we define the |\overbar| command, which produces an overline whose length lies somewhere between |\bar| and |\overline|. The user-level command is a short wrapper around the internal command |\@overb at r|. First, we define |\operatorbaroffset|, which will determine the placement of the overline over the argument of |\overbar|. As is standard in \TeX, we store |\operatorbaroffset| as a count, which we identify with a scale factor because we divide it by 1000 when we use its value in |\@overb at r|.
+% In this section, we define the |\overbar| command, which produces an overline whose length lies somewhere between |\bar| and |\overline|. The user-level command is a short wrapper around the internal command |\@overb at r|. First, we define |\overbaroffset|, which will determine the placement of the overline over the argument of |\overbar|. As is standard in \TeX, we store |\overbaroffset| as a count, which we identify with a scale factor because we divide it by 1000 when we use its value in |\@overb at r|.
 %    \begin{macrocode}
 \if at operator@o
   \wlog{}
   \@operatorinfo{Defining \string\overbar.}
-  \newcount\operatorbaroffset
-  \operatorbaroffset=800\relax
+  \newcount\overbaroffset
+  \overbaroffset=800\relax
 %    \end{macrocode}
-% Now for the user-level command. We start by checking whether we are in math mode. If the user follows |\overbar| with an asterisk, we use 500 as the placement value, and otherwise, we take the value of |\operatorbaroffset|. If the user does not specify an optional argument, we use the default value of 0.8.
+% Version 1.0 of this package called the count |\operatorbaroffset| instead of |\overbaroffset|. We provide access to the old name for backwards compatibility.
 %    \begin{macrocode}
+  \let\operatorbaroffset\overbaroffset
+%    \end{macrocode}
+% Now for the user-level command. We start by checking whether we are in math mode. If the user follows |\overbar| with an asterisk, we use 500 as the placement value, and otherwise, we take the value of |\overbaroffset|. If the user does not specify an optional argument, we use the default value of 0.8.
+%    \begin{macrocode}
   \protected\def\overbar{\mathchoice{}{}{}{}%
     \@ifstar
       {\@ifnextchar[%
@@ -843,10 +952,10 @@
         {\@overb at r{500}}
         {\@overb at r{500}[0.8]}}
       {\@ifnextchar[%
-        {\@overb at r{\the\operatorbaroffset}}
-        {\@overb at r{\the\operatorbaroffset}[0.8]}}}
+        {\@overb at r{\the\overbaroffset}}
+        {\@overb at r{\the\overbaroffset}[0.8]}}}
 %    \end{macrocode}
-% Now we come to the macro that does the acutal work of making the overline. The command |\@overb at r| accepts three arguments: |#1| is the scale argument that determines the horizontal placement of the overline; |#2| is a decimal that determines the size of the overline; and |#3| is the subformula to be overlined. Note that |#1| is only specified internally, and the user controls |#1| indirectly through |\operatorbaroffset|. Just to be safe, we put the contents of |\@overb at r| inside a group since we're making liberal use of scratch registers. The general idea is that inside a |\mathchoice|, we put the subformula in an |\hbox| in the correct style and then manually position the overline using the box dimensions and the |#1| and |#2| arguments.
+% Now we come to the macro that does the actual work of making the overline. The command |\@overb at r| accepts three arguments: |#1| is the scale argument that determines the horizontal placement of the overline; |#2| is a decimal that determines the size of the overline; and |#3| is the subformula to be overlined. Note that |#1| is only specified internally, and the user controls |#1| indirectly through |\overbaroffset|. Just to be safe, we put the contents of |\@overb at r| inside a group since we're making liberal use of scratch registers. The general idea is that inside a |\mathchoice|, we put the subformula in an |\hbox| in the correct style and then manually position the overline using the box dimensions and the |#1| and |#2| arguments.
 %    \begin{macrocode}
   \def\@overb at r#1[#2]#3{\begingroup
     \mathchoice
@@ -926,28 +1035,42 @@
   \DeclareMathOperator{\Burr}{Burr}
   \DeclareMathOperator{\Categorical}{Categorical}
   \DeclareMathOperator{\Cauchy}{Cauchy}
-  \DeclareMathOperator{\ChiSq}{\chi^2}
+  \DeclareMathOperator{\chiop}{\chi}
+  \protected\def\ChiSq{\chiop^{\operator at font\@operatortw@}}
   \DeclareMathOperator{\Dagum}{Dagum}
   \DeclareMathOperator{\Exponential}{Exponential}
   \DeclareMathOperator{\Erlang}{Erlang}
   \DeclareMathOperator{\Gammaop}{Gamma}
   \DeclareMathOperator{\Gompertz}{Gompertz}
-  \DeclareMathOperator{\InvChiSq}{Inv\@operatorhyphen\chi^2}
-  \DeclareMathOperator{\InvGamma}{Inv\@operatorhyphen Gamma}
-  \DeclareMathOperator{\Kolmogorov}{Kolmogorov}
-  \DeclareMathOperator{\LogLogistic}{Log\@operatorhyphen Logistic}
-  \DeclareMathOperator{\LogNormal}{Log\@operatorhyphen Normal}
+  \protected\def\InvChiSq{%
+    \mathop{\operator at font
+      Inv\@operatorhyphen\chiop}%
+      \nolimits^{\operator at font\@operatortw@}}
+  \DeclareMathOperator{\InvGamma}
+    {Inv\@operatorhyphen Gamma}
+  \DeclareMathOperator{\Kolmogorov}
+    {Kolmogorov}
+  \DeclareMathOperator{\LogLogistic}
+    {Log\@operatorhyphen Logistic}
+  \DeclareMathOperator{\LogNormal}
+    {Log\@operatorhyphen Normal}
   \DeclareMathOperator{\Logistic}{Logistic}
   \DeclareMathOperator{\Lomax}{Lomax}
-  \DeclareMathOperator{\MaxwellBoltzmann}{Maxwell\@operatorhyphen Boltzmann}
+  \DeclareMathOperator{\MaxwellBoltzmann}
+    {Maxwell\@operatorhyphen Boltzmann}
   \DeclareMathOperator{\Multinomial}{Multinomial}
-  \DeclareMathOperator{\NegBinomial}{Neg\@operatorhyphen Binomial}
+  \DeclareMathOperator{\NegBinomial}
+    {Neg\@operatorhyphen Binomial}
+%    \end{macrocode}
+% We can't use |\N| for calligraphic $\mathcal N$ because we're already using it for natural numbers. Alas, we will settle for |\Normal|. This one is also more complicated because of the |*|-ed version of the command.
+%    \begin{macrocode}
   \@operatorinfo{Defining new operator \string\Normal.}
   \addto at operator@list{\Normal}
-  \def\operator at N{\mathop{\kern\z@\mathcal{N}}}
-  \def\operator at normal{\mathop{\begingroup\operator at font Normal\endgroup}}
-  \protected\def\Normal{\mathchoice{}{}{}{}%
-    \@ifstar{\operator at normal\nolimits}{\operator at N\nolimits}}
+  \def\operator at N{\mathop{\kern\z@\mathcal{N}}\nolimits}
+  \def\operator at normal{\mathop{\operator at font Normal}\nolimits}
+  \protected\def\Normal{%
+    \mathchoice{}{}{}{}
+    \@ifstar\operator at normal\operator at N}
   \DeclareMathOperator{\Pareto}{Pareto}
   \DeclareMathOperator{\Poisson}{Poisson}
   \DeclareMathOperator{\Weibull}{Weibull}
@@ -957,6 +1080,8 @@
 \fi
 %    \end{macrocode}
 % 
+% 
+% 
 % \section{Special Functions}
 % 
 % Some common special functions.
@@ -971,14 +1096,9 @@
   \DeclareMathOperator{\Chi}{Chi}
   \DeclareMathOperator{\Ei}{Ei}
   \DeclareMathOperator{\erf}{erf}
-  \@operatorinfo{Defining new operator \string\erfinv.}
-  \protected\def\erfinv{\mathop{\begingroup
-    \operator at font erf\endgroup^{-1}}\nolimits}
+  \protected\def\erfinv{\erf^{\operator at font\@operatorm at ne}}
   \DeclareMathOperator{\erfc}{erfc}
-  \@operatorinfo{Defining new operator \string\erfcinv.}
-  \protected\def\erfcinv{\mathop{\begingroup
-    \operator at font erfc\endgroup^{-1}}\nolimits}
-  \addto at operator@list{\erfinv\erfcinv}
+  \protected\def\erfcinv{\erfc^{\operator at font\@operatorm at ne}}
   \DeclareMathOperator{\Li}{Li}
   \DeclareMathOperator{\li}{li}
   \DeclareMathOperator{\Log}{Log}
@@ -1017,9 +1137,11 @@
   \DeclareMathOperator{\curl}{curl}
   \DeclareMathOperator{\divop}{div}
   \DeclareMathOperator{\grad}{grad}
+  \DeclareMathOperator{\Hess}{\mathcal{H}}
   \DeclareMathOperator{\Hom}{Hom}
   \DeclareMathOperator{\id}{id}
   \DeclareMathOperator{\img}{img}
+  \DeclareMathOperator{\Info}{\mathcal{I}}
   \DeclareMathOperator{\interior}{int}
   \DeclareMathOperator*{\lcm}{lcm}
   \DeclareMathOperator{\Proj}{Proj}
@@ -1069,39 +1191,21 @@
 %    \end{macrocode}
 % Inverse functions with $-1$ superscript.
 %    \begin{macrocode}
-  \protected\def\sininv{\mathop{\begingroup
-    \operator at font sin\endgroup^{-1}}\nolimits}
-  \protected\def\cosinv{\mathop{\begingroup
-    \operator at font cos\endgroup^{-1}}\nolimits}
-  \protected\def\taninv{\mathop{\begingroup
-    \operator at font tan\endgroup^{-1}}\nolimits}
-  \protected\def\cscinv{\mathop{\begingroup
-    \operator at font csc\endgroup^{-1}}\nolimits}
-  \protected\def\secinv{\mathop{\begingroup
-    \operator at font sec\endgroup^{-1}}\nolimits}
-  \protected\def\cotinv{\mathop{\begingroup
-    \operator at font cot\endgroup^{-1}}\nolimits}
+  \protected\def\sininv{\sin^{\operator at font\@operatorm at ne}}
+  \protected\def\cosinv{\cos^{\operator at font\@operatorm at ne}}
+  \protected\def\taninv{\tan^{\operator at font\@operatorm at ne}}
+  \protected\def\cscinv{\csc^{\operator at font\@operatorm at ne}}
+  \protected\def\secinv{\sec^{\operator at font\@operatorm at ne}}
+  \protected\def\cotinv{\cot^{\operator at font\@operatorm at ne}}
 %    \end{macrocode}
 % And for hyperbolic trigonometric functions.
 %    \begin{macrocode}
-  \protected\def\sinhinv{\mathop{\begingroup
-    \operator at font sinh\endgroup^{-1}}\nolimits}
-  \protected\def\coshinv{\mathop{\begingroup
-    \operator at font cosh\endgroup^{-1}}\nolimits}
-  \protected\def\tanhinv{\mathop{\begingroup
-    \operator at font tanh\endgroup^{-1}}\nolimits}
-  \protected\def\cschinv{\mathop{\begingroup
-    \operator at font csch\endgroup^{-1}}\nolimits}
-  \protected\def\sechinv{\mathop{\begingroup
-    \operator at font sech\endgroup^{-1}}\nolimits}
-  \protected\def\cothinv{\mathop{\begingroup
-    \operator at font coth\endgroup^{-1}}\nolimits}
-%    \end{macrocode}
-% And add everything we defined manually to |\operator at list|.
-%    \begin{macrocode}
-  \addto at operator@list{\sininv\cosinv\taninv
-    \cscinv\secinv\cotinv\sinhinv\coshinv
-    \tanhinv\cschinv\sechinv\cothinv}
+  \protected\def\sinhinv{\sinh^{\operator at font\@operatorm at ne}}
+  \protected\def\coshinv{\cosh^{\operator at font\@operatorm at ne}}
+  \protected\def\tanhinv{\tanh^{\operator at font\@operatorm at ne}}
+  \protected\def\cschinv{\csch^{\operator at font\@operatorm at ne}}
+  \protected\def\sechinv{\sech^{\operator at font\@operatorm at ne}}
+  \protected\def\cothinv{\coth^{\operator at font\@operatorm at ne}}
 \else
   \@operatorinfo{Skipping trigonometric functions.}
 \fi
@@ -1124,6 +1228,13 @@
 % \version{1.0}{February 2025}
 % \item initial release
 % 
+% \version{1.1}{March 2025}
+% \item big fix in package declaration
+% \item bug fix for operators with superscripts
+% \item added |\operatorsquared| and |\operatorinverse|
+% \item added |\Hess| and |\Info|
+% \item changed |\operatorbaroffset| to |\overbaroffset|
+% 
 % \end{multicols*}
 % 
 % 
@@ -1145,6 +1256,7 @@
   parsep=0pt,partopsep=0pt}
 \usepackage[colorlinks=true,allcolors=blue,implicit=false]{hyperref}
 \usepackage{amssymb}
+\usepackage{graphicx}
 \usepackage{multicol}
 \usepackage{shortvrb}
 \MakeShortVerb{|}
@@ -1167,7 +1279,7 @@
 
 
 
-\noindent \LaTeX\ users will no doubt be familiar with the control sequences that produce special functions and operators such as |\sin|, |\cos|, or |\sup|. However, the \LaTeX\ kernel defines only about 30 such commands, and many less common but still widely used special functions remain undefined as a result. The \textsf{math-operator} package addresses this situation by defining control sequences for some hundred and fifty special functions and operators, divided into nine groups, and the package also provides an interface to define even more. The first three pages of this user guide describe how to use the package, and the remainder of the document lists the control sequences in each group. For documentation of the package code, please see |math-operator_code.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. I encourage users who are interested in this package to also consult the \textsf{amsopn} and \textsf{moremath} packages as they may be more useful for you.\footnote{\LaTeX3 Project and American Mathematical Society, ``amsopn---Typeset mathematical operator names,'' \href{https://ctan.org/pkg/amsopn}{\texttt{https://ctan.org/pkg/amsopn}}; Marcel Ilg, ``moremath---Additional commands for typesetting maths,'' \href{https://ctan.org/pkg/moremath}{\texttt{https://ctan.org/pkg/moremath}}.} Users who are looking specifically for operators in quantum mechanics should consult the \textsf{linop} and \textsf{phfqit} packages.\footnote{Johannes Weytjens, ``linop---Typeset linear operators as they appear in quantum theory or linear algebra,'' \href{https://ctan.org/pkg/linop}{\texttt{https://ctan.org/pkg/linop}}; Philippe Faist, ``phfqit---Macros for typesetting Quantum Information Theory,'' \href{https://ctan.org/pkg/phfqit}{\texttt{https://ctan.org/pkg/phfqit}}.}
+\noindent \LaTeX\ users will no doubt be familiar with the control sequences that produce special functions and operators such as |\sin|, |\cos|, or |\sup|. However, the \LaTeX\ kernel defines only about 30 such commands, and many less common but still widely used special functions remain undefined as a result. The \textsf{math-operator} package addresses this situation by defining control sequences for some hundred and fifty special functions and operators, divided into nine groups, and the package also provides an interface to define even more. The first pages of this user guide describe how to use the package, and the rest of the document lists the control sequences in each group. For documentation of the package code, please see |math-operator_code.pdf|, which is included with the \textsf{math-operator} installation and is available on \textsc{ctan}. I encourage users who are interested in this package to also consult the \textsf{amsopn} and \textsf{moremath} packages as they may be more useful for you.\footnote{\LaTeX3 Project and American Mathematical Society, ``amsopn---Typeset mathematical operator names,'' \href{https://ctan.org/pkg/amsopn}{\texttt{https://ctan.org/pkg/amsopn}}; Marcel Ilg, ``moremath---Additional commands for typesetting maths,'' \href{https://ctan.org/pkg/moremath}{\texttt{https://ctan.org/pkg/moremath}}.} Users who are looking specifically for operators in quantum mechanics should consult the \textsf{linop} and \textsf{phfqit} packages.\footnote{Johannes Weytjens, ``linop---Typeset linear operators as they appear in quantum theory or linear algebra,'' \href{https://ctan.org/pkg/linop}{\texttt{https://ctan.org/pkg/linop}}; Philippe Faist, ``phfqit---Macros for typesetting Quantum Information Theory,'' \href{https://ctan.org/pkg/phfqit}{\texttt{https://ctan.org/pkg/phfqit}}.}
 
 
 
@@ -1215,7 +1327,7 @@
 \end{trivlist}
 The syntax and implementation of these macros is very similar to the \textsf{amsopn} package.
 
-The entries of Table~2 differ in the appearance of the resulting operator. The commands in the first column produce operators with medium text, and the commands in the second column produce operators with bold text. The difference between the rows is more subtle and boils down to the automatic spacing before and after the operator.\footnote{\TeX's eight classes of math subformulas are beyond the scope of this user guide, but in summary, the horizontal position of different characters in an equation depends on their math classes. See Donald Knuth, \textit{The TEXbook} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced TEXbook} (Springer, 1995), 256–258.} The macros from the first row instruct \TeX\ to treat the operator like an ordinary variable, so they are most appropriate for sets and categories. The macros from the second row instruct \TeX\ to horizontally position the operator like a summation or integral sign, and they are appropriate for functions and probability distributions. But if you are not overly fastidious, for most uses of this package other than category theory, you will probably be fine to just use |\DeclareMathOperator|.
+The entries of Table~2 differ in the appearance of the resulting operator. The commands in the first column produce operators with medium text, and the commands in the second column produce operators with bold text. The difference between the rows is more subtle and boils down to the automatic spacing before and after the operator.\footnote{\TeX's eight classes of math subformulas are beyond the scope of this user guide, but in summary, the horizontal position of different characters in an equation depends on their math classes. See Donald Knuth, \textit{The \TeX book} (Addison Wesley, 1986), 170; David Salomon, \textit{The Advanced \TeX book} (Springer, 1995), 256–258.} The macros from the first row instruct \TeX\ to treat the operator like an ordinary variable, so they are most appropriate for sets and categories. The macros from the second row instruct \TeX\ to horizontally position the operator like a summation or integral sign, and they are appropriate for functions and probability distributions. But if you are not overly fastidious, for most uses of this package other than category theory, you will probably be fine to just use |\DeclareMathOperator|.
 
 The macros in Table~2 will happily redefine any operator commands, but they will not overwrite other control sequences unless you specifically tell them to do so. The count variable |\operatordefmode| controls the package behavior in this regard as follows:
 \begin{itemize}
@@ -1243,15 +1355,42 @@
 
 
 
-When |\overbar| does not have an asterisk (the default version of the command), the count variable |\operatorbaroffset| controls the horizontal placement of the line. As is standard in \TeX, this variable should take values between 0 and 1000, and \textsf{math-operator} divides |\operatorbaroffset| by 1000 to form a fraction. It then places the overline that fraction of the way across the top of the subformula. The default value is 800. For example, saying
+When |\overbar| does not have an asterisk (the default version of the command), the count variable |\overbaroffset| controls the horizontal placement of the line.\footnote{Version 1.0 of this package used \vrb\operatorbaroffset\ instead of \vrb\overbaroffset. To preserve backwards compatibility, \vrb\operatorbaroffset\ still works for this purpose. But please don't use \vrb\operatorbaroffset\ because I may take it out in a few years.} As is standard in \TeX, this variable should take values between 0 and 1000, and \textsf{math-operator} divides |\overbaroffset| by 1000 to form a fraction. It then places the overline that fraction of the way across the top of the subformula. The default value is 800. For example, saying
 \begin{trivlist}
-\item \hskip 2em\ttfamily |\operatorbaroffset=0|
+\item \hskip 2em\ttfamily |\overbaroffset=0|
 \end{trivlist}
-will make all following |\overbar| lines appear completely on the left side of the subformula, and an asterisk is equivalent to setting |\operatorbaroffset| to 500.
+will make all following |\overbar| lines appear completely on the left side of the subformula, and an asterisk is equivalent to setting |\overbaroffset| to 500.
 
-Finally, the package defines two other user-level commands. Because it may redefine |\P|, \textsf{math-operator} always defines |\pilcrow| to typeset the \P\ symbol in text and math modes. The macro |\operatorhyphen| will typeset a hyphen when used in the definition of an operator control sequence or in a local font-change command for math such as |\mathrm| or |\mathbf|. Using |\operatorhyphen| in any other situation will result in an error.
+%\begin{figure}[t]
+%\centerline{\bfseries\strut Table 3: Macros for Non-Letter Expressions}
+%\centering
+%\begin{tabular}{lc}\toprule
+%Command & Produces \\\midrule
+%|\operatorhyphen| & - \\
+%|\operatorsquared| & $^2$ \\
+%|\operatorinverse| & $^{-1}$\\\bottomrule
+%\end{tabular}
+%\end{figure}
 
+Some operator names contain characters that are not letters, and \textsf{math-operator} provides three control sequences for non-letter characters: |\operatorhyphen| produces a hyphen, |\operatorsquared| produces a superscript 2, and |\operatorinverse| produces a superscript $-1$. If you use a Unicode font for the operator font, \textsf{math-operator} typesets these symbols in the operator font, and inside the bold commands from Table~2, they will be bold. Additionally, each command has a starred version that forces the characters to be bold no matter where they appear in an equation. If you do not use a Unicode font, the hyphen and the squared symbol will work the same way, but |\operatorinverse| instead typesets the contents of |\defaultinverse|, which is normally $-1$, without using the operator font and without using boldface in the starred version of the command.\footnote{This complication arises because the minus sign lives in different places depending on the encoding. In Unicode, the minus sign is U+2212, but that is not true for other font encodings in \TeX.} If you are in this situation and are unsatisfied with the formatting of your $-1$ expressions, I encourage you to redefine |\defaultinverse| to be more to your liking with |\def| or |\renewcommand|.
 
+A word about superscripts: I implemented the commands from Table~2 in a way that \TeX\ treats operator names as subformulas. This means that any super or subscripts will always appear after or above or below the operator, even if you end the operator name with a super or subscript. For example, if you define an inverse projection map as
+\begin{trivlist}
+\item \hskip 2em |\DeclareMathOperator{\projinv}{proj\operatorinverse}|
+\end{trivlist}
+in your document preamble and then attach a subscript as in
+\begin{trivlist}
+\item\hskip2em |\projinv_x|
+\end{trivlist}
+you will see $\mathop{\operator at font proj^{-1}}_x$ instead of $\mathop{\operator at font proj}^{-1}_x$. If your operator name ends with a super or subscript, I recommend putting everything before the final super or subscript into the appropriate command from Table~2 and then defining a separate macro using |\def| or |\newcommand|. For example, it is better to define an inverse projection map as
+\begin{trivlist}
+\item\hskip2em |\def\projinv{\proj\operatorinv}|
+\end{trivlist}
+rather than using |\DeclareMathOperator|. I took this approach in designing \textsf{math-operator}, so to redefine operators from this package that end in superscripts, you should use |\def| or |\renewcommand| instead of a control sequence from Table~2.
+
+Finally, because it may redefine |\P|, \textsf{math-operator} defines |\pilcrow| to typeset the \P\ symbol in text and math modes.
+
+
 \bigskip
 
 \centerline{***}
@@ -1260,7 +1399,7 @@
 \vskip-\medskipamount
 \vskip\z@
 
-\section{Blackboard Bold}{Note: to use the blackboard-bold commands listed here, you must load a package that defines \vrb\mathbb\space such as \textsf{amssymb} or \textsf{mathfont}, and that command should provide access to blackboard-bold characters. If you do not do so before using these control sequences, you'll get an error.}
+\section{Blackboard Bold}{Note: to use the blackboard-bold commands listed here, you must load a package that defines \vrb\mathbb\space such as \textsf{amssymb} or \textsf{mathfont}, and if you do not do so before using these control sequences, you'll get an error. I am assuming that \vrb\mathbb\space provides access to blackboard-bold letters.}
 
 
 
@@ -1274,7 +1413,7 @@
 \showop\P{$\mathbb P$}{Probability}
 \showop\E{$\mathbb E$}{Expectation}
 
-\section{Categories}{I am not a category theorist, and serious category theorists who use this package will undoubtedly want to define more categories in their own documents using \vrb\DeclareBoldMathText. If I missed any common categories that should be on this list, I am very open to expanding it.}
+\section{Categories}{I am not a category theorist, and serious category theorists who use this package will undoubtedly want to define more categories in their own documents using \vrb\DeclareBoldMathText. If I missed any common categories that should be on this list, I am happy to expand it.}
 
 
 
@@ -1301,9 +1440,9 @@
 \showop{\cone}{cone}{Cone}
 \showop{\op}{$^{\operator at font op}$}{Opposite category}
 
-\vfil
 
 
+
 \section{Jacobi Elliptic Functions}{Pretty straightforward. If you load \textsf{math-operator} with |jacobi|, you won't be able to use \vrb\sc\ to change to a small-caps font. (But you shouldn't use \vrb\sc\ anyway because it's deprecated.)}
 
 
@@ -1343,48 +1482,42 @@
 
 \section{Overlining}{Loading \textsf{math-operator} with the |overbar| option tells the package to define \vrb\overbar. Below are two examples of this macro with \vrb\bar\space and \vrb\overline\space for comparison.}
 
-{\columnsep\z@
-\multicolsep\z@
-\begin{multicols}{2}
-\tabcolsep\z@
 
+\def\showbars#1#2#3#4{%
+  \noindent
+    \hb at xt@ 0.25\textwidth{#1\hfil}%
+    \hb at xt@ 0.25\textwidth{#2\hfil}%
+    \hb at xt@ 0.25\textwidth{#3\hfil}%
+    \hb at xt@ 0.25\textwidth{#4\hfil}\par}
 
-\setbox\@tempboxa\hbox{%
-  \setbox\@tempboxa\hbox{$a$}%
-  \@tempdima\wd\@tempboxa
-  \@tempdimb\ht\@tempboxa
-  \rlap{\box\@tempboxa}%
-  \hskip 0.16\@tempdima
-  $\overline{\vrule height \@tempdimb width \z@ depth \z@
-    \hskip 0.8\@tempdima}\m at th$}
+\showbars{\texttt{\string\bar\ a}}{$\bar a$}
+  {\texttt{\string\bar\ X}}{$\bar X$}
 
-\noindent\begin{tabular}{p{0.5\columnwidth}l}
-|\bar a| & $\bar a$\\
-|\overbar a| & \box\@tempboxa\\
-|\overline a| & $\overline a$
-\end{tabular}
+\showbars{\texttt{\string\overbar\ a}}
+  {\setbox\@tempboxa\hbox{%
+    \setbox\@tempboxa\hbox{$a$}%
+    \@tempdima\wd\@tempboxa
+    \@tempdimb\ht\@tempboxa
+    \hb at xt@\z@{\box\@tempboxa\hss}%
+    \hskip 0.16\@tempdima
+    $\overline{\vrule height \@tempdimb width \z@ depth \z@
+      \hskip 0.8\@tempdima}\m at th$}%
+    \box\@tempboxa}
+  {\texttt{\string\overbar\ X}}
+  {\setbox\@tempboxa\hbox{%
+    \setbox\@tempboxa\hbox{$X$}%
+    \@tempdima\wd\@tempboxa
+    \@tempdimb\ht\@tempboxa
+    \rlap{\box\@tempboxa}%
+    \hskip 0.16\@tempdima
+    $\overline{\vrule height \@tempdimb width \z@ depth \z@
+      \hskip 0.8\@tempdima}\m at th$}%
+    \box\@tempboxa}
 
-\columnbreak
+\showbars{\texttt{\string\overline\ a}}{$\overline a$}
+  {\texttt{\string\overline\ X}}{$\overline X$}
 
-\setbox\@tempboxa\hbox{%
-  \setbox\@tempboxa\hbox{$X$}%
-  \@tempdima\wd\@tempboxa
-  \@tempdimb\ht\@tempboxa
-  \rlap{\box\@tempboxa}%
-  \hskip 0.16\@tempdima
-  $\overline{\vrule height \@tempdimb width \z@ depth \z@
-    \hskip 0.8\@tempdima}\m at th$}
 
-\noindent\begin{tabular}{p{0.5\columnwidth}l}
-|\bar X| & $\bar X$\\
-|\overbar X| & \box\@tempboxa\\
-|\overline X| & $\overline X$
-\end{tabular}
-
-
-\end{multicols}\par}
-
-
 \section{Probability Distributions}{A selection of the most common probability distributions. For the normal distribution, if you type \vrb\Normal\ without the asterisk, you will see $\mathcal N$, and if you include the asterisk after \vrb\Normal, then \textsf{math-operator} will write out ``Normal.''}
 
 
@@ -1457,11 +1590,13 @@
 \showop{\curl}{curl}{Curl}
 \showop{\divop}{div}{Divergence}
 \showop{\grad}{grad}{Gradient}
+\showop{\Hess}{$\mathcal{H}$}{Hessian}
 \showop{\Hom}{Hom}{Collection of morphisms}
 \showop{\id}{id}{Identity}
 \showop{\Im}{Im}{Imaginary part}
 \showop{\varIm}{$\Im$}{Imaginary part\footnotemark}\footnotetext{In the \LaTeX\ kernel, \texttt{\string\Im} produces $\Im$, but I decided to change that since Im is more standard than $\Im$.}
 \showop{\img}{img}{Image}
+\showop{\Info}{$\mathcal{I}$}{Fisher Information}
 \showop{\interior}{int}{Interior}
 \showop{\lcm}{lcm}{Least common multiple}
 \showop{\Proj}{Proj}{Projective spectrum}
@@ -1487,7 +1622,7 @@
 \showop{\arccosh}{arccosh}{Inverse hyperbolic cosine}
 \showop{\arctanh}{arctanh}{Inverse hyperbolic tangent}
 \showop{\arccsch}{arccsch}{Inverse hyperbolic cosecant}
-\showop{\arcsech}{arcsech}{Invesse hyperbolic secant}
+\showop{\arcsech}{arcsech}{Inverse hyperbolic secant}
 \showop{\arccoth}{arccoth}{Inverse hyperbolic tangent}
 \showop{\arsinh}{arsinh}{Inverse hyperbolic sine}
 \showop{\arcosh}{arcosh}{Inverse hyperbolic cosine}
@@ -1522,8 +1657,8 @@
 \makeatletter
 
 % package date and edition
-\def\packagedate{February 2025}
-\def\packageversion{1.0}
+\def\packagedate{March 2025}
+\def\packageversion{1.1}
 
 % header and footer commands
 \let\@@section\section
@@ -1570,6 +1705,12 @@
   {\strut\par\vskip 5pt plus 1pt minus 3pt\relax
     \egroup\hfill\break\strut\ignorespacesafterend}
 \def\vrb#1{\expandafter\texttt\expandafter{\string#1}}
+\protected\def\XeTeX{X\kern-0.1em
+  \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
+  \TeX}
+\protected\def\XeLaTeX{X\kern-0.1em
+  \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em
+  \LaTeX}
 \parskip=0pt
 
 

Modified: trunk/Master/texmf-dist/tex/latex/math-operator/math-operator.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/math-operator/math-operator.sty	2025-03-30 00:49:07 UTC (rev 74791)
+++ trunk/Master/texmf-dist/tex/latex/math-operator/math-operator.sty	2025-03-30 20:32:56 UTC (rev 74792)
@@ -6,8 +6,8 @@
 %%
 %% math-operator_code.dtx  (with options: `code')
 %% 
-%% This file is from version 1.0 of the free and open-source
-%% LaTeX package "math-operator," released February 2025.
+%% This file is from version 1.1 of the free and open-source
+%% LaTeX package "math-operator," released March 2025.
 %% 
 %% Copyright 2025 Conrad Kosowsky
 %% 
@@ -58,7 +58,7 @@
 %% Happy TeXing!
 %% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{operator}[2025/02/27 Package math-operator v. 1.0]
+\ProvidesPackage{math-operator}[2025/03/29 Package math-operator v. 1.1]
 \newif\if at operator@bb  % blackboard bold
 \newif\if at operator@c   % category theory
 \newif\if at operator@j   % Jacobi elliptic functions
@@ -99,9 +99,19 @@
 \def\@operatorinfo#1{\wlog{Package operator Info: #1}}
 \newcount\operatordefmode
 \operatordefmode\@ne
+\newif\if at bfop@
+\@bfop at false
+\def\defaultinverse{-1}
 \ifdefined\Umathchar
-  \protected\edef\@operatorhyphen{%
-      \Umathchar+0+\noexpand\the\fam+\number`\-\relax}
+  \Umathchardef\@operatorhyphen=+7+0+`\-\relax
+  \Umathchardef\@operatortw@=+7+0+`2\relax
+  \edef\@operatorm at ne{%
+    \noexpand\iffontchar\textfont\fam"2212\relax
+      \Umathchar+0+\fam"2212\relax
+      \Umathchar+0+\fam+\number`1\relax
+    \noexpand\else
+      \begingroup\fam\m at ne\noexpand\defaultinverse\endgroup
+    \noexpand\fi}
 \else
   \begingroup
     \@tempcntb=\number`\-\relax
@@ -110,35 +120,91 @@
     \@tempcnta\count@
     \multiply\count@ by 16\relax
     \advance\@tempcntb by -\count@
-    \protected\xdef\@operatorhyphen{%
-      \mathchar"0%
-        \noexpand\hexnumber@\fam
-        \hexnumber@\@tempcnta
-        \hexnumber@\@tempcntb\relax}
+    \global\mathchardef\@operatorhyphen
+      "70\hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax
+    \@tempcntb=\number`2\relax
+    \count@\@tempcntb
+    \divide\count@ by 16\relax
+    \@tempcnta\count@
+    \multiply\count@ by 16\relax
+    \advance\@tempcntb by -\count@
+    \global\mathchardef\@operatortw@
+      "70\hexnumber@\@tempcnta\hexnumber@\@tempcntb\relax
   \endgroup
+  \def\@operatorm at ne{\begingroup\fam\m at ne\defaultinverse\endgroup}
 \fi
-\protected\def\pilcrow{\ifmmode\textparagraph\else\mathparagraph\fi}
-\protected\def\operatorhyphen{%
-  \mathchoice{}{}{}{}
-  \ifnum\fam=\m at ne
-    \PackageError{operator}
-      {Can't use\MessageBreak\string\operatorhyphen\space here}
-      {Your command was ignored.
-      I only know how to\MessageBreak
-      use \string\operatorhyphen\space
-      inside a math operator or\MessageBreak
-      a font-change command for math
-      such as \string\mathrm\MessageBreak
-      or \string\mathbf. (Technically, the
-      \string\fam\space needs to be\MessageBreak
-      something other than -1.)
-      To resolve this\MessageBreak
-      error, make sure \string\operatorhyphen\space
-      appears only\MessageBreak
-      in those settings.}
+\protected\def\operatorhyphen{\@ifstar
+  \@operatorhyphen at bf\@operatorhyphen@@}
+\def\@operatorhyphen at bf{%
+  \if at bfop@
+    -%
   \else
-    \@operatorhyphen
+    \mathchoice{}{}{}{}
+    {\@init at bfopfont\@bfop at choices{-}}
   \fi}
+\def\@operatorhyphen@@{%
+  \if at bfop@
+    -%
+  \else
+    {\operator at font\@operatorhyphen}
+  \fi}
+\protected\def\operatorsquared{\@ifstar
+  \@operatorsquared at bf\@operatorsquared@@}
+\def\@operatorsquared at bf{%
+  \if at bfop@
+    \textsuperscript{2}%
+  \else
+    ^{\@init at bfopfont\@bfop at choices{2}}
+  \fi}
+\def\@operatorsquared@@{%
+  \if at bfop@
+    \textsuperscript{2}%
+  \else
+    ^{\operator at font\@operatortw@}
+  \fi}
+\protected\def\operatorinverse{\@ifstar
+  \@operatorinverse at bf\@operatorinverse@@}
+\def\@operatorinverse at bf{%
+  \if at bfop@
+    \textsuperscript{%
+      \ifdefined\Uchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}%
+  \else
+    ^{\@init at bfopfont\@bfop at choices{%
+      \ifdefined\Uchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}}
+  \fi}
+\def\@operatorinverse@@{%
+  \if at bfop@
+    \textsuperscript{%
+      \ifdefined\Umathchar
+        \iffontchar\font"2212\relax
+          \Uchar"2212\relax 1%
+        \else
+          $\defaultinverse$%
+        \fi
+      \else
+        $\defaultinverse$%
+      \fi}%
+  \else
+    ^{\operator at font\@operatorm at ne}
+  \fi}
+\protected\def\pilcrow{\ifmmode
+  \textparagraph\else\mathparagraph\fi}
 \protected\def\DeclareMathText#1#2{\relax
   \make at newop@cmd{#1}
     {\protected\def#1{{\operator at font #2}}}}
@@ -159,11 +225,11 @@
 \def\@bfoperatorlim#1#2{%
   \make at newop@cmd{#1}
     {\protected\def#1{\mathchoice{}{}{}{}\@init at bfopfont
-      \mathop{\@bfop at choices{\kern\z@#2}}\limits}}}
+      \mathop{\@bfop at choices{#2}}\limits}}}
 \def\@bfoperatornolim#1#2{%
   \make at newop@cmd{#1}
     {\protected\def#1{\mathchoice{}{}{}{}\@init at bfopfont
-      \mathop{\@bfop at choices{\kern\z@#2}}\nolimits}}}
+      \mathop{\@bfop at choices{#2}}\nolimits}}}
 \def\operator at list{\log\lg\ln
   \lim\limsup\liminf
   \sin\arcsin\sinh
@@ -186,7 +252,7 @@
     \expandafter\@secondoftwo
   \fi}
 \def\OperatorBadNameError#1{%
-  \PackageError{operator}{Invalid name\MessageBreak
+  \PackageError{math-operator}{Invalid name\MessageBreak
     "\detokenize{#1}" for new operator}
     {I was expecting the name of the new operator\MessageBreak
     to be a single control sequence, but instead\MessageBreak
@@ -195,11 +261,11 @@
     make sure the first argument of the operator\MessageBreak
     declaration is a single control sequence.\MessageBreak}}
 \def\OperatorCSDefWarning#1{%
-  \PackageWarning{operator}{Control sequence\MessageBreak
+  \PackageWarning{math-operator}{Control sequence\MessageBreak
     \string#1\space is already defined. Your\MessageBreak
     operator declaration was\MessageBreak ignored}}
 \def\OperatorCSDefError#1{%
-  \PackageError{operator}{Control sequence\MessageBreak
+  \PackageError{math-operator}{Control sequence\MessageBreak
     \string#1\space already defined. Your\MessageBreak
     operator declaration was ignored}
     {You tried to define the control sequence\MessageBreak
@@ -269,11 +335,17 @@
       \global\let\operator at ssf\ssf at size
     \endgroup
   \fi}
-\def\@bfop at choices#1{%
-  \mathchoice{\hbox{\@bfoptf#1}}
-    {\hbox{\@bfoptf#1}}
-    {\hbox{\@bfopsf#1}}
-    {\hbox{\@bfopssf#1}}}
+\def\operator at update@font{\begingroup
+    \escapechar\m at ne
+    \expandafter\expandafter\expandafter
+  \endgroup
+  \expandafter\expandafter\expandafter
+  \split at name\expandafter\string\the\font\@nil}
+\def\@bfop at choices#1{\@bfop at true
+  \mathchoice{\hbox{\@bfoptf\operator at update@font#1}}
+    {\hbox{\@bfoptf\operator at update@font#1}}
+    {\hbox{\@bfopsf\operator at update@font#1}}
+    {\hbox{\@bfopssf\operator at update@font#1}}}
 \@onlypreamble\DeclareMathText
 \@onlypreamble\DeclareBoldMathText
 \@onlypreamble\DeclareMathOperator
@@ -286,7 +358,7 @@
 \wlog{}
 \if at operator@bb
   \@operatorinfo{Defining blackboard-bold letters.}
-  \def\NoBBError#1{\PackageError{operator}
+  \def\NoBBError#1{\PackageError{math-operator}
     {Missing \string\mathbb\space command}
     {It looks like you're trying to make\MessageBreak
     a blackbold-board "#1." However, I\MessageBreak
@@ -431,8 +503,9 @@
 \if at operator@o
   \wlog{}
   \@operatorinfo{Defining \string\overbar.}
-  \newcount\operatorbaroffset
-  \operatorbaroffset=800\relax
+  \newcount\overbaroffset
+  \overbaroffset=800\relax
+  \let\operatorbaroffset\overbaroffset
   \protected\def\overbar{\mathchoice{}{}{}{}%
     \@ifstar
       {\@ifnextchar[%
@@ -439,8 +512,8 @@
         {\@overb at r{500}}
         {\@overb at r{500}[0.8]}}
       {\@ifnextchar[%
-        {\@overb at r{\the\operatorbaroffset}}
-        {\@overb at r{\the\operatorbaroffset}[0.8]}}}
+        {\@overb at r{\the\overbaroffset}}
+        {\@overb at r{\the\overbaroffset}[0.8]}}}
   \def\@overb at r#1[#2]#3{\begingroup
     \mathchoice
       {\setbox\@tempboxa\hbox{$\displaystyle#3\m at th$}
@@ -497,28 +570,39 @@
   \DeclareMathOperator{\Burr}{Burr}
   \DeclareMathOperator{\Categorical}{Categorical}
   \DeclareMathOperator{\Cauchy}{Cauchy}
-  \DeclareMathOperator{\ChiSq}{\chi^2}
+  \DeclareMathOperator{\chiop}{\chi}
+  \protected\def\ChiSq{\chiop^{\operator at font\@operatortw@}}
   \DeclareMathOperator{\Dagum}{Dagum}
   \DeclareMathOperator{\Exponential}{Exponential}
   \DeclareMathOperator{\Erlang}{Erlang}
   \DeclareMathOperator{\Gammaop}{Gamma}
   \DeclareMathOperator{\Gompertz}{Gompertz}
-  \DeclareMathOperator{\InvChiSq}{Inv\@operatorhyphen\chi^2}
-  \DeclareMathOperator{\InvGamma}{Inv\@operatorhyphen Gamma}
-  \DeclareMathOperator{\Kolmogorov}{Kolmogorov}
-  \DeclareMathOperator{\LogLogistic}{Log\@operatorhyphen Logistic}
-  \DeclareMathOperator{\LogNormal}{Log\@operatorhyphen Normal}
+  \protected\def\InvChiSq{%
+    \mathop{\operator at font
+      Inv\@operatorhyphen\chiop}%
+      \nolimits^{\operator at font\@operatortw@}}
+  \DeclareMathOperator{\InvGamma}
+    {Inv\@operatorhyphen Gamma}
+  \DeclareMathOperator{\Kolmogorov}
+    {Kolmogorov}
+  \DeclareMathOperator{\LogLogistic}
+    {Log\@operatorhyphen Logistic}
+  \DeclareMathOperator{\LogNormal}
+    {Log\@operatorhyphen Normal}
   \DeclareMathOperator{\Logistic}{Logistic}
   \DeclareMathOperator{\Lomax}{Lomax}
-  \DeclareMathOperator{\MaxwellBoltzmann}{Maxwell\@operatorhyphen Boltzmann}
+  \DeclareMathOperator{\MaxwellBoltzmann}
+    {Maxwell\@operatorhyphen Boltzmann}
   \DeclareMathOperator{\Multinomial}{Multinomial}
-  \DeclareMathOperator{\NegBinomial}{Neg\@operatorhyphen Binomial}
+  \DeclareMathOperator{\NegBinomial}
+    {Neg\@operatorhyphen Binomial}
   \@operatorinfo{Defining new operator \string\Normal.}
   \addto at operator@list{\Normal}
-  \def\operator at N{\mathop{\kern\z@\mathcal{N}}}
-  \def\operator at normal{\mathop{\begingroup\operator at font Normal\endgroup}}
-  \protected\def\Normal{\mathchoice{}{}{}{}%
-    \@ifstar{\operator at normal\nolimits}{\operator at N\nolimits}}
+  \def\operator at N{\mathop{\kern\z@\mathcal{N}}\nolimits}
+  \def\operator at normal{\mathop{\operator at font Normal}\nolimits}
+  \protected\def\Normal{%
+    \mathchoice{}{}{}{}
+    \@ifstar\operator at normal\operator at N}
   \DeclareMathOperator{\Pareto}{Pareto}
   \DeclareMathOperator{\Poisson}{Poisson}
   \DeclareMathOperator{\Weibull}{Weibull}
@@ -536,14 +620,9 @@
   \DeclareMathOperator{\Chi}{Chi}
   \DeclareMathOperator{\Ei}{Ei}
   \DeclareMathOperator{\erf}{erf}
-  \@operatorinfo{Defining new operator \string\erfinv.}
-  \protected\def\erfinv{\mathop{\begingroup
-    \operator at font erf\endgroup^{-1}}\nolimits}
+  \protected\def\erfinv{\erf^{\operator at font\@operatorm at ne}}
   \DeclareMathOperator{\erfc}{erfc}
-  \@operatorinfo{Defining new operator \string\erfcinv.}
-  \protected\def\erfcinv{\mathop{\begingroup
-    \operator at font erfc\endgroup^{-1}}\nolimits}
-  \addto at operator@list{\erfinv\erfcinv}
+  \protected\def\erfcinv{\erfc^{\operator at font\@operatorm at ne}}
   \DeclareMathOperator{\Li}{Li}
   \DeclareMathOperator{\li}{li}
   \DeclareMathOperator{\Log}{Log}
@@ -573,9 +652,11 @@
   \DeclareMathOperator{\curl}{curl}
   \DeclareMathOperator{\divop}{div}
   \DeclareMathOperator{\grad}{grad}
+  \DeclareMathOperator{\Hess}{\mathcal{H}}
   \DeclareMathOperator{\Hom}{Hom}
   \DeclareMathOperator{\id}{id}
   \DeclareMathOperator{\img}{img}
+  \DeclareMathOperator{\Info}{\mathcal{I}}
   \DeclareMathOperator{\interior}{int}
   \DeclareMathOperator*{\lcm}{lcm}
   \DeclareMathOperator{\Proj}{Proj}
@@ -613,33 +694,18 @@
   \DeclareMathOperator{\arcsch}{arcsch}
   \DeclareMathOperator{\arsech}{arsech}
   \DeclareMathOperator{\arcoth}{arcoth}
-  \protected\def\sininv{\mathop{\begingroup
-    \operator at font sin\endgroup^{-1}}\nolimits}
-  \protected\def\cosinv{\mathop{\begingroup
-    \operator at font cos\endgroup^{-1}}\nolimits}
-  \protected\def\taninv{\mathop{\begingroup
-    \operator at font tan\endgroup^{-1}}\nolimits}
-  \protected\def\cscinv{\mathop{\begingroup
-    \operator at font csc\endgroup^{-1}}\nolimits}
-  \protected\def\secinv{\mathop{\begingroup
-    \operator at font sec\endgroup^{-1}}\nolimits}
-  \protected\def\cotinv{\mathop{\begingroup
-    \operator at font cot\endgroup^{-1}}\nolimits}
-  \protected\def\sinhinv{\mathop{\begingroup
-    \operator at font sinh\endgroup^{-1}}\nolimits}
-  \protected\def\coshinv{\mathop{\begingroup
-    \operator at font cosh\endgroup^{-1}}\nolimits}
-  \protected\def\tanhinv{\mathop{\begingroup
-    \operator at font tanh\endgroup^{-1}}\nolimits}
-  \protected\def\cschinv{\mathop{\begingroup
-    \operator at font csch\endgroup^{-1}}\nolimits}
-  \protected\def\sechinv{\mathop{\begingroup
-    \operator at font sech\endgroup^{-1}}\nolimits}
-  \protected\def\cothinv{\mathop{\begingroup
-    \operator at font coth\endgroup^{-1}}\nolimits}
-  \addto at operator@list{\sininv\cosinv\taninv
-    \cscinv\secinv\cotinv\sinhinv\coshinv
-    \tanhinv\cschinv\sechinv\cothinv}
+  \protected\def\sininv{\sin^{\operator at font\@operatorm at ne}}
+  \protected\def\cosinv{\cos^{\operator at font\@operatorm at ne}}
+  \protected\def\taninv{\tan^{\operator at font\@operatorm at ne}}
+  \protected\def\cscinv{\csc^{\operator at font\@operatorm at ne}}
+  \protected\def\secinv{\sec^{\operator at font\@operatorm at ne}}
+  \protected\def\cotinv{\cot^{\operator at font\@operatorm at ne}}
+  \protected\def\sinhinv{\sinh^{\operator at font\@operatorm at ne}}
+  \protected\def\coshinv{\cosh^{\operator at font\@operatorm at ne}}
+  \protected\def\tanhinv{\tanh^{\operator at font\@operatorm at ne}}
+  \protected\def\cschinv{\csch^{\operator at font\@operatorm at ne}}
+  \protected\def\sechinv{\sech^{\operator at font\@operatorm at ne}}
+  \protected\def\cothinv{\coth^{\operator at font\@operatorm at ne}}
 \else
   \@operatorinfo{Skipping trigonometric functions.}
 \fi



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