From 559696e3f6ee84a63a5cbf43fb32a9b5538db7e4 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 24 Aug 2019 09:59:49 +0200
Subject: started rewriting \lem

---
 ekdosis.dtx | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 7fab0d8..bf0a63c 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -512,7 +512,34 @@ idno={}, msName={}, origDate={}][3]{%
   \ekd@isinappfalse}
 \edef\ekdsep{: }
 \NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}}
-\newkeycommand+[\|]{\lem}[wit, alt, pre, post, prewit, postwit,
+\define@cmdkeys[ekd]{lemrdg}[ekdlr@]{wit, alt, pre, post, prewit,
+  postwit}
+\define@cmdkey[ekd]{lem}[ekdl@]{sep}[\ekdsep]{#1}
+\define@boolkeys[ekd]{lem}[ekdl@]{nolem, nosep}[true]
+\NewDocumentCommand{\lem}{O{} m}{%
+  #2%
+  \setkeys[ekd]{lemrdg,lem}{#1}%
+  \ifekdl@nolem\append@ln@app{}\else%
+  % 
+  \edef\lem@app{%
+    \ifdefined\ekdlr@alt
+      \ifdefined\ekdlr@pre\ekdlr@pre\else\fi
+      \ekdlr@alt
+      \ifdefined\ekdlr@post\ekdlr@post\else\fi
+    \else
+      \ifdefined\ekdlr@pre\ekdlr@pre\else\fi
+    #2
+    \ifdefined\ekdlr@post\ekdlr@post\else\fi    
+    \fi
+    \ifdefined\ekdlr@prewit\ekdlr@prewit\else\fi
+    \ifdefined\ekdlr@wit\ekdlr@wit\else\fi
+    \ifdefined\ekdlr@postwit\ekdlr@postwit\else\fi
+    %\ekdl@sep
+  }
+  \append@ln@app{\lem@app}
+  \fi%
+}
+\newkeycommand+[\|]{\lemout}[wit, alt, pre, post, prewit, postwit,
 sep={\ekdsep}, choice nosep={false,,true},
 choice nolem={false,,true}][1]{%
   #1%
-- 
cgit v1.2.3

