aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2023-05-21 11:44:53 +0200
committerRobert Alessi <alessi@robertalessi.net>2023-05-21 11:44:53 +0200
commita7deb7f848332c3a9b808d21c7e7d0e144633e94 (patch)
treea94dc7a6f008c387f73a5845899f8db4ea351604
parentd398899e48b426b3f130a6fd3368b4cc2faa3dd8 (diff)
downloadekdosis-a7deb7f.tar.gz
added support for Arabic poetry with the arabluatex package
-rw-r--r--ekdosis.dtx294
1 files 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 <alessi@robertalessi.net>
59%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 59%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
60%<package>\ProvidesPackage{ekdosis} 60%<package>\ProvidesPackage{ekdosis}
61%<*package> 61%<*package>
62 [2023/04/22 v1.5-dev Typesetting TEI xml-compliant critical editions] 62 [2023/05/21 v1.5-dev Typesetting TEI xml-compliant critical editions]
63%</package> 63%</package>
64%<*driver> 64%<*driver>
65\begin{filecontents}[noheader,overwrite]{bibdata.xml} 65\begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -5088,6 +5088,203 @@ substantiall fewell,}
5088% \iffalse 5088% \iffalse
5089%</example> 5089%</example>
5090% \fi 5090% \fi
5091%
5092% \subsection{Arabic Poetry}
5093% \label{sec:arabic-poetry}
5094% \newfeature[1.5] A short introduction to editing Arabic texts with
5095% \pkg{ekdosis} and \pkg{arabluatex} is provided below,
5096% \vnref{sec:using-arabluatex}. With regard to the technique of
5097% typesetting Arabic poetry, the reader is invited to refer to the
5098% relevant section of the documentation of
5099% \pkg{arabluatex}.\footcite[\nopp see \enquote{Arabic
5100% Poetry}]{arabluatex}
5101%
5102% \danger \pkg{ekdosis} \emph{must be loaded} with the |poetry=verse|
5103% option as described \vpageref{ref:poetry-opt}. Then, the |arabverse|
5104% environment is to be used instead of |ekdverse| to typeset the lines
5105% of Arabic poetry.
5106%
5107% \DescribeMacro{\bayt+}
5108% As of v1.21 of \pkg{arabluatex}, the
5109% \cs{bayt}\marg{\arb[trans]{.sadr}}\oarg{\arb[trans]{tadwIr}}%^^A
5110% \marg{\arb[trans]{`a^guz}}
5111% command it provides accepts a |+| optional argument that is to be
5112% used to let critical notes be inserted in lines of poetry, like
5113% so:---
5114%
5115% \iffalse
5116%<*example>
5117% \fi
5118\begin{minted}[linenos=false]{latex}
5119% Preamble:
5120\usepackage[poetry=verse]{ekdosis}
5121
5122% Document:
5123\begin{ekdosis}
5124 \begin{arabverse}[<options>]
5125 \bayt{<ṣadr>}[<tadwīr>]{<ʿaǧuz>}\\ % no critical notes
5126 [...]
5127 \bayt+{Arabic \app{ % example of \bayt+ with critical notes
5128 \lem{sample}
5129 \rdg{example}
5130 } text}{Arabic sample text}\\
5131 [...]
5132 \bayt{<ṣadr>}[<tadwīr>]{<ʿaǧuz>}\\! % last line (no critical notes)
5133 \end{arabverse}
5134\end{ekdosis}
5135\end{minted}
5136% \iffalse
5137%</example>
5138% \fi
5139%
5140% An example of how one could insert variant readings in \prname{imru'
5141% al-qays}' \arb[trans]{\uc{mu`allaqaT}} (ll.~26--30) follows:---
5142%
5143% \captof{Poetry: \prname{imru' al-qays}'
5144% \arb[trans]{\uc{m}u`allaqaT}}[\label{lst:al-qays-muallaqah}]
5145% \iffalse
5146%<*example>
5147% \fi
5148\begin{minted}[escapeinside=||]{latex}
5149\begin{alignment}[tcols=1,
5150 texts=specimen,
5151 apparatus=specimen]
5152 \resetlinenumber\resetvlinenumber[26]
5153 \begin{specimen}
5154 \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth]
5155 \bayt+{\app{|\label{ln:arb:poetry:plusone}|
5156 \lem{ta^gAwaztu 'a.hrAsaN}
5157 \rdg{ta_ha.t.taytu 'abwAbaN}
5158 \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN}
5159 } 'ilay-hA wa-ma`^saraN}{`alayya
5160 .hirA.saN law \app{
5161 \lem[nonum]{yusirrUna}|\label{ln:arb:poetry:nonum}|
5162 \rdg{yu^sirrUna}
5163 } maqtalI}\\|\label{ln:arb:poetry:plusone:e}|
5164 \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da
5165 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\
5166 \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A
5167 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\
5168 \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in
5169 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\
5170 \bayt+{_hara^gtu bi-hA \app{|\label{ln:arb:poetry:plustwo}|
5171 \lem{tam^sI}
5172 \rdg{'am^sI}
5173 } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA
5174 'a_dyAla mir.tiN mura.h.hali}\\!
5175 \end{arabverse}
5176 \end{specimen}
5177\end{alignment}
5178\end{minted}
5179% \iffalse
5180%</example>
5181% \fi
5182%
5183% \begin{remarks}
5184% \item[\textsc{Rem.}] |\bayt+| has been applied twice, at
5185% lines~\lnref{ln:arb:poetry:plusone}
5186% and~\lnref{ln:arb:poetry:plustwo}. In the first instance
5187% (ll.~\lnref{ln:arb:poetry:plusone}--\lnref{ln:arb:poetry:plusone:e}),
5188% variant readings have been inserted in both hemistichs. As the
5189% hemistichs are technically enclosed in separate \TeX\ groups,
5190% \pkg{ekdosis} naturally recalls in the apparatus criticus the line
5191% number corresponding to the first entry of each one of the two
5192% groups. An easy way to get around this is to apply the |nonum|
5193% optional argument to the first \cs{lem} command used in the second
5194% hemistich, as has been done here on
5195% line~\lnref{ln:arb:poetry:nonum}.
5196% \end{remarks}
5197%
5198% PDF output:---
5199% \medskip
5200%
5201% \begingroup
5202% \SetHooks{refnumstyle=\bfseries}
5203% \begin{alignment}[flush, tcols=1, texts=specimen,
5204% apparatus=specimen]
5205% \resetlinenumber\resetvlinenumber[26]
5206% \setlength{\vrightskip}{-0.75in}
5207% \begin{specimen}
5208% \begin{arabverse}[mode=fullvoc, width=0.25\columnwidth]
5209% \bayt+{\app[type=rtl]{
5210% \lem{ta^gAwaztu 'a.hrAsaN}
5211% \rdg{ta_ha.t.taytu 'abwAbaN}
5212% \rdg[subsep={:~}]{ta_ha.t.taytu 'ahwAlaN}
5213% } 'ilay-hA wa-ma`^saraN}{`alayya
5214% .hirA.saN law \app[type=rtl]{
5215% \lem[nonum]{yusirrUna}
5216% \rdg{yu^sirrUna}
5217% } maqtalI}\\
5218% \bayt{'i_dA mA 'l-_turayyA fI 'l-samA'i ta`arra.dat}{ta`arru.da
5219% 'a_tnA'i 'l-wi^sA.hi 'l-mufa.s.sali}\\
5220% \bayt{fa-^gi'tu wa-qad na.d.dat li-nawmiN _tayAna-hA}{lad_A
5221% 'l-sitri 'illA libsaTa 'l-mutafa.d.dili}\\
5222% \bayt{fa-qAlat yamInau 'l-l_ahi mA la-ka .hIlaTuN}{wa-mA 'in
5223% 'ar_A `an-ka 'l-.gawAyaTa tan^galI}\\
5224% \bayt+{_hara^gtu bi-hA \app[type=rtl]{
5225% \lem{tam^sI}
5226% \rdg{'am^sI}
5227% } ta^gurru wa-rA'a-nA}{`al_A 'a_trinA
5228% 'a_dyAla mir.tiN mura.h.hali}\\!
5229% \end{arabverse}
5230% \end{specimen}
5231% \end{alignment}
5232% \endgroup
5233%
5234% \texttt{TEI xml} output:---
5235% \medskip
5236%
5237% \iffalse
5238%<*example>
5239% \fi
5240\begin{minted}[linenos=false]{xml}
5241<lg xml:lang="ar-Latn" type="transliterated"
5242subtype="arabtex">
5243 <l>
5244 <seg type="hemistich">
5245 <app>
5246 <lem>ta^gAwaztu 'a.hrAsaN</lem>
5247 <rdg>ta_ha.t.taytu 'abwAbaN</rdg>
5248 <rdg>ta_ha.t.taytu 'ahwAlaN</rdg>
5249 </app>'ilay-hA wa-ma`^saraN</seg>
5250 <seg type="hemistich">`alayya .hirA.saN law
5251 <app>
5252 <lem>yusirrUna</lem>
5253 <rdg>yu^sirrUna</rdg>
5254 </app>maqtalI</seg>
5255 </l>
5256 <l>
5257 <seg type="hemistich">'i_dA mA 'l-_turayyA fI 'l-samA'i
5258 ta`arra.dat</seg>
5259 <seg type="hemistich">ta`arru.da 'a_tnA'i 'l-wi^sA.hi
5260 'l-mufa.s.sali</seg>
5261 </l>
5262 <l>
5263 <seg type="hemistich">fa-^gi'tu wa-qad na.d.dat
5264 li-nawmiN _tayAna-hA</seg>
5265 <seg type="hemistich">lad_A 'l-sitri 'illA libsaTa
5266 'l-mutafa.d.dili</seg>
5267 </l>
5268 <l>
5269 <seg type="hemistich">fa-qAlat yamInau 'l-l_ahi mA
5270 la-ka .hIlaTuN</seg>
5271 <seg type="hemistich">wa-mA 'in 'ar_A `an-ka
5272 'l-.gawAyaTa tan^galI</seg>
5273 </l>
5274 <l>
5275 <seg type="hemistich">_hara^gtu bi-hA
5276 <app>
5277 <lem>tam^sI</lem>
5278 <rdg>'am^sI</rdg>
5279 </app>ta^gurru wa-rA'a-nA</seg>
5280 <seg type="hemistich">`al_A 'a_trinA 'a_dyAla mir.tiN
5281 mura.h.hali</seg>
5282 </l>
5283</lg>
5284\end{minted}
5285% \iffalse
5286%</example>
5287% \fi
5091% 5288%
5092% \section{Lineation Settings} 5289% \section{Lineation Settings}
5093% \label{sec:lineation} 5290% \label{sec:lineation}
@@ -5496,8 +5693,7 @@ substantiall fewell,}
5496% \end{alignment} 5693% \end{alignment}
5497% 5694%
5498% \needspace{5\baselineskip} 5695% \needspace{5\baselineskip}
5499% And here follows the PDF output with right-to-left apparatus 5696% The PDF output with right-to-left apparatus criticus follows:---
5500% criticus:---
5501% \medskip 5697% \medskip
5502% 5698%
5503% \needspace{7\baselineskip} 5699% \needspace{7\baselineskip}
@@ -8027,7 +8223,7 @@ Sample text with a \textcolor{red}{word} in red.
8027% \end{macrocode} 8223% \end{macrocode}
8028% \paragraph{\textsf{ekdosis} Symbol} 8224% \paragraph{\textsf{ekdosis} Symbol}
8029% \begin{macro}{\eKd} 8225% \begin{macro}{\eKd}
8030% \changes{v1.5}{2023/04/22}{Prints \textsf{ekdosis} indentifying 8226% \changes{v1.5}{2023/05/21}{Prints \textsf{ekdosis} indentifying
8031% symbol} As of v1.5, \pkg{ekdosis} has its own identifying 8227% symbol} As of v1.5, \pkg{ekdosis} has its own identifying
8032% symbol. It is produced by \cs{eKd} and best printed with the Old 8228% symbol. It is produced by \cs{eKd} and best printed with the Old
8033% Standard Greek font. 8229% Standard Greek font.
@@ -8290,7 +8486,7 @@ Sample text with a \textcolor{red}{word} in red.
8290% \begin{macro}{\teidirectE} 8486% \begin{macro}{\teidirectE}
8291% \changes{v1.3}{2021/08/18}{direct insertion of elements in the 8487% \changes{v1.3}{2021/08/18}{direct insertion of elements in the
8292% \texttt{TEI xml} file} 8488% \texttt{TEI xml} file}
8293% \changes{v1.5}{2023/04/22}{direct insertion of empty elements in the 8489% \changes{v1.5}{2023/05/21}{direct insertion of empty elements in the
8294% \texttt{TEI xml} file} 8490% \texttt{TEI xml} file}
8295% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code} 8491% \cs{teidirect}\oarg{xml attributes}\marg{xml element}\marg{code}
8296% does nothing in \LaTeX. It is only used to insert elements in the 8492% 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.
8305% \end{macro} 8501% \end{macro}
8306% \end{macro} 8502% \end{macro}
8307% \begin{macro}{\getTEIxmlid} 8503% \begin{macro}{\getTEIxmlid}
8308% \changes{v1.5}{2023/04/22}{returns \texttt{TEI xml:ids} from a 8504% \changes{v1.5}{2023/05/21}{returns \texttt{TEI xml:ids} from a
8309% csv-list of ids} This command returns from a csv-list of unique 8505% csv-list of ids} This command returns from a csv-list of unique
8310% identifiers declared in commands such as \cs{DeclareWitness} and the 8506% identifiers declared in commands such as \cs{DeclareWitness} and the
8311% like a space-separated list of their corresponding |xml:id|s, each 8507% 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.
8781\newlength{\ekd@app@localheight} 8977\newlength{\ekd@app@localheight}
8782% \end{macrocode} 8978% \end{macrocode}
8783% \begin{macro}{\localappheight} 8979% \begin{macro}{\localappheight}
8784% \changes{v1.5}{2023/04/22}{changes the height of the apparatus 8980% \changes{v1.5}{2023/05/21}{changes the height of the apparatus
8785% criticus} 8981% criticus}
8786% \cs{localappheight}\marg{dimen} can be used to change locally the 8982% \cs{localappheight}\marg{dimen} can be used to change locally the
8787% length of \cs{ekd@app@height} set by the |appheight| option of 8983% 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.
8800% \end{macrocode} 8996% \end{macrocode}
8801% \end{macro} 8997% \end{macro}
8802% \begin{macro}{\addtoappheight} 8998% \begin{macro}{\addtoappheight}
8803% \changes{v1.5}{2023/04/22}{increases or decreases the height of the 8999% \changes{v1.5}{2023/05/21}{increases or decreases the height of the
8804% apparatus criticus} 9000% apparatus criticus}
8805% As the name suggests, in contrast to \cs{localappheight}, 9001% As the name suggests, in contrast to \cs{localappheight},
8806% \cs{addtoappheight}\marg{dimen} is used to increase or decrease 9002% \cs{addtoappheight}\marg{dimen} is used to increase or decrease
@@ -9086,7 +9282,7 @@ Sample text with a \textcolor{red}{word} in red.
9086% The following commands are provided to set and control the maximum 9282% The following commands are provided to set and control the maximum
9087% number of lines printed on each page. 9283% number of lines printed on each page.
9088% \begin{macro}{\setmaxlines} 9284% \begin{macro}{\setmaxlines}
9089% \changes{v1.5}{2023/04/22}{limits the number of lines per page} 9285% \changes{v1.5}{2023/05/21}{limits the number of lines per page}
9090% \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer 9286% \cs{setmaxlines}\marg{n}, where \meta{n} is a positive integer
9091% $\geq 1$, can be used either in the preamble or at any point of the 9287% $\geq 1$, can be used either in the preamble or at any point of the
9092% document to set the maximum number of lines to be printed on each 9288% 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.
9097% \end{macrocode} 9293% \end{macrocode}
9098% \end{macro} 9294% \end{macro}
9099% \begin{macro}{\localmaxlines} 9295% \begin{macro}{\localmaxlines}
9100% \changes{v1.5}{2023/04/22}{changes the maximum number of lines 9296% \changes{v1.5}{2023/05/21}{changes the maximum number of lines
9101% locally} 9297% locally}
9102% Once a maximum number of lines per page has been set, 9298% Once a maximum number of lines per page has been set,
9103% \cs{localmaxlines}\marg{n} can be used to adjust this number on a 9299% \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.
9110% \end{macrocode} 9306% \end{macrocode}
9111% \end{macro} 9307% \end{macro}
9112% \begin{macro}{\addtomaxlines} 9308% \begin{macro}{\addtomaxlines}
9113% \changes{v1.5}{2023/04/22}{adds or subtracts lines from a given page} 9309% \changes{v1.5}{2023/05/21}{adds or subtracts lines from a given page}
9114% Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as 9310% Unlike \cs{localmaxlines}, \cs{addtomaxlines}\meta{n} takes as
9115% argument the number of lines one wishes to add or substract from the 9311% argument the number of lines one wishes to add or substract from the
9116% number that has been set by \cs{setmaxlines}. As a result, \meta{n} 9312% 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.
9123% \end{macrocode} 9319% \end{macrocode}
9124% \end{macro} 9320% \end{macro}
9125% \begin{macro}{\nomaxlines} 9321% \begin{macro}{\nomaxlines}
9126% \changes{v1.5}{2023/04/22}{unsets \cs{setmaxlines}} 9322% \changes{v1.5}{2023/05/21}{unsets \cs{setmaxlines}}
9127% \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}. 9323% \cs{nomaxlines} unsets any limit previously set by \cs{setmaxlines}.
9128% \begin{macrocode} 9324% \begin{macrocode}
9129\def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}} 9325\def\nomaxlines{\luadirect{tex.sprint(ekdosis.resetlocalmaxlines())}}
@@ -9187,7 +9383,7 @@ Sample text with a \textcolor{red}{word} in red.
9187% \end{macrocode} 9383% \end{macrocode}
9188% \end{macro} 9384% \end{macro}
9189% \begin{macro}{\App} 9385% \begin{macro}{\App}
9190% \changes{v1.5}{2023/04/22}{To be used conjointly with 9386% \changes{v1.5}{2023/05/21}{To be used conjointly with
9191% \texttt{ekdosis.el}} 9387% \texttt{ekdosis.el}}
9192% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and 9388% In contrast to \cs{app}, \cs{App} takes two mandatory arguments and
9193% accepts one optional argument like so: 9389% accepts one optional argument like so:
@@ -10071,7 +10267,7 @@ Sample text with a \textcolor{red}{word} in red.
10071% \end{macro} 10267% \end{macro}
10072% \paragraph{Lacunae} 10268% \paragraph{Lacunae}
10073% \begin{macro}{\ilabel} 10269% \begin{macro}{\ilabel}
10074% \changes{v1.5}{2023/04/22}{recalls and sets the ending label of 10270% \changes{v1.5}{2023/05/21}{recalls and sets the ending label of
10075% lemmas used to mark lacunae in witnesses} When \cs{lem} has been 10271% lemmas used to mark lacunae in witnesses} When \cs{lem} has been
10076% used with the optional argument |ilabel=<label>|, 10272% used with the optional argument |ilabel=<label>|,
10077% \cs{ilabel}\marg{label} must be used to mark the point where the 10273% \cs{ilabel}\marg{label} must be used to mark the point where the
@@ -10387,7 +10583,7 @@ Sample text with a \textcolor{red}{word} in red.
10387% \end{macrocode} 10583% \end{macrocode}
10388% \end{macro} 10584% \end{macro}
10389% \begin{macro}{\ekdEOprint} 10585% \begin{macro}{\ekdEOprint}
10390% \changes{v1.5}{2023/04/22}{Sets headers and footers on 10586% \changes{v1.5}{2023/05/21}{Sets headers and footers on
10391% \enquote{paired} facing pages} 10587% \enquote{paired} facing pages}
10392% To set headers and footers on \enquote{paired} facing pages, 10588% To set headers and footers on \enquote{paired} facing pages,
10393% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like 10589% \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like
@@ -10427,7 +10623,7 @@ Sample text with a \textcolor{red}{word} in red.
10427% counter to set the value of the page numbers. This counter should be 10623% counter to set the value of the page numbers. This counter should be
10428% incremented every two pages. 10624% incremented every two pages.
10429% \begin{counter}{pairedpage} 10625% \begin{counter}{pairedpage}
10430% \changes{v1.5}{2023/04/22}{A counter incremented every two pages} 10626% \changes{v1.5}{2023/05/21}{A counter incremented every two pages}
10431% |pairedpage| is first set as a global counter:--- 10627% |pairedpage| is first set as a global counter:---
10432% \begin{macrocode} 10628% \begin{macrocode}
10433\newcounter{pairedpage} 10629\newcounter{pairedpage}
@@ -10435,19 +10631,19 @@ Sample text with a \textcolor{red}{word} in red.
10435% \end{macrocode} 10631% \end{macrocode}
10436% \end{counter} 10632% \end{counter}
10437% \begin{macro}{\setpairedpagenum} 10633% \begin{macro}{\setpairedpagenum}
10438% \changes{v1.5}{2023/04/22}{sets the same page number on paired 10634% \changes{v1.5}{2023/05/21}{sets the same page number on paired
10439% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of 10635% pages} \cs{setpairedpagenum}\marg{number} is used just ahead of
10440% the alignment environment to set the number of the first left-hand 10636% the alignment environment to set the number of the first left-hand
10441% paired page. 10637% paired page.
10442% \begin{macro}{\setpairedpage} 10638% \begin{macro}{\setpairedpage}
10443% \changes{v1.5}{2023/04/22}{sets the page number of the first paired 10639% \changes{v1.5}{2023/05/21}{sets the page number of the first paired
10444% page} \cs{setpairedpage} is an argument-less command meant to be 10640% page} \cs{setpairedpage} is an argument-less command meant to be
10445% issued in commands used to set headers or footers before 10641% issued in commands used to set headers or footers before
10446% \cs{thepage}. This command has the counter |pairedpage| 10642% \cs{thepage}. This command has the counter |pairedpage|
10447% incremented on right-hand pages only, and sets |page| $\leftarrow$ 10643% incremented on right-hand pages only, and sets |page| $\leftarrow$
10448% |pairedpage| on every page. 10644% |pairedpage| on every page.
10449% \begin{macro}{\resetpagenumber} 10645% \begin{macro}{\resetpagenumber}
10450% \changes{v1.5}{2023/04/22}{resets normal running page numbers} 10646% \changes{v1.5}{2023/05/21}{resets normal running page numbers}
10451% \cs{resetpagenumber} must be used right out of \enquote{mirrored} 10647% \cs{resetpagenumber} must be used right out of \enquote{mirrored}
10452% paired pages alignment environments. This argument-less command 10648% paired pages alignment environments. This argument-less command
10453% corrects any numbering error on the page following the edition 10649% corrects any numbering error on the page following the edition
@@ -10637,6 +10833,9 @@ Sample text with a \textcolor{red}{word} in red.
10637% \env{ekdverse} is defined:--- 10833% \env{ekdverse} is defined:---
10638% \begin{macrocode} 10834% \begin{macrocode}
10639\if@pkg@poetry@verse 10835\if@pkg@poetry@verse
10836% \end{macrocode}
10837% This patch allows for |maxlines| to be used in verse environments:
10838% \begin{macrocode}
10640\AddToHook{cmd/@vscentercr/before}{% 10839\AddToHook{cmd/@vscentercr/before}{%
10641 \ifdefined\maxlines@value 10840 \ifdefined\maxlines@value
10642 \stepcounter{ekd@lnperpage}% 10841 \stepcounter{ekd@lnperpage}%
@@ -10660,10 +10859,10 @@ Sample text with a \textcolor{red}{word} in red.
10660 code type = \def\type@value{#1}, 10859 code type = \def\type@value{#1},
10661} 10860}
10662\ifekd@memoir@loaded 10861\ifekd@memoir@loaded
10663 \def\vlvnumfont{\normalfont\footnotesize} 10862 \def\vlvnumfont{\textdir TLT\normalfont\footnotesize}
10664 \def\verselinenumfont#1{\def\vlvnumfont{#1}} 10863 \def\verselinenumfont#1{\def\vlvnumfont{#1}}
10665\else 10864\else
10666 \verselinenumfont{\normalfont\footnotesize} 10865 \verselinenumfont{\textdir TLT\normalfont\footnotesize}
10667\fi 10866\fi
10668\setcounter{poemline}{1} 10867\setcounter{poemline}{1}
10669\NewDocumentEnvironment{ekdverse}{!O{}}{% 10868\NewDocumentEnvironment{ekdverse}{!O{}}{%
@@ -10680,22 +10879,23 @@ Sample text with a \textcolor{red}{word} in red.
10680 \setcounter{vslineno}{1}% 10879 \setcounter{vslineno}{1}%
10681 \let\\=\@vscentercr 10880 \let\\=\@vscentercr
10682 \list{}{\itemsep \z@ 10881 \list{}{\itemsep \z@
10683 \itemindent -\vindent% 10882 \itemindent -\vindent%
10684 \listparindent\itemindent 10883 \listparindent\itemindent
10685 \parsep \stanzaskip 10884 \parsep \stanzaskip
10686 \setlength{\itemsep}{0pt}% 10885 \setlength{\itemsep}{0pt}%
10687 \setlength{\topsep}{0pt}% 10886 \setlength{\topsep}{0pt}%
10688 \setlength{\partopsep}{0pt}% 10887 \setlength{\partopsep}{0pt}%
10689 \ifdim\vwidth@val < \linewidth 10888 \ifdim\vwidth@val < \linewidth
10690 \rightmargin \z@ 10889 \rightmargin \z@
10691 \setlength{\leftmargin}{\linewidth}% 10890 \setlength{\leftmargin}{\linewidth}%
10692 \addtolength{\leftmargin}{-\vwidth@val}% 10891 \addtolength{\leftmargin}{-\vwidth@val}%
10693 \addtolength{\leftmargin}{-0.5\leftmargin}% 10892 \addtolength{\leftmargin}{-0.5\leftmargin}%
10694 \else 10893 \else
10695 \rightmargin \leftmargin 10894 \rightmargin \leftmargin
10696 \fi 10895 \fi
10697 \addtolength{\leftmargin}{\vindent}}% 10896 \addtolength{\leftmargin}{\vindent}%
10698 \item[]\ifekd@pagevlineation\test@vpnum\fi% 10897 }%
10898\item[]\ifekd@pagevlineation\test@vpnum\fi%
10699} 10899}
10700{\endlist 10900{\endlist
10701 \if@continuous@vnum\resetlinenumber[\thepoemline]\fi} 10901 \if@continuous@vnum\resetlinenumber[\thepoemline]\fi}
@@ -11249,6 +11449,10 @@ local texpatttotags = {
11249 {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11449 {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"},
11250 {a="\\App%s+(%b[])(%b{})(%b{})", b="\\app[ekd@os%1ekd@cs]{ekd@ob%2ekd@cbekd@ob%3ekd@cb}"}, 11450 {a="\\App%s+(%b[])(%b{})(%b{})", b="\\app[ekd@os%1ekd@cs]{ekd@ob%2ekd@cbekd@ob%3ekd@cb}"},
11251 {a="\\App%s+(%b{})(%b{})", b="\\app{ekd@ob%1ekd@cbekd@ob%2ekd@cb}"}, 11451 {a="\\App%s+(%b{})(%b{})", b="\\app{ekd@ob%1ekd@cbekd@ob%2ekd@cb}"},
11452 {a="\\bayt%s+%+?%*?(%b{})(%b[])(%b{})",
11453 b="<l><seg type=\"hemistich\">ekd@ob%1ekd@cb</seg><seg type=\"tadwir\">ekd@os%2ekd@cs</seg><seg type=\"hemistich\">ekd@ob%3ekd@cb</seg></l>"},
11454 {a="\\bayt%s+%+?%*?(%b{})(%b{})",
11455 b="<l><seg type=\"hemistich\">ekd@ob%1ekd@cb</seg><seg type=\"hemistich\">ekd@ob%2ekd@cb</seg></l>"},
11252 {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11456 {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"},
11253 {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"}, 11457 {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"},
11254 {a="\\%=%=%=%s?", b="—"}, 11458 {a="\\%=%=%=%s?", b="—"},
@@ -11553,6 +11757,22 @@ end
11553 11757
11554-- better use lpeg: look into this later 11758-- better use lpeg: look into this later
11555local function versetotei(str) 11759local function versetotei(str)
11760 str = string.gsub(str, "\\begin%s?%{arabverse%}(%b[])(.-)\\end%s?%{arabverse%}", function(opt, arg)
11761 arg = string.gsub(arg, "\\par%s?", "")
11762 arg = gsub(arg, poemline, "")
11763 opt = string.sub(opt, 2, -2)
11764 if string.find(opt, "utf")
11765 then
11766 return "\\p@rb "..string.format("<lg>%s</lg>", arg).."\\p@ra "
11767 else
11768 return "\\p@rb "..string.format("<lg xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\">%s</lg>", arg).."\\p@ra "
11769 end
11770 end)
11771 str = string.gsub(str, "\\begin%s?%{arabverse%}(.-)\\end%s?%{arabverse%}", function(arg)
11772 arg = string.gsub(arg, "\\par%s?", "")
11773 arg = gsub(arg, poemline, "")
11774 return "\\p@rb "..string.format("<lg xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\">%s</lg>", arg).."\\p@ra "
11775 end)
11556 str = string.gsub(str, "\\begin%s?%{ekdverse%}(%b[])(.-)\\end%s?%{ekdverse%}", function(opt, arg) 11776 str = string.gsub(str, "\\begin%s?%{ekdverse%}(%b[])(.-)\\end%s?%{ekdverse%}", function(opt, arg)
11557 arg = string.gsub(arg, "\\par%s?", "") 11777 arg = string.gsub(arg, "\\par%s?", "")
11558 arg = string.gsub(arg, "\\begin%s?%{patverse%*?%}", "") 11778 arg = string.gsub(arg, "\\begin%s?%{patverse%*?%}", "")