From 9de32ed90cefe239de0e878c5acb8cbc96b3eda5 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Wed, 14 Oct 2020 18:54:25 +0200 Subject: insert a dummy statement in if no source has been declared --- ekdosis.dtx | 172 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 90 insertions(+), 82 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index e9247a1..f8c2dc8 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -8943,104 +8943,112 @@ function ekdosis.openteistream() f:write("", "\n") f:write("", "\n") f:write("", "\n") - f:write("", "\n") - for i = 1,#listWit do - f:write('", "\n") - f:write('', textotei(listWit[i].abbr), "", "\n") - f:write(textotei(listWit[i].detailsDesc), "\n") - f:write("", "\n") - if listWit[i].msIdentifier.settlement == "" - and listWit[i].msIdentifier.institution == "" - and listWit[i].msIdentifier.repository == "" - and listWit[i].msIdentifier.collection == "" - and listWit[i].msIdentifier.idno == "" - and listWit[i].msIdentifier.msName == "" + if next(listWit) == nil and next(listPerson) == nil + then + f:write("

No source, born digital

", "\n") + else + if next(listWit) ~= nil then - f:write("", "\n") - else - f:write("", "\n") - if listWit[i].msIdentifier.settlement ~= "" then - f:write("", textotei(listWit[i].msIdentifier.settlement), "", "\n") + f:write("", "\n") + for i = 1,#listWit do + f:write('", "\n") + f:write('', textotei(listWit[i].abbr), "", "\n") + f:write(textotei(listWit[i].detailsDesc), "\n") + f:write("", "\n") + if listWit[i].msIdentifier.settlement == "" + and listWit[i].msIdentifier.institution == "" + and listWit[i].msIdentifier.repository == "" + and listWit[i].msIdentifier.collection == "" + and listWit[i].msIdentifier.idno == "" + and listWit[i].msIdentifier.msName == "" + then + f:write("", "\n") + else + f:write("", "\n") + if listWit[i].msIdentifier.settlement ~= "" then + f:write("", textotei(listWit[i].msIdentifier.settlement), "", "\n") else end - if listWit[i].msIdentifier.institution ~= "" then - f:write("", textotei(listWit[i].msIdentifier.institution), "", "\n") + if listWit[i].msIdentifier.institution ~= "" then + f:write("", textotei(listWit[i].msIdentifier.institution), "", "\n") else end - if listWit[i].msIdentifier.repository ~= "" then - f:write("", textotei(listWit[i].msIdentifier.repository), "", "\n") + if listWit[i].msIdentifier.repository ~= "" then + f:write("", textotei(listWit[i].msIdentifier.repository), "", "\n") else end - if listWit[i].msIdentifier.collection ~= "" then - f:write("", textotei(listWit[i].msIdentifier.collection), "", "\n") + if listWit[i].msIdentifier.collection ~= "" then + f:write("", textotei(listWit[i].msIdentifier.collection), "", "\n") else end - if listWit[i].msIdentifier.idno ~= "" then - f:write("", textotei(listWit[i].msIdentifier.idno), "", "\n") + if listWit[i].msIdentifier.idno ~= "" then + f:write("", textotei(listWit[i].msIdentifier.idno), "", "\n") else end - if listWit[i].msIdentifier.msName ~= "" then - f:write("", textotei(listWit[i].msIdentifier.msName), "", "\n") + if listWit[i].msIdentifier.msName ~= "" then + f:write("", textotei(listWit[i].msIdentifier.msName), "", "\n") else end - f:write("", "\n") - end - if listWit[i].handDesc ~= nil then - f:write("", "\n") - f:write("", "\n") - local j = 1 - while listWit[i].handDesc[j] - do - f:write("", "\n") - f:write('', textotei(listWit[i].handDesc[j].abbr), "", "\n") - f:write("

", textotei(listWit[i].handDesc[j].detailsDesc), "

", "\n") - f:write("
", "\n") - j = j + 1 - end - f:write("
", "\n") - f:write("
", "\n") + f:write("
", "\n") + end + if listWit[i].handDesc ~= nil then + f:write("", "\n") + f:write("", "\n") + local j = 1 + while listWit[i].handDesc[j] + do + f:write("", "\n") + f:write('', textotei(listWit[i].handDesc[j].abbr), "", "\n") + f:write("

", textotei(listWit[i].handDesc[j].detailsDesc), "

", "\n") + f:write("
", "\n") + j = j + 1 + end + f:write("
", "\n") + f:write("
", "\n") else end - if listWit[i].history ~= nil then - f:write("", "\n") - f:write("", "\n") - f:write("", textotei(listWit[i].history.origin.origDate), "", "\n") - f:write("", "\n") - f:write("", "\n") - end - f:write("
", "\n") - f:write("
", "\n") - end - f:write("
", "\n") - if next(listPerson) ~= nil - then - f:write("", "\n") - for i = 1,#listPerson do - f:write('", "\n") - f:write('', "\n") - f:write('', textotei(listPerson[i].abbr), "", "\n") - if listPerson[i].persName.name ~= nil - then - f:write(textotei(listPerson[i].persName.name)) - else - if listPerson[i].persName.forename ~= "" - then - f:write("", textotei(listPerson[i].persName.forename), "", "\n") - else - f:write("", "\n") + if listWit[i].history ~= nil then + f:write("", "\n") + f:write("", "\n") + f:write("", textotei(listWit[i].history.origin.origDate), "", "\n") + f:write("", "\n") + f:write("", "\n") end - if textotei(listPerson[i].persName.surname) ~= "" + f:write("
", "\n") + f:write("
", "\n") + end + f:write("
", "\n") + end + if next(listPerson) ~= nil + then + f:write("", "\n") + for i = 1,#listPerson do + f:write('", "\n") + f:write('', "\n") + f:write('', textotei(listPerson[i].abbr), "", "\n") + if listPerson[i].persName.name ~= nil then - f:write("", textotei(listPerson[i].persName.surname), "", "\n") + f:write(textotei(listPerson[i].persName.name)) else - f:write("", "\n") + if listPerson[i].persName.forename ~= "" + then + f:write("", textotei(listPerson[i].persName.forename), "", "\n") + else + f:write("", "\n") + end + if textotei(listPerson[i].persName.surname) ~= "" + then + f:write("", textotei(listPerson[i].persName.surname), "", "\n") + else + f:write("", "\n") + end + if textotei(listPerson[i].persName.addName) ~= "" + then + f:write("", textotei(listPerson[i].persName.addName), "", "\n") + end end - if textotei(listPerson[i].persName.addName) ~= "" + if listPerson[i].note ~= "" then - f:write("", textotei(listPerson[i].persName.addName), "", "\n") + f:write("", textotei(listPerson[i].note), "", "\n") end + f:write('', "\n") + f:write('', "\n") end - if listPerson[i].note ~= "" - then - f:write("", textotei(listPerson[i].note), "", "\n") - end - f:write('', "\n") - f:write('', "\n") + f:write("", "\n") end - f:write("", "\n") end f:write("
", "\n") f:write("", "\n") -- cgit v1.2.3