diff options
-rw-r--r-- | ekdosis.dtx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index dcc4d24..09ed564 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -1080,6 +1080,9 @@ Running "make install" installs the files in the local TeX tree. | |||
1080 | initial texts = edition;translation, | 1080 | initial texts = edition;translation, |
1081 | initial apparatus = edition, | 1081 | initial apparatus = edition, |
1082 | } | 1082 | } |
1083 | \NewDocumentCommand{\SetEkdosisAlignment}{m}{ | ||
1084 | \ekvset{align}{#1} | ||
1085 | } | ||
1083 | \NewDocumentCommand{\ekd@storecol}{m}{% | 1086 | \NewDocumentCommand{\ekd@storecol}{m}{% |
1084 | \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}% | 1087 | \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}% |
1085 | } | 1088 | } |
@@ -1534,17 +1537,23 @@ local function lem_rdg_totei(str) | |||
1534 | opt = string.match(opt, "%f[%w]wit%s?%=%s?%b{}") | 1537 | opt = string.match(opt, "%f[%w]wit%s?%=%s?%b{}") |
1535 | or string.match(opt, "%f[%w]wit%s?%=%s?%w+%f[%W]") | 1538 | or string.match(opt, "%f[%w]wit%s?%=%s?%w+%f[%W]") |
1536 | or "" | 1539 | or "" |
1537 | opt = string.gsub(opt, "wit%s?%=%s?(%b{})", function(bbraces) | 1540 | if opt == "" |
1538 | bbraces = string.sub(bbraces, 2, -2) | 1541 | then |
1539 | bbraces = ekdosis.getsiglum(bbraces, "tei") | 1542 | return lem_rdg_totei(string.format("<%s>%s</%s>", |
1540 | return string.format("%s", bbraces) | 1543 | cmd, arg, cmd)) |
1541 | end) | 1544 | else |
1542 | opt = string.gsub(opt, "(wit%s?%=%s?)(%w+%f[%W])", function(attr, value) | 1545 | opt = string.gsub(opt, "wit%s?%=%s?(%b{})", function(bbraces) |
1543 | value = ekdosis.getsiglum(value, "tei") | 1546 | bbraces = string.sub(bbraces, 2, -2) |
1544 | return string.format("%s", value) | 1547 | bbraces = ekdosis.getsiglum(bbraces, "tei") |
1545 | end) | 1548 | return string.format("%s", bbraces) |
1546 | return lem_rdg_totei(string.format("<%s wit=\"%s\">%s</%s>", | 1549 | end) |
1547 | cmd, opt, arg, cmd)) | 1550 | opt = string.gsub(opt, "(wit%s?%=%s?)(%w+%f[%W])", function(attr, value) |
1551 | value = ekdosis.getsiglum(value, "tei") | ||
1552 | return string.format("%s", value) | ||
1553 | end) | ||
1554 | return lem_rdg_totei(string.format("<%s wit=\"%s\">%s</%s>", | ||
1555 | cmd, opt, arg, cmd)) | ||
1556 | end | ||
1548 | end) | 1557 | end) |
1549 | str = gsub(str, spcenc^-0 * dblbkslash * lemrdg * spcenc^-1 * bcbraces * spcenc^-1, | 1558 | str = gsub(str, spcenc^-0 * dblbkslash * lemrdg * spcenc^-1 * bcbraces * spcenc^-1, |
1550 | function(bkslash, cmd, arg) | 1559 | function(bkslash, cmd, arg) |
@@ -1983,14 +1992,14 @@ function ekdosis.mkenv() | |||
1983 | .. aligned_texts[i].text | 1992 | .. aligned_texts[i].text |
1984 | .. "}{}{\\begin{nthcolumn}{" | 1993 | .. "}{}{\\begin{nthcolumn}{" |
1985 | .. aligned_texts[i].column | 1994 | .. aligned_texts[i].column |
1986 | .."}\\begin{ekdosis}" | 1995 | .."}\\csname ekd@storecol\\endcsname{\\thecolumn}" |
1987 | .."\\csname ekd@storecol\\endcsname{\\thecolumn}}{\\end{ekdosis}\\end{nthcolumn}}") | 1996 | .."\\begin{ekdosis}}{\\end{ekdosis}\\end{nthcolumn}}") |
1988 | table.insert(environments, "\\NewDocumentEnvironment{" | 1997 | table.insert(environments, "\\NewDocumentEnvironment{" |
1989 | .. aligned_texts[i].text | 1998 | .. aligned_texts[i].text |
1990 | .. "*}{O{}}{\\begin{nthcolumn*}{" | 1999 | .. "*}{O{}}{\\begin{nthcolumn*}{" |
1991 | .. aligned_texts[i].column | 2000 | .. aligned_texts[i].column |
1992 | .."}\\begin{ekdosis}" | 2001 | .."}\\csname ekd@storecol\\endcsname{\\thecolumn}" |
1993 | .."\\csname ekd@storecol\\endcsname{\\thecolumn}}{\\end{ekdosis}\\end{nthcolumn*}}") | 2002 | .."\\begin{ekdosis}}{\\end{ekdosis}\\end{nthcolumn*}}") |
1994 | else | 2003 | else |
1995 | table.insert(environments, "\\NewDocumentEnvironment{" | 2004 | table.insert(environments, "\\NewDocumentEnvironment{" |
1996 | .. aligned_texts[i].text | 2005 | .. aligned_texts[i].text |