diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua index a055a97a1c4..e30a9182016 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/strc-bkm.lua @@ -18,7 +18,6 @@ if not modules then modules = { } end modules ['strc-bkm'] = { local next, type = next, type local gsub, lower = string.gsub, string.lower local concat = table.concat -local utfvalues = utf.values local settings_to_hash = utilities.parsers.settings_to_hash local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end) @@ -113,11 +112,13 @@ end function bookmarks.place() if next(names) then - local levels = { } - local noflevels = 0 - local lastlevel = 1 - local nofblocks = #lists.sectionblocks -- always >= 1 + local levels = { } + local noflevels = 0 + local lastlevel = 1 + local nofblocks = #lists.sectionblocks -- always >= 1 local showblocktitle = toboolean(numberspec.showblocktitle,true) +-- local allsections = sections.collected + local allblocks = sections.sectionblockdata for i=1,nofblocks do local block = lists.sectionblocks[i] local blockdone = nofblocks == 1 @@ -156,9 +157,9 @@ function bookmarks.place() if not blockdone then if showblocktitle then -- add block entry - local blockdata = sections.sectionblockdata[block] - noflevels = noflevels + 1 + local blockdata = allblocks[block] local references = li.references + noflevels = noflevels + 1 levels[noflevels] = { level = 1, -- toplevel title = stripped(blockdata.bookmark ~= "" and blockdata.bookmark or block), @@ -185,19 +186,29 @@ function bookmarks.place() title = titledata.title or "?" -- end end - if numbered[name] then - local sectiondata = sections.collected[li.references.section] - local numberdata = li.numberdata - if sectiondata and numberdata then - if not numberdata.hidenumber then - -- we could typeset the number and convert it - local number = sections.typesetnumber(sectiondata,"direct",numberspec,sectiondata) - if number and #number > 0 then - title = concat(number) .. " " .. title - end - end - end - end +-- if numbered[name] then +-- local sectiondata = allsections[li.references.section] +-- if sectiondata then +-- local numberdata = li.numberdata +-- if numberdata and not numberdata.hidenumber then +-- -- we could typeset the number and convert it +-- local number = sections.typesetnumber(sectiondata,"direct",numberspec,sectiondata) +-- if number and #number > 0 then +-- title = concat(number) .. " " .. title +-- end +-- end +-- end +-- end +if numbered[name] then + local numberdata = li.numberdata + if numberdata and not numberdata.hidenumber then + -- we could typeset the number and convert it + local number = sections.typesetnumber(numberdata,"direct",numberspec,numberdata) + if number and #number > 0 then + title = concat(number) .. " " .. title + end + end +end noflevels = noflevels + 1 local references = li.references levels[noflevels] = { |