From de0d2fc6be9726bd9a6e265fac653e6f8bd3cdcb Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 1 Sep 2022 11:26:32 +0200
Subject: added new option 'delim' to \lem

---
 ekdosis.dtx | 113 +++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 67 insertions(+), 46 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index a7a5b49..a1c3bb0 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -61,7 +61,7 @@ along with this program.  If not, see
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{ekdosis}
 %<*package>
-    [2022/08/28 v1.5-dev Typesetting TEI xml-compliant critical editions]
+    [2022/09/01 v1.5-dev Typesetting TEI xml-compliant critical editions]
 %</package>
 %<*driver>
 \begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -2011,13 +2011,17 @@ yesterday.
 % \vpageref{ref:ilabel-cmd}.} This allows for abbreviated lemmas
 % corresponding to spans of texts that cross verse, paragraph or
 % section boundaries as described below in \vnref{sec:lacunae}.\\
-% \DescribeOption{nodelim} |nodelim|$=$\verb+true|false+\\
-% \newfeature[v1.5] This named argument does not need a value as it
-% defaults to |true| if used. |nodelim| removes the delimiter that is
-% printed just before the entry in the apparatus criticus. This option
-% is typically used in rare occasions in combination with |nolem| and
-% |nonum| for entries that carry information not to be printed in the
-% apparatus but nevertheless to be retained in the \texttt{TEI xml}
+% \DescribeOption{delim} (no-value argument) \newfeature[v1.5]\\
+% |delim| takes no value. If used, this argument instructs to forcibly
+% print the delimiter that \pkg{ekdosis} may have decided not to print
+% in the apparatus criticus before the lemma text.\\
+% \DescribeOption{nodelim}  (no-value argument)\\
+% \newfeature[v1.5] |nodelim| takes no value. If used, this argument
+% removes the delimiter that is printed just before the entry in the
+% apparatus criticus. This option is typically used in rare occasions
+% in combination with |nolem| and |nonum| for entries that carry
+% information not to be printed in the apparatus but nevertheless to
+% be retained in the \texttt{TEI xml}
 % output file.\\
 % \DescribeOption{sep} |sep|$=$\meta{separator}\\
 % |sep| allows to change the symbol used to separate the lemma text
@@ -8399,7 +8403,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \paragraph{\textsf{ekdosis} Symbol}
 % \begin{macro}{\eKd}
