summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/back-pdf.mkiv2
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/grph-inc.lua21
-rw-r--r--tex/context/base/lxml-lpt.lua55
-rw-r--r--tex/context/base/mult-cld.lua10
-rw-r--r--tex/context/base/strc-pag.lua14
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
-rw-r--r--tex/generic/context/m-ch-en.tex4
9 files changed, 68 insertions, 44 deletions
diff --git a/tex/context/base/back-pdf.mkiv b/tex/context/base/back-pdf.mkiv
index 2d3ba8524..68edfcd79 100644
--- a/tex/context/base/back-pdf.mkiv
+++ b/tex/context/base/back-pdf.mkiv
@@ -115,7 +115,7 @@
\appendtoks \ctxlua{backends.codeinjections.finalizepage ()}\to \everybackendshipout % is immediate
\appendtoks \ctxlua{backends.codeinjections.finalizedocument()}\to \everylastbackendshipout % is immediate
-%D Temporary hack, will be removed or improved.
+%D Temporary hack, will be removed or improved or default.
\def\TransparencyHack{\ctxlua{backends.codeinjections.addtransparencygroup()}}
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 59a72b9b0..5686e4764 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2009.10.27 16:35}
+\newcontextversion{2009.10.28 19:27}
%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.tex b/tex/context/base/context.tex
index f1c0e900e..3a3736d9d 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2009.10.27 16:35}
+\edef\contextversion{2009.10.28 19:27}
%D For those who want to use this:
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index f0e2b4c10..43b830e55 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -39,6 +39,7 @@ local ctxcatcodes = tex.ctxcatcodes
local variables = interfaces.variables
local trace_figures = false trackers.register("figures.locating",function(v) trace_figures = v end)
+local trace_bases = false trackers.register("figures.bases", function(v) trace_bases = v end)
--- some extra img functions ---
@@ -811,10 +812,7 @@ local bases = figures.bases
function bases.use(basename)
if basename == "reset" then
- bases.list = { }
- bases.used = { }
- bases.found = { }
- bases.enabled = false
+ bases.list, bases.used, bases.found, bases.enabled = { }, { }, { }, false
else
basename = file.addsuffix(basename,"xml")
if not bases.used[basename] then
@@ -825,11 +823,17 @@ function bases.use(basename)
bases.enabled = true
xml.registerns("rlx","http://www.pragma-ade.com/schemas/rlx") -- we should be able to do this per xml file
end
+ if trace_bases then
+ commands.writestatus("figures","registering base '%s'",basename)
+ end
end
end
end
function bases.find(basename,askedlabel)
+ if trace_bases then
+ commands.writestatus("figures","checking for '%s' in base '%s'",askedlabel,basename)
+ end
basename = file.addsuffix(basename,"xml")
local t = bases.found[askedlabel]
if t == nil then
@@ -842,6 +846,9 @@ function bases.find(basename,askedlabel)
if io.exists(xmlfile) then
base[2] = xmlfile
base[3] = xml.load(xmlfile)
+ if trace_bases then
+ commands.writestatus("figures","base '%s' loaded",xmlfile)
+ end
break
end
end
@@ -858,9 +865,15 @@ function bases.find(basename,askedlabel)
page = page,
}
bases.found[askedlabel] = t
+ if trace_bases then
+ commands.writestatus("figures","figure '%s' found in base '%s'",askedlabel,base[2])
+ end
return t
end
end
+ if trace_bases and not t then
+ commands.writestatus("figures","figure '%s' not found in base '%s'",askedlabel,base[2])
+ end
end
end
return t
diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua
index 428080a9f..7e5ef15b9 100644
--- a/tex/context/base/lxml-lpt.lua
+++ b/tex/context/base/lxml-lpt.lua
@@ -187,9 +187,9 @@ apply_axis['descendant-or-self'] = function(list)
local collected = { }
for l=1,#list do
local ll = list[l]
-if ll.special ~= true then -- catch double root
- collected[#collected+1] = ll
-end
+ if ll.special ~= true then -- catch double root
+ collected[#collected+1] = ll
+ end
collect(ll,collected)
end
return collected
@@ -278,7 +278,7 @@ local function apply_nodes(list,directive,nodes)
return { }
end
else
- local collected = { }
+ local collected, m, p = { }, 0, nil
if not nns then -- only check tag
for l=1,#list do
local ll = list[l]
@@ -286,10 +286,12 @@ local function apply_nodes(list,directive,nodes)
if ltg then
if directive then
if ntg == ltg then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
elseif ntg ~= ltg then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
end
end
@@ -300,10 +302,12 @@ local function apply_nodes(list,directive,nodes)
if lns then
if directive then
if lns == nns then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
elseif lns ~= nns then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
end
end
@@ -316,10 +320,12 @@ local function apply_nodes(list,directive,nodes)
local ok = ltg == ntg and lns == nns
if directive then
if ok then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
elseif not ok then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
end
end
@@ -327,7 +333,7 @@ local function apply_nodes(list,directive,nodes)
return collected
end
else
- local collected = { }
+ local collected, m, p = { }, 0, nil
for l=1,#list do
local ll = list[l]
local ltg = ll.tg
@@ -343,10 +349,12 @@ local function apply_nodes(list,directive,nodes)
end
if directive then
if ok then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
elseif not ok then
- collected[#collected+1] = ll
+ local llp = ll.__p__ ; if llp ~= p then p, m = llp, 1 else m = m + 1 end
+ collected[#collected+1], ll.mi = ll, m
end
end
end
@@ -380,7 +388,8 @@ local lp_builtin = P (
P("last") / "#list" +
P("position") / "l" +
P("rootposition") / "order" +
- P("index") / "ll.ni" +
+ P("index") / "(ll.ni or 1)" +
+ P("match") / "(ll.mi or 1)" +
P("text") / "(ll.dt[1] or '')" +
P("name") / "(ll.ns~='' and ll.ns..':'..ll.tg)" +
P("tag") / "ll.tg" +
@@ -570,14 +579,14 @@ local parser = Ct { "patterns", -- can be made a bit faster by moving pattern ou
shortcuts = V("shortcuts_a") * (spaces * "/" * spaces * V("shortcuts_a"))^0,
- s_descendant_or_self = (P("***/") + P("/")) * Cc(register_descendant_or_self), --- *** is a bonus
- -- s_descendant_or_self = P("/") * Cc(register_descendant_or_self),
- s_descendant = P("**") * Cc(register_descendant),
- s_child = P("*") * Cc(register_child ),
- s_parent = P("..") * Cc(register_parent ),
- s_self = P("." ) * Cc(register_self ),
- s_root = P("^^") * Cc(register_root ),
- s_ancestor = P("^") * Cc(register_ancestor ),
+ s_descendant_or_self = (P("***/") + P("/")) * Cc(register_descendant_or_self), --- *** is a bonus
+ -- s_descendant_or_self = P("/") * Cc(register_descendant_or_self),
+ s_descendant = P("**") * Cc(register_descendant),
+ s_child = P("*") * #(1-P(":")) * Cc(register_child ),
+ s_parent = P("..") * Cc(register_parent ),
+ s_self = P("." ) * Cc(register_self ),
+ s_root = P("^^") * Cc(register_root ),
+ s_ancestor = P("^") * Cc(register_ancestor ),
descendant = P("descendant::") * Cc(register_descendant ),
child = P("child::") * Cc(register_child ),
@@ -769,7 +778,7 @@ local function traced_apply(list,parsed,nofparsed)
logs.report("lpath", "% 10i : ns : %s",(collected and #collected) or 0,nodesettostring(pi.nodes,pi.nodetest))
elseif kind == "expression" then
collected = apply_expression(collected,pi.evaluator,i)
- logs.report("lpath", "% 10i : ex : %s",(collected and #collected) or 0,pi.expression)
+ logs.report("lpath", "% 10i : ex : %s -> %s",(collected and #collected) or 0,pi.expression,pi.converted)
elseif kind == "finalizer" then
collected = pi.finalizer(collected)
logs.report("lpath", "% 10i : fi : %s : %s(%s)",(collected and #collected) or 0,parsed.protocol or xml.defaultprotocol,pi.name,pi.arguments or "")
diff --git a/tex/context/base/mult-cld.lua b/tex/context/base/mult-cld.lua
index 024d196e4..8898ffc49 100644
--- a/tex/context/base/mult-cld.lua
+++ b/tex/context/base/mult-cld.lua
@@ -157,16 +157,18 @@ function context.runfile(filename)
filename = resolvers.findtexfile(filename) or ""
if filename ~= "" then
local ok = dofile(filename)
- if ok then
+ if type(ok) == "function" then
if trace_cld then
- commands.writestatus("cld","begin of file '%s'",filename)
+ commands.writestatus("cld","begin of file '%s' (funciton call)",filename)
end
ok()
if trace_cld then
- commands.writestatus("cld","end of file '%s'",filename)
+ commands.writestatus("cld","end of file '%s' (funciton call)",filename)
end
+ elseif ok then
+ commands.writestatus("cld","file '%s' is processed and returns true",filename)
else
- commands.writestatus("cld","invalid file '%s'",filename)
+ commands.writestatus("cld","file '%s' is processed and returns nothing",filename)
end
else
commands.writestatus("cld","unknown file '%s'",filename)
diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua
index d7340f498..7338888ff 100644
--- a/tex/context/base/strc-pag.lua
+++ b/tex/context/base/strc-pag.lua
@@ -11,7 +11,7 @@ local texcount, format = tex.count, string.format
local ctxcatcodes = tex.ctxcatcodes
local texsprint, texwrite = tex.sprint, tex.write
-local trace_counters = false trackers.register("structure.counters", function(v) trace_counters = v end)
+local trace_pages = false trackers.register("structure.pages", function(v) trace_pages = v end)
structure.pages = structure.pages or { }
@@ -42,8 +42,8 @@ local specification = { } -- to be checked
function pages.save(prefixdata,numberdata)
local realpage, userpage = texcount.realpageno, texcount.userpageno
if realpage > 0 then
- if trace_counters then
- logs.report("counters","saving page %s.%s",realpage,userpage)
+ if trace_pages then
+ logs.report("pages","saving page %s.%s",realpage,userpage)
end
local data = {
number = userpage,
@@ -55,8 +55,8 @@ function pages.save(prefixdata,numberdata)
if not collected[realpage] then
collected[realpage] = data
end
- elseif trace_counters then
- logs.report("counters","not saving page %s.%s",realpage,userpage)
+ elseif trace_pages then
+ logs.report("pages","not saving page %s.%s",realpage,userpage)
end
end
@@ -66,8 +66,8 @@ function structure.counters.specials.userpage()
local t = tobesaved[r]
if t then
t.number = texcount.userpageno
- if trace_counters then
- logs.report("counters","forcing pagenumber of realpage %s to %s",r,t.number)
+ if trace_pages then
+ logs.report("pages","forcing pagenumber of realpage %s to %s",r,t.number)
end
end
end
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 5dba03893..b23f4d70d 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 10/27/09 16:41:26
+-- merge date : 10/28/09 19:32:33
do -- begin closure to overcome local limits and interference
diff --git a/tex/generic/context/m-ch-en.tex b/tex/generic/context/m-ch-en.tex
index 8c55a5669..6bd435319 100644
--- a/tex/generic/context/m-ch-en.tex
+++ b/tex/generic/context/m-ch-en.tex
@@ -1,6 +1,6 @@
-% name : PPCHTEX / english interface
+% name : PPCHTEX / english interface
% version : 1997.03.05
-% author : J. Hagen
+% author : J. Hagen
% copyright : J. Hagen, A.F. Otten
\chardef\interfacenumber=0