From 8021941131ddd111c58766848c74a72fc7d23777 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 18 Nov 2018 17:13:53 +0100
Subject: added 'wit, alt, pre, post, prewit, postwit' to \rdg

---
 ekdosis.dtx | 80 ++++++++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 56 insertions(+), 24 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index df443ab..858f1a3 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -387,42 +387,74 @@ Running "make install" installs the files in the local TeX tree.
     "pg_ii")}%
   \ifbool{ekdstate}{\add@apparatus}{}%
   #1}
-\newkeycommand+[\|]{\lem}[wit,alt,post,pre][1]{%
+\newkeycommand+[\|]{\lem}[wit, alt, pre, post, prewit, postwit][1]{%
   #1%
   |\ifbool{al@rlmode}|%
   {|\obappend|{%
       \bgroup%
-      |\setRL|\ifcommandkey{alt}{\commandkey{alt}%
+      |\setRL|%
+      \ifcommandkey{alt}{%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+        \commandkey{alt}%
         \ifcommandkey{pre}{ \commandkey{pre} }{}%
-      }{#1%
+      }{%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+        #1%
         \ifcommandkey{pre}{ \commandkey{pre} }{}%
       }%
       \egroup{}%
-      \ifcommandkey{wit}{ \commandkey{wit}}{}:}}%
-  {|\obappend|{\ifcommandkey{alt}{\commandkey{alt}%
+      \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
+      \ifcommandkey{wit}{ \commandkey{wit}}{}%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}:%
+    }}%
+  {|\obappend|{%
+      \ifcommandkey{alt}{%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+        \commandkey{alt}%
         \ifcommandkey{post}{ \commandkey{post} }{}%
-      }{#1%
+      }{%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+        #1%
         \ifcommandkey{post}{ \commandkey{post} }{}%
       }%
-      \ifcommandkey{wit}{ \commandkey{wit}}{}:}}%
+      \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
+      \ifcommandkey{wit}{ \commandkey{wit}}{}%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}:%
+    }}%
 }
-  % \NewDocumentCommand{\lem}{o +m}{\nonotetrue#2%  
-  %   \nonotefalse\bgroup\inappfalse%
-  %   \ifbool{al@rlmode}%
-  %   {\IfNoValueTF{#1}%
-  %     {\obappend{\bgroup\setRL#2\egroup:}}%
-  %     {\obappend{\bgroup\setRL#2\egroup{} #1:}}}%
-  %   {\IfNoValueTF{#1}{\obappend{#2:}}{\obappend{#2 #1:}}}%
-  %   \egroup%
-  % }
-\NewDocumentCommand{\rdg}{o +m}{%
-  \bgroup%
-  \ifbool{al@rlmode}%
-  {\IfNoValueTF{#1}
-    {\append{\bgroup\setRL#2\egroup}}
-    {\append{\bgroup\setRL#2\egroup{} #1}}}
-  {\IfNoValueTF{#1}{\append{#2}}{\append{#2 #1}}}%
-  \egroup%
+\newkeycommand+[\|]{\rdg}[wit, alt, pre, post, prewit, postwit][1]{%
+  |\ifbool{al@rlmode}|%
+  {|\append|{%
+      \bgroup%
+      |\setRL|%
+      \ifcommandkey{alt}{%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+        \commandkey{alt}%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+      }{%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+        #1%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+      }%
+      \egroup{}%
+      \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
+      \ifcommandkey{wit}{ \commandkey{wit}}{}%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}%
+    }}%
+  {|\append|{%
+      \ifcommandkey{alt}{%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+        \commandkey{alt}%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+      }{%
+        \ifcommandkey{pre}{ \commandkey{pre} }{}%
+        #1%
+        \ifcommandkey{post}{ \commandkey{post} }{}%
+      }%
+      \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
+      \ifcommandkey{wit}{ \commandkey{wit}}{}%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}%
+    }}%
 }
 \NewDocumentCommand{\note}{s +m}{%
   \IfBooleanTF{#1}{%
-- 
cgit v1.2.3

