summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/math-def.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/math-def.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/math-def.mkiv128
1 files changed, 82 insertions, 46 deletions
diff --git a/Master/texmf-dist/tex/context/base/math-def.mkiv b/Master/texmf-dist/tex/context/base/math-def.mkiv
index ad5e40672f2..50c9902dde8 100644
--- a/Master/texmf-dist/tex/context/base/math-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/math-def.mkiv
@@ -39,9 +39,9 @@
\doifelse{\mathematicsparameter\v!autopunctuation}\v!yes\enablemathpunctuation\disablemathpunctuation
\to \everysetupmathematics
-\appendtoks
- \ifconditional\automathpunctuation\dosetattribute{mathpunc}\plusone\fi
-\to \everymathematics
+% \appendtoks
+% \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi
+% \to \everymathematics
\setupmathematics[\v!autopunctuation=\v!yes]
@@ -59,43 +59,43 @@
% The \mfunction macro is an alternative for \hbox with a
% controlable font switch.
-\definemathcommand [arccos] [nolop] {\mfunction{arccos}}
-\definemathcommand [arcsin] [nolop] {\mfunction{arcsin}}
-\definemathcommand [arctan] [nolop] {\mfunction{arctan}}
-\definemathcommand [arg] [nolop] {\mfunction{arg}}
-\definemathcommand [cosh] [nolop] {\mfunction{cosh}}
-\definemathcommand [cos] [nolop] {\mfunction{cos}}
-\definemathcommand [coth] [nolop] {\mfunction{coth}}
-\definemathcommand [cot] [nolop] {\mfunction{cot}}
-\definemathcommand [csc] [nolop] {\mfunction{csc}}
-\definemathcommand [deg] [nolop] {\mfunction{deg}}
-\definemathcommand [det] [limop] {\mfunction{det}}
-\definemathcommand [dim] [nolop] {\mfunction{dim}}
-\definemathcommand [exp] [nolop] {\mfunction{exp}}
-\definemathcommand [gcd] [limop] {\mfunction{gcd}}
-\definemathcommand [hom] [nolop] {\mfunction{hom}}
-\definemathcommand [inf] [limop] {\mfunction{inf}}
-\definemathcommand [injlim] [limop] {\mfunction{inj\,lim}}
-\definemathcommand [ker] [nolop] {\mfunction{ker}}
-\definemathcommand [lg] [nolop] {\mfunction{lg}}
-\definemathcommand [liminf] [limop] {\mfunction{lim\,inf}}
-\definemathcommand [limsup] [limop] {\mfunction{lim\,sup}}
-\definemathcommand [lim] [limop] {\mfunction{lim}}
-\definemathcommand [ln] [nolop] {\mfunction{ln}}
-\definemathcommand [log] [nolop] {\mfunction{log}}
-\definemathcommand [median] [limop] {\mfunction{median}}
-\definemathcommand [max] [limop] {\mfunction{max}}
-\definemathcommand [min] [limop] {\mfunction{min}}
-\definemathcommand [mod] [limop] {\mfunction{mod}}
-\definemathcommand [div] [limop] {\mfunction{div}}
-\definemathcommand [projlim] [limop] {\mfunction{proj\,lim}}
-\definemathcommand [Pr] [limop] {\mfunction{Pr}}
-\definemathcommand [sec] [nolop] {\mfunction{sec}}
-\definemathcommand [sinh] [nolop] {\mfunction{sinh}}
-\definemathcommand [sin] [nolop] {\mfunction{sin}}
-\definemathcommand [sup] [limop] {\mfunction{sup}}
-\definemathcommand [tanh] [nolop] {\mfunction{tanh}}
-\definemathcommand [tan] [nolop] {\mfunction{tan}}
+\definemathcommand [arccos] [nolop] {\mfunctionlabeltext{arccos}}
+\definemathcommand [arcsin] [nolop] {\mfunctionlabeltext{arcsin}}
+\definemathcommand [arctan] [nolop] {\mfunctionlabeltext{arctan}}
+\definemathcommand [arg] [nolop] {\mfunctionlabeltext{arg}}
+\definemathcommand [cosh] [nolop] {\mfunctionlabeltext{cosh}}
+\definemathcommand [cos] [nolop] {\mfunctionlabeltext{cos}}
+\definemathcommand [coth] [nolop] {\mfunctionlabeltext{coth}}
+\definemathcommand [cot] [nolop] {\mfunctionlabeltext{cot}}
+\definemathcommand [csc] [nolop] {\mfunctionlabeltext{csc}}
+\definemathcommand [deg] [nolop] {\mfunctionlabeltext{deg}}
+\definemathcommand [det] [limop] {\mfunctionlabeltext{det}}
+\definemathcommand [dim] [nolop] {\mfunctionlabeltext{dim}}
+\definemathcommand [exp] [nolop] {\mfunctionlabeltext{exp}}
+\definemathcommand [gcd] [limop] {\mfunctionlabeltext{gcd}}
+\definemathcommand [hom] [nolop] {\mfunctionlabeltext{hom}}
+\definemathcommand [inf] [limop] {\mfunctionlabeltext{inf}}
+\definemathcommand [injlim] [limop] {\mfunctionlabeltext{injlim}}
+\definemathcommand [ker] [nolop] {\mfunctionlabeltext{ker}}
+\definemathcommand [lg] [nolop] {\mfunctionlabeltext{lg}}
+\definemathcommand [liminf] [limop] {\mfunctionlabeltext{liminf}}
+\definemathcommand [limsup] [limop] {\mfunctionlabeltext{limsup}}
+\definemathcommand [lim] [limop] {\mfunctionlabeltext{lim}}
+\definemathcommand [ln] [nolop] {\mfunctionlabeltext{ln}}
+\definemathcommand [log] [nolop] {\mfunctionlabeltext{log}}
+\definemathcommand [median] [limop] {\mfunctionlabeltext{median}}
+\definemathcommand [max] [limop] {\mfunctionlabeltext{max}}
+\definemathcommand [min] [limop] {\mfunctionlabeltext{min}}
+\definemathcommand [mod] [limop] {\mfunctionlabeltext{mod}}
+%definemathcommand [div] [limop] {\mfunctionlabeltext{div}} % overloads \div symbol
+\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}}
+\definemathcommand [Pr] [limop] {\mfunctionlabeltext{Pr}}
+\definemathcommand [sec] [nolop] {\mfunctionlabeltext{sec}}
+\definemathcommand [sinh] [nolop] {\mfunctionlabeltext{sinh}}
+\definemathcommand [sin] [nolop] {\mfunctionlabeltext{sin}}
+\definemathcommand [sup] [limop] {\mfunctionlabeltext{sup}}
+\definemathcommand [tanh] [nolop] {\mfunctionlabeltext{tanh}}
+\definemathcommand [tan] [nolop] {\mfunctionlabeltext{tan}}
\definemathcommand [integers] {{\mathblackboard Z}}
\definemathcommand [reals] {{\mathblackboard R}}
@@ -104,14 +104,46 @@
\definemathcommand [complexes] {{\mathblackboard C}}
\definemathcommand [primes] {{\mathblackboard P}}
-% using attributes
+\let\normalmatharg\arg % todo: maybe automatically
-\def\choosemathbig#1#2{\dosetattribute{mathsize}{#1}\left#2\right.\doresetattribute{mathsize}}
+% using attributes
-\definemathcommand [big] {\choosemathbig\plusone }
-\definemathcommand [Big] {\choosemathbig\plustwo }
-\definemathcommand [bigg] {\choosemathbig\plusthree}
-\definemathcommand [Bigg] {\choosemathbig\plusfour }
+\chardef\bigmathdelimitermethod\plusone
+
+\def\plainbigdelimiters % traditional method
+ {\chardef\bigmathdelimitermethod\plustwo}
+
+\def\doplainbigmath#1#2%
+ {{\hbox{$%
+ \nulldelimiterspace\zeropoint\relax
+ \mathsurround\zeropoint
+ $}}}
+
+\def\doleftbigmath #1{\ifx#1\relax\else\left#1\expandafter\doleftbigmath \fi}
+\def\dorightbigmath#1{\ifx#1\relax\else\right.\expandafter\dorightbigmath\fi}
+
+\def\choosemathbig#1#2% so we accent \big{||} as well
+ {{\hbox{$%
+ \ifcase\bigmathdelimitermethod
+ \doleftbigmath#2\relax
+ \dorightbigmath#2\relax
+ \or
+ \attribute\mathsizeattribute#1\relax
+ \doleftbigmath#2\relax
+ \dorightbigmath#2\relax
+ \else
+ \doleftbigmath#2\relax
+ \vbox\!!to\getvalue{\??mm:b:\number#1}\bodyfontsize{}%
+ \dorightbigmath#2\relax
+ \fi
+ \nulldelimiterspace\zeropoint\relax
+ \mathsurround\zeropoint
+ $}}}
+
+\definemathcommand [big] {\choosemathbig\plusone } \setvalue{\??mm:b:1}{0.85}
+\definemathcommand [Big] {\choosemathbig\plustwo } \setvalue{\??mm:b:2}{1.15}
+\definemathcommand [bigg] {\choosemathbig\plusthree} \setvalue{\??mm:b:3}{1.45}
+\definemathcommand [Bigg] {\choosemathbig\plusfour } \setvalue{\??mm:b:4}{1.75}
\definemathcommand [bigl] [open] [one] {\big}
\definemathcommand [bigm] [rel] [one] {\big}
@@ -324,6 +356,10 @@
\unexpanded\def\underrightarrow{\mathopwithlimits\normalunderrightarrow}
\unexpanded\def\overrightarrow {\mathopwithlimits\normaloverrightarrow }
+\let\normalsurd\surd
+
+\unexpanded\def\surd{\normalsurd{}}
+
% todo mathclass=punctuation ord
% \Umathcode"02C="6 "0 "02C