diff options
author | Robert Alessi <alessi@robertalessi.net> | 2020-09-02 09:14:54 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2020-09-02 09:14:54 +0200 |
commit | 88e41212a021dc51e306e23c2b69926c54aa696e (patch) | |
tree | 91a5dfa9a969ab1cbc3c0cd83a684fe47fb8d41c | |
parent | 312579a658b4570bd003e00c1d19e649a8177f28 (diff) | |
download | ekdosis-88e41212a021dc51e306e23c2b69926c54aa696e.tar.gz |
new command \addentries for modifying the number of accepted entries on the current page
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | ekdosis.dtx | 31 |
2 files changed, 27 insertions, 6 deletions
@@ -1,6 +1,6 @@ | |||
1 | NAME = ekdosis | 1 | NAME = ekdosis |
2 | SHELL = bash | 2 | SHELL = bash |
3 | CMP = lualatex | 3 | CMP = lualatex-dev |
4 | PWD = $(shell pwd) | 4 | PWD = $(shell pwd) |
5 | VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') | 5 | VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//') |
6 | LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) | 6 | LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL) |
diff --git a/ekdosis.dtx b/ekdosis.dtx index 302d537..2ab754a 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -1103,7 +1103,7 @@ along with this program. If not, see | |||
1103 | % source file will be printed as \getsiglum{M}, \getsiglum{M1} and | 1103 | % source file will be printed as \getsiglum{M}, \getsiglum{M1} and |
1104 | % \getsiglum{M2} respectively. Not only the code gains legibility, but | 1104 | % \getsiglum{M2} respectively. Not only the code gains legibility, but |
1105 | % also flexibility for simply changing any declared rendition will | 1105 | % also flexibility for simply changing any declared rendition will |
1106 | % update corresponding sigla thoughout the entire edition. | 1106 | % update corresponding sigla throughout the entire edition. |
1107 | % | 1107 | % |
1108 | % As a final example, here is how \pkg{ekdosis} would encode | 1108 | % As a final example, here is how \pkg{ekdosis} would encode |
1109 | % information as declared above for the \emph{Marcianus Gr.}~269 | 1109 | % information as declared above for the \emph{Marcianus Gr.}~269 |
@@ -1286,7 +1286,7 @@ along with this program. If not, see | |||
1286 | forename=John, | 1286 | forename=John, |
1287 | surname=Smith, | 1287 | surname=Smith, |
1288 | note=Main editor of the text] | 1288 | note=Main editor of the text] |
1289 | \DeclareShorthand{egoscr}{ego}{\emph{scripsi}} | 1289 | \DeclareShorthand{egoscr}{\emph{scripsi}}{ego} |
1290 | \end{minted} | 1290 | \end{minted} |
1291 | % \iffalse | 1291 | % \iffalse |
1292 | %</example> | 1292 | %</example> |
@@ -1371,8 +1371,8 @@ along with this program. If not, see | |||
1371 | % \label{sec:single-text-editing} | 1371 | % \label{sec:single-text-editing} |
1372 | % \DescribeEnv{ekdosis} | 1372 | % \DescribeEnv{ekdosis} |
1373 | % Running paragraphs of one single text to be edited should be | 1373 | % Running paragraphs of one single text to be edited should be |
1374 | % inserted in the \env{ekdosis} environment, like so:---\footnote{See | 1374 | % inserted in the \env{ekdosis} environment, like so:\footnote{See |
1375 | % above \vref{lst:pj1}.} | 1375 | % above \vref{lst:pj1}.}--- |
1376 | % \iffalse | 1376 | % \iffalse |
1377 | %<*example> | 1377 | %<*example> |
1378 | % \fi | 1378 | % \fi |
@@ -5942,6 +5942,22 @@ Sample text with a \textcolor{red}{word} in red. | |||
5942 | } | 5942 | } |
5943 | \@onlypreamble\DeclareApparatus | 5943 | \@onlypreamble\DeclareApparatus |
5944 | % \end{macrocode} | 5944 | % \end{macrocode} |
5945 | % \begin{macro}{\addentries} | ||
5946 | % \changes{v1.1}{2020/09/02}{modifies the number of accepted entries | ||
5947 | % on the current page.} | ||
5948 | % If |maxentries| be set for a given layer of critical notes, | ||
5949 | % \cs{addentries}\oarg{layer}\marg{n}, where \meta{n} is an integer, | ||
5950 | % can be used to add \meta{n}\---or remove it if it be negative\---to | ||
5951 | % the number of accepted entries on the current page. \cs{addentries} | ||
5952 | % operates on the default layer of notes, but any other declared layer | ||
5953 | % can be specified in the optional argument of the command. | ||
5954 | % \begin{macrocode} | ||
5955 | \NewDocumentCommand{\addentries}{O{\ekdan@type} m}{% | ||
5956 | \luadirect{ekdosis.addto_bagunits(\luastringO{#1}, \luastringN{#2})}% | ||
5957 | \ignorespaces | ||
5958 | } | ||
5959 | % \end{macrocode} | ||
5960 | % \end{macro} | ||
5945 | % \end{macro} | 5961 | % \end{macro} |
5946 | % Apparatus-related settings and functions. Some booleans to check if | 5962 | % Apparatus-related settings and functions. Some booleans to check if |
5947 | % an apparatus should be inserted and what is the current environment. | 5963 | % an apparatus should be inserted and what is the current environment. |
@@ -7617,7 +7633,6 @@ local cmdtotags = { | |||
7617 | {a="textsf", b="hi", c=" rend=\"sf\""}, | 7633 | {a="textsf", b="hi", c=" rend=\"sf\""}, |
7618 | {a="arbup", b="hi", c=" rend=\"sup\""}, | 7634 | {a="arbup", b="hi", c=" rend=\"sup\""}, |
7619 | {a="txarb", b="s", c=" xml:lang=\"arb\""}, | 7635 | {a="txarb", b="s", c=" xml:lang=\"arb\""}, |
7620 | {a="mbox", b="", c=""}, | ||
7621 | {a="arb", b="foreign", | 7636 | {a="arb", b="foreign", |
7622 | c=" xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\""} | 7637 | c=" xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\""} |
7623 | } | 7638 | } |
@@ -7626,6 +7641,7 @@ local texpatttotags = { | |||
7626 | {a="\\pagebreak%s+%[[1-4]%]", b=""}, | 7641 | {a="\\pagebreak%s+%[[1-4]%]", b=""}, |
7627 | {a="\\pagebreak%s+", b=""}, | 7642 | {a="\\pagebreak%s+", b=""}, |
7628 | {a="\\altrfont%s+", b=""}, | 7643 | {a="\\altrfont%s+", b=""}, |
7644 | {a="\\mbox%s+{(.-)}", b="%1"}, | ||
7629 | {a="\\LR%s+{(.-)}", b="%1"}, | 7645 | {a="\\LR%s+{(.-)}", b="%1"}, |
7630 | {a="\\RL%s+{(.-)}", b="%1"} | 7646 | {a="\\RL%s+{(.-)}", b="%1"} |
7631 | } | 7647 | } |
@@ -8957,6 +8973,11 @@ function ekdosis.limit_bagunits(teitype) | |||
8957 | end | 8973 | end |
8958 | end | 8974 | end |
8959 | 8975 | ||
8976 | function ekdosis.addto_bagunits(teitype, n) | ||
8977 | n = tonumber(n) | ||
8978 | bagunits[teitype] = bagunits[teitype] - n | ||
8979 | end | ||
8980 | |||
8960 | function ekdosis.increment_bagunits(teitype) | 8981 | function ekdosis.increment_bagunits(teitype) |
8961 | bagunits[teitype] = (bagunits[teitype] or 0) + 1 | 8982 | bagunits[teitype] = (bagunits[teitype] or 0) + 1 |
8962 | end | 8983 | end |