From 4d92d4784ed9af54df5ca276e937639fcc20da90 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 2 Sep 2021 17:00:57 +0200 Subject: newcommand \vmodulolinenumbers and new option vnumbrokenlines --- ekdosis.dtx | 57 ++++++++++++++++++++++++++++++++++++++++++++++----------- ekdosis.el | 2 ++ 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 0eb0002..cde4586 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -61,7 +61,7 @@ along with this program. If not, see %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> - [2021/08/31 v1.4-dev Typesetting TEI xml-compliant critical editions] + [2021/09/02 v1.4-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -4168,10 +4168,11 @@ 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 |\\+| \newfeature[v1.4] does the same as |\\>| but without -% indenting the subsequent line which further complies to any already -% defined indent pattern. +% \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, @@ -4800,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 @@ -4810,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} @@ -4834,6 +4845,9 @@ 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.\\ @@ -8322,7 +8336,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\SetSubseparator} -% \changes{v1.4}{2021/08/31}{New command for subseparators} +% \changes{v1.4}{2021/09/02}{New command for subseparators} % \cs{SetSubseparator}\marg{sub-separator} allows to change the % \enquote{subseparator} between variant readings. By default, % no subseparator is set:--- @@ -8620,6 +8634,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}, @@ -8651,6 +8666,22 @@ Sample text with a \textcolor{red}{word} in red. } % \end{macrocode} % \end{macro} +% \begin{macro}{\vmodulolinenumbers} +% \changes{v1.4}{2021/09/02}{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} @@ -9897,7 +9928,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\\+} -% \changes{v1.4}{2021/08/31}{New macro for poetry} +% \changes{v1.4}{2021/09/02}{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 @@ -9908,8 +9939,8 @@ Sample text with a \textcolor{red}{word} in red. {\newcommand{\@vsifplus}[1]{\@ifnextchar +{\@firstoftwo{#1}}} \renewcommand{\@vscentercr}{% \ifhmode \unskip\else \@nolnerr\fi - \@vsifgt{\verselinebreak}{% - \@vsifplus{\stepcounter{vslineno}% + \@vsifgt{\ifnum@brokenline\@vstypelinenum\fi\verselinebreak}{% + \@vsifplus{\ifnum@brokenline\@vstypelinenum\fi\stepcounter{vslineno}% \par\@ifstar{\nobreak\@vsxcentercr}{% \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}% }% @@ -10463,6 +10494,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=""}, diff --git a/ekdosis.el b/ekdosis.el index 00037b2..69c14d1 100644 --- a/ekdosis.el +++ b/ekdosis.el @@ -202,6 +202,7 @@ ("numbers" ("elided" "full")) ("vlineation" ("page" "document")) ("vmodulo") + ("vnumbrokenlines" ("true" "false")) ("vmargin" ("right" "left")) ("continuousvnum")) "List of local options for setlineation macro.") @@ -357,6 +358,7 @@ '("innerlinenumbers" 0) '("outerlinenumbers" 0) '("modulolinenumbers" [ "number" ] ) + '("vmodulolinenumbers" [ "number" ] ) '("resetlinenumber" [ "number" ] ) '("resetvlinenumber" [ "number" ] ) '("verselinenumfont" "commands" 0) -- cgit v1.2.3