diff options
author | Robert Alessi <alessi@robertalessi.net> | 2019-09-08 21:00:54 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2019-09-08 21:00:54 +0200 |
commit | b87f8ac606363d54619660745fab3f4cc180befe (patch) | |
tree | 0c622812b08354e5b4d87689c203c3eea98809e5 | |
parent | ac6d25d3ad15e63c76d1a722363a4f9edfb4b228 (diff) | |
download | ekdosis-b87f8ac606363d54619660745fab3f4cc180befe.tar.gz |
discard the line number if it is the same as the one of the previous unit
-rw-r--r-- | ekdosis.dtx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 8419858..ef3fd93 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -531,7 +531,21 @@ idno={}, msName={}, origDate={}][3]{% | |||
531 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | 531 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} |
532 | = | 532 | = |
533 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} | 533 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} |
534 | % | ||
535 | \ifsubsq@unit% | ||
536 | % | ||
537 | \ifnum% | ||
538 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | ||
539 | = | ||
540 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b} | ||
541 | \else | ||
534 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}% | 542 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}% |
543 | \fi | ||
544 | % | ||
545 | \else | ||
546 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}% | ||
547 | \fi | ||
548 | % | ||
535 | \else | 549 | \else |
536 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--% | 550 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}--% |
537 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}% | 551 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}% |
@@ -1418,10 +1432,12 @@ end | |||
1418 | local lnlabs = {} | 1432 | local lnlabs = {} |
1419 | local lnlab_salt = 0 | 1433 | local lnlab_salt = 0 |
1420 | local current_lnlab = nil | 1434 | local current_lnlab = nil |
1435 | local prev_lnlab = nil | ||
1421 | local current_lemma = nil | 1436 | local current_lemma = nil |
1422 | local salt = 0 | 1437 | local salt = 0 |
1423 | 1438 | ||
1424 | function ekdosis.dolnlab(str) | 1439 | function ekdosis.dolnlab(str) |
1440 | prev_lnlab = current_lnlab | ||
1425 | current_lemma = str | 1441 | current_lemma = str |
1426 | i = md5.sumhexa(str) | 1442 | i = md5.sumhexa(str) |
1427 | if not mdvisintable(lnlabs, i) then | 1443 | if not mdvisintable(lnlabs, i) then |
@@ -1431,14 +1447,18 @@ function ekdosis.dolnlab(str) | |||
1431 | table.insert(lnlabs, i) | 1447 | table.insert(lnlabs, i) |
1432 | salt = salt + 1 | 1448 | salt = salt + 1 |
1433 | end | 1449 | end |
1434 | current_lnlab = i | 1450 | current_lnlab = i |
1435 | return true | 1451 | return true |
1436 | end | 1452 | end |
1437 | 1453 | ||
1438 | function ekdosis.getlnlab() | 1454 | function ekdosis.getlnlab() |
1439 | return current_lnlab | 1455 | return current_lnlab |
1440 | end | 1456 | end |
1441 | 1457 | ||
1458 | function ekdosis.getprevlnlab() | ||
1459 | return prev_lnlab | ||
1460 | end | ||
1461 | |||
1442 | function ekdosis.mdvappend(str) | 1462 | function ekdosis.mdvappend(str) |
1443 | return [[\linelabel{]] .. current_lnlab .. [[-b}\wordboundary{}]] | 1463 | return [[\linelabel{]] .. current_lnlab .. [[-b}\wordboundary{}]] |
1444 | .. | 1464 | .. |