-% \changes{v1.5}{2022/08/28}{Prints \textsf{ekdosis} indentifying
+% \changes{v1.5}{2022/09/01}{Prints \textsf{ekdosis} indentifying
 % symbol} As of v1.5, \pkg{ekdosis} has its own identifying
 % symbol. It is produced by \cs{eKd} and best printed with the Old
 % Standard Greek font.
@@ -8662,7 +8666,7 @@ Sample text with a \textcolor{red}{word} in red.
 % \begin{macro}{\teidirectE}
 % \changes{v1.3}{2021/08/18}{direct insertion of elements in the
 % \texttt{TEI xml} file}
-% \changes{v1.5}{2022/08/28}{direct insertion of empty elements in the
+% \changes{v1.5}{2022/09/01}{direct insertion of empty elements in the
 % \texttt{TEI xml} file}
 % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
 % does nothing in \LaTeX. It is only used to insert elements in the
@@ -8677,7 +8681,7 @@ Sample text with a \textcolor{red}{word} in red.
 % \end{macro}
 % \end{macro}
 % \begin{macro}{\getTEIxmlid}
-% \changes{v1.5}{2022/08/28}{returns \texttt{TEI xml:ids} from a
+% \changes{v1.5}{2022/09/01}{returns \texttt{TEI xml:ids} from a
 % csv-list of ids} This command returns from a csv-list of unique
 % identifiers declared in commands such as \cs{DeclareWitness} and the
 % like a space-separated list of their corresponding |xml:id|s, each
@@ -9425,7 +9429,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\App}
-% \changes{v1.5}{2022/08/28}{To be used conjointly with
+% \changes{v1.5}{2022/09/01}{To be used conjointly with
 % \texttt{ekdosis.el}}
 % In contrast to \cs{app}, \cs{App} takes two mandatory arguments and
 % accepts one optional argument like so:
@@ -9655,6 +9659,8 @@ Sample text with a \textcolor{red}{word} in red.
 %    \begin{macrocode}
 \newif\ifekdl@forcenum
 \newif\ifekdl@nonum
+\newif\ifekdl@nodelim
+\newif\ifekdl@forcedelim
 \newif\ifekdl@ilabel
 \ekvdefinekeys{lem}{
   code wit = \def\ekdlr@wit{#1},
@@ -9670,7 +9676,8 @@ Sample text with a \textcolor{red}{word} in red.
   store sep = \ekdl@sep,
   noval nonum = \ekdl@nonumtrue,
   noval num = \ekdl@forcenumtrue,
-  bool nodelim = \ifekdl@nodelim,
+  noval nodelim = \ekdl@nodelimtrue,
+  noval delim = \ekdl@forcedelimtrue,
   bool nolem = \ifekdl@nolem,
   nmeta Nolem = {nodelim, nonum, nolem},
   bool nosep = \ifekdl@nosep,
@@ -9771,32 +9778,42 @@ Sample text with a \textcolor{red}{word} in red.
       \luadirect{tex.sprint(ekdosis.getappdelim(\luastringO{\ekdan@type}))}}%
     \luadirect{tex.sprint(ekdosis.limit_bagunits(\luastringO{\ekdan@type}))}%
   \fi%
-  \ifekdl@nolem\edef\lem@app{%
-    % \hskip .75em
-    \ifekd@mapps
-    \unless\ifekdl@nodelim
-      \ifbool{subsq@unit@\ekdan@type}%
-             {\ekd@munit@delim}{}%
-    \fi
-    \else
-    \unless\ifekdl@nodelim
-      \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi
-    \fi
-    \fi%
-    \unless\ifekdl@nonum\current@ref\fi}%\hskip .25em}%
+  \ifekdl@nolem
+    \edef\lem@app{%
+      % \hskip .75em
+      \ifekd@mapps
+        \unless\ifekdl@nodelim
+          \ifbool{subsq@unit@\ekdan@type}%
+            {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}%
+        \fi
+      \else
+        \unless\ifekdl@nodelim
+          \ifsubsq@unit
+            \unexpanded\expandafter{\ekd@unit@delim}%
+          \else
+            \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi
+          \fi
+        \fi
+      \fi%
+      \unless\ifekdl@nonum\current@ref\fi
+    }%\hskip .25em}%
   \else%
   \ifbool{al@rlmode}{%
     \edef\lem@app{%
       % \hskip .75em
       \ifekd@mapps
-      \unless\ifekdl@nodelim
-        \ifbool{subsq@unit@\ekdan@type}%
-               {\ekd@munit@delim}{}%
-      \fi
+        \unless\ifekdl@nodelim
+          \ifbool{subsq@unit@\ekdan@type}%
+            {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}%
+        \fi
       \else
-      \unless\ifekdl@nodelim
-        \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi
-      \fi
+        \unless\ifekdl@nodelim
+          \ifsubsq@unit
+            \unexpanded\expandafter{\ekd@unit@delim}%
+          \else
+            \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi
+          \fi
+        \fi
       \fi%
       \unless\ifekdl@nonum\current@ref\fi%\hskip .25em
       \ifdefined\ekdlr@alt%
@@ -9828,14 +9845,18 @@ Sample text with a \textcolor{red}{word} in red.
     \edef\lem@app{%
       % \hskip .75em
       \ifekd@mapps
-      \unless\ifekdl@nodelim
-        \ifbool{subsq@unit@\ekdan@type}%
-               {\ekd@munit@delim}{}%
-      \fi
+        \unless\ifekdl@nodelim
+          \ifbool{subsq@unit@\ekdan@type}%
+            {\ekd@munit@delim}{\ifekdl@forcedelim\ekd@munit@delim\fi}%
+        \fi
       \else
-      \unless\ifekdl@nodelim
-        \ifsubsq@unit\unexpanded\expandafter{\ekd@unit@delim}\fi
-      \fi
+        \unless\ifekdl@nodelim
+          \ifsubsq@unit
+            \unexpanded\expandafter{\ekd@unit@delim}%
+          \else
+            \ifekdl@forcedelim\unexpanded\expandafter{\ekd@unit@delim}\fi
+          \fi
+        \fi
       \fi%
       \unless\ifekdl@nonum\current@ref\fi%\hskip .25em
       \ifdefined\ekdlr@alt%
@@ -10298,7 +10319,7 @@ Sample text with a \textcolor{red}{word} in red.
 % \end{macro}
 % \paragraph{Lacunae}
 % \begin{macro}{\ilabel}
-% \changes{v1.5}{2022/08/28}{recalls and sets the ending label of
+% \changes{v1.5}{2022/09/01}{recalls and sets the ending label of
 % lemmas used to mark lacunae in witnesses} When \cs{lem} has been
 % used with the optional argument |ilabel=<label>|,
 % \cs{ilabel}\marg{label} must be used to mark the point where the
@@ -10614,7 +10635,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\ekdEOprint}
-% \changes{v1.5}{2022/08/28}{Sets headers and footers on
+% \changes{v1.5}{2022/09/01}{Sets headers and footers on
 % \enquote{paired} facing pages}
 % To set headers and footers on \enquote{paired} facing pages,
 % \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like
@@ -10654,7 +10675,7 @@ Sample text with a \textcolor{red}{word} in red.
 % counter to set the value of the page numbers. This counter should be
 % incremented every two pages.
 % \begin{counter}{pairedpage}
-% \changes{v1.5}{2022/08/28}{A counter incremented every two pages}
+% \changes{v1.5}{2022/09/01}{A counter incremented every two pages}
 % |pairedpage| is first set as a global counter:---
 %    \begin{macrocode}
 \newcounter{pairedpage}
@@ -10662,19 +10683,19 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{counter}
 % \begin{macro}{\setpairedpagenum}
-%   \changes{v1.5}{2022/08/28}{sets the same page number on paired
+%   \changes{v1.5}{2022/09/01}{sets the same page number on paired
 %   pages} \cs{setpairedpagenum}\marg{number} is used just ahead of
 %   the alignment environment to set the number of the first left-hand
 %   paired page.
 % \begin{macro}{\setpairedpage}
-%   \changes{v1.5}{2022/08/28}{sets the page number of the first paired
+%   \changes{v1.5}{2022/09/01}{sets the page number of the first paired
 %   page} \cs{setpairedpage} is an argument-less command meant to be
 %   issued in commands used to set headers or footers before
 %   \cs{thepage}. This command has the counter |pairedpage|
 %   incremented on right-hand pages only, and sets |page| $\leftarrow$
 %   |pairedpage| on every page.
 % \begin{macro}{\resetpagenumber}
-%   \changes{v1.5}{2022/08/28}{resets normal running page numbers}
+%   \changes{v1.5}{2022/09/01}{resets normal running page numbers}
 %   \cs{resetpagenumber} must be used right out of \enquote{mirrored}
 %   paired pages alignment environments. This argument-less command
 %   corrects any numbering error on the page following the edition
-- 
cgit v1.2.3

