diff options
author | Marius <mariausol@gmail.com> | 2012-08-02 12:20:22 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-08-02 12:20:22 +0300 |
commit | 2f920851e38f427bbafbf0ef895d43a0db48611f (patch) | |
tree | 6107452ded5339032f32cebb8e6a5b4b586879b9 | |
parent | a5bdb8782fc92ea930e1f09b60bab5c97f3d533c (diff) | |
download | context-2f920851e38f427bbafbf0ef895d43a0db48611f.tar.gz |
beta 2012.08.02 10:55
42 files changed, 759 insertions, 321 deletions
diff --git a/context/data/scite/lexers/data/scite-context-data-context.lua b/context/data/scite/lexers/data/scite-context-data-context.lua index 060b7f5c7..210dd61de 100644 --- a/context/data/scite/lexers/data/scite-context-data-context.lua +++ b/context/data/scite/lexers/data/scite-context-data-context.lua @@ -1,4 +1,4 @@ return { ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "spaceasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vcentergroupcode", "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "vadjustgroupcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode", "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode", "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifmodeelse", "doifnotmode", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "startmodule", "stopmodule", "usemodule", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordcode", "mathopcode", "mathbincode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctcode", "mathalphacode", "mathinnercode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathboxcode", "mathchoicecode", "mathaccentcode", "mathradicalcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "continueifinputfile" }, - ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextbgroupelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "setconstant", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "begstrut", "endstrut", "lineheight" }, + ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "doifelsecommandhandler", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "then", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthsargumenttrue", "sixthargumentfalse", "sixtsargumenttrue", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "dontcomplain", "forgetall", "donetrue", "donefalse", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "availablehsize", "localhsize", "setlocalhsize", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextbgroupelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifnumber", "doifnotnumber", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "doifassignmentelse", "docheckassignment", "tracingall", "tracingnone", "loggingall", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "everyendpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "udef", "ugdef", "uedef", "uxdef", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "setconstant", "newmacro", "setnewmacro", "newfraction", "newsignal", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse", "startnointerference", "stopnointerference", "strut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "begstrut", "endstrut", "lineheight" }, }
\ No newline at end of file diff --git a/context/data/scite/lexers/data/scite-context-data-metafun.lua b/context/data/scite/lexers/data/scite-context-data-metafun.lua index 749be7663..eac24016c 100644 --- a/context/data/scite/lexers/data/scite-context-data-metafun.lua +++ b/context/data/scite/lexers/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "acosh", "asinh", "sinh", "cosh", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", "withshading", "shadedinto", "withcircularshade", "withlinearshade", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "transparent", "withtransparency", "asgroup", "infont", "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", "space", "CRLF", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedpath", "constructedpairs", "punkedfunction", "curvedfunction", "tightfunction", "punkedpath", "curvedpath", "tightpath", "punkedpairs", "curvedpairs", "tightpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", "drawboundary", "drawwholepath", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions" }, + ["commands"]={ "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "acosh", "asinh", "sinh", "cosh", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "smoothed", "cornered", "superellipsed", "randomized", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", "withshading", "shadedinto", "withcircularshade", "withlinearshade", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "asgroup", "infont", "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", "space", "CRLF", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedpath", "constructedpairs", "punkedfunction", "curvedfunction", "tightfunction", "punkedpath", "curvedpath", "tightpath", "punkedpairs", "curvedpairs", "tightpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", "drawboundary", "drawwholepath", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions" }, ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent" }, }
\ No newline at end of file diff --git a/context/data/scite/scite-context-data-context.properties b/context/data/scite/scite-context-data-context.properties index 74995f8a9..6e8699b19 100644 --- a/context/data/scite/scite-context-data-context.properties +++ b/context/data/scite/scite-context-data-context.properties @@ -51,37 +51,37 @@ appendtotoks prependtotoks to endgraf endpar \ everyendpar reseteverypar finishpar empty null \ space quad enspace obeyspaces obeylines \ normalspace executeifdefined singleexpandafter doubleexpandafter tripleexpandafter \ -dontleavehmode removelastspace removeunwantedspaces wait writestatus \ -define redefine setmeasure setemeasure setgmeasure \ -setxmeasure definemeasure measure getvalue setvalue \ -setevalue setgvalue setxvalue letvalue letgvalue \ -resetvalue undefinevalue ignorevalue setuvalue setuevalue \ -setugvalue setuxvalue globallet glet udef \ -ugdef uedef uxdef getparameters geteparameters \ -getgparameters getxparameters forgetparameters copyparameters getdummyparameters \ -dummyparameter directdummyparameter setdummyparameter letdummyparameter usedummystyleandcolor \ -usedummystyleparameter usedummycolorparameter processcommalist processcommacommand quitcommalist \ -quitprevcommalist processaction processallactions processfirstactioninset processallactionsinset \ -unexpanded expanded startexpanded stopexpanded protected \ -protect unprotect firstofoneargument firstoftwoarguments secondoftwoarguments \ -firstofthreearguments secondofthreearguments thirdofthreearguments firstoffourarguments secondoffourarguments \ -thirdoffourarguments fourthoffourarguments firstoffivearguments secondoffivearguments thirdoffivearguments \ -fourthoffivearguments fifthoffivearguments firstofsixarguments secondofsixarguments thirdofsixarguments \ -fourthofsixarguments fifthofsixarguments sixthofsixarguments firstofoneunexpanded gobbleoneargument \ -gobbletwoarguments gobblethreearguments gobblefourarguments gobblefivearguments gobblesixarguments \ -gobblesevenarguments gobbleeightarguments gobbleninearguments gobbletenarguments gobbleoneoptional \ -gobbletwooptionals gobblethreeoptionals gobblefouroptionals gobblefiveoptionals dorecurse \ -doloop exitloop dostepwiserecurse recurselevel recursedepth \ -dofastloopcs newconstant setnewconstant newconditional settrue \ -setfalse setconstant newmacro setnewmacro newfraction \ -newsignal dosingleempty dodoubleempty dotripleempty doquadrupleempty \ -doquintupleempty dosixtupleempty doseventupleempty dosingleargument dodoubleargument \ -dotripleargument doquadrupleargument doquintupleargument dosixtupleargument doseventupleargument \ -dosinglegroupempty dodoublegroupempty dotriplegroupempty doquadruplegroupempty doquintuplegroupempty \ -nopdfcompression maximumpdfcompression normalpdfcompression modulonumber dividenumber \ -getfirstcharacter doiffirstcharelse startnointerference stopnointerference strut \ -setstrut strutbox strutht strutdp strutwd \ -begstrut endstrut lineheight +dontleavehmode removelastspace removeunwantedspaces keepunwantedspaces wait \ +writestatus define redefine setmeasure setemeasure \ +setgmeasure setxmeasure definemeasure measure getvalue \ +setvalue setevalue setgvalue setxvalue letvalue \ +letgvalue resetvalue undefinevalue ignorevalue setuvalue \ +setuevalue setugvalue setuxvalue globallet glet \ +udef ugdef uedef uxdef getparameters \ +geteparameters getgparameters getxparameters forgetparameters copyparameters \ +getdummyparameters dummyparameter directdummyparameter setdummyparameter letdummyparameter \ +usedummystyleandcolor usedummystyleparameter usedummycolorparameter processcommalist processcommacommand \ +quitcommalist quitprevcommalist processaction processallactions processfirstactioninset \ +processallactionsinset unexpanded expanded startexpanded stopexpanded \ +protected protect unprotect firstofoneargument firstoftwoarguments \ +secondoftwoarguments firstofthreearguments secondofthreearguments thirdofthreearguments firstoffourarguments \ +secondoffourarguments thirdoffourarguments fourthoffourarguments firstoffivearguments secondoffivearguments \ +thirdoffivearguments fourthoffivearguments fifthoffivearguments firstofsixarguments secondofsixarguments \ +thirdofsixarguments fourthofsixarguments fifthofsixarguments sixthofsixarguments firstofoneunexpanded \ +gobbleoneargument gobbletwoarguments gobblethreearguments gobblefourarguments gobblefivearguments \ +gobblesixarguments gobblesevenarguments gobbleeightarguments gobbleninearguments gobbletenarguments \ +gobbleoneoptional gobbletwooptionals gobblethreeoptionals gobblefouroptionals gobblefiveoptionals \ +dorecurse doloop exitloop dostepwiserecurse recurselevel \ +recursedepth dofastloopcs newconstant setnewconstant newconditional \ +settrue setfalse setconstant newmacro setnewmacro \ +newfraction newsignal dosingleempty dodoubleempty dotripleempty \ +doquadrupleempty doquintupleempty dosixtupleempty doseventupleempty dosingleargument \ +dodoubleargument dotripleargument doquadrupleargument doquintupleargument dosixtupleargument \ +doseventupleargument dosinglegroupempty dodoublegroupempty dotriplegroupempty doquadruplegroupempty \ +doquintuplegroupempty nopdfcompression maximumpdfcompression normalpdfcompression modulonumber \ +dividenumber getfirstcharacter doiffirstcharelse startnointerference stopnointerference \ +strut setstrut strutbox strutht strutdp \ +strutwd begstrut endstrut lineheight keywordclass.context.constants=\ zerocount minusone minustwo plusone \ diff --git a/context/data/scite/scite-context-data-metafun.properties b/context/data/scite/scite-context-data-metafun.properties index e0413b2dd..099f8119b 100644 --- a/context/data/scite/scite-context-data-metafun.properties +++ b/context/data/scite/scite-context-data-metafun.properties @@ -33,21 +33,21 @@ grayed greyed onlayer along graphictext \ loadfigure externalfigure withmask figure register \ bitmapimage colordecimals ddecimal dddecimal ddddecimal \ textext thetextext rawtextext textextoffset verbatim \ -thelabel label transparent withtransparency asgroup \ -infont set_linear_vector linear_shade define_linear_shade define_circular_linear_shade \ -define_sampled_linear_shade set_circular_vector circular_shade define_circular_shade define_circular_linear_shade \ -define_sampled_circular_shade space CRLF grayscale greyscale \ -withgray withgrey colorpart readfile clearxy \ -unitvector center epsed anchored originpath \ -infinite break xstretched ystretched snapped \ -pathconnectors function constructedpath constructedpairs punkedfunction \ -curvedfunction tightfunction punkedpath curvedpath tightpath \ -punkedpairs curvedpairs tightpairs evenly oddly \ -condition pushcurrentpicture popcurrentpicture arrowpath tensecircle \ -roundedsquare colortype whitecolor blackcolor normalfill \ -normaldraw visualizepaths naturalizepaths drawboundary drawwholepath \ -visualizeddraw visualizedfill draworigin drawboundingbox drawpath \ -drawpoint drawpoints drawcontrolpoints drawcontrollines drawpointlabels \ -drawlineoptions drawpointoptions drawcontroloptions drawlabeloptions draworiginoptions \ -drawboundoptions drawpathoptions resetdrawoptions +thelabel label autoalign transparent withtransparency \ +asgroup infont set_linear_vector linear_shade define_linear_shade \ +define_circular_linear_shade define_sampled_linear_shade set_circular_vector circular_shade define_circular_shade \ +define_circular_linear_shade define_sampled_circular_shade space CRLF grayscale \ +greyscale withgray withgrey colorpart readfile \ +clearxy unitvector center epsed anchored \ +originpath infinite break xstretched ystretched \ +snapped pathconnectors function constructedpath constructedpairs \ +punkedfunction curvedfunction tightfunction punkedpath curvedpath \ +tightpath punkedpairs curvedpairs tightpairs evenly \ +oddly condition pushcurrentpicture popcurrentpicture arrowpath \ +tensecircle roundedsquare colortype whitecolor blackcolor \ +normalfill normaldraw visualizepaths naturalizepaths drawboundary \ +drawwholepath visualizeddraw visualizedfill draworigin drawboundingbox \ +drawpath drawpoint drawpoints drawcontrolpoints drawcontrollines \ +drawpointlabels drawlineoptions drawpointoptions drawcontroloptions drawlabeloptions \ +draworiginoptions drawboundoptions drawpathoptions resetdrawoptions diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv index 71985cef8..1b59f2f78 100644 --- a/metapost/context/base/mp-mlib.mpiv +++ b/metapost/context/base/mp-mlib.mpiv @@ -255,7 +255,7 @@ vardef thetextext@#(expr p,z) = fi enddef ; -vardef textext@#(expr p) = % no draw hers +vardef textext@#(expr p) = % no draw here thetextext@#(p,origin) enddef ; @@ -614,3 +614,28 @@ primarydef t asgroup s = % s = isolated|knockout wrappedpicture endgroup enddef ; + +% Also experimental + +string mfun_auto_align[] ; + +mfun_auto_align[0] := "rt" ; +mfun_auto_align[1] := "urt" ; +mfun_auto_align[2] := "top" ; +mfun_auto_align[3] := "ulft" ; +mfun_auto_align[4] := "lft" ; +mfun_auto_align[5] := "llft" ; +mfun_auto_align[6] := "bot" ; +mfun_auto_align[7] := "lrt" ; +mfun_auto_align[8] := "rt" ; + +def autoalign(expr n) = + scantokens mfun_auto_align[round((n mod 360)/45)] +enddef ; + +% draw textext.autoalign(60) ("\strut oeps 1") ; +% draw textext.autoalign(160)("\strut oeps 2") ; +% draw textext.autoalign(260)("\strut oeps 3") ; +% draw textext.autoalign(360)("\strut oeps 4") ; + + diff --git a/scripts/context/lua/mtx-fcd.lua b/scripts/context/lua/mtx-fcd.lua index 7ab48707a..d96d0bad3 100644 --- a/scripts/context/lua/mtx-fcd.lua +++ b/scripts/context/lua/mtx-fcd.lua @@ -23,7 +23,7 @@ if not modules then modules = { } end modules ['mtx-fcd'] = { local helpinfo = [[ --clear clear the cache ---clear --history [entyr] clear the history +--clear --history [entry] clear the history --scan clear the cache and add given path(s) --add add given path(s) --find file given path (can be substring) diff --git a/tex/context/base/buff-par.lua b/tex/context/base/buff-par.lua index fbc622d6b..29742f497 100644 --- a/tex/context/base/buff-par.lua +++ b/tex/context/base/buff-par.lua @@ -81,7 +81,7 @@ function parallel.save(category,tag,content) end -- maybe no strip -- use lpeg - if find(content,"^%s*%[") then + if find(content,"%s*%[") then local done = false for label, content in gmatch(content,"%s*%[(.-)%]%s*([^%[]+)") do if done then diff --git a/tex/context/base/buff-par.mkvi b/tex/context/base/buff-par.mkvi index 0dd072f04..404fa8ef3 100644 --- a/tex/context/base/buff-par.mkvi +++ b/tex/context/base/buff-par.mkvi @@ -15,8 +15,8 @@ \registerctxluafile{buff-par}{1.001} -%D This module is developped for Thomas Schmitz as part of -%D a project. There is no documentation yet. +%D This module is developped for Thomas Schmitz as part of a project. There is +%D no documentation yet. %D %D \starttyping %D \defineparallel[main][one,two] diff --git a/tex/context/base/chem-str.lua b/tex/context/base/chem-str.lua index 2cd6effc9..a794f5fe7 100644 --- a/tex/context/base/chem-str.lua +++ b/tex/context/base/chem-str.lua @@ -56,6 +56,7 @@ local common_keys = { z = "text", rz = "text", mrz = "text", prz = "text", crz = "text", rt = "text", rtt = "text", rbt = "text", zt = "text", zn = "number", mov = "transform", rot = "transform", adj = "transform", sub = "transform", + off = "transform", } local front_keys = { @@ -93,7 +94,7 @@ local syntax = { n = 3, max = 3, keys = common_keys, align = { mrz = { { "r","b","l" }, { "b","l","t" }, { "l","t","r" }, { "t","r","b" } }, - rz = { { "r","l_b","l_t" }, { "b","l_t","r_t" }, { "l","r_t","r_b" }, { "t","r_b","l_b" } }, + rz = { { "r_t","r_b","l" }, { "r_b","l_b","t" }, { "l_b","l_t","r" }, { "l_t","r_t","b" } }, prz = { { "r","l","t" }, { "b","t","r" }, { "l","r","b" }, { "t","b","l" } }, } }, diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 02c30a865..e972a84d4 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.07.27 16:41} +\newcontextversion{2012.08.02 10:55} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 4be400862..74a510919 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.07.27 16:41} +\newcontextversion{2012.08.02 10:55} %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/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex d4fbee880..fc0fd45ca 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex 14b3f7051..a7071354e 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 1c246e388..6491882b8 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.07.27 16:41} +\edef\contextversion{2012.08.02 10:55} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index d38680c4e..d3de216a9 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.07.27 16:41} +\edef\contextversion{2012.08.02 10:55} %D For those who want to use this: diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv index 32fba6c04..e1f3b57e8 100644 --- a/tex/context/base/grph-inc.mkiv +++ b/tex/context/base/grph-inc.mkiv @@ -69,8 +69,9 @@ \c!xscale =, \c!yscale =, \c!scale =, - \c!sx =1, - \c!sy =1, + \c!sx =\externalfigureparameter\c!s, + \c!sy =\externalfigureparameter\c!s, + \c!s =1, \c!width =, \c!height =, \c!lines =, @@ -365,10 +366,34 @@ \c!scale =\externalfigureparameter\c!scale, \c!sx =\externalfigureparameter\c!sx, \c!sy =\externalfigureparameter\c!sy, + \c!s =\externalfigureparameter\c!s, \c!width =\externalfigureparameter\c!width, \c!height =\externalfigureparameter\c!height, \c!lines =\externalfigureparameter\c!lines] +% % this will become: +% +% \unexpanded\def\doscalefigure % used at lua end +% {\global\setbox\foundexternalfigure\vbox\bgroup +% \bgroup +% \let\currentscale\currentexternalfigure +% \let\scaleparameter\externalfigureparameter +% \dowithnextboxcs\grph_scale_finish\hbox{\dowithfigure{\box\foundexternalfigure}}% +% \egroup} +% +% % or even better: +% +% \def\grph_scale_inherited#1% +% {\bgroup +% \expandafter\let\expandafter\currentscale \csname current#1\endcsname +% \expandafter\let\expandafter\scaleparameter\csname #1parameter\endcsname +% \dowithnextboxcs\grph_scale_finish\hbox} +% +% \unexpanded\def\doscalefigure % used at lua end +% {\global\setbox\foundexternalfigure\vbox\bgroup +% \grph_scale_inherited{externalfigure}{\dowithfigure{\box\foundexternalfigure}}% +% \egroup} + %D You can register additional suffixes with the following command: %D %D \starttyping diff --git a/tex/context/base/grph-trf.mkiv b/tex/context/base/grph-trf.mkiv index f1ac9c310..128d28ac8 100644 --- a/tex/context/base/grph-trf.mkiv +++ b/tex/context/base/grph-trf.mkiv @@ -52,6 +52,9 @@ \newcount\c_grph_scale_used_x_scale \newcount\c_grph_scale_used_y_scale +\let \m_grph_scale_used_x_scale\!!plusone +\let \m_grph_scale_used_y_scale\!!plusone + \newdimen\d_grph_scale_outer_v_size % we cannot manipulate any global vsize ! % scratch: @@ -66,8 +69,6 @@ \let\finalscaleboxyscale \!!plusone \let\finalscaleboxwidth \!!zeropoint \let\finalscaleboxheight \!!zeropoint -\let\finalscaleboxxfactor\!!hundred -\let\finalscaleboxyfactor\!!hundred % we can let sx/sy win (first check) @@ -78,8 +79,9 @@ \installcommandhandler \??scale {scale} \??scale % we can have instances \setupscale - [\c!sx=1, - \c!sy=1, + [\c!sx=\scaleparameter\c!s, + \c!sy=\scaleparameter\c!s, + \c!s=1, %\c!scale=, %\c!xscale=, %\c!yscale=, @@ -149,8 +151,6 @@ \global\let\finalscaleboxyscale \!!plusone \xdef \finalscaleboxwidth {\the\d_grph_scale_wd}% \xdef \finalscaleboxheight{\the\d_grph_scale_ht}% - \global\let\finalscaleboxxfactor\!!hundred - \global\let\finalscaleboxyfactor\!!hundred % \forgetall \dontcomplain @@ -219,9 +219,45 @@ \glet\finalscaleboxxscale\p_sx \glet\finalscaleboxyscale\p_sy \ifx\finalscaleboxxscale\empty\let\finalscaleboxxscale\!!plusone\fi - \ifx\finalscaleboxyscale\empty\let\finalscaleboxyscale\!!plusone\fi - \xdef\finalscaleboxxfactor{\grph_scale_rounded\finalscaleboxxscale}% - \xdef\finalscaleboxyfactor{\grph_scale_rounded\finalscaleboxyscale}} + \ifx\finalscaleboxyscale\empty\let\finalscaleboxyscale\!!plusone\fi} + +\let\grph_scale_calculations_report\relax + +% \def\grph_scale_calculations_report +% {\writestatus +% {scaled}% +% {wd:\finalscaleboxwidth,ht:\finalscaleboxheight +% ,xscale:\finalscaleboxxscale,yscale:\finalscaleboxyscale}} + +% \def\grph_scale_calculations_yes +% {\settrue\c_grph_scale_done +% % initial values +% \d_grph_scale_x_offset\zeropoint +% \d_grph_scale_y_offset\zeropoint +% \d_grph_scale_x_size \d_grph_scale_wd +% \d_grph_scale_y_size \d_grph_scale_ht % alleen ht wordt geschaald! +% % final values +% \global\d_grph_scale_used_x_size \zeropoint % see note * (core-fig) +% \global\d_grph_scale_used_y_size \zeropoint % see note * (core-fig) +% \c_grph_scale_used_x_scale \plusone % see note * (core-fig) +% \c_grph_scale_used_y_scale \plusone % see note * (core-fig) +% \let\m_grph_scale_used_x_scale \!!plusone +% \let\m_grph_scale_used_y_scale \!!plusone +% % preparations +% \setfalse\c_grph_scale_scaling_done +% \grph_scale_check_parameters +% % calculators +% % beware, they operate in sequence, and calculate missing dimensions / messy +% % grph_scale_by_nature % when? needed? +% \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_factor \fi +% \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_scale \fi +% \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_dimension\fi +% % used in actual scaling +% \xdef\finalscaleboxwidth {\the\d_grph_scale_used_x_size}% +% \xdef\finalscaleboxheight {\the\d_grph_scale_used_y_size}% +% \xdef\finalscaleboxxscale {\luaexpr{\number\c_grph_scale_used_x_scale/1000}}% +% \xdef\finalscaleboxyscale {\luaexpr{\number\c_grph_scale_used_y_scale/1000}}% +% \grph_scale_calculations_report} \def\grph_scale_calculations_yes {\settrue\c_grph_scale_done @@ -235,25 +271,23 @@ \global\d_grph_scale_used_y_size \zeropoint % see note * (core-fig) \c_grph_scale_used_x_scale \plusone % see note * (core-fig) \c_grph_scale_used_y_scale \plusone % see note * (core-fig) + \let\m_grph_scale_used_x_scale \!!plusone + \let\m_grph_scale_used_y_scale \!!plusone % preparations \setfalse\c_grph_scale_scaling_done \grph_scale_check_parameters % calculators % beware, they operate in sequence, and calculate missing dimensions / messy - %grph_scale_by_nature % when? needed? + % grph_scale_by_nature % when? needed? \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_factor \fi \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_scale \fi \ifconditional\c_grph_scale_scaling_done\else\grph_scale_by_dimension\fi - % finalizers / to be done (no longer needed this way, clean up) - \grph_scale_convert_large_scale\d_grph_scale_h_size\figx\c_grph_scale_used_x_scale\m_grph_scale_temp_x - \grph_scale_convert_large_scale\d_grph_scale_v_size\figy\c_grph_scale_used_y_scale\m_grph_scale_temp_y % used in actual scaling \xdef\finalscaleboxwidth {\the\d_grph_scale_used_x_size}% \xdef\finalscaleboxheight {\the\d_grph_scale_used_y_size}% - \xdef\finalscaleboxxfactor{\the\c_grph_scale_used_x_scale}% - \xdef\finalscaleboxyfactor{\the\c_grph_scale_used_y_scale}% - \xdef\finalscaleboxxscale {\withoutpt\the\dimexpr\m_grph_scale_temp_x\points/\plushundred\relax}% - \xdef\finalscaleboxyscale {\withoutpt\the\dimexpr\m_grph_scale_temp_y\points/\plushundred\relax}} + \glet\finalscaleboxxscale \m_grph_scale_used_x_scale + \glet\finalscaleboxyscale \m_grph_scale_used_y_scale + \grph_scale_calculations_report} \setvalue{\??scalegrid\v!yes }{\getnoflines \d_grph_scale_used_y_size\edef\p_height{\the\noflines\lineheight}} \setvalue{\??scalegrid\v!height }{\getrawnoflines\d_grph_scale_used_y_size\edef\p_height{\the\dimexpr\noflines\lineheight+\strutdepth}} @@ -292,27 +326,59 @@ \grph_scale_by_factor_c \grph_scale_by_factor_d}}} +% \def\grph_scale_by_factor_a +% {\grph_scale_apply_size +% \ifdim\d_grph_scale_x_size>\d_grph_scale_y_size +% \grph_scale_calculate_norm \d_grph_scale_used_x_size\p_factor\p_maxwidth\hsize\d_grph_scale_h_size +% \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size +% \else +% \grph_scale_calculate_norm \d_grph_scale_used_y_size\p_factor\p_maxheight\d_grph_scale_outer_v_size\d_grph_scale_v_size +% \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size +% \fi +% \grph_scale_by_factor_indeed} +% +% \def\grph_scale_by_factor_b +% {\grph_scale_apply_size +% \grph_scale_calculate_norm \d_grph_scale_used_y_size\p_hfactor\p_maxheight\d_grph_scale_outer_v_size\d_grph_scale_v_size +% \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size +% \grph_scale_by_factor_indeed} +% +% \def\grph_scale_by_factor_c +% {\grph_scale_apply_size +% \grph_scale_calculate_norm \d_grph_scale_used_x_size\p_wfactor\p_maxwidth\hsize\d_grph_scale_h_size +% \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size +% \grph_scale_by_factor_indeed} +% +% \def\grph_scale_by_factor_d +% {\grph_scale_calculate_norm\d_grph_scale_used_y_size\p_factor \p_height \textheight\d_grph_scale_v_size +% \grph_scale_calculate_norm\d_grph_scale_used_y_size\p_hfactor\p_height \textheight\d_grph_scale_v_size +% \grph_scale_calculate_norm\d_grph_scale_used_x_size\p_wfactor\p_width \hsize \hsize} + \def\grph_scale_by_factor_a {\grph_scale_apply_size \ifdim\d_grph_scale_x_size>\d_grph_scale_y_size \grph_scale_calculate_norm \d_grph_scale_used_x_size\p_factor\p_maxwidth\hsize\d_grph_scale_h_size - \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size + \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size \else \grph_scale_calculate_norm \d_grph_scale_used_y_size\p_factor\p_maxheight\d_grph_scale_outer_v_size\d_grph_scale_v_size - \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size + \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size \fi \grph_scale_by_factor_indeed} \def\grph_scale_by_factor_b {\grph_scale_apply_size \grph_scale_calculate_norm \d_grph_scale_used_y_size\p_hfactor\p_maxheight\d_grph_scale_outer_v_size\d_grph_scale_v_size - \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size + \grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size \grph_scale_by_factor_indeed} \def\grph_scale_by_factor_c {\grph_scale_apply_size \grph_scale_calculate_norm \d_grph_scale_used_x_size\p_wfactor\p_maxwidth\hsize\d_grph_scale_h_size - \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size + \grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size \grph_scale_by_factor_indeed} \def\grph_scale_by_factor_d @@ -333,13 +399,38 @@ \fi \grph_scale_by_dimension} +% \def\grph_scale_by_scale +% {\edef\m_grph_scale_temp{\p_scale\p_xscale\p_yscale}% +% \ifx\m_grph_scale_temp\empty \else +% \grph_scale_apply_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale\p_xscale +% \grph_scale_apply_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale\p_yscale +% \global\d_grph_scale_used_x_size\zeropoint +% \global\d_grph_scale_used_y_size\zeropoint +% \ifx\p_maxwidth\empty +% \ifx\p_maxheight\empty +% \else +% \ifdim\d_grph_scale_y_size>\p_maxheight\relax +% \global\d_grph_scale_used_y_size\p_maxheight +% \fi +% \fi +% \else +% \ifdim\d_grph_scale_x_size>\p_maxwidth\relax +% \global\d_grph_scale_used_x_size\p_maxwidth +% \fi +% \fi +% \fi} + \def\grph_scale_by_scale {\edef\m_grph_scale_temp{\p_scale\p_xscale\p_yscale}% \ifx\m_grph_scale_temp\empty \else - \grph_scale_apply_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale\p_xscale - \grph_scale_apply_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale\p_yscale + \grph_scale_apply_scale\m_grph_scale_used_x_scale\p_xscale + \grph_scale_apply_scale\m_grph_scale_used_y_scale\p_yscale + % \global\d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size\relax % no global needed here + % \global\d_grph_scale_used_y_size\m_grph_scale_used_y_scale\d_grph_scale_y_size\relax % no global needed here + % wrong: we need to recalculate the scale \global\d_grph_scale_used_x_size\zeropoint \global\d_grph_scale_used_y_size\zeropoint + % \ifx\p_maxwidth\empty \ifx\p_maxheight\empty \else @@ -369,33 +460,71 @@ \fi \fi} +% \def\grph_scale_by_dimension_a +% {\grph_scale_by_dimension_indeed +% {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale +% \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}% +% {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale +% \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}% +% {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale +% \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}} +% +% \def\grph_scale_by_dimension_b +% {\grph_scale_by_dimension_indeed +% {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% +% {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% +% {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}} +% +% \def\grph_scale_by_dimension_c +% {\grph_scale_by_dimension_indeed +% {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}% +% {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}% +% {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}} +% +% \def\grph_scale_by_dimension_d +% {\grph_scale_by_dimension_indeed +% {\grph_scale_apply_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale\p_xscale +% \grph_scale_apply_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale\p_yscale}% +% {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% +% {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}} + \def\grph_scale_by_dimension_a {\grph_scale_by_dimension_indeed - {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale - \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}% - {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale - \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}% - {\grph_scale_calculate_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale - \grph_scale_calculate_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale}} + {\grph_scale_calculate_scale\m_grph_scale_used_y_scale\d_grph_scale_used_y_size\d_grph_scale_y_size + \grph_scale_calculate_scale\m_grph_scale_used_x_scale\d_grph_scale_used_x_size\d_grph_scale_x_size}% + {\grph_scale_calculate_scale\m_grph_scale_used_y_scale\d_grph_scale_used_y_size\d_grph_scale_y_size + \grph_scale_calculate_scale\m_grph_scale_used_x_scale\d_grph_scale_used_x_size\d_grph_scale_x_size}% + {\grph_scale_calculate_scale\m_grph_scale_used_y_scale\d_grph_scale_used_y_size\d_grph_scale_y_size + \grph_scale_calculate_scale\m_grph_scale_used_x_scale\d_grph_scale_used_x_size\d_grph_scale_x_size}} \def\grph_scale_by_dimension_b {\grph_scale_by_dimension_indeed - {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% - {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% - {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}} + {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size}} \def\grph_scale_by_dimension_c - {\grph_scale_by_dimension_indeed - {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}% - {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}% - {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}} + {\grph_scale_by_dimension_indeed % weird .. three same cases + {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size}} \def\grph_scale_by_dimension_d {\grph_scale_by_dimension_indeed - {\grph_scale_apply_scale\d_grph_scale_used_x_size\d_grph_scale_x_size\c_grph_scale_used_x_scale\p_xscale - \grph_scale_apply_scale\d_grph_scale_used_y_size\d_grph_scale_y_size\c_grph_scale_used_y_scale\p_yscale}% - {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size\d_grph_scale_used_y_size\d_grph_scale_y_size}% - {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size\d_grph_scale_used_x_size\d_grph_scale_x_size}} + {\grph_scale_apply_scale\m_grph_scale_used_x_scale\p_xscale + \grph_scale_apply_scale\m_grph_scale_used_y_scale\p_yscale + \global\d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size + \global\d_grph_scale_used_y_size\m_grph_scale_used_y_scale\d_grph_scale_y_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_x_size\d_grph_scale_x_size + \d_grph_scale_used_y_size\m_grph_scale_used_x_scale\d_grph_scale_y_size}% + {\grph_scale_calculate_scales\d_grph_scale_used_y_size\d_grph_scale_y_size + \d_grph_scale_used_x_size\m_grph_scale_used_x_scale\d_grph_scale_x_size}} \def\grph_scale_by_dimension_indeed#1#2#3% {#1\relax @@ -423,28 +552,57 @@ \setvalue{\??scalenorm\empty }#1#2#3#4#5{\ifx#3\empty\else\global#1#3\fi} \setvalue{\??scalenorm\s!default}#1#2#3#4#5{\ifx#3\empty\else\global#1#3\fi} -\def\grph_scale_calculate_scales#1#2#3#4% - {\scratchdimen\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax - \c_grph_scale_used_x_scale\scratchdimen - \c_grph_scale_used_y_scale\scratchdimen - #3\dimexpr\c_grph_scale_used_x_scale\dimexpr#4/\plusthousand\relax\relax} +% \def\grph_scale_calculate_scales#1#2#3#4% +% {\scratchdimen\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax +% \c_grph_scale_used_x_scale\scratchdimen +% \c_grph_scale_used_y_scale\scratchdimen +% %\writestatus{!!!!}{\the#3/\luaexpr{\number\dimexpr#1\relax/\number\dimexpr#2/1000}}% +% #3\dimexpr\c_grph_scale_used_x_scale\dimexpr#4/\plusthousand\relax\relax} +% +% \def\grph_scale_calculate_scale#1#2#3% +% {#3\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax} +% +% \def\grph_scale_apply_scale#1#2#3#4% #4 = parameter / scale can be empty +% {\ifcase0#4\relax +% \ifcase0\p_scale\relax +% #3=\plusthousand +% \else +% #3=\p_scale +% \fi +% \else +% #3=#4% +% \fi +% \relax % important ! still ? +% \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi +% \relax} + +\def\grph_scale_calculate_scales#1#2% + {\edef\m_grph_scale_used_x_scale{\luaexpr{\number#1/\number#2}}% + \let\m_grph_scale_used_y_scale\m_grph_scale_used_x_scale} -\def\grph_scale_calculate_scale#1#2#3% - {#3\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax} +% we could inline this: +% +% \grph_scale_calculate_scale\m_grph_scale_used_x_scale#1#2 +% \let\m_grph_scale_used_y_scale\m_grph_scale_used_x_scale -\def\grph_scale_apply_scale#1#2#3#4% #4 = parameter / scale can be empty - {\ifcase0#4\relax - \ifcase0\p_scale\relax - #3=\plusthousand - \else - #3=\p_scale - \fi - \else - #3=#4% - \fi - \relax % important ! still ? - \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi - \relax} +\def\grph_scale_calculate_scale#1#2#3% + {\edef#1{\luaexpr{\number#2/\number#3}}} + +\def\grph_scale_apply_scale#1#2% #1 = parameter / scale can be empty + {\edef#1{\luaexpr + {\number + \ifx#2\empty + \ifx \p_scale \empty \plusthousand \else + \ifnum\p_scale=\zerocount \plusthousand \else + \p_scale \fi\fi + \else\ifnum#2=\zerocount + \ifx \p_scale \empty \plusthousand \else + \ifnum\p_scale=\zerocount \plusthousand \else + \p_scale \fi\fi + \else + #2% + \fi\fi + /1000}}} \def\grph_scale_apply_size {\ifx\p_maxheight\empty @@ -484,26 +642,30 @@ \d_grph_scale_h_size\p_width \fi} -\def\grph_scale_convert_large_scale#1#2#3#4% - {\scratchdimen#1\relax - \ifnum#3=\plusthousand - % == scale 1 - \else - % better 1000 100 10 ranges, evt round 2sp - \divide\scratchdimen \plusthousand - \multiply\scratchdimen #3\relax - \fi - \scratchdimen-\scratchdimen % beter hier - dan in driver - \edef#2{\the\scratchdimen}% - \scratchcounter#3\relax - \ifnum\scratchcounter>\plustenthousand - \divide\scratchcounter\plusten - \scratchdimen\the\scratchcounter\points - \else - \scratchdimen\the\scratchcounter\points - \divide\scratchdimen\plusten - \fi - \edef#4{\withoutpt\the\scratchdimen}} +%\def\grph_scale_convert_large_scale#1#2#3#4% +% {\scratchdimen#1\relax +% \ifnum#3=\plusthousand +% % == scale 1 +% \else +% % better 1000 100 10 ranges, evt round 2sp +% \divide\scratchdimen \plusthousand +% \multiply\scratchdimen #3\relax +% \fi +% \scratchdimen-\scratchdimen % beter hier - dan in driver +% \edef#2{\the\scratchdimen}% +% \scratchcounter#3\relax +% \ifnum\scratchcounter>\plustenthousand +% \divide\scratchcounter\plusten +% \scratchdimen\the\scratchcounter\points % \the ? +% \else +% \scratchdimen\the\scratchcounter\points % \the ? +% \divide\scratchdimen\plusten +% \fi +% \edef#4{\withoutpt\the\scratchdimen}} +% +% \def\grph_scale_convert_large_scale#1#2#3#4% less overflow +% {\edef#2{\ifnum#3=\plusthousand-\the\dimexpr#1\else\luaexpr{-\number#3*\number\dimexpr#1/1000}sp\fi}% +% \edef#4{\luaexpr{\number#3/10}}} % \startcombination % {\externalfigure[cow.pdf] [frame=on,height=3cm,equalwidth=6cm]} {a cow} diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv index 4d3570318..eed2e63ac 100644 --- a/tex/context/base/mult-def.mkiv +++ b/tex/context/base/mult-def.mkiv @@ -34,38 +34,40 @@ % start todo: -\def\c!renderingsetup {renderingsetup} -\def\c!filler {filler} -\def\c!resources {resources} -\def\c!first {first} -\def\c!last {last} -\def\c!quotechar {quotechar} -\def\c!commentchar {commentchar} -\def\c!symbolcommand {symbolcommand} -\def\c!xmlsetup {xmlsetup} -\def\c!comma {comma} -\def\c!period {period} -\def\c!monthconversion{monthconversion} -\def\c!comment {comment} -\def\c!textalign {textalign} +\def\c!compressseparator{compressseparator} +\def\c!renderingsetup {renderingsetup} +\def\c!filler {filler} +\def\c!resources {resources} +\def\c!first {first} +\def\c!last {last} +\def\c!quotechar {quotechar} +\def\c!commentchar {commentchar} +\def\c!symbolcommand {symbolcommand} +\def\c!xmlsetup {xmlsetup} +\def\c!comma {comma} +\def\c!period {period} +\def\c!monthconversion {monthconversion} +\def\c!comment {comment} +\def\c!textalign {textalign} -\def\v!notation {notation} -\def\v!endnote {endnote} -\def\v!interactive {interactive} -\def\v!autopunctuation{autopunctuation} -\def\v!integral {integral} -\def\v!shiftup {shiftup} -\def\v!shiftdown {shiftdown} -\def\v!construction {construction} +\def\v!compressseparator{compressseparator} +\def\v!notation {notation} +\def\v!endnote {endnote} +\def\v!interactive {interactive} +\def\v!autopunctuation {autopunctuation} +\def\v!integral {integral} +\def\v!shiftup {shiftup} +\def\v!shiftdown {shiftdown} +\def\v!construction {construction} -\def\s!lcgreek {lcgreek} -\def\s!ucgreek {ucgreek} -\def\s!italics {italics} -\def\s!integral {integral} +\def\s!lcgreek {lcgreek} +\def\s!ucgreek {ucgreek} +\def\s!italics {italics} +\def\s!integral {integral} -\def\c!HL {HL} -\def\c!VL {VL} -\def\c!NL {NL} +\def\c!HL {HL} +\def\c!VL {VL} +\def\c!NL {NL} \ifdefined\v!kerncharacters\else \def\v!kerncharacters{kerncharacters} \fi % no time now for translations should be a e! actually \ifdefined\v!stretched \else \def\v!stretched {stretched} \fi diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua index 48c148dad..ab9c5d434 100644 --- a/tex/context/base/mult-fun.lua +++ b/tex/context/base/mult-fun.lua @@ -43,7 +43,7 @@ return { "along", "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", - "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", + "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "asgroup", "infont", -- redefined usign textext diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index 6376e7d89..abc159f7c 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -219,7 +219,7 @@ return { -- "singleexpandafter", "doubleexpandafter", "tripleexpandafter", -- - "dontleavehmode", "removelastspace", "removeunwantedspaces", + "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", -- "wait", "writestatus", "define", "redefine", -- diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv index 43967cb76..9b7b1e4d2 100644 --- a/tex/context/base/page-ini.mkiv +++ b/tex/context/base/page-ini.mkiv @@ -107,6 +107,7 @@ \strc_pagenumbers_increment_counters % should hook into an every \page_adapts_synchronize \page_otr_check_for_pending_inserts + \page_floats_flush_page_floats % before postponed blocks \page_spread_flush % defined later \page_postponed_blocks_flush} @@ -228,4 +229,13 @@ \the\everyafterpagebody \egroup} +\def\doiftopofpageelse + {\ifdim\pagegoal=\maxdimen + \expandafter\firstoftwoarguments + \else\ifdim\pagegoal=\vsize + \doubleexpandafter\firstoftwoarguments + \else + \doubleexpandafter\secondoftwoarguments + \fi\fi} + \protect \endinput diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index 504478e5e..febabdac4 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -981,7 +981,6 @@ \showmessage\m!layouts1{\the\d_page_adepts_height,\the\realpageno}% % this will become a better one (do we need insert correction?) \page_otr_command_set_vsize - \global\pagegoal\vsize % \page_backgrounds_recalculate \global\let\page_adepts_push\relax diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv index a8a0a248e..dd13fb87d 100644 --- a/tex/context/base/page-lin.mkiv +++ b/tex/context/base/page-lin.mkiv @@ -552,6 +552,6 @@ \unexpanded\def\inlinerange[#1]% {\doifelsesamelinereference{#1} {\in[lr:b:#1]} - {\in[lr:b:#1]--\in[lr:e:#1]}} + {\in[lr:b:#1]\endash\in[lr:e:#1]}} \protect \endinput diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv index 8c41d97fd..a4ef619bb 100644 --- a/tex/context/base/page-mix.mkiv +++ b/tex/context/base/page-mix.mkiv @@ -368,6 +368,21 @@ \popmacro\currentmixedcolumnsmethod \popmacro\currentmixedcolumns} +% \unexpanded\def\stopmixedcolumns +% {\csname\??mixedcolumnsstop \currentmixedcolumnsmethod\endcsname % no \relax +% \endgroup +% \csname\??mixedcolumnsafter\currentmixedcolumnsmethod\endcsname\relax +% \mixedcolumnsparameter\c!after\relax +% \ifx\currentmixedcolumnsmethod\s!otr +% \popmacro\currentmixedcolumnsmethod +% \popmacro\currentmixedcolumns +% \synchronizeoutput % brrr, otherwise sometimes issues in itemize +% \else +% \popmacro\currentmixedcolumnsmethod +% \popmacro\currentmixedcolumns +% \fi +% } + \let\page_mix_fast_columns_stop\stopmixedcolumns %D This is how the fast one is used: @@ -382,8 +397,6 @@ \def\page_mix_initialize_columns {\page_mix_enable_grid_snapping % - \holdinginserts\maxdimen - % \d_page_mix_distance \mixedcolumnsparameter\c!distance \c_page_mix_n_of_columns\mixedcolumnsparameter\c!n \d_page_mix_max_height \mixedcolumnsparameter\c!maxheight @@ -429,6 +442,9 @@ \setupoutputroutine[\s!mixedcolumn]% \c_page_mix_routine\c_page_mix_routine_intercept \page_otr_trigger_output_routine + % + \holdinginserts\maxdimen + % \global\d_page_mix_preceding_height\ht\b_page_mix_preceding \c_page_mix_routine\c_page_mix_routine_continue % @@ -537,6 +553,7 @@ \par %writestatus\m!columns{flush balance}% \box\b_page_mix_collected + \vskip\zeropoint % triggers recalculation of page stuff (weird that this is needed but it *is* needed, see mixed-001.tex) \par \nointerlineskip \prevdepth\strutdp diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv index 098e91155..1d1698764 100644 --- a/tex/context/base/page-mul.mkiv +++ b/tex/context/base/page-mul.mkiv @@ -297,8 +297,8 @@ \c_page_mul_n_of_lines\openlineheight +\multicolumnovershootratio\openlineheight % collect enough data \relax - \global\vsize \d_page_mul_temp - \global\pagegoal\d_page_mul_temp} % let's do it only here + \global\vsize\d_page_mul_temp + \pagegoal \d_page_mul_temp} % let's do it only here %D It really starts here. After some checks and initializations we change the output %D routine to continous multi||column mode. This mode handles columns that fill the @@ -1280,7 +1280,7 @@ \dimen4=\htdp\currenttopcolumnbox \global\advance\vsize -\dimen4 \advance\dimen4 -\pagegoal - \global\pagegoal-\dimen4 + \pagegoal-\dimen4 \showmessage\m!columns{12}a% \else \showmessage\m!columns{12}b% @@ -1383,7 +1383,7 @@ \advance\count0 \minusone }% \page_otr_command_set_vsize \global\advance\vsize -\dimen8 - \global\pagegoal\vsize + \pagegoal\vsize \else % \page_mul_command_flush_floats % does not snap! \fi @@ -1714,7 +1714,7 @@ \wd\currenttopcolumnbox\hsize \global\advance\vsize -\ht\currenttopcolumnbox \fi} - \global\pagegoal\vsize + \pagegoal\vsize \else \snaptogrid\vbox{\box\b_page_columns_span} \fi diff --git a/tex/context/base/page-one.mkiv b/tex/context/base/page-one.mkiv index 9c740dbc2..6261938b6 100644 --- a/tex/context/base/page-one.mkiv +++ b/tex/context/base/page-one.mkiv @@ -20,8 +20,6 @@ % OTRONE: basic single column -\newdimen \d_page_one_saved_vsize - \newconstant \c_page_one_float_method \unexpanded\def\page_one_command_next_page @@ -36,6 +34,34 @@ \unexpanded\def\page_one_command_set_float_hsize {\global\hsize\textwidth} +% \newdimen\d_page_one_saved_vsize +% +% \unexpanded\def\page_one_command_set_vsize +% {\ifgridsnapping +% \ifcase\layoutlines +% \getrawnoflines\textheight +% \else +% \noflines\layoutlines +% \fi +% \global\vsize\noflines\openlineheight +% \else +% \global\vsize\textheight +% \fi +% \ifdim\pagegoal<\maxdimen +% \ifdim\d_page_one_saved_vsize=\vsize +% % let's assume that the layout didn't change +% \else +% \global\d_page_one_saved_vsize\vsize +% \pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax +% % \bgroup +% % \global\d_page_one_saved_vsize\vsize +% % \advance\vsize-\d_page_floats_inserted_top +% % \advance\vsize-\d_page_floats_inserted_bottom +% % \pagegoal\vsize +% % \egroup +% \fi +% \fi} + \unexpanded\def\page_one_command_set_vsize {\ifgridsnapping \ifcase\layoutlines @@ -47,20 +73,10 @@ \else \global\vsize\textheight \fi - \ifdim\pagegoal<\maxdimen - \ifdim\d_page_one_saved_vsize=\vsize - % let's assume that the layout didn't change - \else - \global\d_page_one_saved_vsize\vsize - \global\pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax -% \bgroup -% \global\d_page_one_saved_vsize\vsize -% \advance\vsize-\d_page_floats_inserted_top -% \advance\vsize-\d_page_floats_inserted_bottom -% \global\pagegoal\vsize -% \egroup - \fi - \fi} + % alternatively we could set it in builders.buildpage_filter + % \ifdim\pagegoal<\maxdimen .. \fi + \global\pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax} + % 1 = partial page, 2 = whole page, 3 = partial page diff --git a/tex/context/base/page-pst.mkiv b/tex/context/base/page-pst.mkiv index 63fa54aa1..7f8a39ca6 100644 --- a/tex/context/base/page-pst.mkiv +++ b/tex/context/base/page-pst.mkiv @@ -73,7 +73,7 @@ {\begingroup \setsystemmode\v!postponing \settrue\c_page_postponed_busy - \global\pagetotal\zeropoint % here? still needed? (was after flush pagefloats) + \pagetotal\zeropoint % here? still needed? (was after flush pagefloats) \the\everytopofpage\relax %\flushrestfloats \page_floats_flush_page_floats diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index 6a70de27d..45755436e 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -608,7 +608,7 @@ \ifsomefreecolumncells \global\vsize\columnfreecells\lineheight \ifinotr % else problems with floats, see extreme - \global\pagegoal\vsize % niet nodig, tenzij binnen otr + \pagegoal\vsize % niet nodig, tenzij binnen otr \fi \synchronizeoutput % fails on example % \allowbreak % hm diff --git a/tex/context/base/spac-hor.mkiv b/tex/context/base/spac-hor.mkiv index 9e9843e61..a750577ce 100644 --- a/tex/context/base/spac-hor.mkiv +++ b/tex/context/base/spac-hor.mkiv @@ -419,6 +419,15 @@ \let\ \space \to \everysimplifycommands +\newsignal\s_spac_keep_unwanted_space + +\unexpanded\def\keepunwantedspaces + {\ifhmode + \ifdim\lastskip=\s_spac_keep_unwanted_space\else + \hskip\s_spac_keep_unwanted_space\relax + \fi + \fi} + \unexpanded\def\removeunwantedspaces {\ifhmode \expandafter \spac_helpers_remove_unwantedspace @@ -426,7 +435,12 @@ \def\spac_helpers_remove_unwantedspace {\ifnum\lastnodetype=\gluenodecode - \unskip \expandafter\spac_helpers_remove_unwantedspace + \ifdim\lastskip=\s_spac_keep_unwanted_space\relax + \unskip + \else + \unskip + \doubleexpandafter\spac_helpers_remove_unwantedspace + \fi \fi} % \startbuffer diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua index 66698a49e..ace3ed8bb 100644 --- a/tex/context/base/spac-ver.lua +++ b/tex/context/base/spac-ver.lua @@ -42,16 +42,18 @@ local stoptiming = statistics.stoptiming -- vertical space handler -local trace_vbox_vspacing = false trackers.register("builders.vbox_vspacing", function(v) trace_vbox_vspacing = v end) -local trace_page_vspacing = false trackers.register("builders.page_vspacing", function(v) trace_page_vspacing = v end) -local trace_collect_vspacing = false trackers.register("builders.collect_vspacing", function(v) trace_collect_vspacing = v end) -local trace_vspacing = false trackers.register("builders.vspacing", function(v) trace_vspacing = v end) -local trace_vsnapping = false trackers.register("builders.vsnapping", function(v) trace_vsnapping = v end) -local trace_vpacking = false trackers.register("builders.vpacking", function(v) trace_vpacking = v end) +local trace_vbox_vspacing = false trackers.register("vspacing.vbox", function(v) trace_vbox_vspacing = v end) +local trace_page_vspacing = false trackers.register("vspacing.page", function(v) trace_page_vspacing = v end) +local trace_page_builder = false trackers.register("builders.page", function(v) trace_page_builder = v end) +local trace_collect_vspacing = false trackers.register("vspacing.collect", function(v) trace_collect_vspacing = v end) +local trace_vspacing = false trackers.register("vspacing.spacing", function(v) trace_vspacing = v end) +local trace_vsnapping = false trackers.register("vspacing.snapping", function(v) trace_vsnapping = v end) +local trace_vpacking = false trackers.register("vspacing.packing", function(v) trace_vpacking = v end) local report_vspacing = logs.reporter("vspacing","spacing") local report_collapser = logs.reporter("vspacing","collapsing") local report_snapper = logs.reporter("vspacing","snapping") +local report_page_builder = logs.reporter("builders","page") local a_skipcategory = attributes.private('skipcategory') local a_skippenalty = attributes.private('skippenalty') @@ -65,6 +67,7 @@ local unset_attribute = node.unset_attribute local set_attribute = node.set_attribute local find_node_tail = node.tail local free_node = node.free +local free_node_list = node.flush_list local copy_node = node.copy local traverse_nodes = node.traverse local traverse_nodes_id = node.traverse_id @@ -1216,7 +1219,6 @@ end function vspacing.pagehandler(newhead,where) -- local newhead = texlists.contrib_head if newhead then - -- starttiming(vspacing) local newtail = find_node_tail(newhead) local flush = false stackhack = true -- todo: only when grid snapping once enabled @@ -1266,7 +1268,6 @@ function vspacing.pagehandler(newhead,where) -- texlists.contrib_head = nil newhead = nil end - -- stoptiming(vspacing) end return newhead end @@ -1316,28 +1317,51 @@ function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction) else nodes.processors.tracer("vpack","unchanged",head,groupcode,before,after,true) end - stoptiming(builders) else head, done = actions(head,groupcode) - stoptiming(builders) end + stoptiming(builders) end return head, done end --- This one is special in the sense that it has no head --- and we operate on the mlv. Also, we need to do the --- vspacing last as it removes items from the mvl. +-- This one is special in the sense that it has no head and we operate on the mlv. Also, +-- we need to do the vspacing last as it removes items from the mvl. local actions = nodes.tasks.actions("mvlbuilders") +local function report(groupcode,head) + report_page_builder("trigger: %s",groupcode) + report_page_builder(" vsize : %s",points(tex.vsize)) + report_page_builder(" pagegoal : %s",points(tex.pagegoal)) + report_page_builder(" pagetotal: %s",points(tex.pagetotal)) + report_page_builder(" list : %s",head and nodeidstostring(head) or "<empty>") +end + function builders.buildpage_filter(groupcode) - starttiming(builders) - local head = texlists.contrib_head - local head, done = actions(head,groupcode) - texlists.contrib_head = head - stoptiming(builders) - return (done and head) or true + local head, done = texlists.contrib_head, false +-- if head and head.next and head.next.id == hlist_code and head.next.width == 1 then +-- report_page_builder("trigger otr calculations") +-- free_node_list(head) +-- head = nil +-- end + if head then + starttiming(builders) + if trace_page_builder then + report(groupcode,head) + end + head, done = actions(head,groupcode) + stoptiming(builders) + -- -- doesn't work here (not passed on?) + -- tex.pagegoal = tex.vsize - tex.dimen.d_page_floats_inserted_top - tex.dimen.d_page_floats_inserted_bottom + texlists.contrib_head = head + return done and head or true + else + if trace_page_builder then + report(groupcode) + end + return nil, false + end end callbacks.register('vpack_filter', builders.vpack_filter, "vertical spacing etc") diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index 1c14266ee..010df21e4 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -1714,13 +1714,13 @@ \fi\fi} \def\spac_vspacing_yes_indeed[#1]% - {\ifmmode\else\ctxcommand{vspacing("#1")}\fi} + {\ifmmode\else\par\ctxcommand{vspacing("#1")}\fi} \def\spac_vspacing_yes_ignore[#1]% {\ifmmode\else\par\fi} \def\spac_vspacing_nop_indeed - {\ifmmode\else\ctxcommand{vspacing("\currentvspacing")}\fi} + {\ifmmode\else\par\ctxcommand{vspacing("\currentvspacing")}\fi} \def\spac_vspacing_nop_ignore {\ifmmode\else\par\fi} diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 1095db683..8fdaf533e 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 044cf11e6..41d97cfe3 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/strc-con.mkvi b/tex/context/base/strc-con.mkvi index 620e64c2e..64371579a 100644 --- a/tex/context/base/strc-con.mkvi +++ b/tex/context/base/strc-con.mkvi @@ -331,6 +331,7 @@ \unexpanded\def\boxedconstructionhead#1% {\vtop {\hsize\constructionsheadwidth + \edef\p_strc_constructions_headalign{\constructionparameter\c!headalign}% \ifx\p_strc_constructions_headalign\empty \else \setupalign[\p_strc_constructions_headalign]% \use... \fi diff --git a/tex/context/base/strc-itm.mkvi b/tex/context/base/strc-itm.mkvi index 5ecf72cc9..ce2d8b47a 100644 --- a/tex/context/base/strc-itm.mkvi +++ b/tex/context/base/strc-itm.mkvi @@ -367,7 +367,7 @@ \def\strc_itemgroups_insert_break_indeed {\flushnotes \vspacing[\v!item @-5]} \def\strc_itemgroups_insert_nobreak_indeed {\flushnotes - \ifinsidecolumns + \ifinsidecolumns % todo \vspacing[\v!item @5]% \else \vspacing[\v!item @500]% diff --git a/tex/context/base/strc-lnt.mkvi b/tex/context/base/strc-lnt.mkvi index 9b93ba07f..4160360d2 100644 --- a/tex/context/base/strc-lnt.mkvi +++ b/tex/context/base/strc-lnt.mkvi @@ -50,6 +50,7 @@ \unexpanded\def\strc_linenotes_start#1[#2]#3% {\global\advance\c_strc_linenotes\plusone + \keepunwantedspaces \strc_linenotes_indeed{#1}{#2}{#3}% \strc_linenotes_traced{#2}% \startline[#2]} @@ -57,19 +58,109 @@ \unexpanded\def\strc_linenotes_stop[#1]% {\stopline[#1]} -\unexpanded\def\strc_linenotes_indeed#1#2#3% will be redone +\let\m_page_lines_previous_to \relax +\let\m_page_lines_previous_from\relax + +\let\m_page_lines_current_to \relax +\let\m_page_lines_current_from \relax + +\newconditional\c_page_lines_current_to +\newconditional\c_page_lines_current_from + +\installcorenamespace{linenotespreviousfrom} +\installcorenamespace{linenotespreviousto} + +\letvalue\??linenotespreviousfrom\empty +\letvalue\??linenotespreviousto \empty + +\def\page_lines_in_from{\in[lr:b:\currentlinenotereference]} +\def\page_lines_in_to {\in[lr:e:\currentlinenotereference]} + +\unexpanded\def\strc_linenotes_range_normal#1% order + {\doifreferencefoundelse{lr:b:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_from + \ifconditional\c_page_lines_current_from + \xdef\m_page_lines_current_from{\currentreferencelinenumber}% + \doifreferencefoundelse{lr:e:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_to + \ifconditional\c_page_lines_current_to + \xdef\m_page_lines_current_to{\currentreferencelinenumber}% + \page_lines_in_from + \ifx\m_page_lines_current_from\m_page_lines_current_to \else + \endash + \page_lines_in_to + \fi + \else + \page_lines_in_from + \fi + \else + \page_lines_in_from + \fi} + +\unexpanded\def\strc_linenotes_range_sparse#1% order + {\doifreferencefoundelse{lr:b:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_from + \ifconditional\c_page_lines_current_from + \xdef\m_page_lines_current_from{\currentreferencelinenumber}% + \doifreferencefoundelse{lr:e:\currentlinenotereference}\settrue\setfalse\c_page_lines_current_to + \ifconditional\c_page_lines_current_to + \xdef\m_page_lines_current_to{\currentreferencelinenumber}% + \ifx\m_page_lines_previous_from\m_page_lines_current_from + \ifx\m_page_lines_previous_to\m_page_lines_current_to + \notationparameter\c!compressseparator + \else + \page_lines_in_from + \fi + \else + \page_lines_in_from + \ifx\m_page_lines_current_from\m_page_lines_current_to + \else + \endash + \page_lines_in_to + \fi + \fi + \else + \page_lines_in_from + \fi + \else + \ifx\m_page_lines_previous_from\m_page_lines_current_from + \notationparameter\c!compressseparator + \else + \page_lines_in_from + \fi + \fi} + +\let\currentlinenotereference\empty + +\unexpanded\def\strc_linenotes_indeed#1#2#3% {\begingroup % we keep things local so we can use it as regular note too - \unexpanded\def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order -% \setupnotation[#1][\c!numbercommand=\linenotelinenumber]% todo: deep hook -% \setupnote[#1][\c!textcommand=\gobbleoneargument]% todo: deep hook \edef\currentnotation{#1}% + \edef\currentlinenotereference{#2}% + \xdef\m_page_lines_previous_from{\csname\??linenotespreviousfrom\ifcsname\??linenotespreviousfrom\currentnotation\endcsname\currentnotation\fi\endcsname}% + \xdef\m_page_lines_previous_to {\csname\??linenotespreviousto \ifcsname\??linenotespreviousto \currentnotation\endcsname\currentnotation\fi\endcsname}% + \doifelse{\notationparameter\c!compress}\v!yes + {\let\linenotelinenumber\strc_linenotes_range_sparse}% + {\let\linenotelinenumber\strc_linenotes_range_normal}% \let\currentnote\currentnotation \letnotationparameter\c!numbercommand\linenotelinenumber% todo: deep hook \letnoteparameter \c!textcommand \gobbleoneargument % todo: deep hook - \relax\getvalue{\??linenote#1}{#3}% + \getvalue{\??linenote\currentnotation}{#3}% + \expandafter\glet\csname\??linenotespreviousfrom\currentnotation\endcsname\m_page_lines_current_from + \expandafter\glet\csname\??linenotespreviousto \currentnotation\endcsname\m_page_lines_current_to \endgroup} +% where to hook this one in? resetcounter has no hook: + +\unexpanded\def\doresetlinenotecompression#1% \strc_linenotes_reset_previous + {\expandafter\glet\csname\??linenotespreviousfrom#1\endcsname\empty + \expandafter\glet\csname\??linenotespreviousto #1\endcsname\empty} + +\definesymbol + [\v!compressseparator] + [\space\hbox{\vl\thinspace\vl}] + +\setupnotations + [%c\compress=\v!no, + \c!compressseparator=\symbol\v!compressseparator] + \let\strc_linenotes_traced\gobbleoneargument \def\strc_linenotes_traced_indeed#1% diff --git a/tex/context/base/strc-not.lua b/tex/context/base/strc-not.lua index 6a3f3bfad..be6e37f52 100644 --- a/tex/context/base/strc-not.lua +++ b/tex/context/base/strc-not.lua @@ -13,18 +13,19 @@ local texcount = tex.count local trace_notes = false trackers.register("structures.notes", function(v) trace_notes = v end) local trace_references = false trackers.register("structures.notes.references", function(v) trace_references = v end) -local report_notes = logs.reporter("structure","notes") +local report_notes = logs.reporter("structure","notes") -local structures = structures -local helpers = structures.helpers -local lists = structures.lists -local sections = structures.sections -local counters = structures.counters -local notes = structures.notes -local references = structures.references +local structures = structures +local helpers = structures.helpers +local lists = structures.lists +local sections = structures.sections +local counters = structures.counters +local notes = structures.notes +local references = structures.references +local counterspecials = counters.specials -notes.states = notes.states or { } -lists.enhancers = lists.enhancers or { } +notes.states = notes.states or { } +lists.enhancers = lists.enhancers or { } storage.register("structures/notes/states", notes.states, "structures.notes.states") @@ -33,10 +34,18 @@ local notedata = { } local variables = interfaces.variables local context = context +local commands = commands -- state: store, insert, postpone -function notes.store(tag,n) +local function store(tag,n) + -- somewhat weird but this is a cheap hook spot + if not counterspecials[tag] then + counterspecials[tag] = function(tag) + context.doresetlinenotecompression(tag) -- maybe flag that controls it + end + end + -- local nd = notedata[tag] if not nd then nd = { } @@ -53,7 +62,13 @@ function notes.store(tag,n) end state.start = state.start or nnd end - context(#nd) + return #nd +end + +notes.store = store + +function commands.storenote(tag,n) + context(store(tag,n)) end local function get(tag,n) -- tricky ... only works when defined @@ -84,16 +99,59 @@ notes.getn = getn -- we could make a special enhancer -function notes.listindex(tag,n) +local function listindex(tag,n) local ndt = notedata[tag] return ndt and ndt[n] end +notes.listindex = listindex + +function commands.notelistindex(tag,n) + context(listindex(tag,n)) +end + +local function setstate(tag,newkind) + local state = notestates[tag] + if trace_notes then + report_notes("setting state of '%s' from %s to %s",tag,(state and state.kind) or "unset",newkind) + end + if not state then + state = { + kind = newkind + } + notestates[tag] = state + elseif newkind == "insert" then + if not state.start then + state.kind = newkind + end + else + state.kind = newkind + end + -- state.start can already be set and will be set when an entry is added or flushed + return state +end + +local function getstate(tag) + local state = notestates[tag] + return state and state.kind or "unknown" +end + +notes.setstate = setstate +notes.getstate = getstate + +commands.setnotestate = setstate + +function commands.getnotestate(tag) + context(getstate(tag)) +end + function notes.define(tag,kind,number) - local state = notes.setstate(tag,kind) + local state = setstate(tag,kind) state.number = number end +commands.definenote = notes.define + function notes.save(tag,newkind) local state = notestates[tag] if state and not state.saved then @@ -121,33 +179,10 @@ function notes.restore(tag,forcedstate) end end -function notes.setstate(tag,newkind) - local state = notestates[tag] - if trace_notes then - report_notes("setting state of '%s' from %s to %s",tag,(state and state.kind) or "unset",newkind) - end - if not state then - state = { - kind = newkind - } - notestates[tag] = state - elseif newkind == "insert" then - if not state.start then - state.kind = newkind - end - else - state.kind = newkind - end - -- state.start can already be set and will be set when an entry is added or flushed - return state -end - -function notes.getstate(tag) - local state = notestates[tag] - context(state and state.kind or "unknown") -end +commands.savenote = notes.save +commands.restore = notes.restore -function notes.doifcontent(tag) +local function hascontent(tag) local ok = notestates[tag] if ok then if ok.kind == "insert" then @@ -160,17 +195,21 @@ function notes.doifcontent(tag) ok = ok.start end end - commands.doif(ok) + return ok and true or false +end + +notes.hascontent = hascontent + +function commands.doifnotecontent(tag) + commands.doif(hascontent(tag)) end local function internal(tag,n) local nd = get(tag,n) if nd then --- inspect(nd) local r = nd.references if r then local i = r.internal --- return i and lists.internals[i] return i and references.internals[i] -- dependency on references end end @@ -186,7 +225,7 @@ end notes.internal = internal notes.ordered = ordered -function notes.doifonsamepageasprevious(tag) +local function onsamepageasprevious(tag) local same = false local n = getn(tag,n) local current, previous = get(tag,n), get(tag,n-1) @@ -194,7 +233,13 @@ function notes.doifonsamepageasprevious(tag) local cr, pr = current.references, previous.references same = cr and pr and cr.realpage == pr.realpage end - commands.doifelse(same) + return same and true or false +end + +notes.doifonsamepageasprevious = onsamepageasprevious + +function commands.doifnoteonsamepageasprevious(tag) + commands.doifelse(onsamepageasprevious(tag)) end function notes.checkpagechange(tag) -- called before increment ! @@ -222,13 +267,15 @@ function notes.postpone() end for tag, state in next, notestates do if state.kind ~= "store" then - notes.setstate(tag,"postpone") + setstate(tag,"postpone") end end end +commands.postponenotes = notes.postpone + function notes.setsymbolpage(tag,n,l) - local l = l or notes.listindex(tag,n) + local l = l or listindex(tag,n) if l then local p = texcount.realpageno if trace_notes or trace_references then @@ -245,41 +292,32 @@ function notes.setsymbolpage(tag,n,l) end end --- function notes.getsymbolpage(tag,n) --- local nd = get(tag,n) --- local p = nd and nd.references.symbolpage or 0 --- if trace_notes or trace_references then --- report_notes("page number of note symbol %s of '%s' is %s",n,tag,p) --- end --- context(p) --- end +commands.setnotesymbolpage = notes.setsymbolpage -function notes.getsymbolpage(tag,n) +local function getsymbolpage(tag,n) local li = internal(tag,n) li = li and li.references li = li and (li.symbolpage or li.realpage) or 0 if trace_notes or trace_references then report_notes("page number of note symbol %s of '%s' is %s",n,tag,li) end - context(li) + return li end -function notes.getnumberpage(tag,n) +local function getnumberpage(tag,n) local li = internal(tag,n) li = li and li.references li = li and li.realpage or 0 if trace_notes or trace_references then report_notes("page number of note number %s of '%s' is %s",n,tag,li) end - context(li) + return li end function notes.deltapage(tag,n) -- 0:unknown 1:textbefore, 2:textafter, 3:samepage local what = 0 - --- references.internals[lists.tobesaved[nd].internal] - + -- references.internals[lists.tobesaved[nd].internal] local li = internal(tag,n) if li then local references = li.references @@ -301,10 +339,18 @@ function notes.deltapage(tag,n) -- nesting in a vbox end end - context(what) + return what end -function notes.flush(tag,whatkind,how) -- store and postpone +notes.getsymbolpage = getsymbolpage +notes.getnumberpage = getnumberpage +notes.getdeltapage = getdeltapage + +function commands.notesymbolpage(tag,n) context(getsymbolpage(tag,n)) end +function commands.notenumberpage(tag,n) context(getnumberpage(tag,n)) end +function commands.notedeltapage (tag,n) context(getdeltapage (tag,n)) end + +function commands.flushnotes(tag,whatkind,how) -- store and postpone local state = notestates[tag] local kind = state.kind if kind == whatkind then @@ -360,12 +406,12 @@ function notes.flush(tag,whatkind,how) -- store and postpone end end -function notes.flushpostponed() +function commands.flushpostponednotes() if trace_notes then report_notes("flushing all postponed notes") end for tag, _ in next, notestates do - notes.flush(tag,"postpone") + commands.flushnotes(tag,"postpone") end end diff --git a/tex/context/base/strc-not.mkvi b/tex/context/base/strc-not.mkvi index a81d3deb9..f6be1ffb4 100644 --- a/tex/context/base/strc-not.mkvi +++ b/tex/context/base/strc-not.mkvi @@ -369,7 +369,7 @@ \doifinsertionelse\currentnote {\normalexpanded{\t_strc_notes{\the\t_strc_notes\noexpand\strc_notes_process_list{\currentnote}}}} \donothing - \ctxlua{structures.notes.define("\currentnote","insert",\number\namedinsertionnumber\currentnote)}% + \ctxcommand{definenote("\currentnote","insert",\number\namedinsertionnumber\currentnote)}% \ifx\currentnoteparent\empty \definenotation[\currentnote][\c!type=\v!note]% \else @@ -418,12 +418,16 @@ \unexpanded\setvalue{\??constructionnotehandler\v!notation:\v!note}% in the running text {\ifnotesenabled - \let\currentnote\currentconstructionmain % do be done elsewhere + % do be done elsewhere + % + %let\currentnote\currentconstructionmain + \let\currentnote\currentconstruction % else wrong inheritance + % \iftrialtypesetting \strc_notes_inject_dummy \else \begingroup - \edef\currentnotenumber{\ctxlua{structures.notes.store("\currentnote",\currentconstructionlistentry)}}% + \edef\currentnotenumber{\ctxcommand{storenote("\currentnote",\currentconstructionlistentry)}}% \settrue\processingnote \ifconditional\c_strc_notes_skip \globallet\lastnotesymbol\strc_notes_inject_symbol @@ -498,7 +502,7 @@ \endcsname} \setvalue{\??noteinteractioninline\v!yes}% - {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getnumberpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxcommand{notenumberpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}% \let \strc_notes_set_style_color_inline \strc_notes_set_style_color_inline_yes} @@ -515,8 +519,10 @@ \expandafter\let\csname\??noteinteractioninline\v!number\expandafter\endcsname\csname\??noteinteractioninline\v!yes\endcsname \expandafter\let\csname\??noteinteractioninline\v!text \expandafter\endcsname\csname\??noteinteractioninline\v!yes\endcsname +% page(...) : we could have a dedicated one + \setvalue{\??noteinteractiondisplay\v!yes}% - {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxcommand{notesymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% \let \strc_notes_set_reference_attribute_text \donothing \let \strc_notes_set_destination_attribute_text\donothing @@ -529,7 +535,7 @@ \let\strc_notes_set_style_color_display \strc_notes_set_style_color_display_nop} \setvalue{\??noteinteractiondisplay\v!all}% - {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxcommand{notesymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_text {\attribute\referenceattribute\currentreferenceattribute}% %\strc_references_set_simple_page_reference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% \strc_references_set_simple_page_reference{note:\currentnote:\currentnotenumber}% @@ -538,7 +544,7 @@ \let \strc_notes_set_style_color_display \strc_notes_set_style_color_display_yes} \setvalue{\??noteinteractiondisplay\v!text}% - {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxcommand{notesymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_text {\attribute\referenceattribute\currentreferenceattribute}% %\strc_references_set_simple_page_reference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% \strc_references_set_simple_page_reference{note:\currentnote:\currentnotenumber}% @@ -563,7 +569,7 @@ {\iftrialtypesetting % keep \else\ifx\currentcolorparameter\empty - \scratchcounter\ctxlua{structures.notes.deltapage("\currentnote",\currentnotenumber)}\relax % todo calculate once + \scratchcounter\ctxcommand{notedeltapage("\currentnote",\currentnotenumber)}\relax % todo calculate once \setlocationcolorspecified\scratchcounter \fi\fi} @@ -582,7 +588,7 @@ % in mkii the pointer only showed up in pagewise notes \unexpanded\def\strc_notes_inject_pointer % todo calculate once - {\ifcase\ctxlua{structures.notes.deltapage("\currentnote",\currentnotenumber)}\relax + {\ifcase\ctxcommand{notedeltapage("\currentnote",\currentnotenumber)}\relax % unknown \or % same page @@ -594,7 +600,7 @@ \unexpanded\def\strc_notes_register_note_page % called more often than needed {\iftrialtypesetting \else - \normalexpanded{\noexpand\ctxlatelua{structures.notes.setsymbolpage("\currentnote",\currentnotenumber)}}% + \normalexpanded{\noexpand\ctxlatecommand{setnotesymbolpage("\currentnote",\currentnotenumber)}}% \fi} \unexpanded\def\strc_notes_inject_symbol @@ -988,7 +994,7 @@ \def\strc_notes_set_location_text % we don't use inserts anyway (e.g. endnotes) {\settrue\c_strc_notes_delayed - \ctxlua{structures.notes.setstate("\currentnote","store")}% + \ctxcommand{setnotestate("\currentnote","store")}% \page_inserts_set_location\currentnote\v!text % \setupinsertion[\currentnote][\c!location=\v!text]% \global\count\namedinsertionnumber\currentnote\zerocount \global\dimen\namedinsertionnumber\currentnote\maxdimen @@ -1160,7 +1166,7 @@ \edef\currentnote{#1}% \strc_constructions_initialize{#1}% \strc_notes_synchronize - \edef\currentconstructionlistentry{\ctxlua{tex.write(structures.notes.listindex("#1",#2))}}% index in list cache + \edef\currentconstructionlistentry{\ctxcommand{notelistindex("#1",#2)}}% index in list cache % as we can have collected notes (e.g. in tables) we need to recover % \currentdescriptionattribute and \currentdescriptionsynchronize % @@ -1360,7 +1366,7 @@ {\ifconditional\postponingnotes\else \global\settrue\postponingnotes \global\let\flushnotes\doflushnotes - \ctxlua{structures.notes.postpone()}% + \ctxcommand{postponenotes()}% \fi} \let\flushnotes\relax @@ -1370,7 +1376,7 @@ \begingroup \let\flushnotes \relax \let\postponenotes\relax - \ctxlua{structures.notes.flushpostponed()}% this also resets the states ! + \ctxcommand{flushpostponednotes()}% this also resets the states ! \global\setfalse\postponednote \global\setfalse\postponingnotes \global\let\flushnotes\relax @@ -1417,20 +1423,20 @@ \strc_counters_save{#1}% \strc_counters_reset{#1}% \fi - \ctxlua{structures.notes.save("#1","store")}} + \ctxcommand{savenote("#1","store")}} \def\strc_notes_local_stop_step#1% {\p_strc_notes_continue{\noteparameter\c!continue}% \ifx\p_strc_notes_continue\v!yes \else \strc_counters_restore{#1}% \fi - \ctxlua{structures.notes.restore("#1")}} + \ctxcommand{restorenote("#1")}} \unexpanded\def\placelocalnotes {\dodoubleempty\strc_notes_local_place} \def\strc_notes_local_place[#1][#2]% - {\doif{\ctxlua{structures.notes.getstate("#1")}}{store}{\strc_notes_local_place_indeed{#2}{#1}}} + {\doif{\ctxcommand{getnotestate("#1")}}{store}{\strc_notes_local_place_indeed{#2}{#1}}} \def\strc_notes_local_place_indeed#1#2% settings note {\begingroup @@ -1489,7 +1495,7 @@ \def\strc_notes_place_indeed#1#2% settings note {\edef\currentnote{#2}% grouping ? - \doifelse{\ctxlua{structures.notes.getstate("#2")}}{store} + \doifelse{\ctxcommand{getnotestate("#2")}}{store} \strc_notes_local_place_indeed \strc_notes_global_place_indeed {#1}{#2}} @@ -1509,7 +1515,7 @@ {\setvalue{\??notealternative#1}{#2}} \unexpanded\def\doifnotescollected#1% - {\ctxlua{structures.notes.doifcontent("#1")}} + {\ctxcommand{doifnotecontent("#1")}} \def\strc_notes_place_local_alternative % will be a setup (wrapper) {\doifnotescollected\currentnote @@ -1536,8 +1542,7 @@ % setups ? -% \def\flushlocalnotes#1{\ctxlua{structures.notes.flush("#1","store")}} -\def\flushlocalnotes#1{\ctxlua{structures.notes.flush("#1","store","\noteparameter\c!criterium")}} +\def\flushlocalnotes#1{\ctxcommand{flushnotes("#1","store","\noteparameter\c!criterium")}} \installnotealternative \v!none {\flushlocalnotes\currentnote} @@ -1727,7 +1732,7 @@ %D } %D \stoptyping -\def\doifnoteonsamepageelse[#1]{\ctxlua{structures.notes.doifonsamepageasprevious("#1")}} +\def\doifnoteonsamepageelse[#1]{\ctxcommand{doifnoteonsamepageasprevious("#1")}} %D New trickery: diff --git a/tex/context/base/strc-num.lua b/tex/context/base/strc-num.lua index 3189adacb..2fff8b3c5 100644 --- a/tex/context/base/strc-num.lua +++ b/tex/context/base/strc-num.lua @@ -325,7 +325,7 @@ local function synchronize(name,d) if trace_counters then report_counters("synchronize, counter: %s, name: %s, action: special",dc,name) end - cs() + cs(name) end end diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua index 0b921a4ba..bce965546 100644 --- a/tex/context/base/strc-pag.lua +++ b/tex/context/base/strc-pag.lua @@ -69,7 +69,7 @@ function pages.save(prefixdata,numberdata) end end --- We can set th epagenumber but as it only get incremented in the page +-- We can set the pagenumber but as it only get incremented in the page -- builder we have to make sure it starts at least at 1. function counters.specials.userpage() diff --git a/tex/context/base/tabl-tsp.mkiv b/tex/context/base/tabl-tsp.mkiv index 5777059a5..0138697af 100644 --- a/tex/context/base/tabl-tsp.mkiv +++ b/tex/context/base/tabl-tsp.mkiv @@ -345,7 +345,7 @@ \else % hack \ifdim\pagegoal<\maxdimen - \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex + \pagegoal\dimexpr\pagegoal+\lineheight\relax % etex \fi % brrr \ifdim\ht\tsplitresult>\zeropoint @@ -402,7 +402,7 @@ \global\setfalse\onlyonesplitofffloat \fi \ifdim\pagegoal<\maxdimen - \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex + \pagegoal\dimexpr\pagegoal+\lineheight\relax % etex \fi \page_split_float_process{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% \global\settrue\usesamefloatnumber % new, prevent next increment diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 38dee68f1..08ceb2a42 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/27/12 16:41:17 +-- merge date : 08/02/12 10:55:40 do -- begin closure to overcome local limits and interference |