aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2017-01-04 17:55:28 +0100
committerRobert Alessi <alessi@robertalessi.net>2017-01-04 17:55:28 +0100
commit610ccf0ca3a8d3836e29f8a7c505ba21d9fd41c0 (patch)
tree0a31dec8940584b96df42c039eef79cad871a849
parent254f9a49d8a4dc9c19816e0369bfcfec67ba455e (diff)
downloadekdosis-610ccf0ca3a8d3836e29f8a7c505ba21d9fd41c0.tar.gz
use keyfloat
-rw-r--r--ekdosis.dtx34
1 files changed, 17 insertions, 17 deletions
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
40along with this program. If not, see 40along with this program. If not, see
41<http://www.gnu.org/licenses/>. 41<http://www.gnu.org/licenses/>.
42--]] 42--]]
43 43
44function closestream() 44function closestream()
45 os.remove(tex.jobname..".ekd") 45 os.remove(tex.jobname..".ekd")
46 os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd") 46 os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd")
@@ -51,6 +51,13 @@ function remove()
51 os.remove(tex.jobname..".ekd") 51 os.remove(tex.jobname..".ekd")
52end 52end
53 53
54function isintable(table, value)
55 for _, v in pairs(table) do
56 if v == value then return true end
57 end
58 return false
59end
60
54function appin(str, nl) 61function appin(str, nl)
55 local f = io.open(tex.jobname.."_tmp.ekd", "a+") 62 local f = io.open(tex.jobname.."_tmp.ekd", "a+")
56 if nl == "yes" then 63 if nl == "yes" then
@@ -93,14 +100,7 @@ end
93md5items = {} 100md5items = {}
94local salt = 0 101local salt = 0
95 102
96function isintable(table, value) 103function mdvappend(str)
97 for _, v in pairs(table) do
98 if v == value then return true end
99 end
100 return false
101end
102
103function mdv(str)
104 i = md5.sumhexa(str) 104 i = md5.sumhexa(str)
105 if not isintable(md5items, i) then 105 if not isintable(md5items, i) then
106 table.insert(md5items, i) 106 table.insert(md5items, i)
@@ -112,7 +112,7 @@ function mdv(str)
112 return "\\linelabel{"..i.."}\\append{\\getrefnumber{"..i.."} "..str.."}" 112 return "\\linelabel{"..i.."}\\append{\\getrefnumber{"..i.."} "..str.."}"
113end 113end
114 114
115-- of no use 115--[[ -- of no use
116function writemdv(str) 116function writemdv(str)
117 str = md5.sumhexa(str) 117 str = md5.sumhexa(str)
118 local f = io.open(tex.jobname.."_tmp.ekd", "a+") 118 local f = io.open(tex.jobname.."_tmp.ekd", "a+")
@@ -120,6 +120,7 @@ function writemdv(str)
120 f:close() 120 f:close()
121 return true 121 return true
122end 122end
123--]]
123 124
124%</lua> 125%</lua>
125%<*internal> 126%<*internal>
@@ -316,8 +317,7 @@ Running "make install" installs the files in the local TeX tree.
316\RequirePackage{lineno} 317\RequirePackage{lineno}
317\PassOptionsToPackage{addpageno}{lineno} 318\PassOptionsToPackage{addpageno}{lineno}
318\RequirePackage{vplref} 319\RequirePackage{vplref}
319\RequirePackage{float} 320\RequirePackage{keyfloat}
320\newfloat{apparat}{b}{lap}
321\RequirePackage{afterpage} 321\RequirePackage{afterpage}
322\RequirePackage{refcount} 322\RequirePackage{refcount}
323% \end{macrocode} 323% \end{macrocode}
@@ -327,6 +327,8 @@ Running "make install" installs the files in the local TeX tree.
327% \end{macrocode} 327% \end{macrocode}
328% \begin{macrocode} 328% \begin{macrocode}
329\AtEndDocument{\luadirect{closestream()}} 329\AtEndDocument{\luadirect{closestream()}}
330% \end{macrocode}
331% \begin{macrocode}
330\newbool{isapp} 332\newbool{isapp}
331\newbool{ekdstate} 333\newbool{ekdstate}
332\newbool{ekdstarted} 334\newbool{ekdstarted}
@@ -339,17 +341,15 @@ Running "make install" installs the files in the local TeX tree.
339 \luadirect{appin(\luastring{</\getpagerefnumber{ekd:\theekd@lab}>}, "yes")}% 341 \luadirect{appin(\luastring{</\getpagerefnumber{ekd:\theekd@lab}>}, "yes")}%
340 \stepcounter{ekd@lab}}{}} 342 \stepcounter{ekd@lab}}{}}
341\NewDocumentCommand{\obappend}{+m}% 343\NewDocumentCommand{\obappend}{+m}%
342 {\luadirect{tex.sprint(mdv(\luastringN{#1}))}} 344 {\luadirect{tex.sprint(mdvappend(\luastringN{#1}))}}
343\NewDocumentCommand{\apparatus}{}{\luadirect{tex.sprint(appout())}} 345\NewDocumentCommand{\apparatus}{}{\luadirect{tex.sprint(appout())}}
344\NewDocumentCommand{\testapparatus}{}{\luadirect{tex.sprint(testapparatus())}} 346\NewDocumentCommand{\testapparatus}{}{\luadirect{tex.sprint(testapparatus())}}
345\def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext} 347\def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
346\def\add@@apparatus{% 348\def\add@@apparatus{%
347 \testapparatus% 349 \testapparatus%
348 \ifbool{isapp}{% 350 \ifbool{isapp}{%
349 \begin{apparat}[b!] 351 \keyparbox[b]{}{\rule{5cm}{0.5pt}\\ \footnotesize\apparatus}
350 \rule{5cm}{0.5pt}\\ 352}{}}
351 \footnotesize\apparatus
352 \end{apparat}}{}}
353\def\add@apparatus{% 353\def\add@apparatus{%
354 \add@@apparatus% 354 \add@@apparatus%
355 \afterpage{\add@apparatus}} 355 \afterpage{\add@apparatus}}