aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2018-11-15 21:08:30 +0100
committerRobert Alessi <alessi@robertalessi.net>2018-11-15 21:08:30 +0100
commit53ac6f6cc7ed2374dd032acdfeb5f322ff64510c (patch)
treede3071fab7dfa601bfa0b0e7deaddda5c7197016
parent55bafcd5eba8427fd04bcde4d1af8291beea26f5 (diff)
downloadekdosis-53ac6f6cc7ed2374dd032acdfeb5f322ff64510c.tar.gz
added 'wit' and 'alt' as keyval arguments of \lem
-rw-r--r--ekdosis.dtx40
1 files changed, 33 insertions, 7 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 709d042..c285a35 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -323,6 +323,7 @@ Running "make install" installs the files in the local TeX tree.
323\ExecuteOptionsX{} 323\ExecuteOptionsX{}
324\ProcessOptionsX\relax 324\ProcessOptionsX\relax
325\RequirePackage{luacode} 325\RequirePackage{luacode}
326\RequirePackage{keycommand}
326\RequirePackage{xparse} 327\RequirePackage{xparse}
327\RequirePackage{etoolbox} 328\RequirePackage{etoolbox}
328\RequirePackage[addpageno]{lineno} 329\RequirePackage[addpageno]{lineno}
@@ -388,15 +389,35 @@ Running "make install" installs the files in the local TeX tree.
388 "pg_ii")}% 389 "pg_ii")}%
389 \ifbool{ekdstate}{\add@apparatus}{}% 390 \ifbool{ekdstate}{\add@apparatus}{}%
390 \bgroup\inapptrue#1\egroup} 391 \bgroup\inapptrue#1\egroup}
391\NewDocumentCommand{\lem}{o +m}{\nonotetrue#2% 392\NewDocumentCommand{\noteonly}{+m}{
392 \nonotefalse\bgroup\inappfalse% 393 \luadirect{tex.sprint(ekdosis.ntonly(\luastringN{#1}))}
393 \ifbool{al@rlmode}% 394}
394 {\IfNoValueTF{#1}% 395\newkeycommand+[\|]{\lem}[wit,alt][1]{%
395 {\obappend{\bgroup\setRL#2\egroup:}}% 396 |\nonotetrue|#1%
396 {\obappend{\bgroup\setRL#2\egroup{} #1:}}}% 397 |\nonotefalse|%
397 {\IfNoValueTF{#1}{\obappend{#2:}}{\obappend{#2 #1:}}}% 398 \bgroup%
399 |\inappfalse|%
400 |\ifbool{al@rlmode}|%
401 {|\obappend|{%
402 \bgroup%
403 |\setRL|\ifcommandkey{alt}{\commandkey{alt}%
404 \noteonly{#1}}{#1}%
405 \egroup%
406 \ifcommandkey{wit}{\commandkey{wit}}{}:}}%
407 {|\obappend|{\ifcommandkey{alt}{\commandkey{alt}%
408 \noteonly{#1}}{#1}%
409 \ifcommandkey{wit}{\commandkey{wit}}{}:}}%
398 \egroup% 410 \egroup%
399} 411}
412 % \NewDocumentCommand{\lem}{o +m}{\nonotetrue#2%
413 % \nonotefalse\bgroup\inappfalse%
414 % \ifbool{al@rlmode}%
415 % {\IfNoValueTF{#1}%
416 % {\obappend{\bgroup\setRL#2\egroup:}}%
417 % {\obappend{\bgroup\setRL#2\egroup{} #1:}}}%
418 % {\IfNoValueTF{#1}{\obappend{#2:}}{\obappend{#2 #1:}}}%
419 % \egroup%
420 % }
400\NewDocumentCommand{\rdg}{o +m}{% 421\NewDocumentCommand{\rdg}{o +m}{%
401 \bgroup\inappfalse% 422 \bgroup\inappfalse%
402 \ifbool{al@rlmode}% 423 \ifbool{al@rlmode}%
@@ -496,6 +517,11 @@ function isintable(table, value)
496 return false 517 return false
497end 518end
498 519
520ekdosis.ntonly = function(str)
521 str = string.match(str, "\\note%s?%*?%b{}")
522 return str or ""
523end
524
499function appin(str, nl) 525function appin(str, nl)
500 local f = io.open(tex.jobname.."_tmp.ekd", "a+") 526 local f = io.open(tex.jobname.."_tmp.ekd", "a+")
501 if nl == "yes" then 527 if nl == "yes" then