summaryrefslogtreecommitdiff
path: root/macros/latex/required/amsmath/amsopn.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/required/amsmath/amsopn.dtx')
-rw-r--r--macros/latex/required/amsmath/amsopn.dtx96
1 files changed, 53 insertions, 43 deletions
diff --git a/macros/latex/required/amsmath/amsopn.dtx b/macros/latex/required/amsmath/amsopn.dtx
index 03df1a116b..110a5fa8be 100644
--- a/macros/latex/required/amsmath/amsopn.dtx
+++ b/macros/latex/required/amsmath/amsopn.dtx
@@ -2,7 +2,7 @@
% \iffalse meta-comment
%
% Copyright (C) 1995, 1999 American Mathematical Society.
-% Copyright (C) 2016-2021 LaTeX Project and American Mathematical Society.
+% Copyright (C) 2016-2022 LaTeX Project and American Mathematical Society.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -52,13 +52,13 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% similar to the standard function names \cn{sin}, \cn{lim},
% \cn{max}, etc.
%
-% \StopEventually{}
+% \MaybeStop{}
%
% Standard file identification.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 or later
-\ProvidesPackage{amsopn}[2021/08/26 v2.02 operator names]
+\ProvidesPackage{amsopn}[2022/04/08 v2.04 operator names]
% \end{macrocode}
%
% What \cs{nolimits@} does is keep a \cn{limits} typed by the user
@@ -151,41 +151,42 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\@onlypreamble\@declmathop
% \end{macrocode}
%
+% \changes{v2.04}{2022/04/08}{Make operators \cs{protected} (gh/123)}
% \begin{macrocode}
-\def\arccos{\qopname\relax o{arccos}}
-\def\arcsin{\qopname\relax o{arcsin}}
-\def\arctan{\qopname\relax o{arctan}}
-\def\arg{\qopname\relax o{arg}}
-\def\cos{\qopname\relax o{cos}}
-\def\cosh{\qopname\relax o{cosh}}
-\def\cot{\qopname\relax o{cot}}
-\def\coth{\qopname\relax o{coth}}
-\def\csc{\qopname\relax o{csc}}
-\def\deg{\qopname\relax o{deg}}
-\def\det{\qopname\relax m{det}}
-\def\dim{\qopname\relax o{dim}}
-\def\exp{\qopname\relax o{exp}}
-\def\gcd{\qopname\relax m{gcd}}
-\def\hom{\qopname\relax o{hom}}
-\def\inf{\qopname\relax m{inf}}
-\def\injlim{\qopname\relax m{inj\,lim}}
-\def\ker{\qopname\relax o{ker}}
-\def\lg{\qopname\relax o{lg}}
-\def\lim{\qopname\relax m{lim}}
-\def\liminf{\qopname\relax m{lim\,inf}}
-\def\limsup{\qopname\relax m{lim\,sup}}
-\def\ln{\qopname\relax o{ln}}
-\def\log{\qopname\relax o{log}}
-\def\max{\qopname\relax m{max}}
-\def\min{\qopname\relax m{min}}
-\def\Pr{\qopname\relax m{Pr}}
-\def\projlim{\qopname\relax m{proj\,lim}}
-\def\sec{\qopname\relax o{sec}}
-\def\sin{\qopname\relax o{sin}}
-\def\sinh{\qopname\relax o{sinh}}
-\def\sup{\qopname\relax m{sup}}
-\def\tan{\qopname\relax o{tan}}
-\def\tanh{\qopname\relax o{tanh}}
+\protected\def\arccos{\qopname\relax o{arccos}}
+\protected\def\arcsin{\qopname\relax o{arcsin}}
+\protected\def\arctan{\qopname\relax o{arctan}}
+\protected\def\arg{\qopname\relax o{arg}}
+\protected\def\cos{\qopname\relax o{cos}}
+\protected\def\cosh{\qopname\relax o{cosh}}
+\protected\def\cot{\qopname\relax o{cot}}
+\protected\def\coth{\qopname\relax o{coth}}
+\protected\def\csc{\qopname\relax o{csc}}
+\protected\def\deg{\qopname\relax o{deg}}
+\protected\def\det{\qopname\relax m{det}}
+\protected\def\dim{\qopname\relax o{dim}}
+\protected\def\exp{\qopname\relax o{exp}}
+\protected\def\gcd{\qopname\relax m{gcd}}
+\protected\def\hom{\qopname\relax o{hom}}
+\protected\def\inf{\qopname\relax m{inf}}
+\protected\def\injlim{\qopname\relax m{inj\,lim}}
+\protected\def\ker{\qopname\relax o{ker}}
+\protected\def\lg{\qopname\relax o{lg}}
+\protected\def\lim{\qopname\relax m{lim}}
+\protected\def\liminf{\qopname\relax m{lim\,inf}}
+\protected\def\limsup{\qopname\relax m{lim\,sup}}
+\protected\def\ln{\qopname\relax o{ln}}
+\protected\def\log{\qopname\relax o{log}}
+\protected\def\max{\qopname\relax m{max}}
+\protected\def\min{\qopname\relax m{min}}
+\protected\def\Pr{\qopname\relax m{Pr}}
+\protected\def\projlim{\qopname\relax m{proj\,lim}}
+\protected\def\sec{\qopname\relax o{sec}}
+\protected\def\sin{\qopname\relax o{sin}}
+\protected\def\sinh{\qopname\relax o{sinh}}
+\protected\def\sup{\qopname\relax m{sup}}
+\protected\def\tan{\qopname\relax o{tan}}
+\protected\def\tanh{\qopname\relax o{tanh}}
% \end{macrocode}
%
% \begin{macro}{\operator@font}
@@ -198,8 +199,16 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% more accessible so that users can call this font for use in special
% constructs that are not ordinary operator names but conceptually
% related.
+%
+% \cs{operator@font} is also declared by the \LaTeX{} kernel (for
+% at least 14 years), thus defining it here effectively means
+% ``resetting it'' to the kernel value, which is counterproductive
+% in situations where the user (or a class) has altered its
+% definition and at a later point \pkg{amsopn} got added.
+% \changes{v2.03}{2022/01/20}{Do not reset \cs{operator@font} it is
+% already defined in the LaTeX kernel (gh/734)}
% \begin{macrocode}
-\def\operator@font{\mathgroup\symoperators}
+%\def\operator@font{\mathgroup\symoperators} % commented out in 2.03
\def\operatorfont{\operator@font}
% \end{macrocode}
% \end{macro}
@@ -218,23 +227,24 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% vertical spacing may not be optimal in script and scriptscript
% sizes. Unfortunately \tex/ provides no easy way to do math mode
% vertical spacing that varies with current math style like mu units.
+% \changes{v2.04}{2022/04/08}{Make operators \cs{protected} (gh/123)}
% \begin{macrocode}
-\def\varlim@#1#2{%
+\protected\def\varlim@#1#2{%
\vtop{\m@th\ialign{##\cr
\hfil$#1\operator@font lim$\hfil\cr
\noalign{\nointerlineskip\kern1.5\ex@}#2\cr
\noalign{\nointerlineskip\kern-\ex@}\cr}}%
}
-\def\varinjlim{%
+\protected\def\varinjlim{%
\mathop{\mathpalette\varlim@{\rightarrowfill@\textstyle}}\nmlimits@
}
-\def\varprojlim{%
+\protected\def\varprojlim{%
\mathop{\mathpalette\varlim@{\leftarrowfill@\textstyle}}\nmlimits@
}
-\def\varliminf{\mathop{\mathpalette\varliminf@{}}\nmlimits@}
+\protected\def\varliminf{\mathop{\mathpalette\varliminf@{}}\nmlimits@}
\def\varliminf@#1{\@@underline{\vrule\@depth.2\ex@\@width\z@
\hbox{$#1\m@th\operator@font lim$}}}
-\def\varlimsup{\mathop{\mathpalette\varlimsup@{}}\nmlimits@}
+\protected\def\varlimsup{\mathop{\mathpalette\varlimsup@{}}\nmlimits@}
\def\varlimsup@#1{\@@overline{\hbox{$#1\m@th\operator@font lim$}}}
% \end{macrocode}
%