From bf74457e0e08d06f934bf511ed22d95bb6f4be82 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 20 Aug 2013 13:40:14 +0300 Subject: beta 2013.08.20 12:31 --- tex/context/base/char-def.lua | 23 ++- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4106 -> 4110 bytes tex/context/base/context.mkiv | 4 +- tex/context/base/font-con.lua | 2 +- tex/context/base/math-def.mkiv | 223 ++------------------- tex/context/base/math-fen.mkiv | 75 +++++-- tex/context/base/math-ini.lua | 38 +++- tex/context/base/math-ini.mkiv | 20 +- tex/context/base/math-rad.mkvi | 35 +++- tex/context/base/math-stc.mkvi | 35 +++- tex/context/base/mult-de.mkii | 1 + tex/context/base/mult-def.lua | 10 + tex/context/base/mult-en.mkii | 1 + tex/context/base/mult-fr.mkii | 1 + tex/context/base/mult-it.mkii | 1 + tex/context/base/mult-mps.lua | 2 +- tex/context/base/mult-nl.mkii | 1 + tex/context/base/mult-pe.mkii | 1 + tex/context/base/mult-ro.mkii | 1 + tex/context/base/status-files.pdf | Bin 24781 -> 24752 bytes tex/context/base/status-lua.log | 2 +- tex/context/base/status-mkiv.lua | 6 + tex/context/interface/keys-cs.xml | 1 + tex/context/interface/keys-de.xml | 1 + tex/context/interface/keys-en.xml | 1 + tex/context/interface/keys-fr.xml | 1 + tex/context/interface/keys-it.xml | 1 + tex/context/interface/keys-nl.xml | 1 + tex/context/interface/keys-pe.xml | 1 + tex/context/interface/keys-ro.xml | 1 + tex/generic/context/luatex/luatex-fonts-merged.lua | 4 +- 32 files changed, 228 insertions(+), 268 deletions(-) (limited to 'tex') diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua index 86e6eef2a..7902ad95a 100644 --- a/tex/context/base/char-def.lua +++ b/tex/context/base/char-def.lua @@ -990,7 +990,7 @@ characters.data={ direction="on", linebreak="op", mathclass="open", - mathname="lbrack", + mathname="lbracket", mirror=0x005D, unicodeslot=0x005B, }, @@ -1014,7 +1014,7 @@ characters.data={ direction="on", linebreak="cp", mathclass="close", - mathname="rbrack", + mathname="rbracket", mirror=0x005B, unicodeslot=0x005D, }, @@ -61520,6 +61520,8 @@ characters.data={ description="NABLA", direction="on", linebreak="ai", + mathclass="default", + mathname="nabla", unicodeslot=0x2207, }, [0x2208]={ @@ -61746,8 +61748,20 @@ characters.data={ description="SQUARE ROOT", direction="on", linebreak="ai", - mathclass="radical", - mathname="surd", + mathspec={ + { + class="root", + name="rootradical", + }, + { + class="radical", + name="surdradical", + }, + { + class="ordinary", + name="surd", + }, + }, unicodeslot=0x221A, }, [0x221B]={ @@ -173811,7 +173825,6 @@ characters.data={ }, [0x1D6FB]={ category="sm", - comment="mathname='nabla'", description="MATHEMATICAL ITALIC NABLA", direction="l", linebreak="al", diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index d5f2014e6..13bfcc907 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.08.18 18:32} +\newcontextversion{2013.08.20 12:31} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 2f1e7f2fb..9b5a5f67e 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index abb5bc13e..c4747fd46 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.08.18 18:32} +\edef\contextversion{2013.08.20 12:31} \edef\contextkind {beta} %D For those who want to use this: @@ -420,7 +420,7 @@ \loadmarkfile{math-ini} \loadmarkfile{math-pln} \loadmarkfile{math-for} -\loadmarkfile{math-def} +\loadmarkfile{math-def} % also saves some meanings \loadmarkfile{math-ali} %loadmarkfile{math-arr} \loadmkvifile{math-stc} diff --git a/tex/context/base/font-con.lua b/tex/context/base/font-con.lua index 091058075..2e35d3ad7 100644 --- a/tex/context/base/font-con.lua +++ b/tex/context/base/font-con.lua @@ -475,7 +475,7 @@ function constructors.scale(tfmdata,specification) -- target.postprocessors = tfmdata.postprocessors -- - local targetslant = (parameters.slant or parameters[1] or 0) + local targetslant = (parameters.slant or parameters[1] or 0) -- *hdelta ? needs checking local targetspace = (parameters.space or parameters[2] or 0)*hdelta local targetspace_stretch = (parameters.space_stretch or parameters[3] or 0)*hdelta local targetspace_shrink = (parameters.space_shrink or parameters[4] or 0)*hdelta diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index 4b881d705..cc75252aa 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -15,7 +15,7 @@ \unprotect -% this will be done at the lua end +%D Some day this will be done at the lua end. \startluacode mathematics.define(\number\defaultmathfamily) @@ -24,22 +24,8 @@ \activatemathcharacters -% will go to math-ext (if used at all) - -\Umathchardef\braceld=0 \defaultmathfamily "FF07A -\Umathchardef\bracerd=0 \defaultmathfamily "FF07B -\Umathchardef\bracelu=0 \defaultmathfamily "FF07C -\Umathchardef\braceru=0 \defaultmathfamily "FF07D - -% ctx specific - -% \bgroup -% \catcode`|=\othercatcode -% \global\let\|=| -% \egroup - -% The \mfunction macro is an alternative for \hbox with a -% controlable font switch. +%D The \mfunction macro is an alternative for \hbox with a controlable font +%D switch. \definemathcommand [arccos] [nolop] {\mfunctionlabeltext{arccos}} \definemathcommand [arcsin] [nolop] {\mfunctionlabeltext{arcsin}} @@ -69,7 +55,7 @@ \definemathcommand [max] [limop] {\mfunctionlabeltext{max}} \definemathcommand [min] [limop] {\mfunctionlabeltext{min}} \definemathcommand [mod] [limop] {\mfunctionlabeltext{mod}} -%definemathcommand [div] [limop] {\mfunctionlabeltext{div}} % overloads \div symbol +%definemathcommand [div] [limop] {\mfunctionlabeltext{div}} % overloads \div symbol \definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}} \definemathcommand [Pr] [limop] {\mfunctionlabeltext{Pr}} \definemathcommand [sec] [nolop] {\mfunctionlabeltext{sec}} @@ -79,170 +65,23 @@ \definemathcommand [tanh] [nolop] {\mfunctionlabeltext{tanh}} \definemathcommand [tan] [nolop] {\mfunctionlabeltext{tan}} -% \definemathcommand [integers] {{\mathblackboard Z}} -% \definemathcommand [reals] {{\mathblackboard R}} -% \definemathcommand [rationals] {{\mathblackboard Q}} -% \definemathcommand [naturalnumbers]{{\mathblackboard N}} -% \definemathcommand [complexes] {{\mathblackboard C}} -% \definemathcommand [primes] {{\mathblackboard P}} - \let\normalmatharg\arg % todo: maybe automatically -% moved to fences -% -% methods: -% -% 1: none -% 2: lua -% 3: tex -% -% variants: -% -% 1: step 1 -% 2: step 2 -% 3: htdp * 1.33^n -% 4: size * 1.33^n -% -% \setnewconstant\bigmathdelimitermethod \plusone -% \setnewconstant\bigmathdelimitervariant\plusthree -% -% \unexpanded\def\plainbigdelimiters % traditional method -% {\bigmathdelimitermethod\plustwo} -% -% \plainbigdelimiters % is default for the moment but not so nice -% -% \def\doleftbigmath #1{\ifx#1\relax\else\left#1\fi} -% \def\dorightbigmath#1{\ifx#1\relax\else\right.\fi} -% -% \installcorenamespace{mathbig} -% -% \unexpanded\def\choosemathbig#1#2% so we accept \big{||} as well -% {{\hbox{$% -% \ifcase\bigmathdelimitermethod -% \doleftbigmath#2\relax -% \dorightbigmath#2\relax -% \or -% \attribute\mathsizeattribute\numexpr\bigmathdelimitervariant*\plushundred+#1\relax -% \doleftbigmath#2\relax -% \dorightbigmath#2\relax -% \else -% \doleftbigmath#2\relax -% \vbox to\getvalue{\??mathbig\number#1}\bodyfontsize{}% -% \dorightbigmath#2\relax -% \fi -% \nulldelimiterspace\zeropoint\relax -% \mathsurround\zeropoint -% $}}} -% -% \unexpanded\def\mathdelimiterstep#1#2% -% {\begingroup -% \attribute\mathsizeattribute\numexpr\plushundred+#1\relax -% \doleftbigmath#2\relax -% \dorightbigmath#2\relax -% \endgroup} -% -% \definemathcommand [big] {\choosemathbig\plusone } -% \definemathcommand [Big] {\choosemathbig\plustwo } -% \definemathcommand [bigg] {\choosemathbig\plusthree} -% \definemathcommand [Bigg] {\choosemathbig\plusfour } -% -% \definemathcommand [bigl] [open] [one] {\big} -% \definemathcommand [bigm] [rel] [one] {\big} -% \definemathcommand [bigr] [close] [one] {\big} -% \definemathcommand [Bigl] [open] [one] {\Big} -% \definemathcommand [Bigm] [rel] [one] {\Big} -% \definemathcommand [Bigr] [close] [one] {\Big} -% \definemathcommand [biggl] [open] [one] {\bigg} -% \definemathcommand [biggm] [rel] [one] {\bigg} -% \definemathcommand [biggr] [close] [one] {\bigg} -% \definemathcommand [Biggl] [open] [one] {\Bigg} -% \definemathcommand [Biggm] [rel] [one] {\Bigg} -% \definemathcommand [Biggr] [close] [one] {\Bigg} - %D This needs checking: -\def\setoperatorlimits#1#2% operator limits +\unexpanded\def\setoperatorlimits#1#2% operator limits {\savenormalmeaning{#1}% - \def#1{\csname normal\strippedcsname#1\endcsname#2}} - -\setoperatorlimits\int \intlimits -\setoperatorlimits\iint \intlimits -\setoperatorlimits\iiint \intlimits -\setoperatorlimits\oint \intlimits -\setoperatorlimits\oiint \intlimits -\setoperatorlimits\oiiint \intlimits -\setoperatorlimits\intclockwise \intlimits -\setoperatorlimits\ointclockwise \intlimits -\setoperatorlimits\ointctrclockwise \intlimits - -%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\;}} -\unexpanded\def\And {\mathrel{\;\internalAnd\;}} -%unexpanded\def\iff {\;\Longleftrightarrow\;} -\setuvalue {iff}{\;\Longleftrightarrow\;} % nicer for if checker - -% todo: virtual in math-vfu - -% \definemathcommand [mapsto] {\mapstochar\rightarrow} -% \definemathcommand [hookrightarrow] {\lhook\joinrel\rightarrow} -% \definemathcommand [hookleftarrow] {\leftarrow\joinrel\rhook} -% \definemathcommand [bowtie] {\mathrel\triangleright\joinrel\mathrel\triangleleft} -% \definemathcommand [models] {\mathrel|\joinrel=} -% \definemathcommand [iff] {\;\Longleftrightarrow\;} - -% hm - -% ldots = 2026 -% vdots = 22EE -% cdots = 22EF -% ddots = 22F1 -% udots = 22F0 - -% \def\PLAINldots{\ldotp\ldotp\ldotp} -% \def\PLAINcdots{\cdotp\cdotp\cdotp} - -% \def\PLAINvdots -% {\vbox{\baselineskip.4\bodyfontsize\lineskiplimit\zeropoint\kern.6\bodyfontsize\hbox{.}\hbox{.}\hbox{.}}} - -% \def\PLAINddots -% {\mkern1mu% -% \raise.7\bodyfontsize\vbox{\kern.7\bodyfontsize\hbox{.}}% -% \mkern2mu% -% \raise.4\bodyfontsize\relax\hbox{.}% -% \mkern2mu% -% \raise.1\bodyfontsize\hbox{.}% -% \mkern1mu} - -% \definemathcommand [ldots] [inner] {\PLAINldots} -% \definemathcommand [cdots] [inner] {\PLAINcdots} -% \definemathcommand [vdots] [nothing] {\PLAINvdots} -% \definemathcommand [ddots] [inner] {\PLAINddots} - -%D \starttyping -%D $\sqrt[3]{10}$ -%D \stoptyping -%D -%D This root command will be overloaded later: - -\def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def - -\def\root#1\of{\rootradical{#1}} % #2 - -\unexpanded\def\sqrt{\doifnextoptionalelse\rootwithdegree\rootwithoutdegree} - -\def\rootwithdegree [#1]{\rootradical{#1}} -\def\rootwithoutdegree {\rootradical {}} - -\definemathcommand [mathstrut] {\vphantom{(}} -\definemathcommand [joinrel] {\mathrel{\mkern-3mu}} - -\unexpanded\def\{{\mathortext\lbrace\letterleftbrace } % or maybe a chardef -\unexpanded\def\}{\mathortext\rbrace\letterrightbrace} % or maybe a chardef -\unexpanded\def\|{\mathortext\vert \letterbar } % or maybe a chardef + \expandafter\def\expandafter#1\expandafter{\csname normal\strippedcsname#1\endcsname#2}} + +\setoperatorlimits \int \intlimits +\setoperatorlimits \iint \intlimits +\setoperatorlimits \iiint \intlimits +\setoperatorlimits \oint \intlimits +\setoperatorlimits \oiint \intlimits +\setoperatorlimits \oiiint \intlimits +\setoperatorlimits \intclockwise \intlimits +\setoperatorlimits \ointclockwise \intlimits +\setoperatorlimits \ointctrclockwise \intlimits %D The following colon related definitions are provided by Aditya %D Mahajan who derived them from \type {mathtools.sty} and \type @@ -288,7 +127,7 @@ \definemathcommand [doublecolonsep] {\mkern-0.9mu} %D Now we define all the colon relations .. needs checking with char-def.lua ... -%d will move to a separate module. +%D will move to a separate module. \definemathcommand [centercolon] [rel] {\mathstylevcenteredhbox\colon} \definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}} @@ -348,9 +187,6 @@ % let's keep this -\def\Umathbotaccent{\Umathaccent \s!bottom } -\def\Umathaccents {\Umathaccent \s!both } - \let\normaloverbrace \overbrace \let\normalunderbrace \underbrace \let\normaloverparent \overparent @@ -365,34 +201,9 @@ \unexpanded\def\mathopwithlimits#1#2{\mathop{#1{#2}}\limits} \unexpanded\def\stackrel #1#2{\mathrel{\mathop{#2}\limits^{#1}}} -% these are stackers now - -%\unexpanded\def\overbrace {\mathopwithlimits\normaloverbrace } -%\unexpanded\def\underbrace {\mathopwithlimits\normalunderbrace } -%\unexpanded\def\doublebrace {\mathopwithlimits\normaldoublebrace } -%\unexpanded\def\overparent {\mathopwithlimits\normaloverparent } -%\unexpanded\def\underparent {\mathopwithlimits\normalunderparent } -%\unexpanded\def\overbracket {\mathopwithlimits\normaloverbracket } -%\unexpanded\def\underbracket {\mathopwithlimits\normalunderbracket } -%\unexpanded\def\doubleparent {\mathopwithlimits\normaldoubleparent } - -%unexpanded\def\underleftarrow {\mathopwithlimits\normalunderleftarrow } -%unexpanded\def\overleftarrow {\mathopwithlimits\normaloverleftarrow } -%unexpanded\def\underrightarrow{\mathopwithlimits\normalunderrightarrow} -%unexpanded\def\overrightarrow {\mathopwithlimits\normaloverrightarrow } - \let\lceil \lceiling \let\rceil \rceiling -\let\normalsurd\surd - -\unexpanded\def\surd{\normalsurd{}} - -% Some special characters: - -\unexpanded\def\nabla{∇} % this one adapts - -% % todo mathclass=punctuation ord % \Umathcode"02C="6 \defaultmathfamily "02C diff --git a/tex/context/base/math-fen.mkiv b/tex/context/base/math-fen.mkiv index 9ad1a1ec1..2a05ac5a1 100644 --- a/tex/context/base/math-fen.mkiv +++ b/tex/context/base/math-fen.mkiv @@ -56,17 +56,17 @@ \def\math_fenced_left {\edef\p_left{\mathfenceparameter\c!left}% \math_fenced_color_push - \normalleft\ifx\p_left\empty.\else\Udelimiter\plusfour\fam\p_left\fi + \normalleft\ifx\p_left\empty.\else\Udelimiter\plusfour\fam\p_left\relax\fi \math_fenced_color_pop} \def\math_fenced_middle{\edef\p_middle{\mathfenceparameter\c!middle}% \mskip\thinmuskip \math_fenced_color_push - \normalmiddle\ifx\p_middle\empty.\else\Udelimiter\plusfour\fam\p_middle\fi + \normalmiddle\ifx\p_middle\empty.\else\Udelimiter\plusfour\fam\p_middle\relax\fi \math_fenced_color_pop \mskip\thinmuskip} \def\math_fenced_right {\edef\p_right{\mathfenceparameter\c!right}% \math_fenced_color_push - \normalright\ifx\p_right\empty.\else\Udelimiter\plusfive\fam\p_right\fi + \normalright\ifx\p_right\empty.\else\Udelimiter\plusfive\fam\p_right\relax\fi \math_fenced_color_pop} \def\math_fenced_color_do_push{\pushcolor[\p_math_fenced_color]} @@ -178,25 +178,48 @@ \setvalue{\??mathright \s!unknown}{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalright \nexttoken\fi} \setvalue{\??mathmiddle\s!unknown}{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalmiddle\nexttoken\fi} -\bgroup - - \let\temp [ \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Lbracket - \let\temp ( \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Lparent - \let\temp < \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Langle - \let\temp { \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Lbrace - \let\temp | \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Lbar - \let\temp ‖ \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Ldoublebar - \let\temp . \global\expandafter\let\csname\??mathleft\meaning\temp\endcsname\Lnothing - - \let\temp ] \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rbracket - \let\temp ) \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rparent - \let\temp > \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rangle - \let\temp } \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rbrace - \let\temp | \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rbar - \let\temp ‖ \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rdoublebar - \let\temp . \global\expandafter\let\csname\??mathright\meaning\temp\endcsname\Rnothing - -\egroup +\unexpanded\def\installmathfencepair#1#2#3#4% + {\expandafter\let\csname\??mathleft \meaning#1\endcsname#2% + \expandafter\let\csname\??mathright\meaning#3\endcsname#4} + +\expandafter\let\csname\??mathleft\meaning [\endcsname\Lbracket +\expandafter\let\csname\??mathleft\meaning (\endcsname\Lparent +\expandafter\let\csname\??mathleft\meaning <\endcsname\Langle +\expandafter\let\csname\??mathleft\meaning {\endcsname\Lbrace +\expandafter\let\csname\??mathleft\meaning |\endcsname\Lbar +\expandafter\let\csname\??mathleft\meaning ‖\endcsname\Ldoublebar +\expandafter\let\csname\??mathleft\meaning .\endcsname\Lnothing + +\expandafter\let\csname\??mathright\meaning ]\endcsname\Rbracket +\expandafter\let\csname\??mathright\meaning )\endcsname\Rparent +\expandafter\let\csname\??mathright\meaning >\endcsname\Rangle +\expandafter\let\csname\??mathright\meaning }\endcsname\Rbrace +\expandafter\let\csname\??mathright\meaning |\endcsname\Rbar +\expandafter\let\csname\??mathright\meaning ‖\endcsname\Rdoublebar +\expandafter\let\csname\??mathright\meaning .\endcsname\Rnothing + +\let\lbrack\lbracket +\let\rbrack\rbracket + +\installmathfencepair \lbrace \Lbrace \rbrace \Rbrace +\installmathfencepair \lbracket \Lbracket \rbracket \Rbracket +\installmathfencepair \lparent \Lparent \rparent \Rparent +\installmathfencepair \langle \Langle \rangle \Rangle +%installmathfencepair \lbar \Lbar \rbar \Rbar + +\unexpanded\def\{{\mathortext\lbrace \letterleftbrace } % or maybe a chardef +\unexpanded\def\}{\mathortext\rbrace \letterrightbrace } % or maybe a chardef +\unexpanded\def\[{\mathortext\lbracket\letterleftbracket } % or maybe a chardef +\unexpanded\def\]{\mathortext\rbracket\letterrightbracket} % or maybe a chardef +\unexpanded\def\({\mathortext\lparent \letterleftparent } % or maybe a chardef +\unexpanded\def\){\mathortext\rparent \letterrightparent } % or maybe a chardef +\unexpanded\def\|{\mathortext\vert \letterbar } % or maybe a chardef + +\installmathfencepair \{ \Lbrace \} \Rbrace +\installmathfencepair \[ \Lbracket \] \Rbracket +\installmathfencepair \( \Lparent \) \Rparent +\installmathfencepair \< \Langle \> \Rangle +\installmathfencepair \| \Lbar \| \Rbar %D As we have overloaded \type {\left} and \type {\right} we also need a more %D clever version of the following: @@ -296,4 +319,12 @@ % \definemathoverextensible [top] [hoed] ["FE302] % \definemathoverextensible [top] [slang] ["FE303] +%D The next characters were used for constructing nicer extensibles but +%D nowadays we have real characters. + +\Umathchardef\braceld=0 \defaultmathfamily "FF07A +\Umathchardef\bracerd=0 \defaultmathfamily "FF07B +\Umathchardef\bracelu=0 \defaultmathfamily "FF07C +\Umathchardef\braceru=0 \defaultmathfamily "FF07D + \protect diff --git a/tex/context/base/math-ini.lua b/tex/context/base/math-ini.lua index c6d96dab2..6be06e634 100644 --- a/tex/context/base/math-ini.lua +++ b/tex/context/base/math-ini.lua @@ -90,6 +90,7 @@ local classes = allocate { large = 1, -- op variable = 7, -- alphabetic number = 7, -- alphabetic + root = 16, -- a private one } local open_class = 4 @@ -154,6 +155,10 @@ local function radical(family,slot) return formatters['\\Uradical "%X "%X '](family,slot) end +local function root(family,slot) + return formatters['\\Uroot "%X "%X '](family,slot) +end + local function mathchardef(name,class,family,slot) return formatters['\\Umathchardef\\%s "%X "%X "%X '](name,class,family,slot) end @@ -194,29 +199,42 @@ local setmathcharacter = function(class,family,slot,unicode,mset,dset) return mset, dset end +local f_accent = formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ] +local f_topaccent = formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ] +local f_botaccent = formatters[ [[\ugdef\%s{\Umathbotaccent 0 "%X "%X }]] ] +local f_over = formatters[ [[\ugdef\%s{\Udelimiterover "%X "%X }]] ] +local f_under = formatters[ [[\ugdef\%s{\Udelimiterunder "%X "%X }]] ] +local f_fence = formatters[ [[\ugdef\%s{\Udelimiter "%X "%X "%X }]] ] +local f_delimiter = formatters[ [[\ugdef\%s{\Udelimiter 0 "%X "%X }]] ] +local f_radical = formatters[ [[\ugdef\%s{\Uradical "%X "%X }]] ] +local f_root = formatters[ [[\ugdef\%s{\Uroot "%X "%X }]] ] +----- f_char = formatters[ [[\ugdef\%s{\Umathchar "%X "%X "%X }]] +local f_char = formatters[ [[\Umathchardef\%s "%X "%X "%X ]] ] + local setmathsymbol = function(name,class,family,slot) -- hex is nicer for tracing if class == classes.accent then - contextsprint(formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ](name,family,slot)) + contextsprint(f_accent(name,family,slot)) elseif class == classes.topaccent then - contextsprint(formatters[ [[\ugdef\%s{\Umathaccent 0 "%X "%X }]] ](name,family,slot)) + contextsprint(f_topaccent(name,family,slot)) elseif class == classes.botaccent then - contextsprint(formatters[ [[\ugdef\%s{\Umathbotaccent 0 "%X "%X }]] ](name,family,slot)) + contextsprint(f_botaccent(name,family,slot)) elseif class == classes.over then - contextsprint(formatters[ [[\ugdef\%s{\Udelimiterover "%X "%X }]] ](name,family,slot)) + contextsprint(f_over(name,family,slot)) elseif class == classes.under then - contextsprint(formatters[ [[\ugdef\%s{\Udelimiterunder "%X "%X }]] ](name,family,slot)) + contextsprint(f_under(name,family,slot)) elseif class == open_class or class == close_class or class == middle_class then setdelcode("global",slot,{family,slot,0,0}) - contextsprint(formatters[ [[\ugdef\%s{\Udelimiter "%X "%X "%X }]] ](name,class,family,slot)) + contextsprint(f_fence(name,class,family,slot)) elseif class == classes.delimiter then setdelcode("global",slot,{family,slot,0,0}) - contextsprint(formatters[ [[\ugdef\%s{\Udelimiter 0 "%X "%X }]] ](name,family,slot)) + contextsprint(f_delimiter(name,family,slot)) elseif class == classes.radical then - contextsprint(formatters[ [[\ugdef\%s{\Uradical "%X "%X }]] ](name,family,slot)) + contextsprint(f_radical(name,family,slot)) + elseif class == classes.root then + contextsprint(f_root(name,family,slot)) else -- beware, open/close and other specials should not end up here - -- contextsprint(formatters[ [[\ugdef\%s{\Umathchar "%X "%X "%X }]],name,class,family,slot)) - contextsprint(formatters[ [[\Umathchardef\%s "%X "%X "%X ]] ](name,class,family,slot)) + contextsprint(f_char(name,class,family,slot)) end end diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv index f386cdd30..bac46cbec 100644 --- a/tex/context/base/math-ini.mkiv +++ b/tex/context/base/math-ini.mkiv @@ -45,6 +45,13 @@ \registerctxluafile{math-tag}{1.001} \registerctxluafile{math-fbk}{1.001} +%D A few compatibility helpers: + +\def\Umathbotaccent{\Umathaccent \s!bottom } +\def\Umathaccents {\Umathaccent \s!both } + +%D The attributes that we will use: + \definesystemattribute[mathalphabet] [public] \definesystemattribute[mathsize] [public] \definesystemattribute[mathpunctuation][public] @@ -355,6 +362,11 @@ \unexpanded\def\mathcommand#1% {\csname\??mathcommand#1\endcsname} +%D Let's define a few comands here: + +\definemathcommand [mathstrut] {\vphantom{(}} +\definemathcommand [joinrel] {\mathrel{\mkern-3mu}} + %D Moved from font-ini.mkiv: %D %D \macros @@ -500,10 +512,6 @@ %D \tt test $\sin{(x^{\sin(x^{\sin(x)})})}$ test %D \stoptyping -%D Some goodies: - -\unexpanded\def\Angstrom{\nomathematics{\Aring}} - %D \macros %D {nonknuthmode, donknuthmode} %D @@ -679,8 +687,8 @@ \newconditional \knuthmode -\let\nonknuthmode\relax -\let\donknuthmode\relax +\let\nonknuthmode\relax % no longer needed in MkIV +\let\donknuthmode\relax % no longer needed in MkIV % \def\nonknuthmode % {\pushcatcodetable diff --git a/tex/context/base/math-rad.mkvi b/tex/context/base/math-rad.mkvi index b9d4021c3..b3a6a24c9 100644 --- a/tex/context/base/math-rad.mkvi +++ b/tex/context/base/math-rad.mkvi @@ -15,18 +15,33 @@ \unprotect -%D This is already defined in math-def.mkiv: +%D \starttyping +%D $\sqrt[3]{10}$ +%D \stoptyping +%D +%D This root command will be overloaded later: -% \def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def -% -% \def\root#1\of{\rootradical{#1}} % #2 -% -% A traditional approach: -% -% \unexpanded\def\sqrt{\doifnextoptionalelse\rootwithdegree\rootwithoutdegree} +%D Old stuff: + +% \def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def +% \def\surdradical{\Uradical \defaultmathfamily "221A } % can be done in char-def + +\def\root#1\of{\rootradical{#1}} % #2 + +\unexpanded\def\sqrt{\doifnextoptionalelse\rootwithdegree\rootwithoutdegree} + +\def\rootwithdegree[#1]{\rootradical{#1}} +\def\rootwithoutdegree {\rootradical {}} + +%D Even older stuff: + +% % is now a ordinary character % -% \def\rootwithdegree [#1]{\rootradical{#1}} -% \def\rootwithoutdegree {\rootradical {}} +% \let\normalsurd\surd % \Uradical "0 "221A +% \unexpanded\def\surd{\normalsurd{}} + + +%D The real thing: \installcorenamespace{mathradical} \installcorenamespace{mathradicalalternative} diff --git a/tex/context/base/math-stc.mkvi b/tex/context/base/math-stc.mkvi index 4652ee564..dd74f494c 100644 --- a/tex/context/base/math-stc.mkvi +++ b/tex/context/base/math-stc.mkvi @@ -265,7 +265,6 @@ \edef\currentmathstackers{#category}% \mathstackersparameter\c!left\relax \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi -% \ifmmode\mathrel\else\dontleavehmode\fi {\edef\p_offset {\mathstackersparameter\c!offset}% \edef\p_location {\mathstackersparameter\c!location}% \edef\p_order {\mathstackersparameter\c!order}% @@ -890,6 +889,40 @@ % \mathchardef\doublebond"003D % \mathchardef\triplebond"2261 +%D Also handy: + +\unexpanded\def\definemathunstacked + {\dotripleempty\math_stackers_define_unstacked_normal} + +\def\math_stackers_define_unstacked_normal[#1][#2][#3]% category name unicode + {\ifthirdargument + \setuevalue{#2}{\math_stackers_unstacked_normal{#1}{\number#3}}% + \else + \setuevalue{#1}{\math_stackers_unstacked_normal\noexpand\currentmathstackers{\number#2}}% + \fi} + +\unexpanded\def\math_stackers_unstacked_normal#category#codepoint% + {\begingroup + \edef\currentmathstackers{#category}% + \edef\p_moffset{\mathstackersparameter\c!moffset}% + \ifx\p_moffset\empty \else + \mskip\scratchmuskip + \fi + \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi + {\usemathstackerscolorparameter\c!color + \Umathchar\zerocount\defaultmathfamily#codepoint}% + \ifx\p_moffset\empty \else + \mskip\scratchmuskip + \fi + \endgroup} + +\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!rel] + +\definemathunstacked [\v!wide] [And] ["0026] % \mathrel{\;&\;} +\definemathunstacked [\v!wide] [impliedby] ["27F8] % \mathrel{\;\Longleftarrow\;} +\definemathunstacked [\v!wide] [implies] ["27F9] % \mathrel{\;\Longrightarrow\;} +\definemathunstacked [\v!wide] [iff] ["27FA] % \mathrel{\;\Longleftrightarrow\;} + \protect \endinput % \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}} diff --git a/tex/context/base/mult-de.mkii b/tex/context/base/mult-de.mkii index 4b7a54e61..4ac85404b 100644 --- a/tex/context/base/mult-de.mkii +++ b/tex/context/base/mult-de.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{mindepth} \setinterfaceconstant{minheight}{minhoehe} \setinterfaceconstant{minwidth}{minbreite} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index 07e1139f0..9398733bc 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -8932,6 +8932,16 @@ return { ["pe"]="کمترین‌عرض", ["ro"]="latimeminima", }, + ["moffset"]={ + ["cs"]="moffset", + ["de"]="moffset", + ["en"]="moffset", + ["fr"]="moffset", + ["it"]="moffset", + ["nl"]="moffset", + ["pe"]="moffset", + ["ro"]="moffset", + }, ["mpwidth"]={ ["en"]="mpwidth", ["nl"]="mpbreedte", diff --git a/tex/context/base/mult-en.mkii b/tex/context/base/mult-en.mkii index 7b06ec627..aee58f9b5 100644 --- a/tex/context/base/mult-en.mkii +++ b/tex/context/base/mult-en.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{mindepth} \setinterfaceconstant{minheight}{minheight} \setinterfaceconstant{minwidth}{minwidth} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/mult-fr.mkii b/tex/context/base/mult-fr.mkii index 55aa3af79..fff2def29 100644 --- a/tex/context/base/mult-fr.mkii +++ b/tex/context/base/mult-fr.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{profondeurmin} \setinterfaceconstant{minheight}{hauteurmin} \setinterfaceconstant{minwidth}{largeurmin} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/mult-it.mkii b/tex/context/base/mult-it.mkii index 6d3591c04..140c12198 100644 --- a/tex/context/base/mult-it.mkii +++ b/tex/context/base/mult-it.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{mindeoth} \setinterfaceconstant{minheight}{altezzamin} \setinterfaceconstant{minwidth}{ampiezzamin} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/mult-mps.lua b/tex/context/base/mult-mps.lua index 59411cd97..48fe36b52 100644 --- a/tex/context/base/mult-mps.lua +++ b/tex/context/base/mult-mps.lua @@ -55,7 +55,7 @@ return { "colormodel", "graypart", "dashpart", "penpart", -- "colorpart", - "stroked", "filled", "textual", "clipped", "bounded", + "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", }, commands = { diff --git a/tex/context/base/mult-nl.mkii b/tex/context/base/mult-nl.mkii index 275f86c1a..0624b01bf 100644 --- a/tex/context/base/mult-nl.mkii +++ b/tex/context/base/mult-nl.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{mindiepte} \setinterfaceconstant{minheight}{minhoogte} \setinterfaceconstant{minwidth}{minbreedte} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{maandconversie} \setinterfaceconstant{more}{meer} \setinterfaceconstant{mpdepth}{mpdiepte} diff --git a/tex/context/base/mult-pe.mkii b/tex/context/base/mult-pe.mkii index cff5dfce4..857a46cac 100644 --- a/tex/context/base/mult-pe.mkii +++ b/tex/context/base/mult-pe.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{کمترین‌عمق} \setinterfaceconstant{minheight}{کمترین‌ارتفاع} \setinterfaceconstant{minwidth}{کمترین‌عرض} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/mult-ro.mkii b/tex/context/base/mult-ro.mkii index e901e28f4..e73e59962 100644 --- a/tex/context/base/mult-ro.mkii +++ b/tex/context/base/mult-ro.mkii @@ -822,6 +822,7 @@ \setinterfaceconstant{mindepth}{mindepth} \setinterfaceconstant{minheight}{inaltimeminima} \setinterfaceconstant{minwidth}{latimeminima} +\setinterfaceconstant{moffset}{moffset} \setinterfaceconstant{monthconversion}{monthconversion} \setinterfaceconstant{more}{more} \setinterfaceconstant{mpdepth}{mpdepth} diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 8f9abcd1a..f032aa51f 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log index d76ec6f60..f8901d762 100644 --- a/tex/context/base/status-lua.log +++ b/tex/context/base/status-lua.log @@ -1,6 +1,6 @@ (cont-yes.mkiv -ConTeXt ver: 2013.08.18 18:32 MKIV beta fmt: 2013.8.18 int: english/english +ConTeXt ver: 2013.08.20 12:31 MKIV beta fmt: 2013.8.20 int: english/english system > 'cont-new.mkiv' loaded (cont-new.mkiv) diff --git a/tex/context/base/status-mkiv.lua b/tex/context/base/status-mkiv.lua index 62bfc790c..6901db4cc 100644 --- a/tex/context/base/status-mkiv.lua +++ b/tex/context/base/status-mkiv.lua @@ -1855,6 +1855,12 @@ return { loading = "always", status = "okay", }, + { + category = "mkiv", + filename = "math-rad", + loading = "always", + status = "okay", + }, { category = "mkiv", comment = "code might move to here", diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index f7de67072..122bd7a22 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 07add1d02..a024e918f 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 954dcffd2..8e4ef2561 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index b71707d8f..db2719fe6 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index ffdc8e2a6..eadd1ca4b 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index b09d73183..37b7c6213 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 069de9a1f..a517697e3 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -828,6 +828,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index b16f25e2c..d5935e6e5 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -828,6 +828,7 @@ + diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 7ab836bd1..8e883bf9a 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 08/18/13 18:32:06 +-- merge date : 08/20/13 12:31:41 do -- begin closure to overcome local limits and interference @@ -3802,7 +3802,7 @@ function constructors.scale(tfmdata,specification) end target.type=isvirtual and "virtual" or "real" target.postprocessors=tfmdata.postprocessors - local targetslant=(parameters.slant or parameters[1] or 0) + local targetslant=(parameters.slant or parameters[1] or 0) local targetspace=(parameters.space or parameters[2] or 0)*hdelta local targetspace_stretch=(parameters.space_stretch or parameters[3] or 0)*hdelta local targetspace_shrink=(parameters.space_shrink or parameters[4] or 0)*hdelta -- cgit v1.2.3