diff options
author | Robert Alessi <alessi@robertalessi.net> | 2021-06-02 17:29:27 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2021-06-02 17:29:27 +0200 |
commit | 447055607c51bd143cb3dad73e9e93038408a630 (patch) | |
tree | 0a29e8f11f4b0286a819168c03ae6a8287da844f | |
parent | 46980fd5fc7cdded5ac372cb8a560e0b985e8ea9 (diff) | |
download | ekdosis-447055607c51bd143cb3dad73e9e93038408a630.tar.gz |
headers/footers: added endmarks
-rw-r--r-- | ekdosis.dtx | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 91b6b94..ca27494 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -61,7 +61,7 @@ along with this program. If not, see | |||
61 | %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] | 61 | %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
62 | %<package>\ProvidesPackage{ekdosis} | 62 | %<package>\ProvidesPackage{ekdosis} |
63 | %<*package> | 63 | %<*package> |
64 | [2021/05/31 v1.3-dev Typesetting TEI xml-compliant critical editions] | 64 | [2021/06/02 v1.3-dev Typesetting TEI xml-compliant critical editions] |
65 | %</package> | 65 | %</package> |
66 | %<*driver> | 66 | %<*driver> |
67 | \begin{filecontents}[noheader,overwrite]{bibdata.xml} | 67 | \begin{filecontents}[noheader,overwrite]{bibdata.xml} |
@@ -7511,7 +7511,7 @@ Sample text with a \textcolor{red}{word} in red. | |||
7511 | % \end{macrocode} | 7511 | % \end{macrocode} |
7512 | % \end{macro} | 7512 | % \end{macro} |
7513 | % \begin{macro}{\teidirect} | 7513 | % \begin{macro}{\teidirect} |
7514 | % \changes{v1.3}{2021/05/31}{direct insertion of elements in the | 7514 | % \changes{v1.3}{2021/06/02}{direct insertion of elements in the |
7515 | % \texttt{TEI xml} file} | 7515 | % \texttt{TEI xml} file} |
7516 | % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} | 7516 | % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} |
7517 | % does nothing in \LaTeX. Its only use is to insert elements in the | 7517 | % does nothing in \LaTeX. Its only use is to insert elements in the |
@@ -7870,7 +7870,7 @@ Sample text with a \textcolor{red}{word} in red. | |||
7870 | % \end{macrocode} | 7870 | % \end{macrocode} |
7871 | % \end{macro} | 7871 | % \end{macro} |
7872 | % \begin{macro}{\SetApparatusNoteLanguage} | 7872 | % \begin{macro}{\SetApparatusNoteLanguage} |
7873 | % \changes{v1.3}{2021/05/31}{defines an alternate language to be | 7873 | % \changes{v1.3}{2021/06/02}{defines an alternate language to be |
7874 | % applied in note apparatus entries} | 7874 | % applied in note apparatus entries} |
7875 | % \cs{SetApparatusNoteLang}\marg{languagename} can be used when | 7875 | % \cs{SetApparatusNoteLang}\marg{languagename} can be used when |
7876 | % it is needed to apply in entries introduced by the \cs{note} command | 7876 | % it is needed to apply in entries introduced by the \cs{note} command |
@@ -9110,6 +9110,14 @@ Sample text with a \textcolor{red}{word} in red. | |||
9110 | \NewDocumentCommand{\ekdmark}{}{% | 9110 | \NewDocumentCommand{\ekdmark}{}{% |
9111 | \luadirect{tex.sprint(ekdosis.gethfmark(\luastring{\thepage}))}% | 9111 | \luadirect{tex.sprint(ekdosis.gethfmark(\luastring{\thepage}))}% |
9112 | } | 9112 | } |
9113 | \NewDocumentCommand{\endmark}{}{% | ||
9114 | \stepcounter{ekd@lab}% | ||
9115 | \label{ekd:\theekd@lab}% | ||
9116 | \luadirect{ekdosis.storehfmark( | ||
9117 | \luastring{\getpagerefnumber{ekd:\theekd@lab}}, | ||
9118 | "", "endmk")}% | ||
9119 | \ifdefined\xspace\xspace\fi | ||
9120 | } | ||
9113 | % \end{macrocode} | 9121 | % \end{macrocode} |
9114 | % \paragraph{Divisions of the Body} | 9122 | % \paragraph{Divisions of the Body} |
9115 | % \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter}, | 9123 | % \pkg{ekdosis} can convert \cs{book}, \cs{part}, \cs{chapter}, |
@@ -9775,6 +9783,7 @@ local texpatttotags = { | |||
9775 | {a="\\teidirect%s+(%b[]){(.-)}(%b{})", b="<%2 ekd@os%1ekd@cs>ekd@ob%3ekd@cb</%2>"}, | 9783 | {a="\\teidirect%s+(%b[]){(.-)}(%b{})", b="<%2 ekd@os%1ekd@cs>ekd@ob%3ekd@cb</%2>"}, |
9776 | {a="\\teidirect%s+{(.-)}(%b{})", b="<%1>ekd@ob%2ekd@cb</%1>"}, | 9784 | {a="\\teidirect%s+{(.-)}(%b{})", b="<%1>ekd@ob%2ekd@cb</%1>"}, |
9777 | {a="\\altrfont%s+", b=""}, | 9785 | {a="\\altrfont%s+", b=""}, |
9786 | {a="\\endmark%s+", b=""}, | ||
9778 | {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"}, | 9787 | {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"}, |
9779 | {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"}, | 9788 | {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"}, |
9780 | {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"}, | 9789 | {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"}, |
@@ -10366,8 +10375,14 @@ end | |||
10366 | --headers and footers | 10375 | --headers and footers |
10367 | local hfmarks = {} | 10376 | local hfmarks = {} |
10368 | 10377 | ||
10369 | function ekdosis.storehfmark(page, mk) | 10378 | function ekdosis.storehfmark(page, mk, opt) |
10370 | table.insert(hfmarks, {a = page, mark = mk}) | 10379 | if opt == "endmk" |
10380 | then | ||
10381 | local emark = hfmarks[#hfmarks].mark | ||
10382 | table.insert(hfmarks, {a = page, mark = emark}) | ||
10383 | else | ||
10384 | table.insert(hfmarks, {a = page, mark = mk}) | ||
10385 | end | ||
10371 | return true | 10386 | return true |
10372 | end | 10387 | end |
10373 | 10388 | ||
@@ -10377,10 +10392,11 @@ function ekdosis.gethfmark(page) | |||
10377 | then | 10392 | then |
10378 | return hfmarks[indexpage].mark | 10393 | return hfmarks[indexpage].mark |
10379 | else | 10394 | else |
10380 | return "nil" | 10395 | return hfmarks[#hfmarks-1].mark or "" |
10381 | end | 10396 | end |
10382 | end | 10397 | end |
10383 | 10398 | ||
10399 | -- divisions of the body text | ||
10384 | local divdepth = { | 10400 | local divdepth = { |
10385 | book = 1, | 10401 | book = 1, |
10386 | part = 2, | 10402 | part = 2, |