From 4a576d3997d65272b083fd494dbea000a45d5868 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 24 Jul 2022 17:42:23 +0100 Subject: [PATCH] mdwmath.dtx: Add `\defop' for defining new operators, and use it. --- mdwmath.dtx | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/mdwmath.dtx b/mdwmath.dtx index 869302e..dbd707a 100644 --- a/mdwmath.dtx +++ b/mdwmath.dtx @@ -30,7 +30,7 @@ %<+oldeqnarray> [2020/09/06 1.14.0 Old enhanced eqnarray] % \end{meta-comment} % -% \CheckSum{740} +% \CheckSum{728} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -228,6 +228,13 @@ % $p(\cdot)$, there is an integer $N$ such that $\nu(n) < 1/p(n)$ for all $n % > N$; $\negl(n)$ is some negligible function of $n$. % +% \DescribeMacro\defop +% New operators can be defined using |\defop|: +% \begin{quote} \syntax{"\\defop"["*"]"{""}{""}"} \end{quote} +% defines \ to be an operator which typesets \. By default, +% limits will be placed above and below the operator in display style; with +% |*|, limits are always written as super- and subscripts. +% % \subsection{Standard set names} % % \DescribeMacro\Z @@ -746,6 +753,14 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\defop} +% Defining new operator names. +% \begin{macrocode} +\def\defop{\@ifstar{\defop@\nolimits}{\defop@\limits}} +\def\defop@#1#2#3{\def#2{\mathop{\operator@font #3}#1}} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\keys} % \begin{macro}{\dom} % \begin{macro}{\ran} @@ -758,14 +773,14 @@ % And the new operator names. % % \begin{macrocode} -\def\keys{\mathop{\operator@font keys}\nolimits} -\def\dom{\mathop{\operator@font dom}\nolimits} -\def\ran{\mathop{\operator@font ran}\nolimits} -\def\supp{\mathop{\operator@font supp}\nolimits} -\def\lcm{\mathop{\operator@font lcm}\nolimits} -\def\poly{\mathop{\operator@font poly}\nolimits} -\def\negl{\mathop{\operator@font negl}\nolimits} -\def\ord{\mathop{\operator@font ord}\nolimits} +\defop*\keys{keys} +\defop*\dom{dom} +\defop*\ran{ran} +\defop*\supp{supp} +\defop*\lcm{lcm} +\defop*\poly{poly} +\defop*\negl{negl} +\defop*\ord{ord} % \end{macrocode} % % \end{macro} -- 2.11.0