From 610ccf0ca3a8d3836e29f8a7c505ba21d9fd41c0 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Wed, 4 Jan 2017 17:55:28 +0100
Subject: use keyfloat

---
 ekdosis.dtx | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 439ae5f..92d673d 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -40,7 +40,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see
 <http://www.gnu.org/licenses/>.
 --]]
-	  
+
 function closestream()
       os.remove(tex.jobname..".ekd")
       os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd")
@@ -51,6 +51,13 @@ function remove()
    os.remove(tex.jobname..".ekd")
 end
 
+function isintable(table, value)
+   for _, v in pairs(table) do
+      if v == value then return true end
+   end
+   return false
+end
+
 function appin(str, nl)
       local f = io.open(tex.jobname.."_tmp.ekd", "a+")
       if nl == "yes" then
@@ -93,14 +100,7 @@ end
 md5items = {}
 local salt = 0
 
-function isintable(table, value)
-   for _, v in pairs(table) do
-      if v == value then return true end
-   end
-   return false
-end
-
-function mdv(str)
+function mdvappend(str)
    i = md5.sumhexa(str)
    if not isintable(md5items, i) then
       table.insert(md5items, i)
@@ -112,7 +112,7 @@ function mdv(str)
    return "\\linelabel{"..i.."}\\append{\\getrefnumber{"..i.."} "..str.."}"
 end
 
--- of no use
+--[[ -- of no use
 function writemdv(str)
    str = md5.sumhexa(str)
    local f = io.open(tex.jobname.."_tmp.ekd", "a+")
@@ -120,6 +120,7 @@ function writemdv(str)
    f:close()
    return true
 end
+--]]
 
 %</lua>
 %<*internal>
@@ -316,8 +317,7 @@ Running "make install" installs the files in the local TeX tree.
 \RequirePackage{lineno}
 \PassOptionsToPackage{addpageno}{lineno}
 \RequirePackage{vplref}
-\RequirePackage{float}
-\newfloat{apparat}{b}{lap}
+\RequirePackage{keyfloat}
 \RequirePackage{afterpage}
 \RequirePackage{refcount}
 %    \end{macrocode}
@@ -327,6 +327,8 @@ Running "make install" installs the files in the local TeX tree.
 %    \end{macrocode}
 %    \begin{macrocode}
 \AtEndDocument{\luadirect{closestream()}}
+%    \end{macrocode}
+%    \begin{macrocode}
 \newbool{isapp}
 \newbool{ekdstate}
 \newbool{ekdstarted}
@@ -339,17 +341,15 @@ Running "make install" installs the files in the local TeX tree.
     \luadirect{appin(\luastring{</\getpagerefnumber{ekd:\theekd@lab}>}, "yes")}%
     \stepcounter{ekd@lab}}{}}
 \NewDocumentCommand{\obappend}{+m}%
-  {\luadirect{tex.sprint(mdv(\luastringN{#1}))}}
+  {\luadirect{tex.sprint(mdvappend(\luastringN{#1}))}}
 \NewDocumentCommand{\apparatus}{}{\luadirect{tex.sprint(appout())}}
 \NewDocumentCommand{\testapparatus}{}{\luadirect{tex.sprint(testapparatus())}}
 \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
 \def\add@@apparatus{%
   \testapparatus%
   \ifbool{isapp}{%
-    \begin{apparat}[b!]
-      \rule{5cm}{0.5pt}\\
-      \footnotesize\apparatus
-    \end{apparat}}{}}
+    \keyparbox[b]{}{\rule{5cm}{0.5pt}\\ \footnotesize\apparatus}
+}{}}
 \def\add@apparatus{%
   \add@@apparatus%
   \afterpage{\add@apparatus}}
-- 
cgit v1.2.3

