From a7deb7f848332c3a9b808d21c7e7d0e144633e94 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
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(-)

(limited to 'ekdosis.dtx')

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>
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\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]
 %</package>
 %<*driver>
 \begin{filecontents}[noheader,overwrite]{bibdata.xml}
@@ -5088,6 +5088,203 @@ substantiall fewell,}
 % \iffalse
 %</example>
 % \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}[<options>]
+    \bayt{<ṣadr>}[<tadwīr>]{<ʿaǧuz>}\\ % no critical notes
+    [...]
+    \bayt+{Arabic \app{ % example of \bayt+ with critical notes
+        \lem{sample}
+        \rdg{example}
+      } text}{Arabic sample text}\\
+    [...]
+    \bayt{<ṣadr>}[<tadwīr>]{<ʿaǧuz>}\\! % last line (no critical notes)
+  \end{arabverse}
+\end{ekdosis}
+\end{minted}
+% \iffalse
+%</example>
+% \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
+%</example>
+% \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}
+<lg xml:lang="ar-Latn" type="transliterated"
+subtype="arabtex">
+  <l>
+    <seg type="hemistich">
+    <app>
+      <lem>ta^gAwaztu 'a.hrAsaN</lem>
+      <rdg>ta_ha.t.taytu 'abwAbaN</rdg>
+      <rdg>ta_ha.t.taytu 'ahwAlaN</rdg>
+    </app>'ilay-hA wa-ma`^saraN</seg>
+    <seg type="hemistich">`alayya .hirA.saN law 
+    <app>
+      <lem>yusirrUna</lem>
+      <rdg>yu^sirrUna</rdg>
+    </app>maqtalI</seg>
+  </l>
+  <l>
+    <seg type="hemistich">'i_dA mA 'l-_turayyA fI 'l-samA'i
+    ta`arra.dat</seg>
+    <seg type="hemistich">ta`arru.da 'a_tnA'i 'l-wi^sA.hi
+    'l-mufa.s.sali</seg>
+  </l>
+  <l>
+    <seg type="hemistich">fa-^gi'tu wa-qad na.d.dat
+    li-nawmiN _tayAna-hA</seg>
+    <seg type="hemistich">lad_A 'l-sitri 'illA libsaTa
+    'l-mutafa.d.dili</seg>
+  </l>
+  <l>
+    <seg type="hemistich">fa-qAlat yamInau 'l-l_ahi mA
+    la-ka .hIlaTuN</seg>
+    <seg type="hemistich">wa-mA 'in 'ar_A `an-ka
+    'l-.gawAyaTa tan^galI</seg>
+  </l>
+  <l>
+    <seg type="hemistich">_hara^gtu bi-hA 
+    <app>
+      <lem>tam^sI</lem>
+      <rdg>'am^sI</rdg>
+    </app>ta^gurru wa-rA'a-nA</seg>
+    <seg type="hemistich">`al_A 'a_trinA 'a_dyAla mir.tiN
+    mura.h.hali</seg>
+  </l>
+</lg>
+\end{minted}
+% \iffalse
+%</example>
+% \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=<label>|,
 % \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.
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\ekdEOprint}
-% \changes{v1.5}{2023/04/22}{Sets headers and footers on
+% \changes{v1.5}{2023/05/21}{Sets headers and footers on
 % \enquote{paired} facing pages}
 % To set headers and footers on \enquote{paired} facing pages,
 % \cs{ekdEOprint} accepts two mandatory, self-evident arguments, like
@@ -10427,7 +10623,7 @@ Sample text with a \textcolor{red}{word} in red.
 % counter to set the value of the page numbers. This counter should be
 % incremented every two pages.
 % \begin{counter}{pairedpage}
-% \changes{v1.5}{2023/04/22}{A counter incremented every two pages}
+% \changes{v1.5}{2023/05/21}{A counter incremented every two pages}
 % |pairedpage| is first set as a global counter:---
 %    \begin{macrocode}
 \newcounter{pairedpage}
@@ -10435,19 +10631,19 @@ Sample text with a \textcolor{red}{word} in red.
 %    \end{macrocode}
 % \end{counter}
 % \begin{macro}{\setpairedpagenum}
-%   \changes{v1.5}{2023/04/22}{sets the same page number on paired
+%   \changes{v1.5}{2023/05/21}{sets the same page number on paired
 %   pages} \cs{setpairedpagenum}\marg{number} is used just ahead of
 %   the alignment environment to set the number of the first left-hand
 %   paired page.
 % \begin{macro}{\setpairedpage}
-%   \changes{v1.5}{2023/04/22}{sets the page number of the first paired
+%   \changes{v1.5}{2023/05/21}{sets the page number of the first paired
 %   page} \cs{setpairedpage} is an argument-less command meant to be
 %   issued in commands used to set headers or footers before
 %   \cs{thepage}. This command has the counter |pairedpage|
 %   incremented on right-hand pages only, and sets |page| $\leftarrow$
 %   |pairedpage| on every page.
 % \begin{macro}{\resetpagenumber}
-%   \changes{v1.5}{2023/04/22}{resets normal running page numbers}
+%   \changes{v1.5}{2023/05/21}{resets normal running page numbers}
 %   \cs{resetpagenumber} must be used right out of \enquote{mirrored}
 %   paired pages alignment environments. This argument-less command
 %   corrects any numbering error on the page following the edition
@@ -10637,6 +10833,9 @@ Sample text with a \textcolor{red}{word} in red.
 % \env{ekdverse} is defined:---
 %    \begin{macrocode}
 \if@pkg@poetry@verse
+%    \end{macrocode}
+% This patch allows for |maxlines| to be used in verse environments:
+%    \begin{macrocode}
 \AddToHook{cmd/@vscentercr/before}{%
   \ifdefined\maxlines@value
     \stepcounter{ekd@lnperpage}%
@@ -10660,10 +10859,10 @@ Sample text with a \textcolor{red}{word} in red.
   code type = \def\type@value{#1},
 }
 \ifekd@memoir@loaded
-  \def\vlvnumfont{\normalfont\footnotesize}
+  \def\vlvnumfont{\textdir TLT\normalfont\footnotesize}
   \def\verselinenumfont#1{\def\vlvnumfont{#1}}
 \else
-  \verselinenumfont{\normalfont\footnotesize}
+  \verselinenumfont{\textdir TLT\normalfont\footnotesize}
 \fi
 \setcounter{poemline}{1}
 \NewDocumentEnvironment{ekdverse}{!O{}}{%
@@ -10680,22 +10879,23 @@ Sample text with a \textcolor{red}{word} in red.
   \setcounter{vslineno}{1}%
   \let\\=\@vscentercr
   \list{}{\itemsep \z@
-          \itemindent  -\vindent%
-          \listparindent\itemindent
-          \parsep       \stanzaskip
-          \setlength{\itemsep}{0pt}%
-          \setlength{\topsep}{0pt}%
-          \setlength{\partopsep}{0pt}%
-          \ifdim\vwidth@val < \linewidth
-            \rightmargin        \z@
-            \setlength{\leftmargin}{\linewidth}%
-            \addtolength{\leftmargin}{-\vwidth@val}%
-            \addtolength{\leftmargin}{-0.5\leftmargin}%
-          \else
-            \rightmargin        \leftmargin
-          \fi
-          \addtolength{\leftmargin}{\vindent}}%
-  \item[]\ifekd@pagevlineation\test@vpnum\fi%
+    \itemindent  -\vindent%
+    \listparindent\itemindent
+    \parsep       \stanzaskip
+    \setlength{\itemsep}{0pt}%
+    \setlength{\topsep}{0pt}%
+    \setlength{\partopsep}{0pt}%
+    \ifdim\vwidth@val < \linewidth
+      \rightmargin        \z@
+      \setlength{\leftmargin}{\linewidth}%
+      \addtolength{\leftmargin}{-\vwidth@val}%
+      \addtolength{\leftmargin}{-0.5\leftmargin}%
+    \else
+      \rightmargin        \leftmargin
+    \fi
+    \addtolength{\leftmargin}{\vindent}%
+  }%
+\item[]\ifekd@pagevlineation\test@vpnum\fi%
 }
 {\endlist
   \if@continuous@vnum\resetlinenumber[\thepoemline]\fi}
@@ -11249,6 +11449,10 @@ local texpatttotags = {
    {a="\\mbox%s+(%b{})", b="ekd@ob%1ekd@cb"},
    {a="\\App%s+(%b[])(%b{})(%b{})", b="\\app[ekd@os%1ekd@cs]{ekd@ob%2ekd@cbekd@ob%3ekd@cb}"},
    {a="\\App%s+(%b{})(%b{})", b="\\app{ekd@ob%1ekd@cbekd@ob%2ekd@cb}"},
+   {a="\\bayt%s+%+?%*?(%b{})(%b[])(%b{})",
+    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>"},
+   {a="\\bayt%s+%+?%*?(%b{})(%b{})",
+    b="<l><seg type=\"hemistich\">ekd@ob%1ekd@cb</seg><seg type=\"hemistich\">ekd@ob%2ekd@cb</seg></l>"},
    {a="\\LR%s+(%b{})", b="ekd@ob%1ekd@cb"},
    {a="\\RL%s+(%b{})", b="ekd@ob%1ekd@cb"},
    {a="\\%=%=%=%s?", b="—"},
@@ -11553,6 +11757,22 @@ end
 
 -- better use lpeg: look into this later
 local function versetotei(str)
+   str = string.gsub(str, "\\begin%s?%{arabverse%}(%b[])(.-)\\end%s?%{arabverse%}", function(opt, arg)
+			arg = string.gsub(arg, "\\par%s?", "")
+			arg = gsub(arg, poemline, "")
+			opt = string.sub(opt, 2, -2)
+			if string.find(opt, "utf")
+			then
+			   return "\\p@rb "..string.format("<lg>%s</lg>", arg).."\\p@ra "
+			else
+			   return "\\p@rb "..string.format("<lg xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\">%s</lg>", arg).."\\p@ra "
+			end
+   end)
+   str = string.gsub(str, "\\begin%s?%{arabverse%}(.-)\\end%s?%{arabverse%}", function(arg)
+			arg = string.gsub(arg, "\\par%s?", "")
+			arg = gsub(arg, poemline, "")
+			return "\\p@rb "..string.format("<lg xml:lang=\"ar-Latn\" type=\"transliterated\" subtype=\"arabtex\">%s</lg>", arg).."\\p@ra "
+   end)
    str = string.gsub(str, "\\begin%s?%{ekdverse%}(%b[])(.-)\\end%s?%{ekdverse%}", function(opt, arg)
 			arg = string.gsub(arg, "\\par%s?", "")
 			arg = string.gsub(arg, "\\begin%s?%{patverse%*?%}", "")
-- 
cgit v1.2.3

