From e82ab073e2d0b9a8e00142895e2e0fca120d4041 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Tue, 6 Dec 2016 10:23:54 +0100
Subject: intermediate commit: added punctuation characters in trigraphs rules
 (all modes) before al-; first implementation of Arabic verse environment

---
 arabluatex.dtx | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index 5788d62..c13d563 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -1514,8 +1514,8 @@ vowels (see §~3).
 % \begin{quote}
 %   |wa-"ust"u`mila| \arb[novoc]{wa-"ust"u`mila}
 %   \arb[trans]{wa-"ust"u`mila}, |huwa| |"inhazama| \arb[novoc]{huwa
-%   "inhazama} \arb[trans]{huwa "inhazama}, |al-"intiqA.du|
-%   \arb[novoc]{al-"intiqA.du} \arb[trans]{al-"intiqA.du}.
+%   "inhazama} \arb[trans]{huwa "inhazama}, |al-"intiqA.d-u|
+%   \arb[novoc]{al-"intiqA.d-u} \arb[trans]{al-"intiqA.d-u}.
 % \end{quote}
 % \end{compactenum}
 %
@@ -2698,6 +2698,7 @@ wa-ya.sIru ta.hta 'l-jild-i
 \RequirePackage{luacode}
 \RequirePackage{xparse}
 \RequirePackage{environ}
+\RequirePackage{xkeyval}
 %    \end{macrocode}
 % The following boolean will be set to |true| in |RL| mode:
 %    \begin{macrocode}
@@ -2964,6 +2965,27 @@ wa-ya.sIru ta.hta 'l-jild-i
   \else \fi\fi\fi\fi}[\par]
 %    \end{macrocode}
 % \end{environment}
+% \begin{environment}{arbverse}
+%   \changes{v1.6}{2016/11/30}{New environment \texttt{arbverse} for
+%   typesetting Arabic poetry} The environment |arbverse| shall
+%   receive different options. Let us define them first.
+%    \begin{macrocode}
+\newlength{\al@bayt@width}
+\setlength{\al@bayt@width}{.3\textwidth}
+\define@key[al]{verse}{width}{\setlength{\al@bayt@width}{#1}}
+\define@key[al]{verse}{metre}{#1}
+\define@boolkey[al]{verse}{utf}[true]{}
+\define@choicekey[al]{verse}{mode}{fullvoc, voc, novoc,
+  trans}{\def\al@mode{#1}}
+\presetkeys[al]{verse}{utf=false}{}
+\NewDocumentEnvironment{arbverse}{O{} O{}}%
+{\par\bgroup\setkeys[al]{verse}[metre]{#1}%
+  \ifx\al@mode\al@mode@trans%
+  \ifal@verse@utf\setRL\else\setLR\fi%
+  \else\setRL\fi%
+}{\\\setkeys[al]{verse}[width,utf,mode]{#1}\egroup\par}
+%    \end{macrocode}
+% \end{environment}
 % \begin{macro}{\abjad} \cs{abjad}\marg{number} expresses its argument
 %   in Arabic letters in accordance with the \arb[trans]{'abjad}
 %   arrangement of the alphabet. \meta{number} must be between 1 and
-- 
cgit v1.2.3

