diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-17 19:15:07 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-17 19:15:07 +0100 |
commit | e200230205ec1297f8d3ade3d491585f85d87fff (patch) | |
tree | 3c1473953256ea8a7144846ff2a55c6ff45e801e /tex/context/base | |
parent | b0a00d3509297a53ffb5618cee122e1b1d995f42 (diff) | |
download | context-e200230205ec1297f8d3ade3d491585f85d87fff.tar.gz |
2016-01-17 18:52:00
Diffstat (limited to 'tex/context/base')
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4170 -> 4175 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/buff-ini.lua | 16 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/lxml-ini.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mkiv/lxml-ini.mkiv | 8 | ||||
-rw-r--r-- | tex/context/base/mkiv/lxml-tab.lua | 20 | ||||
-rw-r--r-- | tex/context/base/mkiv/lxml-tex.lua | 97 | ||||
-rw-r--r-- | tex/context/base/mkiv/pack-mrl.mkiv | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/pack-rul.lua | 11 | ||||
-rw-r--r-- | tex/context/base/mkiv/pack-rul.mkiv | 9 | ||||
-rw-r--r-- | tex/context/base/mkiv/page-set.mkiv | 7 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 9033 -> 9018 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 258720 -> 258792 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/strc-flt.mkvi | 3 | ||||
-rw-r--r-- | tex/context/base/mkiv/strc-syn.mkiv | 3 |
16 files changed, 138 insertions, 45 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 97cb0c64f..25f70f2af 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/buff-ini.lua b/tex/context/base/mkiv/buff-ini.lua index 1caf3b752..c41c51607 100644 --- a/tex/context/base/mkiv/buff-ini.lua +++ b/tex/context/base/mkiv/buff-ini.lua @@ -589,3 +589,19 @@ implement { actions = { collectcontent, context.printlines }, arguments = "string" } + +local startbuffer = context.startbuffer +local stopbuffer = context.stopbuffer + +local startcollecting = context.startcollecting +local stopcollecting = context.stopcollecting + +function context.startbuffer(...) + startcollecting() + startbuffer(...) +end + +function context.stopbuffer() + stopbuffer() + stopcollecting() +end diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 796a0d948..420befa6e 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.01.14 09:55} +\newcontextversion{2016.01.17 18:49} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 96c9558c8..95edb74ee 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.01.14 09:55} +\edef\contextversion{2016.01.17 18:49} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/lxml-ini.lua b/tex/context/base/mkiv/lxml-ini.lua index 379ea31b7..28f5040ff 100644 --- a/tex/context/base/mkiv/lxml-ini.lua +++ b/tex/context/base/mkiv/lxml-ini.lua @@ -41,6 +41,7 @@ implement { name = "xmldoifelseselfempty", actions = lxml.doifelseempty, --------- { name = "xmlflushstripped", actions = lxml.strip, arguments = { "string", true } } implement { name = "xmlall", actions = lxml.all, arguments = { "string", "string" } } implement { name = "xmlatt", actions = lxml.att, arguments = { "string", "string" } } +implement { name = "xmllastatt", actions = lxml.lastatt } implement { name = "xmlattdef", actions = lxml.att, arguments = { "string", "string", "string" } } implement { name = "xmlattribute", actions = lxml.attribute, arguments = { "string", "string", "string" } } implement { name = "xmlattributedef", actions = lxml.attribute, arguments = { "string", "string", "string", "string" } } diff --git a/tex/context/base/mkiv/lxml-ini.mkiv b/tex/context/base/mkiv/lxml-ini.mkiv index 9f84f8ca3..8860f62fe 100644 --- a/tex/context/base/mkiv/lxml-ini.mkiv +++ b/tex/context/base/mkiv/lxml-ini.mkiv @@ -106,6 +106,7 @@ % experiment: \let\xmlall \clf_xmlall \let\xmlatt \clf_xmlatt +\let\xmllastatt \clf_xmllastatt \let\xmlattdef \clf_xmlattdef \let\xmlattribute \clf_xmlattribute \let\xmlattributedef \clf_xmlattributedef @@ -434,6 +435,13 @@ \expandafter\firstofoneargument \fi} +\def\xmlmappedvalue#1#2#3% + {\ifcsname\??xmlmapvalue#1:#2\endcsname + \expandafter\lastnamedcs + \else + \csname\??xmlmapvalue#1:#3\expandafter\endcsname + \fi} + \let\xmldoifvalueelse\xmldoifelsevalue \let\xmlmapval\xmlmapvalue diff --git a/tex/context/base/mkiv/lxml-tab.lua b/tex/context/base/mkiv/lxml-tab.lua index 510ba1bd4..c5480f746 100644 --- a/tex/context/base/mkiv/lxml-tab.lua +++ b/tex/context/base/mkiv/lxml-tab.lua @@ -528,7 +528,7 @@ local function handle_any_entity(str) end else if type(resolve) == "function" then - a = resolve(str) or entities[str] + a = resolve(str,entities) or entities[str] else a = entities[str] end @@ -1146,14 +1146,16 @@ local function serialize(e,handlers,...) end local function xserialize(e,handlers) - local functions = handlers.functions - local etg = e.tg - if etg then - (functions[etg] or functions["@el@"])(e,handlers) - -- elseif type(e) == "string" then - -- functions["@tx@"](e,handlers) - else - functions["@dc@"](e,handlers) + if e then + local functions = handlers.functions + local etg = e.tg + if etg then + (functions[etg] or functions["@el@"])(e,handlers) + -- elseif type(e) == "string" then + -- functions["@tx@"](e,handlers) + else + functions["@dc@"](e,handlers) + end end end diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index 7f375927e..718b8f8c6 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -464,8 +464,8 @@ function xml.load(filename,settings) return xmltable end -local function entityconverter(id,str) - return xmlentities[str] or xmlprivatetoken(str) or "" -- roundtrip handler +local function entityconverter(id,str,ent) -- todo ent optional + return xmlentities[str] or ent[str] or xmlprivatetoken(str) or "" -- roundtrip handler end local function lxmlconvert(id,data,compress,currentresource) @@ -473,7 +473,7 @@ local function lxmlconvert(id,data,compress,currentresource) unify_predefined_entities = true, utfize_entities = true, resolve_predefined_entities = true, - resolve_entities = function(str) return entityconverter(id,str) end, -- needed for mathml + resolve_entities = function(str,ent) return entityconverter(id,str,ent) end, -- needed for mathml currentresource = tostring(currentresource or id), } if compress and compress == variables.yes then @@ -1617,44 +1617,81 @@ end -- -- no need for an assignment so: -function lxml.att(id,a,default) - local e = getid(id) - if e then - local at = e.at - if at then - -- normally always true - local str = at[a] - if not str then - if default and default ~= "" then - contextsprint(notcatcodes,default) +-- function lxml.att(id,a,default) +-- local e = getid(id) +-- if e then +-- local at = e.at +-- if at then +-- -- normally always true +-- local str = at[a] +-- if not str then +-- if default and default ~= "" then +-- contextsprint(notcatcodes,default) +-- end +-- elseif str ~= "" then +-- contextsprint(notcatcodes,str) +-- else +-- -- explicit empty is valid +-- end +-- elseif default and default ~= "" then +-- contextsprint(notcatcodes,default) +-- end +-- elseif default and default ~= "" then +-- contextsprint(notcatcodes,default) +-- end +-- end + +do + + local att + + function lxml.att(id,a,default) + local e = getid(id) + if e then + local at = e.at + if at then + -- normally always true + att = at[a] + if not att then + if default and default ~= "" then + att = default + contextsprint(notcatcodes,default) + end + elseif att ~= "" then + contextsprint(notcatcodes,att) + else + -- explicit empty is valid end - elseif str ~= "" then - contextsprint(notcatcodes,str) - else - -- explicit empty is valid + elseif default and default ~= "" then + att = default + contextsprint(notcatcodes,default) end elseif default and default ~= "" then + att = default contextsprint(notcatcodes,default) end - elseif default and default ~= "" then - contextsprint(notcatcodes,default) end -end -function lxml.refatt(id,a) - local e = getid(id) - if e then - local at = e.at - if at then - local str = at[a] - if str and str ~= "" then - str = gsub(str,"^#+","") - if str ~= "" then - contextsprint(notcatcodes,str) + function lxml.refatt(id,a) + local e = getid(id) + if e then + local at = e.at + if at then + att = at[a] + if str and str ~= "" then + str = gsub(str,"^#+","") + if str ~= "" then + contextsprint(notcatcodes,str) + end end end end end + + function lxml.lastatt() + contextsprint(notcatcodes,att) + end + end function lxml.name(id) -- or remapped name? -> lxml.info, combine diff --git a/tex/context/base/mkiv/pack-mrl.mkiv b/tex/context/base/mkiv/pack-mrl.mkiv index e8f89da8e..39e1f4086 100644 --- a/tex/context/base/mkiv/pack-mrl.mkiv +++ b/tex/context/base/mkiv/pack-mrl.mkiv @@ -353,8 +353,8 @@ \directthinrulesparameter\c!before \scratchcounter\directthinrulesparameter\c!n\relax \dorecurse\scratchcounter - {\ifnum\recurselevel=\scratchcounter \penalty500 \else - \ifnum\recurselevel=\plustwo \penalty500 \fi\fi + {\ifnum\recurselevel=\scratchcounter \directvspacing\v!samepage \else % \penalty500 + \ifnum\recurselevel=\plustwo \directvspacing\v!samepage \fi\fi % \penalty500 \thinrule \ifnum\recurselevel<\scratchcounter\relax % test needed, else messed up whitespace diff --git a/tex/context/base/mkiv/pack-rul.lua b/tex/context/base/mkiv/pack-rul.lua index 32cd9738e..427a2d11d 100644 --- a/tex/context/base/mkiv/pack-rul.lua +++ b/tex/context/base/mkiv/pack-rul.lua @@ -181,7 +181,7 @@ end implement { name = "doreshapeframedbox", actions = doreshapeframedbox, arguments = "integer" } implement { name = "doanalyzeframedbox", actions = doanalyzeframedbox, arguments = "integer" } -function nodes.maxboxwidth(box) +local function maxboxwidth(box) local boxwidth = getfield(box,"width") if boxwidth == 0 then return 0 @@ -219,4 +219,13 @@ function nodes.maxboxwidth(box) for v in traverse_id(vlist_code,list) do -- no dir etc needed check(v,false) end + return maxwidth end + +nodes.maxboxwidth = maxboxwidth + +implement { + name = "themaxboxwidth", + actions = function(n) context("%isp",maxboxwidth(getbox(n))) end, + arguments = "integer" +} diff --git a/tex/context/base/mkiv/pack-rul.mkiv b/tex/context/base/mkiv/pack-rul.mkiv index 9737fb288..0d6ab20bd 100644 --- a/tex/context/base/mkiv/pack-rul.mkiv +++ b/tex/context/base/mkiv/pack-rul.mkiv @@ -3052,4 +3052,13 @@ \c!foregroundstyle=\framedparameter\c!style, \c!foregroundcolor=\framedparameter\c!color] +%D Bonus (as defined in \type {pack-rul.lua}): +%D +%D \starttyping +%D \setbox\scratchbox\vbox{a\par aa\par aaa\par} +%D \the\dimexpr\themaxboxwidth\scratchbox\relax +%D \stoptyping + +\let\themaxboxwidth\clf_themaxboxwidth + \protect \endinput diff --git a/tex/context/base/mkiv/page-set.mkiv b/tex/context/base/mkiv/page-set.mkiv index 6a3d550bd..fab6bc086 100644 --- a/tex/context/base/mkiv/page-set.mkiv +++ b/tex/context/base/mkiv/page-set.mkiv @@ -1170,10 +1170,15 @@ \page_set_command_set_vsize} \def\OTRSETcheckprefered - {\ifnum\floatcolumn<\mofcolumns + {\ifx\floatcolumn\empty + \let\pofcolumns\nofcolumns + \else\ifnum\floatcolumn<\mofcolumns \let\pofcolumns\mofcolumns \else \let\pofcolumns\floatcolumn + \fi\fi + \ifx\floatrow\empty + \let\pofcolumns\plusone \fi \ifquitincurrentcolumn \ifnum\mofcolumns=\nofcolumns diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 0950af5fd..10a5fd251 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex f3c2a95fd..bda7542f2 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-flt.mkvi b/tex/context/base/mkiv/strc-flt.mkvi index ff06b4609..334d98a93 100644 --- a/tex/context/base/mkiv/strc-flt.mkvi +++ b/tex/context/base/mkiv/strc-flt.mkvi @@ -2043,6 +2043,9 @@ % \let\floatrow \empty % \setfloatmethodvariables\floatlocation % todo: nog algemeen otr +% \ifdefined\OTRSETsetpreferedcolumnslot +% \OTRSETsetpreferedcolumnslot\floatcolumn\floatrow +% \fi \ifcsname\??floatmethods\currentoutputroutine:\floatmethod\endcsname \else \let\floatmethod\v!here \fi diff --git a/tex/context/base/mkiv/strc-syn.mkiv b/tex/context/base/mkiv/strc-syn.mkiv index 28d418751..72c94d069 100644 --- a/tex/context/base/mkiv/strc-syn.mkiv +++ b/tex/context/base/mkiv/strc-syn.mkiv @@ -322,6 +322,9 @@ \unexpanded\def\resetusedsynonyms [#1]{\clf_resetusedsynonyms {#1}} \unexpanded\def\resetshownsynonyms [#1]{\clf_resetshownsynonyms {#1}} +\let\rawsynonymname \clf_synonymname +\let\rawsynonymmeaning\clf_synonymmeaning + \installcorenamespace{simplelistalternative} % specific ways of rendering a list \installcorenamespace{simplelistrenderings} % a namespace for setups (rather local) |