From a7deb7f848332c3a9b808d21c7e7d0e144633e94 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 21 May 2023 11:44:53 +0200 Subject: added support for Arabic poetry with the arabluatex package --- ekdosis.dtx | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 257 insertions(+), 37 deletions(-) diff --git a/ekdosis.dtx b/ekdosis.dtx index cf89edd..e85d6fb 100644 --- a/ekdosis.dtx +++ b/ekdosis.dtx @@ -59,7 +59,7 @@ Alessi %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{ekdosis} %<*package> - [2023/04/22 v1.5-dev Typesetting TEI xml-compliant critical editions] + [2023/05/21 v1.5-dev Typesetting TEI xml-compliant critical editions] % %<*driver> \begin{filecontents}[noheader,overwrite]{bibdata.xml} @@ -5088,6 +5088,203 @@ substantiall fewell,} % \iffalse % % \fi +% +% \subsection{Arabic Poetry} +% \label{sec:arabic-poetry} +% \newfeature[1.5] A short introduction to editing Arabic texts with +% \pkg{ekdosis} and \pkg{arabluatex} is provided below, +% \vnref{sec:using-arabluatex}. With regard to the technique of +% typesetting Arabic poetry, the reader is invited to refer to the +% relevant section of the documentation of +% \pkg{arabluatex}.\footcite[\nopp see \enquote{Arabic +% Poetry}]{arabluatex} +% +% \danger \pkg{ekdosis} \emph{must be loaded} with the |poetry=verse| +% option as described \vpageref{ref:poetry-opt}. Then, the |arabverse| +% environment is to be used instead of |ekdverse| to typeset the lines +% of Arabic poetry. +% +% \DescribeMacro{\bayt+} +% As of v1.21 of \pkg{arabluatex}, the +% \cs{bayt}\marg{\arb[trans]{.sadr}}\oarg{\arb[trans]{tadwIr}}%^^A +% \marg{\arb[trans]{`a^guz}} +% command it provides accepts a |+| optional argument that is to be +% used to let critical notes be inserted in lines of poetry, like +% so:--- +% +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{latex} +% Preamble: +\usepackage[poetry=verse]{ekdosis} + +% Document: +\begin{ekdosis} + \begin{arabverse}[] + \bayt{<ṣadr>}[]{<ʿaǧuz>}\\ % no critical notes + [...] + \bayt+{Arabic \app{ % example of \bayt+ with critical notes + \lem{sample} + \rdg{example} + } text}{Arabic sample text}\\ + [...] + \bayt{<ṣadr>}[]{<ʿaǧuz>}\\! % last line (no critical notes) + \end{arabverse} +\end{ekdosis} +\end{minted} +% \iffalse +% +% \fi +% +% An example of how one could insert variant readings in \prname{imru' +% al-qays}' \arb[trans]{\uc{mu`allaqaT}} (ll.~26--30) follows:--- +% +% \captof{Poetry: \prname{imru' al-qays}' +% \arb[trans]{\uc{m}u`allaqaT}}[\label{lst:al-qays-muallaqah}] +% \iffalse +%<*example> +% \fi +\begin{minted}[escapeinside=||]{latex} +\begin{alignment}[tcols=1, + texts=specimen, + apparatus=specimen] + \resetlinenumber\resetvlinenumber[26] + \begin{specimen} + \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth] + \bayt+{\app{|\label{ln:arb:poetry:plusone}| + \lem{ta^gAwaztu 'a.hrAsaN} + \rdg{ta_ha.t.taytu 'abwAbaN} + \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN} + } 'ilay-hA wa-ma`^saraN}{`alayya + .hirA.saN law \app{ + \lem[nonum]{yusirrUna}|\label{ln:arb:poetry:nonum}| + \rdg{yu^sirrUna} + } maqtalI}\\|\label{ln:arb:poetry:plusone:e}| + \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da + 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\ + \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A + 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\ + \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in + 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\ + \bayt+{_hara^gtu bi-hA \app{|\label{ln:arb:poetry:plustwo}| + \lem{tam^sI} + \rdg{'am^sI} + } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA + 'a_dyAla mir.tiN mura.h.hali}\\! + \end{arabverse} + \end{specimen} +\end{alignment} +\end{minted} +% \iffalse +% +% \fi +% +% \begin{remarks} +% \item[\textsc{Rem.}] |\bayt+| has been applied twice, at +% lines~\lnref{ln:arb:poetry:plusone} +% and~\lnref{ln:arb:poetry:plustwo}. In the first instance +% (ll.~\lnref{ln:arb:poetry:plusone}--\lnref{ln:arb:poetry:plusone:e}), +% variant readings have been inserted in both hemistichs. As the +% hemistichs are technically enclosed in separate \TeX\ groups, +% \pkg{ekdosis} naturally recalls in the apparatus criticus the line +% number corresponding to the first entry of each one of the two +% groups. An easy way to get around this is to apply the |nonum| +% optional argument to the first \cs{lem} command used in the second +% hemistich, as has been done here on +% line~\lnref{ln:arb:poetry:nonum}. +% \end{remarks} +% +% PDF output:--- +% \medskip +% +% \begingroup +% \SetHooks{refnumstyle=\bfseries} +% \begin{alignment}[flush, tcols=1, texts=specimen, +% apparatus=specimen] +% \resetlinenumber\resetvlinenumber[26] +% \setlength{\vrightskip}{-0.75in} +% \begin{specimen} +% \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth] +% \bayt+{\app[type=rtl]{ +% \lem{ta^gAwaztu 'a.hrAsaN} +% \rdg{ta_ha.t.taytu 'abwAbaN} +% \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN} +% } 'ilay-hA wa-ma`^saraN}{`alayya +% .hirA.saN law \app[type=rtl]{ +% \lem[nonum]{yusirrUna} +% \rdg{yu^sirrUna} +% } maqtalI}\\ +% \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da +% 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\ +% \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A +% 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\ +% \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in +% 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\ +% \bayt+{_hara^gtu bi-hA \app[type=rtl]{ +% \lem{tam^sI} +% \rdg{'am^sI} +% } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA +% 'a_dyAla mir.tiN mura.h.hali}\\! +% \end{arabverse} +% \end{specimen} +% \end{alignment} +% \endgroup +% +% \texttt{TEI xml} output:--- +% \medskip +% +% \iffalse +%<*example> +% \fi +\begin{minted}[linenos=false]{xml} + + + + + ta^gAwaztu 'a.hrAsaN + ta_ha.t.taytu 'abwAbaN + ta_ha.t.taytu 'ahwAlaN + 'ilay-hA wa-ma`^saraN + `alayya .hirA.saN law + + yusirrUna + yu^sirrUna + maqtalI + + + 'i_dA mA 'l-_turayyA fI 'l-samA'i + ta`arra.dat + ta`arru.da 'a_tnA'i 'l-wi^sA.hi + 'l-mufa.s.sali + + + fa-^gi'tu wa-qad na.d.dat + li-nawmiN _tayAna-hA + lad_A 'l-sitri 'illA libsaTa + 'l-mutafa.d.dili + + + fa-qAlat yamInau 'l-l_ahi mA + la-ka .hIlaTuN + wa-mA 'in 'ar_A `an-ka + 'l-.gawAyaTa tan^galI + + + _hara^gtu bi-hA + + tam^sI + 'am^sI + ta^gurru wa-rA'a-nA + `al_A 'a_trinA 'a_dyAla mir.tiN + mura.h.hali + + +\end{minted} +% \iffalse +% +% \fi % % \section{Lineation Settings} % \label{sec:lineation} @@ -5496,8 +5693,7 @@ substantiall fewell,} % \end{alignment} % % \needspace{5\baselineskip} -% And here follows the PDF output with right-to-left apparatus -% criticus:--- +% The PDF output with right-to-left apparatus criticus follows:--- % \medskip % % \needspace{7\baselineskip} @@ -8027,7 +8223,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \paragraph{\textsf{ekdosis} Symbol} % \begin{macro}{\eKd} -% \changes{v1.5}{2023/04/22}{Prints \textsf{ekdosis} indentifying +% \changes{v1.5}{2023/05/21}{Prints \textsf{ekdosis} indentifying % symbol} As of v1.5, \pkg{ekdosis} has its own identifying % symbol. It is produced by \cs{eKd} and best printed with the Old % Standard Greek font. @@ -8290,7 +8486,7 @@ Sample text with a \textcolor{red}{word} in red. % \begin{macro}{\teidirectE} % \changes{v1.3}{2021/08/18}{direct insertion of elements in the % \texttt{TEI xml} file} -% \changes{v1.5}{2023/04/22}{direct insertion of empty elements in the +% \changes{v1.5}{2023/05/21}{direct insertion of empty elements in the % \texttt{TEI xml} file} % \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} % does nothing in \LaTeX. It is only used to insert elements in the @@ -8305,7 +8501,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macro} % \end{macro} % \begin{macro}{\getTEIxmlid} -% \changes{v1.5}{2023/04/22}{returns \texttt{TEI xml:ids} from a +% \changes{v1.5}{2023/05/21}{returns \texttt{TEI xml:ids} from a % csv-list of ids} This command returns from a csv-list of unique % identifiers declared in commands such as \cs{DeclareWitness} and the % like a space-separated list of their corresponding |xml:id|s, each @@ -8781,7 +8977,7 @@ Sample text with a \textcolor{red}{word} in red. \newlength{\ekd@app@localheight} % \end{macrocode} % \begin{macro}{\localappheight} -% \changes{v1.5}{2023/04/22}{changes the height of the apparatus +% \changes{v1.5}{2023/05/21}{changes the height of the apparatus % criticus} % \cs{localappheight}\marg{dimen} can be used to change locally the % length of \cs{ekd@app@height} set by the |appheight| option of @@ -8800,7 +8996,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\addtoappheight} -% \changes{v1.5}{2023/04/22}{increases or decreases the height of the +% \changes{v1.5}{2023/05/21}{increases or decreases the height of the % apparatus criticus} % As the name suggests, in contrast to \cs{localappheight}, % \cs{addtoappheight}\marg{dimen} is used to increase or decrease @@ -9086,7 +9282,7 @@ Sample text with a \textcolor{red}{word} in red. % The following commands are provided to set and control the maximum % number of lines printed on each page. % \begin{macro}{\setmaxlines} -% \changes{v1.5}{2023/04/22}{limits the number of lines per page} +% \changes{v1.5}{2023/05/21}{limits the number of lines per page} % \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer % $\geq 1$, can be used either in the preamble or at any point of the % document to set the maximum number of lines to be printed on each @@ -9097,7 +9293,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\localmaxlines} -% \changes{v1.5}{2023/04/22}{changes the maximum number of lines +% \changes{v1.5}{2023/05/21}{changes the maximum number of lines % locally} % Once a maximum number of lines per page has been set, % \cs{localmaxlines}\marg{n} can be used to adjust this number on a @@ -9110,7 +9306,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\addtomaxlines} -% \changes{v1.5}{2023/04/22}{adds or subtracts lines from a given page} +% \changes{v1.5}{2023/05/21}{adds or subtracts lines from a given page} % Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as % argument the number of lines one wishes to add or substract from the % number that has been set by \cs{setmaxlines}. As a result, \meta{n} @@ -9123,7 +9319,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\nomaxlines} -% \changes{v1.5}{2023/04/22}{unsets \cs{setmaxlines}} +% \changes{v1.5}{2023/05/21}{unsets \cs{setmaxlines}} % \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}. % \begin{macrocode} \def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}} @@ -9187,7 +9383,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macrocode} % \end{macro} % \begin{macro}{\App} -% \changes{v1.5}{2023/04/22}{To be used conjointly with +% \changes{v1.5}{2023/05/21}{To be used conjointly with % \texttt{ekdosis.el}} % In contrast to \cs{app}, \cs{App} takes two mandatory arguments and % accepts one optional argument like so: @@ -10071,7 +10267,7 @@ Sample text with a \textcolor{red}{word} in red. % \end{macro} % \paragraph{Lacunae} % \begin{macro}{\ilabel} -% \changes{v1.5}{2023/04/22}{recalls and sets the ending label of +% \changes{v1.5}{2023/05/21}{recalls and sets the ending label of % lemmas used to mark lacunae in witnesses} When \cs{lem} has been % used with the optional argument |ilabel=