summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/publ-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-11-07 12:49:36 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-11-07 12:49:36 +0100
commit75fbb107b15d01179a4b772844144e0661240e77 (patch)
treec5210f4f9ade25c89a540f755912a52966404792 /tex/context/base/mkiv/publ-ini.lua
parent7830451577b876020de2a26bbfbf069625ab4d6f (diff)
downloadcontext-75fbb107b15d01179a4b772844144e0661240e77.tar.gz
2017-11-07 11:43:00
Diffstat (limited to 'tex/context/base/mkiv/publ-ini.lua')
-rw-r--r--tex/context/base/mkiv/publ-ini.lua20
1 files changed, 13 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua
index 130f9a49b..99a37e8b9 100644
--- a/tex/context/base/mkiv/publ-ini.lua
+++ b/tex/context/base/mkiv/publ-ini.lua
@@ -127,6 +127,7 @@ local ctx_btxsetafter = context.btxsetafter
local ctx_btxsetbacklink = context.btxsetbacklink
local ctx_btxsetfirstinternal = context.btxsetfirstinternal
local ctx_btxsetlastinternal = context.btxsetlastinternal
+local ctx_btxsetauthorfield = context.btxsetauthorfield
-- local ctx_btxsetdataset = function(s) setmacro("currentbtxdataset", s) end -- context.btxsetdataset
-- local ctx_btxsettag = function(s) setmacro("currentbtxtag", s) end -- context.btxsettag
@@ -2637,6 +2638,7 @@ do
local setter = specification.setter
local compressor = specification.compressor
local method = specification.method
+ local varfield = specification.varfield
--
local reference = publications.parenttag(dataset,reference)
--
@@ -2664,6 +2666,7 @@ do
language = ldata.language,
dataset = dataset,
tag = tag,
+ varfield = varfield,
-- combis = entry.userdata.btxcom,
-- luadata = ldata,
}
@@ -3107,11 +3110,6 @@ do
return keysorter(b,a)
end
- local currentbtxciteauthor = function()
- context.currentbtxciteauthor()
- return true -- needed?
- end
-
local function authorcompressor(found,specification)
-- HERE
if specification.sorttype == v_normal then
@@ -3219,7 +3217,13 @@ do
local partialinteractive = false
+ local currentbtxciteauthor = function()
+ context.currentbtxciteauthorbyfield()
+ return true -- needed?
+ end
+
local function authorgetter(first,last,key,specification) -- only first
+ ctx_btxsetauthorfield(first.varfield or "author")
if first.type == "author" then
ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower)
else
@@ -3246,15 +3250,16 @@ do
return true
end
- -- author
+ -- author (the varfield hack is for editor and translator i.e author type)
local function setter(data,dataset,tag,entry)
- data.author, data.field, data.type = getcasted(dataset,tag,"author")
+ data.author, data.field, data.type = getcasted(dataset,tag,data.varfield or "author")
data.sortkey = text and lpegmatch(numberonly,text)
data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return
end
local function getter(first,last,_,specification)
+ ctx_btxsetauthorfield(specification.varfield or "author")
if first.type == "author" then
ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower)
else
@@ -3269,6 +3274,7 @@ do
setup = "author",
setter = setter,
getter = getter,
+ varfield = presets.variant or "author",
compressor = authorcompressor,
})
end