From b1e3b3e23d91e460a82b8f63aa6614b322f296fa Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sun, 21 Feb 2021 11:16:45 +0100
Subject: allow fancy line numbering

---
 ekdosis.dtx | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 5b26ce2..cc27565 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -6480,12 +6480,14 @@ Sample text with a \textcolor{red}{word} in red.
   \def\tmp@pg{%
     \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}}}%
   \IfNoValueTF{#1}
-  {\ifnum\@tmpmarg=\tmp@ln
+  {\ifnum
+    \pdf@strcmp{\@tmpmarg}{\tmp@ln} = 0
     \pagebreak
     \fi}
   {\ifnum
     \pdf@strcmp{\@tmpoarg}{\tmp@pg} = 0
-    \ifnum\@tmpmarg=\tmp@ln
+    \ifnum
+    \pdf@strcmp{\@tmpmarg}{\tmp@ln} = 0
     \pagebreak
     \fi
     \fi
@@ -6890,16 +6892,17 @@ Sample text with a \textcolor{red}{word} in red.
     =
     0
     \ifnum%
-    \getrefnumber{#1}
+    \pdf@strcmp{\getrefnumber{#1}}{\getrefnumber{#2}}
     =
-    \getrefnumber{#2}
+    0
     % 
     \ifekd@mapps%
     \ifbool{subsq@unit@\ekdan@type}{%
       \ifnum%
-      \getrefnumber{#1}
+      \pdf@strcmp{\getrefnumber{#1}}{%
+        \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}}
       =
-      \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}
+      0
       \else
       \LRnum{\getrefnumber{#1}}% issue the no
       \fi%
@@ -6909,9 +6912,10 @@ Sample text with a \textcolor{red}{word} in red.
     \ifsubsq@unit%
     % 
     \ifnum%
-    \getrefnumber{#1}
+    \pdf@strcmp{\getrefnumber{#1}}{%
+      \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}}
     =
-    \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}}
+    0
     \else
     \LRnum{\getrefnumber{#1}}% issue the no
     \fi
@@ -6951,16 +6955,19 @@ Sample text with a \textcolor{red}{word} in red.
     =
     0
     \ifnum%
-    \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}
+    \pdf@strcmp{%
+      \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}%
+      {\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}
     =
-    \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}
+    0
     % 
     \ifekd@mapps%
     \ifbool{subsq@unit@\ekdan@type}{%
       \ifnum%
-      \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}
+      \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}%
+      {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}}
       =
-      \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}
+      0
       \else
       \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no
       \fi%
@@ -6969,9 +6976,10 @@ Sample text with a \textcolor{red}{word} in red.
     \ifsubsq@unit%
     % 
     \ifnum%
-    \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}
+    \pdf@strcmp{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}%
+    {\getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}}
     =
-    \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b}
+    0
     \else
     \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no
     \fi
-- 
cgit v1.2.3

