summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-07-26 15:15:04 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-07-26 15:15:04 +0200
commite4134528d83ecdfb5bc46c952acddc75c964d0ad (patch)
tree631ff4c2bc062517427b5f1854bfe76fda2104b3
parentfae741e64bc013450f4335e53676fd8293fc9831 (diff)
downloadcontext-e4134528d83ecdfb5bc46c952acddc75c964d0ad.tar.gz
2014-07-26 14:40:00
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4435 -> 4441 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/page-brk.mkiv6
-rw-r--r--tex/context/base/publ-ini.lua239
-rw-r--r--tex/context/base/publ-ini.mkiv19
-rw-r--r--tex/context/base/status-files.pdfbin24897 -> 24895 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin326825 -> 326886 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
9 files changed, 148 insertions, 122 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 74fe145a3..98218ba55 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.07.26 13:05}
+\newcontextversion{2014.07.26 14:38}
%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 522a5ac6d..1afdca0d3 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 644439e54..d4f5bec86 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.07.26 13:05}
+\edef\contextversion{2014.07.26 14:38}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/page-brk.mkiv b/tex/context/base/page-brk.mkiv
index 11dc04bfd..cf74a73c3 100644
--- a/tex/context/base/page-brk.mkiv
+++ b/tex/context/base/page-brk.mkiv
@@ -112,13 +112,13 @@
\endgroup
\fi}
-\def\resetpagebreak % used elsewhere too
+\unexpanded\def\resetpagebreak % used elsewhere too
{\global\settrue\c_page_breaks_enabled}
-\def\simplifypagebreak % to be used grouped !
+\unexpanded\def\simplifypagebreak % to be used grouped !
{\def\page_breaks_process[##1]{\goodbreak}}
-\def\disablepagebreaks % to be used grouped !
+\unexpanded\def\disablepagebreaks % to be used grouped !
{\def\page_breaks_process[##1]{}}
\installpagebreakmethod \s!dummy
diff --git a/tex/context/base/publ-ini.lua b/tex/context/base/publ-ini.lua
index 7a7912fed..ed50af9d3 100644
--- a/tex/context/base/publ-ini.lua
+++ b/tex/context/base/publ-ini.lua
@@ -25,52 +25,52 @@ local setmetatableindex = table.setmetatableindex
local lpegmatch = lpeg.match
local P, S, C, Ct, R, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.R, lpeg.Carg
-local report = logs.reporter("publications")
-local report_cite = logs.reporter("publications","cite")
-local report_reference = logs.reporter("publications","reference")
-
-local trace = false trackers.register("publications", function(v) trace = v end)
-local trace_cite = false trackers.register("publications.cite", function(v) trace_cite = v end)
-local trace_missing = false trackers.register("publications.cite.missing", function(v) trace_missing = v end)
-local trace_references = false trackers.register("publications.cite.references", function(v) trace_references = v end)
-
-local datasets = publications.datasets
-local writers = publications.writers
-
-local variables = interfaces.variables
-
-local v_local = variables["local"]
-local v_global = variables["global"]
-
-local v_force = variables.force
-local v_standard = variables.standard
-local v_start = variables.start
-local v_none = variables.none
-local v_left = variables.left
-local v_right = variables.right
-local v_middle = variables.middle
-local v_inbetween = variables.inbetween
-local v_yes = variables.yes
-local v_all = variables.all
-local v_short = variables.short
-local v_cite = variables.cite
-local v_default = variables.default
-local v_reference = variables.reference
-local v_dataset = variables.dataset
-local v_author = variables.author or "author"
-local v_editor = variables.editor or "editor"
-
-local numbertochar = converters.characters
-
-local logsnewline = logs.newline
-local logspushtarget = logs.pushtarget
-local logspoptarget = logs.poptarget
-local csname_id = token.csname_id
-
-local basicsorter = sorters.basicsorter -- (a,b)
-local sortcomparer = sorters.comparers.basic -- (a,b)
-local sortstripper = sorters.strip
-local sortsplitter = sorters.splitters.utf
+local report = logs.reporter("publications")
+local report_cite = logs.reporter("publications","cite")
+local report_reference = logs.reporter("publications","reference")
+
+local trace = false trackers.register("publications", function(v) trace = v end)
+local trace_cite = false trackers.register("publications.cite", function(v) trace_cite = v end)
+local trace_missing = false trackers.register("publications.cite.missing", function(v) trace_missing = v end)
+local trace_references = false trackers.register("publications.cite.references", function(v) trace_references = v end)
+
+local datasets = publications.datasets
+local writers = publications.writers
+
+local variables = interfaces.variables
+
+local v_local = variables["local"]
+local v_global = variables["global"]
+
+local v_force = variables.force
+local v_standard = variables.standard
+local v_start = variables.start
+local v_none = variables.none
+local v_left = variables.left
+local v_right = variables.right
+local v_middle = variables.middle
+local v_inbetween = variables.inbetween
+local v_yes = variables.yes
+local v_all = variables.all
+local v_short = variables.short
+local v_cite = variables.cite
+local v_default = variables.default
+local v_reference = variables.reference
+local v_dataset = variables.dataset
+local v_author = variables.author or "author"
+local v_editor = variables.editor or "editor"
+
+local numbertochar = converters.characters
+
+local logsnewline = logs.newline
+local logspushtarget = logs.pushtarget
+local logspoptarget = logs.poptarget
+local csname_id = token.csname_id
+
+local basicsorter = sorters.basicsorter -- (a,b)
+local sortcomparer = sorters.comparers.basic -- (a,b)
+local sortstripper = sorters.strip
+local sortsplitter = sorters.splitters.utf
local manipulators = typesetters.manipulators
local splitmanipulation = manipulators.splitspecification
@@ -105,6 +105,7 @@ local ctx_btxmissing = context.btxmissing
local ctx_btxsetdataset = context.btxsetdataset
local ctx_btxsettag = context.btxsettag
+local ctx_btxsetnumber = context.btxsetnumber
local ctx_btxsetlanguage = context.btxsetlanguage
local ctx_btxsetcombis = context.btxsetcombis
local ctx_btxsetcategory = context.btxsetcategory
@@ -991,7 +992,7 @@ methods[v_dataset] = function(dataset,rendering,keyword)
local list = rendering.list
for tag, data in sortedhash(luadata) do
if not keyword or validkeyword(dataset,tag,keyword) then
- list[#list+1] = { tag }
+ list[#list+1] = { tag, false, false, 0 }
end
end
end
@@ -1007,7 +1008,7 @@ methods[v_force] = function (dataset,rendering,keyword)
if u and u.btxset == dataset then
local tag = u.btxref
if tag and (not keyword or validkeyword(dataset,tag,keyword)) then
- list[#list+1] = { tag, listindex, u.btxint }
+ list[#list+1] = { tag, listindex, u.btxint, 0 }
end
end
end
@@ -1045,14 +1046,14 @@ methods[v_local] = function(dataset,rendering,keyword)
if l then
l[#l+1] = u.btxint
else
- local l = { tag, listindex, u.btxint }
+ local l = { tag, listindex, u.btxint, 0 }
list[#list+1] = l
traced[tag] = l
end
else
done[tag] = section
alldone[tag] = true
- list[#list+1] = { tag, listindex, u.btxint }
+ list[#list+1] = { tag, listindex, u.btxint, 0 }
end
end
end
@@ -1222,17 +1223,28 @@ lists.sorters = {
-- sort(list,compare)
-- end,
[v_default] = function(dataset,rendering,list,sorttype) -- experimental
- local valid = byspec(dataset,list,sorttype)
- if #valid == 0 or #valid ~= #list then
- -- nothing to sort
+ if sorttype == "" or sorttype == v_default then
+ local function compare(a,b)
+ local aa, bb = a and a[4], b and b[4]
+ if aa and bb then
+ return aa and bb and aa < bb
+ end
+ return false
+ end
+ sort(list,compare)
else
- -- if needed we can wrap compare and use the list directly but this is cleaner
- sorters.sort(valid,sortcomparer)
- for i=1,#valid do
- local v = valid[i]
- valid[i] = list[v.index]
+ local valid = byspec(dataset,list,sorttype)
+ if #valid == 0 or #valid ~= #list then
+ -- nothing to sort
+ else
+ -- if needed we can wrap compare and use the list directly but this is cleaner
+ sorters.sort(valid,sortcomparer)
+ for i=1,#valid do
+ local v = valid[i]
+ valid[i] = list[v.index]
+ end
+ return valid
end
- return valid
end
end,
[v_author] = function(dataset,rendering,list)
@@ -1253,69 +1265,87 @@ lists.sorters = {
-- for determining width
-function lists.fetchentries(dataset)
+local lastnumber = 0 -- document wide
+
+function lists.prepareentries(dataset)
local rendering = renderings[dataset]
local list = rendering.list
local used = rendering.used
local forceall = rendering.criterium == v_all
local repeated = rendering.repeated == v_yes
+ local sorttype = rendering.sorttype or v_default
+ local sorter = lists.sorters[sorttype] or lists.sorters[v_default]
local luadata = datasets[dataset].luadata
+ local details = datasets[dataset].details
+ local newlist = { }
for i=1,#list do
- local tag = list[i][1]
- if luadata[tag] and (forceall or repeated or not used[tag]) then
- ctx_btxsettag(tag)
- ctx_btxchecklistentry()
+ local li = list[i]
+ local tag = li[1]
+ local entry = luadata[tag]
+ if entry and (forceall or repeated or not used[tag]) then
+ newlist[#newlist+1] = li
+ -- already here:
+ if not repeated then
+ used[tag] = true -- beware we keep the old state (one can always use criterium=all)
+ end
+ local detail = details[tag]
+ local number = detail.number
+ if not number then
+ lastnumber = lastnumber + 1
+ number = lastnumber
+ detail.number = lastnumber
+ end
+ li[4] = number
end
end
+ rendering.list = type(sorter) == "function" and sorter(dataset,rendering,newlist,sorttype) or newlist
+end
+
+function lists.fetchentries(dataset)
+ local rendering = renderings[dataset]
+ local list = rendering.list
+ for i=1,#list do
+ local li = list[i]
+ ctx_btxsettag(li[1])
+ ctx_btxsetnumber(li[4])
+ ctx_btxchecklistentry()
+ end
end
-- for rendering
-function lists.flushentries(dataset,sorttype)
+function lists.flushentries(dataset)
local rendering = renderings[dataset]
local list = rendering.list
- local sorttype = rendering.sorttype or sorttype
- local sorter = lists.sorters[sorttype] or lists.sorters[v_default]
- local used = rendering.used
- local forceall = rendering.criterium == v_all
- local repeated = rendering.repeated == v_yes
local luadata = datasets[dataset].luadata
- if type(sorter) == "function" then
- list = sorter(dataset,rendering,list,sorttype) or list
- end
- -- local details = datasets[dataset].details
for i=1,#list do
- -- we can pass i here too ... more efficient to avoid the setvalue
- local li = list[i]
- local tag = li[1]
- local entry = luadata[tag]
- if entry and (forceall or repeated or not used[tag]) then
- local combined = entry.combined
- if combined then
- ctx_btxsetcombis(concat(combined,","))
- end
- ctx_btxsetcategory(entry.category or "unknown")
- ctx_btxsettag(tag)
- local language = entry.language
- if language then
- ctx_btxsetlanguage(language)
- end
- local bl = li[3]
- if bl and bl ~= "" then
- ctx_btxsetbacklink(bl)
- ctx_btxsetbacktrace(concat(li," ",3))
- local uc = citetolist[tonumber(bl)]
- if uc then
- ctx_btxsetinternal(uc.references.internal or "")
- end
- else
- -- nothing
- end
- ctx_btxhandlelistentry()
- if not repeated then
- used[tag] = true -- beware we keep the old state (one can always use criterium=all)
+ local li = list[i]
+ local tag = li[1]
+ local n = li[4]
+ local entry = luadata[tag]
+ local combined = entry.combined
+ local language = entry.language
+ if combined then
+ ctx_btxsetcombis(concat(combined,","))
+ end
+ ctx_btxsetcategory(entry.category or "unknown")
+ ctx_btxsettag(tag)
+ ctx_btxsetnumber(n)
+ if language then
+ ctx_btxsetlanguage(language)
+ end
+ local bl = li[3]
+ if bl and bl ~= "" then
+ ctx_btxsetbacklink(bl)
+ ctx_btxsetbacktrace(concat(li," ",3)) -- how about 4
+ local uc = citetolist[tonumber(bl)]
+ if uc then
+ ctx_btxsetinternal(uc.references.internal or "")
end
+ else
+ -- nothing
end
+ ctx_btxhandlelistentry()
end
end
@@ -1324,13 +1354,14 @@ function lists.filterall(dataset)
local list = r.list
local registered = r.registered
for i=1,#registered do
- list[i] = { registered[i], i }
+ list[i] = { registered[i], i, false, 0 }
end
end
commands.btxresolvelistreference = lists.resolve
commands.btxaddtolist = lists.addentry
commands.btxcollectlistentries = lists.collectentries
+commands.btxpreparelistentries = lists.prepareentries
commands.btxfetchlistentries = lists.fetchentries
commands.btxflushlistentries = lists.flushentries
diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv
index 96b5eb422..5d64af19c 100644
--- a/tex/context/base/publ-ini.mkiv
+++ b/tex/context/base/publ-ini.mkiv
@@ -357,6 +357,7 @@
\let\currentbtxlanguage \empty \unexpanded\def\btxsetlanguage {\def\currentbtxlanguage}
\let\currentbtxsecond \empty \unexpanded\def\btxsetsecond {\def\currentbtxsecond}
\let\currentbtxtag \empty \unexpanded\def\btxsettag {\def\currentbtxtag}
+\let\currentbtxnumber \empty \unexpanded\def\btxsetnumber {\def\currentbtxnumber}
\let\currentbtxauthorvariant\v!normal \unexpanded\def\btxsetauthorvariant{\def\currentbtxauthorvariant}
%let\currentbtxfirstnames \empty \unexpanded\def\btxsetfirstnames {\def\currentbtxfirstnames}
@@ -399,6 +400,7 @@
\let\currentbtxbacktrace\empty
\let\currentbtxlanguage \empty
\let\currentbtxtag \empty
+ \let\currentbtxnumber \empty
\let\currentbtxdataset \empty}
\unexpanded\def\btxcitereset % check for less .. not all resets needed
@@ -410,6 +412,7 @@
\let \currentbtxlanguage \empty
\let \currentbtxdataset \empty
\let \currentbtxtag \empty
+ \let \currentbtxnumber \empty
\setconstant\currentbtxoverflow \zerocount
\setconstant\currentbtxconcat \zerocount
\setconstant\currentbtxcount \zerocount}
@@ -451,7 +454,6 @@
%newdimen\d_publ_number_distance
\ifdefined\btxblock \else \newcount\btxblock \fi \btxblock\plusone
-\ifdefined\btxlistcounter \else \newcount\btxlistcounter \fi % maintained here, maybe in lua too?
\ifdefined\btxcitecounter \else \newcount\btxcitecounter \fi % maybe pass this to lua
\newtoks \everysetupbtxlistplacement % name will change
@@ -587,17 +589,17 @@
sorttype = "\btxrenderingparameter\c!sorttype",
repeated = "\btxrenderingparameter\c!repeat",
}}%
+ % sorting and so
+ \ctxcommand{btxpreparelistentries("\currentbtxdataset")}%
% next we analyze the width
\ifx\currentbtxnumbering\empty \else
\edef\p_width{\btxrenderingparameter\c!width}%
\ifx\p_width\v!auto
- \scratchcounter\btxlistcounter
\setbox\scratchbox\vbox \bgroup
\settrialtypesetting
\ctxcommand{btxfetchlistentries("\currentbtxdataset")}%
\egroup
\d_publ_number_width\wd\scratchbox
- \global\btxlistcounter\scratchcounter
\letbtxlistparameter\c!width\d_publ_number_width
\fi
\fi
@@ -620,7 +622,6 @@
\unexpanded\def\btxchecklistentry
{\begingroup
% todo, switch to font
- \global\advance\btxlistcounter\plusone
\hbox{\btx_reference_checked}%
\par
\endgroup}
@@ -629,7 +630,6 @@
\unexpanded\def\btxhandlelistentry
{\begingroup
- \global\advance\btxlistcounter\plusone
\let\currentlist\s!btx % probably obsolete here
\startbtxlistentry\currentbtxrendering
\btx_entry_inject
@@ -643,7 +643,7 @@
{\begingroup
\let\currentbtxlistvariant\currentbtxnumbering
\btxlistvariantparameter\c!left
- \ctxcommand{btxlistvariant("\currentbtxdataset","\currentbtxblock","\currentbtxtag","\currentbtxnumbering","\number\btxlistcounter")}% some can go
+ \ctxcommand{btxlistvariant("\currentbtxdataset","\currentbtxblock","\currentbtxtag","\currentbtxnumbering","\currentbtxnumber")}% some can go
\btxlistvariantparameter\c!right
\endgroup}
@@ -668,7 +668,7 @@
\strc_references_direct_full_user
{\s!btxset="\currentbtxdataset",\s!btxref="\currentbtxtag",\ifx\currentbtxbacklink\currentbtxbacktrace\s!btxint="\currentbtxbacklink"\else\s!btxbck="\currentbtxbacktrace"\fi}%
{\s!btx::\v!list::\number\c_btx_list_reference}%
- {\number\btxlistcounter}}
+ {\currentbtxnumber}}
\unexpanded\def\btx_cite_reference_inject
{\dontleavehmode
@@ -830,11 +830,6 @@
\btxcitevariantparameter\v!right
\endgroup}
-\appendtoks
- \doifnot{\btxrenderingparameter\c!continue}\v!yes
- {\global\btxlistcounter\zerocount}%
-\to \everysetupbtxlistplacement
-
%D When a publication is cited, we need to signal that somehow. This is done with the
%D following (not user) command. We could tag without injecting a node but this way
%D we also store the location, which makes it possible to ask local lists.
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index ee0714e02..cf1c7dfe1 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index b7e6da8b5..b96ea1dba 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index a692e621f..881e8d951 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 : 07/26/14 13:05:35
+-- merge date : 07/26/14 14:38:45
do -- begin closure to overcome local limits and interference