summaryrefslogtreecommitdiff
path: root/indexing/xindex/lualatex/xindex-base.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-19 03:01:20 +0000
committerNorbert Preining <norbert@preining.info>2023-01-19 03:01:20 +0000
commitc11207d3e9027d6aa4153a2103df58382d41e56e (patch)
treebde001e74895007216ab81847975bd9143182d60 /indexing/xindex/lualatex/xindex-base.lua
parent8491e6b8fb521fb1c79d3ce9376836c67050c381 (diff)
CTAN sync 202301190301
Diffstat (limited to 'indexing/xindex/lualatex/xindex-base.lua')
-rw-r--r--indexing/xindex/lualatex/xindex-base.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/indexing/xindex/lualatex/xindex-base.lua b/indexing/xindex/lualatex/xindex-base.lua
index a7bd416934..968d130ba8 100644
--- a/indexing/xindex/lualatex/xindex-base.lua
+++ b/indexing/xindex/lualatex/xindex-base.lua
@@ -8,7 +8,7 @@
-- $Id: xindex-base.lua 22 2022-02-07 12:18:15Z hvoss $
-----------------------------------------------------------------------
-local info = { version = 0.45 }
+local info = { version = 0.46 }
-- check config
if pageNoPrefixDel ~= "" then
@@ -47,6 +47,14 @@ if #lines == 0 then
os.exit()
end
+print("Presort of \\indexentry lines")
+table.sort(lines)
+if vlevel > 1 then
+ print("Pres-Sorted index list:")
+ for _,l in pairs(lines) do print (l) end
+end
+
+
if vlevel > 1 then
writeLog(1,"--------------- Input data -----------------\n",2)
for _,l in pairs(lines) do writeLog(1,l.."\n",2) end
@@ -214,10 +222,22 @@ for k=1,#NewIndex do
-- if utf8.codepoint(c) < 12288 then -- Japanese starts at hex 3000
-- firstChar = v["sortChar"]
-- else
- firstChar = utf.sub(v["sortChar"],1,1) -- catch a translatet Ö->OE
+ if language == "cs" then -- Czech language has special char ch
+ if utf.sub(v["sortChar"],1,2) == "CH" then
+ firstChar = "Ch"
+ else
+ firstChar = utf.sub(v["sortChar"],1,1)
+ end
+ else
+ firstChar = utf.sub(v["sortChar"],1,1) -- catch a translatet Ö->OE
+ end
-- end
currentChar = firstChar
- charType = getCharType(firstChar)
+ if string.len(firstChar) > 1 then
+ charType = getCharType(utf.sub(firstChar,1,1))
+ else
+ charType = getCharType(firstChar)
+ end
if charType == 0 then
numbers = false
symbols = true