summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-08-30 17:21:31 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-08-30 17:21:31 +0200
commit65bc427dff7ea819abb9b38a0407026baf13a0cc (patch)
tree6536fd752b3b52a504b274f20b1f58def4455910 /tex
parent59dfd8f21ca1a5c793a89b6af87a28df5a78a3d3 (diff)
downloadcontext-65bc427dff7ea819abb9b38a0407026baf13a0cc.tar.gz
2021-08-30 16:23:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-pe.mkii1
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-hsh.lua22
-rw-r--r--tex/context/base/mkiv/font-syn.lua21
-rw-r--r--tex/context/base/mkiv/grph-fil.lua5
-rw-r--r--tex/context/base/mkiv/l-file.lua2
-rw-r--r--tex/context/base/mkiv/math-fbk.lua20
-rw-r--r--tex/context/base/mkiv/mult-low.lua2
-rw-r--r--tex/context/base/mkiv/mult-prm.lua4
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24877 -> 24895 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin250465 -> 250909 bytes
-rw-r--r--tex/context/base/mkiv/strc-mar.lua2
-rw-r--r--tex/context/base/mkxl/anch-pos.lmt127
-rw-r--r--tex/context/base/mkxl/buff-ini.lmt20
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/driv-shp.lmt10
-rw-r--r--tex/context/base/mkxl/math-ali.mkxl46
-rw-r--r--tex/context/base/mkxl/mult-sys.mkxl2
-rw-r--r--tex/context/base/mkxl/node-ali.lmt285
-rw-r--r--tex/context/base/mkxl/node-nut.lmt1
-rw-r--r--tex/context/base/mkxl/node-pro.lmt14
-rw-r--r--tex/context/base/mkxl/node-res.lmt13
-rw-r--r--tex/context/base/mkxl/node-tsk.lmt51
-rw-r--r--tex/context/base/mkxl/pack-com.mkxl9
-rw-r--r--tex/context/base/mkxl/strc-ref.mklx2
-rw-r--r--tex/context/base/mkxl/syst-aux.mkxl71
-rw-r--r--tex/context/base/mkxl/syst-ini.mkxl2
-rw-r--r--tex/context/base/mkxl/tabl-com.mkxl24
-rw-r--r--tex/context/base/mkxl/tabl-tab.mkxl12
-rw-r--r--tex/context/base/mkxl/tabl-tbl.mkxl87
-rw-r--r--tex/context/base/mkxl/task-ini.lmt6
-rw-r--r--tex/context/base/mkxl/trac-vis.lmt5
-rw-r--r--tex/context/base/mkxl/typo-wrp.lmt81
-rw-r--r--tex/context/base/mkxl/typo-wrp.mkxl20
-rw-r--r--tex/context/interface/mkii/keys-pe.xml1
-rw-r--r--tex/context/sample/common/cuomo.tex17
-rw-r--r--tex/context/sample/common/pluto.xml44
-rw-r--r--tex/context/sample/common/samples.tex2
-rw-r--r--tex/context/sample/common/stork.tex24
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua4
44 files changed, 887 insertions, 184 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index d291b3d4a..81b839988 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2021.08.24 22:14}
+\newcontextversion{2021.08.30 16:21}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 3d7db5756..0974ce519 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.08.24 22:14}
+\edef\contextversion{2021.08.30 16:21}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii
index 0395abe44..0dc7edb31 100644
--- a/tex/context/base/mkii/mult-pe.mkii
+++ b/tex/context/base/mkii/mult-pe.mkii
@@ -151,6 +151,7 @@
\setinterfacevariable{commands}{فرمانها}
\setinterfacevariable{comment}{توضیح}
\setinterfacevariable{component}{مولفه}
+\setinterfacevariable{compress}{compress}
\setinterfacevariable{compressseparator}{compressseparator}
\setinterfacevariable{compressstopper}{compressstopper}
\setinterfacevariable{concept}{مفهوم}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 07e1b0334..6f5333832 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.08.24 22:14}
+\newcontextversion{2021.08.30 16:21}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index cb4cae649..7226ee7b2 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.08.24 22:14}
+\edef\contextversion{2021.08.30 16:21}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-hsh.lua b/tex/context/base/mkiv/font-hsh.lua
index 7e90e1502..89b0dc823 100644
--- a/tex/context/base/mkiv/font-hsh.lua
+++ b/tex/context/base/mkiv/font-hsh.lua
@@ -37,6 +37,7 @@ local italics = hashes.italics or allocate()
local lastmathids = hashes.lastmathids or allocate()
local dynamics = hashes.dynamics or allocate()
local unicodes = hashes.unicodes or allocate()
+local unislots = hashes.unislots or allocate()
local originals = hashes.originals or allocate()
local modes = hashes.modes or allocate()
local variants = hashes.variants or allocate()
@@ -59,12 +60,13 @@ hashes.italics = italics
hashes.lastmathids = lastmathids
hashes.dynamics = dynamics
hashes.unicodes = unicodes
+hashes.unislots = unislots
hashes.originals = originals
hashes.modes = modes
hashes.variants = variants
-local nodepool = nodes and nodes.pool
-local dummyglyph = nodepool and nodepool.register(nodepool.glyph())
+local nodepool = nodes and nodes.pool
+local dummyglyph = nodepool and nodepool.register(nodepool.glyph())
local nulldata = allocate {
name = "nullfont",
@@ -343,6 +345,22 @@ setmetatableindex(originals, function(t,k) -- always a unicode
end
end)
+setmetatableindex(unislots, function(t,k)
+ if k == true then
+ return unislots[currentfont()]
+ else
+ local characters = identifiers[k].characters
+ local resolved = setmetatableindex(function(t,k)
+ local c = characters[k]
+ local v = c and c.unicode or 0xFFFD
+ t[k] = v
+ return v -- can be a table !
+ end)
+ t[k] = resolved
+ return resolved
+ end
+end)
+
setmetatableindex(modes, function(t,k)
if k == true then
return modes[currentfont()]
diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua
index 1d5e18032..e80d57f41 100644
--- a/tex/context/base/mkiv/font-syn.lua
+++ b/tex/context/base/mkiv/font-syn.lua
@@ -1408,13 +1408,30 @@ here is for testing purposes only (it deals with names prefixed by an
encoding name).</p>
--ldx]]--
-local function fuzzy(mapping,sorted,name,sub)
+local function fuzzy(mapping,sorted,name,sub) -- no need for reverse sorted here
local condensed = gsub(name,"[^%a%d]","")
+ local pattern = condensed .. "$"
+ local matches = false
for k=1,#sorted do
local v = sorted[k]
- if find(v,condensed) then
+ if v == condensed then
return mapping[v], v
+ elseif find(v,pattern) then
+ return mapping[v], v
+ elseif find(v,condensed) then
+ if matches then
+ matches[#matches+1] = v
+ else
+ matches = { v }
+ end
+ end
+ end
+ if matches then
+ if #matches > 1 then
+ sort(matches,function(a,b) return #a < #b end)
end
+ matches = matches[1]
+ return mapping[matches], matches
end
end
diff --git a/tex/context/base/mkiv/grph-fil.lua b/tex/context/base/mkiv/grph-fil.lua
index aad110e1c..4de30cd30 100644
--- a/tex/context/base/mkiv/grph-fil.lua
+++ b/tex/context/base/mkiv/grph-fil.lua
@@ -141,14 +141,13 @@ end
local done = { }
local function analyzed(name,options)
- local actiontype = type(action)
local usedname = addsuffix(name,inputsuffix) -- we assume tex if not set
local resultname = replacesuffix(name,resultsuffix) -- we assume tex if not set
local pathname = file.pathpart(usedname)
local runpath = environment.arguments.path -- sic, no runpath
if pathname ~= "" then
if runpath then
- runpath = file.join(action.path,pathname)
+ runpath = file.join(runpath,pathname)
else
runpath = pathname
end
@@ -156,7 +155,7 @@ local function analyzed(name,options)
end
return {
options = options,
- path = runpath,
+ path = runpath, -- or nil
filename = usedname,
result = resultname,
}
diff --git a/tex/context/base/mkiv/l-file.lua b/tex/context/base/mkiv/l-file.lua
index d0af94f09..9f8fd6548 100644
--- a/tex/context/base/mkiv/l-file.lua
+++ b/tex/context/base/mkiv/l-file.lua
@@ -456,7 +456,7 @@ function file.join(one, two, three, ...)
if not two then
return one == "" and one or lpegmatch(reslasher,one)
end
- if one == "" then
+ if not one or one == "" then
return lpegmatch(stripper,three and concat({ two, three, ... },"/") or two)
end
if lpegmatch(isnetwork,one) then
diff --git a/tex/context/base/mkiv/math-fbk.lua b/tex/context/base/mkiv/math-fbk.lua
index 6b43a901b..f1efadc45 100644
--- a/tex/context/base/mkiv/math-fbk.lua
+++ b/tex/context/base/mkiv/math-fbk.lua
@@ -601,9 +601,11 @@ local function actuarian(data)
return {
-- todo: add alttext
-- compromise: lm has large hooks e.g. \actuarial{a}
- width = basewidth + 4 * linewidth,
- unicode = 0x20E7,
- commands = {
+ width = basewidth + 4 * linewidth,
+ height = basechar.height,
+ depth = basechar.depth,
+ unicode = 0x20E7,
+ commands = {
rightcommand[2 * linewidth],
downcommand[- baseheight - 3 * linewidth],
{ "rule", linewidth, basewidth + 4 * linewidth },
@@ -623,13 +625,15 @@ local function equals(data,unicode,snippet,advance,n) -- mathpair needs them
local basechar = characters[snippet]
local advance = advance * parameters.quad
return {
- unicode = unicode,
- width = n*basechar.width + (n-1)*advance,
- commands = {
+ unicode = unicode,
+ width = n*basechar.width - (n-1)*advance,
+ height = basechar.height,
+ depth = basechar.depth,
+ commands = {
charcommand[snippet],
- rightcommand[advance],
+ leftcommand[advance],
charcommand[snippet],
- n > 2 and rightcommand[advance] or nil,
+ n > 2 and leftcommand[advance] or nil,
n > 2 and charcommand[snippet] or nil,
},
}
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 5075ec579..4842a3571 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -450,6 +450,8 @@ return {
"strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight",
"leftboundary", "rightboundary", "signalcharacter",
--
+ "aligncontentleft", "aligncontentmiddle", "aligncontentright",
+ --
"shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox",
--
"ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 6b88ba3b2..81afd645b 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -371,6 +371,7 @@ return {
"ifdimval",
"ifempty",
"ifflags",
+ "ifhaschar",
"ifhastok",
"ifhastoks",
"ifhasxtoks",
@@ -497,6 +498,7 @@ return {
"snapshotpar",
"supmarkmode",
"swapcsvalues",
+ "tabsize",
"textdirection",
"thewithoutunit",
"tokenized",
@@ -651,6 +653,7 @@ return {
"advance",
"afterassignment",
"aftergroup",
+ "aligncontent",
"atop",
"atopwithdelims",
"badness",
@@ -837,7 +840,6 @@ return {
"nolimits",
"nonscript",
"nonstopmode",
- "nonzerowidthkern",
"nulldelimiterspace",
"nullfont",
"number",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 20bdd73ba..833f69b1d 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 2a6018336..ded84acc1 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-mar.lua b/tex/context/base/mkiv/strc-mar.lua
index f7953c416..dd6c0a93d 100644
--- a/tex/context/base/mkiv/strc-mar.lua
+++ b/tex/context/base/mkiv/strc-mar.lua
@@ -43,7 +43,7 @@ local lateluawhatsit_code = whatsitcodes.latelua
local texsetattribute = tex.setattribute
-local a_marks = attributes.private("structure","marks")
+local a_marks = attributes.private("marks")
local trace_set = false trackers.register("marks.set", function(v) trace_set = v end)
local trace_get = false trackers.register("marks.get", function(v) trace_get = v end)
diff --git a/tex/context/base/mkxl/anch-pos.lmt b/tex/context/base/mkxl/anch-pos.lmt
index fdb71ceb9..4900df683 100644
--- a/tex/context/base/mkxl/anch-pos.lmt
+++ b/tex/context/base/mkxl/anch-pos.lmt
@@ -282,83 +282,84 @@ if treemode then
-- todo: use a raw collected and a weak proxy
--
setmetatableindex(collected,function(t,k)
- local prefix, one, two = lpegmatch(p_splitter,k)
- local list = rawget(t,prefix)
- if list and type(list) == "table" then
- local v = list[one] or false
- if v then
- if prefix == "p" then
- if deltapacking and type(v) == "number" then
- for i=one,1,-1 do
- local l = list[i]
- if type(l) ~= "number" then
- if not getmetatable(l) then
- checkcommondata(l,x_h_d_hs_list)
+ if k ~= true then
+ local prefix, one, two = lpegmatch(p_splitter,k)
+ local list = rawget(t,prefix)
+ if list and type(list) == "table" then
+ local v = list[one] or false
+ if v then
+ if prefix == "p" then
+ if deltapacking and type(v) == "number" then
+ for i=one,1,-1 do
+ local l = list[i]
+ if type(l) ~= "number" then
+ if not getmetatable(l) then
+ checkcommondata(l,x_h_d_hs_list)
+ end
+ v = setmetatable({ y = v }, { __index = l })
+ list[one] = v
+ break
end
- v = setmetatable({ y = v }, { __index = l })
- list[one] = v
- break
end
+ else
+ checkcommondata(v,x_h_d_hs_list)
end
- else
- checkcommondata(v,x_h_d_hs_list)
- end
- elseif prefix == "text" or prefix == "textarea" then
- if type(v) == "number" then
- for i=one,1,-1 do
- local l = list[i]
- if type(l) ~= "number" then
- if not getmetatable(l) then
- checkcommondata(l,x_y_w_h_list)
+ elseif prefix == "text" or prefix == "textarea" then
+ if type(v) == "number" then
+ for i=one,1,-1 do
+ local l = list[i]
+ if type(l) ~= "number" then
+ if not getmetatable(l) then
+ checkcommondata(l,x_y_w_h_list)
+ end
+ v = setmetatable({ p = p }, { __index = l })
+ list[one] = v
+ break
end
- v = setmetatable({ p = p }, { __index = l })
- list[one] = v
- break
end
+ else
+ checkcommondata(v,x_y_w_h_list)
end
+ elseif prefix == "columnarea" then
+ if not columndone then
+ checkcommondata(v,y_w_h_d_list)
+ end
+ elseif prefix == "syncpos" then
+ -- will become an error
+ if two then
+ -- v = syncdata[one][two] or { }
+ v = v[two] or { }
+ else
+ v = { }
+ end
+ -- for j=1,#v do
+ -- checkcommondata(v[j],x_h_d_list)
+ -- end
+ elseif prefix == "free" then
+ -- will become an error
+ elseif prefix == "page" then
+ checkcommondata(v)
else
- checkcommondata(v,x_y_w_h_list)
- end
- elseif prefix == "columnarea" then
- if not columndone then
- checkcommondata(v,y_w_h_d_list)
- end
- elseif prefix == "syncpos" then
- -- will become an error
- if two then
- -- v = syncdata[one][two] or { }
- v = v[two] or { }
- else
- v = { }
+ checkcommondata(v)
end
- -- for j=1,#v do
- -- checkcommondata(v[j],x_h_d_list)
- -- end
- elseif prefix == "free" then
- -- will become an error
- elseif prefix == "page" then
- checkcommondata(v)
else
- checkcommondata(v)
- end
- else
- if prefix == "page" then
- for i=one,1,-1 do
- local data = list[i]
- if data then
- v = setmetatableindex({ free = free or false, p = p },last)
- list[one] = v
- break
+ if prefix == "page" then
+ for i=one,1,-1 do
+ local data = list[i]
+ if data then
+ v = setmetatableindex({ free = free or false, p = p },last)
+ list[one] = v
+ break
+ end
end
end
end
+ t[k] = v
+ return v
end
- t[k] = v
- return v
- else
- t[k] = false
- return false
end
+ t[k] = false
+ return false
end)
--
setmetatableindex(tobesaved,function(t,k)
diff --git a/tex/context/base/mkxl/buff-ini.lmt b/tex/context/base/mkxl/buff-ini.lmt
index a646962e5..0b54f81ac 100644
--- a/tex/context/base/mkxl/buff-ini.lmt
+++ b/tex/context/base/mkxl/buff-ini.lmt
@@ -427,16 +427,16 @@ local function pickup(start,stop)
local list = { }
local size = 0
local depth = 0
--- local done = 32
+ -- local done = 32
local scancode = experiment and scantokencode or scancode
while true do -- or use depth
local char = scancode()
if char then
--- if char < done then
--- -- we skip leading control characters so that we can use them to
--- -- obey spaces (a dirty trick)
--- else
--- done = 0
+ -- if char < done then
+ -- -- we skip leading control characters so that we can use them to
+ -- -- obey spaces (a dirty trick)
+ -- else
+ -- done = 0
char = utfchar(char)
size = size + 1
list[size] = char
@@ -473,7 +473,7 @@ local function pickup(start,stop)
depth = depth + 1
end
end
--- end
+ -- end
else
-- local t = scantoken()
local t = gettoken()
@@ -485,7 +485,7 @@ local function pickup(start,stop)
if char then
size = size + 1 ; list[size] = char
else
--- local csname = getcsname(t)
+ -- local csname = getcsname(t)
local csname = scancsname(t)
if csname == stop then
stoplength = 0
@@ -598,8 +598,8 @@ end
-- if char then
-- size = size + 1 ; list[size] = char
-- else
--- local csname = getcsname(t)
- local csname = scancsname(t)
+-- -- local csname = getcsname(t)
+-- local csname = scancsname(t)
-- if csname == stop then
-- stoplength = 0
-- break
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 260197997..0ae1cfbff 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.08.24 22:14}
+\newcontextversion{2021.08.30 16:21}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index d49770402..c965778c8 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2021.08.24 22:14}
+\immutable\edef\contextversion{2021.08.30 16:21}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt
index d84ecbcbc..f0d037564 100644
--- a/tex/context/base/mkxl/driv-shp.lmt
+++ b/tex/context/base/mkxl/driv-shp.lmt
@@ -147,6 +147,8 @@ local flush_character do
local vfinjectors = fonts.helpers.vfinjectors
+ -- current can go
+
local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,factor,vfcommands,sx,sy)
if nesting > 100 then
return
@@ -161,7 +163,7 @@ local flush_character do
local saved_r = pos_r
pos_r = lefttoright_code
- local data = fontdata[font]
+ local data = fontdata[font] -- hm, so why pass data
local fnt = font
local fonts = data.fonts
local siz = (data.parameters.factor or 1)/65536
@@ -186,7 +188,8 @@ local flush_character do
if fnt == 0 then
fnt = main
end
- return flush_character(current,fnt,chr,factor,nest,pos_h,pos_v,pos_r,f,e)
+ -- here no current!
+ return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,f,e)
else
return 0
end
@@ -682,7 +685,8 @@ local hlist_out, vlist_out do
pos_v = pos_v + raise
pos_h = pos_h - left
local wd = flush_character(current,font,char,false,true,pos_h,pos_v,pos_r)
- cur_h = cur_h + wd - right -- hm, no left here?
+-- cur_h = cur_h + wd - right -- hm, no left here?
+cur_h = cur_h + wd -- see new tabulate alignment code
elseif id == glue_code then
local gluewidth = effectiveglue(current,this_box)
if gluewidth ~= 0 then
diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl
index f4294a978..cf941b586 100644
--- a/tex/context/base/mkxl/math-ali.mkxl
+++ b/tex/context/base/mkxl/math-ali.mkxl
@@ -92,9 +92,9 @@
\ialign{%
\strut
\hfil
- \startforceddisplaymath{\alignmark\alignmark}\stopforceddisplaymath
+ \startforceddisplaymath{\aligncontent}\stopforceddisplaymath
\aligntab
- \startforceddisplaymath{{}\alignmark\alignmark{}}\stopforceddisplaymath
+ \startforceddisplaymath{{}\aligncontent{}}\stopforceddisplaymath
\hfil\crcr
#1\crcr}%
}%
@@ -110,13 +110,13 @@
{\t_math_align_a
{\strut
\tabskip\zeropoint
- \alignmark\alignmark % for picking up the number
+ \aligncontent % for picking up the number
\aligntab
\math_first_in_eqalign
\hfil
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\t_math_align_b
@@ -124,7 +124,7 @@
\math_next_in_eqalign
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\ifnum\mathraggedstatus=\plusone
@@ -132,7 +132,7 @@
{\hfil
\aligntab
\span
- \math_text_in_eqalign{\alignmark\alignmark}%
+ \math_text_in_eqalign{\aligncontent}%
\tabskip\zeropoint}%
\orelse\ifnum\mathraggedstatus=\plusthree
\t_math_align_c
@@ -140,7 +140,7 @@
\tabskip\zeropoint\s!plus 1\s!fill
\aligntab
\span
- \math_text_in_eqalign{\alignmark\alignmark}%
+ \math_text_in_eqalign{\aligncontent}%
\tabskip\zeropoint}%
\else
\t_math_align_c
@@ -148,7 +148,7 @@
\tabskip\centering
\aligntab
\span
- \llap{\math_text_in_eqalign{\alignmark\alignmark}}%
+ \llap{\math_text_in_eqalign{\aligncontent}}%
\tabskip\zeropoint}%
\fi
\math_build_eqalign
@@ -159,13 +159,13 @@
{\t_math_align_a
{\strut
\tabskip\zeropoint
- \alignmark\alignmark % for picking up the number
+ \aligncontent % for picking up the number
\aligntab
\math_first_in_eqalign
\hfil
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\t_math_align_b
@@ -173,7 +173,7 @@
\math_next_in_eqalign
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\ifnum\mathraggedstatus=\plusone
@@ -182,7 +182,7 @@
\aligntab
\kern-\displaywidth
\span
- \rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
+ \rlap{\math_text_in_eqalign{\aligncontent}}
\tabskip\displaywidth}%
\orelse\ifnum\mathraggedstatus=\plusthree
\t_math_align_c
@@ -191,7 +191,7 @@
\aligntab
\kern-\displaywidth
\span
- \math_rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
+ \math_rlap{\math_text_in_eqalign{\aligncontent}}%
\tabskip\displaywidth}%
\else
\t_math_align_c
@@ -200,7 +200,7 @@
\aligntab
\kern-\displaywidth
\span
- \rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
+ \rlap{\math_text_in_eqalign{\aligncontent}}%
\tabskip\displaywidth}%
\fi
\math_build_eqalign
@@ -736,19 +736,19 @@
% \halign\bgroup
% \startimath
% \mathcasesparameter\c!style
-% \alignmark\alignmark
+% \aligncontent
% \stopimath
% \hfil
% \aligntab
% \hskip\mathcasesparameter\c!distance\relax
% \pop_macro_math_cases_NC
% \math_cases_strut % looks better
-% \alignmark\alignmark
+% \aligncontent
% \hfil
% \aligntab
% \hskip\mathcasesparameter\c!numberdistance\relax
% % \let\formuladistance\!!zeropoint
-% \span\math_text_in_eqalign{\alignmark\alignmark}%
+% \span\math_text_in_eqalign{\aligncontent}%
% \crcr} % todo: number
%
% % When we have just protected we get an extra row but we can no flag
@@ -848,17 +848,17 @@
\halign\bgroup
\ifmmode\else\startimath\fi
\mathcasesparameter\c!style
- \alignmark\alignmark
+ \aligncontent
\ifmmode\stopimath\fi
\hfil
\aligntab
\hskip\mathcasesparameter\c!distance\relax
\math_cases_strut % looks better
- \alignmark\alignmark
+ \aligncontent
\hfil
\aligntab
\hskip\mathcasesparameter\c!numberdistance\relax
- \span\math_text_in_eqalign{\alignmark\alignmark}%
+ \span\math_text_in_eqalign{\aligncontent}%
\crcr} % todo: number
\noaligned\permanent\protected\def\math_cases_stop
@@ -1047,14 +1047,14 @@
\math_matrix_distance_first
\global\advance\c_math_eqalign_column\plusone
\math_matrix_start_cell
- \alignmark\alignmark
+ \aligncontent
\math_matrix_stop_cell
\aligntab
\aligntab
\math_matrix_distance
\global\advance\c_math_eqalign_column\plusone
\math_matrix_start_cell
- \alignmark\alignmark
+ \aligncontent
\math_matrix_stop_cell}
\permanent\protected\def\math_matrix_NR
@@ -1509,7 +1509,7 @@
\enforced\let\NC\relax
\enforced\let\MC\relax
\enforced\let\NR\crcr
- \halign\bgroup\hfil\normalstartimath\scriptstyle\alignmark\alignmark\normalstopimath\hfil\crcr}
+ \halign\bgroup\hfil\normalstartimath\scriptstyle\aligncontent\normalstopimath\hfil\crcr}
\noaligned\permanent\protected\def\stopsubstack
{\crcr
diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl
index 6b8379753..11b9f9cb9 100644
--- a/tex/context/base/mkxl/mult-sys.mkxl
+++ b/tex/context/base/mkxl/mult-sys.mkxl
@@ -131,6 +131,7 @@
\definesystemconstant {bp}
\definesystemconstant {bs}
\definesystemconstant {b}
+\definesystemconstant {callback}
\definesystemconstant {calligraphy}
\definesystemconstant {Calligraphy}
\definesystemconstant {Caps}
@@ -283,6 +284,7 @@
\definesystemconstant {noheight}
\definesystemconstant {nomath}
\definesystemconstant {none}
+\definesystemconstant {noskips}
\definesystemconstant {normal}
\definesystemconstant {Normal}
\definesystemconstant {nowidth}
diff --git a/tex/context/base/mkxl/node-ali.lmt b/tex/context/base/mkxl/node-ali.lmt
new file mode 100644
index 000000000..0a7cf30ce
--- /dev/null
+++ b/tex/context/base/mkxl/node-ali.lmt
@@ -0,0 +1,285 @@
+if not modules then modules = { } end modules ['node-ali'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local a_alignchar = attributes.private("aligncharacter")
+
+local nuts = nodes.nuts
+local tonut = nuts.tonut
+local tonode = nuts.tonode
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+local getid = nuts.getid
+local getattr = nuts.getattr
+local setnext = nuts.setnext
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local setglue = nuts.setglue
+local getglue = nuts.getglue
+local getlist = nuts.getlist
+local setlist = nuts.setlist
+local setattrlist = nuts.setattrlist
+local getchar = nuts.getchar
+local addmargins = nuts.addmargins
+local findtail = nuts.tail
+local hasglyph = nuts.hasglyph
+local getwordrange = nuts.getwordrange
+local dimensions = nuts.rangedimensions
+local nextrecord = nuts.traversers.alignrecord
+local nextunset = nuts.traversers.unset
+local nextglyph = nuts.traversers.glyph
+local nextglue = nuts.traversers.glue
+local nextnode = nuts.traversers.node
+local prevnode = nuts.treversers.node
+local flushnode = nuts.flush
+local hpack = nuts.hpack
+
+local glyph_code = nodes.nodecodes.glyph
+local glue_code = nodes.nodecodes.glue
+local kern_code = nodes.nodecodes.kern
+local disc_code = nodes.nodecodes.disc
+
+local spaceskip_code = nodes.gluecodes.spaceskip
+local xspaceskip_code = nodes.gluecodes.xspaceskip
+local fontkern_code = nodes.kerncodes.fontkern
+
+local newkern = nuts.pool.kern
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+
+-- todo statistics and tracing
+
+local method = 2
+local unislots = fonts.hashes.unislots -- todo
+local chardata = fonts.hashes.characters
+
+function nodes.handlers.aligncharacter(head,attr,preamble)
+ local attr = getattr(attr,a_alignchar) -- 1 : value doesn't matter (for now)
+ if attr then
+ local widths = { }
+ local data = { }
+ local rows = 0
+ local cols = 0
+ for col in nextrecord, preamble do
+ cols = cols + 1
+ local w, s = getwidth(col,true)
+ widths[cols] = { col, w, s }
+ end
+ --
+ for row in nextunset, head do
+ rows = rows + 1
+ local c = 0
+ local d = { }
+ data[rows] = d
+ for col in nextunset, getlist(row) do
+ c = c + 1
+ if widths[c][2] then
+ local list = getlist(col)
+ -- if method == 1 then
+ -- local left = nil
+ -- local right = nil
+ -- local middle = nil
+ -- for g, char in nextglyph, list do
+ -- if not left then
+ -- left = g
+ -- end
+ -- if char == getattr(g,a_alignchar) then
+ -- middle = g
+ -- end
+ -- right = g
+ -- end
+ -- d[c] = middle and { col, left, middle, right, 0, 0, getwidth(middle) } or false
+ -- elseif method == 2 then
+ local middle = nil
+ -- we can either cache unislots or we can cache for this font
+ for g, char, font in nextglyph, list do
+ local unicode = getattr(g,a_alignchar)
+ if unicode then
+ if char == unicode then
+ middle = g
+ elseif unislots[font][char] == unicode then
+ middle = g
+ end
+ end
+ end
+ if middle then
+ local left, right = getwordrange(middle) -- not real gain but handy anyway (less code too)
+ -- local left = middle
+ -- local right = middle
+ -- for g, id, subtype in nextnode, middle do
+ -- if id == glyph_code or id == disc_code then
+ -- right = g
+ -- elseif id == kern_code and subtype == fontkern_code then
+ -- right = g
+ -- else
+ -- break
+ -- end
+ -- end
+ -- for g, id, subtype in prevnode, middle do
+ -- if id == glyph_code or id == disc_code then
+ -- left = g
+ -- elseif id == kern_code and subtype == fontkern_code then
+ -- left = g
+ -- else
+ -- break
+ -- end
+ -- end
+ d[c] = { col, left, middle, right, 0, 0, getwidth(middle) }
+ else
+ d[c] = false
+ end
+ -- else
+ -- local middle = nil
+ -- for g, char in nextglyph, list do
+ -- if char == getattr(g,a_alignchar) then
+ -- middle = g
+ -- end
+ -- end
+ -- if middle then
+ -- local left = list
+ -- local right = findtail(list)
+ -- if getid(left) == glue_code then
+ -- left = getnext(left)
+ -- end
+ -- if getid(right) == glue_code then
+ -- right = getprev(right)
+ -- end
+ -- d[c] = { col, left, middle, right, 0, 0, getwidth(middle) }
+ -- else
+ -- d[c] = false
+ -- end
+ -- end
+ else
+ d[c] = false
+ end
+ end
+ end
+ --
+ for col=1,cols do
+ local maxl = 0
+ local maxr = 0
+ local minm = 0
+ local maxm = 0
+ local colw = widths[col]
+ for row=1,rows do
+ local d = data[row][col]
+ if d then
+ local p = d[1]
+ local l = d[2]
+ local m = d[3]
+ local r = d[4]
+ if m then
+ local lw = l == m and 0 or dimensions(p,l,m)
+ local rw = m == r and 0 or dimensions(p,getnext(m),getnext(r))
+ d[5] = lw
+ d[6] = rw
+ if lw > maxl then
+ maxl = lw
+ end
+ if rw > maxr then
+ maxr = rw
+ end
+ local mw = d[7]
+ if maxm == 0 then
+ minm = mw
+ maxm = mw
+ else
+ if mw > maxm then
+ maxm = mw
+ end
+ if mw < minm then
+ minm = mw
+ end
+ end
+ end
+ end
+ end
+ --
+ local fixedwidth = colw[3] ~= 0
+ --
+ local old = colw[2]
+ local new = old
+ for row=1,rows do
+ local d = data[row][col]
+ if d then
+ local p = d[1]
+ local l = d[2]
+ local m = d[3]
+ local r = d[4]
+ if l and m and r then
+ local lw = d[5]
+ local rw = d[6]
+ local mw = d[7]
+ dl = maxl - lw
+ dr = maxr - rw
+ if dl ~= 0 or dr ~= 0 or mw ~= maxm then
+ local lst = getlist(p)
+ local wid = getwidth(p)
+ if dl ~= 0 then
+ local k = newkern(dl)
+ lst = insertbefore(lst,l,k)
+ setattrlist(k,m)
+ setlist(p,lst)
+ wid = wid + dl
+ end
+ if dr ~= 0 then
+ local k = newkern(dr)
+ insertafter(lst,r,k)
+ setattrlist(k,m)
+ wid = wid + dr
+ end
+ if mw ~= maxm then
+ local dw = (maxm - mw)
+ local dx = dw / 2
+ addmargins(m,-dx,-dx)
+ wid = wid + dw
+ end
+ setwidth(p,wid)
+ if wid > new then
+ new = wid
+ end
+ setlist(p,lst)
+ -- somewhat fuzzy:
+ if fixedwidth then
+ local l = hpack(h,getwidth(p),"exactly")
+ setglue(p,getglue(l))
+ setlist(l)
+ flushnode(l)
+ else
+ setglue(p)
+ end
+ --
+ end
+ end
+ end
+ end
+ if new > old then
+ if fixedwidth then
+ -- issue overflow warning
+ else
+ setwidth(colw[1],new)
+ end
+ end
+ end
+ end
+end
+
+local enabled = false
+
+interfaces.implement {
+ name = "enablealignmentcharacter",
+ -- onlyonce = true,
+ public = true,
+ protected = true,
+ actions = function()
+ if not enabled then
+ nodes.tasks.enableaction("alignments", "nodes.handlers.aligncharacter")
+ enabled = true
+ end
+ end,
+}
+
diff --git a/tex/context/base/mkxl/node-nut.lmt b/tex/context/base/mkxl/node-nut.lmt
index 7970c1fe5..f78e1add6 100644
--- a/tex/context/base/mkxl/node-nut.lmt
+++ b/tex/context/base/mkxl/node-nut.lmt
@@ -151,6 +151,7 @@ local nuts = {
appendaftertail = direct.appendaftertail,
prependbeforehead = direct.prependbeforehead,
getparstate = direct.getparstate,
+ getwordrange = direct.getwordrange,
isdirect = isdirect,
isnode = isnode,
isnut = isdirect,
diff --git a/tex/context/base/mkxl/node-pro.lmt b/tex/context/base/mkxl/node-pro.lmt
index 9a60e2fb1..33f501aab 100644
--- a/tex/context/base/mkxl/node-pro.lmt
+++ b/tex/context/base/mkxl/node-pro.lmt
@@ -129,7 +129,19 @@ do
end
end
- callbacks.register("contribute_filter", processors.contribute_filter,"things done with lines")
+ callbacks.register("contribute_filter", processors.contribute_filter, "things done with lines")
+
+end
+
+do
+
+ local actions = tasks.actions("alignments")
+
+ function processors.alignment_filter(head,attr,preamble)
+ actions(head,attr,preamble)
+ end
+
+ callbacks.register("alignment_filter", processors.alignment_filter, "things done with alignments")
end
diff --git a/tex/context/base/mkxl/node-res.lmt b/tex/context/base/mkxl/node-res.lmt
index b1ab7e22b..a1fa24bbd 100644
--- a/tex/context/base/mkxl/node-res.lmt
+++ b/tex/context/base/mkxl/node-res.lmt
@@ -551,6 +551,12 @@ do
return v
end)
+ local treversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph,true)
+ t[k] = v
+ return v
+ end)
+
-- these are special:
traversers.node = nuts.traverse (glyph)
@@ -559,6 +565,13 @@ do
traversers.list = nuts.traverselist (glyph)
traversers.content = nuts.traversecontent(glyph)
+ treversers.node = nuts.traverse (glyph,true)
+ treversers.char = nuts.traversechar (glyph,true)
+ treversers.glyph = nuts.traverseglyph (glyph,true)
+ treversers.list = nuts.traverselist (glyph,true)
+ treversers.content = nuts.traversecontent(glyph,true)
+
nuts.traversers = traversers
+ nuts.treversers = treversers
end
diff --git a/tex/context/base/mkxl/node-tsk.lmt b/tex/context/base/mkxl/node-tsk.lmt
index 785d0ecbf..61e5bc0d4 100644
--- a/tex/context/base/mkxl/node-tsk.lmt
+++ b/tex/context/base/mkxl/node-tsk.lmt
@@ -347,6 +347,57 @@ tasks.new {
templates = templates,
}
+-- -- alignment -- --
+
+tasks.new {
+ name = "alignments",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- users
+ "normalizers", -- system
+ "after", -- users
+ },
+ templates = {
+
+default = [[
+return function(head)
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,attr,preamble)
+ local nuthead = tonut(head)
+ local nutattr = tonut(attr)
+ local nutpreamble = tonut(preamble)
+
+%actions%
+end
+]],
+
+step = [[
+ %action%(head,attr,preamble)
+]],
+
+nut = [[
+ %action%(nuthead,nutattr,nutpreamble)
+]],
+
+nohead = [[
+ %action%(head,attr,preamble)
+]],
+
+nonut = [[
+ %action%(nuthead,nutattr,nutpreamble)
+]],
+
+ }
+}
+
-- -- finalizers -- --
tasks.new {
diff --git a/tex/context/base/mkxl/pack-com.mkxl b/tex/context/base/mkxl/pack-com.mkxl
index 44cfc9a4f..21f99ffc2 100644
--- a/tex/context/base/mkxl/pack-com.mkxl
+++ b/tex/context/base/mkxl/pack-com.mkxl
@@ -327,13 +327,14 @@
\multiply\c_pack_combinations_y\c_pack_combinations_x
\tabskip\zeropoint
\halign \ifx\p_width\v!fit\else to \p_width \fi \bgroup % repetitive preamble
+ % \halign noskips \ifx\p_width\v!fit\else to \p_width \fi \bgroup % repetitive preamble
\aligntab
\m_pack_combinations_leftfiller
- \alignmark\alignmark
+ \aligncontent
\m_pack_combinations_rightfiller
\aligntab
\tabskip\zeropoint \s!plus 1fill % \fillskip
- \alignmark\alignmark
+ \aligncontent
\cr
\pack_combinations_pickup}
@@ -981,10 +982,10 @@
\def\pack_sidebyside_one {\bgroup\setbox\scratchboxone\box\nextbox\dowithnextboxcs\pack_sidebyside_two \hbox}
\def\pack_topofeachother_two{\setbox\scratchboxtwo\box\nextbox
- \halign{\hss\alignmark\alignmark\hss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
+ \halign{\hss\aligncontent\hss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
\egroup\egroup}
\def\pack_sidebyside_two {\setbox\scratchboxtwo\box\nextbox
- \valign{\vss\alignmark\alignmark\vss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
+ \valign{\vss\aligncontent\vss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
\egroup\egroup}
\protect \endinput
diff --git a/tex/context/base/mkxl/strc-ref.mklx b/tex/context/base/mkxl/strc-ref.mklx
index a11e9dd5f..3952a4faf 100644
--- a/tex/context/base/mkxl/strc-ref.mklx
+++ b/tex/context/base/mkxl/strc-ref.mklx
@@ -842,7 +842,7 @@
\installcorenamespace{savedinternalreference}
-\letvalue{\??savedinternalreference\s!default}\!!zerocount
+\letcsname\??savedinternalreference\s!default\endcsname\!!zerocount
\permanent\protected\def\storeinternalreference#1#2%
{\xdefcsname\??savedinternalreference\currentstructurename\endcsname{\number#2}}
diff --git a/tex/context/base/mkxl/syst-aux.mkxl b/tex/context/base/mkxl/syst-aux.mkxl
index 873debedf..c9bed105f 100644
--- a/tex/context/base/mkxl/syst-aux.mkxl
+++ b/tex/context/base/mkxl/syst-aux.mkxl
@@ -4662,8 +4662,8 @@
%D Which in terms of \TEX\ looks like:
\permanent\protected\def\removesubstring#1\from#2\to#3%
- {\splitstring#2\to\m_syst_string_one\and\m_syst_string_two
- \dodoglobal#3{\m_syst_string_one\m_syst_string_two}}
+ {\splitstring#2\at#1\to\m_syst_string_one\and\m_syst_string_two
+ \dodoglobal\def#3{\m_syst_string_one\m_syst_string_two}}
%D \macros
%D {appendtocommalist,prependtocommalist,
@@ -6705,4 +6705,71 @@
\permanent\protected\def\resetmacros[#1]%
{\processcommalist[#1]\syst_reset_macro}
+%D These demos are for hvdm who needs ways to manipulate arguments but
+%D in a fully expandable way (some explanation is given in the low level
+%D expansion manual).
+%D
+%D \startbuffer
+%D \edef\xxx{[\wipetokens {123}{abc123abc123abc123abc123abc}]}1 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{abc}]} 2 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{123}]} 3 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{123123}]} 4 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{}]} 5 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {}{123}]} 6 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {\relax}{1\relax2\relax3}]} 7 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {1}{1{2}3}]} 8 : \meaningless\xxx\par
+%D \edef\xxx{[\wipedtokens{{1}}{{1}23}]} 9 : \meaningless\xxx\par
+%D \edef\xxx{[\wipedtokens{{1}}{123}]} 0 : \meaningless\xxx\par
+%D \stopbuffer
+%D
+%D \typebuffer \startpacked \getbuffer \stoppacked
+
+\def\syst_helpers_wipe_tokens_nop#0^^04{}%
+
+\permanent\def\wipetokens#1#2%
+ {\beginlocalcontrol
+ \tolerant\def\syst_helpers_wipe_tokens_yes##1#1##2^^04%
+ {##1%
+ \ifparameter##2\or
+ \expandafter\syst_helpers_wipe_tokens_yes
+ \else
+ \expandafter\syst_helpers_wipe_tokens_nop
+ \fi
+ ##2^^04}%
+ \endlocalcontrol
+ \syst_helpers_wipe_tokens_yes#2#1^^04}
+
+\permanent\def\wipedtokens#1#2%
+ {\tokenized{\normalexpanded{\noexpand\wipetokens{\detokenize{#1}}{\detokenize{#2}}}}}
+
+%D \startbuffer
+%D \def\abc{abc}
+%D \semiprotected \def\xyz{xyz}
+%D \edef\pqr{\expandtoken\notcatcodes`p%
+%D \expandtoken\notcatcodes`q%
+%D \expandtoken\notcatcodes`r}
+%D
+%D 1: \ifcondition\similartokens{abc} {def}YES\else NOP\fi (NOP) \quad
+%D 2: \ifcondition\similartokens{abc}{\abc}YES\else NOP\fi (YES)
+%D
+%D 3: \ifcondition\similartokens{xyz} {pqr}YES\else NOP\fi (NOP) \quad
+%D 4: \ifcondition\similartokens{xyz}{\xyz}YES\else NOP\fi (YES)
+%D
+%D 5: \ifcondition\similartokens{pqr} {pqr}YES\else NOP\fi (YES) \quad
+%D 6: \ifcondition\similartokens{pqr}{\pqr}YES\else NOP\fi (YES)
+%D \stopbuffer
+%D
+%D \typebuffer \startpacked \getbuffer \stoppacked
+
+\permanent\protected\def\similartokens#1#2%
+ %{\normalexpanded{\noexpand\iftok{\noexpand\detokenize{#1}}{\noexpand\detokenize{#2}}}}
+ {\semiexpanded{\noexpand\iftok{\noexpand\detokenize{#1}}{\noexpand\detokenize{#2}}}}
+
+\permanent\protected\def\doifelsesimilartokens#1#2%
+ {\ifcondition\similartokens{#1}{#2}%
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
\protect \endinput
diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl
index 523d8ab2e..f5cd28d32 100644
--- a/tex/context/base/mkxl/syst-ini.mkxl
+++ b/tex/context/base/mkxl/syst-ini.mkxl
@@ -772,7 +772,7 @@
\tracingnesting \plusthree
\tracingassigns \plustwo
\tracingmath \plusone
- \tracingalignments\plusone
+ \tracingalignments\plustwo % > 1: also show preamble
\showboxbreadth \maxcount
\showboxdepth \maxcount}
diff --git a/tex/context/base/mkxl/tabl-com.mkxl b/tex/context/base/mkxl/tabl-com.mkxl
index 97c497eac..0803fc0ee 100644
--- a/tex/context/base/mkxl/tabl-com.mkxl
+++ b/tex/context/base/mkxl/tabl-com.mkxl
@@ -17,6 +17,30 @@
\pushoverloadmode
+\registerctxluafile{node-ali}{autosuffix}
+
+\definesystemattribute[aligncharacter][public]
+
+\permanent\protected\def\setalignmentcharacter#1%
+ {\enablealignmentcharacter
+ \global\settrue\c_tabl_use_size
+ \global\settrue\c_tabl_sparse_skips
+ \enforced\permanent\protected\gdef\setalignmentcharacter##1%
+ {\attribute\aligncharacterattribute`##1\relax}%
+ \attribute\aligncharacterattribute`#1\relax}
+
+\permanent\protected\def\resetalignmentcharacter
+ {\attribute\aligncharacterattribute\attributeunsetvalue}
+
+\permanent\def\alignmentcharactertrigger
+ {\s!callback\space\s!attr\aligncharacterattribute\plusone}
+
+\noaligned\permanent\protected\def\aligncontentleft {\ignorespaces\aligncontent\unskip\hss}
+\noaligned\permanent\protected\def\aligncontentmiddle{\hss\ignorespaces\aligncontent\unskip\hss}
+\noaligned\permanent\protected\def\aligncontentright {\hss\ignorespaces\aligncontent\unskip}
+
+% \enablealignmentcharacter % defined at the lua end
+
% maybe frozen instead
\permanent\protected\lettonothing\AR
diff --git a/tex/context/base/mkxl/tabl-tab.mkxl b/tex/context/base/mkxl/tabl-tab.mkxl
index 95d263ecd..d9aa5e7fa 100644
--- a/tex/context/base/mkxl/tabl-tab.mkxl
+++ b/tex/context/base/mkxl/tabl-tab.mkxl
@@ -207,7 +207,7 @@
\else
\!tgValue
\fi
- \alignmark\alignmark\alignmark\alignmark
+ \aligncontent
\hfil
\the\!taRuleColumnTemplate}%
\!tfAdjoinPriorColumn}
@@ -231,9 +231,9 @@
\fi
\advance\!taColumnNumber\plusone
\if!taOnceOnlyTabskip
- \!thToksEdef\!taDataColumnTemplate{\alignmark\alignmark\alignmark\alignmark\tabskip\the\!taLastRegularTabskip}%
+ \!thToksEdef\!taDataColumnTemplate{\aligncontent\tabskip\the\!taLastRegularTabskip}%
\else
- \!taDataColumnTemplate{\alignmark\alignmark}%
+ \!taDataColumnTemplate{\aligncontent}%
\fi
\!taRuleColumnTemplate\emptytoks
\!taLeftGlue{\hfil}%
@@ -266,17 +266,17 @@
\def\!tfFinishFormat
{\!thToksEdef\!taPreamble{%
- \alignmark\alignmark\alignmark\alignmark\tabskip\tablelefttabskip
+ \aligncontent\tabskip\tablelefttabskip
\aligntab
\the\!taPreamble\tabskip\tablerighttabskip
\aligntab
- \alignmark\alignmark\alignmark\alignmark\tabskip\zeropoint\cr}
+ \aligncontent\tabskip\zeropoint\cr}
\!taBeginFormatfalse
\!ttDoHalign}
\def\tabl_table_reformat[#1]% will become local
{\omit
- \!taDataColumnTemplate{\alignmark\alignmark}%
+ \!taDataColumnTemplate{\aligncontent}%
\!taLeftGlue\emptytoks
\!taRightGlue\emptytoks
\begingroup
diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl
index c48c384f2..c248c13a2 100644
--- a/tex/context/base/mkxl/tabl-tbl.mkxl
+++ b/tex/context/base/mkxl/tabl-tbl.mkxl
@@ -295,7 +295,8 @@
% 1 = RC column raw RQ equal column raw
% 2 = HC column hook HQ equal column hook
-% [|lg{.}|] => \NG 12.34 \NC
+% [|lg{.}|] => \NG 12.34 \NC % old
+% [|lG{.}|] => \NG 12.34 \NC % new
\def\tabl_tabulate_nobreak_inject_tracer
{\red % maybe use the fast color switcher here
@@ -422,19 +423,37 @@
\let\tabl_tabulate_hook_b\donothing
\let\tabl_tabulate_hook_e\donothing
\let\tabl_tabulate_hook_g\donothing
+\let\tabl_tabulate_hook_G\donothing
+
+\newconditional\c_tabl_use_size
+\newconditional\c_tabl_sparse_skips
+
+% \settrue\c_tabl_use_size
+% \settrue\c_tabl_sparse_skips
+
+\installtexexperiment {tabulateusesize} {\settrue\c_tabl_use_size} {\setfalse\c_tabl_use_size}
+\installtexexperiment {tabulatesparseskips} {\settrue\c_tabl_sparse_skips} {\setfalse\c_tabl_sparse_skips}
\def\tabl_tabulate_set_preamble_step#1#2% only makes sense for many tabulates
{\etoksapp\t_tabl_tabulate_preamble{%
+ % begin of between/initial part
\tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
\tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
\tabl_tabulate_check_local_color\constantemptyargument\m_tabl_tabulate_color\constantnumberargument\c_tabl_tabulate_colorspan
\tabl_tabulate_color_side_right
+ % end of between/initial part
\aligntab
+ % begin of left part
\tabl_tabulate_column_vrule_inject
\tabl_tabulate_color_side_left
\tabl_tabulate_inject_pre_skip{\the\dimexpr\s_tabl_tabulate_pre}% get rid of plus
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
+ % end of left part
+ \ifconditional\c_tabl_use_size
+ \tabsize\zeropoint
+ \fi
\aligntab
+ % begin of main cell
\tabl_tabulate_color_side_both
\global\c_tabl_tabulate_colorspan\zerocount
\global\c_tabl_tabulate_column\constantnumber\c_tabl_tabulate_columns
@@ -448,7 +467,11 @@
\fi
\else
\ifcase\c_tabl_tabulate_modus
- \hbox to
+ \ifconditional\c_tabl_use_size
+ \tabsize % we could remove one level of grouping
+ \else
+ \hbox to
+ \fi
\else
\hsize
\fi
@@ -483,8 +506,9 @@
% grouping needs to be outside macros (or expandable), nice test
% example \NC \string \aligntab \NC which will fail otherwise (mk)
\bgroup
+ \tabl_tabulate_hook_G
\tabl_tabulate_entry_before
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabl_tabulate_entry_after
\egroup
\noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
@@ -498,12 +522,18 @@
\tabl_tabulate_hook_e
\egroup
\egroup
+ % end of main cell
\aligntab
+ \ifconditional\c_tabl_use_size
+ \tabsize\zeropoint
+ \fi
+ % begin of right part
\noexpand\dostoptagged
\tabl_tabulate_inject_post_skip
{\the\ifconditional\c_tabl_post_is_set\s_tabl_tabulate_post\else\s_tabl_tabulate_last\fi}%
{\the\s_tabl_tabulate_post}%
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
+ % end of right part
}%
\toksapp\t_tabl_tabulate_dummy{\NC}%
\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\relax
@@ -557,6 +587,7 @@
\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\settrue\c_tabl_tabulate_equal}%
\tabl_tabulate_set_preamble}
\installtabulatepreambleoption{g}{\tabl_tabulate_set_align}
+\installtabulatepreambleoption{G}{\tabl_tabulate_set_align_new}
\installtabulatepreambleoption{.}{\tabl_tabulate_set_align.}
\installtabulatepreambleoption{,}{\tabl_tabulate_set_align,}
\installtabulatepreambleoption{C}{\tabl_tabulate_set_color_span}
@@ -623,7 +654,8 @@
% begin of character align plugin
-\newconditional\c_tabl_auto_align_mode % reset later
+\newconditional\c_tabl_auto_align_mode % reset later
+\newconditional\c_tabl_auto_align_mode_new % reset later
\def\tabl_tabulate_hook_g % partly expanded
{\ifconditional\c_tabl_auto_align_mode
@@ -631,11 +663,24 @@
\typo_charalign_adapt_font
\fi}
+\def\tabl_tabulate_hook_G % partly expanded
+ {\ifconditional\c_tabl_auto_align_mode_new
+ \typo_charalign_adapt_font
+ \attribute\aligncharacterattribute\the\attribute\aligncharacterattribute\relax
+ \else
+ \attribute\aligncharacterattribute\attributeunsetvalue
+ \fi}
+
\def\tabl_tabulate_set_align#1%
{\global\settrue\c_tabl_auto_align_mode
\setcharacteralign\c_tabl_tabulate_columns{#1}%
\tabl_tabulate_set_preamble}
+\def\tabl_tabulate_set_align_new#1%
+ {\global\settrue\c_tabl_auto_align_mode_new
+ \iftok{#1}\emptytoks\else\setalignmentcharacter{#1}\fi% todo: check for number or char or ... in lua
+ \tabl_tabulate_set_preamble}
+
% end of character align plugin
\def\tabl_tabulate_set_before#1%
@@ -794,6 +839,9 @@
\glet\m_tabl_tabulate_vrule_color\empty
\global\c_tabl_tabulate_colorspan\zerocount
\global\setfalse\c_tabl_auto_align_mode
+ \global\setfalse\c_tabl_auto_align_mode_new
+ \resetalignmentcharacter
+% \attribute\aligncharacterattribute\attributeunsetvalue
\global\advance\c_tabl_tabulate_columns\plusone
\letcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing % here ?
\iftok{#1}\emptytoks
@@ -1166,10 +1214,10 @@
\tolerant\protected\def\tabl_start_regular[#1]#*[#2]% [format] | [settings] | [format] [settings] | [settings] [format]
{\let\currenttabulation\currenttabulationparent
\iftok{#1}\emptytoks
- \ifhastok={#2}\relax
+ \ifhaschar={#2}\relax
\setupcurrenttabulation[#2]%
\fi
- \orelse\ifhastok={#1}\relax
+ \orelse\ifhaschar={#1}\relax
\iftok{#2}\emptytoks\else
\settabulationparameter\c!format{#2}%
\fi
@@ -1178,7 +1226,7 @@
\iftok{#1}\emptytoks\else
\settabulationparameter\c!format{#1}%
\fi
- \ifhastok={#2}\relax
+ \ifhaschar={#2}\relax
\setupcurrenttabulation[#2]%
\fi
\fi
@@ -2248,11 +2296,11 @@
\tabl_tabulate_flush_indent
% \global\advance\c_tabl_tabulate_noflines\plusone
\strut
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\d_tabl_tabulate_margin
\strut
\aligntab
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\zeropoint}%
\else
\t_tabl_tabulate_preamble
@@ -2260,9 +2308,9 @@
\tabl_tabulate_flush_indent
% \global\advance\c_tabl_tabulate_noflines\plusone
\strut
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\aligntab
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\zeropoint}%
\fi
\d_tabl_tabulate_width\zeropoint
@@ -2276,7 +2324,8 @@
\d_tabl_tabulate_width\zeropoint
\tabl_tabulate_initialize_boxes\c_tabl_tabulate_columns
\toksapp\t_tabl_tabulate_preamble{%
- \aligntab\alignmark\alignmark
+ \aligntab
+ \aligncontent % \alignmark\alignmark
\global\advance\c_tabl_tabulate_column\plusone % maybe just set it already
}%
\toksapp\t_tabl_tabulate_dummy{%
@@ -2302,7 +2351,10 @@
\d_tabl_tabulate_indent\zeropoint
\settrialtypesetting % very important
\anch_backgrounds_text_level_start
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}%
+ \halign
+ \ifconditional\c_tabl_sparse_skips \s!noskips\fi
+ \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
+ \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}%
\anch_backgrounds_text_level_stop
\ifcase\c_anch_backgrounds_text_state\else
\global\settrue\tablehaspositions
@@ -2349,7 +2401,10 @@
\setfalse\inhibitmargindata % new per 2012.06.13 ... really needed
% % \everycr\expandafter{\the\everycr\noalign{\the\t_tabl_tabulate_every_real_row}\dostoptagged\dostarttagged\t!tabulaterow\empty}%
\toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row\dostoptagged\dostarttagged\t!tabulaterow\empty}}%
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}%
+ \halign
+ \ifconditional\c_tabl_sparse_skips \s!noskips\fi
+ \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
+ \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}%
\dostoptagged
\dostoptagged
\ifhmode\par\prevdepth\strutdp\fi % nog eens beter, temporary hack
diff --git a/tex/context/base/mkxl/task-ini.lmt b/tex/context/base/mkxl/task-ini.lmt
index 4989db85c..78d7ab657 100644
--- a/tex/context/base/mkxl/task-ini.lmt
+++ b/tex/context/base/mkxl/task-ini.lmt
@@ -149,13 +149,15 @@ appendaction("mvlbuilders", "normalizers", "typesetters.checkers.handler",
appendaction("everypar", "normalizers", "nodes.handlers.checkparcounter", nil, "nut", "disabled" )
+appendaction("alignments", "normalizers", "nodes.handlers.aligncharacter", nil, "nut", "disabled" )
+
-- some protection
freezecallbacks("find_.*_file", "find file using resolver")
freezecallbacks("read_.*_file", "read file at once")
freezecallbacks("open_.*_file", "open file for reading")
--- experimental:
+-- experimental (needs to be updated):
freezegroup("processors", "normalizers")
freezegroup("processors", "characters")
@@ -185,6 +187,8 @@ freezegroup("math", "builders")
freezegroup("everypar", "normalizers")
+freezegroup("alignments", "normalizers")
+
-- new: disabled here
directives.register("nodes.basepass", function(v)
diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt
index da71535ce..74bfd01e3 100644
--- a/tex/context/base/mkxl/trac-vis.lmt
+++ b/tex/context/base/mkxl/trac-vis.lmt
@@ -923,6 +923,7 @@ local ruledglue, ruledmathglue do
local indentskip_code = gluecodes.indentskip
local intermathskip_code = gluecodes.intermathskip
local correctionskip_code = gluecodes.correctionskip
+ local tabskip_code = gluecodes.tabskip
local g_cache_v = caches["vglue"]
local g_cache_h = caches["hglue"]
@@ -947,7 +948,7 @@ local ruledglue, ruledmathglue do
[gluecodes.belowdisplayshortskip] = "SB",
[gluecodes.topskip] = "TS",
[gluecodes.splittopskip] = "ST",
- [gluecodes.tabskip] = "AS",
+ [tabskip_code] = "TB",
[gluecodes.thinmuskip] = "MS",
[gluecodes.medmuskip] = "MM",
[gluecodes.thickmuskip] = "ML",
@@ -1029,6 +1030,8 @@ local ruledglue, ruledmathglue do
else
info = sometext(amount,l_glue,"trace:g")
end
+ elseif subtype == tabskip_code then
+ info = sometext(amount,l_glue,"trace:s")
elseif subtype == indentskip_code or subtype == correctionskip_code then
info = sometext(amount,l_glue,"trace:s")
elseif subtype == leftskip_code then
diff --git a/tex/context/base/mkxl/typo-wrp.lmt b/tex/context/base/mkxl/typo-wrp.lmt
new file mode 100644
index 000000000..5b31c4015
--- /dev/null
+++ b/tex/context/base/mkxl/typo-wrp.lmt
@@ -0,0 +1,81 @@
+if not modules then modules = { } end modules ['typo-wrp'] = {
+ version = 1.001,
+ comment = "companion to typo-wrp.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- begin/end par wrapping stuff ... more to come
+
+local boundary_code = nodes.nodecodes.boundary
+local wordboundary_code = nodes.boundarycodes.word
+
+local nuts = nodes.nuts
+
+local findtail = nuts.tail
+local getprev = nuts.getprev
+local setnext = nuts.setnext
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getattr = nuts.getattr
+local flushnodelist = nuts.flushlist
+
+local enableaction = nodes.tasks.enableaction
+
+local wrappers = { }
+typesetters.wrappers = wrappers
+
+local trace_wrappers = trackers.register("typesetters.wrappers",function(v) trace_wrappers = v end)
+local report = logs.reporter("paragraphs","wrappers")
+
+-- In luametatex we don't have the parfilskip attached yet but we can have final glue
+-- anyway. This check is very bound to the \crlf definition where we get:
+--
+-- ... boundary [strut: hlist] [break: glue penalty] boundary
+
+local a_crlf = attributes.private("crlf")
+
+local function remove_dangling_crlf(head,tail)
+ if head and tail then
+ if getid(tail) == boundary_code and getsubtype(tail) == wordboundary_code then
+ -- findnode could run backwards
+ if getattr(tail,a_crlf) then
+ local t = tail
+ while t do
+ t = getprev(t)
+ if not t then
+ break
+ elseif getid(t) == boundary_code and getsubtype(t) == wordboundary_code then
+ if t ~= head then
+ if trace_wrappers then
+ report("removing a probably unwanted end-of-par break in line %s (guess)",tex.inputlineno)
+ end
+ tail = getprev(t)
+ setnext(tail)
+ flushnodelist(t)
+ end
+ break
+ end
+ end
+ end
+ end
+ end
+ return head, tail
+end
+
+function wrappers.handler(head)
+ if head then
+ local tail = findtail(head)
+ head, tail = remove_dangling_crlf(head,tail) -- will be action chain
+ end
+ return head
+end
+
+interfaces.implement {
+ name = "enablecrlf",
+ onlyonce = true,
+ actions = function()
+ enableaction("processors","typesetters.wrappers.handler")
+ end
+}
diff --git a/tex/context/base/mkxl/typo-wrp.mkxl b/tex/context/base/mkxl/typo-wrp.mkxl
index 92af2058e..850d42e78 100644
--- a/tex/context/base/mkxl/typo-wrp.mkxl
+++ b/tex/context/base/mkxl/typo-wrp.mkxl
@@ -15,7 +15,9 @@
\unprotect
-\registerctxluafile{typo-wrp}{}
+\registerctxluafile{typo-wrp}{autosuffix}
+
+\definesystemattribute[crlf]
\permanent\protected\def\crlf
{\ifhmode
@@ -25,27 +27,29 @@
\protected\def\spac_crlf
{\clf_enablecrlf % once
\unskip
- \spac_crlf_placeholder
+ \wordboundary
+ \spac_crlf_placeholder % box
\ifcase\raggedstatus\hfil\or\or\or\hfil\fi
- % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [parfillskip]
+ % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [glue (filler)]
\break
+ \begingroup
+ \c_attr_crlf\plusone
\wordboundary
+ \endgroup
% which we then remove (maybe we should flag the wordboundary with an attribute but not now
\ignorespaces}
\protected\def\spac_crlf_placeholder
- {\wordboundary\strut} % or \endstrut
+ {\strut} % or \endstrut
\protected\def\spac_crlf_placeholder_show
- {\wordboundary
- %\nobreak
- \hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
+ {\hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
\permanent\protected\def\settestcrlf
{\let\spac_crlf_placeholder\spac_crlf_placeholder_show}
\permanent\protected\def\crlfplaceholder % for old times sake
- {\spac_crlf_placeholder}
+ {\wordboundary\strut}
\appendtoks
\let\spac_crlf_placeholder\empty
diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml
index 57e767de1..18183e894 100644
--- a/tex/context/interface/mkii/keys-pe.xml
+++ b/tex/context/interface/mkii/keys-pe.xml
@@ -154,6 +154,7 @@
<cd:variable name='commands' value='فرمانها'/>
<cd:variable name='comment' value='توضیح'/>
<cd:variable name='component' value='مولفه'/>
+ <cd:variable name='compress' value='compress'/>
<cd:variable name='compressseparator' value='compressseparator'/>
<cd:variable name='compressstopper' value='compressstopper'/>
<cd:variable name='concept' value='مفهوم'/>
diff --git a/tex/context/sample/common/cuomo.tex b/tex/context/sample/common/cuomo.tex
deleted file mode 100644
index b4ab3f27a..000000000
--- a/tex/context/sample/common/cuomo.tex
+++ /dev/null
@@ -1,17 +0,0 @@
-Yeah, my mother is not expendable. And your mother is not expendable. And our
-brothers and sisters are not expendable. And we're not going to accept a premise
-that human life is disposable. And we're not going to put a dollar figure on
-human life. First order of business is: save lives. Period. Whatever it costs.
-Now, I also don't believe it's an either or. I believe you can have an
-intelligent refined public health strategy. You talk about risk stratification.
-You can have people go to work. You can test people and find out that they are
-resolved from the virus. Let them go back to work. You can let go younger people
-back to work. You can have an economic startup strategy that is consistent with a
-public health strategy. It's smart. It's complicated. It's sophisticated. But
-that's what government is supposed to do, right. That whole concept of developed
-government policy and program. You can do both. But not in a clumsy ham-handed
-way. Right? \quotation {Well, we'll just sacrifice old people, they're old people
-anyway, and the old get left behind.} What is this? Some modern Darwinian theory
-of natural selection? You can't keep up so the band is going to leave you behind.
-We're gonna move on and if you can't keep up you, well then you just fall by the
-wayside of life. God forbid.
diff --git a/tex/context/sample/common/pluto.xml b/tex/context/sample/common/pluto.xml
new file mode 100644
index 000000000..348dfcc19
--- /dev/null
+++ b/tex/context/sample/common/pluto.xml
@@ -0,0 +1,44 @@
+<?xml version='1.0' ?>
+
+<!-- This is not fake but real. More about this Pluto thing can be found in The Pluto Files
+by Neil deGrasse Tyson. The state of New Mexico -->
+
+<bills>
+ <bill>
+ <title>California Assembly Bill HR 36</title>
+ <introduced>INTRODUCED BY Assembly Members ...</introduced>
+ <date>AUGUST 24, 2006</date>
+ <concerns>Relative to Pluto's planetary status.</concerns>
+ <text>
+ <whereas>WHEREAS, Recent astronomical discoveries, including Pluto's oblong orbit and the sighting of a slightly larger Kuiper Belt object, have led astronomers to question the planetary status of Pluto; and</whereas>
+ <whereas>WHEREAS, The mean-spirited International Astronomical Union decided on August 24, 2006, to disrespect Pluto by stripping Pluto of its planetary status and reclassifying it as a lowly dwarf planet; and</whereas>
+ <whereas>WHEREAS, Pluto was discovered in 1930 by an American, Clyde Tombaugh, at the Lowell Observatory in Arizona, and this discovery resulted in millions of Californians being taught that Pluto was the ninth planet in the solar system; and</whereas>
+ <whereas>WHEREAS, Pluto, named after the Roman God of the underworld and affectionately sharing the name of California's most famous animated dog, has a special connection to California history and culture; and</whereas>
+ <whereas>WHEREAS, Downgrading Pluto's status will cause psychological harm to some Californians who question their place in the universe and worry about the instability of universal constants; and</whereas>
+ <whereas>WHEREAS, The deletion of Pluto as a planet renders millions of text books, museum displays, and children's refrigerator art projects obsolete, and represents a substantial unfunded mandate that must be paid by dwindling Proposition 98 education funds, thereby harming California's children and widening its budget deficits; and</whereas>
+ <whereas>WHEREAS, The deletion of Pluto as a planet is a hasty, ill-considered scientific heresy similar to questioning the Copernican theory, drawing maps of a round world, and proving the existence of the time and space continuum; and</whereas>
+ <whereas>WHEREAS, The downgrading of Pluto reduces the number of planets available for legislative leaders to hide redistricting legislation and other inconvenient political reform measures; and</whereas>
+ <whereas>WHEREAS, The California Legislature, in the closing days of the 2005-06 session, has been considering few matters important to the future of California, and the status of Pluto takes precedence and is worthy of this body's immediate attention; now, therefore, be it</whereas>
+ <resolved>Resolved by the Assembly of the State of California, That the Assembly hereby condemns the International Astronomical Union's decision to strip Pluto of its planetary status for its tremendous impact on the people of California and the state's long term fiscal health; and be it further</resolved>
+ <resolved>Resolved, That the Assembly Clerk shall send a copy of the resolution to the International Astronomical Union and to any Californian who, believing that his or her legislator is addressing the problems that threaten the future of the Golden State, requests a copy of the resolution.</resolved>
+ </text>
+ </bill>
+ <bill>
+ <title>HOUSE JOINT MEMORIAL 54 48th legislature - STATE OF NEW MEXICO - first session, 2007</title>
+ <title>A JOINT MEMORIAL DECLARING PLUTO A PLANET AND DECLARING MARCH 13, 2007, "PLUTO PLANET DAY" AT THE LEGISLATURE.</title>
+ <introduced>INTRODUCED BY ...</introduced>
+ <concerns>New Mexico Legislature: Declaring Pluto a Planet and March 13, 2007 as Pluto Planet Day</concerns>
+ <text>
+ <whereas>WHEREAS, the state of New Mexico is a global center for astronomy, astrophysics and planetary science; and</whereas>
+ <whereas>WHEREAS, New Mexico is home to world class astronomical observing facilities, such as the Apache Point observatory, the very large array, the Magdalena Ridge observatory and the national solar observatory; and</whereas>
+ <whereas>WHEREAS, Apache Point observatory, operated by New Mexico state university, houses the astrophysical research consortium's three-and-one-half meter telescope, as well as the unique two-and-one-half meter diameter Sloan digital sky survey telescope; and</whereas>
+ <whereas>WHEREAS, New Mexico state university has the state's only independent, doctorate-granting astronomy department; and</whereas>
+ <whereas>WHEREAS, New Mexico state university and Dona Ana county were the longtime home of Clyde Tombaugh, discoverer of Pluto; and</whereas>
+ <whereas>WHEREAS, Pluto has been recognized as a planet for seventy-five years; and</whereas>
+ <whereas>WHEREAS, Pluto's average orbit is three billion six hundred ninety-five million nine hundred fifty thousand miles from the sun, and its diameter is approximately one thousand four hundred twenty-one miles; and</whereas>
+ <whereas>WHEREAS, Pluto has three moons known as Charon, Nix and Hydra; and</whereas>
+ <whereas>WHEREAS, a spacecraft called new horizons was launched in January 2006 to explore Pluto in the year 2015;</whereas>
+ <resolved>NOW, THEREFORE, BE IT RESOLVED BY THE LEGISLATURE OF THE STATE OF NEW MEXICO that, as Pluto passes overhead through New Mexico's excellent night skies, it be declared a planet and that March 13, 2007 be declared "Pluto Planet Day" at the legislature.</resolved>
+ </text>
+ </bill>
+</bills>
diff --git a/tex/context/sample/common/samples.tex b/tex/context/sample/common/samples.tex
index 71688270e..df5b38211 100644
--- a/tex/context/sample/common/samples.tex
+++ b/tex/context/sample/common/samples.tex
@@ -11,7 +11,7 @@ used in testing bibliographic references and citations.
\starttabulate[|l|l|p|]
\NC \bf file \NC \bf author \NC \bf source \NC \NR
\HL
-%NC stork.tex \NC David F. Stork \NC \NC \NR
+\NC stork.tex \NC David F. Stork \NC Hal's Legacy\NC \NR
\NC knuth.tex \NC Donald E. Knuth \NC \NC \NR
\NC tufte.tex \NC Edward R. Tufte \NC \NC \NR
\NC reich.tex \NC Steve Reich \NC City Life (1995) \NC \NR
diff --git a/tex/context/sample/common/stork.tex b/tex/context/sample/common/stork.tex
new file mode 100644
index 000000000..bf36bcda7
--- /dev/null
+++ b/tex/context/sample/common/stork.tex
@@ -0,0 +1,24 @@
+With most science fiction films, the more science you
+understand, the {\em less} you admire the film or respect
+its makers. An evil interstellar spaceship careens across
+the screen. The hero's ship fires off a laser blast,
+demolishing the enemy ship---the audience cheers at the
+explosion. But why is the laser beam visible? There is
+nothing in space to scatter the light back to the viewer.
+And what slowed the beam a billionfold to render its advance
+toward the enemy ship perceptible? Why, after the moment of
+the explosion, does the debris remain centered in the screen
+instead of continuing forward as dictated by the laws of
+inertia? What could possibly drag and slow down the
+expanding debris (and cause the smoke to billow) in the
+vacuum of outer space? Note too the graceful, falling curve
+of the debris. Have the cinematographers forgotten that
+there is no gravity---no \quote {downward}--- in outer
+space? Of course the scene is accompanied by the obligatory
+deafening boom. But isn't outer space eternally silent? And
+even if there were some magical way to hear the explosion,
+doesn't light travel faster than sound? Shouldn't we {\em
+see} the explosion long before we {\em hear} it, just as we
+do with lightning and thunder? Finally, isn't all this moot?
+Shouldn't the enemy ship be invisible anyway, as there are
+no nearby stars to provide illumination?
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index c03144492..fe1f83d18 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2021-08-24 22:14
+-- merge date : 2021-08-30 16:21
do -- begin closure to overcome local limits and interference
@@ -2794,7 +2794,7 @@ function file.join(one,two,three,...)
if not two then
return one=="" and one or lpegmatch(reslasher,one)
end
- if one=="" then
+ if not one or one=="" then
return lpegmatch(stripper,three and concat({ two,three,... },"/") or two)
end
if lpegmatch(isnetwork,one) then