From 71b6be7feb4c87ad2d3ac5e650e691d9d8a8b710 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Thu, 5 Sep 2019 16:45:14 +0200
Subject: line numbers: if relevant, specify subsequent page numbers

---
 ekdosis.dtx | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 1f88522..e0ad7cc 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -354,7 +354,6 @@ Running "make install" installs the files in the local TeX tree.
 \RequirePackage{keycommand}
 \RequirePackage{xparse}
 \RequirePackage{etoolbox}
-\PassOptionsToPackage{addpageno}{lineno}
 \RequirePackage{lineno}
 \RequirePackage{keyfloat}
 \RequirePackage{refcount}
@@ -522,6 +521,12 @@ idno={}, msName={}, origDate={}][3]{%
   \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#1}))}%
   \ekd@isinappfalse}
 \def\current@ref{{\textdir TLT\noexpand\bfseries%
+    \ifnum%
+    \getrefbykeydefault{%
+      \luadirect{tex.sprint(ekdosis.getlnlab())}-b}{page}{}
+    =
+    \getrefbykeydefault{%
+      \luadirect{tex.sprint(ekdosis.getlnlab())}-e}{page}{}
       \ifnum%
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}
       =
@@ -530,7 +535,14 @@ idno={}, msName={}, origDate={}][3]{%
       \else
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--%
       \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}%
-      \fi}
+      \fi%
+      \else
+      \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--%
+      \getrefbykeydefault{%
+        \luadirect{tex.sprint(ekdosis.getlnlab())}-e}{page}{}.%
+      \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}%
+      \fi%
+    }
   }%
 \define@cmdkeys[ekd]{lemrdg}[ekdlr@]{wit, alt, pre, post, prewit,
   postwit}
-- 
cgit v1.2.3

