diff options
author | Karl Berry <karl@freefriends.org> | 2022-01-22 21:03:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-01-22 21:03:20 +0000 |
commit | cdf946a4c2d4105eba2a5bec9a9608a3c2e178c3 (patch) | |
tree | 4537c299eafae52df1691ca9656c352563c3917f /Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua | |
parent | 84657de6b123a17eb3af55b3ed14ee47c671d7c8 (diff) |
xindex (22jan22)
git-svn-id: svn://tug.org/texlive/trunk@61696 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua b/Master/texmf-dist/tex/lualatex/xindex/xindex-base.lua index 2bc1fad8d37..20fa9a494d7 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 13 2021-08-15 10:49:40Z hvoss $ +-- $Id: xindex-base.lua 19 2022-01-22 09:59:15Z hvoss $ ----------------------------------------------------------------------- -local info = { version = 0.34 } +local info = { version = 0.35 } -- check config if pageNoPrefixDel ~= "" then @@ -49,10 +49,12 @@ if hyperpage then writeLog(1,"We have hyperpages ... \n",1) end --for _,l in pairs(lines) do print (l) end writeLog(1,"Change escape chars with macros ... \n",0) -for k,v in pairs(lines) do +for k,v in ipairs(lines) do if not commandEntry(v) then - for i, str0 in ipairs(escape_chars) do - v = v:gsub(str0[1],str0[2]) + for i, str0 in ipairs(escape_chars) do -- str0: esc-char, coded, char +-- print(str0[1],str0[2],v) + v = string.gsub(v,str0[1],str0[2]) +-- print("==> "..v) end if k < #lines then if commandEntry(lines[k+1]) then -- is the next line not a \indexentry ? @@ -222,6 +224,7 @@ for k=1,#NewIndex do firstSLine = false if not no_headings then outFile:write(idxnewletter.."{"..index_header[1].."}") + indLines = indLines + 1 -- outFile:write("\\par"..idxnewletter.."{"..index_header[1].."}") if no_labels then outFile:write("\n\\nopagebreak[4]\n") @@ -247,16 +250,20 @@ for k=1,#NewIndex do if firstNLine then firstNLine = false outFile:write("\n\\indexspace\n") + indLines = indLines + 1 if not no_headings then outFile:write(idxnewletter.."{"..index_header[2].."}") + indLines = indLines + 1 if no_labels then outFile:write("\n\\nopagebreak[4]\n") + indLines = indLines + 1 else if (labelPrefix == "") then outFile:write("\\label{xindex-numbers}\n\\nopagebreak[4]\n") else outFile:write("\\label{"..labelPrefix.."-xindex-numbers}\n\\nopagebreak[4]\n") end + indLines = indLines + 1 end end end @@ -272,8 +279,10 @@ for k=1,#NewIndex do writeLog(1,"We have letters to print ...\n",3) if (currentChar ~= oldChar) and (charType == 2) then outFile:write("\n\\indexspace\n") + indLines = indLines + 1 if not no_headings then outFile:write(idxnewletter.."{"..currentChar.."}") + indLines = indLines + 1 if no_labels then outFile:write("\n\\nopagebreak[4]\n") else @@ -282,6 +291,7 @@ for k=1,#NewIndex do else outFile:write("\\label{"..labelPrefix.."-xindex-"..currentChar.."}\n\\nopagebreak[4]\n") end + indLines = indLines + 1 end end oldChar = currentChar |