aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2020-07-19 20:45:55 +0200
committerRobert Alessi <alessi@robertalessi.net>2020-07-19 20:45:55 +0200
commit6d0fdc5992ff1a56d470dffc41af5025cf64d1f1 (patch)
tree5385c755c9d944e0622556a3442a9a3f3974f600
parent34786688b350598f9da6641a1a45d9d747c17536 (diff)
downloadekdosis-6d0fdc5992ff1a56d470dffc41af5025cf64d1f1.tar.gz
more control over expansion of \delim@val. new option numbers=elided|full (and defaults to elided)
-rw-r--r--ekdosis.dtx84
1 files changed, 48 insertions, 36 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index f2bae26..76e3fc4 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2653,7 +2653,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2653 direction=#1}{`direction' must be either `LR' or `RL'.}, 2653 direction=#1}{`direction' must be either `LR' or `RL'.},
2654 store rule = \rule@val, 2654 store rule = \rule@val,
2655 nmeta norule = {rule=none}, 2655 nmeta norule = {rule=none},
2656 store delim = \delim@val, 2656 code delim = \def\delim@val{\unexpanded{#1}},
2657 store sep = \sep@val, 2657 store sep = \sep@val,
2658 store bhook = \bhook@val, 2658 store bhook = \bhook@val,
2659 store ehook = \ehook@val, 2659 store ehook = \ehook@val,
@@ -2951,6 +2951,42 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2951 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2}, 2951 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2},
2952 \luastringO{#1}))}}} 2952 \luastringO{#1}))}}}
2953% \end{macrocode} 2953% \end{macrocode}
2954% \paragraph{Lineation settings}
2955% The keys to be used for lineation settings follow. A conditional is
2956% defined beforehand so that \pkg{ekdosis} may know whether the
2957% numbering should start afresh at the top of each page.
2958% \begin{macrocode}
2959\newif\ifekd@pagelineation
2960\NewDocumentCommand{\ekdatbegshihook}{}{%
2961 \ifekd@pagelineation\resetlinenumber\fi
2962}
2963\AtBeginShipout{\ekdatbegshihook}
2964\newif\ifekd@elidednumbers
2965\ekvdefinekeys{ekd@lineation}{
2966 choice lineation = {page = \ekd@pagelineationtrue,
2967 document = \ekd@pagelineationfalse},
2968 unknown-choice lineation = \PackageError{ekdosis}{unknown
2969 lineation=#1}{`lineation' must be either `page' or `document'.},
2970 code modulonum = \chardef\c@linenumbermodulo#1\relax,
2971 noval modulo = \modulolinenumbers,
2972 choice numbers = {elided = \ekd@elidednumberstrue,
2973 full = \ekd@elidednumbersfalse},
2974 unknown-choice numbers = \PackageError{ekdosis}{unknown
2975 numbers=#1}{`numbers' must be either `elided' or `full'.},
2976 initial numbers = elided
2977}
2978% \end{macrocode}
2979% \begin{macro}{\SetLineation}
2980% Then \cs{SetLineation}\marg{options} can be used in the preamble or
2981% at any point of the document to set lineation preferences. Its
2982% argument processes the |key-value| options that are defined just
2983% above.
2984% \begin{macrocode}
2985\NewDocumentCommand{\SetLineation}{m}{
2986 \ekvset{ekd@lineation}{#1}
2987}
2988% \end{macrocode}
2989% \end{macro}
2954% \begin{macro}{\EkdosisDefaultApparatus} 2990% \begin{macro}{\EkdosisDefaultApparatus}
2955% By default, \pkg{ekdosis} defines one layer of critical notes which 2991% By default, \pkg{ekdosis} defines one layer of critical notes which
2956% is called |default|. This name can be changed at any point of the 2992% is called |default|. This name can be changed at any point of the
@@ -3029,10 +3065,13 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3029 \fi 3065 \fi
3030 % 3066 %
3031 \else 3067 \else
3068 \ifekd@elidednumbers
3032 \luadirect{tex.sprint(ekdosis.numrange(\luastring{\getrefnumber{#1}}, 3069 \luadirect{tex.sprint(ekdosis.numrange(\luastring{\getrefnumber{#1}},
3033 \luastring{\getrefnumber{#2}}))} 3070 \luastring{\getrefnumber{#2}}))}%
3034 % \LRnum{\getrefnumber{#1}}--% 3071 \else
3035 % \LRnum{\getrefnumber{#2}}% issue the nos 3072 \LRnum{\getrefnumber{#1}}--%
3073 \LRnum{\getrefnumber{#2}}% issue the nos
3074 \fi
3036 \fi% 3075 \fi%
3037 \else 3076 \else
3038 \LRnum{\getrefnumber{#1}}--% 3077 \LRnum{\getrefnumber{#1}}--%
@@ -3084,11 +3123,14 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3084 \fi 3123 \fi
3085 % 3124 %
3086 \else 3125 \else
3126 \ifekd@elidednumbers
3087 \luadirect{tex.sprint(ekdosis.numrange( 3127 \luadirect{tex.sprint(ekdosis.numrange(
3088 \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}, 3128 \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}},
3089 \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}))}% issue the nos 3129 \luastring{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}))}% issue the nos
3090 % \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% 3130 \else
3091 % \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos 3131 \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
3132 \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos
3133 \fi
3092 \fi% 3134 \fi%
3093 \else 3135 \else
3094 \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% 3136 \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--%
@@ -3499,36 +3541,6 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3499 \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}% 3541 \luadirect{ekdosis.storecurcol(\luastring{\thecolumn})}%
3500} 3542}
3501% \end{macrocode} 3543% \end{macrocode}
3502% \paragraph{Lineation settings}
3503% The keys to be used for lineation settings follow. A conditional is
3504% defined beforehand so that \pkg{ekdosis} may know whether the
3505% numbering should start afresh at the top of each page.
3506% \begin{macrocode}
3507\newif\ifekd@pagelineation
3508\NewDocumentCommand{\ekdatbegshihook}{}{%
3509 \ifekd@pagelineation\resetlinenumber\fi
3510}
3511\AtBeginShipout{\ekdatbegshihook}
3512\ekvdefinekeys{ekd@lineation}{
3513 choice lineation = {page = \ekd@pagelineationtrue,
3514 document = \ekd@pagelineationfalse},
3515 unknown-choice lineation = \PackageError{ekdosis}{unknown
3516 lineation=#1}{`lineation' must be either `page' or `document'.},
3517 code modulonum = \chardef\c@linenumbermodulo#1\relax,
3518 noval modulo = \modulolinenumbers
3519}
3520% \end{macrocode}
3521% \begin{macro}{\SetLineation}
3522% Then \cs{SetLineation}\marg{options} can be used in the preamble or
3523% at any point of the document to set lineation preferences. Its
3524% argument processes the |key-value| options that are defined just
3525% above.
3526% \begin{macrocode}
3527\NewDocumentCommand{\SetLineation}{m}{
3528 \ekvset{ekd@lineation}{#1}
3529}
3530% \end{macrocode}
3531% \end{macro}
3532% Start and stop |ekdosis|: 3544% Start and stop |ekdosis|:
3533% \begin{macrocode} 3545% \begin{macrocode}
3534\NewDocumentCommand{\EkdosisOn}{}{% 3546\NewDocumentCommand{\EkdosisOn}{}{%