From f1f70d0df950198cad6fb2d5a72471626857bd40 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Tue, 13 Apr 2021 15:11:20 +0200
Subject: added new option 'locus' in \DeclareWitness

---
 ekdosis.dtx | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 1983e56..5b5fed9 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -7172,7 +7172,8 @@ Sample text with a \textcolor{red}{word} in red.
   store collection = \collection@value,
   store idno = \idno@value,
   store msName = \msName@value,
-  store origDate = \origDate@value
+  store origDate = \origDate@value,
+  store locus = \locus@value
 }
 %    \end{macrocode}
 % \begin{macro}{\DeclareWitness} \cs{DeclareWitness} is a
@@ -7195,7 +7196,8 @@ Sample text with a \textcolor{red}{word} in red.
       \luastringO{\collection@value},
       \luastringO{\idno@value},
       \luastringO{\msName@value},
-      \luastringO{\origDate@value})}
+      \luastringO{\origDate@value},
+      \luastringO{\locus@value})}
     \egroup
   }
 \@onlypreamble\DeclareWitness
@@ -9261,7 +9263,8 @@ function ekdosis.newwitness(id,
 			    Collection,
 			    Idno,
 			    MsName,
-			    OrigDate)
+			    OrigDate,
+			    Locus)
    if xmlidfound(id)
    then
       tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\""
@@ -9297,6 +9300,10 @@ function ekdosis.newwitness(id,
 	 listWit[indexwit].history = {}
 	 listWit[indexwit].history.origin = {origDate = OrigDate}
       end
+      if Locus ~= "" then
+	 listWit[indexwit].msContents = {}
+	 listWit[indexwit].msContents.msItem = {locus = Locus}
+      end
    end
    return true
 end
@@ -10477,7 +10484,14 @@ function ekdosis.openteistream()
 	       end
 	       f:write("</handDesc>", "\n")
 	       f:write("</physDesc>", "\n")
-      else end
+	    else end
+	    if listWit[i].msContents ~= nil then
+	       f:write("<msContents>", "\n")
+	       f:write("<msItem>", "\n")
+	       f:write("<locus>", textotei(listWit[i].msContents.msItem.locus), "</locus>", "\n")
+	       f:write("</msItem>", "\n")
+	       f:write("</msContents>", "\n")
+	    end
 	    if listWit[i].history ~= nil then
 	       f:write("<history>", "\n")
 	       f:write("<origin>", "\n")
@@ -10618,7 +10632,15 @@ function ekdosis.basic_cs(msid)
    else
       date = ""
    end
-   return siglum.."&"..name.."&"..date
+   if listWit[indexwit].msContents ~= nil
+      and
+      listWit[indexwit].msContents.msItem ~= nil
+   then
+      locus = listWit[indexwit].msContents.msItem.locus
+   else
+      locus = ""
+   end
+   return siglum.."&"..name.."\\space "..locus.."&"..date
 end
 -- end basic TeX Conspectus siglorum
 
-- 
cgit v1.2.3

