From 574f8ab2d75941857590cb0ad0bf4c2cc126fc00 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 20 Jan 2014 12:40:17 +0200 Subject: beta 2014.01.20 11:31 --- doc/context/manuals/allkind/mkiv-publications.tex | 6 ++++ tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4093 -> 4088 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/node-res.lua | 13 ++++---- tex/context/base/publ-dat.lua | 34 ++++++++++----------- tex/context/base/publ-ini.lua | 16 +++++++--- tex/context/base/spac-ver.lua | 25 ++++++++++----- tex/context/base/status-files.pdf | Bin 24775 -> 24772 bytes tex/context/base/status-lua.pdf | Bin 229268 -> 229139 bytes tex/context/base/trac-tim.lua | 2 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 12 files changed, 62 insertions(+), 40 deletions(-) diff --git a/doc/context/manuals/allkind/mkiv-publications.tex b/doc/context/manuals/allkind/mkiv-publications.tex index 8d88e5dbd..f666bd388 100644 --- a/doc/context/manuals/allkind/mkiv-publications.tex +++ b/doc/context/manuals/allkind/mkiv-publications.tex @@ -1213,4 +1213,10 @@ suffix, you can do this: \stoptext +Todo: + +\setuplabeltext[en][reprint=reprint] +\setuplabeltext[de][reprint=Nachdruck] + +note = {\labeltext{reprint} 2004} diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 90b114573..886556d81 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.01.19 17:35} +\newcontextversion{2014.01.20 11:31} %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/context-version.pdf b/tex/context/base/context-version.pdf index 46c672325..fd721fd46 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index d63bacb07..0787ae987 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.01.19 17:35} +\edef\contextversion{2014.01.20 11:31} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua index 709532d76..968283745 100644 --- a/tex/context/base/node-res.lua +++ b/tex/context/base/node-res.lua @@ -159,13 +159,12 @@ local vlist = register_nut(new_nut("vlist")) setfield(vlist,"dir","T function nutpool.zeroglue(n) local s = getfield(n,"spec") - return not writable or ( -- still valid? writable - getfield(s,"width") == 0 - and getfield(s,"stretch") == 0 - and getfield(s,"shrink") == 0 - and getfield(s,"stretch_order") == 0 - and getfield(s,"shrink_order") == 0 - ) + return + getfield(s,"width") == 0 and + getfield(s,"stretch") == 0 and + getfield(s,"shrink") == 0 and + getfield(s,"stretch_order") == 0 and + getfield(s,"shrink_order") == 0 end function nutpool.glyph(fnt,chr) diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua index 8b59b1dee..20fada411 100644 --- a/tex/context/base/publ-dat.lua +++ b/tex/context/base/publ-dat.lua @@ -126,8 +126,11 @@ end) -- we apply some normalization +local space = S(" \t\n\r\f") -- / " " + ----- command = P("\\") * Cc("btxcmd{") * (R("az","AZ")^1) * Cc("}") -local command = P("\\") * (Carg(1) * C(R("az","AZ")^1) / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end) +----- command = P("\\") * (Carg(1) * C(R("az","AZ")^1) / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end) +local command = P("\\") * (Carg(1) * C(R("az","AZ")^1) * space^0 / function(list,c) list[c] = (list[c] or 0) + 1 return "btxcmd{" .. c .. "}" end) local somemath = P("$") * ((1-P("$"))^1) * P("$") -- let's not assume nested math local any = P(1) local done = P(-1) @@ -150,14 +153,6 @@ local filter_2 = Cs( -- in tugboat.bib this is not that efficient. However, eventually strings get -- hashed again. --- local function do_shortcut(tag,key,value,dataset) --- publicationsstats.nofshortcuts = publicationsstats.nofshortcuts + 1 --- tag = lowercase(tag) --- if tag == "@string" then --- dataset.shortcuts[key] = value --- end --- end - local function do_shortcut(key,value,dataset) publicationsstats.nofshortcuts = publicationsstats.nofshortcuts + 1 dataset.shortcuts[key] = value @@ -176,6 +171,9 @@ end publications.getindex = getindex +-- todo: categories : metatable that lowers and also counts +-- todo: fields : metatable that lowers + local function do_definition(category,tag,tab,dataset) publicationsstats.nofdefinitions = publicationsstats.nofdefinitions + 1 local fields = dataset.fields @@ -183,7 +181,7 @@ local function do_definition(category,tag,tab,dataset) local found = luadata[tag] local index = getindex(dataset,luadata,tag) local entries = { - category = gsub(lower(category),"^@",""), + category = lower(category), tag = tag, index = index, } @@ -239,29 +237,31 @@ local balanced = P { [2] = left * V(1) * right } -local keyword = C((R("az","AZ","09") + S("@_:-"))^1) -- C((1-space)^1) +local keyword = C((R("az","AZ","09") + S("@_:-"))^1) +local key = C((1-space-equal)^1) +local tag = C((1-space-comma)^1) +local reference = keyword +local category = P("@") * C((1-space-left)^1) local s_quoted = ((escape*single) + collapsed + (1-single))^0 local d_quoted = ((escape*double) + collapsed + (1-double))^0 local b_value = (left /"") * balanced * (right /"") local s_value = (single/"") * (b_value + s_quoted) * (single/"") local d_value = (double/"") * (b_value + d_quoted) * (double/"") -local r_value = keyword * Carg(1) /resolve +local r_value = reference * Carg(1) /resolve local somevalue = s_value + d_value + b_value + r_value local value = Cs((somevalue * ((spacing * hash * spacing)/"" * somevalue)^0)) -local assignment = spacing * keyword * spacing * equal * spacing * value * spacing ------ shortcut = keyword * spacing * left * spacing * (assignment * comma^0)^0 * spacing * right * Carg(1) +local assignment = spacing * key * spacing * equal * spacing * value * spacing local shortcut = P("@") * (P("string") + P("STRING")) * spacing * left * ((assignment * Carg(1))/do_shortcut * comma^0)^0 * spacing * right -local definition = keyword * spacing * left * spacing * keyword * comma * Ct((assignment * comma^0)^0) * spacing * right * Carg(1) +local definition = category * spacing * left * spacing * tag * spacing * comma * Ct((assignment * comma^0)^0) * spacing * right * Carg(1) / do_definition local comment = keyword * spacing * left * (1-right)^0 * spacing * right local forget = percent^1 * (1-lineending)^0 -- todo \% --- local bibtotable = (space + forget + shortcut/do_shortcut + definition/do_definition + comment + 1)^0 -local bibtotable = (space + forget + shortcut + definition/do_definition + comment + 1)^0 +local bibtotable = (space + forget + shortcut + definition + comment + 1)^0 -- loadbibdata -> dataset.luadata -- loadtexdata -> dataset.luadata diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua index ff5963173..9cb5fe0f4 100644 --- a/tex/context/base/publ-ini.lua +++ b/tex/context/base/publ-ini.lua @@ -853,8 +853,8 @@ end -- rendering ? -local f_reference = formatters["r:%s:%s:%s"] -- dataset, instance, tag -local f_destination = formatters["d:%s:%s:%s"] -- dataset, instance, tag +local f_reference = formatters["r:%s:%s:%s"] -- dataset, instance (block), tag +local f_destination = formatters["d:%s:%s:%s"] -- dataset, instance (block), tag function lists.resolve(dataset,reference) -- maybe already feed it split -- needs checking (the prefix in relation to components) @@ -879,6 +879,7 @@ function lists.resolve(dataset,reference) -- maybe already feed it split end end end +-- inspect(subsets) if #subsets > 0 then local result, nofresult, done = { }, 0, { } for i=1,#subsets do @@ -890,7 +891,8 @@ function lists.resolve(dataset,reference) -- maybe already feed it split found = subset[tag] if not found then for i=block-1,1,-1 do - tag = i .. ":" .. rest + tag = f_destination(dataset,blk,rest) +-- tag = i .. ":" .. rest found = subset[tag] if found then blk = i @@ -952,6 +954,9 @@ function lists.resolve(dataset,reference) -- maybe already feed it split end end if nofcollected > 0 then +-- inspect(reference) +-- inspect(result) +-- inspect(collected) for i=1,nofcollected do local c = collected[i] if i == nofcollected then @@ -982,6 +987,7 @@ function commands.btxreference(dataset,block,tag,data) local ref = f_reference(dataset,block,tag) if not done[ref] then done[ref] = true +-- context("<%s>",data) ctx_dodirectfullreference(ref,data) end end @@ -992,6 +998,7 @@ function commands.btxdestination(dataset,block,tag,data) local ref = f_destination(dataset,block,tag) if not done[ref] then done[ref] = true +-- context("<<%s>>",data) ctx_dodirectfullreference(ref,data) end end @@ -1221,7 +1228,8 @@ function citevariants.page(dataset,tags) end function citevariants.num(dataset,tags) - lists.resolve(dataset,tags) +-- ctx_btxdirectlink(f_destination(dataset,block,tags),listindex) -- not okay yet + lists.resolve(dataset,tags) end function citevariants.serial(dataset,tags) -- the traditional fieldname is "serial" and not "index" diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua index 960180dc2..66d7ca642 100644 --- a/tex/context/base/spac-ver.lua +++ b/tex/context/base/spac-ver.lua @@ -765,7 +765,16 @@ local belowdisplayshortskip_code = skipcodes.belowdisplayshortskip local topskip_code = skipcodes.topskip local splittopskip_code = skipcodes.splittopskip +-- local function free_glue_node(n) +-- free_node(n) +-- local s = getfield(n,"spec") +-- if s then +-- free_node(s) +-- end +-- end + local free_glue_node = free_node +local free_glue_spec = free_node function vspacing.snapbox(n,how) local sv = snapmethods[how] @@ -980,14 +989,13 @@ local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also local so = getattr(current,a_skiporder) or 1 -- has 1 default, no unset (yet) local sp = getattr(current,a_skippenalty) -- has no default, no unset (yet) if sp and sc == penalty then - -if where == "page" and sp >= special_penalty_min and sp <= special_penalty_max then - local previousspecial = specialpenalty(current,sp) - if previousspecial then - setfield(previousspecial,"penalty",0) - sp = 0 - end -end + if where == "page" and sp >= special_penalty_min and sp <= special_penalty_max then + local previousspecial = specialpenalty(current,sp) + if previousspecial then + setfield(previousspecial,"penalty",0) + sp = 0 + end + end if not penalty_data then penalty_data = sp elseif penalty_order < so then @@ -1016,6 +1024,7 @@ end local cw, cp, cm = getfield(cs,"width"), getfield(cs,"stretch"), getfield(cs,"shrink") -- ps = writable_spec(previous) -- no writable needed here -- ps.width, ps.stretch, ps.shrink = pw + cw, pp + cp, pm + cm + free_glue_spec(ps) setfield(previous,"spec",new_gluespec(pw + cw, pp + cp, pm + cm)) -- else topskip can disappear if trace then trace_natural("removed",current) end head, current = remove_node(head, current, true) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index ea41e0226..a749e563f 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index f099c4741..de9ed3c93 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/trac-tim.lua b/tex/context/base/trac-tim.lua index 15ac9bf1b..b4744291c 100644 --- a/tex/context/base/trac-tim.lua +++ b/tex/context/base/trac-tim.lua @@ -88,7 +88,7 @@ local function convert(name) delta = factor/delta end for k=1,#s do - s[k] = format("(%s,%s)",k,(s[k]-b)*delta) + s[k] = format("(%.3f,%.3f)",k,(s[k]-b)*delta) end paths[tagname] = concat(s,"--") end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 3088ab4be..d5b21a678 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/19/14 17:35:01 +-- merge date : 01/20/14 11:31:50 do -- begin closure to overcome local limits and interference -- cgit v1.2.3