summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-22 14:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-22 14:15:05 +0100
commit442277c17f9171ecb94d4d974d3f16a07e1df4b1 (patch)
tree162e85aab26c05e84c947eb8143749e787a51ba2 /tex
parentf5d6cbdeba9b2e7e63997df429eb796bb871a7a2 (diff)
downloadcontext-442277c17f9171ecb94d4d974d3f16a07e1df4b1.tar.gz
2015-01-22 13:28:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4381 -> 4388 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/math-frc.mkiv199
-rw-r--r--tex/context/base/math-ini.mkiv12
-rw-r--r--tex/context/base/mult-mps.lua21
-rw-r--r--tex/context/base/publ-aut.lua2
-rw-r--r--tex/context/base/publ-ini.lua112
-rw-r--r--tex/context/base/status-files.pdfbin24962 -> 24943 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin333151 -> 333215 bytes
-rw-r--r--tex/context/base/syst-ini.mkiv2
-rw-r--r--tex/context/base/x-mathml.mkiv26
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 248 insertions, 132 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 939558740..8307ce650 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{2015.01.19 19:29}
+\newcontextversion{2015.01.22 13:26}
%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 dfb43033c..6502c4965 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 27a3b9fcf..5d5d5a8a2 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2015.01.19 19:29}
+\edef\contextversion{2015.01.22 13:26}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/math-frc.mkiv b/tex/context/base/math-frc.mkiv
index a9ab9ec6f..c466760ac 100644
--- a/tex/context/base/math-frc.mkiv
+++ b/tex/context/base/math-frc.mkiv
@@ -15,32 +15,14 @@
\unprotect
-%D todo: struts ... depends on demand
+%D I need to check it all again as there was a bug in luatex with dimensions that could
+%D resulted in side effects that made me mess with spacing.
+\unexpanded\def\topstrut{\vrule\s!width\zeropoint\s!height\strutht\s!depth\zeropoint\relax}
+\unexpanded\def\botstrut{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp\relax}
- \installcorenamespace {partialmathtopstrut}
- \installcorenamespace {partialmathbotstrut}
-
- \unexpanded\def\topstrut{\vrule\s!width\zeropoint\s!height\strutht\s!depth\zeropoint\relax}
- \unexpanded\def\botstrut{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp\relax}
-
- \unexpanded\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax}
- \unexpanded\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax}
-
- \letvalue{\??partialmathtopstrut\v!line }\topstrut
- \letvalue{\??partialmathbotstrut\v!line }\botstrut
-
- \letvalue{\??partialmathtopstrut\v!yes }\topstrut
- \letvalue{\??partialmathbotstrut\v!yes }\botstrut
-
- \letvalue{\??partialmathtopstrut\v!character}\mathtopstrut
- \letvalue{\??partialmathbotstrut\v!character}\mathbotstrut
-
- \letvalue{\??partialmathtopstrut }\donothing
- \letvalue{\??partialmathbotstrut }\donothing
-
- \unexpanded\def\math_partial_strut_top#1{\csname\??partialmathtopstrut\ifcsname\??partialmathtopstrut#1\endcsname#1\fi\endcsname}
- \unexpanded\def\math_partial_strut_bot#1{\csname\??partialmathbotstrut\ifcsname\??partialmathbotstrut#1\endcsname#1\fi\endcsname}
+\unexpanded\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax}
+\unexpanded\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax}
%D This module is reimplemented in \MKIV\ style.
@@ -131,7 +113,7 @@
\c!rulethickness=.25\exheight,
\c!left=0x2E,
\c!right=0x2E,
- \c!strut=,
+ \c!strut=\v!yes,
\c!topdistance=,
\c!bottomdistance=,
\c!rule=\v!auto]
@@ -148,6 +130,8 @@
\math_fraction_set_distance
\to \everymathematics
+% why only displaystyle .. a bit weak
+
\unexpanded\def\math_fraction_set_distance_top
{\Umathfractionnumup \displaystyle\m_math_fraction_distance_top
\relax}
@@ -183,10 +167,28 @@
% So far for control.
-\newdimen\d_math_fraction_margin
+\installcorenamespace{mathfractionstrut}
+
+\setvalue{\??mathfractionstrut\v!yes}%
+ {\let\m_fractions_strut_top\mathstrut
+ \let\m_fractions_strut_bot\mathstrut}
-\unexpanded\def\m_fractions_strut_top_indeed{\math_partial_strut_top\p_math_fractions_strut}
-\unexpanded\def\m_fractions_strut_bot_indeed{\math_partial_strut_bot\p_math_fractions_strut}
+\setvalue{\??mathfractionstrut\v!math}%
+ {\let\m_fractions_strut_top\mathstrut
+ \let\m_fractions_strut_bot\mathstrut}
+
+\setvalue{\??mathfractionstrut\v!no}%
+ {\let\m_fractions_strut_top\relax
+ \let\m_fractions_strut_bot\relax}
+
+\setvalue{\??mathfractionstrut\v!tight}%
+ {\let\m_fractions_strut_top\mathbotstrut % indeed swapped name
+ \let\m_fractions_strut_bot\mathtopstrut} % indeed swapped name
+
+\let\m_fractions_strut_top\relax
+\let\m_fractions_strut_bot\relax
+
+\newdimen\d_math_fraction_margin
\unexpanded\def\math_frac#1%
{\begingroup
@@ -197,13 +199,10 @@
\edef\p_math_fractions_color{\mathfractionparameter\c!color}%
%
\edef\p_math_fractions_strut{\mathfractionparameter\c!strut}%
- \ifx\p_math_fractions_strut\empty
- \let\m_fractions_strut_top\relax
- \let\m_fractions_strut_bot\relax
- \else
- \let\m_fractions_strut_top\m_fractions_strut_top_indeed
- \let\m_fractions_strut_bot\m_fractions_strut_bot_indeed
- \fi
+ \csname
+ \??mathfractionstrut
+ \ifcsname\??mathfractionstrut\p_math_fractions_strut\endcsname\p_math_fractions_strut\else\v!no\fi
+ \endcsname
%
\ifx\p_math_fractions_color\empty
\expandafter\math_frac_normal
@@ -229,11 +228,10 @@
\number\dimexpr\mathfractionparameter\c!rulethickness%
)}}
-% Having a \withmarginornot{#1}{#2} makes not much sense nor do
-% 4 tests or 4 redundant kerns (longer node lists plus possible
-% interference). A split in normal and margin also makes testing
-% easier. When left and right margins are needed we might merge
-% the variants again. After all, these are not real installers.
+% Having a \withmarginornot{#1}{#2} makes not much sense nor do 4 tests or 4 redundant
+% kerns (longer node lists plus possible interference). A split in normal and margin
+% also makes testing easier. When left and right margins are needed we might merge the
+% variants again. After all, these are not real installers.
\setvalue{\??mathfractionalternative\v!inner}%
{\ifcase\d_math_fraction_margin
@@ -260,18 +258,20 @@
\def\math_fraction_inner_normal#1#2%
{\Ustack{%
- {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}
- \math_frac_command
- {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}%
+ {%
+ {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}%
+ \math_frac_command
+ {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}%
+ }%
}\endgroup}
\def\math_fraction_outer_normal#1#2%
{\Ustack{%
\usemathstyleparameter\mathfractionparameter
{%
- {\m_fractions_strut_top#1}%
- \math_frac_command
- {\m_fractions_strut_bot#2}%
+ {\m_fractions_strut_top#1}%
+ \math_frac_command
+ {\m_fractions_strut_bot#2}%
}%
}\endgroup}
@@ -279,34 +279,36 @@
{\Ustack{%
\usemathstyleparameter\mathfractionparameter
{%
- {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}%
- \math_frac_command
- {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}%
+ {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}%
+ \math_frac_command
+ {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}%
}%
}\endgroup}
\def\math_fraction_inner_margin#1#2%
{\Ustack{%
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}%
- \kern\d_math_fraction_margin}%
- \math_frac_command
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}%
- \kern\d_math_fraction_margin}%
+ {%
+ {\kern\d_math_fraction_margin
+ \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}%
+ \kern\d_math_fraction_margin}%
+ \math_frac_command
+ {\kern\d_math_fraction_margin
+ \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}%
+ \kern\d_math_fraction_margin}%
+ }%
}\endgroup}
\def\math_fraction_outer_margin#1#2%
{\Ustack{%
\usemathstyleparameter\mathfractionparameter
{%
- {\kern\d_math_fraction_margin
- \m_fractions_strut_top#1%
- \kern\d_math_fraction_margin}%
- \math_frac_command
- {\kern\d_math_fraction_margin
- \m_fractions_strut_bot#2%
- \kern\d_math_fraction_margin}%
+ {\kern\d_math_fraction_margin
+ \m_fractions_strut_top#1%
+ \kern\d_math_fraction_margin}%
+ \math_frac_command
+ {\kern\d_math_fraction_margin
+ \m_fractions_strut_bot#2%
+ \kern\d_math_fraction_margin}%
}%
}\endgroup}
@@ -314,13 +316,13 @@
{\Ustack{%
\usemathstyleparameter\mathfractionparameter
{%
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1%
- \kern\d_math_fraction_margin}%
- \math_frac_command
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2%
- \kern\d_math_fraction_margin}%
+ {\kern\d_math_fraction_margin
+ \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1%
+ \kern\d_math_fraction_margin}%
+ \math_frac_command
+ {\kern\d_math_fraction_margin
+ \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2%
+ \kern\d_math_fraction_margin}%
}%
}\endgroup}
@@ -333,6 +335,40 @@
{\begingroup
\math_frac_alternative\scriptscriptstyle{#1}{\raise.25\exheight\hbox{$\scriptscriptstyle#2$}}}
+%D Spacing:
+
+\unexpanded\def\nomathfractiongaps {\normalexpanded{\math_no_fraction_gaps \triggermathstyle\mathstyle}} % maybe collect settings
+\unexpanded\def\overlaymathfractiongaps{\normalexpanded{\math_overlay_fraction_gaps\triggermathstyle\mathstyle}} % maybe collect settings
+
+\unexpanded\def\math_no_fraction_gaps#1%
+ {\Umathfractionnumup #1\zeropoint
+ \Umathfractiondenomdown#1\zeropoint}
+
+\unexpanded\def\math_overlay_fraction_gaps#1%
+ {\Umathfractionnumup #1\zeropoint
+ \Umathfractionnumvgap #1\zeropoint
+ %Umathfractionrule #1\zeropoint
+ \Umathfractiondenomvgap#1\zeropoint
+ \Umathfractiondenomdown#1\zeropoint}
+
+\installcorenamespace{mathfractiondistance}
+
+\letvalue{\??mathfractiondistance\v!none }\nomathfractiongaps
+\letvalue{\??mathfractiondistance\v!no }\nomathfractiongaps
+\letvalue{\??mathfractiondistance\v!overlay}\overlaymathfractiongaps
+
+\setupmathfractions
+ [\c!distance=\v!none]
+
+\appendtoks
+ \edef\p_distance{\rootmathfractionparameter\c!distance}%
+ \ifx\p_distance\empty\else
+ \ifcsname\??mathfractiondistance\p_distance\endcsname
+ \csname\??mathfractiondistance\p_distance\endcsname
+ \fi
+ \fi
+\to \everymathematics
+
%D \macros
%D {dfrac, tfrac, frac, dbinom, tbinom, binom}
%D
@@ -359,23 +395,13 @@
% \unexpanded\def\dfrac #1#2{{\displaystyle {{#1}\normalover {#2}}}}
% \unexpanded\def\tfrac #1#2{{\textstyle {{#1}\normalover {#2}}}}
-% \definemathfraction[frac] [\c!mathstyle=]
-% \definemathfraction[dfrac][\c!alternative=\v!outer,\c!mathstyle=\s!display]
-% \definemathfraction[tfrac][\c!alternative=\v!outer,\c!mathstyle=\s!text]
-% \definemathfraction[sfrac][\c!alternative=\v!outer,\c!mathstyle=\s!script]
-
-% \definemathfraction[frac] [\c!alternative=\v!inner, \c!mathstyle=\inlineordisplaymath\s!script {\s!cramped,\s!text}]
-% \definemathfraction[tfrac][\c!alternative=\inlineordisplaymath\v!inner\v!both,\c!mathstyle=\inlineordisplaymath\s!script {\s!cramped,\s!script}]
-% \definemathfraction[sfrac][\c!alternative=\inlineordisplaymath\v!inner\v!both,\c!mathstyle=\inlineordisplaymath\s!scriptscript{\s!cramped,\s!scriptscript}]
-% \definemathfraction[dfrac][\c!alternative=\v!inner, \c!mathstyle=\s!display]
-
-\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=] % was script and then small but nothign needed
-\definemathfraction[i:tfrac][\c!alternative=\v!inner,\c!mathstyle=\s!script]
+\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=] % was script and then small but nothing needed
+\definemathfraction[i:tfrac][\c!alternative=\v!inner,\c!mathstyle=\s!text] % was script (before luatex fix)
\definemathfraction[i:sfrac][\c!alternative=\v!inner,\c!mathstyle=\s!scriptscript]
\definemathfraction[i:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display]
-\definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped] % was {\s!cramped,\s!text}
-\definemathfraction[d:tfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!script}]
+\definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped] % was cramped,text
+\definemathfraction[d:tfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!text}] % was cramped,script (before luatex fix)
\definemathfraction[d:sfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!scriptscript}]
\definemathfraction[d:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display]
@@ -467,6 +493,11 @@
\unexpanded\def\splitdfrac#1#2%
{{\displaystyle{{ #1\quad\hfill}\normalabove\zeropoint{ \hfill\quad\mathstrut#2}}}}
+%D For testing:
+
+% \unexpanded\def\ShowMathFractions#1#2%
+% {\mathematics{x+\tfrac{#1}{#2}+1+\frac{#1}{#2}+2+\sfrac{#1}{#2}+g}}
+
\protect \endinput
% I have no clue what \mthfrac and \mthsqrt are supposed to do but
diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv
index c333893d5..d7587a5c4 100644
--- a/tex/context/base/math-ini.mkiv
+++ b/tex/context/base/math-ini.mkiv
@@ -13,6 +13,16 @@
\writestatus{loading}{ConTeXt Math Macros / Initializations}
+% Todo in luatex maincontrol.w: also accept a number here:
+%
+% case set_math_param_cmd:
+% p = cur_chr;
+% get_token();
+% if (cur_cmd != math_style_cmd) {
+
+% \unexpanded\def\Umathshow#1%
+% {\hbox{\infofont(\string#1:\the#1\textstyle,\the#1\scriptstyle,\the#1\scriptscriptstyle)}}
+
%D This module provides namespaces for math fonts, thereby permitting mixed usage of
%D math fonts. Although not strictly needed, we also provide a family name mapping
%D mechanism as used in the (original) AMS math definition files, but here these
@@ -436,7 +446,7 @@
\relax
\hskip-.01\emwidth}
-\unexpanded\def\showmathstruts % let's not overload \nath_strut_normal
+\unexpanded\def\showmathstruts % let's not overload \math_strut_normal
{\let\math_strut\math_strut_visual}
\let\math_strut\math_strut_normal
diff --git a/tex/context/base/mult-mps.lua b/tex/context/base/mult-mps.lua
index c5e4b04ac..1181977a9 100644
--- a/tex/context/base/mult-mps.lua
+++ b/tex/context/base/mult-mps.lua
@@ -3,7 +3,7 @@ return {
"btex", "etex", "verbatimtex",
},
shortcuts = {
- "..", "...", "--", "---", "&",
+ "..", "...", "--", "---", "&", "\\",
},
primitives = { -- to be checked
"charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing",
@@ -71,7 +71,7 @@ return {
commands = {
"upto", "downto",
"beginfig", "endfig",
- "beginglyph", "endglyph", "charscale",
+ "beginglyph", "endglyph", -- actually a mult-fun one
"rotatedaround", "reflectedabout",
"arrowhead",
"currentpen", "currentpicture", "cuttings",
@@ -127,6 +127,7 @@ return {
"labeloffset", "dotlabeldiam",
"defaultpen", "defaultscale",
"join_radius",
+ "charscale", -- actually a mult-fun one
--
"pen_lft", "pen_rt", "pen_top", "pen_bot", -- "pen_count_",
},
@@ -135,12 +136,12 @@ return {
"autorounding", "beginchar", "blacker", "boundarychar", "capsule_def",
"capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists",
"charext", "charht", "charic", "charlist", "charwd", "cull", "cullit",
- "currenttransform", "define_blacker_pixels", "define_corrected_pixels",
- "define_good_x_pixels", "define_good_y_pixels",
+ "currenttransform", "currentwindow", "define_blacker_pixels",
+ "define_corrected_pixels", "define_good_x_pixels", "define_good_y_pixels",
"define_horizontal_corrected_pixels", "define_pixels",
"define_whole_blacker_pixels", "define_whole_pixels",
"define_whole_vertical_blacker_pixels", "define_whole_vertical_pixels",
- "designsize", "display", "endchar", "extensible", "extra_beginchar",
+ "designsize", "display", "displaying", "endchar", "extensible", "extra_beginchar",
"extra_endchar", "extra_setup", "fillin", "font_coding_scheme",
"font_extra_space", "font_identifier", "font_normal_shrink",
"font_normal_space", "font_normal_stretch", "font_quad", "font_size",
@@ -150,12 +151,12 @@ return {
"makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays",
"notransforms", "numspecial", "o_correction", "openit", "openwindow",
"proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen",
- "screenchars", "screenrule", "screenstrokes", "showit", "slantfont",
- "smode", "smoothing", "titlefont", "totalweight", "tracingedges",
- "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset",
- "yoffset",
+ "screenchars", "screenrule", "screenstrokes", "screen_cols", "screen_rows",
+ "showit", "slantfont", "smode", "smoothing", "titlefont", "totalweight",
+ "tracingedges", "tracingpens", "turningcheck", "unitpixel", "vppp", "vround",
+ "xoffset", "yoffset",
},
disabled = {
- "verbatimtex"
+ "verbatimtex", "troffmode"
}
}
diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua
index f203d1f79..791b65294 100644
--- a/tex/context/base/publ-aut.lua
+++ b/tex/context/base/publ-aut.lua
@@ -310,7 +310,7 @@ end
function commands.btxauthor(dataset,tag,field,settings)
local split, usedfield, kind = getcasted(dataset,tag,field)
if kind == "author" then
- local max = split and #split or 0
+ local max = split and #split or 0
if max == 0 then
return
-- error
diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua
index 0431b6cbb..bf2102a9a 100644
--- a/tex/context/base/publ-ini.lua
+++ b/tex/context/base/publ-ini.lua
@@ -768,40 +768,108 @@ publications.getcasted = getcasted
publications.getfaster = getfaster
publications.getdirect = getdirect
+-- this needs to be checked: a specific type should have a checker
+
+-- author pagenumber keyword url
+
+-- function commands.btxsingularorplural(dataset,tag,name)
+-- local d = getcasted(dataset,tag,name)
+-- if type(d) == "table" then
+-- d = #d <= 1
+-- else
+-- d = true
+-- end
+-- ctx_doifelse(d)
+-- end
+
+-- function commands.oneorrange(dataset,tag,name)
+-- local d = datasets[dataset].luadata[tag] -- details ?
+-- if d then
+-- d = d[name]
+-- end
+-- if type(d) == "string" then
+-- d = find(d,"%-")
+-- else
+-- d = false
+-- end
+-- ctx_doifelse(not d) -- so singular is default
+-- end
+
+-- function commands.firstofrange(dataset,tag,name)
+-- local d = datasets[dataset].luadata[tag] -- details ?
+-- if d then
+-- d = d[name]
+-- end
+-- if type(d) == "string" then
+-- context(match(d,"([^%-]+)"))
+-- end
+-- end
+
+local inspectors = allocate()
+local nofmultiple = allocate()
+local firstandlast = allocate()
+
+publications.inspectors = inspectors
+inspectors.nofmultiple = nofmultiple
+inspectors.firstandlast = firstandlast
+
+function nofmultiple.author(d)
+ return type(d) == "table" and #d or 0
+end
+
function commands.btxsingularorplural(dataset,tag,name)
- local d = datasets[dataset].details[tag]
- if d then
- d = d[name]
+ local data, field, kind = getcasted(dataset,tag,name)
+ if data then
+ local test = nofmultiple[kind]
+ if test then
+ local n = test(data)
+ ctx_doifelse(not n or n < 2)
+ return
+ end
end
+ ctx_doifelse(true)
+end
+
+function firstandlast.pagenumber(d)
if type(d) == "table" then
- d = #d <= 1
- else
- d = false
+ return d[1], d[2]
end
- ctx_doifelse(d)
end
function commands.oneorrange(dataset,tag,name)
- local d = datasets[dataset].luadata[tag] -- details ?
- if d then
- d = d[name]
- end
- if type(d) == "string" then
- d = find(d,"%-")
- else
- d = false
-
+ local data, field, kind = getcasted(dataset,tag,name)
+ if data then
+ local test = firstandlast[kind]
+ if test then
+ local first, last = test(data)
+ ctx_doifelse(not (first and last))
+ end
end
- ctx_doifelse(not d) -- so singular is default
end
function commands.firstofrange(dataset,tag,name)
- local d = datasets[dataset].luadata[tag] -- details ?
- if d then
- d = d[name]
+ local data, field, kind = getcasted(dataset,tag,name)
+ if data then
+ local test = firstandlast[kind]
+ if test then
+ local first = test(data)
+ if first then
+ context(first)
+ end
+ end
end
- if type(d) == "string" then
- context(match(d,"([^%-]+)"))
+end
+
+function commands.lastofrange(dataset,tag,name)
+ local data, field, kind = getcasted(dataset,tag,name)
+ if data then
+ local test = firstandlast[kind]
+ if test then
+ local first, last = test(data)
+ if last then
+ context(last)
+ end
+ end
end
end
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 6a88cbdf8..c8be76f91 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index b84665942..1a4f54428 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv
index af3a0310c..73904cf63 100644
--- a/tex/context/base/syst-ini.mkiv
+++ b/tex/context/base/syst-ini.mkiv
@@ -328,7 +328,7 @@
\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree
\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree
\newskip \scratchskipone \newskip \scratchskiptwo \newskip \scratchskipthree
-\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree
+\newmuskip\scratchmuskipone \newmuskip\scratchmuskiptwo \newmuskip\scratchmuskipthree
\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv
index c80e23825..4c1146a7a 100644
--- a/tex/context/base/x-mathml.mkiv
+++ b/tex/context/base/x-mathml.mkiv
@@ -725,7 +725,7 @@
\startxmlsetups mml:cn:rational
\xmldoifelse {#1} {/mml:sep} {
- \frac
+ \mmlfrac
{\xmlsnippet{#1}{1}}
{\xmlsnippet{#1}{3}}
} {
@@ -910,7 +910,7 @@
\mmlsecond{#1}/\mmlthird{#1}
\else
\MMLcreset
- \frac{\MMLcreset\mmlsecond{#1}}{\MMLcreset\mmlthird{#1}}
+ \mmlfrac{\MMLcreset\mmlsecond{#1}}{\MMLcreset\mmlthird{#1}}
\fi
}
\advance\mmldividelevel\minusone
@@ -1308,7 +1308,7 @@
\doifelse \MMLdiffalternative \v!a {
\xmldoifelse {#1} {/mml:lambda} {
% a special case (mathadore/openmath)
- \frac {
+ \mmlfrac {
d
\normalsuperscript
{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:cn}}
@@ -1321,7 +1321,7 @@
}
} {
\xmldoifelse {#1} {/mml:bvar} {
- \frac {
+ \mmlfrac {
{\mr d}{
\xmldoifelse {#1} {/mml:degree} {
\normalsuperscript{\xmlconcat{#1}{/mml:degree}\empty}
@@ -1392,7 +1392,7 @@
\xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)}
} {
\xmldoifelse {#1} {/mml:bvar} {
- \frac {
+ \mmlfrac {
{\mr d}\normalsuperscript{
\xmldoifelse {#1} {/mml:degree} {
\xmlconcat{#1}{/mml:degree}\empty
@@ -1844,14 +1844,18 @@
\xmlmapvalue {mml:s} {sans-serif-bold-italic} {\mathss\mathbi}
\xmlmapvalue {mml:s} {monospace} {\mathtt}
-\xmlmapvalue {mml:l} {-} {\triggersmallstyle}
-\xmlmapvalue {mml:l} {+} {\triggerbigstyle}
+\xmlmapvalue {mml:l} {-} {\let\mmlfrac\tfrac}
+ \let\mmlfrac\frac
+\xmlmapvalue {mml:l} {+} {\let\mmlfrac\sfrac}
% todo: displaystyle=true/false (or whatever else shows up)
\starttexdefinition setmmlmathstyle #1
- \xmlval {mml:s} {\xmlatt{#1}{mathvariant}} \empty % was: \mmmr
- \xmlval {mml:l} {\xmlatt{#1}{scriptlevel}} \empty % was: \mmmr
+ \xmlval{mml:s}{\xmlatt{#1}{mathvariant}}\empty % was: \mmmr
+\stoptexdefinition
+
+\starttexdefinition setmmlscriptlevel #1
+ \xmlval{mml:l}{\xmlatt{#1}{scriptlevel}}{\let\mmlfrac\frac}
\stoptexdefinition
\starttexdefinition applymmlmathcolor #1#2
@@ -1910,6 +1914,7 @@
\begingroup
\pushmathstyle
\setmmlmathstyle{#1}
+ \setmmlscriptlevel{#1}
\ctxmodulemathml{mi("#1")}
\popmathstyle
\endgroup
@@ -2054,7 +2059,7 @@
\doifelse{\xmlatt{#1}{bevelled}}{true} {
\left.\mmlfirst{#1}\middle/\mmlsecond{#1}\right.% \thinspace\middle/\thinspace
} {
- \frac{\mmlfirst{#1}}{\mmlsecond{#1}}
+ \mmlfrac{\mmlfirst{#1}}{\mmlsecond{#1}}
}
\else
\doifelse {\xmlval{mml:mfrac:linethickness}{\mmlfraclinethickness}{}} {} {
@@ -2087,6 +2092,7 @@
\begingroup
\pushmathstyle
\setmmlmathstyle{#1}
+ \setmmlscriptlevel{#1}
\xmlflush{#1}
\popmathstyle
\endgroup
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index e5b159d7d..26d9f3d41 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 : 01/19/15 19:29:42
+-- merge date : 01/22/15 13:26:19
do -- begin closure to overcome local limits and interference