[latex3-commits] [git/LaTeX3-latex3-latex2e] gh734: do not reset \operator at font when loading amsopn (see #734) (21205b49)
Frank Mittelbach
frank.mittelbach at latex-project.org
Thu Jan 20 17:48:16 CET 2022
Repository : https://github.com/latex3/latex2e
On branch : gh734
Link : https://github.com/latex3/latex2e/commit/21205b493c57c538ac4eba40748f96aa507b970c
>---------------------------------------------------------------
commit 21205b493c57c538ac4eba40748f96aa507b970c
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Thu Jan 20 17:48:16 2022 +0100
do not reset \operator at font when loading amsopn (see #734)
>---------------------------------------------------------------
21205b493c57c538ac4eba40748f96aa507b970c
base/doc/ltnews35.tex | 22 ++++++++++++++++++++++
required/amsmath/amsopn.dtx | 12 ++++++++++--
required/amsmath/changes.txt | 6 ++++++
required/amsmath/testfiles/github-0734.lvt | 17 +++++++++++++++++
.../amsmath/testfiles/github-0734.tlg | 6 +++---
5 files changed, 58 insertions(+), 5 deletions(-)
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 31bce8a1..770c05c7 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -472,6 +472,28 @@ is now fixed.
\section{Changes to packages in the \pkg{amsmath} category}
+
+\subsection{\pkg{amsopn} Do not reset \cs{operator at font}}
+
+The package \pkg{amsopn} used to define \cs{operator at font} but this
+command is already provided by the \LaTeX{} format (for at least 14
+years). As a result the definition in \pkg{amsopn} is equivalent to a
+reset to the kernel definition, which is unnecessary and suprising if
+you alter the math setup (e.g., by loading a package) and at a later
+stage add \pkg{amsmath}, which then undoes part of your setup. For
+this reason the definition was taken out and
+\pkg{amsmath}/\pkg{amsopn} now relies on the format definition.
+
+In the unlikely event that you want the resetting to happen, use
+\begin{verbatim}
+ \makeatletter
+ \def\operator at font{\mathgroup\symoperators}
+ \makeatother
+\end{verbatim}
+after loading the package.
+%
+\githubissue{734}
+
\subsection{???}
%
\githubissue{???}
diff --git a/required/amsmath/amsopn.dtx b/required/amsmath/amsopn.dtx
index 20e63b63..22801e8c 100644
--- a/required/amsmath/amsopn.dtx
+++ b/required/amsmath/amsopn.dtx
@@ -58,7 +58,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
% \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/01/20 v2.03 operator names]
% \end{macrocode}
%
% What \cs{nolimits@} does is keep a \cn{limits} typed by the user
@@ -198,8 +198,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 at 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 at font} it is
+% already defined in the LaTeX kernel (gh/734)}
% \begin{macrocode}
-\def\operator at font{\mathgroup\symoperators}
+%\def\operator at font{\mathgroup\symoperators} % commented out in 2.03
\def\operatorfont{\operator at font}
% \end{macrocode}
% \end{macro}
diff --git a/required/amsmath/changes.txt b/required/amsmath/changes.txt
index e61d8724..7c5723b8 100644
--- a/required/amsmath/changes.txt
+++ b/required/amsmath/changes.txt
@@ -1,3 +1,9 @@
+2022-01-20 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * amsopn.dtx:
+ Do not define/reset \operator at font; it is already defined in
+ the LaTeX kernel (gh/734)
+
2021-11-18 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
* All *.dtx: Replaced \StopEventually by \MaybeStop
diff --git a/required/amsmath/testfiles/github-0734.lvt b/required/amsmath/testfiles/github-0734.lvt
new file mode 100644
index 00000000..c9584c0c
--- /dev/null
+++ b/required/amsmath/testfiles/github-0734.lvt
@@ -0,0 +1,17 @@
+\documentclass{article}
+
+\input{test2e}
+
+\makeatletter
+\def\operator at font{XXX} % doesn't matter what it is defined to
+\makeatother
+
+\usepackage{amsopn}
+
+\START
+
+\makeatletter
+\show\operator at font
+\makeatother
+
+\END
diff --git a/base/testfiles-lthooks/github-0675.tlg b/required/amsmath/testfiles/github-0734.tlg
similarity index 63%
copy from base/testfiles-lthooks/github-0675.tlg
copy to required/amsmath/testfiles/github-0734.tlg
index cb25ed26..e28ea70b 100644
--- a/base/testfiles-lthooks/github-0675.tlg
+++ b/required/amsmath/testfiles/github-0734.tlg
@@ -1,5 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
-bar
-foo
-baz
+> \operator at font=macro:
+->XXX.
+l. ...\show\operator at font
More information about the latex3-commits
mailing list.