From 08138be2648ce925ec46e2f60bebbd0f88d385c3 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Tue, 17 Sep 2019 21:14:51 +0200 Subject: tidy up --- ekdosis.dtx | 66 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 37 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index a3095ce..39cc3a7 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -820,11 +820,11 @@ function ekdosis.newwitness(id, OrigDate) if xmlidfound(id) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..id.. - [[" already exists as a xml:id. ]] + "\" already exists as a xml:id. " .. - [[Please pick another id.}}]]) + "Please pick another id.}}") else table.insert(xmlids, {xmlid = id}) table.sort(xmlids, function(a ,b) return(#a.xmlid > #b.xmlid) end) @@ -851,11 +851,11 @@ end function ekdosis.newhand(id, witid, siglum, description) if xmlidfound(id) or not xmlidfound(witid) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..id.. - [[" already exists as a xml:id. ]] + "\" already exists as a xml:id. " .. - [[Please pick another id.}}]]) + "Please pick another id.}}") else table.insert(xmlids, {xmlid = id}) table.sort(xmlids, function(a ,b) return(#a.xmlid > #b.xmlid) end) @@ -877,11 +877,11 @@ end function ekdosis.newshorthand(id, rend, xmlids) if isintable(shorthands, id) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..id.. - [[" already exists as a shorthand. ]] + "\" already exists as a shorthand. " .. - [[Please pick another shorthand.}}]]) + "Please pick another shorthand.}}") else table.insert(shorthands, { a = id, b = rend, c = xmlids }) table.sort(shorthands, function(a ,b) return(#a.a > #b.a) end) @@ -901,11 +901,11 @@ end function ekdosis.newscholar(id, siglum) if xmlidfound(id) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] - ..id.. - [[" already exists as a xml:id. ]] - .. - [[Please pick another id.}}]]) + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" + ..id.. + "\" already exists as a xml:id. " + .. + "Please pick another id.}}") else table.insert(xmlids, {xmlid = id}) table.sort(xmlids, function(a ,b) return(#a.xmlid > #b.xmlid) end) @@ -981,11 +981,11 @@ local close_p = { function ekdosis.newcmdtotag(cmd, tag, attr) if isintable(cmdtotags, cmd) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] --`' - ..cmd.. - [[" already exists as a known command to be processed to TEI. ]] - .. - [[Please pick another command.}}]]) + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" + ..cmd.. + "\" already exists as a known command to be processed to TEI. " + .. + "Please pick another command.}}") else table.insert(cmdtotags, {a = cmd, b = tag, c = " "..attr}) table.sort(cmdtotags, function(a ,b) return(#a.a > #b.a) end) @@ -996,11 +996,11 @@ end function ekdosis.newenvtotag(env, tag, attr, closep) if isintable(envtotags, env) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" ..cmd.. - [[" already exists as a known environment to be processed to TEI. ]] + "\" already exists as a known environment to be processed to TEI. " .. - [[Please pick another environment name.}}]]) + "Please pick another environment name.}}") else table.insert(envtotags, {a = env, b = tag, c = " "..attr}) table.sort(envtotags, function(a ,b) return(#a.a > #b.a) end) @@ -1367,21 +1367,14 @@ end -- handle multiple layers in apparatuses -- local apparatuses = {} -function ekdosis.newapparatus(teitype, cmd) - if cmd ~= "app" or "note" +function ekdosis.newapparatus(teitype) + if isintable(apparatuses, teitype) then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] - ..cmd.. - [[" must be either 'app' or 'note'.}}]]) + tex.print("\\unexpanded{\\PackageWarning{ekdosis}{\"" + ..teitype.. + "\" already exists.}}") else - if isintable(apparatuses, teitype) - then - tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] - ..teitype.. - [[" already exists.}}]]) - else - table.insert(apparatuses, { a = teitype, b = cmd }) - end + table.insert(apparatuses, { a = teitype }) end return true end @@ -1405,7 +1398,6 @@ function ekdosis.appin(str, teitype) return true end ---[[ function ekdosis.appin_out(str, nl) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if nl == "yes" then @@ -1416,7 +1408,7 @@ function ekdosis.appin_out(str, nl) f:close() return true end ---]] + function ekdosis.appout() local file = io.open(tex.jobname..".ekd", "r") -- cgit v1.2.3