From 298afdcdcb9d3c88fcc9abdbf17ac66f2f5006a1 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 18 Feb 2021 11:28:41 +0100 Subject: 2021-02-18 10:24:00 --- .../lexers/data/scite-context-data-metafun.lua | 2 +- .../context/scite-context-data-metafun.properties | 2 +- .../context/data/scite-context-data-metafun.lua | 2 +- .../context/syntaxes/context-syntax-mps.json | 2 +- .../general/manuals/metafun/metafun-basics.tex | 6 +- .../general/manuals/metafun/metafun-effects.tex | 30 +- .../general/manuals/metafun/metafun-layout.tex | 2 + .../general/manuals/metafun/metafun-lua.tex | 798 +++++++++++---------- .../general/manuals/metafun/metafun-reference.tex | 12 +- .../sources/general/manuals/metafun/metafun.tex | 11 +- metapost/context/base/mpiv/mp-base.mpiv | 6 +- metapost/context/base/mpxl/mp-apos.mpxl | 6 +- metapost/context/base/mpxl/mp-base.mpxl | 2 +- metapost/context/base/mpxl/mp-lmtx.mpxl | 22 + metapost/context/base/mpxl/mp-tool.mpxl | 11 +- scripts/context/lua/mtx-epub.lua | 4 +- scripts/context/lua/mtxrun.lua | 16 +- scripts/context/stubs/mswin/mtxrun.lua | 16 +- scripts/context/stubs/unix/mtxrun | 16 +- scripts/context/stubs/win64/mtxrun.lua | 16 +- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-fr.mkii | 4 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/luat-cod.lua | 2 +- tex/context/base/mkiv/luat-fmt.lua | 6 +- tex/context/base/mkiv/luat-ini.lua | 2 +- tex/context/base/mkiv/meta-imp-txt.mkiv | 2 +- tex/context/base/mkiv/mult-fun.lua | 2 + tex/context/base/mkiv/status-files.pdf | Bin 25358 -> 25349 bytes tex/context/base/mkiv/status-lua.pdf | Bin 256060 -> 256058 bytes tex/context/base/mkiv/toks-ini.mkiv | 2 +- tex/context/base/mkiv/trac-inf.lua | 2 - tex/context/base/mkxl/anch-bck.mklx | 39 +- tex/context/base/mkxl/anch-pgr.lmt | 105 +-- tex/context/base/mkxl/catc-ini.mkxl | 2 +- tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/luat-ini.lmt | 2 +- tex/context/base/mkxl/meta-ini.mkxl | 2 +- tex/context/base/mkxl/mlib-cnt.lmt | 10 +- tex/context/base/mkxl/mlib-ctx.mkxl | 2 + tex/context/base/mkxl/mlib-lmp.lmt | 14 + tex/context/base/mkxl/strc-sec.mkxl | 2 +- tex/context/base/mkxl/trac-inf.lmt | 2 - tex/context/interface/mkii/keys-fr.xml | 4 + tex/context/modules/mkiv/s-syntax.mkiv | 84 +-- tex/context/modules/mkiv/x-math-svg.lua | 6 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 50 files changed, 688 insertions(+), 604 deletions(-) diff --git a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua index edbf39a57..a253f95b0 100644 --- a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua +++ b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvar" }, ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "pushparameters", "popparameters", "definecolor" }, } \ No newline at end of file diff --git a/context/data/scite/context/scite-context-data-metafun.properties b/context/data/scite/context/scite-context-data-metafun.properties index 79f8b5087..92de8db85 100644 --- a/context/data/scite/context/scite-context-data-metafun.properties +++ b/context/data/scite/context/scite-context-data-metafun.properties @@ -78,7 +78,7 @@ comment report lua lualist mp \ MP luacall mirrored mirroredabout scriptindex \ newscriptindex newcolor newrgbcolor newcmykcolor newnumeric \ newboolean newtransform newpath newpicture newstring \ -newpair +newpair mpvar keywordclass.metafun.internals=\ nocolormodel greycolormodel graycolormodel rgbcolormodel \ diff --git a/context/data/textadept/context/data/scite-context-data-metafun.lua b/context/data/textadept/context/data/scite-context-data-metafun.lua index edbf39a57..a253f95b0 100644 --- a/context/data/textadept/context/data/scite-context-data-metafun.lua +++ b/context/data/textadept/context/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin", "shownshadedirection", "shownshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "filloutlinetext", "drawoutlinetext", "outlinetexttopath", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext", "notcached", "keepcached", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "withopacity", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath", "theoffset", "texmode", "systemmode", "texvar", "texstr", "isarray", "prefix", "dimension", "getmacro", "getdimen", "getcount", "gettoks", "setmacro", "setdimen", "setcount", "settoks", "positionpath", "positioncurve", "positionxy", "positionpxy", "positionwhd", "positionpage", "positionregion", "positionbox", "positionanchor", "positioninregion", "positionatanchor", "wdpart", "htpart", "dppart", "texvar", "texstr", "inpath", "pointof", "leftof", "rightof", "utfnum", "utflen", "utfsub", "newhash", "disposehash", "inhash", "tohash", "isarray", "prefix", "isobject", "comment", "report", "lua", "lualist", "mp", "MP", "luacall", "mirrored", "mirroredabout", "scriptindex", "newscriptindex", "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", "mpvar" }, ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "shadeoffset", "textextoffset", "textextanchor", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption", "contextlmtxmode", "metafunversion", "minifunversion", "getparameters", "presetparameters", "hasparameter", "hasoption", "getparameter", "getparameterdefault", "getparametercount", "getmaxparametercount", "getparameterpath", "getparameterpen", "getparametertext", "applyparameters", "pushparameters", "popparameters", "definecolor" }, } \ No newline at end of file diff --git a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json index 29bb24058..bcc2c9ede 100644 --- a/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json +++ b/context/data/vscode/extensions/context/syntaxes/context-syntax-mps.json @@ -60,7 +60,7 @@ "name" : "context.extra" }, "helper" : { - "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecenter|withshade|withproperties|withopacity|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|validtexbox|utfsub|utfnum|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|thefmttext|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shownshadedirection|shownshadecenter|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setdimen|setcount|scriptindex|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|rawmadetext|rawfmttext|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|onetimetextext|onetimefmttext|oddly|nothing|notcached|normalfill|normaldraw|nofill|nodraw|newtransform|newstring|newscriptindex|newrgbcolor|newpicture|newpath|newpair|newnumeric|newhash|newcolor|newcmykcolor|newboolean|naturalizepaths|namedcolor|multitonecolor|mp|mirroredabout|mirrored|lualist|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fmttext|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|dofill|dodraw|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])", + "match" : "(zmod|ystretched|ysized|xysized|xyscaled|xstretched|xsized|withtransparency|withshadevector|withshadetransform|withshadestep|withshaderadius|withshadeorigin|withshademethod|withshadefraction|withshadefactor|withshadedomain|withshadedirection|withshadecolors|withshadecenter|withshade|withproperties|withopacity|withmask|withlinearshade|withgrey|withgray|withcircularshade|whitecolor|wdpart|visualizepaths|visualizedfill|visualizeddraw|verbatim|validtexbox|utfsub|utfnum|utflen|urtriangle|urmoved|urenlarged|urcircle|uptriangle|unspiked|unitvector|unittriangle|unitdiamond|unitcircle|uniquelist|undrawfill|undecorated|undashed|uncolored|ultriangle|ulmoved|ulenlarged|ulcircle|tripled|triangle|transparent|transparency|tostring|topenlarged|topboundary|topath|topair|tolist|tohash|tocycle|thetextext|thetexbox|theoffset|thelabel|thefmttext|texvar|texvar|textextoffset|textext|texstr|texstr|texmode|texbox|tensecircle|tcircle|tanh|tand|tan|systemmode|superellipsed|strut|stretched|straightpath|straightpairs|straightfunction|stoppassingvariable|startpassingvariable|squeezed|squarepath|sqr|spotcolor|space|sortlist|softened|snapped|smoothed|sized|sinh|sin|simplified|shownshadevector|shownshadeorigin|shownshadedirection|shownshadecenter|shortened|shapedlist|shadedup|shadedright|shadedleft|shadedinto|shadeddown|shaded|settoks|setmacro|setdimen|setcount|scriptindex|rule|roundedsquare|righttriangle|rightof|rightenlarged|rightboundary|rightarrow|resolvedcolor|resetdrawoptions|resetarrows|report|register|redecorated|readfile|rcircle|rawtextext|rawtexbox|rawmadetext|rawfmttext|randomshifted|randomizedcontrols|randomized|radian|quote|quotation|pushcurrentpicture|pushboundingbox|punked|property|properties|prefix|prefix|pow|positionxy|positionwhd|positionregion|positionpxy|positionpath|positionpage|positioninregion|positioncurve|positionbox|positionatanchor|positionanchor|popcurrentpicture|popboundingbox|pointof|pi|perpendicular|percent|penpoint|pencilled|peepholed|pathconnectors|passvariable|passarrayvariable|paralleled|paired|outsideof|outlinetexttopath|outlinetext|outerboundingbox|originpath|onlayer|onetimetextext|onetimefmttext|oddly|nothing|notcached|normalfill|normaldraw|nofill|nodraw|newtransform|newstring|newscriptindex|newrgbcolor|newpicture|newpath|newpair|newnumeric|newhash|newcolor|newcmykcolor|newboolean|naturalizepaths|namedcolor|multitonecolor|mpvar|mp|mirroredabout|mirrored|lualist|luacall|lua|lrtriangle|lrmoved|lrenlarged|lrcircle|log|loadmodule|loadimage|loadfile|loadfigure|ln|lltriangle|llmoved|llenlarged|llcircle|listtolines|listtocurves|listsize|listlast|linearpath|lefttriangle|leftof|leftenlarged|leftboundary|leftarrow|lcircle|laddered|label|keepcached|istextext|isobject|isarray|isarray|invtan|invsin|inverted|invcos|inv|intersection_point|intersection_found|interpolated|insideof|inpath|innerboundingbox|inhash|infont|infinite|htpart|greyscale|greyed|grayscale|grayed|graphictext|gettoks|getmacro|getdimen|getcount|function|fulltriangle|fullsquare|fulldiamond|formatted|format|fmttext|fillup|filloutlinetext|figure|externalfigure|exp|evenly|epsed|eofillup|eofill|eoclip|enlonged|enlarged|drawwholepath|drawpoints|drawpointoptions|drawpointlabels|drawpoint|drawpathoptions|drawpathonly|drawpath|drawoutlinetext|draworiginoptions|draworigin|drawlineoptions|drawlabeloptions|drawfill|drawdoublearrows|drawcontrolpoints|drawcontroloptions|drawcontrollines|drawboundoptions|drawboundingbox|drawboundary|dquote|dppart|downtriangle|dofill|dodraw|disposehash|dispose|dimension|detailpaths|detaileddraw|defineshade|decorated|ddecimal|dddecimal|ddddecimal|cutends|curvedpath|curvedpairs|curvedfunction|curved|crossingunder|crossed|crlf|cotd|cot|cosh|cos|cornered|copylist|constructedpath|constructedpairs|constructedfunction|condition|complemented|complementary|comment|colortype|colorpart|colorlike|colordecimalslist|colordecimals|cmyk|clearxy|circularpath|checkedbounds|checkbounds|centerarrow|center|break|boundingradius|boundingpoint|boundingcircle|boundingbox|bottomenlarged|bottomboundary|blownup|blackcolor|bitmapimage|bcircle|bbwidth|bbheight|basiccolors|autoalign|atan|asinh|asin|asgroup|arrowpath|area|anchored|along|addbackground|acosh|acos|SPACE|PERCENT|MP|DQUOTE|CRLF)(?=[^a-zA-Z\u005C_@!?-ÿ])", "name" : "context.command.metafun.helper.mps" }, "identifier" : { diff --git a/doc/context/sources/general/manuals/metafun/metafun-basics.tex b/doc/context/sources/general/manuals/metafun/metafun-basics.tex index a52c7a35a..823448acf 100644 --- a/doc/context/sources/general/manuals/metafun/metafun-basics.tex +++ b/doc/context/sources/general/manuals/metafun/metafun-basics.tex @@ -776,9 +776,9 @@ draw {\def\Xcom{2}\def\Ycom{3}\def\Zcom{\the\textwidth }} Chapter 3 of the \METAFONT\ book explains the mathematics behind the construction -of curves. Both \METAFONT\ and \METAPOST\ implement B\'ezier curves. The fact -that these curves are named after Pierre B\'ezier obscures the fact that the math -behind them originates with Serge\u{\i} Bernshte\u{\i}n. +of curves. Both \METAFONT\ and \METAPOST\ implement Bézier curves. The fact that +these curves are named after Pierre Bézier obscures the fact that the math behind +them originates with SergeÄ­ BernshteÄ­n. The points on the curve are determined by the following formula: diff --git a/doc/context/sources/general/manuals/metafun/metafun-effects.tex b/doc/context/sources/general/manuals/metafun/metafun-effects.tex index 74e7d487e..f87334b3e 100644 --- a/doc/context/sources/general/manuals/metafun/metafun-effects.tex +++ b/doc/context/sources/general/manuals/metafun/metafun-effects.tex @@ -363,9 +363,9 @@ moment shading is only supported in \PDF. In the following examples, we will use the next three colors: \startbuffer -\definecolor[a][darkyellow] -\definecolor[b][s=.8] -\definecolor[c][darkred] +\definecolor[mycolora][darkyellow] +\definecolor[mycolorb][s=.8] +\definecolor[mycolorc][darkred] \stopbuffer \typebuffer @@ -386,13 +386,13 @@ First we discuss the old method which is still valid and also available in \startuniqueMPgraphic{CircularShade} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; - circular_shade(p,0,\MPcolor{a},\MPcolor{b}) ; + circular_shade(p,0,\MPcolor{mycolora},\MPcolor{mycolorb}) ; \stopuniqueMPgraphic \startuniqueMPgraphic{LinearShade} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; - linear_shade(p,0,\MPcolor{a},\MPcolor{b}); + linear_shade(p,0,\MPcolor{mycolora},\MPcolor{mycolorb}); \stopuniqueMPgraphic \stopbuffer @@ -458,7 +458,7 @@ stepping through the color values, we can use the more efficient and generalized width := \overlaywidth ; height := \overlayheight ; path p ; p := unitsquare xscaled width yscaled height ; - #2_shade(p,#3,\MPcolor{a},\MPcolor{b}) ; + #2_shade(p,#3,\MPcolor{mycolora},\MPcolor{mycolorb}) ; \stopuniqueMPgraphic \defineoverlay[shade-#1][\uniqueMPgraphic{shade-#1}]% \framed[background=shade-#1,width=2cm,height=2cm,frame=off]{}} @@ -501,7 +501,7 @@ stepping through the color values, we can use the more efficient and generalized % \startbuffer % path p ; p := fullcircle scaled 1cm ; % for i=0 step 2cm until 8cm : -% circular_shade(p shifted (i,0),0,\MPcolor{a},\MPcolor{b}) ; +% circular_shade(p shifted (i,0),0,\MPcolor{mycolora},\MPcolor{mycolorb}) ; % endfor ; % \stopbuffer % @@ -518,7 +518,7 @@ stepping through the color values, we can use the more efficient and generalized % the center of the shading stays at the first circle. % % \startbuffer -% circular_shade(fullcircle scaled 1cm,0,\MPcolor{a},\MPcolor{b}) ; +% circular_shade(fullcircle scaled 1cm,0,\MPcolor{mycolora},\MPcolor{mycolorb}) ; % picture s ; s := currentpicture ; currentpicture := nullpicture ; % for i=0 step 2cm until 8cm : % addto currentpicture also s shifted (i,0) ; @@ -544,7 +544,7 @@ stepping through the color values, we can use the more efficient and generalized \startbuffer sh := define_circular_shade - (origin,origin,0,8cm,\MPcolor{a},\MPcolor{b}) ; + (origin,origin,0,8cm,\MPcolor{mycolora},\MPcolor{mycolorb}) ; for i=0 step 2cm until 8cm : fill fullcircle scaled 1cm shifted (i,0) withshade sh ; endfor ; @@ -570,9 +570,9 @@ the shade. The next macro demonstrates the principles in a different way. def test_shade (expr a, b, ra, rb) = pickup pencircle scaled 1mm ; - color ca ; ca := \MPcolor{a} ; - color cb ; cb := \MPcolor{b} ; - color cc ; cc := \MPcolor{c} ; + color ca ; ca := \MPcolor{mycolora} ; + color cb ; cb := \MPcolor{mycolorb} ; + color cc ; cc := \MPcolor{mycolorc} ; path pa ; pa := fullcircle scaled 2ra shifted a ; path pb ; pb := fullcircle scaled 2rb shifted b ; @@ -640,9 +640,9 @@ test_shade(origin shifted (.25cm,0), origin, .50cm, 1cm) ; def test_shade (expr a, b) = pickup pencircle scaled 1mm ; - color ca ; ca := \MPcolor{a} ; - color cb ; cb := \MPcolor{b} ; - color cc ; cc := \MPcolor{c} ; + color ca ; ca := \MPcolor{mycolora} ; + color cb ; cb := \MPcolor{mycolorb} ; + color cc ; cc := \MPcolor{mycolorc} ; sh := define_linear_shade(a,b,ca,cb) ; diff --git a/doc/context/sources/general/manuals/metafun/metafun-layout.tex b/doc/context/sources/general/manuals/metafun/metafun-layout.tex index 2be7e19ff..e81800bb4 100644 --- a/doc/context/sources/general/manuals/metafun/metafun-layout.tex +++ b/doc/context/sources/general/manuals/metafun/metafun-layout.tex @@ -327,9 +327,11 @@ is represented by a lioness. It is still unclear if they have a relationship, but if so, and if a cub is born, may it enjoy \METAFUN.} \stopbuffer +\pushoverloadmode \startquotation \def\processwords#1{#1}\getbuffer[lions] \stopquotation +\popoverloadmode The low level \CONTEXT\ macro \type {\processwords} provides a mechanism to treat the individual words of its argument. The macro is called as follows: diff --git a/doc/context/sources/general/manuals/metafun/metafun-lua.tex b/doc/context/sources/general/manuals/metafun/metafun-lua.tex index 0794fc879..bd33109b0 100644 --- a/doc/context/sources/general/manuals/metafun/metafun-lua.tex +++ b/doc/context/sources/general/manuals/metafun/metafun-lua.tex @@ -24,11 +24,17 @@ of a graphic from data but often it makes more sense to do the reverse. I finall found time and reason to look into this and in the following sections I will describe how it's done. -\stopintro +\blank -\startsection[title=Introduction] +{\bi The \LUA\ interface in \MKIV\ is way more limited than in \LMTX\ and new +features will only show up in \LMTX, simply because the \METAPOST\ library in +\LUAMETATEX\ is more powerful.} -\stopsection +\stopintro + +% \startsection[title=Introduction] +% +% \stopsection \startsection[title=The basics] @@ -232,7 +238,7 @@ helper is \type {mp.quoted}, as in: \startbuffer draw - textext(lua("mp.quoted('@0.3f'," & decimal n & ")")) + textext(lua("mp.quoted('@0.3f'," & decimal 1.234 & ")")) withcolor darkred ; \stopbuffer @@ -416,73 +422,73 @@ So in the end we can simplify the code that we started with to: \stopsection -\startsection[title=Access to variables] - -The question with such mechanisms is always: how far should we go. Although -\METAPOST\ is a macro language it has properties of procedural languages. It also -has more introspective features at the user end. For instance, one can loop over -the resulting picture and manipulate it. This means that we don't need full -access to \METAPOST\ internals. However, it makes sense to provide access to -basic variables: \type {numeric}, \type {string}, and \type {boolean}. - -\startbuffer -draw textext(lua("mp.quoted('@0.15f',mp.get.numeric('pi')-math.pi)")) - ysized 1cm - withcolor darkred ; -\stopbuffer - -\typebuffer - -In double mode you will get zero printed but in scaled mode we definitely get a -difference: - -\startlinecorrection[blank] -\processMPbuffer -\stoplinecorrection - -\startbuffer -boolean b ; b := true ; -draw textext(lua("mp.quoted(mp.get.boolean('b') and 'yes' or 'no')")) - ysized 1cm - withcolor darkred ; -\stopbuffer - -In the next example we use \type {mp.quoted} to make sure that indeed we pass a -string. The \type {textext} macro can deal with numbers but an unquoted \type -{yes} or \type {no} is asking for problems. - -\typebuffer - -Especially when more text is involved it makes sense to predefine a helper in -the \type {MP} namespace if only because \METAPOST\ (currently) doesn't like -newlines in the middle of a string, so a \type {lua} call has to be on one line. - -\startlinecorrection[blank] -\processMPbuffer -\stoplinecorrection - -Here is an example where \LUA\ does something that would be close to impossible, -especially if more complex text is involved. - -% \enabletrackers[metapost.lua] - -\startbuffer -string s ; s := "ΤΕΧ" ; % "τεχ" -draw textext(lua("mp.quoted(characters.lower(mp.get.string('s')))")) - ysized 1cm - withcolor darkred ; -\stopbuffer - -\typebuffer - -As you can see here, the whole repertoire of helper functions can be used in -a \METAFUN\ definition. - -\startlinecorrection[blank] -\processMPbuffer -\stoplinecorrection - -\stopsection +% \startsection[title=Access to variables] +% +% The question with such mechanisms is always: how far should we go. Although +% \METAPOST\ is a macro language it has properties of procedural languages. It also +% has more introspective features at the user end. For instance, one can loop over +% the resulting picture and manipulate it. This means that we don't need full +% access to \METAPOST\ internals. However, it makes sense to provide access to +% basic variables: \type {numeric}, \type {string}, and \type {boolean}. +% +% \startbuffer +% draw textext(lua("mp.quoted('@0.15f',mp.get.numeric('pi')-math.pi)")) +% ysized 1cm +% withcolor darkred ; +% \stopbuffer +% +% \typebuffer +% +% In double mode you will get zero printed but in scaled mode we definitely get a +% difference: +% +% \startlinecorrection[blank] +% \processMPbuffer +% \stoplinecorrection +% +% \startbuffer +% boolean b ; b := true ; +% draw textext(lua("mp.quoted(mp.get.boolean('b') and 'yes' or 'no')")) +% ysized 1cm +% withcolor darkred ; +% \stopbuffer +% +% In the next example we use \type {mp.quoted} to make sure that indeed we pass a +% string. The \type {textext} macro can deal with numbers but an unquoted \type +% {yes} or \type {no} is asking for problems. +% +% \typebuffer +% +% Especially when more text is involved it makes sense to predefine a helper in +% the \type {MP} namespace if only because \METAPOST\ (currently) doesn't like +% newlines in the middle of a string, so a \type {lua} call has to be on one line. +% +% \startlinecorrection[blank] +% \processMPbuffer +% \stoplinecorrection +% +% Here is an example where \LUA\ does something that would be close to impossible, +% especially if more complex text is involved. +% +% % \enabletrackers[metapost.lua] +% +% \startbuffer +% string s ; s := "ΤΕΧ" ; % "τεχ" +% draw textext(lua("mp.quoted(characters.lower(mp.get.string('s')))")) +% ysized 1cm +% withcolor darkred ; +% \stopbuffer +% +% \typebuffer +% +% As you can see here, the whole repertoire of helper functions can be used in +% a \METAFUN\ definition. +% +% \startlinecorrection[blank] +% \processMPbuffer +% \stoplinecorrection +% +% \stopsection \startsection[title=The library] @@ -678,53 +684,53 @@ So this gives: \startlinecorrection[blank] \getbuffer \stoplinecorrection -A variant call is the following: \footnote {Getting that to work properly in the -library was non||trivial as the loop variable \type {i} is an abstract nameless -variable at the \METAPOST\ end. When investigating this Luigi Scarso and I found out -that the internals of \METAPOST\ are not really geared for interfacing this way -but in the end it worked out well.} - -\startbuffer -\startMPcode - for i=1 upto lua("mp.size(MP.myset)") : - fill area - lua("mp.path(MP.myset[mp.get.numeric('i')])") - xysized (HSize,5ExHeight) - withcolor basiccolors[i]/2 - withtransparency (2,.25) ; - endfor ; -\stopMPcode -\stopbuffer - -\typebuffer - -The result is the same: - -\startlinecorrection[blank] \getbuffer \stoplinecorrection - -\startbuffer -\startluacode - MP.mypath = function(i) - return mp.path(MP.myset[mp.get.numeric(i)]) - end -\stopluacode -\stopbuffer - -\typebuffer \getbuffer - -\startbuffer -\startMPcode - for i=1 upto lua("mp.size(MP.myset)") : - fill area - lua("MP.mypath('i')") - xysized (HSize,5ExHeight) - withcolor basiccolors[i]/2 - withtransparency (2,.25) ; - endfor ; -\stopMPcode -\stopbuffer - -\typebuffer +% A variant call is the following: \footnote {Getting that to work properly in the +% library was non||trivial as the loop variable \type {i} is an abstract nameless +% variable at the \METAPOST\ end. When investigating this Luigi Scarso and I found out +% that the internals of \METAPOST\ are not really geared for interfacing this way +% but in the end it worked out well.} +% +% \startbuffer +% \startMPcode +% for i=1 upto lua("mp.size(MP.myset)") : +% fill area +% lua("mp.path(MP.myset[mp.get.numeric('i')])") +% xysized (HSize,5ExHeight) +% withcolor basiccolors[i]/2 +% withtransparency (2,.25) ; +% endfor ; +% \stopMPcode +% \stopbuffer +% +% \typebuffer +% +% The result is the same: +% +% \startlinecorrection[blank] \getbuffer \stoplinecorrection +% +% \startbuffer +% \startluacode +% MP.mypath = function(i) +% return mp.path(MP.myset[mp.get.numeric(i)]) +% end +% \stopluacode +% \stopbuffer +% +% \typebuffer \getbuffer +% +% \startbuffer +% \startMPcode +% for i=1 upto lua("mp.size(MP.myset)") : +% fill area +% lua("MP.mypath('i')") +% xysized (HSize,5ExHeight) +% withcolor basiccolors[i]/2 +% withtransparency (2,.25) ; +% endfor ; +% \stopMPcode +% \stopbuffer +% +% \typebuffer This snippet of \METAPOST\ code still looks kind of horrible so how can we make it look better? Here is an attempt, First we define a bit more \LUA: @@ -1167,285 +1173,285 @@ the same name defined. \stopsection -\startsection[title=Large paths] - -The plugins (like those dealing with text) also use calls in the \type {mp} -namespace but they have sort of protected names, starting with \type {mf_}. These -are visible but not meant to be used by users. Not only can their name change, -their functionality can as well. - -The following are actually private as they have related macros but also have a -public alias: - -\startlines -lua.mp.pathlength(name) -lua.mp.pathpoint(i) -lua.mp.pathleft(i) -lua.mp.pathright(i) -lua.mp.pathreset() -\stoplines - -They are meant for special high|-|performance path access, for example: - -\startlinecorrection -\startMPcode - save p, q, r; - path p ; p := for i=1 upto 1000 : - (i,0) -- (i,4 + uniformdeviate 4) -- - endfor cycle ; - fill p xysized (TextWidth,20mm) withcolor red ; - - path q ; q := for i=1 upto lua.mp.pathlength("p") : - if (i mod 4) == 0 : lua.mp.pathpoint(i) -- fi - endfor cycle ; - fill q xysized (TextWidth,2cm) shifted (0,-45mm) withcolor green ; - - path r ; r := for i inpath p : - if not odd (i) : pointof i -- fi - endfor cycle ; - fill r xysized (TextWidth,2cm) shifted (0,-70mm) withcolor blue ; -\stopMPcode -\stoplinecorrection - -Because a lookup of a point in \METAPOST\ is a linear lookup over a linked list -for very large paths the gain is significant when using \LUA\ because there the -points are stored in an indexed table. The left and right points can be used -vebose like - -\starttyping -lua.mp.pathpoint(i) controls lua.mp.pathleft(i) and lua.mp.pathright(i) -\stoptyping - -or more terse: - -\starttyping -pointof i controls leftof i and rightof i -\stoptyping - -Beware: this kind of trickery is {\em only} needed when you have very large paths -that are to be manipulated and the. Otherwise it's overkill. - -\stopsection - -\startsection[title={Interfacing to \TEX}] - -The next bunch of calls is for accessing \TEX\ registers. You can set their -values and get them as well. - -\starttyping -lua.mp.getmacro(k) -lua.mp.getdimen(k) -lua.mp.getcount(k) -lua.mp.gettoks (k) - -lua.mp.setmacro(k,v) -lua.mp.setdimen(k,v) -lua.mp.setcount(k,v) -lua.mp.settoks (k,v) -\stoptyping - -When you mess around with variables and run into issues it might help to -report values on the console. The \type {report} function does this: - -\starttyping -lua.mp.report(a,b) -\stoptyping - -\startlinecorrection -\startMPcode -lua.mp.report("status","a circle") ; -fill fullcircle xyscaled (2cm,1cm) withcolor red ; -lua.mp.report("status","its boundingbox [@N,@N,@N,@N]", - xpart llcorner currentpicture, ypart llcorner currentpicture, - xpart urcorner currentpicture, ypart urcorner currentpicture -) ; -draw boundingbox currentpicture withcolor blue ; -report("status","the size: @Nbp x @Nbp", - bbwidth(currentpicture), bbheight(currentpicture) -) ; -message("done") ; -\stopMPcode -\stoplinecorrection - -The console shows: - -\starttyping -metapost > status : a circle -metapost > status : its boundingbox [-28.34645,-14.17323,28.34645,14.17323] -metapost > status : the size: 57.1929bp x 28.84647bp -metapost > message : done -\stoptyping - -There are two more getters. These can be used to access the specific graphic -related variables set at the \TEX\ end. - -\starttyping -mp.texvar(name) -mp.texstr(name) -\stoptyping - -If you have adaptive styles you might want to test for modes. - -\starttyping -if lua.mp.mode("screen") : % or processingmode - % some action only needed for screen documents -fi ; -if lua.mp.systemmode("first") : - % some action for the first run -fi ; -\stoptyping - -For convenience these are wrapped into macros: - -\starttyping -if texmode("screen") : - % some action only needed for screen documents -fi ; -if systemmode("first") : - % some action for the first run -fi ; -\stoptyping - -When you implement your own helpers you can fall back on some auxiliary functions -in the \type {mp} namespace. Actually these are collected in \type {mp.aux} and -thereby protected from being overwritten by mistake. Here they are: - -% mp.flush() -% mp.size(t) - -\stopsection - -\startsection[title={Interfacing to \METAPOST}] - -There is also experimental access to some of the \METAPOST\ internals. In order -to deal with (large) paths a few more iterator related helpers are provided too. - -% mp.set (numeric string path boolean) - -\starttyping -n = mp.getnumeric(name) -s = mp.getstring(name) -b = mp.getboolean(name) -p = mp.getpath(name) -\stoptyping - -A is path a table of tables that have six values: the coordinates and the -pre- and postcontrol. You can manipulate this table and feed it back into -\METAPOST. - -\startlinecorrection -\startMPcode -numeric n ; n := lua.mp.newhash() ; - -for i=1 upto 3 : - lua.mp.tohash(n,i) ; -endfor ; - -fill fullcircle scaled 10mm withcolor - if lua.mp.inhash(n,3) : green else : red fi ; - -fill fullcircle scaled 5mm withcolor - if lua.mp.inhash(n,4) : green else : red fi ; - -lua.mp.disposehash(n) -\stopMPcode -\stoplinecorrection - -You can also store values with keys and access them later: - -\startlinecorrection -\startMPcode -numeric n ; n := lua.mp.newhash() ; - -for i=1 upto 3 : - lua.mp.tohash(n,i,decimal sqrt(i)) ; -endfor ; - -draw textext(lua.mp.fromhash(n,3)) - ysized 1cm - withcolor blue ; - -lua.mp.disposehash(n) -\stopMPcode -\stoplinecorrection - -You can also name your own hash: - -\startlinecorrection -\startMPcode -lua.mp.newhash("foo") ; - -for i=1 upto 3 : - lua.mp.tohash("foo",i,decimal sqrt(i)) ; -endfor ; - -draw textext(lua.mp.fromhash("foo",2)) - ysized 1cm - withcolor green ; - -lua.mp.disposehash("foo") -\stopMPcode -\stoplinecorrection - -Although it might look like \METAPOST\ supports arrays the reality is that it -doesn't really. There is a concept of suffixes but internally these are just a -way to compose macros. The following test is one that is used in one of the -\METAFUN\ modules written by Alan Braslau. - -\startlinecorrection -\startMPcode -path p, q[] ; - -if lua.mp.isarray(str q[1]) : - fill fullcircle scaled 1cm withcolor red ; - draw textext(lua.mp.prefix(str q[1])) withcolor white; -else : - fill fullsquare scaled 1cm withcolor blue ; -fi ; - -currentpicture := currentpicture shifted (-2cm,0) ; - -if lua.mp.isarray(str p) : - fill fullcircle scaled 1cm withcolor red ; -else : - fill fullsquare scaled 1cm withcolor blue ; -fi ; -\stopMPcode -\stoplinecorrection - -Another helper relates to extensions that \METAFUN\ adds to \METAPOST. When you -iterate over a picture you can recognize these as objects. The next code shows -the \LUA\ call as well as the more convenient macro call. So, \type {textext} -clearly is a foreign object. - -\startlinecorrection -\startMPcode -picture p ; p := image ( - fill fullcircle scaled 1cm withcolor red ; - draw textext("ok") withcolor white ; -) ; - -for i within p : - if not picture i : - draw i ysized 4cm ; - elseif isobject i : - draw i xsized 3cm ; - else : - draw i ysized 4cm ; - fi ; -endfor ; - -currentpicture := currentpicture shifted (-6cm,0) ; +% \startsection[title=Large paths] +% +% The plugins (like those dealing with text) also use calls in the \type {mp} +% namespace but they have sort of protected names, starting with \type {mf_}. These +% are visible but not meant to be used by users. Not only can their name change, +% their functionality can as well. +% +% The following are actually private as they have related macros but also have a +% public alias: +% +% \startlines +% lua.mp.pathlength(name) +% lua.mp.pathpoint(i) +% lua.mp.pathleft(i) +% lua.mp.pathright(i) +% lua.mp.pathreset() +% \stoplines +% +% They are meant for special high|-|performance path access, for example: +% +% \startlinecorrection +% \startMPcode +% save p, q, r; +% path p ; p := for i=1 upto 1000 : +% (i,0) -- (i,4 + uniformdeviate 4) -- +% endfor cycle ; +% fill p xysized (TextWidth,20mm) withcolor red ; +% +% path q ; q := for i=1 upto lua.mp.pathlength("p") : +% if (i mod 4) == 0 : lua.mp.pathpoint(i) -- fi +% endfor cycle ; +% fill q xysized (TextWidth,2cm) shifted (0,-45mm) withcolor green ; +% +% path r ; r := for i inpath p : +% if not odd (i) : pointof i -- fi +% endfor cycle ; +% fill r xysized (TextWidth,2cm) shifted (0,-70mm) withcolor blue ; +% \stopMPcode +% \stoplinecorrection +% +% Because a lookup of a point in \METAPOST\ is a linear lookup over a linked list +% for very large paths the gain is significant when using \LUA\ because there the +% points are stored in an indexed table. The left and right points can be used +% vebose like +% +% \starttyping +% lua.mp.pathpoint(i) controls lua.mp.pathleft(i) and lua.mp.pathright(i) +% \stoptyping +% +% or more terse: +% +% \starttyping +% pointof i controls leftof i and rightof i +% \stoptyping +% +% Beware: this kind of trickery is {\em only} needed when you have very large paths +% that are to be manipulated and the. Otherwise it's overkill. +% +% \stopsection +% +% \startsection[title={Interfacing to \TEX}] +% +% The next bunch of calls is for accessing \TEX\ registers. You can set their +% values and get them as well. +% +% \starttyping +% lua.mp.getmacro(k) +% lua.mp.getdimen(k) +% lua.mp.getcount(k) +% lua.mp.gettoks (k) +% +% lua.mp.setmacro(k,v) +% lua.mp.setdimen(k,v) +% lua.mp.setcount(k,v) +% lua.mp.settoks (k,v) +% \stoptyping +% +% When you mess around with variables and run into issues it might help to +% report values on the console. The \type {report} function does this: +% +% \starttyping +% lua.mp.report(a,b) +% \stoptyping +% +% \startlinecorrection +% \startMPcode +% lua.mp.report("status","a circle") ; +% fill fullcircle xyscaled (2cm,1cm) withcolor red ; +% lua.mp.report("status","its boundingbox [@N,@N,@N,@N]", +% xpart llcorner currentpicture, ypart llcorner currentpicture, +% xpart urcorner currentpicture, ypart urcorner currentpicture +% ) ; +% draw boundingbox currentpicture withcolor blue ; +% report("status","the size: @Nbp x @Nbp", +% bbwidth(currentpicture), bbheight(currentpicture) +% ) ; +% message("done") ; +% \stopMPcode +% \stoplinecorrection +% +% The console shows: +% +% \starttyping +% metapost > status : a circle +% metapost > status : its boundingbox [-28.34645,-14.17323,28.34645,14.17323] +% metapost > status : the size: 57.1929bp x 28.84647bp +% metapost > message : done +% \stoptyping +% +% There are two more getters. These can be used to access the specific graphic +% related variables set at the \TEX\ end. +% +% \starttyping +% mp.texvar(name) +% mp.texstr(name) +% \stoptyping +% +% If you have adaptive styles you might want to test for modes. +% +% \starttyping +% if lua.mp.mode("screen") : % or processingmode +% % some action only needed for screen documents +% fi ; +% if lua.mp.systemmode("first") : +% % some action for the first run +% fi ; +% \stoptyping +% +% For convenience these are wrapped into macros: +% +% \starttyping +% if texmode("screen") : +% % some action only needed for screen documents +% fi ; +% if systemmode("first") : +% % some action for the first run +% fi ; +% \stoptyping +% +% When you implement your own helpers you can fall back on some auxiliary functions +% in the \type {mp} namespace. Actually these are collected in \type {mp.aux} and +% thereby protected from being overwritten by mistake. Here they are: +% +% % mp.flush() +% % mp.size(t) +% +% \stopsection -for i within p : - if isobject(i) : - draw i xsized 5cm ; - else : - draw i ysized 3cm withcolor blue; - fi ; -endfor ; -\stopMPcode -\stoplinecorrection +% \startsection[title={Interfacing to \METAPOST}] +% +% There is also experimental access to some of the \METAPOST\ internals. In order +% to deal with (large) paths a few more iterator related helpers are provided too. +% +% % mp.set (numeric string path boolean) +% +% \starttyping +% n = mp.getnumeric(name) +% s = mp.getstring(name) +% b = mp.getboolean(name) +% p = mp.getpath(name) +% \stoptyping +% +% A is path a table of tables that have six values: the coordinates and the +% pre- and postcontrol. You can manipulate this table and feed it back into +% \METAPOST. +% +% \startlinecorrection +% \startMPcode +% numeric n ; n := lua.mp.newhash() ; +% +% for i=1 upto 3 : +% lua.mp.tohash(n,i) ; +% endfor ; +% +% fill fullcircle scaled 10mm withcolor +% if lua.mp.inhash(n,3) : green else : red fi ; +% +% fill fullcircle scaled 5mm withcolor +% if lua.mp.inhash(n,4) : green else : red fi ; +% +% lua.mp.disposehash(n) +% \stopMPcode +% \stoplinecorrection +% +% You can also store values with keys and access them later: +% +% \startlinecorrection +% \startMPcode +% numeric n ; n := lua.mp.newhash() ; +% +% for i=1 upto 3 : +% lua.mp.tohash(n,i,decimal sqrt(i)) ; +% endfor ; +% +% draw textext(lua.mp.fromhash(n,3)) +% ysized 1cm +% withcolor blue ; +% +% lua.mp.disposehash(n) +% \stopMPcode +% \stoplinecorrection +% +% You can also name your own hash: +% +% \startlinecorrection +% \startMPcode +% lua.mp.newhash("foo") ; +% +% for i=1 upto 3 : +% lua.mp.tohash("foo",i,decimal sqrt(i)) ; +% endfor ; +% +% draw textext(lua.mp.fromhash("foo",2)) +% ysized 1cm +% withcolor green ; +% +% lua.mp.disposehash("foo") +% \stopMPcode +% \stoplinecorrection +% +% Although it might look like \METAPOST\ supports arrays the reality is that it +% doesn't really. There is a concept of suffixes but internally these are just a +% way to compose macros. The following test is one that is used in one of the +% \METAFUN\ modules written by Alan Braslau. +% +% \startlinecorrection +% \startMPcode +% path p, q[] ; +% +% if lua.mp.isarray(str q[1]) : +% fill fullcircle scaled 1cm withcolor red ; +% draw textext(lua.mp.prefix(str q[1])) withcolor white; +% else : +% fill fullsquare scaled 1cm withcolor blue ; +% fi ; +% +% currentpicture := currentpicture shifted (-2cm,0) ; +% +% if lua.mp.isarray(str p) : +% fill fullcircle scaled 1cm withcolor red ; +% else : +% fill fullsquare scaled 1cm withcolor blue ; +% fi ; +% \stopMPcode +% \stoplinecorrection +% +% Another helper relates to extensions that \METAFUN\ adds to \METAPOST. When you +% iterate over a picture you can recognize these as objects. The next code shows +% the \LUA\ call as well as the more convenient macro call. So, \type {textext} +% clearly is a foreign object. +% +% \startlinecorrection +% \startMPcode +% picture p ; p := image ( +% fill fullcircle scaled 1cm withcolor red ; +% draw textext("ok") withcolor white ; +% ) ; +% +% for i within p : +% if not picture i : +% draw i ysized 4cm ; +% elseif isobject i : +% draw i xsized 3cm ; +% else : +% draw i ysized 4cm ; +% fi ; +% endfor ; +% +% currentpicture := currentpicture shifted (-6cm,0) ; +% +% for i within p : +% if isobject(i) : +% draw i xsized 5cm ; +% else : +% draw i ysized 3cm withcolor blue; +% fi ; +% endfor ; +% \stopMPcode +% \stoplinecorrection % not yet, still experimental: % diff --git a/doc/context/sources/general/manuals/metafun/metafun-reference.tex b/doc/context/sources/general/manuals/metafun/metafun-reference.tex index 6eb177949..7803faea5 100644 --- a/doc/context/sources/general/manuals/metafun/metafun-reference.tex +++ b/doc/context/sources/general/manuals/metafun/metafun-reference.tex @@ -476,7 +476,7 @@ defineshade cshade withshademethod "circular" ; \ShowSampleJ {mm} {pencircle transform} {pencircle} \ShowSampleJ {mm} {pensquare transform} {pensquare} \ShowSampleJ {mm} {penrazor transform} {penrazor} -\ShowSampleK {mm} {penspeck transform} {penspeck} +\ShowSampleK {mm} {penspec transform} {penspec} \ShowSampleL {mm} {draw} {fullcircle} \ShowSampleL {mm} {fill} {fullcircle} @@ -610,7 +610,7 @@ defineshade cshade withshademethod "circular" ; \ShowSampleS {fm} {externalfigure string ...} - {draw externalfigure "mycow.pdf" scaled 3cm} + {draw externalfigure "mycow.pdf" ysized 3cm} \ShowSampleT {fm} {addbackground text} {addbackground withcolor .625 yellow} @@ -637,11 +637,11 @@ defineshade cshade withshademethod "circular" ; \ShowSampleT {mm} {withmask string} - {draw externalfigure "m-1.png" scaled 2cm withmask "m-2.png"} + {draw externalfigure "m-1.png" ysized 2cm withmask "m-2.png"} {Scale := 1 ; - draw externalfigure "m-2.png" scaled 2cm shifted (-3cm,0) ; - draw externalfigure "m-1.png" scaled 2cm shifted (-6cm,0) ; - draw externalfigure "m-1.png" scaled 2cm withmask "m-2.png"} + draw externalfigure "m-2.png" ysized 2cm shifted (-3cm,0) ; + draw externalfigure "m-1.png" ysized 2cm shifted (-6cm,0) ; + draw externalfigure "m-1.png" ysized 2cm withmask "m-2.png"} \stopsection diff --git a/doc/context/sources/general/manuals/metafun/metafun.tex b/doc/context/sources/general/manuals/metafun/metafun.tex index dc90bb611..8a75be464 100644 --- a/doc/context/sources/general/manuals/metafun/metafun.tex +++ b/doc/context/sources/general/manuals/metafun/metafun.tex @@ -28,13 +28,20 @@ % % comment : This is one of the manuals that can be ordered at http://www.h2o-books.com and % it's actually meant to be read on paper. +% +% comment : Before I started updating the manual to lmtx (luametafun) I made sure that it +% processed okay in the february version of lmtx. The runtime for 446 pages is +% below 18 seconds and with compact fonts we gain half a second. So we can safely +% conclude that we're not worse off wrt performance. (I used the same machine.) -\enabledirectives[hyphenator.optimize] -\enabledirectives[hyphenator.flatten] +% \enabledirectives[hyphenator.optimize] +% \enabledirectives[hyphenator.flatten] % \setuphyphenation[method=traditional] % \enabletrackers[*defin*] +% \enableexperiments[fonts.compact] + % \enablemode[screen] \enablemode[print] % \enablemode[book] diff --git a/metapost/context/base/mpiv/mp-base.mpiv b/metapost/context/base/mpiv/mp-base.mpiv index 75dd4b4b0..08bd42c05 100644 --- a/metapost/context/base/mpiv/mp-base.mpiv +++ b/metapost/context/base/mpiv/mp-base.mpiv @@ -237,11 +237,13 @@ EOF = char 0 ; % end-of-file for readfrom and write..to % pen constants -pen pensquare, penrazor, penspeck ; +pen pensquare, penrazor, penspec ; pensquare = makepen(unitsquare shifted -(.5,.5)) ; penrazor = makepen((-.5,0) -- (.5,0) -- cycle) ; -penspeck = pensquare scaled eps ; +penspec = pensquare scaled eps ; + +def penspeck = penspec enddef ; % nullary operators diff --git a/metapost/context/base/mpxl/mp-apos.mpxl b/metapost/context/base/mpxl/mp-apos.mpxl index 3e7524b11..e3746540f 100644 --- a/metapost/context/base/mpxl/mp-apos.mpxl +++ b/metapost/context/base/mpxl/mp-apos.mpxl @@ -105,6 +105,8 @@ enddef ; % new interface -newscriptindex mfid_getposboxes ; mfid_getposboxes := scriptindex "getposboxes" ; +newscriptindex mfid_getposboxes ; mfid_getposboxes := scriptindex "getposboxes" ; +newscriptindex mfid_getmultipars ; mfid_getmultipars := scriptindex "getmultipars" ; -def getposboxes(expr tags, anchor) = runscript mfid_getposboxes tags anchor ; enddef ; +def getposboxes (expr tags, anchor) = runscript mfid_getposboxes tags anchor ; enddef ; +def getmultipars(expr tags, anchor) = runscript mfid_getmultipars tags anchor ; enddef ; diff --git a/metapost/context/base/mpxl/mp-base.mpxl b/metapost/context/base/mpxl/mp-base.mpxl index 430e75a62..8086ee799 100644 --- a/metapost/context/base/mpxl/mp-base.mpxl +++ b/metapost/context/base/mpxl/mp-base.mpxl @@ -895,7 +895,7 @@ defaultscale := 1 ; labeloffset := 3bp ; dotlabeldiam := 3bp ; -permanent defaultfont, defaultscale, labeloffset, dotlabeldiam ; +mutable defaultfont, defaultscale, labeloffset, dotlabeldiam ; vardef thelabel@#(expr s,z) = % Position s near z save p ; picture p ; diff --git a/metapost/context/base/mpxl/mp-lmtx.mpxl b/metapost/context/base/mpxl/mp-lmtx.mpxl index a3866dff4..93791e7c5 100644 --- a/metapost/context/base/mpxl/mp-lmtx.mpxl +++ b/metapost/context/base/mpxl/mp-lmtx.mpxl @@ -2346,3 +2346,25 @@ primarydef p scrutenized n = enddef ; permanent scrutenized ; + +% for now here + +% newscriptindex mfid_mpv_numeric ; mfid_mpv_numeric := scriptindex "mpv_numeric" ; +% newscriptindex mfid_mpv_dimension ; mfid_mpv_dimension := scriptindex "mpv_dimension" ; +% newscriptindex mfid_mpv_string ; mfid_mpv_string := scriptindex "mpv_string" ; +% +% def mpv_numeric = runscript mfid_mpv_numeric enddef ; +% def mpv_dimension = runscript mfid_mpv_dimension enddef ; +% def mpv_string = runscript mfid_mpv_string enddef ; +% +% permanent mpv_numeric, mpv_dimension, mpv_string ; + +newscriptindex mfid_mpvar ; mfid_mpvar := scriptindex "mpvar" ; + +def mpvar = runscript mfid_mpvar enddef ; + +permanent mpvar ; + +% for old times sake (metafun manual) + +vardef textual primary p = false enddef ; diff --git a/metapost/context/base/mpxl/mp-tool.mpxl b/metapost/context/base/mpxl/mp-tool.mpxl index 59b29c148..1d515ffc8 100644 --- a/metapost/context/base/mpxl/mp-tool.mpxl +++ b/metapost/context/base/mpxl/mp-tool.mpxl @@ -1446,7 +1446,8 @@ vardef arrowhead expr p = enddef ; vardef drawarrowpath expr p = - save autoarrows ; boolean autoarrows ; autoarrows := true ; +% save autoarrows ; boolean autoarrows ; autoarrows := true ; + interim autoarrows := true ; drawarrow p mfun_opt_pth enddef ; @@ -1455,8 +1456,8 @@ def midarrowhead expr p = enddef ; vardef arrowheadonpath (expr p, s) = - save autoarrows ; boolean autoarrows ; - autoarrows := true ; +% save autoarrows ; boolean autoarrows ; + interim autoarrows := true ; set_ahlength(scaled ahfactor) ; % added arrowhead p if s < 1 : cutafter (point (s*arclength(p) + (ahlength/2)) on p) fi enddef ; @@ -1709,9 +1710,11 @@ extra_beginfig := extra_beginfig & " linecap := rounded ; " ; % restores %D Normally, arrowheads don't scale well. So we provide a hack. -boolean autoarrows ; autoarrows := false ; % todo: newinternal boolean autoarrows ; +% boolean autoarrows ; autoarrows := false ; % todo: newinternal boolean autoarrows ; numeric ahfactor ; ahfactor := 2.5 ; % todo: newinternal ahfactor ; +newinternal boolean autoarrows ; + permanent ahfactor, ahlength, autoarrows ; def set_ahlength (text t) = % called to often diff --git a/scripts/context/lua/mtx-epub.lua b/scripts/context/lua/mtx-epub.lua index 956ce4931..0109b15c4 100644 --- a/scripts/context/lua/mtx-epub.lua +++ b/scripts/context/lua/mtx-epub.lua @@ -497,7 +497,7 @@ function scripts.epub.make(purge,rename,svgmath,svgstyle) -- end of todo - local pdftosvg = os.which("mudraw") and formatters[ [[mudraw -o "%s" "%s" %s]] ] + local pdftosvg = os.which("mutool") and formatters[ [[mutool draw -o "%s" "%s" %s]] ] local f_svgpage = formatters["%s-page-%s.svg"] local f_svgname = formatters["%s.svg"] @@ -509,7 +509,7 @@ function scripts.epub.make(purge,rename,svgmath,svgstyle) local newfiles = { } if not pdftosvg then - report("the %a binary is not present","mudraw") + report("the %a binary is not present","mutool") end -- a coverpage file has to be in the root of the export tree diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 827242d91..274de2553 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -13581,7 +13581,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-inf"] = package.loaded["trac-inf"] or true --- original size: 9781, stripped down to: 7325 +-- original size: 9740, stripped down to: 7296 if not modules then modules={} end modules ['trac-inf']={ version=1.001, @@ -13675,10 +13675,8 @@ local function stoptiming(instance) timer.loadtime=timer.loadtime+loadtime timer.timing=0 timer.starttime=0 - return loadtime end end - return 0 end local function benchmarktimer(instance) local timer=timers[instance or "notimer"] @@ -25491,7 +25489,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true --- original size: 11654, stripped down to: 8311 +-- original size: 11691, stripped down to: 8350 if not modules then modules={} end modules ['luat-fmt']={ version=1.001, @@ -25746,9 +25744,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco luafile=quoted(scriptname), texfile=filename~="" and quoted(filename) or "", } - statistics.starttiming() + statistics.starttiming("make format") local result=runner(specification) - local runtime=statistics.stoptiming() + statistics.stoptiming("make format") if verbose then report_format() if binarypath and binarypath~="" then @@ -25766,7 +25764,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco if secondaryflags~="" then report_format("secondary flags : %s",secondaryflags) end - report_format("run time : %.3f seconds",runtime) + report_format("run time : %0.3f seconds",statistics.elapsed("make format")) report_format("return value : %s",result==0 and "okay" or "error") report_format() end @@ -25778,8 +25776,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023714 --- stripped bytes : 404810 +-- original bytes : 1023710 +-- stripped bytes : 404796 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 827242d91..274de2553 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -13581,7 +13581,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-inf"] = package.loaded["trac-inf"] or true --- original size: 9781, stripped down to: 7325 +-- original size: 9740, stripped down to: 7296 if not modules then modules={} end modules ['trac-inf']={ version=1.001, @@ -13675,10 +13675,8 @@ local function stoptiming(instance) timer.loadtime=timer.loadtime+loadtime timer.timing=0 timer.starttime=0 - return loadtime end end - return 0 end local function benchmarktimer(instance) local timer=timers[instance or "notimer"] @@ -25491,7 +25489,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true --- original size: 11654, stripped down to: 8311 +-- original size: 11691, stripped down to: 8350 if not modules then modules={} end modules ['luat-fmt']={ version=1.001, @@ -25746,9 +25744,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco luafile=quoted(scriptname), texfile=filename~="" and quoted(filename) or "", } - statistics.starttiming() + statistics.starttiming("make format") local result=runner(specification) - local runtime=statistics.stoptiming() + statistics.stoptiming("make format") if verbose then report_format() if binarypath and binarypath~="" then @@ -25766,7 +25764,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco if secondaryflags~="" then report_format("secondary flags : %s",secondaryflags) end - report_format("run time : %.3f seconds",runtime) + report_format("run time : %0.3f seconds",statistics.elapsed("make format")) report_format("return value : %s",result==0 and "okay" or "error") report_format() end @@ -25778,8 +25776,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023714 --- stripped bytes : 404810 +-- original bytes : 1023710 +-- stripped bytes : 404796 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 827242d91..274de2553 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -13581,7 +13581,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-inf"] = package.loaded["trac-inf"] or true --- original size: 9781, stripped down to: 7325 +-- original size: 9740, stripped down to: 7296 if not modules then modules={} end modules ['trac-inf']={ version=1.001, @@ -13675,10 +13675,8 @@ local function stoptiming(instance) timer.loadtime=timer.loadtime+loadtime timer.timing=0 timer.starttime=0 - return loadtime end end - return 0 end local function benchmarktimer(instance) local timer=timers[instance or "notimer"] @@ -25491,7 +25489,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true --- original size: 11654, stripped down to: 8311 +-- original size: 11691, stripped down to: 8350 if not modules then modules={} end modules ['luat-fmt']={ version=1.001, @@ -25746,9 +25744,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco luafile=quoted(scriptname), texfile=filename~="" and quoted(filename) or "", } - statistics.starttiming() + statistics.starttiming("make format") local result=runner(specification) - local runtime=statistics.stoptiming() + statistics.stoptiming("make format") if verbose then report_format() if binarypath and binarypath~="" then @@ -25766,7 +25764,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco if secondaryflags~="" then report_format("secondary flags : %s",secondaryflags) end - report_format("run time : %.3f seconds",runtime) + report_format("run time : %0.3f seconds",statistics.elapsed("make format")) report_format("return value : %s",result==0 and "okay" or "error") report_format() end @@ -25778,8 +25776,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023714 --- stripped bytes : 404810 +-- original bytes : 1023710 +-- stripped bytes : 404796 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 827242d91..274de2553 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -13581,7 +13581,7 @@ do -- create closure to overcome 200 locals limit package.loaded["trac-inf"] = package.loaded["trac-inf"] or true --- original size: 9781, stripped down to: 7325 +-- original size: 9740, stripped down to: 7296 if not modules then modules={} end modules ['trac-inf']={ version=1.001, @@ -13675,10 +13675,8 @@ local function stoptiming(instance) timer.loadtime=timer.loadtime+loadtime timer.timing=0 timer.starttime=0 - return loadtime end end - return 0 end local function benchmarktimer(instance) local timer=timers[instance or "notimer"] @@ -25491,7 +25489,7 @@ do -- create closure to overcome 200 locals limit package.loaded["luat-fmt"] = package.loaded["luat-fmt"] or true --- original size: 11654, stripped down to: 8311 +-- original size: 11691, stripped down to: 8350 if not modules then modules={} end modules ['luat-fmt']={ version=1.001, @@ -25746,9 +25744,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco luafile=quoted(scriptname), texfile=filename~="" and quoted(filename) or "", } - statistics.starttiming() + statistics.starttiming("make format") local result=runner(specification) - local runtime=statistics.stoptiming() + statistics.stoptiming("make format") if verbose then report_format() if binarypath and binarypath~="" then @@ -25766,7 +25764,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco if secondaryflags~="" then report_format("secondary flags : %s",secondaryflags) end - report_format("run time : %.3f seconds",runtime) + report_format("run time : %0.3f seconds",statistics.elapsed("make format")) report_format("return value : %s",result==0 and "okay" or "error") report_format() end @@ -25778,8 +25776,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1023714 --- stripped bytes : 404810 +-- original bytes : 1023710 +-- stripped bytes : 404796 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 166b632f8..dd2121312 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2021.02.17 13:30} +\newcontextversion{2021.02.18 10:21} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 9291fb479..d35333376 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2021.02.17 13:30} +\edef\contextversion{2021.02.18 10:21} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index 9f9892874..ef2da9e49 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -774,6 +774,8 @@ \setinterfaceconstant{deepnumbercommand}{commandeprofondenumero} \setinterfaceconstant{deeptextcommand}{commandeprofondetexte} \setinterfaceconstant{default}{defaut} +\setinterfaceconstant{defaultheight}{defaultheight} +\setinterfaceconstant{defaultwidth}{defaultwidth} \setinterfaceconstant{define}{define} \setinterfaceconstant{delay}{retard} \setinterfaceconstant{depth}{profondeur} @@ -1118,6 +1120,7 @@ \setinterfaceconstant{print}{imprimer} \setinterfaceconstant{printable}{imprimable} \setinterfaceconstant{process}{traiter} +\setinterfaceconstant{processors}{processors} \setinterfaceconstant{profile}{profil} \setinterfaceconstant{properties}{proprietes} \setinterfaceconstant{pubsep}{seppub} @@ -1131,6 +1134,7 @@ \setinterfaceconstant{reference}{reference} \setinterfaceconstant{referencemethod}{methodereference} \setinterfaceconstant{referenceprefix}{prefixereference} +\setinterfaceconstant{referencetext}{referencetext} \setinterfaceconstant{referencing}{referencement} \setinterfaceconstant{region}{region} \setinterfaceconstant{regionin}{regiondedans} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 181bb0da5..8c5bfa011 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.02.17 13:30} +\newcontextversion{2021.02.18 10:21} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index f63e4b1a6..219c00255 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.02.17 13:30} +\edef\contextversion{2021.02.18 10:21} %D Kind of special: diff --git a/tex/context/base/mkiv/luat-cod.lua b/tex/context/base/mkiv/luat-cod.lua index 12f7a31e6..b3abecbba 100644 --- a/tex/context/base/mkiv/luat-cod.lua +++ b/tex/context/base/mkiv/luat-cod.lua @@ -144,7 +144,7 @@ if LUATEXVERSION == nil then end if CONTEXTLMTXMODE == nil then - CONTEXTLMTXMODE = LUATEXENGINE == "luametatex" and 1 or 0 + CONTEXTLMTXMODE = 0 end if LUATEXFUNCTIONALITY == nil then diff --git a/tex/context/base/mkiv/luat-fmt.lua b/tex/context/base/mkiv/luat-fmt.lua index eb24378a4..fe97cf604 100644 --- a/tex/context/base/mkiv/luat-fmt.lua +++ b/tex/context/base/mkiv/luat-fmt.lua @@ -297,9 +297,9 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco luafile = quoted(scriptname), texfile = filename ~= "" and quoted(filename) or "", } - statistics.starttiming() + statistics.starttiming("make format") local result = runner(specification) - local runtime = statistics.stoptiming() + statistics.stoptiming("make format") if verbose then report_format() if binarypath and binarypath ~= "" then @@ -317,7 +317,7 @@ function environment.run_format(formatname,scriptname,filename,primaryflags,seco if secondaryflags ~= "" then report_format("secondary flags : %s",secondaryflags) end - report_format("run time : %.3f seconds",runtime) + report_format("run time : %0.3f seconds",statistics.elapsed("make format")) report_format("return value : %s",result == 0 and "okay" or "error") report_format() end diff --git a/tex/context/base/mkiv/luat-ini.lua b/tex/context/base/mkiv/luat-ini.lua index 39453b44c..dcca8cec7 100644 --- a/tex/context/base/mkiv/luat-ini.lua +++ b/tex/context/base/mkiv/luat-ini.lua @@ -31,7 +31,7 @@ LUATEXFUNCTIONALITY = status.development_id or 6346 LUATEXFORMATID = status.format_id or 0 JITSUPPORTED = false INITEXMODE = status.run_state == 0 -- initializing updating production -CONTEXTLMTXMODE = 1 +CONTEXTLMTXMODE = 0 status.ini_version = INITEXMODE -- for a while diff --git a/tex/context/base/mkiv/meta-imp-txt.mkiv b/tex/context/base/mkiv/meta-imp-txt.mkiv index e683c3766..c814d2cb0 100644 --- a/tex/context/base/mkiv/meta-imp-txt.mkiv +++ b/tex/context/base/mkiv/meta-imp-txt.mkiv @@ -25,7 +25,7 @@ \unprotect -\definesystemvariable {sh} % ShapedText .. todo: commandhandler +\ifdefined\??sh \else \definesystemvariable {sh} \fi % ShapedText .. todo: commandhandler \unexpanded\def\setupshapetexts {\dodoubleempty\getparameters[\??sh]} diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua index 4e4a901c0..7bfda80bc 100644 --- a/tex/context/base/mkiv/mult-fun.lua +++ b/tex/context/base/mkiv/mult-fun.lua @@ -201,5 +201,7 @@ return { -- "newcolor", "newrgbcolor", "newcmykcolor", "newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair", + + "mpvar", }, } diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index f934bfab7..2e5da9719 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 4ec3a9778..dbed8e590 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/toks-ini.mkiv b/tex/context/base/mkiv/toks-ini.mkiv index c7d7bceb3..af22d5393 100644 --- a/tex/context/base/mkiv/toks-ini.mkiv +++ b/tex/context/base/mkiv/toks-ini.mkiv @@ -15,6 +15,6 @@ \unprotect -\registerctxluafile{toks-ini}{autosuffix} +\registerctxluafile{toks-ini}{} \protect \endinput diff --git a/tex/context/base/mkiv/trac-inf.lua b/tex/context/base/mkiv/trac-inf.lua index 3db912be1..e2736cfb6 100644 --- a/tex/context/base/mkiv/trac-inf.lua +++ b/tex/context/base/mkiv/trac-inf.lua @@ -129,10 +129,8 @@ local function stoptiming(instance) timer.loadtime = timer.loadtime + loadtime timer.timing = 0 timer.starttime = 0 - return loadtime end end - return 0 end local function benchmarktimer(instance) diff --git a/tex/context/base/mkxl/anch-bck.mklx b/tex/context/base/mkxl/anch-bck.mklx index c8f989624..36416c93d 100644 --- a/tex/context/base/mkxl/anch-bck.mklx +++ b/tex/context/base/mkxl/anch-bck.mklx @@ -11,6 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% when tested for a while: \MPgetmultipars -> getmultipars +% when tested for a while: \MPvar -> mpvar + \writestatus{loading}{ConTeXt Anchoring Macros / Backgrounds} %D This module is quite okay but at some point I might add methods that use @@ -595,6 +598,7 @@ \startMPpositiongraphic{mpos:region}{fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius,lineoffset} \includeMPgraphic{mpos:region:setup} ; \includeMPgraphic{mpos:region:extra} ; + % \getmultipars("self","anchor") ; \MPgetmultipars{\MPvar{self}}{\MPanchorid} ; \includeMPgraphic{\MPvar{mp}} ; \includeMPgraphic{mpos:region:anchor} ; @@ -666,13 +670,21 @@ lineoffset=5pt, linewidth=1pt] +% \startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset} +% getposboxes("self","anchor") ; +% if nofposboxes = 1 : +% posboxes[1] := posboxes[1] enlarged \MPvar{lineoffset} cornered \MPvar{lineoffset} ; +% fill posboxes[1] withcolor \MPvar{fillcolor} ; +% draw posboxes[1] withpen pencircle scaled \MPvar{linewidth} withcolor \MPvar{linecolor} ; +% fi ; +% \stopMPpositiongraphic + \startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset} - \MPgetposboxes{\MPvar{self}}{\MPanchorid} - % getposboxes("self","anchor") ; + getposboxes("self","anchor") ; if nofposboxes = 1 : - posboxes[1] := posboxes[1] enlarged \MPvar{lineoffset} cornered \MPvar{lineoffset} ; - fill posboxes[1] withcolor \MPvar{fillcolor} ; - draw posboxes[1] withpen pencircle scaled \MPvar{linewidth} withcolor \MPvar{linecolor} ; + posboxes[1] := (posboxes[1] enlarged mpvar "lineoffset") cornered mpvar "lineoffset" ; + fill posboxes[1] withcolor mpvar "fillcolor" ; + draw posboxes[1] withpen pencircle scaled mpvar "linewidth" withcolor mpvar "linecolor" ; fi ; \stopMPpositiongraphic @@ -682,12 +694,19 @@ lineoffset=.25ex, linewidth=1pt] +% \startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth} +% boxlinewidth := \MPvar{linewidth} ; +% boxlineoffset := \MPvar{lineoffset} ; +% def boxlineoptions = withcolor \MPvar{linecolor} enddef ; +% getposboxes("from,to","anchor") ; +% connect_positions ; +% \stopMPpositiongraphic + \startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth} - boxlinewidth := \MPvar{linewidth} ; - boxlineoffset := \MPvar{lineoffset} ; - def boxlineoptions = withcolor \MPvar{linecolor} enddef ; - \MPgetposboxes{\MPvar{from},\MPvar{to}}{\MPanchorid} - % getposboxes("from,to","anchor") ; + boxlinewidth := mpvar "linewidth" ; + boxlineoffset := mpvar "lineoffset" ; + def boxlineoptions = withcolor mpvar "linecolor" enddef ; + getposboxes("from,to","anchor") ; connect_positions ; \stopMPpositiongraphic diff --git a/tex/context/base/mkxl/anch-pgr.lmt b/tex/context/base/mkxl/anch-pgr.lmt index 0cf9ea9e4..5b750d80e 100644 --- a/tex/context/base/mkxl/anch-pgr.lmt +++ b/tex/context/base/mkxl/anch-pgr.lmt @@ -24,6 +24,7 @@ local lpegmatch = lpeg.match local jobpositions = job.positions local formatters = string.formatters local setmetatableindex = table.setmetatableindex +local settings_to_array = utilities.parsers.settings_to_array local enableaction = nodes.tasks.enableaction @@ -33,6 +34,8 @@ local context = context local implement = interfaces.implement local getmacro = tokens.getters.macro +local scanmpstring = mp.scan.string +local mpgnamespace = getmacro("??graphicvariable") local report_graphics = logs.reporter("backgrounds") local report_shapes = logs.reporter("backgrounds","shapes") @@ -57,6 +60,12 @@ graphics = graphics or { } local backgrounds = { } graphics.backgrounds = backgrounds +-- -- -- these can go -- -- -- + +backgrounds.point = f_point +backgrounds.pair = f_pair +backgrounds.path = f_path + -- -- -- local texsetattribute = tex.setattribute @@ -1183,9 +1192,29 @@ end backgrounds.fetchmultipar = fetchmultipar -backgrounds.point = f_point -backgrounds.pair = f_pair -backgrounds.path = f_path +local function getwhatever(action) + local tags = scanmpstring() + local anchor = scanmpstring() + local page = nil + if tags == "self" then + tags = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":self",true) -- Isn't it already edef'd? + elseif type(tags) == "string" then + tags = settings_to_array(tags) + for i=1,#tags do + tags[i] = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. tags[i],true) -- Isn't it already edef'd? + end + end + if anchor == "anchor" then + anchor = getmacro("MPanchorid") -- brrr + end + if tags and anchor then + return action(tags,anchor,page) + end +end + +metapost.registerscript("getmultipars", function() + return getwhatever(fetchmultipar) +end) -- n anchor page @@ -1199,8 +1228,6 @@ implement { do - local scanstring = mp.scan.string - local f_template_a = formatters[ [[ path posboxes[], posregions[] ; numeric pospages[] ; @@ -1218,7 +1245,7 @@ do local function getposboxes(tags,anchor,page) -- no caching (yet) / page local collected = jobpositions.collected if type(tags) == "string" then - tags = utilities.parsers.settings_to_array(tags) + tags = settings_to_array(tags) end local list = { } local nofboxes = 0 @@ -1258,32 +1285,8 @@ do return f_template_a(nofboxes,list) end - local namespace - - -- metapost.registerscript("var", function() - -- local name = scanstring() - -- if not namespace then - -- namespace = getmacro("??graphicvariable") - -- end - -- return getmacro(namespace .. getmacro("currentmpvariableclass") .. ":" .. name) - -- end - metapost.registerscript("getposboxes", function() - local tags = scanstring() - local anchor = scanstring() - local page = nil - if tags == "self" then - if not namespace then - namespace = getmacro("??graphicvariable") - end - tags = getmacro(namespace .. getmacro("currentmpvariableclass") .. ":self") - end - if anchor == "anchor" then - anchor = getmacro("MPanchorid") -- brrr - end - if tags and anchor then - return getposboxes(tags,anchor,page) - end + return getwhatever(getposboxes) end) implement { @@ -1294,25 +1297,29 @@ do end -local doifelse = commands.doifelse +do -implement { - name = "doifelserangeonpage", - arguments = { "string", "string", "integer" }, - actions = function(first,last,page) - local c = jobpositions.collected - local f = c[first] - if f then - f = f.p - if f and f ~= true and page >= f then - local l = c[last] - if l then - l = l.p - doifelse(l and l ~= true and page <= l) - return + local doifelse = commands.doifelse + + implement { + name = "doifelserangeonpage", + arguments = { "string", "string", "integer" }, + actions = function(first,last,page) + local c = jobpositions.collected + local f = c[first] + if f then + f = f.p + if f and f ~= true and page >= f then + local l = c[last] + if l then + l = l.p + doifelse(l and l ~= true and page <= l) + return + end end end + doifelse(false) end - doifelse(false) - end -} + } + +end diff --git a/tex/context/base/mkxl/catc-ini.mkxl b/tex/context/base/mkxl/catc-ini.mkxl index 7f1a89f6c..5b33db981 100644 --- a/tex/context/base/mkxl/catc-ini.mkxl +++ b/tex/context/base/mkxl/catc-ini.mkxl @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\registerctxluafile{catc-ini}{} +\registerctxluafile{catc-ini}{autosuffix} \unprotect diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 13ddba0fd..6f7a14b13 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.02.17 13:30} +\newcontextversion{2021.02.18 10:21} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 68860f7e5..89cf5654a 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2021.02.17 13:30} +\immutable\edef\contextversion{2021.02.18 10:21} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/luat-ini.lmt b/tex/context/base/mkxl/luat-ini.lmt index cec0161e7..3bfd191b9 100644 --- a/tex/context/base/mkxl/luat-ini.lmt +++ b/tex/context/base/mkxl/luat-ini.lmt @@ -39,7 +39,7 @@ JITSUPPORTED = LUATEXENGINE == "luajittex" or jit INITEXMODE = status.ini_version -CONTEXTLMTXMODE = CONTEXTLMTXMODE or (LUATEXENGINE == "luametatex" and 1) or 0 +CONTEXTLMTXMODE = 1 function os.setlocale() -- no need for a message diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl index 2100912d7..823d369f0 100644 --- a/tex/context/base/mkxl/meta-ini.mkxl +++ b/tex/context/base/mkxl/meta-ini.mkxl @@ -500,7 +500,7 @@ \let \m_meta_current_variable \empty \let \m_meta_current_variable_template\empty -\installcorenamespace{graphicvariable} +% \installcorenamespace{graphicvariable} % already set \def\meta_prepare_variable_default{\MPcolor{black}} % just to be sure we use a color but ... diff --git a/tex/context/base/mkxl/mlib-cnt.lmt b/tex/context/base/mkxl/mlib-cnt.lmt index 667384ed7..bddcb33b8 100644 --- a/tex/context/base/mkxl/mlib-cnt.lmt +++ b/tex/context/base/mkxl/mlib-cnt.lmt @@ -53,7 +53,8 @@ local bor = bit32.bor -- it's really time to ditch support for luajit local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming -local elapsedtime = statistics.elapsedtime +local resettiming = statistics.resettiming +local elapsedtiming = statistics.elapsed local formatters = string.formatters local setmetatableindex = table.setmetatableindex @@ -250,6 +251,7 @@ end function mp.lmt_contours_start() + resettiming("lmt_contours") starttiming("lmt_contours") nofcontours = nofcontours + 1 @@ -546,14 +548,12 @@ end function mp.lmt_contours_stop() local p = getparameterset() - local e = stoptiming("lmt_contours") + stoptiming("lmt_contours") setcache(p) p.result = nil local f = p["function"] local l = p.functions - report("index %i, %0.3f seconds for: %s", - nofcontours, e, "[ " .. concat(l or { f } ," ] [ ") .. " ]" - ) + report("index %i, %0.3f seconds for: %s", nofcontours, elapsedtiming("lmt_contours"), "[ " .. concat(l or { f } ," ] [ ") .. " ]") end function mp.lmt_contours_bitmap_set() diff --git a/tex/context/base/mkxl/mlib-ctx.mkxl b/tex/context/base/mkxl/mlib-ctx.mkxl index 81fbffa85..fb069b6ea 100644 --- a/tex/context/base/mkxl/mlib-ctx.mkxl +++ b/tex/context/base/mkxl/mlib-ctx.mkxl @@ -13,6 +13,8 @@ \writestatus{loading}{MetaPost Library Graphics / Initializations} +\installcorenamespace{graphicvariable} + \registerctxluafile{mlib-fio}{autosuffix} \registerctxluafile{mlib-run}{autosuffix} \registerctxluafile{mlib-ctx}{autosuffix} diff --git a/tex/context/base/mkxl/mlib-lmp.lmt b/tex/context/base/mkxl/mlib-lmp.lmt index 19288b32b..2b3e910ba 100644 --- a/tex/context/base/mkxl/mlib-lmp.lmt +++ b/tex/context/base/mkxl/mlib-lmp.lmt @@ -88,3 +88,17 @@ registerscript("showhashentry", function() end end end) + +local getmacro = tokens.getters.macro +local mpgnamespace = getmacro("??graphicvariable") + +local scanmpstring = mp.scan.string + +local injectnumeric = mp.inject.numeric +local injectstring = mp.inject.string + +-- registerscript("mpv_numeric", function() injectnumeric (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end) +-- registerscript("mpv_dimension", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring()) end) +-- registerscript("mpv_string", function() injectstring (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end) + +registerscript("mpvar", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring(), true) end) -- Isn't it already edef'd? diff --git a/tex/context/base/mkxl/strc-sec.mkxl b/tex/context/base/mkxl/strc-sec.mkxl index 4e6464db4..7a3a64875 100644 --- a/tex/context/base/mkxl/strc-sec.mkxl +++ b/tex/context/base/mkxl/strc-sec.mkxl @@ -179,7 +179,7 @@ \glet\currentstructurecoding\s!tex \fi \iflocation \ifempty\currentstructurebookmark \orelse \ifx\currentstructurebookmark\currentstructuretitle \else - \showmessage\m!structures3{\currentstructurebookmark}% + \showmessage\m!structures3{{\currentstructurebookmark}}% \fi \fi \setnextinternalreference \storeinternalreference\currentstructurename{\the\locationcount}% diff --git a/tex/context/base/mkxl/trac-inf.lmt b/tex/context/base/mkxl/trac-inf.lmt index 301a56e9b..ebcd21e07 100644 --- a/tex/context/base/mkxl/trac-inf.lmt +++ b/tex/context/base/mkxl/trac-inf.lmt @@ -78,10 +78,8 @@ local function stoptiming(instance) timer.loadtime = timer.loadtime + loadtime timer.timing = 0 timer.starttime = 0 - return loadtime end end - return 0 end local function benchmarktimer(instance) diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index eeca9f5a7..3a1e64452 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -780,6 +780,8 @@ + + @@ -1124,6 +1126,7 @@ + @@ -1137,6 +1140,7 @@ + diff --git a/tex/context/modules/mkiv/s-syntax.mkiv b/tex/context/modules/mkiv/s-syntax.mkiv index d9492af3e..658343ac5 100644 --- a/tex/context/modules/mkiv/s-syntax.mkiv +++ b/tex/context/modules/mkiv/s-syntax.mkiv @@ -42,49 +42,49 @@ \unexpanded\def\StartSyntax {\startlines % formatters - \let\Indent \module_syntax_Indent - \let\Sugar \module_syntax_Sugar - \let\Something \module_syntax_Something - \let\Lbrace \module_syntax_Lbrace - \let\Rbrace \module_syntax_Rbrace - \let\Lparent \module_syntax_Lparent - \let\Rparent \module_syntax_Rparent - \let\Lbracket \module_syntax_Lbracket - \let\Rbracket \module_syntax_Rbracket - \let\Or \module_syntax_Or - \let\Optional \module_syntax_Optional - \let\Means \module_syntax_Means - \let\Tex \module_syntax_Tex - \let\Literal \module_syntax_Literal - \let\Syntax \module_syntax_Syntax - \let\Next \module_syntax_Next - \let\Whatever \module_syntax_Whatever - \let\Quote \module_syntax_Quote - \let\Or \module_syntax_Or - \let\Means \module_syntax_Means - \let\FlaggedLiteral \module_syntax_FlaggedLiteral - \let\FlaggedSomething\module_syntax_FlaggedSomething + \enforced\let\Indent \module_syntax_Indent + \enforced\let\Sugar \module_syntax_Sugar + \enforced\let\Something \module_syntax_Something + \enforced\let\Lbrace \module_syntax_Lbrace + \enforced\let\Rbrace \module_syntax_Rbrace + \enforced\let\Lparent \module_syntax_Lparent + \enforced\let\Rparent \module_syntax_Rparent + \enforced\let\Lbracket \module_syntax_Lbracket + \enforced\let\Rbracket \module_syntax_Rbracket + \enforced\let\Or \module_syntax_Or + \enforced\let\Optional \module_syntax_Optional + \enforced\let\Means \module_syntax_Means + \enforced\let\Tex \module_syntax_Tex + \enforced\let\Literal \module_syntax_Literal + \enforced\let\Syntax \module_syntax_Syntax + \enforced\let\Next \module_syntax_Next + \enforced\let\Whatever \module_syntax_Whatever + \enforced\let\Quote \module_syntax_Quote + \enforced\let\Or \module_syntax_Or + \enforced\let\Means \module_syntax_Means + \enforced\let\FlaggedLiteral \module_syntax_FlaggedLiteral + \enforced\let\FlaggedSomething\module_syntax_FlaggedSomething % shortcuts - \let\FL \module_syntax_FlaggedLiteral - \let\FS \module_syntax_FlaggedSomething - \let\L \module_syntax_Literal - \let\S \module_syntax_Something - \let\M \module_syntax_Means - \let\N \module_syntax_Next - \let\O \module_syntax_Or - \let\Q \module_syntax_Quote - \let\LB \module_syntax_Lbrace - \let\RB \module_syntax_Rbrace - \let\LP \module_syntax_Lparent - \let\RP \module_syntax_Rparent - \let\LS \module_syntax_Lbracket - \let\RS \module_syntax_Rbracket - \let\{ \module_syntax_Lbrace - \let\} \module_syntax_Rbrace - \let\( \module_syntax_Lparent - \let\) \module_syntax_Rparent - \let\[ \module_syntax_Lbracket - \let\] \module_syntax_Rbracket + \enforced\let\FL \module_syntax_FlaggedLiteral + \enforced\let\FS \module_syntax_FlaggedSomething + \enforced\let\L \module_syntax_Literal + \enforced\let\S \module_syntax_Something + \enforced\let\M \module_syntax_Means + \enforced\let\N \module_syntax_Next + \enforced\let\O \module_syntax_Or + \enforced\let\Q \module_syntax_Quote + \enforced\let\LB \module_syntax_Lbrace + \enforced\let\RB \module_syntax_Rbrace + \enforced\let\LP \module_syntax_Lparent + \enforced\let\RP \module_syntax_Rparent + \enforced\let\LS \module_syntax_Lbracket + \enforced\let\RS \module_syntax_Rbracket + \enforced\let\{ \module_syntax_Lbrace + \enforced\let\} \module_syntax_Rbrace + \enforced\let\( \module_syntax_Lparent + \enforced\let\) \module_syntax_Rparent + \enforced\let\[ \module_syntax_Lbracket + \enforced\let\] \module_syntax_Rbracket % precaution \catcode`\#\othercatcode} diff --git a/tex/context/modules/mkiv/x-math-svg.lua b/tex/context/modules/mkiv/x-math-svg.lua index 8a6288167..818c7ad84 100644 --- a/tex/context/modules/mkiv/x-math-svg.lua +++ b/tex/context/modules/mkiv/x-math-svg.lua @@ -35,10 +35,10 @@ local pagedata = { } local statusname = "x-math-svg-status.lua" local pdfname = "x-math-svg.pdf" -local pdftosvg = os.which("mudraw") +local pdftosvg = os.which("mutool") local f_make_tex = formatters[ [[context --global kpse:x-math-svg.mkvi --inputfile="%s" --svgstyle="%s" --batch --noconsole --once --purgeall]] ] -local f_make_svg = formatters[ [[mudraw -o "math-%%d.svg" "%s" 1-9999]] ] +local f_make_svg = formatters[ [[mutool draw -o "math-%%d.svg" "%s" 1-9999]] ] ----- f_inline = formatters[ [[
]] ] local f_inline = formatters[ [[
]] ] @@ -101,7 +101,7 @@ function svgmath.convert(filename,svgstyle) -- invalid filename return false, "invalid filename" elseif not pdftosvg then - return false, "mudraw is not installed" + return false, "mutool is not installed" end os.execute(f_make_tex(filename,svgstyle)) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 390693ed0..86b9a07f8 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2021-02-17 13:30 +-- merge date : 2021-02-18 10:21 do -- begin closure to overcome local limits and interference -- cgit v1.2.3