From e76ae3e1038bfba0c61ef78857f7594b66afb1f1 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 16 Jul 2020 10:21:22 +0200
Subject: added \SetLineation

---
 ekdosis.dtx | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index e34dc71..f4204bc 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2391,6 +2391,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 \RequirePackage{refcount}
 \RequirePackage[user,abspage]{zref}
 \RequirePackage{ltxcmds}
+\RequirePackage{atbegshi}
 \if@pkg@parnotes
   \RequirePackage{parnotes}
 \fi
@@ -2735,7 +2736,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
 }
 %    \end{macrocode}
 % \begin{macro}{\SetApparatus}
-% All settings can also be defined as|key-value| options within the
+% All settings can also be defined as |key-value| options within the
 % argument of \cs{SetApparatus}:---
 %    \begin{macrocode}
 \NewDocumentCommand{\SetApparatus}{m}{
@@ -2882,7 +2883,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   \fi%
 }
 %    \end{macrocode}
-% Before inserting any new entry, \cs{add@apparatus} is called
+% Before inserting any new entry, \cs{add@apparatus} calls
 % \cs{test@apparatus} to decide whether a new apparatus block must be
 % created on a given page.
 %    \begin{macrocode}
@@ -3452,6 +3453,27 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}%
 }
 %    \end{macrocode}
+% \paragraph{Lineation settings}
+% 
+%    \begin{macrocode}
+\newif\ifekd@pagelineation
+\NewDocumentCommand{\ekdatbegshihook}{}{%
+  \ifekd@pagelineation\resetlinenumber\fi
+}
+\AtBeginShipout{\ekdatbegshihook}
+\ekvdefinekeys{ekd@lineation}{
+  choice lineation = {page = \ekd@pagelineationtrue,
+    document = \ekd@pagelineationfalse},
+  unknown-choice lineation = \PackageError{ekdosis}{unknown
+    lineation=#1}{`lineation' must be either `page' or `document'.},
+  code modulonum = \chardef\c@linenumbermodulo#1\relax,
+  noval modulo = \modulolinenumbers
+}
+\NewDocumentCommand{\SetLineation}{m}{
+  \ekvset{ekd@lineation}{#1}
+}
+%    \end{macrocode}
+%
 % Start and stop |ekdosis|:
 %    \begin{macrocode}
 \NewDocumentCommand{\EkdosisOn}{}{%
@@ -3487,12 +3509,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
   \luadirect{ekdosis.exporttei(\luastringN{\par #1\par })}\fi}
 %    \end{macrocode}
 % \end{environment}
-% \paragraph{Alignment} What follows isto arrange texts in parallel
+% \paragraph{Alignment} What follows is to arrange texts in parallel
 % columns either on single pages or on facing pages.
 %
 % Define keys to be used by the \env{alignment} environment:---
 %    \begin{macrocode}
-\newif\ifekd@pagelineation
 \ekvdefinekeys{ekd@align}{
   store tcols = \tcols@num,
   store lcols = \lcols@num,
-- 
cgit v1.2.3

