summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/ekdosis/ekdosis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/ekdosis/ekdosis.dtx')
-rw-r--r--macros/luatex/latex/ekdosis/ekdosis.dtx418
1 files changed, 329 insertions, 89 deletions
diff --git a/macros/luatex/latex/ekdosis/ekdosis.dtx b/macros/luatex/latex/ekdosis/ekdosis.dtx
index 30b19f07d6..d78a17f4cf 100644
--- a/macros/luatex/latex/ekdosis/ekdosis.dtx
+++ b/macros/luatex/latex/ekdosis/ekdosis.dtx
@@ -61,7 +61,7 @@ along with this program. If not, see
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\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]
%</package>
%<*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
%</driver>
% \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 <alessi@roberalessi.net>}
-% \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
+%</example>
+% \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{ "<anchor" * ((1 - (lpeg.P"<" + lpeg.P">")) + lpeg.V(1)
local inopeningnote = lpeg.Cs{ "<note" * ((1 - (lpeg.P"<" + lpeg.P">")) + 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("&gt;") * bsqbrackets^-1 * spcenc^-1)
+local poemlinebreak = lpeg.Cs(lnbrk * spcenc^-1 * (lpeg.P("&gt;") + lpeg.P("+")) * bsqbrackets^-1 * spcenc^-1)
local linegroup = lpeg.Cs{ "<lg" * ((1 - lpeg.S"<>") + lpeg.V(1))^0 * ">" }
local bclinegroup = lpeg.Cs(linegroup + lpeg.P("</lg>"))
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("<lg>%s</lg>", 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, "</",
- cur_abs_pg, cur_alignment, curcol, "-0>\n")
+ f:write("<", ekd_abs_pg, cur_alignment, curcol, "-0>", str, "</",
+ ekd_abs_pg, cur_alignment, curcol, "-0>\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, "</", cur_abs_pg, cur_alignment, curcol, "-", appno, ">\n")
+ f:write("<", ekd_abs_pg, cur_alignment, curcol, "-",
+ appno, ">", str, "</", ekd_abs_pg, cur_alignment, curcol, "-", appno, ">\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>.-</"
- ..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..">.-</"
- ..cur_abs_pg
+ ..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..">.-</"
- ..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, "</"..cur_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", "")
- str = string.gsub(str, "<"..cur_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", " ")
+ str = string.gsub(str, "</"..ekd_abs_pg..cur_alignment_patt..curcol.."%-[0-9]>", "")
+ 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