summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/bibl-tra.lua57
-rw-r--r--tex/context/base/bibl-tra.mkiv2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4100 -> 4101 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/status-files.pdfbin24693 -> 24685 bytes
-rw-r--r--tex/context/base/status-lua.log2
7 files changed, 41 insertions, 24 deletions
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 4b17e0dcc..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:18}
+\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 9b5628c84..82498a60b 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 843e15081..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:18}
+\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
--- 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.log b/tex/context/base/status-lua.log
index faa75cfaa..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:18 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)