From bb1788443ceb234c15451f189aa9e6390576a0d6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 13 Feb 2022 21:24:29 +0000 Subject: xindex (13feb22) git-svn-id: svn://tug.org/texlive/trunk@62002 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/lualatex/xindex/xindex-AU.lua | 2 +- .../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 | 6 +- .../tex/lualatex/xindex/xindex-baselib.lua | 28 ++++++++- .../tex/lualatex/xindex/xindex-cfg-common.lua | 72 ++++++++++++++++++---- .../tex/lualatex/xindex/xindex-cfg-uca.lua | 4 +- .../texmf-dist/tex/lualatex/xindex/xindex-cfg.lua | 4 +- .../tex/lualatex/xindex/xindex-danteedition.lua | 2 +- .../texmf-dist/tex/lualatex/xindex/xindex-dtk.lua | 4 +- .../texmf-dist/tex/lualatex/xindex/xindex-lib.lua | 32 ++++++---- .../tex/lualatex/xindex/xindex-norsk.lua | 4 +- .../tex/lualatex/xindex/xindex-pretty.lua | 4 +- .../tex/lualatex/xindex/xindex-yannis.lua | 4 +- 14 files changed, 127 insertions(+), 45 deletions(-) (limited to 'Master/texmf-dist/tex/lualatex') diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua index b1adc53813b..fd484a7d605 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-AU.lua @@ -9,7 +9,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-AU'] = { - version = 0.33, + version = 0.40, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua index 35ec8ab4625..a619a749690 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-DIN2.lua @@ -9,7 +9,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-DIN2'] = { - version = 0.33, + version = 0.35, 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 2244992db41..ac152ba7f97 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-HAdW-eKO.lua @@ -5,13 +5,13 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-HAdW-eKO.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-HAdW-eKO.lua 13 2021-08-15 10:49:40Z hvoss $ ----------------------------------------------------------------------- -- -- configuration for index files of the Heidelberger Akademie der Wissenschaften if not modules then modules = { } end modules ['xindex-HAdW-eKO'] = { - version = 0.35, + version = 0.34, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua index 20fa9a494d7..e7c16becf15 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua @@ -5,10 +5,10 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-base.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-base.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- -local info = { version = 0.35 } +local info = { version = 0.40 } -- check config if pageNoPrefixDel ~= "" then @@ -293,7 +293,7 @@ for k=1,#NewIndex do end indLines = indLines + 1 end - end + end -- not no_headings oldChar = currentChar end if specialItemOutput then diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua index 0ff33a591e1..4e5c09a87de 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-baselib.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-baselib.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-baselib.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-baselib'] = { - version = 0.35, + version = 0.40, comment = "base library to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -128,12 +128,36 @@ function romanToNumber(s) return ret end +function toNumber(s) -- number as string or a roman number to arabic number + if s == nil then return s end + if type(s) == "number" then return s end -- it is already a number + local rnum = romanToNumber(s) -- check if roman + if rnum then return rnum end -- if yes, return converted roman + return tonumber(s) -- return string to number +end + +--[[ function string:split() local sep, fields = " ", {} local pattern = string.format("([^%s]+)", sep) self:gsub(pattern, function(c) fields[#fields+1] = c end) return fields end +]] + +function string:split(s) + local D + if not s then + D = '%s' + else + D = tostring(s) + end + local sep, fields = " ", {} + local pattern = string.format("([^"..D.."]+)", sep) + self:gsub(pattern, function(c) fields[#fields+1] = c end) + return fields +end + function shellsort(a) local inc = math.ceil( #a / 2 ) 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 21267039d5e..270d5d5c3c4 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-common.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-cfg-common.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-cfg-common.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg-common'] = { - version = 0.35, + version = 0.40, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -17,17 +17,66 @@ if not modules then modules = { } end modules ['xindex-cfg-common'] = { } indexheader = { - cs = {"Symboly", "Čísla"}, - da = {"Symboler", "Tal"}, - de = {"Symbole", "Zahlen"}, - en = {"Symbols", "Numbers"}, - es = {"Símbolos", "Números"}, - fr = {"Symboles","Nombres"}, - it = {"Simboli", "Numeri"}, - jp = {"シンボル","番号"}, - no = {"Symboler","Tall"}, + cs = {"Symboly", "Čísla", "czech"}, + da = {"Symboler", "Tal", "danish"}, + de = {"Symbole", "Zahlen", "austrian", "german", "germanb", "ngerman", "naustrian"}, + en = {"Symbols", "Numbers", "english", "USenglish", "american", "UKenglish", "british", "canadian", "australian", "newzealand"}, + es = {"Símbolos", "Números", "spanish"}, + fr = {"Symboles","Nombres", "french", "francais", "canadien", "acadian"}, + it = {"Simboli", "Numeri", "italian"}, + jp = {"シンボル","番号", "japanese"}, + nl = {"Symbolen", "Nummers", "dutch"}, + no = {"Symboler","Tall", "norsk", "nynorsk"}, } +--[[ babel +afrikaans +azerbaijani +basque +breton +bulgarian +catalan +croatian +czech +danish +dutch +english, USenglish, american, UKenglish, british, canadian, australian, newzealand +esperanto +estonian +finnish +french, francais, canadien, acadian +galician +austrian, german, germanb, ngerman, naustrian +greek, polutonikogreek +hebrew +icelandic +indonesian (bahasa, indon, bahasai) +interlingua +irish +italian +latin +lowersorbian +malay, melayu (bahasam) +samin +norsk, nynorsk +polish +portuguese +brazilian (portuges, brazil) +romanian +russian +scottish +spanish +slovak +slovene +swedish +serbian +turkish +ukrainian +uppersorbian +welsh +]] + + folium = { cs = {"f.", "ff."}, da = {"f", "ff"}, @@ -37,6 +86,7 @@ folium = { fr = {"\\,sq.","\\,sqq."}, it = {"f", "ff"}, jp = {"シンボル","番号"}, + nl = {"f.", "ff."}, no = {"\\,f.","\\,ff."}, } diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua index 098e314e3e9..cd5b5dbb128 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg-uca.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-cfg-uca.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-cfg-uca.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg-lua'] = { - version = 0.35, + version = 0.40, comment = "configuration to xindex-cfg-uca.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 0adba23737f..1ee09e57dc3 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-cfg.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-cfg.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-cfg.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.35, + version = 0.40, comment = "main configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua index c39f92d652c..246f8776231 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-danteedition.lua @@ -9,7 +9,7 @@ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.36, + version = 0.40, comment = "configuration file for the DANTE Edition", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua index 945094663f5..d4e10b75da8 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-dtk.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-dtk.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-dtk.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-cfg'] = { - version = 0.35, + version = 0.40, comment = "DTK configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua index dedf476ac2c..61c4f90d9d0 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-lib.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-lib.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-lib.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-lib'] = { - version = 0.35, + version = 0.40, comment = "main library to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", @@ -311,8 +311,8 @@ function compressEntryList(EntryList) end end -- last data line - newList[#newList]["pages"] = deletePageDups(newList[#newList]["pages"]) -- require 'xindex-pretty'.dump(newList) -- only for internal dump + newList[#newList]["pages"] = deletePageDups(newList[#newList]["pages"]) return newList end @@ -354,14 +354,14 @@ end function compressPageList(pages) -- called with (v["pages"]) writeLog(1,"compressPageList: we have "..#pages.." pages for this entry\n",2) -- require 'xindex-pretty'.dump(pages) -- only for internal dump - pages = deletePageDups(pages) -- delete duplicate page numners with same special + pages = deletePageDups(pages) -- delete duplicate page numbers with same special local str if #pages == 1 then -- only one pageno return pages end -- only one pageno if #pages == 2 then -- only two pages - if tonumber(pages[1]["number"]) and tonumber(pages[2]["number"]) then - if ((tonumber(pages[2]["number"]) - tonumber(pages[1]["number"])) == 1) and (pages[1]["special"] == pages[2]["special"]) then + if toNumber(pages[1]["number"]) and toNumber(pages[2]["number"]) then + if ((toNumber(pages[2]["number"]) - toNumber(pages[1]["number"])) == 1) and (pages[1]["special"] == pages[2]["special"]) then if fCompress then pages[1]["number"] = pages[1]["number"]..page_folium[1] pages[2] = nil @@ -392,8 +392,8 @@ function compressPageList(pages) -- called with (v["pages"]) end if args_v then print ("compressPageList: more than two pages for the entry\n") end for i=startIndex,#pages do - if tonumber(pages[i-1]["number"]) and tonumber(pages[i]["number"]) then -- de we have something like 17--31 in the current list - if ((tonumber(pages[i]["number"])-tonumber(pages[i-1]["number"])) == 1) and + if (toNumber(pages[i-1]["number"]) and toNumber(pages[i]["number"])) then -- do we have two arabic or two roman numbers? + if ((toNumber(pages[i]["number"])-toNumber(pages[i-1]["number"])) == 1) and (pages[i]["special"] == pages[i-1]["special"]) then -- something like 12, 13 with identical |\special series[#series+1] = pages[i]-- page difference is 1, add page to series elseif (#series == 1) then -- no -f page -> only one page -> output @@ -529,10 +529,18 @@ function GenerateSortKey(a) end if no_caseSensitive then A = NormalizedUpper(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!',' ')) -- replace! by empty - a["SortKey"] = A + if ignoreSpace then + a["SortKey"] = A:gsub("%s+", "") -- remove spaces + else + a["SortKey"] = A + end else A = NormalizedChars(getSortString(a["Entry"].." "..Apage..a["pages"][1]["special"]):gsub('!',' ')) -- replace! by empty - a["SortKey"] = A + if ignoreSpace then + a["SortKey"] = A:gsub("%s+", "")-- remove spaces + else + a["SortKey"] = A + end end -- return A end @@ -754,12 +762,12 @@ end function itemOutput(last, v, hyperpage) local lastItems = last --- print (tostring("test: "),v["Entry"],lastItems[1],lastItems[2],lastItems[3],type(lastItems[1]),#lastItems) + --print (tostring("test: "),v["Entry"],lastItems[1],lastItems[2],lastItems[3],type(lastItems[1]),#lastItems) local currentItems = {} local Entry = v["Entry"] local mainEntry = getItem(Entry,0) -- save current main letter local lastmainEntry = last[1] -- save last main letter --- require 'xindex-pretty'.dump(v) -- only for internal dump + --require 'xindex-pretty'.dump(v) -- only for internal dump local str local excl = select(2,string.gsub(Entry,"!","!")) -- Number of ! writeLog(1,"itemOutput(): We have entry "..Entry.."\n",2) diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua index 6d6853dd03b..9e02d3018c0 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua @@ -6,11 +6,11 @@ -- MODIFIED: Sveinung Heggen (2020-01-02) -- LICENSE: LPPL1.3 -- --- $Id: xindex-norsk.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-norsk.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-no'] = { - version = 0.35, + version = 0.40, comment = "configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua index 80699a0313b..e626c1225be 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-pretty.lua @@ -3,11 +3,11 @@ -- Also provides a sandboxed Lua table reader and -- a function to present large numbers in human-friendly format. -- --- $Id: xindex-pretty.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-pretty.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-pretty'] = { - version = 0.35, + version = 0.40, comment = "dump a Lua table for debugging", author = "Steve Donovan", copyright = "Steve Donovan", diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua index 93757ea4132..dceb9bf3cd9 100644 --- a/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua +++ b/Master/texmf-dist/tex/lualatex/xindex/xindex-yannis.lua @@ -5,11 +5,11 @@ -- AUTHOR: Herbert Voß -- LICENSE: LPPL1.3 -- --- $Id: xindex-yannis.lua 19 2022-01-22 09:59:15Z hvoss $ +-- $Id: xindex-yannis.lua 22 2022-02-07 12:18:15Z hvoss $ ----------------------------------------------------------------------- if not modules then modules = { } end modules ['xindex-yannis'] = { - version = 0.35, + version = 0.40, comment = "main configuration to xindex.lua", author = "Herbert Voss", copyright = "Herbert Voss", -- cgit v1.2.3