From e329140ea4ab6404ea1d54781b32694baaabbd77 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Tue, 31 Aug 2021 14:14:23 +0200
Subject: siglumsep -> familysep

---
 ekdosis.dtx | 71 ++++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 44 insertions(+), 27 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 2be331a..4d36bcd 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>
-    [2021/08/30 v1.4-dev Typesetting TEI xml-compliant critical editions]
+    [2021/08/31 v1.4-dev Typesetting TEI xml-compliant critical editions]
 %</package>
 %<*driver>
 \begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -1861,8 +1861,8 @@ yesterday.
 % apparatus criticus, preceded by the line number where it occurs or a
 % broad space when the entry refers to the same line as the preceding
 % entry. \phts\label{ref:lem-opts-b}The optional argument of \cs{lem}
-% accepts the following
-% comma-separated list of \enquote{name$=$value} arguments:---\\
+% accepts the following comma-separated list of \enquote{name$=$value}
+% arguments:---\\
 % \DescribeOption{wit} |wit|$=$\meta{csv list of
 % witnesses}\phts\label{ref:lem-wit}\\
 % While a single witness may be recorded as in |wit=A|,
@@ -1870,11 +1870,16 @@ yesterday.
 % enclosed in curly braces, like so:
 % |wit={A,B,C}|. \phts\label{ref:mss-sep-families}It must be noted
 % that witnesses can be grouped by using spaces as separators, like
-% so: \verb*|wit={A,B,C, D,E,F}|. Although any unique identifiers or
-% labels used to \enquote{declare} sources and scholars as described
-% above \vpagerefrange{ref:declare-source}{ref:declare-scholar} can
-% also be used as values of the |wit| optional argument, it is
-% recommended to use |sources| and |resp| to refer to either category
+% so: \verb*|wit={A,B,C, D,E,F}|. \danger In the apparatus criticus in
+% print, it is customary to remind the reader of the manuscript
+% groupings by spaces or commas. \pkg{ekdosis} prints spaces by
+% default, but can be instructed to print any other symbol
+% instead.\footnote{See below \vpageref{ref:familysep} for details.}
+% \danger Although any unique identifiers or labels used to
+% \enquote{declare} sources and scholars as described above
+% \vpagerefrange{ref:declare-source}{ref:declare-scholar} can also be
+% used as values of the |wit| optional argument, it is recommended to
+% use |sources| and |resp| to refer to either category
 % respectively as described below.\\
 % \DescribeOption{source} |source|$=$\meta{csv list of
 % sources}\phts\label{ref:lem-source}\newfeature[v1.1]\\
@@ -1910,12 +1915,11 @@ yesterday.
 % if used. |nosep| removes the separator mentioned above. Obviously,
 % |nosep| must be used when for some reason no \cs{rdg} command
 % follows a \cs{lem} command that has just been used, as shown below
-% in \vref{lst:emend-coni-corr}, l.~7.
-% \danger If |nosep| be used so as to insert an explanatory note after
-% the lemma text with the \cs{note} command described below
-% \vpageref{ref:editorial-notes}, then the |sep| optional argument of
-% \cs{note} can be used to put back in the separator. This technique
-% is demonstrated below in
+% in \vref{lst:emend-coni-corr}, l.~7.  \danger If |nosep| be used so
+% as to insert an explanatory note after the lemma text with the
+% \cs{note} command described below \vpageref{ref:editorial-notes},
+% then the |sep| optional argument of \cs{note} can be used to put
+% back in the separator. This technique is demonstrated below in
 % \vref{lst:emend-coni-corr}, ll.~23--5.\\
 % \DescribeOption{nolem} |nolem|$=$\verb+true|false+\\
 % This named argument does not need a value as it defaults to |true|
@@ -3349,6 +3353,20 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 % \hfill\tcboxverb{Default: not set}\\
 % \newfeature[v1.2] |readingstyle| operates in the same way as
 % |lemmastyle| but applies to variant readings.\\
