From b87c5d705f6a0af952975f166c1eb6fbc6e1e036 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 13 May 2021 16:15:29 +0200
Subject: do not print page numbers ahead entries that span across pages when
 lineation is set to document

---
 ekdosis.dtx | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index b925713..d005c0f 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -61,7 +61,7 @@ along with this program.  If not, see
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{ekdosis}
 %<*package>
-    [2021/05/07 v1.3-dev Typesetting TEI xml-compliant critical editions]
+    [2021/05/13 v1.3-dev Typesetting TEI xml-compliant critical editions]
 %</package>
 %<*driver>
 \begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -7508,7 +7508,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\teidirect}
-% \changes{v1.3}{2021/05/07}{direct insertion of elements in the
+% \changes{v1.3}{2021/05/13}{direct insertion of elements in the
 % \texttt{TEI xml} file}
 % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
 % does nothing in \LaTeX. Its only use is to insert elements in the
@@ -7862,7 +7862,7 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\SetApparatusNoteLanguage}
-% \changes{v1.3}{2021/05/07}{defines an alternate language to be
+% \changes{v1.3}{2021/05/13}{defines an alternate language to be
 % applied in note apparatus entries}
 % \cs{SetApparatusNoteLang}\marg{languagename} can be used when
 % it is needed to apply in entries introduced by the \cs{note} command
@@ -8216,9 +8216,14 @@ Sample text with a \textcolor{red}{word} in red.
     \fi
     \fi%
     \else
-    \LRnum{\getrefnumber{#1}}--%
-    \LRnum{\getpagerefnumber{#2}}.%
-    \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}% issue pg and ln nos
+    \ifekd@pagelineation
+      \LRnum{\getrefnumber{#1}}--%
+      \LRnum{\getpagerefnumber{#2}}.%
+      \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}% issue pg and ln nos
+    \else
+      \LRnum{\getrefnumber{#1}}--%
+      \LRnum{\getrefnumber{#2}}\unexpanded\expandafter{\ekd@postrefnum}% issue the nos
+    \fi
     \fi%
     \ifekdn@forcenum
       \LRnum{\getrefnumber{#1}}\unexpanded\expandafter{\ekd@postrefnum}% force the no
@@ -8334,10 +8339,16 @@ Sample text with a \textcolor{red}{word} in red.
     \fi
     \fi%
     \else
-    \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
-    \LRnum{\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}.%
-    \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}%
-      \unexpanded\expandafter{\ekd@postrefnum}% issue pg and ln nos
+    \ifekd@pagelineation
+      \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
+      \LRnum{\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}.%
+      \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}%
+        \unexpanded\expandafter{\ekd@postrefnum}% issue pg and ln nos
+    \else
+      \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
+      \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}%
+        \unexpanded\expandafter{\ekd@postrefnum}% issue the nos
+    \fi
     \fi%
     \ifekdl@forcenum
     \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}%
-- 
cgit v1.2.3

