summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-10-15 15:03:57 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-10-15 15:03:57 +0200
commit6ca88e6f1f15cea89db047839c3126a501f39eea (patch)
treee87d8a0ad20389157a8ccb02278d3a94152877c9 /tex/context/base/mkiv
parentcc7fcf11d31b2db23ba3adca896507f9faf128cc (diff)
downloadcontext-6ca88e6f1f15cea89db047839c3126a501f39eea.tar.gz
2021-10-15 13:59:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/mult-def.lua6
-rw-r--r--tex/context/base/mkiv/spac-ver.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24821 -> 24822 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin253942 -> 253826 bytes
-rw-r--r--tex/context/base/mkiv/strc-doc.lua80
-rw-r--r--tex/context/base/mkiv/strc-ref.lua1
8 files changed, 88 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 022391a60..c97e9b74b 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.10.13 16:56}
+\newcontextversion{2021.10.15 13:57}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index ed579d53a..24aa443d2 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.10.13 16:56}
+\edef\contextversion{2021.10.15 13:57}
%D Kind of special:
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index bb3f458bf..7c62df864 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -7,7 +7,11 @@ if not modules then modules = { } end modules ['mult-def'] = {
dataonly = true,
}
--- we can remove some commands, like inleftmargin and so (see typo-mar.mkiv)
+-- We can remove some commands, like inleftmargin and so (see typo-mar.mkiv). Also,
+-- some keywords are unique for mkiv or lmtx so at some point we might split this
+-- file. On the other hand, it's a way to standardize.
+
+-- StartMovie and StartSound etc can go.
return {
["commands"]={
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index efc157a2b..9e0bc2dd8 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -172,7 +172,7 @@ local nodepool = nuts.pool
local new_penalty = nodepool.penalty
local new_kern = nodepool.kern
-local new_glue = nodepool.glue
+----- new_glue = nodepool.glue
local new_rule = nodepool.rule
local nodecodes = nodes.nodecodes
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 50a3a1f99..6bcf6b371 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 57b1a2f59..aaba8ae4f 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-doc.lua b/tex/context/base/mkiv/strc-doc.lua
index 9094446c1..d613d1aa7 100644
--- a/tex/context/base/mkiv/strc-doc.lua
+++ b/tex/context/base/mkiv/strc-doc.lua
@@ -40,6 +40,8 @@ local v_all = variables.all
local v_positive = variables.positive
local v_current = variables.current
+local texgetcount = tex.getcount
+
local trace_sectioning = false trackers.register("structures.sectioning", function(v) trace_sectioning = v end)
local trace_details = false trackers.register("structures.details", function(v) trace_details = v end)
@@ -48,6 +50,7 @@ local report_used = logs.reporter("structure")
local context = context
local commands = commands
+local ctx_doifelse = commands.doifelse
local structures = structures
local helpers = structures.helpers
@@ -1211,3 +1214,80 @@ implement {
name = "popsectionblock",
actions = sections.popblock,
}
+
+interfaces.implement {
+ name = "doifelsefirstsectionpage",
+ arguments = "1 argument",
+ public = true,
+ protected = true,
+ actions = function(name)
+ local found = false
+ -- local list = structures.lists.collected
+ local list = lists.collected
+ if list then
+ local realpage = texgetcount("realpageno")
+ for i=1,#list do
+ local listdata = list[i]
+ local metadata = listdata.metadata
+ if metadata and metadata.kind == "section" and metadata.name == name then
+ -- local current = structures.documents.data.status[metadata.level]
+ local current = data.status[metadata.level]
+ if current and current.references.internal == listdata.references.internal then
+ found = listdata.references.realpage == realpage
+ break
+ end
+ end
+ end
+ end
+ ctx_doifelse(found)
+ end,
+}
+
+-- could be faster (in huge lists)
+
+-- local firstpages = table.setmetatableindex(function(t,name)
+-- -- local list = structures.lists.collected
+-- local list = lists.collected
+-- local pages = { }
+-- if list then
+-- for i=1,#list do
+-- local listdata = list[i]
+-- local metadata = listdata.metadata
+-- if metadata and metadata.kind == "section" and metadata.name == name then
+-- local references = listdata.references
+-- if references then
+-- pages[references.internal] = listdata
+-- end
+-- end
+-- end
+-- end
+-- t[name] = pages
+-- return pages
+-- end)
+--
+-- interfaces.implement {
+-- name = "doifelsefirstsectionpage",
+-- arguments = "1 argument",
+-- public = true,
+-- protected = true,
+-- actions = function(name)
+-- local found = firstpages[name]
+-- if found then
+-- local level = structures.sections.levelmap[name]
+-- if level then
+-- -- local current = structures.documents.data.status[level]
+-- local current = data.status[level]
+-- if current then
+-- local realpage = texgetcount("realpageno")
+-- found = found[current.references.internal]
+-- found = found and found.references.realpage == realpage
+-- else
+-- found = false
+-- end
+-- else
+-- found = false
+-- end
+-- end
+-- ctx_doifelse(found)
+-- end,
+-- }
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index ba4ee9c5d..2dee95b40 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -2662,7 +2662,6 @@ end
implement { name = "referenceposx", actions = function() context("%p",referencepos("x")) end }
implement { name = "referenceposy", actions = function() context("%p",referencepos("y")) end }
-
implement {
name = "referencecolumn",
actions = function()