From 6a279cf14cf7ee2a70e1e3df89eaec2b69cded2d Mon Sep 17 00:00:00 2001 From: Marius Date: Wed, 7 Aug 2013 23:20:21 +0300 Subject: beta 2013.08.07 22:10 --- tex/context/base/bibl-tra.lua | 57 +++++++++++++-------- tex/context/base/bibl-tra.mkiv | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4100 -> 4101 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/status-files.pdf | Bin 24693 -> 24685 bytes tex/context/base/status-lua.log | 2 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 8 files changed, 42 insertions(+), 25 deletions(-) (limited to 'tex') diff --git a/tex/context/base/bibl-tra.lua b/tex/context/base/bibl-tra.lua index e58aded3b..63a7b7852 100644 --- a/tex/context/base/bibl-tra.lua +++ b/tex/context/base/bibl-tra.lua @@ -6,26 +6,38 @@ if not modules then modules = { } end modules ['bibl-tra'] = { license = "see context related readme files" } +local match, gmatch, format, concat, sort = string.match, string.gmatch, string.format, table.concat, table.sort + bibtex = bibtex or { } local bibtex = bibtex bibtex.hacks = bibtex.hacks or { } local hacks = bibtex.hacks -local match, gmatch, format, concat, sort = string.match, string.gmatch, string.format, table.concat, table.sort -local variables, constants = interfaces.variables, interfaces.constants - local trace_bibtex = false trackers.register("publications.bibtex", function(v) trace_bibtex = v end) local report_tex = logs.reporter("publications","tex") -local context, structures = context, structures +local context = context +local structures = structures local references = structures.references local sections = structures.sections -local list, done, alldone, used, registered, ordered = { }, { }, { }, { }, { }, { } -local mode = 0 +local variables = interfaces.variables + +local v_short = variables.short +local v_cite = variables.cite +local v_default = variables.default + +local list = { } +local done = { } +local alldone = { } +local used = { } +local registered = { } +local ordered = { } +local shorts = { } +local mode = 0 local template = utilities.strings.striplong([[ \citation{*} @@ -54,12 +66,17 @@ function hacks.process(settings) end end -function hacks.register(str) +function hacks.register(tag,short) + if not short or short == "" then + short = tag + end if trace_bibtex then - report_tex("registering bibtex entry %a",str) + report_tex("registering bibtex entry %a with shortcut %a",tag,short) end - registered[#registered+1] = str - ordered[str] = #registered + local top = #registered + 1 + registered[top] = tag + ordered [tag] = top + shorts [short] = top end function hacks.nofregistered() @@ -90,19 +107,19 @@ function hacks.add(str,listindex) end end -local function compare(a,b) -- quite some checking for non-nil - local aa, bb = a and a[1], b and b[1] - if aa and bb then - local oa, ob = ordered[aa], ordered[bb] - return oa and ob and oa < ob - end - return false -end - function hacks.flush(sortvariant) - if sortvariant == "" or sortvariant == variables.cite or sortvariant == "default" then + if sortvariant == "" or sortvariant == v_cite or sortvariant == v_default then -- order is cite order i.e. same as list else + local data = sortvariant == v_short and shorts or ordered + local function compare(a,b) -- quite some checking for non-nil + local aa, bb = a and a[1], b and b[1] + if aa and bb then + local oa, ob = data[aa], data[bb] + return oa and ob and oa < ob + end + return false + end 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 b142e8938..9d307082d 100644 --- a/tex/context/base/bibl-tra.mkiv +++ b/tex/context/base/bibl-tra.mkiv @@ -684,7 +684,7 @@ \doifassignmentelse{#1}% {\getparameters[\??pb][k=\s!unknown,t=article,n=,s=,a=,y=,o=,u=,#1]}% {\getparameters[\??pb][k=#1,t=article,n=,s=,a=,y=,o=,u=]}% - \ctxlua{bibtex.hacks.register("\@@pbk")}% + \ctxlua{bibtex.hacks.register("\@@pbk","\@@pbs")}% \catcode\commentasciicode\othercatcode \dodostartpublication} diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 505ebe7b5..23c9870c7 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 20:25} +\newcontextversion{2013.08.07 22:10} %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 2cf27f1d9..82498a60b 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 fd5b540e3..c7c73cc57 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 20:25} +\edef\contextversion{2013.08.07 22:10} \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 1ffd317e7..2c5b3f351 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 eeb5a8703..070225bd4 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 20:25 MKIV beta fmt: 2013.8.7 int: english/english +ConTeXt ver: 2013.08.07 22:10 MKIV beta fmt: 2013.8.7 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 78a497b67..5bf27b352 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 20:25:19 +-- merge date : 08/07/13 22:10:50 do -- begin closure to overcome local limits and interference -- cgit v1.2.3