+% \DescribeOption{familysep} |familysep|$=$\meta{symbol}\verb+|reset+
+% \phts\label{ref:familysep}\hfill\tcboxverb{Default: not set}\\
+% \newfeature[v1.4] As described above \vpageref{ref:lem-wit},
+% multiple witnesses must be recorded in the |wit| optional argument
+% of the \cs{lem} and \cs{rdg} commands as comma-separated lists of
+% sigla which can be further grouped into families by inserting spaces
+% as separators just after commas at specific places. \pkg{ekdosis}
+% saves and prints these spaces in the apparatus criticus but can be
+% instructed to print any other symbol instead by means of
+% |familysep|. For instance, |familysep={,}| has the separating spaces
+% replaced with commas and |familysep={,\allowbreak}| does the same
+% while further allowing breaks after commas at the end of
+% lines. Finally, |familysep=reset| can be used to restore the default
+% behavior.\\
 % \DescribeOption{initialrule} |initialrule|$=$\meta{command}
 % \phts\label{ref:initialrule}\hfill\bgroup\footnotesize
 % \tcboxverb{Default: \rule{0.4\columnwidth}{0.4pt} (initially not set)}%
@@ -3356,8 +3374,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 % between the edition text and all subsequent layers of critical
 % notes. Of course, this option only makes sense when multiple-layer
 % apparatus criticus are set. Therefore, it has no effect on
-% single-layer apparatus
-% criticus.\\
+% single-layer apparatus criticus.\\
 % \DescribeOption{noinitialrule}\hfill\tcboxverb{Default: not set}\\
 % This is a no-value option. It removes any previously set
 % |initialrule|.
@@ -7757,7 +7774,7 @@ Sample text with a \textcolor{red}{word} in red.
   store appfontsize = \ekd@appfontsize,
   store refnumstyle = \ekd@refnumstyle,
   store postrefnum = \ekd@postrefnum,
-  code siglumsep = \luadirect{ekdosis.setsiglumsep(\luastringN{#1})},
+  code familysep = \luadirect{ekdosis.setfamilysep(\luastringN{#1})},
   store lemmastyle = \ekd@lemmastyle,
   store readingstyle = \ekd@readingstyle,
   code keyparopts = \if@pkg@keyfloat\ekd@keyparopts{#1}\fi,
@@ -8305,7 +8322,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\SetSubseparator}
-% \changes{v1.4}{2021/08/30}{New command for subseparators}
+% \changes{v1.4}{2021/08/31}{New command for subseparators}
 % \cs{SetSubseparator}\marg{sub-separator} allows to change the
 % \enquote{subseparator} between variant readings. By default,
 % no subseparator is set:---
@@ -9880,7 +9897,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\\+}
-% \changes{v1.4}{2021/08/30}{New macro for poetry}
+% \changes{v1.4}{2021/08/31}{New macro for poetry}
 % |\\+| comes in addition to the verse commands that are provided by
 % the \pkg{verse} package. |\\+| causes a linebreak within a verse
 % line. In contrast to |\\>|, the subsequent line is not indented and
@@ -10368,14 +10385,14 @@ function ekdosis.newsource(id, siglum)
    return true
 end
 
-local siglumsep = nil
+local familysep = nil
 
-function ekdosis.setsiglumsep(str)
+function ekdosis.setfamilysep(str)
    if str == "reset"
    then
-      siglumsep = nil
+      familysep = nil
    else
-      siglumsep = str
+      familysep = str
    end
    return true
 end
@@ -10401,12 +10418,12 @@ function ekdosis.getsiglum(str, opt)
       for i = 1,#idsRend do
 	 local tempc = string.gsub(idsRend[i].xmlid, "([%-%.%_])", "%%%1")
 	 str  = string.gsub(str, tempc.."%,", idsRend[i].abbr)
-	 if siglumsep ~= nil
-	 then
-	    str = string.gsub(str, "%s", siglumsep)
-	 end
 	 ctrl = string.gsub(ctrl, tempc.."%,", "")
       end
+      if familysep ~= nil
+      then
+	 str = string.gsub(str, "%s+", familysep)
+      end
    end
    -- if string.find(ctrl, "[A-Za-z0-9]")
    if string.find(ctrl, "%S")
-- 
cgit v1.2.3

