From 123ac3a99df880d5da88ee46d6dcec3eeba6b97a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Nov 2021 21:13:16 +0000 Subject: ekdosis (21nov21) git-svn-id: svn://tug.org/texlive/trunk@61113 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/lualatex/ekdosis/README.md | 8 +- Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.el | 15 +- Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.pdf | Bin 930575 -> 949399 bytes .../lualatex/ekdosis/samples/Caesar_BG-6-13-1.pdf | Bin 18006 -> 18006 bytes .../texmf-dist/source/lualatex/ekdosis/ekdosis.dtx | 418 ++++++++++++++++----- Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.lua | 71 +++- Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.sty | 113 ++++-- 7 files changed, 493 insertions(+), 132 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/lualatex/ekdosis/README.md b/Master/texmf-dist/doc/lualatex/ekdosis/README.md index 0fef027f196..ae7e85154fc 100644 --- a/Master/texmf-dist/doc/lualatex/ekdosis/README.md +++ b/Master/texmf-dist/doc/lualatex/ekdosis/README.md @@ -30,12 +30,12 @@ Alessi: - email: -- website: +- website: - comments, feature requests, bug reports: - + -- mailing list, support: [[mailing list archives](http://www.robertalessi.net/pipermail/ekdosis/)] +- mailing list, support: [[mailing list archives](http://www.ekdosis.org/pipermail/ekdosis/)] This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -98,7 +98,7 @@ instructions on how to install `ekdosis`, please see above. Comments, Feature Requests, Bug Reports --------------------------------------- - + Download the Repository diff --git a/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.el b/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.el index 845c004aef7..bac25500a35 100644 --- a/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.el +++ b/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.el @@ -105,6 +105,8 @@ ("post") ("prewit") ("postwit") + ("subsep") + ("nosubsep") ("type") ("nordg" ("true" "false"))) "Local options for rdg macro.") @@ -116,6 +118,7 @@ ("labele") ("sep") ("nosep") + ("subsep") ("num") ("nonum") ("pre") @@ -138,7 +141,8 @@ ("delend") ("sicbegin") ("sicend") - ("gapmark")) + ("gapmark") + ("keepinapp")) "List of local options for setcritsymbols macro.") (defvar LaTeX-ekdosis-sethooks-options @@ -147,6 +151,7 @@ ("postrefnum") ("lemmastyle") ("readingstyle") + ("familysep") ("initialrule") ("noinitialrule") ("keyparopts") @@ -164,6 +169,7 @@ (defvar LaTeX-ekdosis-setapparatus-options '(("direction" ("LR" "RL")) ("sep") + ("subsep") ("delim") ("bhook") ("ehook") @@ -176,6 +182,7 @@ (defvar LaTeX-ekdosis-declareapparatus-options '(("direction" ("LR" "RL")) ("sep") + ("subsep") ("delim") ("bhook") ("ehook") @@ -195,6 +202,7 @@ ("numbers" ("elided" "full")) ("vlineation" ("page" "document")) ("vmodulo") + ("vnumbrokenlines" ("true" "false")) ("vmargin" ("right" "left")) ("continuousvnum")) "List of local options for setlineation macro.") @@ -329,6 +337,7 @@ '("SetLTRapp" 0) '("SetRTLapp" 0) '("SetSeparator" "separator" 0) + '("SetSubseparator" "subseparator" 0) '("SetBeginApparatus" "chars|commands" 0) '("SetEndApparatus" "chars" 0) '("SetUnitDelimiter" "delimiter" 0) @@ -338,6 +347,8 @@ '("SetApparatus" (TeX-arg-key-val LaTeX-ekdosis-setapparatus-options)) '("footnoteruletrue" 0) '("footnoterulefalse" 0) + '("ekdsep" 0) + '("ekdsubsep" 0) '("SetDefaultApparatus" "apparatus name" 0) '("DeclareApparatus" "apparatus name" [ TeX-arg-key-val LaTeX-ekdosis-declareapparatus-options ] 0) @@ -347,6 +358,7 @@ '("innerlinenumbers" 0) '("outerlinenumbers" 0) '("modulolinenumbers" [ "number" ] ) + '("vmodulolinenumbers" [ "number" ] ) '("resetlinenumber" [ "number" ] ) '("resetvlinenumber" [ "number" ] ) '("verselinenumfont" "commands" 0) @@ -355,6 +367,7 @@ '("MkBodyDivs" "div1" "div2" "div3" "div4" "div5" "div6" 0) '("ekddiv" (LaTeX-ekdosis-long-key-val LaTeX-ekdosis-ekddiv-options)) '("FormatDiv" "number" "code before" "code after" 0) + '("ekdpage" 0) '("ekdmark" 0) '("endmark" 0) '("ekdprintmark" diff --git a/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.pdf b/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.pdf index de40fcdb68a..c0f43502361 100644 Binary files a/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.pdf and b/Master/texmf-dist/doc/lualatex/ekdosis/ekdosis.pdf differ diff --git a/Master/texmf-dist/doc/lualatex/ekdosis/samples/Caesar_BG-6-13-1.pdf b/Master/texmf-dist/doc/lualatex/ekdosis/samples/Caesar_BG-6-13-1.pdf index 1ca02247624..9162af6e64d 100644 Binary files a/Master/texmf-dist/doc/lualatex/ekdosis/samples/Caesar_BG-6-13-1.pdf and b/Master/texmf-dist/doc/lualatex/ekdosis/samples/Caesar_BG-6-13-1.pdf differ diff --git a/Master/texmf-dist/source/lualatex/ekdosis/ekdosis.dtx b/Master/texmf-dist/source/lualatex/ekdosis/ekdosis.dtx index 30b19f07d6d..d78a17f4cfc 100644 --- a/Master/texmf-dist/source/lualatex/ekdosis/ekdosis.dtx +++ b/Master/texmf-dist/source/lualatex/ekdosis/ekdosis.dtx @@ -61,7 +61,7 @@ along with this program. If not, see %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> - [2021/08/18 v1.3 Typesetting TEI xml-compliant critical editions] + [2021/11/21 v1.4 Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -441,8 +441,13 @@ along with this program. If not, see } \end{filecontents} \begin{filecontents}[overwrite]{\jobname-ekd.cfg} +%% fixfoot:--- +\DeclareFixedFootnote{\seeekdsep}{See below + \vpageref{ref:ekdsep-subsep} for more information and + \vref{lst:emend-coni-corr}, ll.~23--5 for an illustrative example.} +%% ekdosis:--- \footnotelayout{m} -\SetCritSymbols{suppbegin = 〈,suppend = 〉} +\SetCritSymbols{suppbegin = ⟨,suppend = ⟩} \EnvtoTEI{ancientgreek}{p}[xml:lang="grc"] \DeclareApparatus{fontium}[ delim=\hskip0.75em, @@ -558,14 +563,14 @@ along with this program. If not, see \defaultfontfeatures{Renderer=Harfbuzz} \usepackage[latin.classic,greek.ancient,american]{babel} \babelfont{rm}{Old Standard} -\babelfont{sf}{NewComputerModernSans10} -\babelfont{tt}{NewComputerModernMono10} +\babelfont{sf}{NewCMSans10-Book} +\babelfont{tt}{NewCMMono10-Book} \babelfont[greek]{rm}[ Script=Greek, RawFeature={+ss05;+ss06} ]{Old Standard} -\babelfont[greek]{sf}[Script=Greek]{NewComputerModernSans10} -\babelfont[greek]{tt}[Script=Greek]{NewComputerModernMono10} +\babelfont[greek]{sf}[Script=Greek]{NewCMSans10-Book} +\babelfont[greek]{tt}[Script=Greek]{NewCMMono10-Book} \newfontfamily{\junicode}{Junicode}[ Ligatures=TeX, RawFeature={+hist}] @@ -575,6 +580,10 @@ along with this program. If not, see \usepackage[Old Standard]{mathfont} \usepackage[biblatex=true]{embrac} \usepackage{chifoot} +\usepackage{fixfoot} +\usepackage[nospace,american]{varioref} +\newcommand\phts{\phantomsection} +\usepackage{nameref} \usepackage{arabluatex} \usepackage[parnotes=roman, teiexport=tidy, poetry=verse]{ekdosis} \AddxmlBibResource{bibdata.xml} @@ -628,9 +637,6 @@ along with this program. If not, see \labelformat{figure}{fig.~#1} \usepackage[defaultindex=none,citecmd=autocite]{icite} \bibinput{ekdosis} -\usepackage[nospace,american]{varioref} -\newcommand\phts{\phantomsection} -\usepackage{nameref} \newcommand\vnref[1]{\vref{#1}, \enquote{\nameref{#1}}} \usepackage[style=oxnotes-inote,dashed]{biblatex} \DefineBibliographyStrings{english}{ @@ -805,7 +811,7 @@ along with this program. If not, see \usepackage{needspace} \NewDocumentCommand{\captof}{O{listing} m O{}}{% \bgroup - \needspace{5\baselineskip}% + \nobreak \vskip 1ex plus 2pt minus 2pt% \captionof{#1}{#2}% #3% @@ -849,7 +855,7 @@ along with this program. If not, see % % \fi % -% \CheckSum{2519} +% \CheckSum{2635} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -927,10 +933,10 @@ along with this program. If not, see % Alessi: % \begin{itemize} % \item email: \mailto[ekdosis package]{Robert Alessi } -% \item website: \url{http://www.robertalessi.net/ekdosis} +% \item website: \url{http://www.ekdosis.org} % \item development: \url{http://git.robertalessi.net/ekdosis} % \item comments, feature requests, bug reports: -% \url{https://gitlab.com/ralessi/ekdosis/issues} +% \url{http://www.ekdosis.org/issues} % \end{itemize} % % \leavevmode\marginpar{\hfill\texttt{gpl3+}} @@ -1822,8 +1828,8 @@ yesterday. % \DescribeOption{type} |type|$=$\meta{type}\phts\label{ref:app-type} % \hfill\tcboxverb{Default: default}\\ % As will be described below in \vref{sec:multilayer-apparatus}, -% \pkg{ekdosis} initially sets one layer of notes\--- the |default| -% layer\---in the apparatus criticus. This layer is fit to receive +% \pkg{ekdosis} initially sets one layer of notes\===the |default| +% layer\===in the apparatus criticus. This layer is fit to receive % notes related to variant readings from witnesses and sources used by % the editor to establish the edition text. Additional layers can be % defined to receive other kinds of notes, such as references to texts @@ -1855,8 +1861,8 @@ yesterday. % apparatus criticus, preceded by the line number where it occurs or a % broad space when the entry refers to the same line as the preceding % entry. \phts\label{ref:lem-opts-b}The optional argument of \cs{lem} -% accepts the following -% comma-separated list of \enquote{name$=$value} arguments:---\\ +% accepts the following comma-separated list of \enquote{name$=$value} +% arguments:---\\ % \DescribeOption{wit} |wit|$=$\meta{csv list of % witnesses}\phts\label{ref:lem-wit}\\ % While a single witness may be recorded as in |wit=A|, @@ -1864,11 +1870,16 @@ yesterday. % enclosed in curly braces, like so: % |wit={A,B,C}|. \phts\label{ref:mss-sep-families}It must be noted % that witnesses can be grouped by using spaces as separators, like -% so: \verb*|wit={A,B,C, D,E,F}|. Although any unique identifiers or -% labels used to \enquote{declare} sources and scholars as described -% above \vpagerefrange{ref:declare-source}{ref:declare-scholar} can -% also be used as values of the |wit| optional argument, it is -% recommended to use |sources| and |resp| to refer to either category +% so: \verb*|wit={A,B,C, D,E,F}|. \danger In the apparatus criticus in +% print, it is customary to remind the reader of the manuscript +% groupings by spaces or commas. \pkg{ekdosis} prints spaces by +% default, but can be instructed to print any other symbol +% instead.\footnote{See below \vpageref{ref:familysep} for details.} +% \danger Although any unique identifiers or labels used to +% \enquote{declare} sources and scholars as described above +% \vpagerefrange{ref:declare-source}{ref:declare-scholar} can also be +% used as values of the |wit| optional argument, it is recommended to +% use |sources| and |resp| to refer to either category % respectively as described below.\\ % \DescribeOption{source} |source|$=$\meta{csv list of % sources}\phts\label{ref:lem-source}\newfeature[v1.1]\\ @@ -1904,15 +1915,12 @@ yesterday. % if used. |nosep| removes the separator mentioned above. Obviously, % |nosep| must be used when for some reason no \cs{rdg} command % follows a \cs{lem} command that has just been used, as shown below -% in \vref{lst:emend-coni-corr}, l.~7. -% -% \needspace{2\baselineskip} -% \danger \DescribeMacro{\ekdsep} If |nosep| be used so as to insert -% an explanatory note after the lemma text with the \cs{note} command -% described below \vpageref{ref:editorial-notes}, then \cs{ekdsep} can -% be used\---for instance as value of the |post| optional argument of -% the note\---to put back in the separator. This technique is -% demonstrated below in \vref{lst:emend-coni-corr}, ll.~23--5.\\ +% in \vref{lst:emend-coni-corr}, l.~7. \danger If |nosep| be used so +% as to insert an explanatory note after the lemma text with the +% \cs{note} command described below \vpageref{ref:editorial-notes}, +% then the |sep| optional argument of \cs{note} can be used to put +% back in the separator. This technique is demonstrated below in +% \vref{lst:emend-coni-corr}, ll.~23--5.\\ % \DescribeOption{nolem} |nolem|$=$\verb+true|false+\\ % This named argument does not need a value as it defaults to |true| % if used. |nolem| completely removes the lemma text from the related @@ -1987,6 +1995,19 @@ yesterday. % \DescribeOption{post} |post|$=$\meta{words}\\ % \DescribeOption{prewit} |prewit|$=$\meta{words}\\ % \DescribeOption{postwit} |postwit|$=$\meta{words}\\ +% \DescribeOption{subsep} |subsep|$=$\meta{subseparator}\\ +% \newfeature[v1.4] |subsep| inserts a subseparator to be printed +% \emph{before} the current entry as described below +% \vpageref{ref:setsubseparator}. This option is supposed to be used +% when no subseparator is defined, or when one is defined but for some +% reason a different subseparator is needed for the current +% entry.\\ +% \DescribeOption{nosubsep} This argument-less option removes the +% subseparator from the current entry, provided one has been set by +% means of \cs{SetSubseparator}, \cs{SetApparatus} or +% \cs{DeclareApparatus}.\footnote{See +% \vpagerefrange{ref:setsubseparator}{ref:apparatus-settings-e} and +% \vref{sec:declaring-layers} for details.} % % \paragraph{Notes} % \DescribeMacro{\note}\phts\label{ref:notes-b}\DescribeMacro{\note*} @@ -2007,6 +2028,10 @@ yesterday. % |pre| inserts \meta{words} immediately before the note.\\ % \DescribeOption{post} |post|$=$\meta{words}\\ % |post| inserts \meta{words} immediately after the note.\\ +% \DescribeOption{sep} This argument-less option is equivalent to +% |post=\ekdsep|.\seeekdsep\\ +% \DescribeOption{subsep} This argument-less option is equivalent to +% |pre=\ekdsubsep|.\seeekdsep\\ % % \danger Under no circumstances is it permitted to insert this % command \cs{note} or \cs{note*} inside the argument of \cs{lem} or @@ -2537,6 +2562,14 @@ friend % \DescribeOption{gapmark}|gapmark|$=$\meta{symbols} % \hfill\tcboxverb{Default: ***}\\ % The symbols used to mark lacunae.\\ +% \DescribeOption{keepinapp} |keepinapp|$=$\verb+true|false+ +% \hfill\tcboxverb{Default: false}\\ +% \newfeature[v1.4] This named argument does not need a value as it +% defaults to |true| if used. By default, the critical symbols used by +% \cs{supplied}, \cs{surplus} and \cs{sic} described below +% \vpagerefrange{ref:corr-cmds-b}{ref:corr-cmds-e} are printed in the +% edition text but removed from the apparatus. |keepinapp| instructs +% \pkg{ekdosis} to print these symbols in both places. % % As an example, what follows sets |[]| for deletions and |...| for % lacunae:--- @@ -2564,6 +2597,7 @@ friend % used to perform the test. % % \paragraph{Editorial Addition} +% \phts\label{ref:corr-cmds-b} % \DescribeMacro{\supplied}\newfeature[v1.1]\cs{supplied}\marg{text} % is used to mark \meta{text} that is by definition missing from the % tradition as supplied by the editor or some other scholar. This @@ -2581,6 +2615,7 @@ friend % mandatory argument the text deemed by the editor to be readable but % not understandable. \cs{sic} inserts \meta{text} between cruces % while \cs{sic*} prints only one crux before \meta{text}. +% \phts\label{ref:corr-cmds-e} % % \paragraph{Lacuna} % \DescribeMacro{\gap}\newfeature[v1.1] \cs{gap}\marg{csv list of @@ -2639,7 +2674,7 @@ friend Πάντων δὲ \app{ \lem[resp=egomute, type=emendation, nosep]{\supplied{τῶν πυρετῶν}} - \note[post=\ekdsep]{addidi (\arb{^gamI`a 'l-.hummayAti} + \note[sep]{addidi (\arb{^gamI`a 'l-.hummayAti} \getsiglum{Gal})} \rdg[nordg, source=Gal]{\arb{al-.hummayAti}} \rdg[wit=codd, source=edd, alt=om.]{} @@ -2676,7 +2711,7 @@ friend % % Πάντων δὲ \app{ % \lem[resp=egomute, type=emendation, nosep]{\supplied{τῶν πυρετῶν}} -% \note[post=\ekdsep]{addidi (\arb{^gamI`a 'l-.hummayAti} +% \note[sep]{addidi (\arb{^gamI`a 'l-.hummayAti} % \getsiglum{Gal})} % \rdg[nordg, source=Gal]{\arb{al-.hummayAti}} % \rdg[wit=hcodd, source=hedd, alt=om.]{} @@ -2985,7 +3020,7 @@ friend % \emph{semicolons}, as shown in red in the listing below at the end % of lines~1 and 2. % \begin{enumerate} -% \item[\dbend] The colon at the end of line~3 closes the whole +% \item[\dbend] The comma at the end of line~3 closes the whole % value of |text| and acts as a higher level separator. % \end{enumerate} % \item \phts\label{it:lang-subopt} Each name may be followed by a @@ -3318,6 +3353,20 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \hfill\tcboxverb{Default: not set}\\ % \newfeature[v1.2] |readingstyle| operates in the same way as % |lemmastyle| but applies to variant readings.\\ +% \DescribeOption{familysep} |familysep|$=$\meta{symbol}\verb+|reset+ +% \phts\label{ref:familysep}\hfill\tcboxverb{Default: not set}\\ +% \newfeature[v1.4] As described above \vpageref{ref:lem-wit}, +% multiple witnesses must be recorded in the |wit| optional argument +% of the \cs{lem} and \cs{rdg} commands as comma-separated lists of +% sigla which can be further grouped into families by inserting spaces +% as separators just after commas at specific places. \pkg{ekdosis} +% saves and prints these spaces in the apparatus criticus but can be +% instructed to print any other symbol instead by means of +% |familysep|. For instance, |familysep={,}| has the separating spaces +% replaced with commas and |familysep={,\allowbreak}| does the same +% while further allowing breaks after commas at the end of +% lines. Finally, |familysep=reset| can be used to restore the default +% behavior.\\ % \DescribeOption{initialrule} |initialrule|$=$\meta{command} % \phts\label{ref:initialrule}\hfill\bgroup\footnotesize % \tcboxverb{Default: \rule{0.4\columnwidth}{0.4pt} (initially not set)}% @@ -3325,8 +3374,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % between the edition text and all subsequent layers of critical % notes. Of course, this option only makes sense when multiple-layer % apparatus criticus are set. Therefore, it has no effect on -% single-layer apparatus -% criticus.\\ +% single-layer apparatus criticus.\\ % \DescribeOption{noinitialrule}\hfill\tcboxverb{Default: not set}\\ % This is a no-value option. It removes any previously set % |initialrule|. @@ -3386,10 +3434,38 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % right-to-left. % % \DescribeMacro{\SetSeparator} \cs{SetSeparator}\marg{separator} is -% used to change the separator between lemma texts and variants +% used to change the separator between lemma texts and variant % readings. By default, the separator is a closing square bracket % followed by a space (\verb*+] +). % +% \DescribeMacro{\SetSubseparator}\label{ref:setsubseparator} +% \newfeature[v1.4] \cs{SetSubseparator}\marg{subseparator} is used to +% set or change the \enquote{subseparator} between succeeding variant +% readings. By default, no subseparator is set. +% +% \danger As the subseparator applies to subsequent variant readings +% only, it is naturally preceded by a breakable space. This space can +% be removed by \cs{unskip}. As an example, what follows replaces the +% breakable space with an unbreakable space, then prints a colon as +% subseparator followed by a space:--- +% +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{latex} +\SetSubseparator{\unskip~: } +\end{minted} +% \iffalse +% +% \fi +% +% \danger \DescribeMacro{\ekdsep} \DescribeMacro{\ekdsubsep} +% \phts\label{ref:ekdsep-subsep} Once the separator and if applicable +% the subseparator have been set, they can be accessed by \cs{ekdsep} +% and \cs{ekdsubsep} respectively. It is therefore advisable to use +% these commands instead of the mere symbols at whatever place one +% would have them printed. +% % \DescribeMacro{\SetBeginApparatus} % \cs{SetBeginApparatus}\marg{characters\textbar commands} can be used % to append \meta{characters} or \meta{commands} at the beginning of @@ -3452,6 +3528,9 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \DescribeOption{sep} |sep|$=$\meta{command \textbar\ chars} % \hfill\tcboxverb{Default: ]␣}\\ % The separator between lemma texts and variant readings.\\ +% \DescribeOption{subsep} |subsep|$=$\meta{command \textbar\ chars} +% \hfill\tcboxverb{Default: not set}\\ +% The \enquote{subseparator} between succeeding variant readings.\\ % \DescribeOption{delim} |delim|$=$\meta{delimiter} % \hfill\tcboxverb{Default: not set}\\ % The delimiter between entries in the apparatus criticus. As said @@ -3470,7 +3549,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % between the edition text and the apparatus criticus.\\ % \DescribeOption{norule}\hfill\tcboxverb{Default: not set}\\ % |norule| does not accept any value and is used to remove the -% line.\phts\label{ref:apparatus-settings-e}\\ +% line.\\ % \DescribeOption{lang} |lang|$=$\meta{languagename} % \newfeature[v1.2]\phts\label{ref:app-lang-opt} % \hfill\tcboxverb{Default: not set}\\ @@ -3489,7 +3568,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \cs{note}\oarg{options}\marg{text}\===a language different from the % one that is selected in the edition text. |languagename| can be any % value accepted by \pkg{babel} or \pkg{polyglossia}. -% +% \phts\label{ref:apparatus-settings-e} +% % As an example, an apparatus criticus with references to line numbers % printed in normal font, a colon as a separator between lemma texts % and variant readings, a broad space as a delimiter between entries @@ -3578,6 +3658,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \label{sec:layout-layers} % \DescribeOption{direction} % \DescribeOption{sep} +% \DescribeOption{subsep} % \DescribeOption{delim} % \DescribeOption{bhook} % \DescribeOption{ehook} @@ -3603,7 +3684,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ % \iffalse %<*example> % \fi -\begin{minted}{latex} +\begin{minted}[numbersep=6pt]{latex} \SetHooks{ refnumstyle=\normalfont, initialrule=\rule{0.7in}{0.4pt} @@ -4087,14 +4168,18 @@ argument of the % instead of |\\|. % \item |\\*| does the same as |\\| except that it prohibits a page % break after the line. -% \item |\\>| is for line breaks within a verse line. +% \item |\\>| \label{ref:vlinebreak-indent}is for line breaks within a +% verse line. +% \item |\\+| \newfeature[v1.4] \label{ref:vlinebreak-noindent}does +% the same as |\\>| but without indenting the subsequent line which +% further complies to any already defined indent pattern. % \end{enumerate} % % All of these commands can take a dimension as optional argument, -% like so: |\\[30pt]|, |\\![30pt]|, |\\*[30pt]| or |\\>[30pt]|. If -% |\\|, |\\!| or |\\*| be used, a vertical space of the dimension -% specified is added between lines, whereas |\\>[...]| adds an -% horizontal space after the line break. +% like so: |\\[30pt]|, |\\![30pt]|, |\\*[30pt]|, |\\>[30pt]| or +% |\\+[30pt]|. If |\\|, |\\!|, |\\*| or |\\+| be used, a vertical +% space of the dimension specified is added between lines, whereas +% |\\>[...]| adds an horizontal space after the line break. % % \DescribeMacro{\vin} \phts\label{ref:verse-vin}\cs{vin} indents a % verse line by a length which is by default \unit[1.5]{em}. This @@ -4716,6 +4801,16 @@ substantiall fewell,} % verse printed in the margin. If used without value, this option is % equivalent to |vmodulo=5|. |vmodulo=0| prevents the % numbers from being printed.\\ +% \DescribeOption{vnumbrokenlines} +% |vnumbrokenlines|$=$\verb+true|false+ % +% \hfill\tcboxverb{Initially: false}\\ +% \newfeature[v1.4] This named argument does not need a value as it +% defaults to |true| if used. |vnumbrokenlines| has both parts of lines +% broken by |\\>| or |\\+|\footnote{See above +% \vrefrange{ref:vlinebreak-indent}{ref:vlinebreak-noindent} for more +% information.} numbered with the same number for disambiguation +% purposes. By default, only the second part of broken lines is +% numbered.\\ % \DescribeOption{vmargin} |vmargin|$=$\verb+right|left+ % \hfill\tcboxverb{Default: right}\\ % |vmargin| sets the margin in which the verse line numbers are to be @@ -4726,13 +4821,13 @@ substantiall fewell,} % numbered continuously, irrespective of whether they are lines of % prose or poetry text. % -% % \paragraph{Useful Lineation Commands} % As implied above, pretty much all commands that are provided by the % \enquote{running} mode of operation of the \pkg{lineno} package will % work with \pkg{ekdosis}, notably the following:---\\ % \DescribeMacro{\modulolinenumbers} \cs{modulolinenumbers}\oarg{n} -% can be used to enable modulo line numbering as described above.\\ +% can be used to enable or modify modulo line numbering as described +% above.\\ % \DescribeMacro{\resetlinenumber} \cs{resetlinenumber}\oarg{n} resets % the line number to one or to \emph{n} if specified.\\ % \DescribeMacro{\linenumberfont} @@ -4750,15 +4845,16 @@ substantiall fewell,} % global option |poetry=verse| as described above in % \vref{sec:verse-package}, the commands dedicated to line numbering % that are provided by the \pkg{verse} package can be used.\\ +% \DescribeMacro{\vmodulolinenumbers} \newfeature[v1.4] +% \cs{vmodulolinenumbers}\oarg{n} can be used to enable or modify +% verse modulo line numbering as described above.\\ % \DescribeMacro{\resetvlinenumber} \cs{resetvlinenumber}\oarg{n} has % for lines of verse the same effect as \cs{resetlinenumber} for % lines of prose text.\\ % \DescribeMacro{\verselinenumfont} % \cs{verselinenumfont}\marg{commands} can be used to set the font % used for lines of verse. By default, the definition is -% |\normalfont\footnotesize|. \danger If the \cls{memoir} class be -% loaded, this command is replaced with \cs{linenumberfont} described -% above.\\ +% |\normalfont\footnotesize|.\\ % \DescribeMacro{\vrightskip} The \pkg{verse} package prints the % numbers at the distance \cs{vrightskip} into the right margin. This % distance can be redefined by means of \cs{setlength} like so: @@ -7563,7 +7659,7 @@ Sample text with a \textcolor{red}{word} in red. \newif\if@pkg@float \newif\if@pkg@footins \newif\if@pkg@keyfloat -\newif\if@pkg@fitfloat +\newif\if@pkg@fitapp \newif\if@pkg@ekddivs \newif\if@parnotesroman \newif\if@pkg@parnotes @@ -7573,7 +7669,7 @@ Sample text with a \textcolor{red}{word} in red. choice layout = {float = {\@pkg@floattrue}, footins = {\@pkg@floatfalse\@pkg@footinstrue}, keyfloat = {\@pkg@floatfalse\@pkg@keyfloattrue}, - fitfloat = {\@pkg@floatfalse\@pkg@fitfloattrue}}, + fitapp = {\@pkg@floatfalse\@pkg@fitapptrue}}, initial layout = float, unknown-choice layout = \PackageError{ekdosis}{unknown layout=#1}{`layout' must be either `float' or `footins'.}, @@ -7632,7 +7728,7 @@ Sample text with a \textcolor{red}{word} in red. \keyparbox[!b]{#1}{\ekd@insert@apparatus}}} \ekd@keyparopts{} \fi -\if@pkg@fitfloat +\if@pkg@fitapp \RequirePackage{tcolorbox} \tcbuselibrary{fitting,skins} \fi @@ -7690,6 +7786,7 @@ Sample text with a \textcolor{red}{word} in red. store appfontsize = \ekd@appfontsize, store refnumstyle = \ekd@refnumstyle, store postrefnum = \ekd@postrefnum, + code familysep = \luadirect{ekdosis.setfamilysep(\luastringN{#1})}, store lemmastyle = \ekd@lemmastyle, store readingstyle = \ekd@readingstyle, code keyparopts = \if@pkg@keyfloat\ekd@keyparopts{#1}\fi, @@ -8008,6 +8105,7 @@ Sample text with a \textcolor{red}{word} in red. nmeta norule = {rule=none}, code delim = \def\delim@val{\unexpanded{#1}}, store sep = \sep@val, + store subsep = \subsep@val, store bhook = \bhook@val, store ehook = \ehook@val, store maxentries = \limit@val, @@ -8042,6 +8140,7 @@ Sample text with a \textcolor{red}{word} in red. \luastringO{\rule@val}, \luastringO{\delim@val}, \luastringO{\sep@val}, + \luastringO{\subsep@val}, \luastringO{\bhook@val}, \luastringO{\ehook@val}, \luastringO{\limit@val}, @@ -8181,12 +8280,14 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macrocode} \newif\ifrtl@app \edef\ekdsep{] } +\edef\ekdsubsep{} \ekvdefinekeys{default@app}{ choice direction = {LR = \rtl@appfalse, RL = \rtl@apptrue}, unknown-choice direction = \PackageError{ekdosis}{unknown direction=#1}{`direction' must be either `LR' or `RL'.}, code sep = \edef\ekdsep{#1}, + code subsep = \edef\ekdsubsep{#1}, store bhook = \ekd@begin@apparatus, initial bhook = {}, store ehook = \ekd@end@apparatus, @@ -8232,6 +8333,15 @@ Sample text with a \textcolor{red}{word} in red. \NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}} % \end{macrocode} % \end{macro} +% \begin{macro}{\SetSubseparator} +% \changes{v1.4}{2021/11/21}{New command for subseparators} +% \cs{SetSubseparator}\marg{sub-separator} allows to change the +% \enquote{subseparator} between variant readings. By default, +% no subseparator is set:--- +% \begin{macrocode} +\NewDocumentCommand{\SetSubseparator}{m}{\edef\ekdsubsep{#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, @@ -8352,13 +8462,14 @@ Sample text with a \textcolor{red}{word} in red. % either in the footnote floating block or in a float of its own, % depending on the value set in the |layout| global option. As some % commands need to know whether they are called from inside the -% apparatus criticus, a conditional is first defined. +% apparatus criticus, two conditionals are first defined. % \begin{macrocode} \newif\ifekd@inside@app +\newif\ifekd@keepinapp % \end{macrocode} % Then \cs{ekd@fitapp} is defined for |layout=fitapp|:--- % \begin{macrocode} -\if@pkg@fitfloat +\if@pkg@fitapp \newtcboxfit{\ekd@fitapp}{% blankest, fit basedim = \f@size pt, @@ -8425,7 +8536,7 @@ Sample text with a \textcolor{red}{word} in red. \if@pkg@keyfloat \ekd@insert@keyparapp \fi - \if@pkg@fitfloat + \if@pkg@fitapp \ekd@fitapp{\ekd@insert@apparatus}% \fi } @@ -8521,6 +8632,7 @@ Sample text with a \textcolor{red}{word} in red. \else\if@pkg@poetry@verse\poemlines{#1}\fi\fi, initial vmodulo = 1, default vmodulo = 5, + bool vnumbrokenlines = \ifnum@brokenline, bool continuousvnum = \if@continuous@vnum, choice numbers = {elided = \ekd@elidednumberstrue, full = \ekd@elidednumbersfalse}, @@ -8552,6 +8664,22 @@ Sample text with a \textcolor{red}{word} in red. } % \end{macrocode} % \end{macro} +% \begin{macro}{\vmodulolinenumbers} +% \changes{v1.4}{2021/11/21}{New command to adjust modulo verse line +% numbering} +% \begin{macrocode} +\NewDocumentCommand{\vmodulolinenumbers}{O{5}}{% + \ifekd@memoir@loaded + \linenumberfrequency{#1}% + \else + \if@pkg@poetry@verse + \poemlines{#1}% + \fi + \fi + \ignorespaces +} +% \end{macrocode} +% \end{macro} % Use |\normalfont| for line numbers:--- % \begin{macrocode} \renewcommand\linenumberfont{\normalfont\footnotesize} @@ -8593,6 +8721,19 @@ Sample text with a \textcolor{red}{word} in red. \endgroup} % \end{macrocode} % \end{macro} +% \begin{macro}{\ekdpage} +% \changes{v1.4}{2021/11/21}{prints page marks used internally by +% \textsf{ekdosis} to generate the apparatus blocks on pages} +% Instead of absolute page numbers, \pkg{ekdosis} now marks the +% entries of the apparatus with its own page numbering +% scheme. \cs{ekdpage} can be used at any point of the document to +% retrieve and print the current number. +% \begin{macrocode} +\NewDocumentCommand{\ekdpage}{}{% + \luadirect{tex.sprint(ekdosis.getekdabspg())}% +} +% \end{macrocode} +% \end{macro} % \cs{current@ref@arg} is used outside \cs{app} by \cs{note}. It takes % two mandatory arguments: the beginning line label and the ending % line label\---which are manually inserted---and returns the formatted @@ -8817,6 +8958,9 @@ Sample text with a \textcolor{red}{word} in red. code post = \def\ekdlr@post{#1}, code prewit = \def\ekdlr@prewit{#1}, code postwit = \def\ekdlr@postwit{#1}, + store subsep = \ekdr@subsep, + initial subsep = \ekdsubsep, + bool nosubsep = \ifekdr@nosubsep, store type = \ekdlr@type, bool nordg = \ifekdr@nordg } @@ -8987,8 +9131,11 @@ Sample text with a \textcolor{red}{word} in red. % \cs{rdg}\oarg{options}\marg{variant reading} inserts \meta{variant % reading} in the second part of the entry, after the lemma text and % the separator, in the apparatus criticus. This command accepts the -% optional key-value arguments defined above. +% optional key-value arguments defined above. This command sets +% \cs{ifekd@subsq@rdg} to true, which instructs \pkg{ekdosis} that +% \enquote{subseparators} may be used for subsequent entries. % \begin{macrocode} +\newif\ifekd@subsq@rdg \NewDocumentCommand{\rdg}{O{} m}{% \bgroup% \ekvset{rdg}{#1}% @@ -9005,6 +9152,9 @@ Sample text with a \textcolor{red}{word} in red. \else% \ifbool{al@rlmode}{% \edef\rdg@app{% + \ifekd@subsq@rdg + \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi + \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi @@ -9031,6 +9181,9 @@ Sample text with a \textcolor{red}{word} in red. }% {% \edef\rdg@app{% + \ifekd@subsq@rdg + \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi + \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi @@ -9061,13 +9214,14 @@ Sample text with a \textcolor{red}{word} in red. \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi }% }% - \ifekd@mapps% + \ifekd@mapps \append@app[\ekdan@type]{\rdg@app}% - \else% + \else \append@app{\rdg@app}% - \fi% - \fi% - \egroup% + \fi + \fi + \egroup + \ekd@subsq@rdgtrue } % \end{macrocode} % \end{macro} @@ -9177,7 +9331,9 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macrocode} \ekvdefinekeys{ekd@note}{ store pre = \pre@value, - store post = \post@value + store post = \post@value, + nmeta sep = {post=\ekdsep}, + nmeta subsep = {pre=\ekdsubsep} } % \end{macrocode} % The following three commands, \cs{note@app}, \cs{ekd@note} and @@ -9276,7 +9432,8 @@ Sample text with a \textcolor{red}{word} in red. initial delend = \ifbool{al@rlmode}{\{}{\}}, initial sicbegin = \dag, initial sicend = \dag, - initial gapmark = *** + initial gapmark = ***, + bool keepinapp = \ifekd@keepinapp } % \end{macrocode} % \begin{macro}{\supplied} @@ -9286,9 +9443,13 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macrocode} \NewDocumentCommand{\supplied}{m}{% \ifekd@inside@app - #1% + \ifekd@keepinapp + \suppb@value #1\suppe@value + \else + #1% + \fi \else - \suppb@value #1\suppe@value + \suppb@value #1\suppe@value \fi } % \end{macrocode} @@ -9302,9 +9463,13 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macrocode} \NewDocumentCommand{\surplus}{m}{% \ifekd@inside@app - #1% + \ifekd@keepinapp + \delb@value #1\dele@value + \else + #1% + \fi \else - \delb@value #1\dele@value + \delb@value #1\dele@value \fi } % \end{macrocode} @@ -9319,11 +9484,17 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macrocode} \NewDocumentCommand{\sic}{s m}{% \ifekd@inside@app - #2% + \ifekd@keepinapp + \IfBooleanTF{#1} + {\sicb@value #2} + {\sicb@value #2\sice@value}% + \else + #2% + \fi \else - \IfBooleanTF{#1} - {\sicb@value #2} - {\sicb@value #2\sice@value}% + \IfBooleanTF{#1} + {\sicb@value #2} + {\sicb@value #2\sice@value}% \fi } % \end{macrocode} @@ -9767,6 +9938,35 @@ Sample text with a \textcolor{red}{word} in red. } % \end{macrocode} % \end{macro} +% \begin{macro}{\\+} +% \changes{v1.4}{2021/11/21}{New macro for poetry} +% |\\+| comes in addition to the verse commands that are provided by +% the \pkg{verse} package. |\\+| causes a linebreak within a verse +% line. In contrast to |\\>|, the subsequent line is not indented and +% complies to any already defined indent pattern. \cs{@vscentercr} +% must be redefined accordingly. +% \begin{macrocode} +\ifboolexpr{bool {@pkg@poetry@verse} or bool {ekd@memoir@loaded}} + {\newcommand{\@vsifplus}[1]{\@ifnextchar +{\@firstoftwo{#1}}} + \renewcommand{\@vscentercr}{% + \ifhmode \unskip\else \@nolnerr\fi + \@vsifgt{\ifnum@brokenline\@vstypelinenum\fi\verselinebreak}{% + \@vsifplus{\ifnum@brokenline\@vstypelinenum\fi\stepcounter{vslineno}% + \par\@ifstar{\nobreak\@vsxcentercr}{% + \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}% + }% + }{% + \@vstypelinenum + \incr@vsline% + \par\@ifstar{\nobreak\@vsxcentercr}{% + \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}% + }% + }% + }% + } + }{} +% \end{macrocode} +% \end{macro} % A small patch is applied to the \pkg{verse} package, then % \env{ekdverse} is defined:--- % \begin{macrocode} @@ -9781,7 +9981,8 @@ Sample text with a \textcolor{red}{word} in red. code type = \def\type@value{#1}, } \ifekd@memoir@loaded - \linenumberfont{\normalfont\footnotesize} + \def\vlvnumfont{\normalfont\footnotesize} + \def\verselinenumfont#1{\def\vlvnumfont{#1}} \else \verselinenumfont{\normalfont\footnotesize} \fi @@ -9927,7 +10128,7 @@ local inanchor = lpeg.Cs{ "")) + lpeg.V(1) local inopeningnote = lpeg.Cs{ "")) + lpeg.V(1))^0 * ">" } local lnbrk = lpeg.Cs("\\\\") local poemline = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.S("*!")^-1 * bsqbrackets^-1 * spcenc^-1) -local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.P(">") * bsqbrackets^-1 * spcenc^-1) +local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * (lpeg.P(">") + lpeg.P("+")) * bsqbrackets^-1 * spcenc^-1) local linegroup = lpeg.Cs{ "") + lpeg.V(1))^0 * ">" } local bclinegroup = lpeg.Cs(linegroup + lpeg.P("")) local endpoem = lpeg.Cs(lnbrk * lpeg.S("*!") * bsqbrackets^-1) -- not used @@ -10227,6 +10428,18 @@ function ekdosis.newsource(id, siglum) return true end +local familysep = nil + +function ekdosis.setfamilysep(str) + if str == "reset" + then + familysep = nil + else + familysep = str + end + return true +end + function ekdosis.getsiglum(str, opt) str = str.."," str = string.gsub(str, "%s-(%,)", "%1") @@ -10250,6 +10463,10 @@ function ekdosis.getsiglum(str, opt) str = string.gsub(str, tempc.."%,", idsRend[i].abbr) ctrl = string.gsub(ctrl, tempc.."%,", "") end + if familysep ~= nil + then + str = string.gsub(str, "%s+", familysep) + end end -- if string.find(ctrl, "[A-Za-z0-9]") if string.find(ctrl, "%S") @@ -10289,6 +10506,10 @@ local cmdtotags = { local texpatttotags = { {a="\\addentries%s+%[(.-)%]{(.-)}", b=""}, {a="\\addentries%s+{(.-)}", b=""}, + {a="\\vmodulolinenumbers%s+%[(.-)%]", b=""}, + {a="\\vmodulolinenumbers%s+", b=""}, + {a="\\modulolinenumbers%s+%[(.-)%]", b=""}, + {a="\\modulolinenumbers%s+", b=""}, {a="\\setverselinenums%s+{(.-)}{(.-)}", b=""}, {a="\\resetvlinenumber%s+%[(.-)%]", b=""}, {a="\\resetvlinenumber%s+", b=""}, @@ -10630,6 +10851,9 @@ local function versetotei(str) end) str = string.gsub(str, "\\begin%s?%{ekdverse%}(.-)\\end%s?%{ekdverse%}", function(arg) arg = string.gsub(arg, "\\par%s?", "") + arg = string.gsub(arg, "\\begin%s?%{patverse%*?%}", "") + arg = string.gsub(arg, "\\end%s?%{patverse%*?%}", "") + arg = string.gsub(arg, "\\indentpattern%s?%b{}", "") return "\\p@rb "..linestotei(string.format("%s", arg)).."\\p@ra " end) str = string.gsub(str, "\\begin%s?%{verse%}%b[](.-)\\end%s?%{verse%}", function(arg) @@ -11546,6 +11770,7 @@ function ekdosis.closestream() end local cur_abs_pg = 0 +local ekd_abs_pg = 0 local pg_i = nil local pg_ii = nil local prevcol = nil @@ -11559,16 +11784,25 @@ function ekdosis.update_abspg(n) -- not used end function ekdosis.storeabspg(n, pg) + if tonumber(n) > tonumber(cur_abs_pg) + then + ekd_abs_pg = ekd_abs_pg + 1 + end + cur_abs_pg = n + n = ekd_abs_pg if pg == "pg_i" then pg_i = n elseif pg == "pg_ii" then pg_ii = n table.insert(check_resetlineno, curcol.."-"..pg_ii) end - cur_abs_pg = n return true end +function ekdosis.getekdabspg() + return ekd_abs_pg +end + function ekdosis.checkresetlineno() if isfound(check_resetlineno, curcol.."-"..pg_i) then @@ -11806,6 +12040,7 @@ function ekdosis.newapparatus(teitype, apprule, appdelim, appsep, + appsubsep, appbhook, appehook, applimit, @@ -11822,6 +12057,7 @@ function ekdosis.newapparatus(teitype, rule = apprule, delim = appdelim, sep = appsep, + subsep = appsubsep, bhook = appbhook, ehook = appehook, limit = applimit, @@ -11922,8 +12158,8 @@ function ekdosis.appin(str, teitype) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if next(apparatuses) == nil then - f:write("<", cur_abs_pg, cur_alignment, curcol, "-0>", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-0>", str, "\n") else for i = 1,#apparatuses do @@ -11932,8 +12168,8 @@ function ekdosis.appin(str, teitype) break end end - f:write("<", cur_abs_pg, cur_alignment, curcol, "-", - appno, ">", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-", + appno, ">", str, "\n") end f:close() return true @@ -11951,10 +12187,10 @@ function ekdosis.appout() table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces") -- table.insert(output, "\\noindent ") for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-0>.-") do @@ -11966,10 +12202,10 @@ function ekdosis.appout() local n = 1 while apparatuses[n] do - if string.match(t, "<"..cur_abs_pg + if string.match(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") then @@ -12026,6 +12262,10 @@ function ekdosis.appout() table.insert(output, "\\edef\\ekdsep{" .. apparatuses[n].sep .. "}") else end + if apparatuses[n].subsep ~= "" + then + table.insert(output, "\\edef\\ekdsubsep{" .. apparatuses[n].subsep .. "}") + end if apparatuses[n].bhook ~= "" then table.insert(output, apparatuses[n].bhook) @@ -12033,10 +12273,10 @@ function ekdosis.appout() table.insert(output, "\\relax") end for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") do @@ -12056,8 +12296,8 @@ function ekdosis.appout() end f:close() str = table.concat(output) - str = string.gsub(str, "", "") - str = string.gsub(str, "<"..cur_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") + str = string.gsub(str, "", "") + str = string.gsub(str, "<"..ekd_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") return str else end @@ -12077,7 +12317,7 @@ end local curcol_curabspg = {} function ekdosis.testapparatus() - if isfound(curcol_curabspg, curcol.."-"..cur_abs_pg) + if isfound(curcol_curabspg, curcol.."-"..ekd_abs_pg) then if newalignment then @@ -12090,7 +12330,7 @@ function ekdosis.testapparatus() return "\\boolfalse{do@app}" end else - table.insert(curcol_curabspg, curcol.."-"..cur_abs_pg) + table.insert(curcol_curabspg, curcol.."-"..ekd_abs_pg) if next(apparatuses) ~= nil then reset_bagunits() end diff --git a/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.lua b/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.lua index f5f9bd22c41..b5ddfb38c56 100644 --- a/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.lua +++ b/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.lua @@ -56,7 +56,7 @@ local inanchor = lpeg.Cs{ "")) + lpeg.V(1) local inopeningnote = lpeg.Cs{ "")) + lpeg.V(1))^0 * ">" } local lnbrk = lpeg.Cs("\\\\") local poemline = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.S("*!")^-1 * bsqbrackets^-1 * spcenc^-1) -local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * lpeg.P(">") * bsqbrackets^-1 * spcenc^-1) +local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * (lpeg.P(">") + lpeg.P("+")) * bsqbrackets^-1 * spcenc^-1) local linegroup = lpeg.Cs{ "") + lpeg.V(1))^0 * ">" } local bclinegroup = lpeg.Cs(linegroup + lpeg.P("")) local endpoem = lpeg.Cs(lnbrk * lpeg.S("*!") * bsqbrackets^-1) -- not used @@ -356,6 +356,18 @@ function ekdosis.newsource(id, siglum) return true end +local familysep = nil + +function ekdosis.setfamilysep(str) + if str == "reset" + then + familysep = nil + else + familysep = str + end + return true +end + function ekdosis.getsiglum(str, opt) str = str.."," str = string.gsub(str, "%s-(%,)", "%1") @@ -379,6 +391,10 @@ function ekdosis.getsiglum(str, opt) str = string.gsub(str, tempc.."%,", idsRend[i].abbr) ctrl = string.gsub(ctrl, tempc.."%,", "") end + if familysep ~= nil + then + str = string.gsub(str, "%s+", familysep) + end end -- if string.find(ctrl, "[A-Za-z0-9]") if string.find(ctrl, "%S") @@ -418,6 +434,10 @@ local cmdtotags = { local texpatttotags = { {a="\\addentries%s+%[(.-)%]{(.-)}", b=""}, {a="\\addentries%s+{(.-)}", b=""}, + {a="\\vmodulolinenumbers%s+%[(.-)%]", b=""}, + {a="\\vmodulolinenumbers%s+", b=""}, + {a="\\modulolinenumbers%s+%[(.-)%]", b=""}, + {a="\\modulolinenumbers%s+", b=""}, {a="\\setverselinenums%s+{(.-)}{(.-)}", b=""}, {a="\\resetvlinenumber%s+%[(.-)%]", b=""}, {a="\\resetvlinenumber%s+", b=""}, @@ -759,6 +779,9 @@ local function versetotei(str) end) str = string.gsub(str, "\\begin%s?%{ekdverse%}(.-)\\end%s?%{ekdverse%}", function(arg) arg = string.gsub(arg, "\\par%s?", "") + arg = string.gsub(arg, "\\begin%s?%{patverse%*?%}", "") + arg = string.gsub(arg, "\\end%s?%{patverse%*?%}", "") + arg = string.gsub(arg, "\\indentpattern%s?%b{}", "") return "\\p@rb "..linestotei(string.format("%s", arg)).."\\p@ra " end) str = string.gsub(str, "\\begin%s?%{verse%}%b[](.-)\\end%s?%{verse%}", function(arg) @@ -1675,6 +1698,7 @@ function ekdosis.closestream() end local cur_abs_pg = 0 +local ekd_abs_pg = 0 local pg_i = nil local pg_ii = nil local prevcol = nil @@ -1688,16 +1712,25 @@ function ekdosis.update_abspg(n) -- not used end function ekdosis.storeabspg(n, pg) + if tonumber(n) > tonumber(cur_abs_pg) + then + ekd_abs_pg = ekd_abs_pg + 1 + end + cur_abs_pg = n + n = ekd_abs_pg if pg == "pg_i" then pg_i = n elseif pg == "pg_ii" then pg_ii = n table.insert(check_resetlineno, curcol.."-"..pg_ii) end - cur_abs_pg = n return true end +function ekdosis.getekdabspg() + return ekd_abs_pg +end + function ekdosis.checkresetlineno() if isfound(check_resetlineno, curcol.."-"..pg_i) then @@ -1935,6 +1968,7 @@ function ekdosis.newapparatus(teitype, apprule, appdelim, appsep, + appsubsep, appbhook, appehook, applimit, @@ -1951,6 +1985,7 @@ function ekdosis.newapparatus(teitype, rule = apprule, delim = appdelim, sep = appsep, + subsep = appsubsep, bhook = appbhook, ehook = appehook, limit = applimit, @@ -2051,8 +2086,8 @@ function ekdosis.appin(str, teitype) local f = io.open(tex.jobname.."_tmp.ekd", "a+") if next(apparatuses) == nil then - f:write("<", cur_abs_pg, cur_alignment, curcol, "-0>", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-0>", str, "\n") else for i = 1,#apparatuses do @@ -2061,8 +2096,8 @@ function ekdosis.appin(str, teitype) break end end - f:write("<", cur_abs_pg, cur_alignment, curcol, "-", - appno, ">", str, "\n") + f:write("<", ekd_abs_pg, cur_alignment, curcol, "-", + appno, ">", str, "\n") end f:close() return true @@ -2080,10 +2115,10 @@ function ekdosis.appout() table.insert(output, "\\csname ekd@begin@apparatus\\endcsname\\ignorespaces") -- table.insert(output, "\\noindent ") for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-0>.-") do @@ -2095,10 +2130,10 @@ function ekdosis.appout() local n = 1 while apparatuses[n] do - if string.match(t, "<"..cur_abs_pg + if string.match(t, "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") then @@ -2155,6 +2190,10 @@ function ekdosis.appout() table.insert(output, "\\edef\\ekdsep{" .. apparatuses[n].sep .. "}") else end + if apparatuses[n].subsep ~= "" + then + table.insert(output, "\\edef\\ekdsubsep{" .. apparatuses[n].subsep .. "}") + end if apparatuses[n].bhook ~= "" then table.insert(output, apparatuses[n].bhook) @@ -2162,10 +2201,10 @@ function ekdosis.appout() table.insert(output, "\\relax") end for i in string.gmatch(t, - "<"..cur_abs_pg + "<"..ekd_abs_pg ..cur_alignment_patt ..curcol.."%-"..n..">.-") do @@ -2185,8 +2224,8 @@ function ekdosis.appout() end f:close() str = table.concat(output) - str = string.gsub(str, "", "") - str = string.gsub(str, "<"..cur_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") + str = string.gsub(str, "", "") + str = string.gsub(str, "<"..ekd_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ") return str else end @@ -2206,7 +2245,7 @@ end local curcol_curabspg = {} function ekdosis.testapparatus() - if isfound(curcol_curabspg, curcol.."-"..cur_abs_pg) + if isfound(curcol_curabspg, curcol.."-"..ekd_abs_pg) then if newalignment then @@ -2219,7 +2258,7 @@ function ekdosis.testapparatus() return "\\boolfalse{do@app}" end else - table.insert(curcol_curabspg, curcol.."-"..cur_abs_pg) + table.insert(curcol_curabspg, curcol.."-"..ekd_abs_pg) if next(apparatuses) ~= nil then reset_bagunits() end diff --git a/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.sty b/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.sty index 2bacb9f9159..0e3058955d5 100644 --- a/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.sty +++ b/Master/texmf-dist/tex/lualatex/ekdosis/ekdosis.sty @@ -41,7 +41,7 @@ %% Running "make inst" installs the files in the user's TeX tree. \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{ekdosis} - [2021/08/18 v1.3 Typesetting TEI xml-compliant critical editions] + [2021/11/21 v1.4 Typesetting TEI xml-compliant critical editions] \RequirePackage{iftex} \RequireLuaTeX \RequirePackage{expkv-opt} @@ -49,7 +49,7 @@ \newif\if@pkg@float \newif\if@pkg@footins \newif\if@pkg@keyfloat -\newif\if@pkg@fitfloat +\newif\if@pkg@fitapp \newif\if@pkg@ekddivs \newif\if@parnotesroman \newif\if@pkg@parnotes @@ -59,7 +59,7 @@ choice layout = {float = {\@pkg@floattrue}, footins = {\@pkg@floatfalse\@pkg@footinstrue}, keyfloat = {\@pkg@floatfalse\@pkg@keyfloattrue}, - fitfloat = {\@pkg@floatfalse\@pkg@fitfloattrue}}, + fitapp = {\@pkg@floatfalse\@pkg@fitapptrue}}, initial layout = float, unknown-choice layout = \PackageError{ekdosis}{unknown layout=#1}{`layout' must be either `float' or `footins'.}, @@ -110,7 +110,7 @@ \keyparbox[!b]{#1}{\ekd@insert@apparatus}}} \ekd@keyparopts{} \fi -\if@pkg@fitfloat +\if@pkg@fitapp \RequirePackage{tcolorbox} \tcbuselibrary{fitting,skins} \fi @@ -143,6 +143,7 @@ store appfontsize = \ekd@appfontsize, store refnumstyle = \ekd@refnumstyle, store postrefnum = \ekd@postrefnum, + code familysep = \luadirect{ekdosis.setfamilysep(\luastringN{#1})}, store lemmastyle = \ekd@lemmastyle, store readingstyle = \ekd@readingstyle, code keyparopts = \if@pkg@keyfloat\ekd@keyparopts{#1}\fi, @@ -293,6 +294,7 @@ nmeta norule = {rule=none}, code delim = \def\delim@val{\unexpanded{#1}}, store sep = \sep@val, + store subsep = \subsep@val, store bhook = \bhook@val, store ehook = \ehook@val, store maxentries = \limit@val, @@ -314,6 +316,7 @@ \luastringO{\rule@val}, \luastringO{\delim@val}, \luastringO{\sep@val}, + \luastringO{\subsep@val}, \luastringO{\bhook@val}, \luastringO{\ehook@val}, \luastringO{\limit@val}, @@ -402,12 +405,14 @@ \hb@xt@0em{\hss\@makefnmark}#1} \newif\ifrtl@app \edef\ekdsep{] } +\edef\ekdsubsep{} \ekvdefinekeys{default@app}{ choice direction = {LR = \rtl@appfalse, RL = \rtl@apptrue}, unknown-choice direction = \PackageError{ekdosis}{unknown direction=#1}{`direction' must be either `LR' or `RL'.}, code sep = \edef\ekdsep{#1}, + code subsep = \edef\ekdsubsep{#1}, store bhook = \ekd@begin@apparatus, initial bhook = {}, store ehook = \ekd@end@apparatus, @@ -430,6 +435,7 @@ \NewDocumentCommand{\SetRTLapp}{}{\rtl@apptrue} \NewDocumentCommand{\SetLTRapp}{}{\rtl@appfalse} \NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}} +\NewDocumentCommand{\SetSubseparator}{m}{\edef\ekdsubsep{#1}} \NewDocumentCommand{\SetBeginApparatus}{m}{\edef\ekd@begin@apparatus{#1}} \NewDocumentCommand{\SetEndApparatus}{m}{\edef\ekd@end@apparatus{#1}} \NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}} @@ -469,7 +475,8 @@ \newif\ifsubsq@unit \subsq@unittrue \newif\ifekd@inside@app -\if@pkg@fitfloat +\newif\ifekd@keepinapp +\if@pkg@fitapp \newtcboxfit{\ekd@fitapp}{% blankest, fit basedim = \f@size pt, @@ -532,7 +539,7 @@ \if@pkg@keyfloat \ekd@insert@keyparapp \fi - \if@pkg@fitfloat + \if@pkg@fitapp \ekd@fitapp{\ekd@insert@apparatus}% \fi } @@ -599,6 +606,7 @@ \else\if@pkg@poetry@verse\poemlines{#1}\fi\fi, initial vmodulo = 1, default vmodulo = 5, + bool vnumbrokenlines = \ifnum@brokenline, bool continuousvnum = \if@continuous@vnum, choice numbers = {elided = \ekd@elidednumberstrue, full = \ekd@elidednumbersfalse}, @@ -621,6 +629,16 @@ \NewDocumentCommand{\SetLineation}{m}{ \ekvset{ekd@lineation}{#1} } +\NewDocumentCommand{\vmodulolinenumbers}{O{5}}{% + \ifekd@memoir@loaded + \linenumberfrequency{#1}% + \else + \if@pkg@poetry@verse + \poemlines{#1}% + \fi + \fi + \ignorespaces +} \renewcommand\linenumberfont{\normalfont\footnotesize} \ekvdefinekeys{appnote}{ store type = \ekdan@type, @@ -643,6 +661,9 @@ \ekd@isinappfalse \ekd@appinappfalse \endgroup} +\NewDocumentCommand{\ekdpage}{}{% + \luadirect{tex.sprint(ekdosis.getekdabspg())}% +} \def\current@ref@arg#1#2{{%\textdir TLT% \unexpanded\expandafter{\ekd@refnumstyle}% \ifnum% @@ -853,6 +874,9 @@ code post = \def\ekdlr@post{#1}, code prewit = \def\ekdlr@prewit{#1}, code postwit = \def\ekdlr@postwit{#1}, + store subsep = \ekdr@subsep, + initial subsep = \ekdsubsep, + bool nosubsep = \ifekdr@nosubsep, store type = \ekdlr@type, bool nordg = \ifekdr@nordg } @@ -990,6 +1014,7 @@ \ekd@isinlemfalse% \subsq@unittrue% } +\newif\ifekd@subsq@rdg \NewDocumentCommand{\rdg}{O{} m}{% \bgroup% \ekvset{rdg}{#1}% @@ -1006,6 +1031,9 @@ \else% \ifbool{al@rlmode}{% \edef\rdg@app{% + \ifekd@subsq@rdg + \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi + \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@post% \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi @@ -1032,6 +1060,9 @@ }% {% \edef\rdg@app{% + \ifekd@subsq@rdg + \unless\ifekdr@nosubsep\unexpanded\expandafter{\ekdr@subsep}\fi + \fi \ifdefined\ekdlr@alt% \ifdefined\ekdlr@pre% \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi @@ -1062,13 +1093,14 @@ \space\unexpanded\expandafter{\ekdlr@postwit}\else\fi }% }% - \ifekd@mapps% + \ifekd@mapps \append@app[\ekdan@type]{\rdg@app}% - \else% + \else \append@app{\rdg@app}% - \fi% - \fi% - \egroup% + \fi + \fi + \egroup + \ekd@subsq@rdgtrue } \newif\ifekdn@forcenum \ekvdefinekeys{note}{ @@ -1160,7 +1192,9 @@ } \ekvdefinekeys{ekd@note}{ store pre = \pre@value, - store post = \post@value + store post = \post@value, + nmeta sep = {post=\ekdsep}, + nmeta subsep = {pre=\ekdsubsep} } \NewDocumentCommand{\ekd@note}{O{} m}{% \bgroup% @@ -1237,29 +1271,44 @@ initial delend = \ifbool{al@rlmode}{\{}{\}}, initial sicbegin = \dag, initial sicend = \dag, - initial gapmark = *** + initial gapmark = ***, + bool keepinapp = \ifekd@keepinapp } \NewDocumentCommand{\supplied}{m}{% \ifekd@inside@app - #1% + \ifekd@keepinapp + \suppb@value #1\suppe@value + \else + #1% + \fi \else - \suppb@value #1\suppe@value + \suppb@value #1\suppe@value \fi } \NewDocumentCommand{\surplus}{m}{% \ifekd@inside@app - #1% + \ifekd@keepinapp + \delb@value #1\dele@value + \else + #1% + \fi \else - \delb@value #1\dele@value + \delb@value #1\dele@value \fi } \NewDocumentCommand{\sic}{s m}{% \ifekd@inside@app - #2% + \ifekd@keepinapp + \IfBooleanTF{#1} + {\sicb@value #2} + {\sicb@value #2\sice@value}% + \else + #2% + \fi \else - \IfBooleanTF{#1} - {\sicb@value #2} - {\sicb@value #2\sice@value}% + \IfBooleanTF{#1} + {\sicb@value #2} + {\sicb@value #2\sice@value}% \fi } \NewDocumentCommand{\gap}{m}{% @@ -1502,6 +1551,25 @@ \global\ekd@test@vpnumtrue \fi } +\ifboolexpr{bool {@pkg@poetry@verse} or bool {ekd@memoir@loaded}} + {\newcommand{\@vsifplus}[1]{\@ifnextchar +{\@firstoftwo{#1}}} + \renewcommand{\@vscentercr}{% + \ifhmode \unskip\else \@nolnerr\fi + \@vsifgt{\ifnum@brokenline\@vstypelinenum\fi\verselinebreak}{% + \@vsifplus{\ifnum@brokenline\@vstypelinenum\fi\stepcounter{vslineno}% + \par\@ifstar{\nobreak\@vsxcentercr}{% + \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}% + }% + }{% + \@vstypelinenum + \incr@vsline% + \par\@ifstar{\nobreak\@vsxcentercr}{% + \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}% + }% + }% + }% + } + }{} \if@pkg@poetry@verse \patchcmd{\start@vsline}{% \ifaltindent}{% @@ -1513,7 +1581,8 @@ code type = \def\type@value{#1}, } \ifekd@memoir@loaded - \linenumberfont{\normalfont\footnotesize} + \def\vlvnumfont{\normalfont\footnotesize} + \def\verselinenumfont#1{\def\vlvnumfont{#1}} \else \verselinenumfont{\normalfont\footnotesize} \fi -- cgit v1.2.3