diff options
author | Robert Alessi <alessi@robertalessi.net> | 2019-04-02 19:54:03 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2019-04-02 19:54:03 +0200 |
commit | b9f6093c92fe7326c5438e97bef939c0cf05541d (patch) | |
tree | d42b6c28cf8dde59a6b8febccefa0f7e5643fdf7 | |
parent | d4362822585c1dc7c66b13c8d4c339a2322526d0 (diff) | |
download | ekdosis-b9f6093c92fe7326c5438e97bef939c0cf05541d.tar.gz |
added origDate. new command \SigLine. tidied up cmdtotag. new function ekdosis.basic_cs()
-rw-r--r-- | ekdosis.dtx | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 1adbc99..9e82bb5 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -358,7 +358,7 @@ Running "make install" installs the files in the local TeX tree. | |||
358 | % Build and process the list of witnesses and hands. | 358 | % Build and process the list of witnesses and hands. |
359 | % \begin{macrocode} | 359 | % \begin{macrocode} |
360 | \newkeycommand+[\|]{\declare@new@witness}[settlement={}, repository={}, | 360 | \newkeycommand+[\|]{\declare@new@witness}[settlement={}, repository={}, |
361 | idno={}, msName={}][3]{% | 361 | idno={}, msName={}, origDate={}][3]{% |
362 | |\luadirect|{% | 362 | |\luadirect|{% |
363 | ekdosis.newwitness( | 363 | ekdosis.newwitness( |
364 | |\luastringN|{#1}, | 364 | |\luastringN|{#1}, |
@@ -367,7 +367,8 @@ idno={}, msName={}][3]{% | |||
367 | |\luastringN|{\commandkey{settlement}}, | 367 | |\luastringN|{\commandkey{settlement}}, |
368 | |\luastringN|{\commandkey{repository}}, | 368 | |\luastringN|{\commandkey{repository}}, |
369 | |\luastringN|{\commandkey{idno}}, | 369 | |\luastringN|{\commandkey{idno}}, |
370 | |\luastringN|{\commandkey{msName}})} | 370 | |\luastringN|{\commandkey{msName}}, |
371 | |\luastringN|{\commandkey{origDate}})} | ||
371 | } | 372 | } |
372 | \NewDocumentCommand{\DeclareNewWitness}{m m O{} +O{}}{% | 373 | \NewDocumentCommand{\DeclareNewWitness}{m m O{} +O{}}{% |
373 | \declare@new@witness[#3]{#1}{#2}{#4} | 374 | \declare@new@witness[#3]{#1}{#2}{#4} |
@@ -381,6 +382,9 @@ idno={}, msName={}][3]{% | |||
381 | \NewDocumentCommand{\getsiglum}{m}{% | 382 | \NewDocumentCommand{\getsiglum}{m}{% |
382 | \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}))}% | 383 | \luadirect{tex.sprint(ekdosis.getsiglum(\luastringN{#1}))}% |
383 | } | 384 | } |
385 | \NewDocumentCommand{\SigLine}{m}{% | ||
386 | \luadirect{tex.sprint(ekdosis.basic_cs(\luastringN{#1}))} | ||
387 | } | ||
384 | % \end{macrocode} | 388 | % \end{macrocode} |
385 | % Add a \hologo{(La)TeX} command to be processed as a |TEI xml| tag: | 389 | % Add a \hologo{(La)TeX} command to be processed as a |TEI xml| tag: |
386 | % \begin{macrocode} | 390 | % \begin{macrocode} |
@@ -631,7 +635,8 @@ function ekdosis.newwitness(id, | |||
631 | Settlement, | 635 | Settlement, |
632 | Repository, | 636 | Repository, |
633 | Idno, | 637 | Idno, |
634 | MsName) | 638 | MsName, |
639 | OrigDate) | ||
635 | if xmlidfound(id) | 640 | if xmlidfound(id) |
636 | then | 641 | then |
637 | tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] | 642 | tex.print([[\unexpanded{\PackageWarning{ekdosis}{"]] |
@@ -653,6 +658,11 @@ function ekdosis.newwitness(id, | |||
653 | msName = MsName | 658 | msName = MsName |
654 | }, | 659 | }, |
655 | detailsDesc = description}) | 660 | detailsDesc = description}) |
661 | local indexwit = getindex(id, listWit) | ||
662 | if OrigDate ~= "" then | ||
663 | listWit[indexwit].history = {} | ||
664 | listWit[indexwit].history.origin = {origDate = OrigDate} | ||
665 | end | ||
656 | end | 666 | end |
657 | return true | 667 | return true |
658 | end | 668 | end |
@@ -705,13 +715,15 @@ end | |||
705 | 715 | ||
706 | local cmdtotags = { | 716 | local cmdtotags = { |
707 | {a="footnote", b="note", c=" place=\"bottom\""}, | 717 | {a="footnote", b="note", c=" place=\"bottom\""}, |
718 | {a="textsuperscript", b="hi", c=" rend=\"sup\""}, | ||
719 | {a="textsubscript", b="hi", c=" rend=\"sub\""}, | ||
708 | {a="textbf", b="hi", c=" rend=\"bold\""}, | 720 | {a="textbf", b="hi", c=" rend=\"bold\""}, |
721 | {a="textit", b="hi", c=" rend=\"italic\""}, | ||
722 | {a="textsc", b="hi", c=" rend=\"smallcaps\""}, | ||
723 | {a="textsf", b="hi", c=" rend=\"sf\""}, | ||
724 | {a="arbup", b="hi", c=" rend=\"sup\""}, | ||
709 | {a="txarb", b="foreign", c=" xml:lang=\"arb\""}, | 725 | {a="txarb", b="foreign", c=" xml:lang=\"arb\""}, |
710 | {a="emph", b="hi", c=" rend=\"italic\""}, | ||
711 | {a="arb", b="foreign", c=" xml:lang=\"arb\""}, | 726 | {a="arb", b="foreign", c=" xml:lang=\"arb\""}, |
712 | {a="app", b="app", c=""}, | ||
713 | {a="lem", b="lem", c=""}, | ||
714 | {a="rdg", b="rdg", c=""} | ||
715 | } | 727 | } |
716 | 728 | ||
717 | function ekdosis.newcmdtotag(cmd, tag, attr) | 729 | function ekdosis.newcmdtotag(cmd, tag, attr) |
@@ -820,6 +832,13 @@ function ekdosis.openteistream() | |||
820 | f:write("</handDesc>", "\n") | 832 | f:write("</handDesc>", "\n") |
821 | f:write("</physDesc>", "\n") | 833 | f:write("</physDesc>", "\n") |
822 | else end | 834 | else end |
835 | if listWit[i].history ~= nil then | ||
836 | f:write("<history>", "\n") | ||
837 | f:write("<origin>", "\n") | ||
838 | f:write("<origDate>", ekdosis.textotei(listWit[i].history.origin.origDate), "</origDate>", "\n") | ||
839 | f:write("</origin>", "\n") | ||
840 | f:write("</history>", "\n") | ||
841 | end | ||
823 | if listWit[i].detailsDesc == "" then else | 842 | if listWit[i].detailsDesc == "" then else |
824 | f:write("<p>", ekdosis.textotei(listWit[i].detailsDesc), "</p>", "\n") | 843 | f:write("<p>", ekdosis.textotei(listWit[i].detailsDesc), "</p>", "\n") |
825 | end | 844 | end |
@@ -854,6 +873,31 @@ function ekdosis.exporttei(str) | |||
854 | end | 873 | end |
855 | -- end totei functions | 874 | -- end totei functions |
856 | 875 | ||
876 | -- begin basic TeX Conspectus siglorum | ||
877 | function ekdosis.basic_cs(msid) | ||
878 | local indexwit = getindex(msid, listWit) | ||
879 | siglum = listWit[indexwit].head | ||
880 | if listWit[indexwit].detailsDesc == "" | ||
881 | then | ||
882 | name = listWit[indexwit].msIdentifier.msName | ||
883 | else | ||
884 | name = listWit[indexwit].msIdentifier.msName | ||
885 | .."\\thinspace\\newline\\bgroup\\footnotesize{}".. | ||
886 | listWit[indexwit].detailsDesc | ||
887 | .."\\egroup{}" | ||
888 | end | ||
889 | if listWit[indexwit].history ~= nil | ||
890 | and | ||
891 | listWit[indexwit].history.origin ~= nil | ||
892 | then | ||
893 | date = listWit[indexwit].history.origin.origDate | ||
894 | else | ||
895 | date = "" | ||
896 | end | ||
897 | return siglum.."&"..name.."&"..date | ||
898 | end | ||
899 | -- end basic TeX Conspectus siglorum | ||
900 | |||
857 | function ekdosis.closestream() | 901 | function ekdosis.closestream() |
858 | os.remove(tex.jobname..".ekd") | 902 | os.remove(tex.jobname..".ekd") |
859 | os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd") | 903 | os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd") |