aboutsummaryrefslogtreecommitdiff
path: root/ekdosis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r--ekdosis.dtx72
1 files changed, 71 insertions, 1 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index 6fa4895..91d3da5 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -2341,9 +2341,12 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2341\ekvoProcessLocalOptions{ekdosis} 2341\ekvoProcessLocalOptions{ekdosis}
2342% \end{macrocode} 2342% \end{macrocode}
2343% \paragraph{Required Packages} \label{ref:ekdrequirements} In 2343% \paragraph{Required Packages} \label{ref:ekdrequirements} In
2344% addition to \pkg{iftex} \pkg{expkv-opt} and \pkg{expkv-def}, a list 2344% addition to \pkg{iftex}, \pkg{expkv-opt} and \pkg{expkv-def}, a list
2345% of the packages that are required by \pkg{ekdosis} follows:--- 2345% of the packages that are required by \pkg{ekdosis} follows:---
2346% \begin{macrocode} 2346% \begin{macrocode}
2347% \RequirePackage{iftex} % already loaded above
2348% \RequirePackage{expkv-opt} % already loaded above
2349% \RequirePackage{expkv-def} % already loaded above
2347\RequirePackage{luacode} 2350\RequirePackage{luacode}
2348\RequirePackage{paracol} 2351\RequirePackage{paracol}
2349\RequirePackage{xparse} 2352\RequirePackage{xparse}
@@ -2681,6 +2684,15 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2681\NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}} 2684\NewDocumentCommand{\SetUnitDelimiter}{m}{\def\ekd@unit@delim{#1}}
2682% \end{macrocode} 2685% \end{macrocode}
2683% \end{macro} 2686% \end{macro}
2687% \begin{macro}{\footnoteruletrue}
2688% \begin{macro}{\footnoterulefalse}
2689% As \pkg{ekdosis} takes care of drawing a rule separating the main
2690% text from the apparatus block as well as layers of notes from each
2691% other inside this block, it may not be desirable to have
2692% the standard \LaTeX{} \enquote{footnoterule} printed on every page
2693% of the edition text. \cs{footnoterulefalse} removes it while
2694% \cs{footnoteruletrue} leaves it untouched. The latter is set by
2695% default.
2684% \begin{macrocode} 2696% \begin{macrocode}
2685\def\ekd@default@rule{\rule{2truein}{0.5pt}} 2697\def\ekd@default@rule{\rule{2truein}{0.5pt}}
2686\newif\iffootnoterule 2698\newif\iffootnoterule
@@ -2697,20 +2709,48 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2697 \dflt@pcol@footnoterule% 2709 \dflt@pcol@footnoterule%
2698 \fi 2710 \fi
2699} 2711}
2712% \end{macrocode}
2713% \end{macro}
2714% \end{macro}
2715% \begin{macro}{\SetDefaultRule}
2716% By default, \pkg{ekdosis} draws separating rules the definition of
2717% which is |\rule{2truein}{0.5pt}|. This can be changed in the
2718% preamble or at any point of the document with
2719% \cs{SetDefaultRule}\marg{\allowbreak{}rule definition}. Leaving this
2720% argument empty as in \cs{SetDefaultRule}|{}| removes the rule.
2721% \begin{macrocode}
2700\NewDocumentCommand{\SetDefaultRule}{m}{% 2722\NewDocumentCommand{\SetDefaultRule}{m}{%
2701 \def\@tempa{#1} 2723 \def\@tempa{#1}
2702 \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}% 2724 \ifx\@tempa\empty\def\ekd@default@rule{\mbox{}}%
2703 \else% 2725 \else%
2704 \def\ekd@default@rule{#1}% 2726 \def\ekd@default@rule{#1}%
2705 \fi} 2727 \fi}
2728% \end{macrocode}
2729% \end{macro}
2730% \begin{macro}{\NLS}
2731% \cs{NLS} is adapted from a snippet written by Heiko Oberdiek. It is
2732% used by \pkg{ekdosis} internally to prevent page breaks between
2733% separating rules and subsequent notes. Therefore, it is not
2734% documented.
2735% \begin{macrocode}
2706\newcommand*{\NLS}{% 2736\newcommand*{\NLS}{%
2707 \par% 2737 \par%
2708 \nobreak% 2738 \nobreak%
2709 \vspace{-\parskip}% 2739 \vspace{-\parskip}%
2710 \noindent% 2740 \noindent%
2711 \ignorespaces} 2741 \ignorespaces}
2742% \end{macrocode}
2743% \end{macro}
2744% This boolean is used to test if a given entry is to be preceded by a
2745% numeral referring to the line of the edition text.
2746% \begin{macrocode}
2712\newif\ifsubsq@unit 2747\newif\ifsubsq@unit
2713\subsq@unittrue 2748\subsq@unittrue
2749% \end{macrocode}
2750% \cs{add@@apparatus} inserts the apparatus block on a given page
2751% either in the footnote floating block or in a float of its own,
2752% depending on the value set in the |layout| global option.
2753% \begin{macrocode}
2714\def\add@@apparatus{% 2754\def\add@@apparatus{%
2715 \if@pkg@parnotes\parnotes\else\fi% 2755 \if@pkg@parnotes\parnotes\else\fi%
2716 \if@pkg@footins% 2756 \if@pkg@footins%
@@ -2737,10 +2777,18 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2737 }% 2777 }%
2738 \fi% 2778 \fi%
2739} 2779}
2780% \end{macrocode}
2781% Before inserting any new entry, \cs{add@apparatus} is called
2782% \cs{test@apparatus} to decide whether a new apparatus block must be
2783% created on a given page.
2784% \begin{macrocode}
2740\def\add@apparatus{% 2785\def\add@apparatus{%
2741 \test@apparatus% 2786 \test@apparatus%
2742 \ifbool{do@app}{\subsq@unitfalse\add@@apparatus}{}% 2787 \ifbool{do@app}{\subsq@unitfalse\add@@apparatus}{}%
2743} 2788}
2789% \end{macrocode}
2790% \cs{append@app} inserts a bare (sub)entry in the apparatus...
2791% \begin{macrocode}
2744\NewDocumentCommand{\append@app}{o +m}{% 2792\NewDocumentCommand{\append@app}{o +m}{%
2745 \ifekd@isinapp% 2793 \ifekd@isinapp%
2746 \ifekd@state% 2794 \ifekd@state%
@@ -2749,17 +2797,36 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2749 {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}% 2797 {\luadirect{ekdosis.appin(\luastringO{#2}, \luastringO{#1})}}%
2750 \fi% 2798 \fi%
2751 \fi} 2799 \fi}
2800% \end{macrocode}
2801% while \cs{append@ln@app} inserts a (sub)entry possibly preceded by a
2802% line number.
2803% \begin{macrocode}
2752\NewDocumentCommand{\append@ln@app}{o +m}{% 2804\NewDocumentCommand{\append@ln@app}{o +m}{%
2753 \IfNoValueTF{#1} 2805 \IfNoValueTF{#1}
2754 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2}))}} 2806 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2}))}}
2755 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2}, 2807 {\luadirect{tex.sprint(ekdosis.mdvappend(\luastringO{#2},
2756 \luastringO{#1}))}}} 2808 \luastringO{#1}))}}}
2809% \end{macrocode}
2810% \begin{macro}{\EkdosisDefaultApparatus}
2811% By default, \pkg{ekdosis} defines one layer of critical notes which
2812% is called |default|. This name can be changed at any point of the
2813% document with \cs{EkdosisDefaultApparatus}\marg{name}.
2814% \begin{macrocode}
2757\ekvdefinekeys{appnote}{ 2815\ekvdefinekeys{appnote}{
2758 store type = \ekdan@type, 2816 store type = \ekdan@type,
2759 initial type = default 2817 initial type = default
2760 } 2818 }
2761\NewDocumentCommand{\EkdosisDefaultApparatus}{m}{% 2819\NewDocumentCommand{\EkdosisDefaultApparatus}{m}{%
2762 \ekvset{appnote}{type=#1}} 2820 \ekvset{appnote}{type=#1}}
2821% \end{macrocode}
2822% \end{macro}
2823% \begin{macro}{\app}
2824% \cs{app}|[type=|\meta{type}|]|\marg{apparatus entries} takes one
2825% mandatory argument and accepts one optional argument. |type=| refers
2826% to the layer the note must go into and \meta{apparatus entries}
2827% contains command used to insert the entries, either \cs{lem},
2828% \cs{rdg} or \cs{note}:---
2829% \begin{macrocode}
2763\NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{% 2830\NewDocumentCommand{\app}{O{} > { \TrimSpaces } +m}{%
2764 \begingroup 2831 \begingroup
2765 \ekvset{appnote}{#1}% 2832 \ekvset{appnote}{#1}%
@@ -2772,6 +2839,9 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2772 \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#2}))}% 2839 \luadirect{tex.sprint(ekdosis.removesp(\luastringN{#2}))}%
2773 \ekd@isinappfalse% 2840 \ekd@isinappfalse%
2774 \endgroup} 2841 \endgroup}
2842% \end{macrocode}
2843% \end{macro}
2844% \begin{macrocode}
2775\def\current@ref@arg#1#2{{%\textdir TLT% 2845\def\current@ref@arg#1#2{{%\textdir TLT%
2776 \unexpanded\expandafter{\ekd@refnumstyle}% 2846 \unexpanded\expandafter{\ekd@refnumstyle}%
2777 \ifnum% 2847 \ifnum%