aboutsummaryrefslogtreecommitdiff
path: root/ekdosis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'ekdosis.dtx')
-rw-r--r--ekdosis.dtx61
1 files changed, 50 insertions, 11 deletions
diff --git a/ekdosis.dtx b/ekdosis.dtx
index c9703da..9cfc44f 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -634,6 +634,10 @@ along with this program. If not, see
634% \pkg{ekdosis} can be seen as an attempt at combining the two 634% \pkg{ekdosis} can be seen as an attempt at combining the two
635% approaches. 635% approaches.
636% 636%
637% \subsection{Requirements}
638% \label{sec:requirements}
639% Please refer to \vref{ref:ekdrequirements}.
640%
637% \subsection{Features} 641% \subsection{Features}
638% \label{sec:features} 642% \label{sec:features}
639% A list of the main features of \pkg{ekdosis} follows:--- 643% A list of the main features of \pkg{ekdosis} follows:---
@@ -2300,7 +2304,8 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2300% \StopEventually{} 2304% \StopEventually{}
2301% 2305%
2302% \section{Implementation} 2306% \section{Implementation}
2303% 2307% \label{sec:implementation}
2308%
2304% \iffalse 2309% \iffalse
2305%<*package> 2310%<*package>
2306% \fi 2311% \fi
@@ -2371,7 +2376,9 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2371\ExecuteOptionsX{layout,divs} 2376\ExecuteOptionsX{layout,divs}
2372\ProcessOptionsX\relax 2377\ProcessOptionsX\relax
2373% \end{macrocode} 2378% \end{macrocode}
2374% Packages that are required by \pkg{ekdosis}:--- 2379% \paragraph{Required Packages} \label{ref:ekdrequirements} In
2380% addition to \pkg{iftex} and \pkg{xkeyval}, a list of the packages
2381% that are required by \pkg{ekdosis} follows:---
2375% \begin{macrocode} 2382% \begin{macrocode}
2376\RequirePackage{luacode} 2383\RequirePackage{luacode}
2377\RequirePackage{paracol} 2384\RequirePackage{paracol}
@@ -2387,7 +2394,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2387 \RequirePackage{parnotes} 2394 \RequirePackage{parnotes}
2388\fi 2395\fi
2389% \end{macrocode} 2396% \end{macrocode}
2390% Here begins the real work: load |ekdosis.lua|:--- 2397% \paragraph{Lua} Here begins the real work: load |ekdosis.lua|:---
2391% \begin{macrocode} 2398% \begin{macrocode}
2392\luadirect{dofile(kpse.find_file("ekdosis.lua"))} 2399\luadirect{dofile(kpse.find_file("ekdosis.lua"))}
2393% \end{macrocode} 2400% \end{macrocode}
@@ -2396,7 +2403,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2396 \luadirect{ekdosis.closestream()} 2403 \luadirect{ekdosis.closestream()}
2397} 2404}
2398% \end{macrocode} 2405% \end{macrocode}
2399% General settings:--- 2406% Use |\normalfont| for line numbers:---
2400% \begin{macrocode} 2407% \begin{macrocode}
2401\renewcommand\linenumberfont{\normalfont\footnotesize} 2408\renewcommand\linenumberfont{\normalfont\footnotesize}
2402% \end{macrocode} 2409% \end{macrocode}
@@ -2531,20 +2538,40 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2531 \luadirect{ekdosis.newpatttotag(\luastringN{#1}, \luastringN{#2})} 2538 \luadirect{ekdosis.newpatttotag(\luastringN{#1}, \luastringN{#2})}
2532} 2539}
2533% \end{macrocode} 2540% \end{macrocode}
2534% Set |TEI| file name 2541% \begin{macro}{\SetTEIFilename} \cs{SetTEIFilename}\marg{basename} is
2542% a preamble-only command. It is used to set the base name of the
2543% |TEI xml| output file, to which the suffix |.xml| is appended. By
2544% default, the base name is |\jobname-tei|:---
2535% \begin{macrocode} 2545% \begin{macrocode}
2536\NewDocumentCommand{\SetTEIFileName}{m}{ 2546\NewDocumentCommand{\SetTEIFileName}{m}{
2537 \luadirect{ekdosis.setteifilename(\luastringN{#1})} 2547 \luadirect{ekdosis.setteifilename(\luastringN{#1})}
2538} 2548}
2539\@onlypreamble\SetTEIFileName 2549\@onlypreamble\SetTEIFileName
2550% \end{macrocode}
2551% \end{macro}
2552% \begin{macro}{\SetxmlBibResource} This is a preamble-only command.
2553% If a base name for a \texttt{TEI xml} compliant bibliographical
2554% database file is provided with
2555% \cs{SetxmlBibResource}\marg{basename}, \pkg{ekdosis} will use
2556% insert formatted data in the back matter section of its own
2557% \texttt{TEI xml} output file, as |<biblStruct>| elements within a
2558% |<listBibl>| section.
2559% \begin{macrocode}
2540\NewDocumentCommand{\SetxmlBibResource}{m}{ 2560\NewDocumentCommand{\SetxmlBibResource}{m}{
2541 \luadirect{ekdosis.setxmlbibresource(\luastringN{#1})} 2561 \luadirect{ekdosis.setxmlbibresource(\luastringN{#1})}
2542} 2562}
2543\@onlypreamble\SetxmlBibResource 2563\@onlypreamble\SetxmlBibResource
2544% \end{macrocode} 2564% \end{macrocode}
2545% Multi-layer apparatuses 2565% \end{macro}
2566%
2567%\paragraph{Multi-layer apparatuses}
2568% \pkg{ekdosis} must know is an entry is to be processed in a single-
2569% or multiple-layer context:---
2546% \begin{macrocode} 2570% \begin{macrocode}
2547\newif\ifekd@mapps 2571\newif\ifekd@mapps
2572% \end{macrocode}
2573% Now the key-value options can be defined:---
2574% \begin{macrocode}
2548\ekvdefinekeys{ekd@newapp}{ 2575\ekvdefinekeys{ekd@newapp}{
2549 choice direction = {LR = \def\direction@val{LR}, 2576 choice direction = {LR = \def\direction@val{LR},
2550 RL = \def\direction@val{RL}}, 2577 RL = \def\direction@val{RL}},
@@ -2556,6 +2583,17 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2556 initial direction = LR, 2583 initial direction = LR,
2557 initial ehook = {\csname ekd@end@apparatus\endcsname} 2584 initial ehook = {\csname ekd@end@apparatus\endcsname}
2558} 2585}
2586% \end{macrocode}
2587% \begin{macro}{\DeclareApparatus}
2588% \cs{DeclareApparatus}\marg{apparatus name}\oarg{options} is a
2589% preamble-only command. As a mandatory argument, it takes the name of
2590% the new layer of notes to be inserted in the apparatus block. Then,
2591% the following six key-value options can be used to lay out the
2592% layer: \verb+direction=LR|RL+, |rule|, |delim| (the delimiter between
2593% entries), |sep| (the separator between lemma part and readings or
2594% notes), |bhook| (\LaTeX{} code inserted as the layer begins),
2595% |ehook| (\LaTeX{} code inserted as the layer ends):---
2596% \begin{macrocode}
2559\NewDocumentCommand{\DeclareApparatus}{m O{}}{ 2597\NewDocumentCommand{\DeclareApparatus}{m O{}}{
2560 \newbool{subsq@unit@#1} 2598 \newbool{subsq@unit@#1}
2561 \booltrue{subsq@unit@#1} 2599 \booltrue{subsq@unit@#1}
@@ -2575,6 +2613,7 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
2575} 2613}
2576\@onlypreamble\DeclareApparatus 2614\@onlypreamble\DeclareApparatus
2577% \end{macrocode} 2615% \end{macrocode}
2616% \end{macro}
2578% \begin{macrocode} 2617% \begin{macrocode}
2579\newbool{do@app} 2618\newbool{do@app}
2580\newif\ifekd@state 2619\newif\ifekd@state
@@ -3114,12 +3153,12 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
3114} 3153}
3115\NewDocumentCommand{\note@app}{s O{} +m}{% 3154\NewDocumentCommand{\note@app}{s O{} +m}{%
3116 \ifbool{al@rlmode}{% 3155 \ifbool{al@rlmode}{%
3117 \IfBooleanTF{#1}{\ekd@note@star[#2]{\unexpanded{% 3156 \IfBooleanTF{#1}{\ekd@note@star[#2]{%
3118 {\textdir TRT#3}}}} 3157 {\textdir TRT#3}}}
3119 {\ekd@note[#2]{\unexpanded{{\textdir TRT#3}}}}% 3158 {\ekd@note[#2]{{\textdir TRT#3}}}%
3120 }{% 3159 }{%
3121 \IfBooleanTF{#1}{\ekd@note@star[#2]{\unexpanded{#3}}} 3160 \IfBooleanTF{#1}{\ekd@note@star[#2]{#3}}
3122 {\ekd@note[#2]{\unexpanded{#3}}}% 3161 {\ekd@note[#2]{#3}}%
3123 }% 3162 }%
3124} 3163}
3125\NewDocumentCommand{\note}{s O{} +m}{% 3164\NewDocumentCommand{\note}{s O{} +m}{%