From 61b96868e1b00ffb825cc3b9799976289c1fc81b Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Wed, 15 Jul 2020 19:38:23 +0200 Subject: added bhook to \SetApparatus --- ekdosis.dtx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 3d490ed..e34dc71 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -2723,6 +2723,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ unknown-choice direction = \PackageError{ekdosis}{unknown direction=#1}{`direction' must be either `LR' or `RL'.}, code sep = \edef\ekdsep{#1}, + store bhook = \ekd@begin@apparatus, + initial bhook = {}, store ehook = \ekd@end@apparatus, initial ehook = {}, store delim = \ekd@unit@delim, @@ -2760,6 +2762,14 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ \NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}} % \end{macrocode} % \end{macro} +% \begin{macro}{\SetBeginApparatus} +% \cs{SetBeginApparatus}\marg{characters} can be used to append +% characters at the beginning of the apparatus block. By default, +% nothing is appended:--- +% \begin{macrocode} +\NewDocumentCommand{\SetBeginApparatus}{m}{\edef\ekd@begin@apparatus{#1}} +% \end{macrocode} +% \end{macro} % \begin{macro}{\SetEndApparatus} % \cs{SetEndApparatus}\marg{characters} can be used to append % characters at the end of the apparatus block\---such as a full stop, @@ -3988,10 +3998,12 @@ local texpatttotags = { {a="\\icite%s?%[(.-)%]%[(.-)%]{(.-)}", b="%1 %2"}, {a="\\icite%s?%[(.-)%]{(.-)}", b="%1"}, {a="\\icite%s?{(.-)}", b=""}, - {a="\\linelabel%s?{(.-)}", b=""}, - {a="\\label%s?{(.-)}", b=""}, + {a="\\linelabel%s?{(.-)}", b=""}, + {a="\\label%s?{(.-)}", b=""}, {a="\\v?pageref%s?{(.-)}", b=""}, - {a="\\v?ref%s?{(.-)}", b=""} + {a="\\v?ref%s?{(.-)}", b=""}, + {a="\\LR%s+{(.-)}", b="%1"}, + {a="\\RL%s+{(.-)}", b="%1"} } local envtotags = { @@ -5175,6 +5187,7 @@ function ekdosis.appout() if next(apparatuses) == nil then -- table.insert(output, "BEGIN") table.insert(output, "\\noindent\\csname ekd@default@rule\\endcsname\\NLS{}") + table.insert(output, "\\csname ekd@begin@apparatus\\endcsname{}") -- table.insert(output, "\\noindent ") for i in string.gmatch(t, "<"..cur_abs_pg @@ -5191,8 +5204,8 @@ function ekdosis.appout() local n = 1 while apparatuses[n] do - if string.match(t, "<"..cur_abs_pg.. - cur_alignment_patt + if string.match(t, "<"..cur_abs_pg + ..cur_alignment_patt ..curcol.."%-"..n..">.-