From 6d0fdc5992ff1a56d470dffc41af5025cf64d1f1 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 19 Jul 2020 20:45:55 +0200
Subject: more control over expansion of \delim@val. new option
 numbers=elided|full (and defaults to elided)

---
 ekdosis.dtx | 84 +++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 48 insertions(+), 36 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index f2bae26..76e3fc4 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2653,7 +2653,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
     direction=#1}{`direction' must be either `LR' or `RL'.},
   store rule = \rule@val,
   nmeta norule = {rule=none},
-  store delim = \delim@val,
+  code delim = \def\delim@val{\unexpanded{#1}},
   store sep = \sep@val,
   store bhook = \bhook@val,
   store ehook = \ehook@val,
@@ -2951,6 +2951,42 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2},
       \luastringO{#1}))}}}
 %    \end{macrocode}
+% \paragraph{Lineation settings}
+% The keys to be used for lineation settings follow. A conditional is
+% defined beforehand so that \pkg{ekdosis} may know whether the
+% numbering should start afresh at the top of each page.
+%    \begin{macrocode}
+\newif\ifekd@pagelineation
+\NewDocumentCommand{\ekdatbegshihook}{}{%
+  \ifekd@pagelineation\resetlinenumber\fi
+}
+\AtBeginShipout{\ekdatbegshihook}
+\newif\ifekd@elidednumbers
+\ekvdefinekeys{ekd@lineation}{
+  choice lineation = {page = \ekd@pagelineationtrue,
+    document = \ekd@pagelineationfalse},
+  unknown-choice lineation = \PackageError{ekdosis}{unknown
+    lineation=#1}{`lineation' must be either `page' or `document'.},
+  code modulonum = \chardef\c@linenumbermodulo#1\relax,
+  noval modulo = \modulolinenumbers,
+  choice numbers = {elided = \ekd@elidednumberstrue,
+    full = \ekd@elidednumbersfalse},
+  unknown-choice numbers = \PackageError{ekdosis}{unknown
+    numbers=#1}{`numbers' must be either `elided' or `full'.},
+  initial numbers = elided
+}
+%    \end{macrocode}
+% \begin{macro}{\SetLineation}
+% Then \cs{SetLineation}\marg{options} can be used in the preamble or
+% at any point of the document to set lineation preferences. Its
+% argument processes the |key-value| options that are defined just
+% above.
+%    \begin{macrocode}
+\NewDocumentCommand{\SetLineation}{m}{
+  \ekvset{ekd@lineation}{#1}
+}
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{\EkdosisDefaultApparatus}
 % By default, \pkg{ekdosis} defines one layer of critical notes which
 % is called |default|. This name can be changed at any point of the
@@ -3029,10 +3065,13 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
     \fi
     % 
     \else
+    \ifekd@elidednumbers
     \luadirect{tex.sprint(ekdosis.numrange(\luastring{\getrefnumber{#1}},
-      \luastring{\getrefnumber{#2}}))}
-    % \LRnum{\getrefnumber{#1}}--%
-    % \LRnum{\getrefnumber{#2}}% issue the nos
+      \luastring{\getrefnumber{#2}}))}%
+    \else
+    \LRnum{\getrefnumber{#1}}--%
+    \LRnum{\getrefnumber{#2}}% issue the nos
+    \fi
     \fi%
     \else
     \LRnum{\getrefnumber{#1}}--%
@@ -3084,11 +3123,14 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
     \fi
     % 
     \else
+    \ifekd@elidednumbers
     \luadirect{tex.sprint(ekdosis.numrange(
       \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}},
       \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}))}% issue the nos
-    % \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
-    % \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos
+    \else
+    \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
+    \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos
+    \fi
     \fi%
     \else
     \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
@@ -3499,36 +3541,6 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}%
 }
 %    \end{macrocode}
-% \paragraph{Lineation settings}
-% The keys to be used for lineation settings follow. A conditional is
-% defined beforehand so that \pkg{ekdosis} may know whether the
-% numbering should start afresh at the top of each page.
-%    \begin{macrocode}
-\newif\ifekd@pagelineation
-\NewDocumentCommand{\ekdatbegshihook}{}{%
-  \ifekd@pagelineation\resetlinenumber\fi
-}
-\AtBeginShipout{\ekdatbegshihook}
-\ekvdefinekeys{ekd@lineation}{
-  choice lineation = {page = \ekd@pagelineationtrue,
-    document = \ekd@pagelineationfalse},
-  unknown-choice lineation = \PackageError{ekdosis}{unknown
-    lineation=#1}{`lineation' must be either `page' or `document'.},
-  code modulonum = \chardef\c@linenumbermodulo#1\relax,
-  noval modulo = \modulolinenumbers
-}
-%    \end{macrocode}
-% \begin{macro}{\SetLineation}
-% Then \cs{SetLineation}\marg{options} can be used in the preamble or
-% at any point of the document to set lineation preferences. Its
-% argument processes the |key-value| options that are defined just
-% above.
-%    \begin{macrocode}
-\NewDocumentCommand{\SetLineation}{m}{
-  \ekvset{ekd@lineation}{#1}
-}
-%    \end{macrocode}
-% \end{macro}
 % Start and stop |ekdosis|:
 %    \begin{macrocode}
 \NewDocumentCommand{\EkdosisOn}{}{%
-- 
cgit v1.2.3

