chiark
/
gitweb
/
~mdw
/
mdwtools
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf6775e
)
mdwmath.dtx: Add `\defop' for defining new operators, and use it.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 24 Jul 2022 16:42:23 +0000
(17:42 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 24 Jul 2022 16:42:23 +0000
(17:42 +0100)
mdwmath.dtx
patch
|
blob
|
blame
|
history
diff --git
a/mdwmath.dtx
b/mdwmath.dtx
index 869302e18d6a53e3b4ba859d173b60b83912b394..dbd707ae2212b1dc064954ac355d7679816ee01e 100644
(file)
--- a/
mdwmath.dtx
+++ b/
mdwmath.dtx
@@
-30,7
+30,7
@@
%<+oldeqnarray> [2020/09/06 1.14.0 Old enhanced eqnarray]
% \end{meta-comment}
%
%<+oldeqnarray> [2020/09/06 1.14.0 Old enhanced eqnarray]
% \end{meta-comment}
%
-% \CheckSum{7
40
}
+% \CheckSum{7
28
}
%% \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
%% \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$.
%
% $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"["*"]"{"<command>"}{"<text>"}"} \end{quote}
+% defines \<command> to be an operator which typesets \<text>. 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
% \subsection{Standard set names}
%
% \DescribeMacro\Z
@@
-746,6
+753,14
@@
% \end{macro}
% \end{macro}
%
% \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}
% \begin{macro}{\keys}
% \begin{macro}{\dom}
% \begin{macro}{\ran}
@@
-758,14
+773,14
@@
% And the new operator names.
%
% \begin{macrocode}
% And the new operator names.
%
% \begin{macrocode}
-\def
\keys{\mathop{\operator@font keys}\nolimit
s}
-\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
}
+\def
op*\keys{key
s}
+\def
op*\dom{dom
}
+\def
op*\ran{ran
}
+\def
op*\supp{supp
}
+\def
op*\lcm{lcm
}
+\def
op*\poly{poly
}
+\def
op*\negl{negl
}
+\def
op*\ord{ord
}
% \end{macrocode}
%
% \end{macro}
% \end{macrocode}
%
% \end{macro}