From 10a79f542c1a547b704bb8b88d70190dffd9b3c7 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 1 Mar 2020 12:11:27 +0100 Subject: replacing 'options' with 'expkv-def' --- ekdosis.dtx | 66 ++++++++++++++++++++++++++----------------------------------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index 1d5f998..7e44af5 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -349,6 +349,7 @@ Running "make install" installs the files in the local TeX tree. \RequirePackage{luacode} \RequirePackage{paracol} \RequirePackage{options} +\RequirePackage{expkv-def} \RequirePackage{xparse} \RequirePackage{etoolbox} \RequirePackage{lineno} @@ -371,35 +372,26 @@ Running "make install" installs the files in the local TeX tree. % \end{macrocode} % Hooks % \begin{macrocode} -\def\ekd@refnumstyle{\bfseries} -\def\ekd@postrefnum{~} -\options{ - /hooks/.new family, - /hooks/refnumstyle/.new cmd = \def\ekd@refnumstyle{#1}, - /hooks/postrefnum/.new cmd = \def\ekd@postrefnum{#1} -} -\NewDocumentCommand{\SetEkdosisHooks}{m}{ - \options{/hooks,#1} +\ekvdefinekeys{hooks}{ + store refnumstyle = \ekd@refnumstyle, + store postrefnum = \ekd@postrefnum, + initial refnumstyle = \bfseries, + initial postrefnum = ~ } +\NewDocumentCommand{\SetEkdosisHooks}{m}{\ekvset{hooks}{#1}} % \end{macrocode} % Build and process the list of witnesses and hands. % \begin{macrocode} -\options{ - /witness/.new family, - /witness/settlement/.new value = {}, - /witness/repository/.new value = {}, - /witness/idno/.new value = {}, - /witness/msName/.new value = {}, - /witness/origDate/.new value = {} +\ekvdefinekeys{witness}{ + store settlement = \settlement@value, + store repository = \repository@value, + store idno = \idno@value, + store msName = \msName@value, + store origDate = \origDate@value } \NewDocumentCommand{\DeclareWitness}{m m m O{}}{% \bgroup - \options{/witness,#4} - \letoption{/witness/settlement}\settlement@value - \letoption{/witness/repository}\repository@value - \letoption{/witness/idno}\idno@value - \letoption{/witness/msName}\msName@value - \letoption{/witness/origDate}\origDate@value + \ekvset{witness}{#4} \luadirect{ekdosis.newwitness( \luastringN{#1}, \luastringN{#2}, @@ -474,29 +466,26 @@ Running "make install" installs the files in the local TeX tree. % Multi-layer apparatuses % \begin{macrocode} \newif\ifekd@mapps -\options{ - /newapp/.new family, - /newapp/direction/.new choice = {LR,RL}, - /newapp/rule/.new value = {}, - /newapp/delim/.new value = {}, - /newapp/sep/.new value = {}, - /newapp/bhook/.new value = {}, - /newapp/ehook/.new value = {\csname ekd@end@apparatus\endcsname} +\ekvdefinekeys{newapp}{ + choice direction = {LR = \def\direction@val{LR}, + RL = \def\direction@val{RL}}, + store rule = \rule@val, + store delim = \delim@val, + store sep = \sep@val, + store bhook = \bhook@val, + store ehook = \ehook@val, + initial direction = LR, + initial ehook = {\csname ekd@end@apparatus\endcsname} } \NewDocumentCommand{\DeclareApparatus}{m O{}}{ \newbool{subsq@unit@#1} \booltrue{subsq@unit@#1} \unless\ifekd@mapps\global\ekd@mappstrue\fi \bgroup - \options{/newapp,#2} - \letoption{/newapp/rule}\rule@val - \letoption{/newapp/delim}\delim@val - \letoption{/newapp/sep}\sep@val - \letoption{/newapp/bhook}\bhook@val - \letoption{/newapp/ehook}\ehook@val + \ekvset{newapp}{#2} \luadirect{ekdosis.newapparatus( \luastringN{#1}, - \luastring{\option{/newapp/direction}}, + \luastring{\direction@val}, \luastringO{\rule@val}, \luastringO{\delim@val}, \luastringO{\sep@val}, @@ -652,7 +641,8 @@ Running "make install" installs the files in the local TeX tree. "pg_ii")}% \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#2}))}% \ekd@isinappfalse} -\def\current@ref@arg#1#2{{\textdir TLT\unexpanded\expandafter{\ekd@refnumstyle}% +\def\current@ref@arg#1#2{{\textdir TLT% + \unexpanded\expandafter{\ekd@refnumstyle}% \ifnum% \getpagerefnumber{#1} = -- cgit v1.2.3