diff options
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r-- | ekdosis.dtx | 261 |
1 files changed, 181 insertions, 80 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx index 29919e1..b9cfbaf 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx | |||
@@ -2345,7 +2345,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2345 | \AtEndDocument{\luadirect{ekdosis.closeteistream("tidy")}}}}, | 2345 | \AtEndDocument{\luadirect{ekdosis.closeteistream("tidy")}}}}, |
2346 | default teiexport = true, | 2346 | default teiexport = true, |
2347 | unknown-choice teiexport = \PackageError{ekdosis}{unknown | 2347 | unknown-choice teiexport = \PackageError{ekdosis}{unknown |
2348 | teiexport=#1}{`teiexport' must be either `true', `false' or `tidy'}, | 2348 | teiexport=#1}{`teiexport' must be either `true', `false' or |
2349 | `tidy'.} | ||
2349 | } | 2350 | } |
2350 | \ekvoProcessLocalOptions{ekdosis} | 2351 | \ekvoProcessLocalOptions{ekdosis} |
2351 | % \end{macrocode} | 2352 | % \end{macrocode} |
@@ -2490,13 +2491,36 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2490 | \luadirect{tex.sprint(ekdosis.basic_cs(\luastringN{#1}))} | 2491 | \luadirect{tex.sprint(ekdosis.basic_cs(\luastringN{#1}))} |
2491 | } | 2492 | } |
2492 | % \end{macrocode} | 2493 | % \end{macrocode} |
2493 | % Add a \hologo{(La)TeX} command to be processed as a |TEI xml| tag: | 2494 | % \paragraph{\TeX\ to \texttt{TEI xml}} |
2495 | % The following three commands can be used to instruct \pkg{ekdosis} | ||
2496 | % how to convert unknown or unusual \hologo{(La)TeX} commands into | ||
2497 | % \texttt{TEI xml} equivalents. | ||
2498 | % \begin{macro}{\TeXtoTEI} | ||
2499 | % \cs{TeXtoTEI}\marg{csname}\marg{TEI element}\oarg{TEI attribute(s)} | ||
2500 | % takes two mandatory arguments and one optional argument, namely: the | ||
2501 | % control sequence name to be converted, the \texttt{TEI} element it | ||
2502 | % is to be converted into and any additional \texttt{xml} attributes | ||
2503 | % to be appended to the opening \texttt{TEI} element:--- | ||
2494 | % \begin{macrocode} | 2504 | % \begin{macrocode} |
2495 | \NewDocumentCommand{\TeXtoTEI}{m m O{}}{% | 2505 | \NewDocumentCommand{\TeXtoTEI}{m m O{}}{% |
2496 | \luadirect{ekdosis.newcmdtotag(\luastringN{#1}, | 2506 | \luadirect{ekdosis.newcmdtotag(\luastringN{#1}, |
2497 | \luastringN{#2}, | 2507 | \luastringN{#2}, |
2498 | \luastringN{#3})} | 2508 | \luastringN{#3})} |
2499 | } | 2509 | } |
2510 | % \end{macrocode} | ||
2511 | % \end{macro} | ||
2512 | % \begin{macro}{\EnvtoTEI} | ||
2513 | % \begin{macro}{\EnvtoTEI*} | ||
2514 | % \cs{EnvtoTEI}\meta{*}\marg{env name}\marg{TEI element}\oarg{TEI | ||
2515 | % attribute(s)} instructs how to convert \LaTeX{} environments into | ||
2516 | % \texttt{TEI xml} equivalents. It takes two mandatory arguments and | ||
2517 | % one optional argument, namely the name of the \LaTeX{} environment | ||
2518 | % to be converted, the \texttt{TEI} element it is to be converted into | ||
2519 | % and any additional attributes to be appended to the \texttt{TEI} | ||
2520 | % opening element. \cs{EnvtoTEI*} is restricted to \texttt{TEI} | ||
2521 | % elements that must never appear within |<p>| elements, such as | ||
2522 | % |<div>|, |<lg>| and the like. | ||
2523 | % \begin{macrocode} | ||
2500 | \NewDocumentCommand{\EnvtoTEI}{s m m O{}}{% | 2524 | \NewDocumentCommand{\EnvtoTEI}{s m m O{}}{% |
2501 | \IfBooleanTF{#1}{% | 2525 | \IfBooleanTF{#1}{% |
2502 | \luadirect{ekdosis.newenvtotag(\luastringN{#2}, | 2526 | \luadirect{ekdosis.newenvtotag(\luastringN{#2}, |
@@ -2509,10 +2533,21 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2509 | \luastringN{#4})} | 2533 | \luastringN{#4})} |
2510 | } | 2534 | } |
2511 | } | 2535 | } |
2536 | % \end{macrocode} | ||
2537 | % \end{macro} | ||
2538 | % \end{macro} | ||
2539 | % \begin{macro}{\TeXtoTEIPatt} | ||
2540 | % Finally, the more flexible\---and more delicate to | ||
2541 | % handle\---\cs{TeXtoTEIPatt}\marg{\TeX\ | ||
2542 | % pattern}\allowbreak\marg{\texttt{TEI} pattern} uses pattern matching | ||
2543 | % to instruct \pkg{ekdosis} how to convert \hologo{(La)TeX} commands | ||
2544 | % into \texttt{TEI} equivalents. | ||
2545 | % \begin{macrocode} | ||
2512 | \NewDocumentCommand{\TeXtoTEIPatt}{m m}{% | 2546 | \NewDocumentCommand{\TeXtoTEIPatt}{m m}{% |
2513 | \luadirect{ekdosis.newpatttotag(\luastringN{#1}, \luastringN{#2})} | 2547 | \luadirect{ekdosis.newpatttotag(\luastringN{#1}, \luastringN{#2})} |
2514 | } | 2548 | } |
2515 | % \end{macrocode} | 2549 | % \end{macrocode} |
2550 | % \end{macro} | ||
2516 | % \begin{macro}{\SetTEIFilename} \cs{SetTEIFilename}\marg{basename} is | 2551 | % \begin{macro}{\SetTEIFilename} \cs{SetTEIFilename}\marg{basename} is |
2517 | % a preamble-only command. It is used to set the base name of the | 2552 | % a preamble-only command. It is used to set the base name of the |
2518 | % |TEI xml| output file, to which the suffix |.xml| is appended. By | 2553 | % |TEI xml| output file, to which the suffix |.xml| is appended. By |
@@ -2836,7 +2871,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2836 | % mandatory argument and accepts one optional argument. |type=| refers | 2871 | % mandatory argument and accepts one optional argument. |type=| refers |
2837 | % to the layer the note must go into and \meta{apparatus entries} | 2872 | % to the layer the note must go into and \meta{apparatus entries} |
2838 | % contains command used to insert the entries, either \cs{lem}, | 2873 | % contains command used to insert the entries, either \cs{lem}, |
2839 | % \cs{rdg} or \cs{note}:--- | 2874 | % \cs{rdg} or \cs{note}\meta{*}:--- |
2840 | % \begin{macrocode} | 2875 | % \begin{macrocode} |
2841 | \NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% | 2876 | \NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% |
2842 | \begingroup | 2877 | \begingroup |
@@ -2852,6 +2887,10 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2852 | \endgroup} | 2887 | \endgroup} |
2853 | % \end{macrocode} | 2888 | % \end{macrocode} |
2854 | % \end{macro} | 2889 | % \end{macro} |
2890 | % \cs{current@ref@arg} is used outside \cs{app} by \cs{note}. It takes | ||
2891 | % two mandatory arguments: the beginning line label and the ending | ||
2892 | % line label\---which are manually inserted---and returns the formatted | ||
2893 | % reference to be inserted in the apparatus criticus. | ||
2855 | % \begin{macrocode} | 2894 | % \begin{macrocode} |
2856 | \def\current@ref@arg#1#2{{%\textdir TLT% | 2895 | \def\current@ref@arg#1#2{{%\textdir TLT% |
2857 | \unexpanded\expandafter{\ekd@refnumstyle}% | 2896 | \unexpanded\expandafter{\ekd@refnumstyle}% |
@@ -2859,97 +2898,106 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2859 | \getpagerefnumber{#1} | 2898 | \getpagerefnumber{#1} |
2860 | = | 2899 | = |
2861 | \getpagerefnumber{#2} | 2900 | \getpagerefnumber{#2} |
2862 | \ifnum% | 2901 | \ifnum% |
2863 | \getrefnumber{#1} | 2902 | \getrefnumber{#1} |
2864 | = | 2903 | = |
2865 | \getrefnumber{#2} | 2904 | \getrefnumber{#2} |
2866 | % | 2905 | % |
2867 | \ifekd@mapps% | 2906 | \ifekd@mapps% |
2868 | \ifbool{subsq@unit@\ekdan@type}{% | 2907 | \ifbool{subsq@unit@\ekdan@type}{% |
2869 | \ifnum% | ||
2870 | \getrefnumber{#1} | ||
2871 | = | ||
2872 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}} | ||
2873 | \else | ||
2874 | \LRnum{\getrefnumber{#1}}% issue the no | ||
2875 | \fi% | ||
2876 | }% | ||
2877 | {\LRnum{\getrefnumber{#1}}}% issue the no | ||
2878 | \else | ||
2879 | \ifsubsq@unit% | ||
2880 | % | ||
2881 | \ifnum% | 2908 | \ifnum% |
2882 | \getrefnumber{#1} | 2909 | \getrefnumber{#1} |
2883 | = | 2910 | = |
2884 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}} | 2911 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}} |
2885 | \else | 2912 | \else |
2886 | \LRnum{\getrefnumber{#1}}% issue the no | 2913 | \LRnum{\getrefnumber{#1}}% issue the no |
2887 | \fi | ||
2888 | % | ||
2889 | \else | ||
2890 | \LRnum{\getrefnumber{#1}}% issue the no | ||
2891 | \fi | ||
2892 | \fi | ||
2893 | % | ||
2894 | \else | ||
2895 | \LRnum{\getrefnumber{#1}}--% | ||
2896 | \LRnum{\getrefnumber{#2}}% issue the nos | ||
2897 | \fi% | ||
2898 | \else | ||
2899 | \LRnum{\getrefnumber{#1}}--% | ||
2900 | \LRnum{\getpagerefnumber{#2}}.% | ||
2901 | \LRnum{\getrefnumber{#2}}% issue pg and ln nos | ||
2902 | \fi% | 2914 | \fi% |
2903 | }\unexpanded\expandafter{\ekd@postrefnum}% | 2915 | }% |
2904 | }% | 2916 | {\LRnum{\getrefnumber{#1}}}% issue the no |
2905 | \def\current@ref{{%\textdir TLT% | 2917 | \else |
2906 | \unexpanded\expandafter{\ekd@refnumstyle}% | 2918 | \ifsubsq@unit% |
2919 | % | ||
2920 | \ifnum% | ||
2921 | \getrefnumber{#1} | ||
2922 | = | ||
2923 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevnotelab())}} | ||
2924 | \else | ||
2925 | \LRnum{\getrefnumber{#1}}% issue the no | ||
2926 | \fi | ||
2927 | % | ||
2928 | \else | ||
2929 | \LRnum{\getrefnumber{#1}}% issue the no | ||
2930 | \fi | ||
2931 | \fi | ||
2932 | % | ||
2933 | \else | ||
2934 | \LRnum{\getrefnumber{#1}}--% | ||
2935 | \LRnum{\getrefnumber{#2}}% issue the nos | ||
2936 | \fi% | ||
2937 | \else | ||
2938 | \LRnum{\getrefnumber{#1}}--% | ||
2939 | \LRnum{\getpagerefnumber{#2}}.% | ||
2940 | \LRnum{\getrefnumber{#2}}% issue pg and ln nos | ||
2941 | \fi% | ||
2942 | }\unexpanded\expandafter{\ekd@postrefnum}% | ||
2943 | } | ||
2944 | % \end{macrocode} | ||
2945 | % \cs{current@ref} is pretty much the same as \cs{current@reg@arg}, | ||
2946 | % but takes no argument. It is used by commands such as \cs{lem} when | ||
2947 | % references to page and line numbers can be returned by \textsf{Lua}. | ||
2948 | % \begin{macrocode} | ||
2949 | \def\current@ref{{%\textdir TLT% | ||
2950 | \unexpanded\expandafter{\ekd@refnumstyle}% | ||
2907 | \ifnum% | 2951 | \ifnum% |
2908 | \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | 2952 | \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} |
2909 | = | 2953 | = |
2910 | \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} | 2954 | \getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} |
2911 | \ifnum% | 2955 | \ifnum% |
2912 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | 2956 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} |
2913 | = | 2957 | = |
2914 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} | 2958 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e} |
2915 | % | 2959 | % |
2916 | \ifekd@mapps% | 2960 | \ifekd@mapps% |
2917 | \ifbool{subsq@unit@\ekdan@type}{% | 2961 | \ifbool{subsq@unit@\ekdan@type}{% |
2918 | \ifnum% | ||
2919 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | ||
2920 | = | ||
2921 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b} | ||
2922 | \else | ||
2923 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no | ||
2924 | \fi% | ||
2925 | }{\LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}}% issue the no | ||
2926 | \else | ||
2927 | \ifsubsq@unit% | ||
2928 | % | ||
2929 | \ifnum% | 2962 | \ifnum% |
2930 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} | 2963 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} |
2931 | = | 2964 | = |
2932 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b} | 2965 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b} |
2933 | \else | 2966 | \else |
2934 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no | 2967 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no |
2935 | \fi | ||
2936 | % | ||
2937 | \else | ||
2938 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no | ||
2939 | \fi | ||
2940 | \fi | ||
2941 | % | ||
2942 | \else | ||
2943 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% | ||
2944 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos | ||
2945 | \fi% | 2968 | \fi% |
2946 | \else | 2969 | }{\LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}}% issue the no |
2947 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% | 2970 | \else |
2948 | \LRnum{\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}.% | 2971 | \ifsubsq@unit% |
2949 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue pg and ln nos | 2972 | % |
2950 | \fi% | 2973 | \ifnum% |
2951 | }\unexpanded\expandafter{\ekd@postrefnum}% | 2974 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b} |
2952 | }% | 2975 | = |
2976 | \getrefnumber{\luadirect{tex.sprint(ekdosis.getprevlnlab())}-b} | ||
2977 | \else | ||
2978 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no | ||
2979 | \fi | ||
2980 | % | ||
2981 | \else | ||
2982 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}% issue the no | ||
2983 | \fi | ||
2984 | \fi | ||
2985 | % | ||
2986 | \else | ||
2987 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% | ||
2988 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue the nos | ||
2989 | \fi% | ||
2990 | \else | ||
2991 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-b}}--% | ||
2992 | \LRnum{\getpagerefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}.% | ||
2993 | \LRnum{\getrefnumber{\luadirect{tex.sprint(ekdosis.getlnlab())}-e}}% issue pg and ln nos | ||
2994 | \fi% | ||
2995 | }\unexpanded\expandafter{\ekd@postrefnum}% | ||
2996 | } | ||
2997 | % \end{macrocode} | ||
2998 | % Define keys to be used by the optional arguments of \cs{lem} and | ||
2999 | % \cs{rdg}:--- | ||
3000 | % \begin{macrocode} | ||
2953 | \ekvdefinekeys{lem}{ | 3001 | \ekvdefinekeys{lem}{ |
2954 | code wit = \def\ekdlr@wit{#1}, | 3002 | code wit = \def\ekdlr@wit{#1}, |
2955 | code alt = \def\ekdlr@alt{#1}, | 3003 | code alt = \def\ekdlr@alt{#1}, |
@@ -2962,7 +3010,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2962 | bool nolem = \ifekdl@nolem, | 3010 | bool nolem = \ifekdl@nolem, |
2963 | bool nosep = \ifekdl@nosep, | 3011 | bool nosep = \ifekdl@nosep, |
2964 | initial sep = \ekdsep | 3012 | initial sep = \ekdsep |
2965 | } | 3013 | } |
2966 | \ekvdefinekeys{rdg}{ | 3014 | \ekvdefinekeys{rdg}{ |
2967 | code wit = \def\ekdlr@wit{#1}, | 3015 | code wit = \def\ekdlr@wit{#1}, |
2968 | code alt = \def\ekdlr@alt{#1}, | 3016 | code alt = \def\ekdlr@alt{#1}, |
@@ -2972,7 +3020,15 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
2972 | code postwit = \def\ekdlr@postwit{#1}, | 3020 | code postwit = \def\ekdlr@postwit{#1}, |
2973 | store type = \ekdlr@type, | 3021 | store type = \ekdlr@type, |
2974 | bool nordg = \ifekdr@nordg | 3022 | bool nordg = \ifekdr@nordg |
2975 | } | 3023 | } |
3024 | % \end{macrocode} | ||
3025 | % \begin{macro}{\lem} | ||
3026 | % \cs{lem}\oarg{options}\marg{lemma text} inserts \meta{lemma text} | ||
3027 | % both in the edition text and in the apparatus criticus by default, | ||
3028 | % preceded by the reference to the line number or a space if it is the | ||
3029 | % same number as the one of the previous entry. This command accepts | ||
3030 | % the optional key-value arguments just defined above. | ||
3031 | % \begin{macrocode} | ||
2976 | \NewDocumentCommand{\lem}{O{} m}{% | 3032 | \NewDocumentCommand{\lem}{O{} m}{% |
2977 | \ekd@isinlemtrue% | 3033 | \ekd@isinlemtrue% |
2978 | \luadirect{ekdosis.dolnlab(\luastringN{#2})}% | 3034 | \luadirect{ekdosis.dolnlab(\luastringN{#2})}% |
@@ -3075,6 +3131,14 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3075 | \ekd@isinlemfalse% | 3131 | \ekd@isinlemfalse% |
3076 | \subsq@unittrue% | 3132 | \subsq@unittrue% |
3077 | } | 3133 | } |
3134 | % \end{macrocode} | ||
3135 | % \end{macro} | ||
3136 | % \begin{macro}{\rdg} | ||
3137 | % \cs{rdg}\oarg{options}\marg{variant reading} inserts \meta{variant | ||
3138 | % reading} in the second part of the entry, after the lemma text and | ||
3139 | % the separator, in the apparatus criticus. This command accepts the | ||
3140 | % optional key-value arguments defined above. | ||
3141 | % \begin{macrocode} | ||
3078 | \NewDocumentCommand{\rdg}{O{} m}{% | 3142 | \NewDocumentCommand{\rdg}{O{} m}{% |
3079 | \bgroup% | 3143 | \bgroup% |
3080 | \ekvset{rdg}{#1}% | 3144 | \ekvset{rdg}{#1}% |
@@ -3145,6 +3209,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3145 | \fi% | 3209 | \fi% |
3146 | \egroup% | 3210 | \egroup% |
3147 | } | 3211 | } |
3212 | % \end{macrocode} | ||
3213 | % \end{macro} | ||
3214 | % Define keys to be used by the optional argument of \cs{note} when | ||
3215 | % this command is found outside \cs{app}:--- | ||
3216 | % \begin{macrocode} | ||
3148 | \ekvdefinekeys{note}{ | 3217 | \ekvdefinekeys{note}{ |
3149 | store type = \ekdan@type, | 3218 | store type = \ekdan@type, |
3150 | store lem = \ekdn@lem, | 3219 | store lem = \ekdn@lem, |
@@ -3153,10 +3222,19 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3153 | store sep = \ekdn@sep, | 3222 | store sep = \ekdn@sep, |
3154 | initial type = default, | 3223 | initial type = default, |
3155 | initial sep = \ekdsep | 3224 | initial sep = \ekdsep |
3156 | } | 3225 | } |
3226 | % \end{macrocode} | ||
3227 | % \cs{note@noapp} is used internally when a \cs{note} command is found | ||
3228 | % outside \cs{app}. This command is mostly used to insert short | ||
3229 | % comments or references to texts quoted or cited in the edition text | ||
3230 | % to go into additional layers of the apparatus criticus, e.g.\ the | ||
3231 | % \emph{apparatus testium}. It accepts the optional key-value | ||
3232 | % arguments just defined above. It must be noted that |labelb| must be | ||
3233 | % specified; otherwise \pkg{ekdosis} will issue an error message. | ||
3234 | % \begin{macrocode} | ||
3157 | \NewDocumentCommand{\note@noapp}{O{} +m}{% | 3235 | \NewDocumentCommand{\note@noapp}{O{} +m}{% |
3158 | \bgroup% | 3236 | \bgroup% |
3159 | \ekvset{note}{#1} | 3237 | \ekvset{note}{#1}% |
3160 | \stepcounter{ekd@lab}% | 3238 | \stepcounter{ekd@lab}% |
3161 | \zlabel{ekd:\theekd@lab}% | 3239 | \zlabel{ekd:\theekd@lab}% |
3162 | \luadirect{ekdosis.storeabspg( | 3240 | \luadirect{ekdosis.storeabspg( |
@@ -3218,10 +3296,23 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3218 | \egroup% | 3296 | \egroup% |
3219 | \subsq@unittrue% | 3297 | \subsq@unittrue% |
3220 | } | 3298 | } |
3299 | % \end{macrocode} | ||
3300 | % Define keys to be used by the optional argument of \cs{note} when | ||
3301 | % this command is found inside \cs{app}:--- | ||
3302 | % \begin{macrocode} | ||
3221 | \ekvdefinekeys{ekd@note}{ | 3303 | \ekvdefinekeys{ekd@note}{ |
3222 | store pre = \pre@value, | 3304 | store pre = \pre@value, |
3223 | store post = \post@value | 3305 | store post = \post@value |
3224 | } | 3306 | } |
3307 | % \end{macrocode} | ||
3308 | % The following three commands, \cs{note@app}, \cs{ekd@note} and | ||
3309 | % \cs{ekd@note@star} are used internally when a \cs{note} command is | ||
3310 | % found inside \cs{app}. These commands are used to insert short | ||
3311 | % comments after the lemma text or after any variant reading in the | ||
3312 | % apparatus criticus. \cs{note@app} and subsequently \cs{ekd@note} and | ||
3313 | % \cs{ekd@note@star} accept the optional key-value arguments just | ||
3314 | % defined above. | ||
3315 | % \begin{macrocode} | ||
3225 | \NewDocumentCommand{\ekd@note}{O{} m}{% | 3316 | \NewDocumentCommand{\ekd@note}{O{} m}{% |
3226 | \bgroup% | 3317 | \bgroup% |
3227 | \ekvset{ekd@note}{#1}% | 3318 | \ekvset{ekd@note}{#1}% |
@@ -3262,6 +3353,13 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3262 | {\ekd@note[#2]{#3}}% | 3353 | {\ekd@note[#2]{#3}}% |
3263 | }% | 3354 | }% |
3264 | } | 3355 | } |
3356 | % \end{macrocode} | ||
3357 | % \begin{macro}{\note} | ||
3358 | % Finally, \cs{note} is a simple command designed to check if it is | ||
3359 | % found inside or outside \cs{app}. Then, unless it is found inside | ||
3360 | % \cs{lem}, it calls \cs{note@app} in the former case and | ||
3361 | % \cs{note@noapp} in the latter case:--- | ||
3362 | % \begin{macrocode} | ||
3265 | \NewDocumentCommand{\note}{s O{} +m}{% | 3363 | \NewDocumentCommand{\note}{s O{} +m}{% |
3266 | \ifekd@state% | 3364 | \ifekd@state% |
3267 | \ifekd@isinapp% | 3365 | \ifekd@isinapp% |
@@ -3275,6 +3373,9 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+ | |||
3275 | \fi% | 3373 | \fi% |
3276 | \fi% | 3374 | \fi% |
3277 | } | 3375 | } |
3376 | % \end{macrocode} | ||
3377 | % \end{macro} | ||
3378 | % \begin{macrocode} | ||
3278 | \NewDocumentCommand{\apparatus}{}{% | 3379 | \NewDocumentCommand{\apparatus}{}{% |
3279 | \luadirect{tex.sprint(ekdosis.appout())}} | 3380 | \luadirect{tex.sprint(ekdosis.appout())}} |
3280 | \NewDocumentCommand{\test@apparatus}{}{% | 3381 | \NewDocumentCommand{\test@apparatus}{}{% |