From 6ef534628809195e81acd7250eb340a36ffed11e Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Mon, 8 Apr 2019 14:15:50 +0200
Subject: \DeclareNewHand only added the last hand. fixed

---
 ekdosis.dtx | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index af96445..2f37a27 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -705,7 +705,13 @@ function ekdosis.newhand(id, witid, siglum, description)
       table.insert(idsRend, {xmlid = id, head = siglum})
       table.sort(idsRend, function(a ,b) return(#a.xmlid > #b.xmlid) end)
       local indexwit = getindex(witid, listWit)
-      listWit[indexwit].handDesc = {xmlid = id, head = siglum, detailsDesc = description}
+      -- listWit[indexwit].handDesc = {xmlid = id, head = siglum, detailsDesc = description}
+      if listWit[indexwit].handDesc == nil
+      then
+	 listWit[indexwit].handDesc = {}
+      else
+      end
+      table.insert(listWit[indexwit].handDesc, {xmlid = id, head = siglum, detailsDesc = description})
    end
    return true
 end
@@ -855,12 +861,17 @@ function ekdosis.openteistream()
       end
       if listWit[i].handDesc ~= nil then
 	 f:write("<physDesc>", "\n")
-      	 f:write("<handDesc xml:id=\"", listWit[i].handDesc.xmlid, "\">", "\n")
-      	 f:write("<head>", ekdosis.textotei(listWit[i].handDesc.head), "</head>", "\n")
-	 if listWit[i].handDesc.detailsDesc == "" then else
-	    f:write("<p>", ekdosis.textotei(listWit[i].handDesc.detailsDesc), "</p>", "\n")
+	 local j = 1
+	 while listWit[i].handDesc[j]
+	 do
+	    f:write("<handDesc xml:id=\"", listWit[i].handDesc[j].xmlid, "\">", "\n")
+	    f:write("<head>", ekdosis.textotei(listWit[i].handDesc[j].head), "</head>", "\n")
+	    if listWit[i].handDesc[j].detailsDesc == "" then else
+	       f:write("<p>", ekdosis.textotei(listWit[i].handDesc[j].detailsDesc), "</p>", "\n")
+	    end
+	    j = j + 1
+	    f:write("</handDesc>", "\n")
 	 end
-      	 f:write("</handDesc>", "\n")
 	 f:write("</physDesc>", "\n")
       else end
       if listWit[i].history ~= nil then
-- 
cgit v1.2.3

