summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/bibl-tra.lua1
-rw-r--r--tex/context/base/context-version.pdfbin4103 -> 4101 bytes
-rw-r--r--tex/context/base/grph-inc.lua4
-rw-r--r--tex/context/base/status-files.pdfbin24708 -> 24695 bytes
-rw-r--r--tex/context/base/strc-ref.lua65
-rw-r--r--tex/context/base/strc-ref.mkvi22
6 files changed, 71 insertions, 21 deletions
diff --git a/tex/context/base/bibl-tra.lua b/tex/context/base/bibl-tra.lua
index 6a7016023..e58aded3b 100644
--- a/tex/context/base/bibl-tra.lua
+++ b/tex/context/base/bibl-tra.lua
@@ -235,6 +235,7 @@ function hacks.resolve(prefix,block,reference) -- maybe already feed it split
if c[3] then
context.dowithbibtexnumrefrange(#collected,i,prefix,c[1],c[2],c[3],c[4])
else
+-- print(#collected,i,prefix,c[1],c[2])
context.dowithbibtexnumref(#collected,i,prefix,c[1],c[2])
end
end
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index d1aaca936..dc67d2670 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index 4f9d7fd92..392aa58b1 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -742,6 +742,9 @@ local function locate(request) -- name, format, cache
local pattern = figures_patterns[i]
if find(askedformat,pattern[1]) then
format = pattern[2]
+ if trace_figures then
+ report_inclusion("asked format %a matches %a",askedformat,pattern[1])
+ end
break
end
end
@@ -761,6 +764,7 @@ local function locate(request) -- name, format, cache
elseif quitscanning then
return register(askedname)
end
+ askedformat = format -- new per 2013-08-05
elseif trace_figures then
report_inclusion("unknown format %a",askedformat)
end
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index e77908f5f..c2beda085 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index adf88840f..9b4ec6ab7 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -18,7 +18,7 @@ local format, find, gmatch, match, concat = string.format, string.find, string.g
local floor = math.floor
local rawget, tonumber = rawget, tonumber
local lpegmatch = lpeg.match
-local copytable = table.copy
+local insert, remove, copytable = table.insert, table.remove, table.copy
local formatters = string.formatters
local allocate = utilities.storage.allocate
@@ -1381,25 +1381,36 @@ local function identify_inner_or_outer(set,var,i)
return v
end
-local components = job.structure.components
+ -- these get auto prefixes but are loaded in the document so they are
+ -- internal .. we also set the realpage (for samepage analysis)
-if components then
- for i=1,#components do
- local component = components[i]
- local data = collected[component]
- local vi = data and data[inner]
- if vi then
- var.outer = component
- var.i = vi
- var.kind = "outer with inner"
- set.external = true
- if trace_identifying then
- report_identify_outer(set,var,i,"4x")
- end
- return var
- end
+ local components = job.structure.components
+ if components then
+ for i=1,#components do
+ local component = components[i]
+ local data = collected[component]
+ local vi = data and data[inner]
+ if vi then
+-- var = copytable(var)
+-- var.kind = "inner"
+-- var.i = vi
+-- var.p = component
+-- runners.inner(var.r = vi.references.realpage
+-- if trace_identifying then
+-- report_identify_outer(set,var,i,"4x")
+-- end
+-- return var
+local v = identify_inner(set,copytable(var),component,collected) -- is copy needed ?
+if v.i and not v.error then
+ v.kind = "inner"
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4x")
end
+ return v
end
+ end
+ end
+ end
local componentreferences = productdata.componentreferences
local productreferences = productdata.productreferences
@@ -2164,3 +2175,23 @@ function references.import(usedname) end
function references.load (usedname) end
commands.exportreferences = references.export
+
+-- better done here .... we don't insert/remove, just use a pointer
+
+local prefixstack = { "" }
+local prefixlevel = 1
+
+function commands.pushreferenceprefix(prefix)
+ prefixlevel = prefixlevel + 1
+ prefixstack[prefixlevel] = prefix
+ context(prefix)
+end
+
+function commands.popreferenceprefix()
+ prefixlevel = prefixlevel - 1
+ if prefixlevel > 0 then
+ context(prefixstack[prefixlevel])
+ else
+ report_references("unable to pop referenceprefix")
+ end
+end
diff --git a/tex/context/base/strc-ref.mkvi b/tex/context/base/strc-ref.mkvi
index 28d759a7f..69ad4629e 100644
--- a/tex/context/base/strc-ref.mkvi
+++ b/tex/context/base/strc-ref.mkvi
@@ -75,6 +75,8 @@
%D document). By setting the \type{interaction} variable, one
%D can influences the way interactive references are set.
+\let\referenceprefix\empty
+
\installcorenamespace{referencing}
\installdirectcommandhandler \??referencing {referencing} % \??referencing
@@ -772,12 +774,24 @@
\unexpanded\def\setupglobalreferenceprefix[#prefix]%
{\xdef\referenceprefix{#prefix}}
+% \unexpanded\def\pushreferenceprefix#prefix%
+% {\pushmacro\referenceprefix
+% \xdef\referenceprefix{#prefix}} % global
+
+% \unexpanded\def\popreferenceprefix
+% {\popmacro\referenceprefix}
+
+\unexpanded\def\globalpushreferenceprefix#prefix%
+ {\xdef\referenceprefix{\ctxcommand{pushreferenceprefix("#prefix")}}}
+
+\unexpanded\def\globalpopreferenceprefix
+ {\xdef\referenceprefix{\ctxcommand{popreferenceprefix()}}}
+
\unexpanded\def\pushreferenceprefix#prefix%
- {\pushmacro\referenceprefix
- \xdef\referenceprefix{#prefix}}
+ {\edef\referenceprefix{\ctxcommand{pushreferenceprefix("#prefix")}}}
\unexpanded\def\popreferenceprefix
- {\popmacro\referenceprefix}
+ {\edef\referenceprefix{\ctxcommand{popreferenceprefix()}}}
\def\m_strc_references_prefix_yes{+}
\def\m_strc_references_prefix_nop{-}
@@ -800,7 +814,7 @@
\fi\fi\fi\fi}
\appendtoks
- \setupreferenceprefix[\referencingparameter\c!prefix]
+ \setupreferenceprefix[\referencingparameter\c!prefix]
\to \everysetupreferencing
%D We can typeset a reference using \type{\in}, \type{\at} and