summaryrefslogtreecommitdiff
path: root/tex/context/base/math-def.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-01-25 13:09:00 +0100
committerHans Hagen <pragma@wxs.nl>2012-01-25 13:09:00 +0100
commit71b6d9367123e33b454886654c24177be3d64880 (patch)
treeedcda6f3cd4ea1de2b89a273439fa75b40b65f4b /tex/context/base/math-def.mkiv
parent97af40831e32337e13acae3b562782a8f6a8e79b (diff)
downloadcontext-71b6d9367123e33b454886654c24177be3d64880.tar.gz
beta 2012.01.25 13:09
Diffstat (limited to 'tex/context/base/math-def.mkiv')
-rw-r--r--tex/context/base/math-def.mkiv78
1 files changed, 22 insertions, 56 deletions
diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv
index 70e36556d..96c122f51 100644
--- a/tex/context/base/math-def.mkiv
+++ b/tex/context/base/math-def.mkiv
@@ -24,26 +24,7 @@
\activatemathcharacters
-% will be attributes
-
-\setfalse \automathpunctuation
-
-\def\enablemathpunctuation {\settrue \automathpunctuation}
-\def\disablemathpunctuation{\setfalse\automathpunctuation}
-
-\def\v!autopunctuation{autopunctuation}
-
-\appendtoks
- \doifelse{\mathematicsparameter\v!autopunctuation}\v!yes\enablemathpunctuation\disablemathpunctuation
-\to \everysetupmathematics
-
-% \appendtoks
-% \ifconditional\automathpunctuation\attribute\mathpunctuationattribute\plusone\fi
-% \to \everymathematics
-
-\setupmathematics[\v!autopunctuation=\v!yes]
-
-% will go to math-ext
+% will go to math-ext (if used at all)
\Umathchardef\braceld=0 \defaultmathfamily "FF07A
\Umathchardef\bracerd=0 \defaultmathfamily "FF07B
@@ -125,6 +106,8 @@
\def\doleftbigmath #1{\ifx#1\relax\else\left#1\expandafter\doleftbigmath \fi}
\def\dorightbigmath#1{\ifx#1\relax\else\right.\expandafter\dorightbigmath\fi}
+\installcorenamespace{mathbig}
+
\def\choosemathbig#1#2% so we accent \big{||} as well
{{\hbox{$%
\ifcase\bigmathdelimitermethod
@@ -136,17 +119,17 @@
\dorightbigmath#2\relax
\else
\doleftbigmath#2\relax
- \vbox\!!to\getvalue{\??mm:b:\number#1}\bodyfontsize{}%
+ \vbox\!!to\getvalue{\??mathbig\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 [big] {\choosemathbig\plusone } \setvalue{\??mathbig1}{0.85}
+\definemathcommand [Big] {\choosemathbig\plustwo } \setvalue{\??mathbig2}{1.15}
+\definemathcommand [bigg] {\choosemathbig\plusthree} \setvalue{\??mathbig3}{1.45}
+\definemathcommand [Bigg] {\choosemathbig\plusfour } \setvalue{\??mathbig4}{1.75}
\definemathcommand [bigl] [open] [one] {\big}
\definemathcommand [bigm] [rel] [one] {\big}
@@ -161,9 +144,7 @@
\definemathcommand [Biggm] [rel] [one] {\Bigg}
\definemathcommand [Biggr] [close] [one] {\Bigg}
-% special
-
-%AM: Optimize this! Add similar options for sums.
+%D This needs checking:
\def\setoperatorlimits#1#2% operator limits
{\savenormalmeaning{#1}%
@@ -179,7 +160,9 @@
\setoperatorlimits\ointclockwise \intlimits
\setoperatorlimits\ointctrclockwise \intlimits
-%D This is a temporary hack until we figure out how to do this correctly.
+%D This is a temporary hack until we figure out how to do this correctly,
+%D preferably using math parameters but we can also consider doing some
+%D node juggling here.
\unexpanded\def\implies {\mathrel{\;\Longrightarrow\;}}
\unexpanded\def\impliedby{\mathrel{\;\Longleftarrow\;}}
@@ -236,18 +219,9 @@
\def\rootwithdegree [#1]{\rootradical{#1}}
\def\rootwithoutdegree {\rootradical {}}
-\def\PLAINmatrix#1%
- {\emptyhbox\,\vcenter{\normalbaselines\mathsurround\zeropoint
- \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
- \mathstrut\crcr\noalign{\kern-\baselineskip}
- #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
-
\definemathcommand [mathstrut] {\vphantom{(}}
\definemathcommand [joinrel] {\mathrel{\mkern-3mu}}
-% \definemathcommand [matrix] {\PLAINmatrix}
-% \definemathcommand [over] {\normalover} % hack, to do
-
\unexpanded\def\{{\mathortext\lbrace\letterleftbrace }
\unexpanded\def\}{\mathortext\rbrace\letterrightbrace}
@@ -294,17 +268,9 @@
\definemathcommand [colonsep] {\mkern-1.2mu}
\definemathcommand [doublecolonsep] {\mkern-0.9mu}
-%D The next macro vertically centeres its contents.
-
-\def\@center@math#1%
- {\vcenter{\hbox{$\mathsurround\zeropoint#1$}}}
-
-\def\@center@colon
- {\mathpalette\@center@math{\colon}}
-
-%D Now we define all the colon relations.
+%D Now we define all the colon relations .. needs checking with char-def.lua:
-\definemathcommand [centercolon] [rel] {\@center@colon}
+\definemathcommand [centercolon] [rel] {\mathpalette\vcenter{\hbox{$\mathsurround\zeropoint\colon$}}}
\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}}
\definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon}
\definemathcommand [colonequals] [rel] {\centercolon\colonsep=}
@@ -326,8 +292,8 @@
%D Goodies. We might move this elsewhere.
-% Be careful in choosing what accents you take (the code
-% below uses a combining one):
+% Be careful in choosing what accents you take (the code below uses a
+% combining one):
%
% \startbuffer
% % $\Umathaccent top 0 0 "20D7 {example}$
@@ -350,15 +316,15 @@
% \setupbodyfont[xits] \getbuffer
% \setupbodyfont[cambria] \getbuffer
-\def\underleftarrow #1{\mathop{\Uunderdelimiter \defaultmathfamily "2190 {#1}}}
-\def\overleftarrow #1{\mathop{\Uoverdelimiter \defaultmathfamily "2190 {#1}}}
-\def\underrightarrow#1{\mathop{\Uunderdelimiter \defaultmathfamily "2192 {#1}}}
-\def\overrightarrow #1{\mathop{\Uoverdelimiter \defaultmathfamily "2192 {#1}}}
+\unexpanded\def\underleftarrow #1{\mathop{\Uunderdelimiter \defaultmathfamily "2190 {#1}}}
+\unexpanded\def\overleftarrow #1{\mathop{\Uoverdelimiter \defaultmathfamily "2190 {#1}}}
+\unexpanded\def\underrightarrow#1{\mathop{\Uunderdelimiter \defaultmathfamily "2192 {#1}}}
+\unexpanded\def\overrightarrow #1{\mathop{\Uoverdelimiter \defaultmathfamily "2192 {#1}}}
% watch out: here we have a class (zero):
-\def\normaldoublebrace {\Umathaccents 0 \defaultmathfamily "23DE 0 \defaultmathfamily "23DF }
-\def\normaldoubleparent{\Umathaccents 0 \defaultmathfamily "23DC 0 \defaultmathfamily "23DD }
+\unexpanded\def\normaldoublebrace {\Umathaccents 0 \defaultmathfamily "23DE 0 \defaultmathfamily "23DF }
+\unexpanded\def\normaldoubleparent{\Umathaccents 0 \defaultmathfamily "23DC 0 \defaultmathfamily "23DD }
\let\normaloverbrace \overbrace
\let\normalunderbrace \underbrace