diff options
author | Robert Alessi <alessi@robertalessi.net> | 2019-09-12 12:47:53 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2019-09-12 12:47:53 +0200 |
commit | c358fe9c92ce563f32134fc5a9ed4bfdeab00fe3 (patch) | |
tree | 34030e431bc5c2fff5ac57edc1695efb9c10fa61 | |
parent | b87f8ac606363d54619660745fab3f4cc180befe (diff) | |
download | ekdosis-c358fe9c92ce563f32134fc5a9ed4bfdeab00fe3.tar.gz |
rewrote testapparatus() and \test@pparatus; removed unnecessary booleans
-rw-r--r-- | ekdosis.dtx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index ef3fd93..941ceed 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -449,7 +449,6 @@ idno={}, msName={}, origDate={}][3]{% | |||
449 | \@onlypreamble\SetxmlBibResource | 449 | \@onlypreamble\SetxmlBibResource |
450 | % \end{macrocode} | 450 | % \end{macrocode} |
451 | % \begin{macrocode} | 451 | % \begin{macrocode} |
452 | \newbool{ekd@started} | ||
453 | \newbool{do@app} | 452 | \newbool{do@app} |
454 | \newbool{ekd@state} | 453 | \newbool{ekd@state} |
455 | \newif\ifekd@isinapp | 454 | \newif\ifekd@isinapp |
@@ -494,10 +493,8 @@ idno={}, msName={}, origDate={}][3]{% | |||
494 | \unconditional@appin{\rule{5cm}{0.5pt}\newline} | 493 | \unconditional@appin{\rule{5cm}{0.5pt}\newline} |
495 | } | 494 | } |
496 | \def\add@apparatus{% | 495 | \def\add@apparatus{% |
497 | \notbool{ekd@started}{\subsq@unitfalse\add@@apparatus% | 496 | \test@apparatus% |
498 | \global\setbool{ekd@started}{true}} | 497 | \ifbool{do@app}{\subsq@unitfalse\add@@apparatus}{}% |
499 | {\test@apparatus% | ||
500 | \ifbool{do@app}{\subsq@unitfalse\add@@apparatus}{}}% | ||
501 | } | 498 | } |
502 | \NewDocumentCommand{\append@app}{+m}{% | 499 | \NewDocumentCommand{\append@app}{+m}{% |
503 | \ifekd@isinapp% | 500 | \ifekd@isinapp% |
@@ -516,10 +513,12 @@ idno={}, msName={}, origDate={}][3]{% | |||
516 | \ekd@isinapptrue% | 513 | \ekd@isinapptrue% |
517 | \stepcounter{ekd@lab}% | 514 | \stepcounter{ekd@lab}% |
518 | \zlabel{ekd:\theekd@lab}% | 515 | \zlabel{ekd:\theekd@lab}% |
516 | \luadirect{ekdosis.storeabspg( | ||
517 | \luastring{\zref@extract{ekd:\theekd@lab}{abspage}})}% | ||
518 | \ifbool{ekd@state}{\add@apparatus}{}% | ||
519 | \luadirect{% | 519 | \luadirect{% |
520 | ekdosis.storeabspg(\luastring{\zref@extract{ekd:\theekd@lab}{abspage}}, | 520 | ekdosis.storeabspg(\luastring{\zref@extract{ekd:\theekd@lab}{abspage}}, |
521 | "pg_ii")}% | 521 | "pg_ii")}% |
522 | \ifbool{ekd@state}{\add@apparatus}{}% | ||
523 | \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#1}))}% | 522 | \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#1}))}% |
524 | \ekd@isinappfalse} | 523 | \ekd@isinappfalse} |
525 | \def\current@ref{{\textdir TLT\noexpand\bfseries% | 524 | \def\current@ref{{\textdir TLT\noexpand\bfseries% |
@@ -732,8 +731,7 @@ idno={}, msName={}, origDate={}][3]{% | |||
732 | } | 731 | } |
733 | \NewDocumentEnvironment{ekdosis}{+b}{% | 732 | \NewDocumentEnvironment{ekdosis}{+b}{% |
734 | \begin{linenumbers} | 733 | \begin{linenumbers} |
735 | \ifbool{ekd@started}{}% | 734 | \EkdosisStart |
736 | {\EkdosisStart} | ||
737 | \EkdosisOn#1}{% | 735 | \EkdosisOn#1}{% |
738 | \EkdosisOff | 736 | \EkdosisOff |
739 | \end{linenumbers}% | 737 | \end{linenumbers}% |
@@ -1360,7 +1358,7 @@ function ekdosis.update_abspg(n) | |||
1360 | end | 1358 | end |
1361 | 1359 | ||
1362 | function ekdosis.get_abs_page() | 1360 | function ekdosis.get_abs_page() |
1363 | return cur_abs_pg | 1361 | return "i:" .. pg_i .. ", ii:" .. pg_ii .. ", abs:" .. cur_abs_pg |
1364 | end | 1362 | end |
1365 | 1363 | ||
1366 | function ekdosis.storeabspg(n, pg) | 1364 | function ekdosis.storeabspg(n, pg) |
@@ -1419,13 +1417,15 @@ function ekdosis.appout() | |||
1419 | end | 1417 | end |
1420 | 1418 | ||
1421 | function ekdosis.testapparatus() | 1419 | function ekdosis.testapparatus() |
1422 | if tonumber(pg_ii) == tonumber(pg_i) then | 1420 | if tonumber(pg_ii) < tonumber(pg_i) |
1421 | or tonumber(pg_ii) < tonumber(cur_abs_pg) then | ||
1422 | pg_i = cur_abs_pg | ||
1423 | return "\\booltrue{do@app}" | ||
1424 | elseif tonumber(pg_ii) == tonumber(pg_i) then | ||
1423 | return "\\boolfalse{do@app}" | 1425 | return "\\boolfalse{do@app}" |
1424 | elseif tonumber(pg_ii) > tonumber(pg_i) then | 1426 | elseif tonumber(pg_ii) > tonumber(pg_i) then |
1425 | pg_i = pg_ii | 1427 | pg_i = cur_abs_pg |
1426 | return "\\booltrue{do@app}" | 1428 | return "\\booltrue{do@app}" |
1427 | else | ||
1428 | return "\\boolfalse{do@app}" | ||
1429 | end | 1429 | end |
1430 | end | 1430 | end |
1431 | 1431 | ||