diff options
author | Norbert Preining <norbert@preining.info> | 2023-07-13 03:01:48 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-07-13 03:01:48 +0000 |
commit | 09fc70b0ee7cb93f02510dd10df6b769b62c9d76 (patch) | |
tree | 2b31427a79c780325ede59c5a45c5e97bad0342a /indexing/xindex/lualatex/xindex-lib.lua | |
parent | 0a2934080da36226eca1cdccfd08d76f67dca95a (diff) |
CTAN sync 202307130301
Diffstat (limited to 'indexing/xindex/lualatex/xindex-lib.lua')
-rw-r--r-- | indexing/xindex/lualatex/xindex-lib.lua | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/indexing/xindex/lualatex/xindex-lib.lua b/indexing/xindex/lualatex/xindex-lib.lua index f321765c64..86b103823b 100644 --- a/indexing/xindex/lualatex/xindex-lib.lua +++ b/indexing/xindex/lualatex/xindex-lib.lua @@ -9,7 +9,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-lib'] = { - version = 0.49, + version = 0.51, comment = "main library to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -558,20 +558,22 @@ function GenerateSortKey(a) end end -- s:gsub("%s+", "") strip spaces - if findStr(a["SortKey"],"\\parenLeft") < 2 then a["SortKey"] = '{ '..Apage end - if findStr(a["SortKey"],"\\parenRight") < 2 then a["SortKey"] = '} '..Apage end + if findStr(a["SortKey"],"\\braceLeft") < 2 then a["SortKey"] = '{ '..Apage end + if findStr(a["SortKey"],"\\braceRight") < 2 then a["SortKey"] = '} '..Apage end if findStr(a["SortKey"],"//escapedexcl//") < 2 then a["SortKey"] = '! '..Apage end if findStr(a["SortKey"],"//escapedquote//") < 2 then a["SortKey"] = '" '..Apage end if findStr(a["SortKey"],"//escapedat//") < 2 then a["SortKey"] = '@ '..Apage end if findStr(a["SortKey"],"//escapedvert//") < 2 then a["SortKey"] = '| '..Apage end +-- if findStr(a["SortKey"],"\\textbar") < 2 then a["SortKey"] = '| '..Apage end -- a["SortKey"] = a["SortKey"]:gsub("%s+", "") - -- print("Sortkey: " .. a["SortKey"]) if not use_UCA then -- test if it is a symbol after 9 and before A or after Z if (a["SortKey"]:byte() > 57 and a["SortKey"]:byte() < 65) or + (a["SortKey"]:byte() > 90 and a["SortKey"]:byte() < 97) or (a["SortKey"]:byte() > 122 and a["SortKey"]:byte() < 128) then -- symbol above digits a["SortKey"] = "/"..a["SortKey"] -- sort it after / end end + -- print("Sortkey: " .. a["SortKey"]) end function GenerateSortKeys(Index) @@ -781,14 +783,27 @@ function checkHyperpage(lines) end end if hyperpage then + if fix_hyperref then + writeLog(1,"fix vertical bar with hyperref ... ",0) + -- hyperref ignores the vertical bar in "| and also other escape chars + end + local sub_str = esc_char..'|hyperpage' for i=1,#lines do + if fix_hyperref then + s = lines[i]:find(sub_str) + print(i,lines[i],s) + if s == nil then s = 0 end + if s == 2 then + lines[i] = lines[i]:gsub(sub_str, '\\textbar|hyperpage') -- "| -> \textbar + end + end lines[i] = string.gsub(lines[i],'|?hyperpage}{','}{') - end + end -- for + writeLog(1,"done\n",0) return true, lines - else + else -- no hyperpage return false, lines end - return end function itemOutput(last, v, hyperpage) |