From 7e69eda2c0f61a9c55ee44c8bff3573b151447ff Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 8 Aug 2013 12:00:15 +0300 Subject: beta 2013.08.08 10:48 --- tex/context/base/bibl-tra.lua | 66 ++++++++++++++------- tex/context/base/bibl-tra.mkiv | 5 ++ tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4109 -> 4102 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/status-files.pdf | Bin 24695 -> 24696 bytes tex/context/base/status-lua.log | 2 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 8 files changed, 53 insertions(+), 26 deletions(-) (limited to 'tex') diff --git a/tex/context/base/bibl-tra.lua b/tex/context/base/bibl-tra.lua index 63a7b7852..39eae3bcd 100644 --- a/tex/context/base/bibl-tra.lua +++ b/tex/context/base/bibl-tra.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['bibl-tra'] = { license = "see context related readme files" } +-- also see bibl-tra-new ! + local match, gmatch, format, concat, sort = string.match, string.gmatch, string.format, table.concat, table.sort bibtex = bibtex or { } @@ -18,26 +20,27 @@ local trace_bibtex = false trackers.register("publications.bibtex", function(v) local report_tex = logs.reporter("publications","tex") -local context = context -local structures = structures +local context = context +local structures = structures -local references = structures.references -local sections = structures.sections +local references = structures.references +local sections = structures.sections -local variables = interfaces.variables +local variables = interfaces.variables -local v_short = variables.short -local v_cite = variables.cite -local v_default = variables.default +local v_short = variables.short +local v_cite = variables.cite +local v_default = variables.default +local v_reference = variables.default -local list = { } -local done = { } -local alldone = { } -local used = { } -local registered = { } -local ordered = { } -local shorts = { } -local mode = 0 +local list = { } +local done = { } +local alldone = { } +local used = { } +local registered = { } +local ordered = { } +local shorts = { } +local mode = 0 local template = utilities.strings.striplong([[ \citation{*} @@ -74,9 +77,9 @@ function hacks.register(tag,short) report_tex("registering bibtex entry %a with shortcut %a",tag,short) end local top = #registered + 1 - registered[top] = tag - ordered [tag] = top - shorts [short] = top + registered[top] = tag + ordered [tag] = top + shorts [tag] = short end function hacks.nofregistered() @@ -108,18 +111,37 @@ function hacks.add(str,listindex) end function hacks.flush(sortvariant) + local compare -- quite some checking for non-nil if sortvariant == "" or sortvariant == v_cite or sortvariant == v_default then -- order is cite order i.e. same as list + elseif sortvariant == v_short then + compare = function(a,b) + local aa, bb = a and a[1], b and b[1] + if aa and bb then + local oa, ob = shorts[aa], shorts[bb] + return oa and ob and oa < ob + end + return false + end + elseif sortvariant == v_reference then + compare = function(a,b) + local aa, bb = a and a[1], b and b[1] + if aa and bb then + return aa and bb and aa < bb + end + return false + end else - local data = sortvariant == v_short and shorts or ordered - local function compare(a,b) -- quite some checking for non-nil + compare = function(a,b) local aa, bb = a and a[1], b and b[1] if aa and bb then - local oa, ob = data[aa], data[bb] + local oa, ob = ordered[aa], ordered[bb] return oa and ob and oa < ob end return false end + end + if compare then sort(list,compare) end for i=1,#list do diff --git a/tex/context/base/bibl-tra.mkiv b/tex/context/base/bibl-tra.mkiv index 9d307082d..174bc8e25 100644 --- a/tex/context/base/bibl-tra.mkiv +++ b/tex/context/base/bibl-tra.mkiv @@ -9,6 +9,11 @@ %C %C Donated to the public domain. + +% % % % watch out ... bibl-tra-new.mkiv is work in progress % % % % + +% % % % mlbibtex also supports context and we can run that instead of bibtex % % % % + %D This module has been adapted to \MKIV\ by Hans Hagen so if things go wrong, %D he is to blame. The changes concern references and lists but teh rendering %D itself is unchanged. Future versions might provide variants as we have plans diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 8756b109c..23a601963 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{2013.08.07 22:54} +\newcontextversion{2013.08.08 10:48} %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 b65dc8de6..2b302e4b2 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 c910661c5..44ced49b8 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.08.07 22:54} +\edef\contextversion{2013.08.08 10:48} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index d4b901c03..1587afc41 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.log b/tex/context/base/status-lua.log index c80e18120..1fe1edd83 100644 --- a/tex/context/base/status-lua.log +++ b/tex/context/base/status-lua.log @@ -1,6 +1,6 @@ (cont-yes.mkiv -ConTeXt ver: 2013.08.07 22:54 MKIV beta fmt: 2013.8.7 int: english/english +ConTeXt ver: 2013.08.08 10:48 MKIV beta fmt: 2013.8.8 int: english/english system > 'cont-new.mkiv' loaded (cont-new.mkiv) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 77e355eb2..f66bc79cd 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 : 08/07/13 22:54:47 +-- merge date : 08/08/13 10:48:04 do -- begin closure to overcome local limits and interference -- cgit v1.2.3