aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ekdosis.dtx71
1 files changed, 65 insertions, 6 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 9cfc44f..630ebfe 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2614,24 +2614,44 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2614\@onlypreamble\DeclareApparatus 2614\@onlypreamble\DeclareApparatus
2615% \end{macrocode} 2615% \end{macrocode}
2616% \end{macro} 2616% \end{macro}
2617% Apparatus-related settings and functions. Some booleans to check if
2618% an apparatus should be inserted and what is the current environment.
2617% \begin{macrocode} 2619% \begin{macrocode}
2618\newbool{do@app} 2620\newbool{do@app}
2619\newif\ifekd@state 2621\newif\ifekd@state
2620\newif\ifekd@isinapp 2622\newif\ifekd@isinapp
2621\newif\ifekd@isinlem 2623\newif\ifekd@isinlem
2624% \end{macrocode}
2625% The next boolean is shared with \pkg{arabluatex}. \cs{LRnum} is used
2626% internally to ensure that numerals referring to line spans are
2627% displayed in the right order.
2628% \begin{macrocode}
2622\providebool{al@rlmode} 2629\providebool{al@rlmode}
2623\@ifpackageloaded{arabluatex}{}{% 2630\@ifpackageloaded{arabluatex}{}{%
2624 \def\setRL{\booltrue{al@rlmode}\pardir TRT\textdir TRT} 2631 \def\setRL{\booltrue{al@rlmode}\pardir TRT\textdir TRT}
2625 \def\setLR{\boolfalse{al@rlmode}\pardir TLT \textdir TLT} 2632 \def\setLR{\boolfalse{al@rlmode}\pardir TLT \textdir TLT}
2626} 2633}
2627\protected\def\LRnum#1{\bgroup\textdir TLT#1\egroup} 2634\protected\def\LRnum#1{\bgroup\textdir TLT#1\egroup}
2635% \end{macrocode}
2636% Set counter referring to line numbers and make it global.
2637% \begin{macrocode}
2628\newcounter{ekd@lab} 2638\newcounter{ekd@lab}
2629\globalcounter{ekd@lab} 2639\globalcounter{ekd@lab}
2640% \end{macrocode}
2641% This command inserts words in the apparatus criticus without
2642% checking if both |ekd@isinapp| and |ekd@state| are set to |true|.
2643% \begin{macrocode}
2630\NewDocumentCommand{\unconditional@appin}{o m}{% 2644\NewDocumentCommand{\unconditional@appin}{o m}{%
2631 \IfNoValueTF{#1} 2645 \IfNoValueTF{#1}
2632 {\luadirect{ekdosis.appin(\luastringO{#2})}} 2646 {\luadirect{ekdosis.appin(\luastringO{#2})}}
2633 {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}% 2647 {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}%
2634} 2648}
2649% \end{macrocode}
2650% \begin{macro}{\blfootnote} \cs{blfootnote}\marg{footnote} is used
2651% internally to insert the apparatus in the footnote block should the
2652% global optional argument |layout| be set to |footins|. Therefore, it
2653% is not documented.
2654% \begin{macrocode}
2635 % \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext} 2655 % \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
2636\def\blfootnote{\gdef\@thefnmark{}\@blfootnotetext} 2656\def\blfootnote{\gdef\@thefnmark{}\@blfootnotetext}
2637\long\def\@blfootnotetext#1{\insert\footins{% 2657\long\def\@blfootnotetext#1{\insert\footins{%
@@ -2651,15 +2671,54 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2651 \parindent 1em% 2671 \parindent 1em%
2652 \noindent 2672 \noindent
2653 \hb@xt@0em{\hss\@makefnmark}#1} 2673 \hb@xt@0em{\hss\@makefnmark}#1}
2674% \end{macrocode}
2675% \end{macro}
2676% \paragraph{Single-layer apparatus} The following commands are for
2677% general settings. All of them can be used in the preamble or at any
2678% point of the document:---
2679% \begin{macro}{\SetLTRapp}
2680% \begin{macro}{\SetRTLapp}
2681% \cs{SetLTRapp} and \cs{SetRTLapp} are two argument-less commands to
2682% set the direction of single-layer apparatus criticus, either LTR or
2683% RTL:---
2684% \begin{macrocode}
2654\newif\ifrtl@app 2685\newif\ifrtl@app
2655\NewDocumentCommand{\SetRTLapp}{}{\rtl@apptrue} 2686\NewDocumentCommand{\SetRTLapp}{}{\rtl@apptrue}
2656\NewDocumentCommand{\SetLTRapp}{}{\rtl@appfalse} 2687\NewDocumentCommand{\SetLTRapp}{}{\rtl@appfalse}
2688% \end{macrocode}
2689% \end{macro}
2690% \end{macro}
2691% \begin{macro}{\SetSeparator}
2692% \cs{SetSeparator}\marg{separator} allows to change the separator
2693% between lemma texts and variant readings, which is by default
2694% a closing square bracket followed by a space (\verb*+] +):---
2695% \begin{macrocode}
2657\edef\ekdsep{] } 2696\edef\ekdsep{] }
2658\NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}} 2697\NewDocumentCommand{\SetSeparator}{m}{\edef\ekdsep{#1}}
2698% \end{macrocode}
2699% \end{macro}
2700% \begin{macro}{\SetEndApparatus}
2701% \cs{SetEndApparatus}\marg{characters} can be used to append
2702% characters at the end of the apparatus block\---such as a full stop,
2703% as it is customary in some editions. By default, nothing is
2704% appended:---
2705% \begin{macrocode}
2659\edef\ekd@end@apparatus{} 2706\edef\ekd@end@apparatus{}
2660\NewDocumentCommand{\SetEndApparatus}{m}{\edef\ekd@end@apparatus{#1}} 2707\NewDocumentCommand{\SetEndApparatus}{m}{\edef\ekd@end@apparatus{#1}}
2708% \end{macrocode}
2709% \end{macro}
2710% \begin{macro}{\SetUnitDelimiter}
2711% \cs{SetUnitDelimiter}\marg{delimiter} can be used to set the
2712% delimiter between entries in the apparatus criticus. By default,
2713% there is no delimiter except a simple space. \cs{SetUnitDelimiter}
2714% can be used to insert a broad space (with |\hskip| for instance, as
2715% in the OCT series) or the divider-sign (‖, as in the Budé series):---
2716% \begin{macrocode}
2661\def\ekd@unit@delim{} 2717\def\ekd@unit@delim{}
2662\NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}} 2718\NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}}
2719% \end{macrocode}
2720% \end{macro}
2721% \begin{macrocode}
2663\def\ekd@default@rule{\rule{2truein}{0.5pt}} 2722\def\ekd@default@rule{\rule{2truein}{0.5pt}}
2664\newif\iffootnoterule 2723\newif\iffootnoterule
2665\footnoteruletrue 2724\footnoteruletrue
@@ -2675,18 +2734,18 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2675 \dflt@pcol@footnoterule% 2734 \dflt@pcol@footnoterule%
2676 \fi 2735 \fi
2677} 2736}
2678\newcommand*{\NLS}{%
2679 \par%
2680 \nobreak%
2681 \vspace{-\parskip}%
2682 \noindent%
2683 \ignorespaces}
2684\NewDocumentCommand{\SetDefaultRule}{m}{% 2737\NewDocumentCommand{\SetDefaultRule}{m}{%
2685 \def\@tempa{#1} 2738 \def\@tempa{#1}
2686 \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}% 2739 \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}%
2687 \else% 2740 \else%
2688 \def\ekd@default@rule{#1}% 2741 \def\ekd@default@rule{#1}%
2689 \fi} 2742 \fi}
2743\newcommand*{\NLS}{%
2744 \par%
2745 \nobreak%
2746 \vspace{-\parskip}%
2747 \noindent%
2748 \ignorespaces}
2690\newif\ifsubsq@unit 2749\newif\ifsubsq@unit
2691\subsq@unittrue 2750\subsq@unittrue
2692\def\add@@apparatus{% 2751\def\add@@apparatus{%