summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context/data/scite/context/lexers/data/scite-context-data-metapost.lua10
-rw-r--r--context/data/scite/context/scite-context-data-metapost.properties97
-rw-r--r--metapost/context/base/metafun.mpiv1
-rw-r--r--metapost/context/base/mp-mlib.mpiv16
-rw-r--r--metapost/context/base/mp-tool.mpiv55
-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
18 files changed, 364 insertions, 195 deletions
diff --git a/context/data/scite/context/lexers/data/scite-context-data-metapost.lua b/context/data/scite/context/lexers/data/scite-context-data-metapost.lua
index cc53b0c30..258524459 100644
--- a/context/data/scite/context/lexers/data/scite-context-data-metapost.lua
+++ b/context/data/scite/context/lexers/data/scite-context-data-metapost.lua
@@ -1,9 +1,9 @@
return {
- ["commands"]={ "upto", "downto", "beginfig", "endfig", "beginglyph", "endglyph", "charscale", "rotatedaround", "reflectedabout", "arrowhead", "currentpen", "currentpicture", "cuttings", "defaultfont", "extra_beginfig", "extra_endfig", "ditto", "EOF", "down", "evenly", "fullcircle", "halfcircle", "identity", "in", "left", "pensquare", "penrazor", "penspec", "origin", "quartercircle", "right", "unitsquare", "up", "withdots", "abs", "bbox", "ceiling", "center", "cutafter", "cutbefore", "dir", "directionpoint", "div", "dotprod", "intersectionpoint", "inverse", "mod", "round", "unitvector", "whatever", "cutdraw", "draw", "drawarrow", "drawdblarrow", "fill", "filldraw", "drawdot", "loggingall", "interact", "tracingall", "tracingnone", "pickup", "undraw", "unfill", "unfilldraw", "buildcycle", "dashpattern", "decr", "dotlabel", "dotlabels", "drawoptions", "incr", "label", "labels", "max", "min", "thelabel", "z", "beginchar", "blacker", "capsule_end", "change_width", "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", "endchar", "extra_beginchar", "extra_endchar", "extra_setup", "font_coding_scheme", "clearxy", "clearit", "clearpen", "shipit", "font_extra_space", "exitunless", "relax", "hide", "gobble", "gobbled", "stop", "blankpicture", "counterclockwise", "tensepath", "takepower", "direction", "softjoin", "makelabel", "rotatedabout", "flex", "superellipse", "image", "nullpen", "savepen", "clearpen", "penpos", "penlabels", "range", "thru", "z", "laboff", "bye", "red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "background", "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in", "triplet", "quadruplet" },
- ["disabled"]={ "verbatimtex" },
- ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "pen_lft", "pen_rt", "pen_top", "pen_bot" },
- ["metafont"]={ "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", "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", "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", "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", "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" },
+ ["commands"]={ "upto", "downto", "beginfig", "endfig", "beginglyph", "endglyph", "rotatedaround", "reflectedabout", "arrowhead", "currentpen", "currentpicture", "cuttings", "defaultfont", "extra_beginfig", "extra_endfig", "ditto", "EOF", "down", "evenly", "fullcircle", "halfcircle", "identity", "in", "left", "pensquare", "penrazor", "penspec", "origin", "quartercircle", "right", "unitsquare", "up", "withdots", "abs", "bbox", "ceiling", "center", "cutafter", "cutbefore", "dir", "directionpoint", "div", "dotprod", "intersectionpoint", "inverse", "mod", "round", "unitvector", "whatever", "cutdraw", "draw", "drawarrow", "drawdblarrow", "fill", "filldraw", "drawdot", "loggingall", "interact", "tracingall", "tracingnone", "pickup", "undraw", "unfill", "unfilldraw", "buildcycle", "dashpattern", "decr", "dotlabel", "dotlabels", "drawoptions", "incr", "label", "labels", "max", "min", "thelabel", "z", "beginchar", "blacker", "capsule_end", "change_width", "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", "endchar", "extra_beginchar", "extra_endchar", "extra_setup", "font_coding_scheme", "clearxy", "clearit", "clearpen", "shipit", "font_extra_space", "exitunless", "relax", "hide", "gobble", "gobbled", "stop", "blankpicture", "counterclockwise", "tensepath", "takepower", "direction", "softjoin", "makelabel", "rotatedabout", "flex", "superellipse", "image", "nullpen", "savepen", "clearpen", "penpos", "penlabels", "range", "thru", "z", "laboff", "bye", "red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "background", "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in", "triplet", "quadruplet" },
+ ["disabled"]={ "verbatimtex", "troffmode" },
+ ["internals"]={ "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", "charscale", "pen_lft", "pen_rt", "pen_top", "pen_bot" },
+ ["metafont"]={ "autorounding", "beginchar", "blacker", "boundarychar", "capsule_def", "capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists", "charext", "charht", "charic", "charlist", "charwd", "cull", "cullit", "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", "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", "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", "makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays", "notransforms", "numspecial", "o_correction", "openit", "openwindow", "proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen", "screenchars", "screenrule", "screenstrokes", "screen_cols", "screen_rows", "showit", "slantfont", "smode", "smoothing", "titlefont", "totalweight", "tracingedges", "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset", "yoffset" },
["primitives"]={ "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing", "prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset", "tracingcommands", "tracingequations", "tracinglostchars", "tracingmacros", "tracingonline", "tracingoutput", "tracingrestores", "tracingspecs", "tracingstats", "tracingtitles", "truecorners", "warningcheck", "year", "false", "nullpicture", "pencircle", "true", "and", "angle", "arclength", "arctime", "ASCII", "boolean", "bot", "char", "color", "cosd", "cycle", "decimal", "directiontime", "floor", "fontsize", "hex", "infont", "intersectiontimes", "known", "length", "llcorner", "lrcorner", "makepath", "makepen", "mexp", "mlog", "normaldeviate", "not", "numeric", "oct", "odd", "or", "path", "pair", "pen", "penoffset", "picture", "point", "postcontrol", "precontrol", "reverse", "rotated", "scaled", "shifted", "sind", "slanted", "sqrt", "str", "string", "subpath", "substring", "transform", "transformed", "ulcorner", "uniformdeviate", "unknown", "urcorner", "xpart", "xscaled", "xxpart", "xypart", "ypart", "yscaled", "yxpart", "yypart", "zscaled", "addto", "clip", "input", "interim", "let", "newinternal", "save", "setbounds", "shipout", "show", "showdependencies", "showtoken", "showvariable", "special", "begingroup", "endgroup", "of", "curl", "tension", "and", "controls", "interpath", "on", "off", "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", "withcolor", "withcmykcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", "fontmaking", "charexists", "cullit", "currenttransform", "gfcorners", "grayfont", "hround", "imagerules", "lowres_fix", "nodisplays", "notransforms", "openit", "displaying", "currentwindow", "screen_rows", "screen_cols", "pixels_per_inch", "cull", "display", "openwindow", "numspecial", "totalweight", "autorounding", "fillin", "proofing", "tracingpens", "xoffset", "chardx", "granularity", "smoothing", "turningcheck", "yoffset", "chardy", "hppp", "tracingedges", "vppp", "extra_beginfig", "extra_endfig", "mpxbreak", "endinput", "message", "delimiters", "turningnumber", "errmessage", "readstring", "scantokens", "end", "outer", "inner", "write", "to", "readfrom", "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "colormodel", "graypart", "greypart", "greycolor", "graycolor", "dashpart", "penpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", "runscript" },
- ["shortcuts"]={ "..", "...", "--", "---", "&" },
+ ["shortcuts"]={ "..", "...", "--", "---", "&", "\\" },
["tex"]={ "btex", "etex", "verbatimtex" },
} \ No newline at end of file
diff --git a/context/data/scite/context/scite-context-data-metapost.properties b/context/data/scite/context/scite-context-data-metapost.properties
index 55bb457a8..1fe411092 100644
--- a/context/data/scite/context/scite-context-data-metapost.properties
+++ b/context/data/scite/context/scite-context-data-metapost.properties
@@ -1,65 +1,66 @@
keywordclass.metapost.commands=\
upto downto beginfig endfig \
-beginglyph endglyph charscale rotatedaround reflectedabout \
-arrowhead currentpen currentpicture cuttings defaultfont \
-extra_beginfig extra_endfig ditto EOF down \
-evenly fullcircle halfcircle identity in \
-left pensquare penrazor penspec origin \
-quartercircle right unitsquare up withdots \
-abs bbox ceiling center cutafter \
-cutbefore dir directionpoint div dotprod \
-intersectionpoint inverse mod round unitvector \
-whatever cutdraw draw drawarrow drawdblarrow \
-fill filldraw drawdot loggingall interact \
-tracingall tracingnone pickup undraw unfill \
-unfilldraw buildcycle dashpattern decr dotlabel \
-dotlabels drawoptions incr label labels \
-max min thelabel z beginchar \
-blacker capsule_end change_width 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 endchar extra_beginchar \
-extra_endchar extra_setup font_coding_scheme clearxy clearit \
-clearpen shipit font_extra_space exitunless relax \
-hide gobble gobbled stop blankpicture \
-counterclockwise tensepath takepower direction softjoin \
-makelabel rotatedabout flex superellipse image \
-nullpen savepen clearpen penpos penlabels \
-range thru z laboff bye \
-red green blue cyan magenta \
-yellow black white background mm \
-pt dd bp cm pc \
-cc in triplet quadruplet
+beginglyph endglyph rotatedaround reflectedabout arrowhead \
+currentpen currentpicture cuttings defaultfont extra_beginfig \
+extra_endfig ditto EOF down evenly \
+fullcircle halfcircle identity in left \
+pensquare penrazor penspec origin quartercircle \
+right unitsquare up withdots abs \
+bbox ceiling center cutafter cutbefore \
+dir directionpoint div dotprod intersectionpoint \
+inverse mod round unitvector whatever \
+cutdraw draw drawarrow drawdblarrow fill \
+filldraw drawdot loggingall interact tracingall \
+tracingnone pickup undraw unfill unfilldraw \
+buildcycle dashpattern decr dotlabel dotlabels \
+drawoptions incr label labels max \
+min thelabel z beginchar blacker \
+capsule_end change_width 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 endchar extra_beginchar extra_endchar \
+extra_setup font_coding_scheme clearxy clearit clearpen \
+shipit font_extra_space exitunless relax hide \
+gobble gobbled stop blankpicture counterclockwise \
+tensepath takepower direction softjoin makelabel \
+rotatedabout flex superellipse image nullpen \
+savepen clearpen penpos penlabels range \
+thru z laboff bye red \
+green blue cyan magenta yellow \
+black white background mm pt \
+dd bp cm pc cc \
+in triplet quadruplet
keywordclass.metapost.disabled=\
-verbatimtex
+verbatimtex troffmode
keywordclass.metapost.internals=\
mitered rounded beveled butt \
squared eps epsilon infinity bboxmargin \
ahlength ahangle labeloffset dotlabeldiam defaultpen \
-defaultscale join_radius pen_lft pen_rt pen_top \
-pen_bot
+defaultscale join_radius charscale pen_lft pen_rt \
+pen_top pen_bot
keywordclass.metapost.metafont=\
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 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 \
-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 font_slant font_x_height fontdimen fontmaking \
-gfcorners granularity grayfont headerbyte hppp \
-hround imagerules italcorr kern labelfont \
-ligtable lowres_fix makebox 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
+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 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 font_slant font_x_height \
+fontdimen fontmaking gfcorners granularity grayfont \
+headerbyte hppp hround imagerules italcorr \
+kern labelfont ligtable lowres_fix makebox \
+makegrid maketicks mode_def mode_setup nodisplays \
+notransforms numspecial o_correction openit openwindow \
+proofing proofoffset proofrule proofrulethickness rulepen \
+screenchars screenrule screenstrokes screen_cols screen_rows \
+showit slantfont smode smoothing titlefont \
+totalweight tracingedges tracingpens turningcheck unitpixel \
+vppp vround xoffset yoffset
keywordclass.metapost.primitives=\
charcode day linecap linejoin \
@@ -119,7 +120,7 @@ runscript
keywordclass.metapost.shortcuts=\
.. ... -- --- \
-&
+& \
keywordclass.metapost.tex=\
btex etex verbatimtex
diff --git a/metapost/context/base/metafun.mpiv b/metapost/context/base/metafun.mpiv
index 095b84b0e..a2ef05306 100644
--- a/metapost/context/base/metafun.mpiv
+++ b/metapost/context/base/metafun.mpiv
@@ -47,6 +47,7 @@ let normalend = end ;
if known mplib :
def end = ; message "" ; message metafunversion ; message "" ; endinput ; enddef ;
+ def bye = ; message "" ; message metafunversion ; message "" ; endinput ; enddef ;
else :
def end = ; message "" ; message metafunversion ; message "" ; normalend ; enddef ;
fi ;
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index ac1bf7437..a3eec2818 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -175,8 +175,8 @@ extra_beginfig := extra_beginfig & "mfun_reset_tex_texts ;" ;
% see mp-keep.mpiv for older code
-vardef rawtextext(expr str) = % todo: avoid currentpicture
- if str = "" :
+vardef rawtextext(expr s) = % todo: avoid currentpicture
+ if s = "" :
nullpicture
else :
mfun_tt_n := mfun_tt_n + 1 ;
@@ -188,7 +188,7 @@ vardef rawtextext(expr str) = % todo: avoid currentpicture
withprescript "tx_number=" & decimal mfun_tt_n
withprescript "tx_stage=trial"
withprescript "tx_color=" & colordecimals colorpart mfun_tt_o
- withpostscript str ;
+ withpostscript s ;
addto mfun_tt_p also mfun_tt_c ;
elseif known mfun_tt_d[mfun_tt_n] :
addto mfun_tt_c doublepath unitsquare
@@ -375,11 +375,11 @@ enddef ;
let normalinfont = infont ;
-primarydef str infont name = % nasty hack
+primarydef s infont name = % nasty hack
if name = "" :
- textext(str)
+ textext(s)
else :
- textext("\definedfont[" & name & "]" & str)
+ textext("\definedfont[" & name & "]" & s)
fi
enddef ;
@@ -722,8 +722,8 @@ extra_endfig := extra_endfig & "mfun_reset_tex_texts ; " ;
% Bonus
-vardef verbatim(expr str) =
- ditto & "\detokenize{" & str & "}" & ditto
+vardef verbatim(expr s) =
+ ditto & "\detokenize{" & s & "}" & ditto
enddef ;
% New
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index 8af2693cd..b82910f6b 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -2516,21 +2516,72 @@ enddef ;
% )
% enddef ;
+vardef mfun_snapped(expr p, s) =
+ if p < 0 : - ( - else : ( fi p div s) * s % the less tokens the better
+enddef ;
+
+vardef mfun_applied(expr p, s)(suffix a) =
+ if path p :
+ if pair s :
+ for i=0 upto length(p)-1 :
+ (a(xpart point i of p,xpart s),a(ypart point i of p,ypart s)) --
+ endfor
+ if cycle p :
+ cycle
+ else :
+ (a(xpart point length(p) of p,xpart s),a(ypart point length(p) of p,ypart s))
+ fi
+ else :
+ for i=0 upto length(p)-1 :
+ (a(xpart point i of p,s),a(ypart point i of p,s)) --
+ endfor
+ if cycle p :
+ cycle
+ else :
+ (a(xpart point length(p) of p,s),a(ypart point length(p) of p,s))
+ fi
+ fi
+ elseif pair p :
+ if pair s :
+ (a(xpart p,xpart s),a(ypart p,ypart s))
+ else :
+ (a(xpart p,s),a(ypart p,s))
+ fi
+ elseif cmykcolor p :
+ (a(cyanpart p,s),a(magentapart p,s),a(yellowpart p,s),a(blackpart p,s))
+ elseif rgbcolor p :
+ (a(redpart p,s),a(greenpart p,s),a(bluepart p,s))
+ elseif graycolor p :
+ a(p,s)
+ elseif numeric p :
+ a(p,s)
+ else
+ p
+ fi
+enddef ;
+
+primarydef p snapped s =
+ mfun_applied(p,s)(mfun_snapped) % so we can play with variants
+enddef ;
+
%D New helpers:
+newinternal charscale ; charscale := 1 ; % persistent so one needs to 'reset' it to 0 or 1
+
def beginglyph(expr unicode, width, height, depth) =
beginfig(unicode) ; % the number is irrelevant
charcode := unicode ;
charwd := width ;
charht := height ;
chardp := depth ;
+ % charscale := 1 ; % can be set for a whole font, so no reset here
enddef ;
def endglyph =
setbounds currentpicture to (boundingbox unitsquare xscaled charwd yscaled (charht + chardp) shifted (0,-chardp)) ;
- if known charscale :
+ if known charscale : if (charscale > 0) and (charscale <> 1) :
currentpicture := currentpicture scaled charscale ;
- fi ;
+ fi ; fi ;
endfig ;
enddef ;
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