From a3e4294f4c1c16a8b065ad2301da1cdb2f16c03a Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 11 Nov 2018 21:00:03 +0100
Subject: ekdstarted boolean was needed in \add@apparatus

---
 ekdosis.dtx | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 523ae9c..593c1a9 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -343,10 +343,10 @@ Running "make install" installs the files in the local TeX tree.
 \AtEndDocument{\luadirect{closestream()}}
 %    \end{macrocode}
 %    \begin{macrocode}
+\newbool{ekdstarted}
 \newbool{isapp}
 \newbool{doapp}
 \newbool{ekdstate}
-% \newbool{ekdstarted}
 \providebool{al@rlmode}
 \newcounter{ekd@lab}
 \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
@@ -364,9 +364,12 @@ Running "make install" installs the files in the local TeX tree.
   }%
 }
 \def\add@apparatus{%
-  \ifbool{isapp}{\testapparatus}{\add@@apparatus%
-    \global\setbool{isapp}{true}}%
-  \ifbool{doapp}{\add@@apparatus}{}%
+  % \ifbool{isapp}{\testapparatus}{\add@@apparatus%
+  % \setbool{isapp}{true}}%
+  \notbool{ekdstarted}{\add@@apparatus%
+    \global\setbool{ekdstarted}{true}}
+  {\testapparatus%
+    \ifbool{doapp}{\add@@apparatus}{}}%
 }
 \NewDocumentCommand{\append}{+m}{%
   \ifbool{ekdstate}{%
@@ -384,7 +387,7 @@ Running "make install" installs the files in the local TeX tree.
   \luadirect{%
     ekdosis.storeabspg(\luastring{\zref@extract{ekd:\theekd@lab}{abspage}},
     "pg_ii")}%
-  \add@apparatus%
+  \ifbool{ekdstate}{\add@apparatus}{}%
     #1}
 \NewDocumentCommand{\lem}{o +m}{%
   \ifbool{al@rlmode}%
@@ -424,10 +427,9 @@ Running "make install" installs the files in the local TeX tree.
 \NewDocumentCommand{\EkdosisOn}{}{\setbool{ekdstate}{true}}
 \NewDocumentCommand{\EkdosisOff}{}{%
   \setbool{ekdstate}{false}%
-  \global\setbool{isapp}{false}%
+  % \setbool{isapp}{false}%
 }
 \newenvironment{ekdosis}{%
-  % \ifbool{ekdstarted}{}{\EkdosisStart\global\setbool{ekdstarted}{true}}
   \EkdosisStart%
   \EkdosisOn}{\EkdosisOff}
 %    \end{macrocode}
-- 
cgit v1.2.3

