summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-10-20 21:15:03 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-10-20 21:15:03 +0200
commitcecfd22db11bd5090bff902828a9e8c141eed424 (patch)
treea4adca468d4c995ccc20476df5426d26ba5b0934 /tex
parent7cc87f17f5be2362f52c62c819e95042c5ae89f5 (diff)
downloadcontext-cecfd22db11bd5090bff902828a9e8c141eed424.tar.gz
2014-10-20 21:12:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4383 -> 4383 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/mult-def.mkiv1
-rw-r--r--tex/context/base/publ-aut.lua56
-rw-r--r--tex/context/base/publ-ini.mkiv50
-rw-r--r--tex/context/base/status-files.pdfbin24691 -> 24721 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin333362 -> 333473 bytes
-rw-r--r--tex/context/base/strc-reg.lua4
-rw-r--r--tex/context/base/strc-reg.mkiv18
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
11 files changed, 126 insertions, 9 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 6a7a8e714..0f004eacc 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.10.20 19:31}
+\newcontextversion{2014.10.20 21: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 fc46759fd..3c4ce91fc 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 9e9ee8fd3..29460fb94 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.10.20 19:31}
+\edef\contextversion{2014.10.20 21:10}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv
index 055f72dc9..51173d09f 100644
--- a/tex/context/base/mult-def.mkiv
+++ b/tex/context/base/mult-def.mkiv
@@ -75,6 +75,7 @@
\def\c!groupsuffix {groupsuffix}
\def\c!properties {properties}
\def\c!journalconversion {journalconversion}
+\def\c!register {register}
\def\c!referencemethod {referencemethod} % forward both
diff --git a/tex/context/base/publ-aut.lua b/tex/context/base/publ-aut.lua
index 5267bd9bd..fdd17f34b 100644
--- a/tex/context/base/publ-aut.lua
+++ b/tex/context/base/publ-aut.lua
@@ -324,6 +324,7 @@ function commands.btxauthor(dataset,tag,field,settings)
local etaldisplay = tonumber(settings.etaldisplay) or etallimit
local combiner = settings.combiner
local symbol = settings.symbol
+ local index = settings.index
if not combiner or combiner == "" then
combiner = "normal"
end
@@ -336,12 +337,17 @@ function commands.btxauthor(dataset,tag,field,settings)
end
currentauthordata = split
currentauthorsymbol = symbol
- for i=1,max do
+
+ local function oneauthor(i)
local author = split[i]
- local state = author.state or 0
- ctx_btxstartauthor(i,max,state)
- ctx_btxsetconcat(concatstate(i,max))
- ctx_btxsetauthorvariant(combiner)
+ if index then
+ ctx_btxstartauthor(i,1,0)
+ else
+ local state = author.state or 0
+ ctx_btxstartauthor(i,max,state)
+ ctx_btxsetconcat(concatstate(i,max))
+ ctx_btxsetauthorvariant(combiner)
+ end
local initials = author.initials
if initials and #initials > 0 then
ctx_btxsetinitials() -- (concat(the_initials(initials,symbol)," "))
@@ -362,7 +368,7 @@ function commands.btxauthor(dataset,tag,field,settings)
if juniors and #juniors > 0 then
ctx_btxsetjuniors() -- (concat(juniors," "))
end
- if i == max then
+ if not index and i == max then
local overflow = #split - max
if overflow > 0 then
ctx_btxsetoverflow(overflow)
@@ -371,6 +377,14 @@ function commands.btxauthor(dataset,tag,field,settings)
ctx_btxsetup(combiner)
ctx_btxstopauthor()
end
+
+ if index then
+ oneauthor(index)
+ else
+ for i=1,max do
+ oneauthor(i)
+ end
+ end
end
-- We can consider creating a hashtable key -> entry but I wonder if
@@ -419,6 +433,8 @@ end
writers.author = writer
writers.editor = editor
+publications.serializeauthor = writer -- helper
+
local function newsplitter(splitter)
return table.setmetatableindex({},function(t,k) -- could be done in the sorter but seldom that many shared
local v = splitter(k,true) -- in other cases
@@ -486,6 +502,34 @@ function authors.sorted(dataset,list,sorttype) -- experimental
end
end
+local f_author = formatters[ [[\dobtxindexedauthor{%s}{%s}{%s}{%s}]] ]
+local writer = publications.serializeauthor
+
+function commands.btxauthortoregister(register,dataset,tag)
+ local current = datasets[dataset]
+ local details = current.details
+ local detail = details[tag]
+ if detail then
+ local author = detail.author
+ if author then
+ for i=1,#author do
+ local a = author[i]
+ local k = writer {a}
+ local e = f_author(dataset,tag,"author",i)
+ context.dosetfastregisterentry(register,e,k)
+ -- context.setregisterentry(
+ -- { register },
+ -- {
+ -- ["entries:1"] = e,
+ -- ["keys:1"] = k,
+ -- }
+ -- )
+ end
+ end
+ end
+end
+
+
-- local dataset = publications.datasets.test
--
-- local function add(str)
diff --git a/tex/context/base/publ-ini.mkiv b/tex/context/base/publ-ini.mkiv
index 0c08c73b1..a58ea8eac 100644
--- a/tex/context/base/publ-ini.mkiv
+++ b/tex/context/base/publ-ini.mkiv
@@ -1179,6 +1179,56 @@
\let\btxhandlelisttextentry\btx_entry_inject
+%D Registers
+
+\def\btx_cite_reference_inject_indeed
+ {\btx_trace_list_cross\currentbtxbacklink\empty
+ %
+ \edef\p_register{\btxcitevariantparameter\c!register}%
+ \ifx\p_register\empty\else
+ \ctxcommand{btxauthortoregister("\p_register","\currentbtxdataset","\currentbtxtag")}%
+ \fi
+ %
+ \normalexpanded{\writedatatolist
+ [\s!btx]%
+ [\s!btxset=\currentbtxdataset,%
+ \s!btxref=\currentbtxtag,%
+ \ifx\p_publ_cite_lefttext \empty\else\s!btxltx={\p_publ_cite_lefttext },\fi%
+ \ifx\p_publ_cite_righttext\empty\else\s!btxrtx={\p_publ_cite_righttext},\fi%
+ \s!btxint=\number\currentbtxbacklink
+ \ifx\currentbtxciteuservariables\empty\else,\currentbtxciteuservariables\fi]}}
+
+\unexpanded\def\dosetfastregisterentry#1#2#3% register entry key
+ {\begingroup
+ \edef\currentregister{#1}%
+ \setnextinternalreference
+ \xdef\currentregisternumber{\ctxcommand{storeregister{
+ metadata = { name = "\currentregister" },
+ entries = { { \!!bs#2\!!es }, { \!!bs#3\!!es } },
+ }
+ }}%
+ \xdef\currentregistersynchronize{\ctxlatecommand{enhanceregister("\currentregister",\currentregisternumber)}}%
+ \currentregistersynchronize % here?
+ \dostarttagged\t!registerlocation\currentregister
+ \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
+ \dotagregisterlocation
+ \dostoptagged
+ \endgroup}
+
+\unexpanded\def\btx_flush_specific_author#1#2#3#4% dataset tag field index
+ {\begingroup
+ \edef\currentbtxdataset{#1}%
+ \edef\currentbtxtag {#2}%
+ \edef\currentbtxfield {#3}%
+ \let\currentbtxlistvariant\currentbtxfield
+ \ctxcommand{btxauthor("\currentbtxdataset","\currentbtxtag","\currentbtxfield",{
+ kind = "list",
+ index = \number#4,
+ })}%
+ \endgroup}
+
+\let\dobtxindexedauthor\btx_flush_specific_author
+
%D Defaults:
\setbtxdataset
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 160bf723f..af6614d76 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 1e66ffbbc..e7066b4d0 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/strc-reg.lua b/tex/context/base/strc-reg.lua
index ff30bb0df..7d001953f 100644
--- a/tex/context/base/strc-reg.lua
+++ b/tex/context/base/strc-reg.lua
@@ -478,6 +478,10 @@ local function storeregister(rawdata) -- metadata, references, entries
local name = metadata.name
local notsaved = tobesaved[name].metadata.notsaved
--
+ if not references then
+ references = { }
+ rawdata.references = references
+ end
local internal = references.internal
if not internal then
internal = texgetcount("locationcount") -- we assume that it has been set
diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv
index 3fa673d24..aaa58ace4 100644
--- a/tex/context/base/strc-reg.mkiv
+++ b/tex/context/base/strc-reg.mkiv
@@ -308,6 +308,24 @@
\dostoptagged
\endgroup}
+\unexpanded\def\dosetfastregisterentry#1#2#3% register entry key
+ {\begingroup
+ \edef\currentregister{#1}%
+ \setnextinternalreference
+ \xdef\currentregisternumber{\ctxcommand{storeregister{
+ metadata = { name = "\currentregister" },
+ entries = { { \!!bs#2\!!es }, { \!!bs#3\!!es } },
+ }
+ }}%
+ % overlap with the above
+ \xdef\currentregistersynchronize{\ctxlatecommand{enhanceregister("\currentregister",\currentregisternumber)}}%
+ \currentregistersynchronize % here?
+ \dostarttagged\t!registerlocation\currentregister
+ \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup
+ \dotagregisterlocation
+ \dostoptagged
+ \endgroup}
+
\let\dotagregisterlocation\relax % experiment
\unexpanded\def\strc_registers_insert_entry[#1][#2]%
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 5639aa0c3..914729988 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 : 10/20/14 19:31:06
+-- merge date : 10/20/14 21:10:43
do -- begin closure to overcome local limits and interference