From 35b751c33c56ff6cb3df176ce46f349c8c4a8043 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Wed, 10 Nov 2021 09:31:18 +0100 Subject: use ekd_abs_pg instead of cur_abs_pg in .ekd file --- ekdosis.dtx | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 9530825..751c1f3 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -811,7 +811,7 @@ along with this program. If not, see \usepackage{needspace} \NewDocumentCommand{\captof}{O{listing} m O{}}{% \bgroup - \needspace{5\baselineskip}% + \nobreak \vskip 1ex plus 2pt minus 2pt% \captionof{#1}{#2}% #3% @@ -11757,6 +11757,7 @@ function ekdosis.closestream() end local cur_abs_pg = 0 +local ekd_abs_pg = 0 local pg_i = nil local pg_ii = nil local prevcol = nil @@ -11770,13 +11771,18 @@ function ekdosis.update_abspg(n) -- not used end function ekdosis.storeabspg(n, pg) + if tonumber(n) > tonumber(cur_abs_pg) + then + ekd_abs_pg = ekd_abs_pg + 1 + end + cur_abs_pg = n + n = ekd_abs_pg if pg == "pg_i" then pg_i = n elseif pg == "pg_ii" then pg_ii = n table.insert(check_resetlineno, curcol.."-"..pg_ii) end - cur_abs_pg = n return true end @@ -12135,8 +12141,8 @@ function ekdosis.appin(str, teitype) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if next(apparatuses) == nil then - f:write("<", cur_abs_pg, cur_alignment, curcol, "-0>", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-0>", str, "\n") else for i = 1,#apparatuses do @@ -12145,8 +12151,8 @@ function ekdosis.appin(str, teitype) break end end - f:write("<", cur_abs_pg, cur_alignment, curcol, "-", - appno, ">", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-", + appno, ">", str, "\n") end f:close() return true @@ -12164,10 +12170,10 @@ function ekdosis.appout() table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces") -- table.insert(output, "\\noindent ") for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-0>.-") do @@ -12179,10 +12185,10 @@ function ekdosis.appout() local n = 1 while apparatuses[n] do - if string.match(t, "<"..cur_abs_pg + if string.match(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") then @@ -12250,10 +12256,10 @@ function ekdosis.appout() table.insert(output, "\\relax") end for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") do @@ -12273,8 +12279,8 @@ function ekdosis.appout() end f:close() str = table.concat(output) - str = string.gsub(str, "", "") - str = string.gsub(str, "<"..cur_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") + str = string.gsub(str, "", "") + str = string.gsub(str, "<"..ekd_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") return str else end @@ -12294,7 +12300,7 @@ end local curcol_curabspg = {} function ekdosis.testapparatus() - if isfound(curcol_curabspg, curcol.."-"..cur_abs_pg) + if isfound(curcol_curabspg, curcol.."-"..ekd_abs_pg) then if newalignment then @@ -12307,7 +12313,7 @@ function ekdosis.testapparatus() return "\\boolfalse{do@app}" end else - table.insert(curcol_curabspg, curcol.."-"..cur_abs_pg) + table.insert(curcol_curabspg, curcol.."-"..ekd_abs_pg) if next(apparatuses) ~= nil then reset_bagunits() end -- cgit v1.2.3