From aeae43d3534cf925e45e99e9abe0b0e365a73595 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 11 Apr 2019 12:13:23 +0200
Subject: new command \SetSeparator. \lem{}: new options 'nosep' 'sep' (need
 more work)

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

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 37fab9d..7bfc0f5 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -482,8 +482,11 @@ idno={}, msName={}, origDate={}][3]{%
   \ifbool{ekd@state}{\add@apparatus}{}%
   \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#1}))}%
   \ekd@isinappfalse}
+\edef\@sep{: }
+\NewDocumentCommand{\SetSeparator}{m}{\edef\@sep{#1}}
 \newkeycommand+[\|]{\lem}[wit, alt, pre, post, prewit, postwit,
-choice nolem={false,,true}][1]{%
+sep={\csname @sep\endcsname},
+choice nosep={false,,true}, choice nolem={false,,true}][1]{%
   #1%
   |\ifnum|%
   \commandkey{nolem}>0%
@@ -505,7 +508,12 @@ choice nolem={false,,true}][1]{%
       \egroup{}%
       \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
       \ifcommandkey{wit}{ \getsiglum{\commandkey{wit}}}{}%
-      \ifcommandkey{postwit}{ \commandkey{postwit}}{}:%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}%
+      |\ifnum|
+      \commandkey{nosep}>0%
+      |\else|
+      \commandkey{sep}%
+      |\fi|%
     }}%
   {\append@ln@app{%
       \ifcommandkey{alt}{%
@@ -519,7 +527,12 @@ choice nolem={false,,true}][1]{%
       }%
       \ifcommandkey{prewit}{ \commandkey{prewit} }{}%
       \ifcommandkey{wit}{ \getsiglum{\commandkey{wit}}}{}%
-      \ifcommandkey{postwit}{ \commandkey{postwit}}{}:%
+      \ifcommandkey{postwit}{ \commandkey{postwit}}{}%
+      |\ifnum|
+      \commandkey{nosep}>0%
+      |\else|
+      \commandkey{sep}%
+      |\fi|%
     }}%
   |\fi|}
 \newkeycommand+[\|]{\rdg}[wit, alt, pre, post, prewit, postwit][1]{%
@@ -832,6 +845,7 @@ end
 function ekdosis.textotei(str)
    str = xml_entities(str)
    str = string.gsub(str, "%s?\\par%s?", "</p>\n<p>")
+   str = string.gsub(str, "%s?\\unskip%s?", "")
    str = lem_rdg_totei(str)
    str = textotei(str)
    return str
-- 
cgit v1.2.3

