diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua index 9dfeda168cc..f62352f07f0 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua @@ -32,7 +32,7 @@ local sortedkeys, sortedhash = table.sortedkeys, table.sortedhash local setmetatableindex = table.setmetatableindex local lpegmatch = lpeg.match local P, S, C, Ct, Cs, R, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.R, lpeg.Carg -local upper = utf.upper +local upper = characters.upper local report = logs.reporter("publications") local report_cite = logs.reporter("publications","cite") @@ -229,9 +229,9 @@ logs.registerfinalactions(function() logs.startfilelogging(report,"used btx commands") done = true end - if isdefined[command] then + if isdefined(command) then report("%-20s %-20s % 5i %s",name,command,n,"known") - elseif isdefined[upper(command)] then + elseif isdefined(upper(command)) then report("%-20s %-20s % 5i %s",name,command,n,"KNOWN") else report("%-20s %-20s % 5i %s",name,command,n,"unknown") @@ -246,7 +246,7 @@ logs.registerfinalactions(function() logs.starterrorlogging(report,"unknown btx commands") for name, dataset in sortedhash(datasets) do for command, n in sortedhash(dataset.commands) do - if not isdefined[command] and not isdefined[upper(command)] then + if not isdefined(command) and not isdefined(upper(command)) then report("%-20s %-20s % 5i %s",name,command,n,"unknown") end end @@ -1065,14 +1065,17 @@ do -- maybe not redo when already done local function shortsorter(a,b) - local ay, by = a[2], b[2] -- year + local ay = a[2] -- year + local by = b[2] -- year if ay ~= by then return ay < by end - local ay, by = a[3], b[3] -- suffix + local ay = a[3] -- suffix + local by = b[3] -- suffix if ay ~= by then -- bah, bah, bah - local an, bn = tonumber(ay), tonumber(by) + local an = tonumber(ay) + local bn = tonumber(by) if an and bn then return an < bn else @@ -2023,7 +2026,8 @@ do for i=1,nofranges do local r = ranges[i] ctx_btxsetconcat(concatstate(i,nofranges)) - local first, last = r[1], r[2] + local first = r[1] + local last = r[2] ctx_btxsetfirstinternal(first[2].internal) ctx_btxsetfirstpage(first[1]) if last then @@ -2044,7 +2048,8 @@ do } local function identical(a,b) - local na, nb = #a, #b + local na = #a + local nb = #b if na ~= nb then return false end @@ -2056,7 +2061,8 @@ do end return true end - local ha, hb = a.hash, b.hash + local ha = a.hash + local hb = b.hash if ha then return ha == hb end @@ -3456,3 +3462,20 @@ do } end + +do + + local btxstring = "" + + implement { + name = "btxcmdstring", + actions = function() if btxstring ~= "" then context(btxstring) end end, + } + + function publications.prerollcmdstring(str) + btxstring = str or "" + tex.runtoks("t_btx_cmd") + return nodes.toutf(tex.getbox("b_btx_cmd").list) or str + end + +end |