From bb3a18a8791a2f32a6c8a3e0c9ee15a643aefd89 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 7 Apr 2019 21:21:59 +0000 Subject: xindex (7apr19) git-svn-id: svn://tug.org/texlive/trunk@50842 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua | 2 +- .../tex/lualatex/xindex/xindex-HAdW-eKO.lua | 4 +-- .../texmf-dist/tex/lualatex/xindex/xindex-base.lua | 7 +++-- .../tex/lualatex/xindex/xindex-cfg-common.lua | 2 +- .../texmf-dist/tex/lualatex/xindex/xindex-cfg.lua | 4 +-- .../texmf-dist/tex/lualatex/xindex/xindex-dtk.lua | 2 +- .../texmf-dist/tex/lualatex/xindex/xindex-lapp.lua | 2 +- .../texmf-dist/tex/lualatex/xindex/xindex-lib.lua | 34 ++++++++++++++++++++-- .../tex/lualatex/xindex/xindex-pretty.lua | 2 +- 9 files changed, 44 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/tex/lualatex/xindex') diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua index dae45fa7fb7..cbf9dd6bc03 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua @@ -7,7 +7,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.09, + version = 0.10, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua index 1ceade22381..38ffcccab96 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua @@ -9,7 +9,7 @@ -- configuration for index files of the Heidelberger Akademie der Wissenschaften if not modules then modules = { } end modules ['xindex-HAdW-eKO'] = { - version = 0.09, + version = 0.10, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -27,7 +27,7 @@ sublabels = {"", "-\\,", "--\\,", "---\\,"} -- for the (sub(sub(sub-item pageNoPrefixDel = "" -- a delimiter for page numbers like "VI-17" indexOpening = "" -- commands after \begin{theindex} - +case_sensitive = false -- speeds up running --[[ Each character's position in this array-like table determines its 'priority'. diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua index 0588651541e..1a8919c1149 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua @@ -6,7 +6,7 @@ -- LICENSE: LPPL1.3 ----------------------------------------------------------------------- -local info = { version = 0.09} +local info = { version = 0.10} -- check config if pageNoPrefixDel ~= "" then @@ -135,6 +135,7 @@ writeLog(2,"Start writing .ind file ... \n",0) writeLog(1,"---------- Start list to write the ind file --------------\n",1) writeLog(1,require 'xindex-pretty'.dump(NewIndex),3) -- only for internal dump + for k=1,#NewIndex do -- require 'xindex-pretty'.dump(NewIndex[k]) -- only for internal dump if NewIndex[k]["Entry"] then @@ -147,7 +148,7 @@ 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 + firstChar = utf.sub(v["sortChar"],1,1) -- catch a translatet Ö->OE -- end currentChar = firstChar charType = getCharType(firstChar) @@ -213,7 +214,7 @@ for k=1,#NewIndex do outFile:write("\n\\indexspace\n") if not no_headings then outFile:write("\\textbf{"..currentChar.."}") - if (labelPrefix == "") then + if (labelPrefix == '""') then outFile:write("\\label{xindex-"..currentChar.."}\n\\nopagebreak[4]\n") else outFile:write("\\label{"..labelPrefix.."-xindex-"..currentChar.."}\n\\nopagebreak[4]\n") diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua index db8c81f6ade..6446cee0a62 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua @@ -7,7 +7,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg-common'] = { - version = 0.09, + version = 0.10, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua index 3ceea684e8e..f4a72a9ffcb 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua @@ -7,7 +7,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.09, + version = 0.10, comment = "main configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -50,7 +50,7 @@ alphabet_lower = { -- for sorting { 'r' }, { 's', 'š', 'ß' }, { 't' }, - { 'u', 'ú', 'ù', 'ü' }, + { 'u', 'ú', 'ù', 'ü' , 'û'}, { 'v' }, { 'w' }, { 'x' }, diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua index f04c359c663..82327ed597b 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua @@ -7,7 +7,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.09, + version = 0.10, comment = "DTK configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua index 5c7c8cd7715..f470fcb1e59 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-lapp.lua @@ -28,7 +28,7 @@ --~ n 2 -------------------------------- if not modules then modules = { } end modules ['xindex-lapp'] = { - version = 0.09, + version = 0.10, comment = "read parameter for xindex.lua", author = "Steve Donovan", copyright = "Steve Donovan", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua index b9464eb1f5f..a52b44cbbb0 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua @@ -7,7 +7,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-lib'] = { - version = 0.09, + version = 0.10, comment = "main library to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -68,6 +68,25 @@ function NormalizedUpper(strOrig) -- return normalized UTF string.upper (ä -> return str end +function NormalizedChars(strOrig) -- return normalized UTF string (ä -> a) with first as upper case + local c = string.upper(get_normalized_char(alphabet_lower,utf.sub(strOrig,1,1))) + local str = c + for i=2, utf.len(strOrig) do + c = get_normalized_char(alphabet_lower,utf.sub(strOrig,i,i)) + str = str..c + end + local strOrigTrue = strOrig + strOrig = str + c = string.upper(get_normalized_char(alphabet_upper,utf.sub(strOrig,1,1))) + str = c + for i=2, utf.len(strOrig) do + c = get_normalized_char(alphabet_upper,utf.sub(strOrig,i,i)) + str = str..c + end +-- print(strOrigTrue.." -> "..str) + return str +end + function checkVert(str) -- get the | part local vert = string.find(str,"|",1,true) if (vert) then @@ -510,8 +529,10 @@ function UTFCompare(a,b) Apage = string.format("%09s",a["pages"][1]["number"]) Bpage = string.format("%09s",b["pages"][1]["number"]) end - A = NormalizedUpper(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!','')) -- replace! by empty - B = NormalizedUpper(getSortString(b["Entry"].." "..Bpage..b["pages"][1]["special"]):gsub('!','')) + A = NormalizedChars(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!','')) -- replace! by empty + B = NormalizedChars(getSortString(b["Entry"].." "..Bpage..b["pages"][1]["special"]):gsub('!','')) +-- A = NormalizedUpper(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!','')) -- replace! by empty +-- B = NormalizedUpper(getSortString(b["Entry"].." "..Bpage..b["pages"][1]["special"]):gsub('!','')) writeLog(1,"UTFCompare: A--B "..A.."--"..B.."\n",2) -- print(A,B) --[[ @@ -572,6 +593,13 @@ function pageCompare(a,b) -- a = {{number=...,special=..},{...,...}} end end +function charCompare(a,b) -- compare only first char + local A,B + A = string.upper(utf.sub(a["sortChar"],1,1)) + B = string.upper(utf.sub(b["sortChar"],1,1)) + return A < B +end + function checkFF(p) if not p then return p end local P = tostring(p) diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua index 84754c18ce1..588f2d842a1 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua @@ -5,7 +5,7 @@ -- if not modules then modules = { } end modules ['xindex-pretty'] = { - version = 0.09, + version = 0.10, comment = "dump a Lua table for debugging", author = "Steve Donovan", copyright = "Steve Donovan", -- cgit v1.2.3