texlive[42737] Master/texmf-dist: arabluatex (17dec16)

commits+karl at tug.org commits+karl at tug.org
Sat Dec 17 21:40:20 CET 2016


Revision: 42737
          http://tug.org/svn/texlive?view=revision&revision=42737
Author:   karl
Date:     2016-12-17 21:40:20 +0100 (Sat, 17 Dec 2016)
Log Message:
-----------
arabluatex (17dec16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/arabluatex/arabluatex.pdf
    trunk/Master/texmf-dist/source/lualatex/arabluatex/README.tex
    trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua

Modified: trunk/Master/texmf-dist/doc/lualatex/arabluatex/arabluatex.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/lualatex/arabluatex/README.tex
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/arabluatex/README.tex	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/source/lualatex/arabluatex/README.tex	2016-12-17 20:40:20 UTC (rev 42737)
@@ -82,6 +82,7 @@
   \url{http://www.tex.ac.uk/faq/FAQ-inst-wlcf.html} for more on this:
 \begin{itemize}
 \item \verb|arabluatex.sty|
+\item \verb|arabluatex-patch.sty|
 \item \verb|arabluatex.lua|
 \item \verb|arabluatex_voc.lua|
 \item \verb|arabluatex_fullvoc.lua|
@@ -113,7 +114,7 @@
 
 Use this command to download the repository
 \begin{verbatim}
-git clone http://git.robertalessi.net/cgit.cgi/arabluatex
+git clone http://git.robertalessi.net/arabluatex
 \end{verbatim}
 
 

Modified: trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx	2016-12-17 20:40:20 UTC (rev 42737)
@@ -27,7 +27,7 @@
 %<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package-info>\ProvidesPackage{arabluatex}
 %<*package-info>
-    [2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
+    [2016/12/17 v1.6 An ArabTeX-like interface for LuaLaTeX]
 %</package-info>
 %
 %<*driver>
@@ -145,7 +145,7 @@
 \defaultfontfeatures{RawFeature={+liga}}
 \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps},
   RawFeature={+mark;+ccmp;+ss05;+ss06}]
-\usepackage{arabluatex}[2016/11/14]
+\usepackage{arabluatex}[2016/12/17]
 \usepackage[nopar]{quran}
 \usepackage{varioref}
 \usepackage{hypdoc}
@@ -160,6 +160,7 @@
 \quotingsetup{noorphans, rightmargin=0pt}
 \renewcommand*{\quotingfont}{\footnotesize}
 \usepackage[position=below]{caption}
+\usepackage{lineno}
 \usepackage{longtable}
 \usepackage{booktabs}
 \usepackage[defaultlines=3,all]{nowidow}
@@ -191,8 +192,11 @@
 \CodelineIndex
 \begin{document}
   \DocInput{arabluatex.dtx}
+  \printbibliography[heading=bibintoc]
+  \phantomsection
   \addcontentsline{toc}{section}{Change History}
   \PrintChanges
+  \phantomsection
   \addcontentsline{toc}{section}{Index}
   \PrintIndex
 \end{document}
@@ -199,7 +203,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{561}
+% \CheckSum{694}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -506,14 +510,13 @@
 % \end{quote}
 % \item The euphonic \arb[trans]{ta^sdId} is generated (see
 %   \vpageref{ref:euphonic-tashdid}).
-% \item Assimilation rules laid on \vref{ref:assimilation} are
-%   applied.
 % \item In |fullvoc| mode, the \arb[trans]{sukUn} is expressed.
 % \end{compactitem}
 % 
 % \DescribeMacro{\SetArbEasy} \NEWfeature{v1.4.4}
 % \DescribeMacro{\SetArbEasy*} \DescribeMacro{\SetArbDflt} Such
-% refinements may be discarded by the command \cs{SetArbEasy}, either
+% refinements as \enquote*{classic} \arb[trans]{maddaT} may be
+% discarded by the command \cs{SetArb\allowbreak{}Easy}, either
 % globally in the preamble or locally at any point of the
 % document. The difference between \cs{SetArbEasy} and its
 % \enquote*{starred} version \cs{SetArbEasy*} is that the former keeps
@@ -520,7 +523,13 @@
 % the \arb[trans]{sukUn} that is generated by the |fullvoc| mode,
 % while the latter further takes it away. Default \enquote*{classic}
 % rules may be set back at any point of the document with the command
-% \cs{SetArbDflt}. Examples follow:---
+% \cs{SetArbDflt}. \NEWfeature{v1.6}
+% \DescribeMacro{\SetArbDflt*}Assimilation rules laid on
+% \vref{ref:assimilation} may also be applied by the
+% \enquote*{starred} version of this command \cs{SetArbDflt*} either
+% in the preamble or at any point of the document.\footnote{For an
+% example, see \vref{sec:poetry-example}.} Examples
+% follow:---
 % \begin{compactenum}[(a)]
 % \item \cs{SetArbDflt}:
 %   \begin{compactenum}[i.]
@@ -531,6 +540,15 @@
 %   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
 %     kitAba-hu fI nujUm-i 'l-samA'-i}
 %   \end{compactenum}
+% \item \cs{SetArbDflt*}:
+%   \begin{compactenum}[i.]\SetArbDflt*
+%   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
+%     kitAba-hu fI nujUm-i 'l-samA'-i}
+%   \item |fullvoc| \arb[fullvoc]{wa-mAta istisqA'aN qabla 'an yutimma
+%     kitAba-hu fI nujUm-i 'l-samA'-i}
+%   \item |trans| \arb[trans]{wa-mAta istisqA'aN qabla 'an yutimma
+%     kitAba-hu fI nujUm-i 'l-samA'-i}\SetArbDflt
+%   \end{compactenum}
 % \item \cs{SetArbEasy}:
 %   \begin{compactenum}[i.]\SetArbEasy
 %   \item |voc| \arb[voc]{wa-mAta istisqA'aN qabla 'an yutimma
@@ -1153,7 +1171,7 @@
 %   \arb[novoc]{l}, \arb[novoc]{m}, \arb[novoc]{w}, \arb[novoc]{y}
 %   after \arb[voc]{n} with \arb[trans]{jazmaT}, and also after the
 %   \arb[trans]{tanwIn}:---
-% \begin{quote}
+% \begin{quote}\SetArbDflt*
 %   Note the absence of \arb[trans]{sukUn} above the passed over
 %   \arb[novoc]{n} in the following examples, each of which is
 %   accompanied by a consistent transliteration: |min rabbi-hi|
@@ -1162,8 +1180,22 @@
 %   |'an| |yaqtula| \arb[fullvoc]{'an yaqtula} \arb[trans]{'an yaqtula}.
 %   
 %   With \arb[trans]{tanwIn}: |kitAbuN| |mubInuN| \arb[voc]{kitAbuN
-%   mubInuN} \arb[trans]{kitAbuN mubInuN}.
+%   mubInuN} \arb[trans]{kitAbuN mubInuN}.\SetArbDflt
 % \end{quote}
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}[text only]
+  \textsc{Rem.} This particular feature must be put into operation by
+  the command \cs{SetArbDflt*} explicitly. See above
+  \vref{sec:classic-modern-typesetting} for further details. Other
+  kinds of assimilations, including the various cases of
+  \arb[trans]{'id.gAm}, will be included in \package{arabluatex}
+  gradually.
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
 % \item With the letter \arb[voc]{t} after the dentals
 %   \arb[novoc]{_t}, \arb[novoc]{d}, \arb[novoc]{_d}, \arb[novoc]{.d},
 %   \arb[novoc]{.t}, \arb[novoc]{.z} in certain parts of the verb:
@@ -1174,6 +1206,7 @@
 % \end{compactenum}
 %
 % \paragraph{The definite article and the \arb[trans]{'alif-u 'l-wa.sl-i}}
+% \label{ref:definite-article}
 % At the beginning of a sentence, \arb[fullvoc]{"a} is never written,
 % as \arb[fullvoc]{'l-.hamd-u li-ll_ah-i}; instead, to indicate that
 % the \arb[trans]{'alif} is a connective \arb[trans]{'alif}
@@ -1321,13 +1354,20 @@
 %   \cap{'l-rUm-u}}.
 % \end{quote}
 % \label{ref:muhammaduni}
-% However, the Arabic script does not shows the \arb[trans]{kasraT}
-% which is taken by the nouns having \arb[trans]{tanwIn} although it
-% is explicit in pronunciation and must appear in some transliteration
-% standards. \package{arabluatex} takes care of that automatically:---
+% However, the Arabic script does not show the \arb[trans]{kasraT} or
+% the \arb[trans]{.dammaT} which may be taken by the nouns having
+% \arb[trans]{tanwIn} although it is explicit in pronunciation and
+% must appear in some transliteration standards. \package{arabluatex}
+% takes care of that automatically:---
 % \begin{quote}
 %   |mu.hammaduN| |'l-nabI| \arb[fullvoc]{mu.hammaduN 'l-nabI}
-%   \arb[trans]{\cap{m}u.hammaduN 'l-nabI}.
+%   \arb[trans]{\cap{m}u.hammaduN 'l-nabI}, |salAmuN| |ud_hulUA|
+%   \arb[fullvoc]{salAmuN ud_hulUA} \arb[trans]{salAmuN ud_hulUA},
+%   |qa.sIdata-hu| |fI| |qatl-i| |\cap{'a}bI| |\cap{m}uslimiN|
+%   |'llatI| |yaqUlu| |fI-hA| \arb[fullvoc]{qa.sIdata-hu fI qatl-i
+%   \cap{'a}bI \cap{m}uslimiN 'llatI yaqUlu fI-hA}
+%   \arb[trans]{qa.sIdata-hu fI qatl-i \cap{'a}bI \cap{m}uslimiN
+%   'llatI yaqUlu fI-hA}.
 % \end{quote}
 %
 % \subsection{Special orthographies}
@@ -1478,8 +1518,8 @@
 % \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}
 %
@@ -1540,7 +1580,7 @@
 % \end{quote}
 %
 % \subsubsection{\texorpdfstring{Quoting the
-% \arb[trans]{hamzaT}}{Quoting the hamza}}
+% \arb[trans]{hamzaT}}{Quoting the hamzah}}
 % \label{sec:quoting-hamza}
 % As said above in \vref{ref:hamza}, the \arb[trans]{hamzaT} is always
 % written \meta{\texttt{'}}, its carrier being determined by contextual
@@ -1742,6 +1782,281 @@
 %   \arb[trans]{\abjad{45}: kitAbu-hu fI 'l-\cap{`AdAt-i}}.
 % \end{quote}
 %
+% \section{Arabic poetry}
+% \label{sec:poetry}
+% \NEWfeature{v1.6} \package{arabluatex} provides a special
+% environment for typesetting Arabic poetry. Every line in this
+% environment must end with |\\|.
+%
+% \DescribeEnv{arabverse} The |arabverse| environment may take up to
+% six optional \enquote*{named arguments} each of which is set using
+% the syntax \meta{key}$=$\meta{value}, like so:---%
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+  \begin{arabverse}[key1=value1, key2=value2, ...]
+    <verses>
+  \end{arabverse}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi
+%
+% The description of the optional arguments follows:---
+%
+% \DescribeOption{mode} |mode|$=$\meta{mode}, either |voc|, |fullvoc|,
+% |novoc| or |trans|. The default mode is the one that is set at load
+% time as already seen \vref{sec:options}.
+%
+% \DescribeOption{width} |width|$=$\meta{length}
+% \hfill\arabluaverb{Default: 0.3\linewidth}\\ The default width of
+% each hemistich that the verse consists of. It may be expressed in
+% any accepted unit of measurement, such as |4cm| or |2in|. However,
+% one must keep in mind that the total length of the two hemistichs
+% added to the one of the gutter that separates them must not exceed
+% the length of the base line, unless one wishes to have the
+% hemistichs distributed on subsequent lines.
+%
+% \DescribeOption{gutter} |gutter|$=$\meta{width}
+% \hfill\arabluaverb{Default: 0.15 x (hemistich width)}\\ The gutter
+% consists of the blank space that is between the two hemistichs. By
+% default, it is commensurate with the width of the hemistich, but it
+% may be expressed in any accepted unit of measurement as well.
+%
+% \DescribeOption{metre} |metre|$=$\meta{name}
+% \hfill\arabluaverb{Default: none}\\ If the name of the metre is
+% expressed, it is printed after the lines and set flush left in
+% |voc|, |fullvoc| and |novoc| modes or flush right in |trans| mode.
+%
+% \DescribeOption{delim} |delim|$=$|true|\verb+|+|false|
+% \hfill\arabluaverb{Default: false}\\ This named argument does not
+% need a value as it defaults to |true| if it is used. If so, a
+% delimiter is printed between each of the hemistichs. By default, it
+% is set to the \enquote*{star} character \enquote*{*}. The command
+% \DescribeMacro{\SetHemistichDelim}\cs{SetHemistichDelim}\marg{delimiter}
+% may be used at any point of the document to change this default
+% setting.
+%
+% \DescribeOption{utf} |utf|$=$|true|\verb+|+|false|
+% \hfill\arabluaverb{Default: false}\\ As the preceding one, this
+% named argument does not need a value as it defaults to |true| if it
+% is used. If so, unicode Arabic input is expected in the |arabverse|
+% environment instead of \textsc{ascii} Arab\TeX\ or Buckwalter input
+% schemes. See \vref{sec:unicode-input} for more details.
+%
+% \DescribeMacro{\bayt} Inside the |arabverse| environment, each line
+% is typeset by the command \cs{bayt} which takes two mandatory
+% arguments and may accept one optional argument. Additionally, every
+% \cs{bayt} command \emph{must} be followed with |\\| like so:---%
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}[text only]
+  \cs{bayt}\marg{\arb[trans]{.sadr}}\oarg{\arb[trans]{tadwIr}}%
+  \marg{\arb[trans]{`ajuz}}|\\|
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
+% That two subsequent hemistichs should be connected with one another
+% is technically named \arb[trans]{tadwIr}. Should that happen, either
+% the \arb[trans]{.sadr} or the \arb[trans]{`ajuz} or both of them,
+% may be connected to one another by letters that are naturally bound
+% to the following or the preceding ones over the
+% \arb[trans]{tadwIr}. The optional argument of the \cs{bayt} command
+% is designed to deal with the various situations that may arise:---
+% \begin{compactenum}[(a)]
+% \item If the two hemistichs be connected with one another by a
+% prominent horizontal flexible stroke, the \arb[trans]{tatwIl} should
+% be used, like so: |[--]| (see \vref{sec:tatwil}). Of course, the
+% ending word of the \arb[trans]{.sadr} and the word at the
+% commencement of the \arb[trans]{`a^guz} must have the
+% \arb[trans]{ta.twIl} too so that the proper shapes of the letters be
+% selected. Consider for example the following:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+\begin{arabverse}[mode=fullvoc, width=.3\linewidth]
+  \bayt{lA 'ar_A man `ahidtu fI-hA fa-'abkI 'l---}[--]{---yawma
+    dalhaN wa-mA yu.hIru 'l-bukA'u}\\
+\end{arabverse}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi%
+% As one can see, \emph{triple hyphens} have been used. In the
+% \arb[trans]{.sadr}, the first hyphen triggers the rules that are
+% related to the definite article and the \arb[trans]{'alif-u
+% 'l-wa.sl-i},\footnote{See \vref{ref:definite-article}} while the
+% following two select the figure of the letter \arb[trans]{lAm}
+% connected with a following letter. In the \arb[trans]{`a^guz}, the
+% last two hyphens select the letter \arb[trans]{yA'} connected with a
+% preceding letter, while the first one is simply discarded in this
+% mode, but still may appear as it should, if the |trans| mode be
+% selected:---%
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+\begin{arabverse}[mode=trans, width=.4\linewidth]
+  \bayt{lA 'ar_A man `ahidtu fI-hA fa-'abkI 'l---}[--]{---yawma
+    dalhaN wa-mA yu.hIru 'l-bukA'u}\\
+\end{arabverse}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi%
+% \item In some other cases, it may seem difficult, if not fairly
+%   impossible, to split a given word into two parts. This happens
+%   mostly because of the \arb[trans]{^saddaT}. Consider for example
+%   the following:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+\begin{arabverse}[mode=fullvoc, width=.25\linewidth, gutter=1cm]
+  \bayt{.gayra 'annI qad 'asta`Inu `al_A 'l-ha--}[--mmi ]{'i_dA
+  _haffa bi-'l-_tawiyyi 'l-na^gA'u}\\
+  \bayt{bi-zaf--UfiN ka-'anna-hA hiq--laTuN}[ 'ummu ]{ri'AliN
+  dawwiyyaTuN saqfA'u}\\
+\end{arabverse}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi%
+% In the first line, the word \arb{al-hammi} should be split into
+% \arb{al-ham"-- --mi} as the first part of it belongs to the
+% \arb[trans]{.sadr} and the second to the \arb[trans]{`a^guz}. One
+% solution to avoid splitting this word in such a way is to write
+% inside the \arb[trans]{tadwIr} the part of it that belongs to either
+% hemistich, without omitting to add a space after it. In the second
+% line, the word \arb{'ummu} should be split into \arb{'um"-- --mu},
+% so that the only way to avoid splitting it into two parts is to
+% write it all inside the \arb[trans]{tadwIr}. In that case, as the
+% word is to be placed in the middle, it has been surrounded by
+% spaces.
+% \end{compactenum}
+%
+% \paragraph{Scaling and distortion of characters}
+% The |arabverse| environment and the \cs{bayt} command are designed
+% to typeset the verses in a two-column, fixed width layout. This may
+% result in somewhat distorted text. Should that happen, one may adapt
+% the layout by modifying the values of the above described |width|
+% and |gutter| named arguments until the visual aspect of the layout
+% be satisfactory. It has to be noted that distortion and warping may
+% be even more perceptible in Roman than in Arabic characters.
+%
+% \paragraph{Footnotes}
+% Footnotes are not set by default inside the \cs{bayt} command, but
+% there are two easy ways to have them printed.
+%
+% If they are little in number, each footnote may be split into pairs
+% of \cs{footnote\allowbreak{}mark}|{}| (please mind the braces) in
+% either argument of the \cs{bayt} command and \cs{footnotetext}
+% outside the \cs{bayt} command.
+%
+% If the footnotes are abundant in number, it is advised to load the
+% \package{footnote} package which \package{arabluatex} will then use
+% to typeset any kind of footnote that is called from the arguments of
+% the \cs{bayt} command. Please note that the package
+% \package{footnote} must be loaded \emph{after} \package{arabluatex}.
+%
+% \paragraph{Line numbering}
+% Inside the |arabverse| environment, the |linenumbers| environment of
+% the \package{lineno} package may be used to have the lines of
+% succeeding verses numbered. Please refer to the documentation of
+% this package for more information or to the example below for a
+% basic implementation of this technique.
+%
+% \subsection{Example}
+% \label{sec:poetry-example}
+% Here follow the first lines of \arb[trans]{\upshape{}\cap{i}mru'u
+% 'l-\cap{q}aysi}'s \arb[trans]{\cap{m}u`allaqaT}. In this example,
+% \cs{SetArbDflt*} has been selected so as to mark the
+% \arb[trans]{'id.gAm} that is fit to this declamatory
+% poetry:---\footnote{See \vref{sec:classic-modern-typesetting} for
+% more information.}%
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+\begin{arab}[fullvoc]
+  qAla \cap{i}mru'u 'l-\cap{q}aysi fI mu`allaqati-hi:
+\end{arab}
+
+\begin{arabverse}[mode=fullvoc, metre={(al-.darbu 'l-_tAnI mina
+  'l-`arU.di 'l-'_Ul_A mina 'l-.tawIli)}]
+  \SetArbDflt*
+  \begin{linenumbers*}
+    \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti
+      \cap{'l-l}iw_A bayna \cap{'l-d}a_hUli wa-\cap{.h}awmali}\\
+    \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu
+      rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\
+    \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA
+      ka-'anna-hu .habbu fulfuli}\\
+    \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{laday
+      samurAti 'l-.hayyi nAqifu .han.zali}\\
+    \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA
+      tahlik 'asaN_A wa-ta^gammali}\\
+    \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN
+      dAsiriN min mu`awwali}\\
+  \end{linenumbers*}
+\end{arabverse}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi%
+% \begin{arab}[fullvoc]
+%   qAla \cap{i}mru'u 'l-\cap{q}aysi fI mu`allaqati-hi:
+% \end{arab}
+% 
+% \begin{arabverse}[mode=fullvoc, metre={(al-.darbu 'l-_tAnI mina
+%  'l-`arU.di 'l-'_Ul_A mina 'l-.tawIli)}, width=.25\linewidth]
+%  \SetArbDflt*
+%   \begin{linenumbers*}
+%     \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti
+%     \cap{'l-l}iw_A bayna \cap{'l-d}a_hUli wa-\cap{.h}awmali}\\
+%     \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu
+%     rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\
+%     \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA
+%     ka-'anna-hu .habbu fulfuli}\\
+%     \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{laday
+%     samurAti
+%     'l-.hayyi nAqifu .han.zali}\\
+%     \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA
+%     tahlik 'asaN_A wa-ta^gammali}\\
+%     \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN
+%     dAsiriN min mu`awwali}\\
+%   \end{linenumbers*}
+% \end{arabverse}
+% 
+% \begin{arab}[trans]
+%   qAla \cap{i}mru'u 'l-\cap{q}aysi fI mu`allaqati-hi:
+% \end{arab}
+% 
+% \begin{arabverse}[mode=trans, metre={(al-.darbu 'l-_tAnI mina
+%  'l-`arU.di 'l-'_Ul_A mina 'l-.tawIli)}, width=.4\linewidth]
+%  \SetArbDflt*
+%   \begin{linenumbers*}
+%     \bayt{qifA nabki min _dikr_A .habibiN wa-manzili}{bi-saq.ti
+%     \cap{'l-l}iw_A bayna \cap{'l-d}a_hUli wa-\cap{.h}awmali}\\
+%     \bayt{fa-\cap{t}Udi.ha fa-'l-\cap{m}iqrATi lam ya`fu
+%     rasmu-hA}{limA nasa^gat-hA min ^ganUbiN wa-^sam'ali}\\
+%     \bayt{tar_A ba`ara 'l-'ar'Ami fI `ara.sAti-hA}{wa-qI`Ani-hA
+%     ka-'anna-hu .habbu fulfuli}\\
+%     \bayt{ka-'annI .gadATa 'l-bayni yawma ta.hammalUA}{laday
+%     samurAti
+%     'l-.hayyi nAqifu .han.zali}\\
+%     \bayt{wuqUfaN bi-hA .sa.hbI `alayya ma.tiyya-hum}{yaqUlUna lA
+%     tahlik 'asaN_A wa-ta^gammali}\\
+%     \bayt{wa-'inna ^sifA'I `abraTuN muhrAqaTuN}{fa-hal `inda rasmiN
+%     dAsiriN min mu`awwali}\\
+%   \end{linenumbers*}
+% \end{arabverse}
+% 
 % \section{Special applications}
 % \label{sec:special-applications}
 % \paragraph{Linguistics}
@@ -2592,9 +2907,6 @@
 % \begin{compactenum}[(a)]
 % \item Short-term:
 %   \begin{compactenum}[i.] 
-%   \item Support for typesetting Arabic poetry.
-%   \item The \arb[trans]{\cap{qur'An}}: support for typesetting the
-%     \arb[trans]{\cap{Qur'An}}.
 %   \item \texttt{TEI xml} support: \package{arabluatex} will
 %     interoperate with \texttt{TEI xml} through new global and local
 %     options that will output Arabic in a \texttt{TEI xml} compliant
@@ -2626,7 +2938,7 @@
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{arabluatex}%
-[2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
+[2016/12/17 v1.6 An ArabTeX-like interface for LuaLaTeX]
 \RequirePackage{ifluatex}
 %    \end{macrocode}
 % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning
@@ -2662,6 +2974,8 @@
 \RequirePackage{luacode}
 \RequirePackage{xparse}
 \RequirePackage{environ}
+\RequirePackage{adjustbox}
+\RequirePackage{xkeyval}
 %    \end{macrocode}
 % The following boolean will be set to |true| in |RL| mode:
 %    \begin{macrocode}
@@ -2751,6 +3065,13 @@
 %   \arb[trans]{sukUn} that is generated, while the starred version
 %   \cs{SetArbEasy*} takes it away. Default complex rules can be set
 %   back at any point of the document with \cs{SetArbDflt}.
+% \begin{macro}{\SetArbDflt*}
+%   \changes{v1.6}{2016/12/17}{This starred version applies the
+%   assimilation rules in addition to what \cs{SetArbDflt} already
+%   does.} As of v1.6, \package{arabluatex} does not applies any more
+%   the assimilation rules that are laid on \vref{ref:assimilation}; a
+%   new starred version \cs{SetArbDflt*} is now available to the user
+%   should he wish to apply them.
 %    \begin{macrocode}
 \def\al at arb@rules{dflt}
 \NewDocumentCommand{\SetArbEasy}{s}{%
@@ -2757,11 +3078,15 @@
   \IfBooleanTF{#1}
   {\def\al at arb@rules{easynosukun}}
   {\def\al at arb@rules{easy}}}
-\NewDocumentCommand{\SetArbDflt}{}{\def\al at arb@rules{dflt}}
+\NewDocumentCommand{\SetArbDflt}{s}{%
+  \IfBooleanTF{#1}
+  {\def\al at arb@rules{idgham}}
+  {\def\al at arb@rules{dflt}}}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 % \begin{macro}{\SetTranslitFont}
 %   \changes{v1.4}{2016/07/05}{For selecting a specific font for
 %   transliterated texts} By default, the font that is used for
@@ -2917,6 +3242,90 @@
   \else \fi\fi\fi\fi}[\par]
 %    \end{macrocode}
 % \end{environment}
+% \begin{environment}{arabverse}
+%   \changes{v1.6}{2016/12/17}{New environment \texttt{arabverse} for
+%   typesetting Arabic poetry} The |arabverse| environment may receive
+%   different options: |mode|, |width|, |gutter|, |metre|, |utf|
+%   and |delim|; all of them are defined here just before the
+%   |arabverse| environment:
+%    \begin{macrocode}
+\newlength{\al at bayt@width}
+\newlength{\al at gutter@width}
+\setlength{\al at bayt@width}{.3\textwidth}
+\setlength{\al at gutter@width}{.15\al at bayt@width}
+\define at key[al]{verse}{width}{\setlength{\al at bayt@width}{#1}}
+\define at key[al]{verse}{gutter}{\setlength{\al at gutter@width}{#1}}
+\define at key[al]{verse}{metre}{\arb{#1}}
+\define at boolkey[al]{verse}{utf}[true]{}
+\define at boolkey[al]{verse}{delim}[true]{}
+\define at choicekey[al]{verse}{mode}{fullvoc, voc, novoc,
+  trans}{\def\al at mode{#1}}
+\presetkeys[al]{verse}{metre=\LR{\vskip -\baselineskip}, utf=false,
+  delim=false}{}
+%    \end{macrocode}
+% Then follows the environment itself:
+%    \begin{macrocode}
+\NewDocumentEnvironment{arabverse}{O{}}%
+{\par\centering\noindent\bgroup\setkeys[al]{verse}[metre]{#1}%
+  \ifx\al at mode\al at mode@trans%
+  \ifal at verse@utf\setRL\else\setLR\fi%
+  \else\setRL\fi}%
+{\hfill\setkeys[al]{verse}[width,gutter,utf,mode]{#1}\egroup}
+%    \end{macrocode}
+% \begin{macro}{\bayt}
+%   \changes{v1.6}{2016/12/17}{New macro \cs{bayt} for typesetting
+%   each verse inside the \texttt{arabverse} environment} Each verse
+%   consists of two hemistichs; therefore the command \cs{bayt} takes
+%   two arguments, the first receives the \arb[trans]{.sadr} and the
+%   second the \arb[trans]{`ajuz}. That two subsequent hemistichs
+%   should be connected with one another is technically named
+%   \arb[trans]{tadwIr}. In some of these cases, the hemistichs may be
+%   connected by a prominent horizontal flexible stroke which is drawn
+%   by the command \cs{al at verse@stroke}.
+% \begin{macro}{\SetHemistichDelim}
+%   \changes{v1.6}{2016/12/17}{New command \cs{SetHemistichDelim} for
+%   changing the default delimiter between hemistichs} A hemistich
+%   delimiter also may be defined. By default, it is set to the
+%   \enquote*{star} character: |*|. The command
+%   \cs{SetHemistichDelim}\marg{delimiter} may be used at any point of
+%   the document to change this default setting.
+% \end{macro}
+%    \begin{macrocode}
+\NewDocumentCommand{\arb at utf}{m}{%
+  \ifal at verse@utf\txarb{#1}\else\arb{#1}\fi}
+\def\al at hemistich@delim{*}
+\NewDocumentCommand{\SetHemistichDelim}{m}{\def\al at hemistich@delim{#1}}
+\def\al at verse@stroke{\leavevmode\xleaders\hbox{\arb{--}}\hfill\kern0pt}
+\NewDocumentCommand{\bayt}{m o m}{%
+  \ifdefined\savenotes\savenotes\else\fi%
+  \edef\al at tatweel{--}%
+  \adjustbox{width=\al at bayt@width, height=\Height}{\arb at utf{#1}}%
+  \IfNoValueTF{#2}{%
+    \ifal at verse@delim\makebox[\al at gutter@width][c]{\al at hemistich@delim}%
+    \else%
+    \hspace{\al at gutter@width}%
+    \fi
+  }{%
+    \edef\@tempa{#2}%
+    \ifx\@tempa\al at tatweel%
+    \ifx\al at mode\al at mode@trans%
+    \hspace{\al at gutter@width}%
+    \else%
+    \makebox[\al at gutter@width][s]{\al at verse@stroke}%
+    \fi%
+    \else%
+    \ifx\al at mode\al at mode@trans%
+    \adjustbox{width=\al at gutter@width, height=\Height}{\arb at utf{#2}}%
+    \else%
+    \makebox[\al at gutter@width][s]{\arb at utf{#2}}%
+    \fi\fi}%
+  \adjustbox{width=\al at bayt@width, height=\Height}{\arb at utf{#3}}%
+  \ifdefined\spewnotes\spewnotes\else\fi%
+}
+%    \end{macrocode}
+%   
+% \end{macro} 
+% \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
@@ -3117,7 +3526,5 @@
 %</patch>
 % \fi
 %
-% \printbibliography[heading=bibintoc]
-%
 % \Finale
 \endinput

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua	2016-12-17 20:40:20 UTC (rev 42737)
@@ -146,18 +146,29 @@
    return str
 end
 
-local function voc(str)
+local function voc(str, rules)
    str = string.gsub(str, "\\arb(%b{})", function(inside)
    inside = string.sub(inside, 2, -2)
    for i = 1,#hamza do
       inside = string.gsub(inside, hamza[i].a, hamza[i].b)
    end
-   for i = 1,#tanwin do
-      inside  = string.gsub(inside, tanwin[i].a, tanwin[i].b)
+   if rules == "idgham" then
+      for i = 1,#tanwin do
+	 inside  = string.gsub(inside, tanwin[i].a, tanwin[i].b)
+      end
+   else
+      for i = 1,#tanwineasy do
+	 inside  = string.gsub(inside, tanwineasy[i].a, tanwineasy[i].b)
+      end
    end
    for i = 1,#trigraphs do
       inside = string.gsub(inside, trigraphs[i].a, trigraphs[i].b)
    end
+   if rules == "idgham" then
+      for i = 1,#idgham do
+	 inside = string.gsub(inside, idgham[i].a, idgham[i].b)
+      end
+   end
    for i = 1,#digraphs do
       inside = string.gsub(inside, digraphs[i].a, digraphs[i].b)
    end
@@ -218,21 +229,38 @@
 return str
 end
 
-local function fullvoc(str)
+local function fullvoc(str, rules)
    str = string.gsub(str, "\\arb(%b{})", function(inside)
    inside = string.sub(inside, 2, -2)
    for i = 1,#hamzafv do
       inside = string.gsub(inside, hamzafv[i].a, hamzafv[i].b)
    end
-   for i = 1,#tanwinfv do
-      inside  = string.gsub(inside, tanwinfv[i].a, tanwinfv[i].b)
+   if rules == "idgham" then
+      for i = 1,#tanwinfv do
+	 inside  = string.gsub(inside, tanwinfv[i].a, tanwinfv[i].b)
+      end
+   else
+      for i = 1,#tanwinfveasy do
+	 inside  = string.gsub(inside, tanwinfveasy[i].a, tanwinfveasy[i].b)
+      end
    end
    for i = 1,#trigraphsfv do
       inside = string.gsub(inside, trigraphsfv[i].a, trigraphsfv[i].b)
    end
-   for i = 1,#digraphsfv do
-      inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b)
+   if rules == "idgham" then
+      for i = 1,#idgham do
+	 inside = string.gsub(inside, idgham[i].a, idgham[i].b)
+      end
    end
+   if rules == "idgham" then
+      for i = 1,#digraphsfvidgham do
+	 inside = string.gsub(inside, digraphsfvidgham[i].a, digraphsfvidgham[i].b)
+      end
+   else
+      for i = 1,#digraphsfv do
+	 inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b)
+      end
+   end
    for i = 1,#singlefv do
       inside = string.gsub(inside, singlefv[i].a, singlefv[i].b)
    end
@@ -254,7 +282,7 @@
 return str
 end
 
-local function fullvoceasy(str, opt)
+local function fullvoceasy(str, rules)
    str = string.gsub(str, "\\arb(%b{})", function(inside)
    inside = string.sub(inside, 2, -2)
    for i = 1,#hamzafveasy do
@@ -266,7 +294,7 @@
    for i = 1,#trigraphsfveasy do
       inside = string.gsub(inside, trigraphsfveasy[i].a, trigraphsfveasy[i].b)
    end
-   if opt == "nosukun" then
+   if rules == "nosukun" then
       for i = 1,#digraphsfveasy do
 	 inside = string.gsub(inside, digraphsfveasy[i].a, digraphsfveasy[i].b)
       end
@@ -368,7 +396,7 @@
 return str
 end
 
-local function transdmg(str)
+local function transdmg(str, rules)
    str = string.gsub(str, "\\arb(%b{})", function(inside)
    inside = string.sub(inside, 2, -2)
    for i = 1,#hamzatrdmg do
@@ -380,41 +408,11 @@
    for i = 1,#trigraphstrdmg do
       inside = string.gsub(inside, trigraphstrdmg[i].a, trigraphstrdmg[i].b)
    end
-   for i = 1,#digraphstrdmg do
-      inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b)
+   if rules == "idgham" then
+      for i = 1,#idghamtrdmg do
+	 inside = string.gsub(inside, idghamtrdmg[i].a, idghamtrdmg[i].b)
+      end
    end
-   for i = 1,#singletrdmg do
-      inside = string.gsub(inside, singletrdmg[i].a, singletrdmg[i].b)
-   end
-   for i = 1,#longvtrdmg do
-      inside = string.gsub(inside, longvtrdmg[i].a, longvtrdmg[i].b)
-   end
-   for i = 1,#shortvtrdmg do
-      inside = string.gsub(inside, shortvtrdmg[i].a, shortvtrdmg[i].b)
-   end
-   for i = 1,#punctuationtr do
-      inside = string.gsub(inside, punctuationtr[i].a, punctuationtr[i].b)
-   end
-   for i = 1,#nulltr do
-      inside = string.gsub(inside, nulltr[i].a, nulltr[i].b)
-   end
-   return string.format("\\txtrans{%s}", inside)
-   end)
-return str
-end
-
-local function transdmgeasy(str)
-   str = string.gsub(str, "\\arb(%b{})", function(inside)
-   inside = string.sub(inside, 2, -2)
-   for i = 1,#hamzatrdmg do
-      inside = string.gsub(inside, hamzatrdmg[i].a, hamzatrdmg[i].b)
-   end
-   for i = 1,#tanwintrdmg do
-      inside  = string.gsub(inside, tanwintrdmg[i].a, tanwintrdmg[i].b)
-   end
-   for i = 1,#trigraphstrdmgeasy do
-  inside = string.gsub(inside, trigraphstrdmgeasy[i].a, trigraphstrdmgeasy[i].b)
-   end
    for i = 1,#digraphstrdmg do
       inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b)
    end
@@ -498,8 +496,8 @@
       else end
    if rules == "easy" or rules == "easynosukun" then
       str = voceasy(str)
-   elseif rules == "dflt" then
-      str = voc(str)
+   elseif rules == "dflt" or rules == "idgham" then
+      str = voc(str, rules)
       else end
    str = unprotectarb(str)
 return str
@@ -518,8 +516,8 @@
       str = fullvoceasy(str, "sukun")
    elseif rules == "easynosukun" then
       str = fullvoceasy(str, "nosukun")
-   elseif rules == "dflt" then
-      str = fullvoc(str)
+   elseif rules == "dflt" or rules == "idgham" then
+      str = fullvoc(str, rules)
       else end
    str = unprotectarb(str)
 return str
@@ -536,7 +534,7 @@
       else end
    if rules == "easy" or rules == "easynosukun" then
       str = novoceasy(str)
-   elseif rules == "dflt" then
+   elseif rules == "dflt" or rules == "idgham" then
       str = novoc(str)
       else end
    str = unprotectarb(str)
@@ -551,16 +549,12 @@
    str = holdcmd(str)
    if scheme == "buckwalter" then
       str = processbuckw(str)
-      else end
+   end
    if mode == "dmg" then
-      if rules == "easy" or rules == "easynosukun" then
-	 str = transdmgeasy(str)
-      elseif rules == "dflt" then
-	 str = transdmg(str)
-	 else end
+      str = transdmg(str, rules)
    elseif mode == "loc" then
       str = transloc(str)
-      else end
+   end
    str = unprotectarb(str)
 return str
 end

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty	2016-12-17 20:40:20 UTC (rev 42737)
@@ -41,7 +41,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{arabluatex}%
-[2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
+[2016/12/17 v1.6 An ArabTeX-like interface for LuaLaTeX]
 \RequirePackage{ifluatex}
 \ifluatex\else
  \PackageError{arabluatex}{lualatex needed}{%
@@ -67,6 +67,8 @@
 \RequirePackage{luacode}
 \RequirePackage{xparse}
 \RequirePackage{environ}
+\RequirePackage{adjustbox}
+\RequirePackage{xkeyval}
 \newbool{al at rlmode}
 \luadirect{dofile(kpse.find_file("arabluatex.lua"))}
 \luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))}
@@ -92,7 +94,10 @@
   \IfBooleanTF{#1}
   {\def\al at arb@rules{easynosukun}}
   {\def\al at arb@rules{easy}}}
-\NewDocumentCommand{\SetArbDflt}{}{\def\al at arb@rules{dflt}}
+\NewDocumentCommand{\SetArbDflt}{s}{%
+  \IfBooleanTF{#1}
+  {\def\al at arb@rules{idgham}}
+  {\def\al at arb@rules{dflt}}}
 \def\al at trans@font{\rmfamily}%
 \NewDocumentCommand{\SetTranslitFont}{m}{\def\al at trans@font{#1}}
 \def\al at trans@style{\itshape}%
@@ -167,6 +172,56 @@
     \luastringO{\al at arb@rules},
     \luastringO{\al at input@scheme}))}\egroup%
   \else \fi\fi\fi\fi}[\par]
+\newlength{\al at bayt@width}
+\newlength{\al at gutter@width}
+\setlength{\al at bayt@width}{.3\textwidth}
+\setlength{\al at gutter@width}{.15\al at bayt@width}
+\define at key[al]{verse}{width}{\setlength{\al at bayt@width}{#1}}
+\define at key[al]{verse}{gutter}{\setlength{\al at gutter@width}{#1}}
+\define at key[al]{verse}{metre}{\arb{#1}}
+\define at boolkey[al]{verse}{utf}[true]{}
+\define at boolkey[al]{verse}{delim}[true]{}
+\define at choicekey[al]{verse}{mode}{fullvoc, voc, novoc,
+  trans}{\def\al at mode{#1}}
+\presetkeys[al]{verse}{metre=\LR{\vskip -\baselineskip}, utf=false,
+  delim=false}{}
+\NewDocumentEnvironment{arabverse}{O{}}%
+{\par\centering\noindent\bgroup\setkeys[al]{verse}[metre]{#1}%
+  \ifx\al at mode\al at mode@trans%
+  \ifal at verse@utf\setRL\else\setLR\fi%
+  \else\setRL\fi}%
+{\hfill\setkeys[al]{verse}[width,gutter,utf,mode]{#1}\egroup}
+\NewDocumentCommand{\arb at utf}{m}{%
+  \ifal at verse@utf\txarb{#1}\else\arb{#1}\fi}
+\def\al at hemistich@delim{*}
+\NewDocumentCommand{\SetHemistichDelim}{m}{\def\al at hemistich@delim{#1}}
+\def\al at verse@stroke{\leavevmode\xleaders\hbox{\arb{--}}\hfill\kern0pt}
+\NewDocumentCommand{\bayt}{m o m}{%
+  \ifdefined\savenotes\savenotes\else\fi%
+  \edef\al at tatweel{--}%
+  \adjustbox{width=\al at bayt@width, height=\Height}{\arb at utf{#1}}%
+  \IfNoValueTF{#2}{%
+    \ifal at verse@delim\makebox[\al at gutter@width][c]{\al at hemistich@delim}%
+    \else%
+    \hspace{\al at gutter@width}%
+    \fi
+  }{%
+    \edef\@tempa{#2}%
+    \ifx\@tempa\al at tatweel%
+    \ifx\al at mode\al at mode@trans%
+    \hspace{\al at gutter@width}%
+    \else%
+    \makebox[\al at gutter@width][s]{\al at verse@stroke}%
+    \fi%
+    \else%
+    \ifx\al at mode\al at mode@trans%
+    \adjustbox{width=\al at gutter@width, height=\Height}{\arb at utf{#2}}%
+    \else%
+    \makebox[\al at gutter@width][s]{\arb at utf{#2}}%
+    \fi\fi}%
+  \adjustbox{width=\al at bayt@width, height=\Height}{\arb at utf{#3}}%
+  \ifdefined\spewnotes\spewnotes\else\fi%
+}
 \AtBeginDocument{%
   \ifdefined\abjad%
   \RenewDocumentCommand{\abjad}{m}%

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua	2016-12-17 20:40:20 UTC (rev 42737)
@@ -66,6 +66,12 @@
    {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda
    {a="(A)(')", b="aآء"}, -- historic madda
    -- initial (needs both ^ and %W patterns)
+   -- 'aw: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
+   -- then the 'initial' rules for the remaining cases
    {a="^(')([ua])", b="أ%2"},
    {a="^(')(i)", b="إ%2"},
    {a="(%W)(')([ua])", b="%1أ%3"},
@@ -74,29 +80,29 @@
    -- ^say'aN and .zim'aN are special orthographies
    {a="(%^say)(%')(aN)", b="%1ئ%3"},
    {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
-   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
-   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)$", b="%1ء%3"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)(%W)", b="%1ء%3%4"},
 -- u
-   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
-   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
+   {a="(u)(')([uai][^%.%^%_]N?)$", b="%1ؤ%3"},
+   {a="(u)(')([uai][^%.%^%_]N?)(%W)", b="%1ؤ%3%4"},
    {a="(u)(')$", b="%1ؤْ"},
    {a="(u)(')(%W)", b="%1ؤْ%3"},
 -- a
    {a="(a)(')(A)$", b="%1آ"},
    {a="(a)(')(A)(%W)", b="%1آ%4"},
-   {a="(a)(')([u]N?)$", b="%1أ%3"},
-   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
+   {a="(a)(')([u][^%.%^%_]N?)$", b="%1أ%3"},
+   {a="(a)(')([u][^%.%^%_]N?)(%W)", b="%1أ%3%4"},
    {a="(a)(')(a)$", b="%1أ%3"},
    {a="(a)(')(a)(%W)", b="%1أ%3%4"},
    {a="(a)(')(aN)$", b="%1أً"},
    {a="(a)(')(aN)(%W)", b="%1أً%4"},
-   {a="(a)(')([i]N?)$", b="%1إ%3"},
-   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
+   {a="(a)(')([i][^%.%^%_]N?)$", b="%1إ%3"},
+   {a="(a)(')([i][^%.%^%_]N?)(%W)", b="%1إ%3%4"},
    {a="(a)(')$", b="%1أْ"},
    {a="(a)(')(%W)", b="%1أْ%3"},
 -- i
-   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
-   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
+   {a="(i)(')([uai][^%.%^%_]N?)$", b="%1ئ%3"},
+   {a="(i)(')([uai][^%.%^%_]N?)(%W)", b="%1ئ%3%4"},
    {a="(i)(')$", b="%1ئْ"},
    {a="(i)(')(%W)", b="%1ئْ%3"},
 --
@@ -166,6 +172,12 @@
    {a="(A)(')", b="aاء"}, -- historic madda
    --easy (end)
    -- initial (needs both ^ and %W patterns)
+   -- 'aw: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
+   -- then the 'initial' rules for the remaining cases
    {a="^(')([ua])", b="أ%2"},
    {a="^(')(i)", b="إ%2"},
    {a="(%W)(')([ua])", b="%1أ%3"},
@@ -174,29 +186,29 @@
    -- ^say'aN and .zim'aN are special orthographies
    {a="(%^say)(%')(aN)", b="%1ئ%3"},
    {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
-   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
-   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)$", b="%1ء%3"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)(%W)", b="%1ء%3%4"},
 -- u
-   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
-   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
+   {a="(u)(')([uai][^%.%^%_]N?)$", b="%1ؤ%3"},
+   {a="(u)(')([uai][^%.%^%_]N?)(%W)", b="%1ؤ%3%4"},
    {a="(u)(')$", b="%1ؤْ"},
    {a="(u)(')(%W)", b="%1ؤْ%3"},
 -- a
    {a="(a)(')(A)$", b="%1آ"},
    {a="(a)(')(A)(%W)", b="%1آ%4"},
-   {a="(a)(')([u]N?)$", b="%1أ%3"},
-   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
+   {a="(a)(')([u][^%.%^%_]N?)$", b="%1أ%3"},
+   {a="(a)(')([u][^%.%^%_]N?)(%W)", b="%1أ%3%4"},
    {a="(a)(')(a)$", b="%1أ%3"},
    {a="(a)(')(a)(%W)", b="%1أ%3%4"},
    {a="(a)(')(aN)$", b="%1أً"},
    {a="(a)(')(aN)(%W)", b="%1أً%4"},
-   {a="(a)(')([i]N?)$", b="%1إ%3"},
-   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
+   {a="(a)(')([i][^%.%^%_]N?)$", b="%1إ%3"},
+   {a="(a)(')([i][^%.%^%_]N?)(%W)", b="%1إ%3%4"},
    {a="(a)(')$", b="%1أْ"},
    {a="(a)(')(%W)", b="%1أْ%3"},
 -- i
-   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
-   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
+   {a="(i)(')([uai][^%.%^%_]N?)$", b="%1ئ%3"},
+   {a="(i)(')([uai][^%.%^%_]N?)(%W)", b="%1ئ%3%4"},
    {a="(i)(')$", b="%1ئْ"},
    {a="(i)(')(%W)", b="%1ئْ%3"},
 --
@@ -220,7 +232,10 @@
    {a="(i)(')([^uaiUAI])", b="%1ئْ%3"}
 }
 
-tanwinfv = {
+tanwinfv = { -- with assimilations (\SetArbDflt*)
+   {a="%-?(uNU)(%s)([uai])", b="%1%2ٱ"},
+   {a="%-?(aNU)(%s)([uai])", b="%1%2ٱ"},
+   {a="%-?(iNU)(%s)([uai])", b="%1%2ٱ"},
    {a="%-?uNU", b="ٌو"},
    {a="%-?aNU", b="ًوا"},
    {a="%-?iNU", b="ٍو"},
@@ -256,6 +271,9 @@
 }
 
 tanwinfveasy = { -- no assimilations (see below)
+   {a="%-?(uNU)(%s)([uai])", b="%1%2ٱ"},
+   {a="%-?(aNU)(%s)([uai])", b="%1%2ٱ"},
+   {a="%-?(iNU)(%s)([uai])", b="%1%2ٱ"},
    {a="%-?uNU", b="ٌو"},
    {a="%-?aNU", b="ًوا"},
    {a="%-?iNU", b="ٍو"},
@@ -293,24 +311,29 @@
 trigraphsfv = { -- trigraphs or more
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
-   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"},
+   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"}, --p
+   -- law: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
    -- al- + lām
    {a="^(a)l%-(l)", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"}, --p
    -- al- + solar consonant
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, --p
    -- assim. art. + solar consonant
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"}, --p
    -- al- + initial unstable hamza
    {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
-   {a="([%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"}, --p
    -- li-/la + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-(\"?[uai])", b="ل%1ل%2ٱ"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="ا%1لْ"},
-   {a="([%s%-])(a)l%-", b="%1ا%2لْ"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2لْ"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
    {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
@@ -341,32 +364,38 @@
    -- words ending in -āT with silent wāw/yāʾ
    {a="(_a)UA", b="%1وا"},
    {a="(_a)U", b="%1و"},
-   {a="(_a)I", b="%1ي"},
-   -- assimilations
-   {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
+   {a="(_a)I", b="%1ي"}
 }
 
+-- idgham/assimilation rules for trigraphs apply here : see voc lua
+-- file.
+
 trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs)
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
-   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"},
+   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"}, --p
+   -- law: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
    -- al- + lām
    {a="^(a)l%-(l)", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"}, --p
    -- al- + solar consonant
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, --p
    -- assim. art. + solar consonant
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"}, --p
    -- al- + initial unstable hamza
    {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
-   {a="([%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"}, --p
    -- li-/la + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-(\"?[uai])", b="ل%1ل%2ٱ"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="ا%1لْ"},
-   {a="([%s%-])(a)l%-", b="%1ا%2لْ"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2لْ"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
    {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
@@ -397,12 +426,10 @@
    -- words ending in -āT with silent wāw/yāʾ
    {a="(_a)UA", b="%1وا"},
    {a="(_a)U", b="%1و"},
-   {a="(_a)I", b="%1ي"},
-   -- assimilations
---easy   {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
+   {a="(_a)I", b="%1ي"}
 }
 
-digraphsfv = {
+digraphsfvidgham = {
    -- iʿrāb: straight double quote must be discarded
    {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
    {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"},
@@ -417,7 +444,7 @@
    -- ʾiʿrāb (end)
    -- initial straight double quote gives a connective ʾalif
    {a="^\"[uai]", b="ٱ"},
-   {a="([%s%-])\"[uai]", b="%1ٱ"},
+   {a="([%(%[%|%<%s%-])\"[uai]", b="%1ٱ"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"},
    {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"},
@@ -424,9 +451,9 @@
    {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"},
    {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza
    -- initial alif without hamza
-   {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"},
-   {a="^([uai])", b="ا%1"},      -- initial alif without hamza
-   {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza
+   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
+   {a="^([%(%[%|%<]?)([uai])", b="%1ا%2"}, -- initial alif without hamza --p
+   {a="(%s)([%(%[%|%<]?)([uai])", b="%1%2ا%3"}, -- initial alif without hamza --p
    {a="%-%-", b="ـ"},
    {a="ؤؤ", b="ؤّ"},
    {a="أأ", b="أّ"},
@@ -438,6 +465,7 @@
    {a="%_t%_t", b="ثّ"},
    {a="jj", b="جّ"},
    {a="%^g%^g", b="جّ"},
+   {a="%.h%.h", b="حّ"},
    {a="xx", b="خّ"},
    {a="%_h%_h", b="خّ"},
    {a="dd", b="دّ"},
@@ -503,6 +531,108 @@
    {a="%^d", b="ڊ"}
 }
 
+digraphsfv = {
+   -- iʿrāb: straight double quote must be discarded
+   {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
+   {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"},
+   {a="(%-)(\"?At[ui])(%p?%s)", b="%2%3"},
+   {a="(%-)(\"?At[ui])(%p?)$", b="%2%3"},
+   {a="(%-)(\"?Ani)(%p?%s)", b="%2%3"},
+   {a="(%-)(\"?Ani)(%p?)$", b="%2%3"},
+   {a="(%-)(\"?ayni)(%p?%s)", b="%2%3"},
+   {a="(%-)(\"?ayni)(%p?)$", b="%2%3"},
+   {a="(%-)(\"?[uai])(%p?%s)", b="%2%3"},
+   {a="(%-)(\"?[uai])(%p?)$", b="%2%3"},
+   -- ʾiʿrāb (end)
+   -- initial straight double quote gives a connective ʾalif
+   {a="^\"[uai]", b="ٱ"},
+   {a="([%(%[%|%<%s%-])\"[uai]", b="%1ٱ"}, --p
+   -- diphthongs to be resolved before ʾalif conjunctionis
+   {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"},
+   {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"},
+   {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"},
+   {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza
+   -- initial alif without hamza
+   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
+   {a="^([%(%[%|%<]?)([uai])", b="%1ا%2"}, -- initial alif without hamza --p
+   {a="(%s)([%(%[%|%<]?)([uai])", b="%1%2ا%3"}, -- initial alif without hamza --p
+   {a="%-%-", b="ـ"},
+   {a="ؤؤ", b="ؤّ"},
+   {a="أأ", b="أّ"},
+   {a="ئئ", b="ئّ"},
+   {a="bb", b="بّ"},
+   {a="BB", b="ـّ"},
+   {a="(%_)([thd])([thd])", b="%1%2|%3"},
+   {a="tt", b="تّ"},
+   {a="%_t%_t", b="ثّ"},
+   {a="jj", b="جّ"},
+   {a="%^g%^g", b="جّ"},
+   {a="%.h%.h", b="حّ"},
+   {a="xx", b="خّ"},
+   {a="%_h%_h", b="خّ"},
+   {a="dd", b="دّ"},
+   {a="%_d%_d", b="ذّ"},
+   {a="rr", b="رّ"},
+   {a="zz", b="زّ"},
+   {a="ss", b="سّ"},
+   {a="%^s%^s", b="شّ"},
+   {a="%.s%.s", b="صّ"},
+   {a="%.d%.d", b="ضّ"},
+   {a="%.t%.t", b="طّ"},
+   {a="%.z%.z", b="ظّ"},
+   {a="%`%`", b="عّ"},
+   {a="%.g%.g", b="غّ"},
+   {a="ff", b="فّ"},
+   {a="qq", b="قّ"},
+   {a="kk", b="كّ"},
+   {a="ll", b="لّ"},
+   {a="mm", b="مّ"},
+   {a="nn", b="نّ"},
+   {a="hh", b="هّ"},
+   {a="ww", b="وّ"},
+   {a="yy", b="يّ"},
+   -- sukūn begin
+   -- first, take out hyphen if any:
+   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
+   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"},
+   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"},
+   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIYًٌٍ])", b="%1ْ%2"},
+   -- take out sukūn in cases of assimilation
+--   {a="(n)(ْ)(%s)(ر)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(و)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(ي)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(ل)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(م)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(ن)", b="%1%3%4"},
+--   {a="ْ\"", b="\""},
+   -- sukūn end
+   {a="_t", b="ث"},
+   {a="%^g", b="ج"},
+   {a="%.h", b="ح"},
+   {a="_h", b="خ"},
+   {a="_d", b="ذ"},
+   {a="%^s", b="ش"},
+   {a="%.s", b="ص"},
+   {a="%.d", b="ض"},
+   {a="%.t", b="ط"},
+   {a="%.z", b="ظ"},
+   {a="%.g", b="غ"},
+   {a="(U)(A)", b="%1ا"},
+   {a="WA", b="وْا"},
+   {a="(a)W\"", b="%1وا"},
+   {a="(a)W", b="%1وْا"},
+   {a="_A", b="aى"},
+   {a="_u", b="ٗ"},
+   {a="_a", b="ٰ"},
+   {a="_i", b="ٖ"},
+   {a="%.b", b="ٮ"},
+   {a="%.f", b="ڡ"},
+   {a="%.q", b="ٯ"},
+   {a="%.k", b="ک"},
+   {a="%.n", b="ں"},
+   {a="%^d", b="ڊ"}
+}
+
 digraphsfveasy = { -- see the differences under 'easy' marker below
    -- iʿrāb: straight double quote must be discarded
    {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
@@ -518,7 +648,7 @@
    -- ʾiʿrāb (end)
    -- initial straight double quote gives a connective ʾalif
    {a="^\"[uai]", b="ٱ"},
-   {a="([%s%-])\"[uai]", b="%1ٱ"},
+   {a="([%(%[%|%<%s%-])\"[uai]", b="%1ٱ"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"},
    {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"},
@@ -525,9 +655,9 @@
    {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"},
    {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza
    -- initial alif without hamza
-   {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"},
-   {a="^([uai])", b="ا%1"},      -- initial alif without hamza
-   {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza
+   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
+   {a="^([%(%[%|%<]?)([uai])", b="%1ا%2"}, -- initial alif without hamza --p
+   {a="(%s)([%(%[%|%<]?)([uai])", b="%1%2ا%3"}, -- initial alif without hamza --p
    {a="%-%-", b="ـ"},
    {a="ؤؤ", b="ؤّ"},
    {a="أأ", b="أّ"},
@@ -539,6 +669,7 @@
    {a="%_t%_t", b="ثّ"},
    {a="jj", b="جّ"},
    {a="%^g%^g", b="جّ"},
+   {a="%.h%.h", b="حّ"},
    {a="xx", b="خّ"},
    {a="%_h%_h", b="خّ"},
    {a="dd", b="دّ"},
@@ -572,7 +703,9 @@
 --   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"},
 --   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIًٌٍ])", b="%1ْ%2"},
    -- take out sukūn in cases of assimilation
---   {a="(n)(ْ)(%s)([روي])", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(ر)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(و)", b="%1%3%4"},
+--   {a="(n)(ْ)(%s)(ي)", b="%1%3%4"},
 --   {a="(n)(ْ)(%s)([ل])", b="%1%3%4"},
 --   {a="(n)(ْ)(%s)([م])", b="%1%3%4"},
 --   {a="(n)(ْ)(%s)([ن])", b="%1%3%4"},

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua	2016-12-17 20:40:20 UTC (rev 42737)
@@ -64,27 +64,27 @@
    {a="l%-l_ah", b="l-ll_ah"},
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="ال%1%2"},
-   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ال%2%3"},
+   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ال%2%3"}, --p
    -- al- + lām
    {a="^(a)l%-(l)", b="ا%1ل%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3"}, --p
    -- al- + solar consonant
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3"}, --p
    -- assim. art. + solar consonant
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل"}, --p
    -- al- + initial unstable hamza
    {a="^(a)l%-(\")([uai])", b="ا%1لٱ%3"},
-   {a="([%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"}, --p
    {a="^(a)l%-([uai])", b="ا%1لا%2"},
-   {a="([%s%-])(a)l%-([uai])", b="%1ا%2لا%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([uai])", b="%1ا%2لا%3"}, --p
    -- li-/la- + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-(\")([uai])", b="ل%1لٱ%3"},
    {a="l([ai])%-l%-([uai])", b="ل%1لا%2"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="ا%1ل"},
-   {a="([%s%-])(a)l%-", b="%1ا%2ل"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2ل"}, --p
    -- art. with waṣla + lām
    {a="'l%-(l)", b="ال%1"},
    -- art. with waṣla + solar consonant

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua	2016-12-17 20:40:20 UTC (rev 42737)
@@ -95,6 +95,12 @@
    {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda
    {a="(A)(')", b="%1ʾ"}, -- historic madda
    -- initial (needs both ^ and %W patterns)
+   -- 'aw: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
+   -- then the 'initial' rules for the remaining cases
    {a="^(')([ua])", b="ʾ%2"},
    {a="^(')(i)", b="ʾ%2"},
    {a="(%W)(')([ua])", b="%1ʾ%3"},
@@ -127,6 +133,7 @@
 }
 
 tanwintrdmg = {
+   {a="%-?([uai]NU)(%s)([ui])", b="\\arbup{un%3}%2'"},
    {a="%-?uNU", b="\\arbup{un}"},
    {a="%-?aNU", b="\\arbup{an}"},
    {a="%-?iNU", b="\\arbup{in}"},
@@ -138,13 +145,20 @@
    {a="(T)%-?(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="t\\arbup{ani}%3%4"},
    {a="([^TA])%-?(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1\\arbup{ani}%3%4"},
    {a="%-?(iN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="\\arbup{ini}%2%3"},
--- tanwīn + alif without hamza and kasra (ibn)
-   {a="%-?(uN)(%s)(i)", b="\\arbup{uni}%2'"},
-   {a="%-?(aN)(_A)(%s)(i)", b="ạ\\arbup{ni}%3%'"},
-   {a="%-?(aN)(Y)(%s)(i)", b="ạ\\arbup{ni}%3%'"},
-   {a="(T)%-?(aN)(%s)(i)", b="t\\arbup{ani}%3%'"},
-   {a="([^TA])%-?(aN)(%s)(i)", b="%1\\arbup{ani}%3%'"},
-   {a="%-?(iN)(%s)(i)", b="\\arbup{ini}%2%'"},
+   -- tanwīn preceding 'lla_dI/'llatI
+   {a="%-?(uN)(%s)('lla[%_]?[dt])", b="\\arbup{uni}%2%3"},
+   {a="%-?(aN)(_A)(%s)('lla[%_]?[dt])", b="ạ\\arbup{ni}%3%4"},
+   {a="%-?(aN)(Y)(%s)('lla[%_]?[dt])", b="ạ\\arbup{ni}%3%4"},
+   {a="(T)%-?(aN)(%s)('lla[%_]?[dt])", b="t\\arbup{ani}%3%4"},
+   {a="([^TA])%-?(aN)(%s)('lla[%_]?[dt])", b="%1\\arbup{ani}%3%4"},
+   {a="%-?(iN)(%s)('lla[%_]?[dt])", b="\\arbup{ini}%2%3"},
+   -- tanwīn + alif without hamza and kasra (ibn) or dhamma (uhrub)
+   {a="%-?(uN)(%s)([ui])", b="\\arbup{un%3}%2'"},
+   {a="%-?(aN)(_A)(%s)([ui])", b="ạ\\arbup{n%4}%3%'"},
+   {a="%-?(aN)(Y)(%s)([ui])", b="ạ\\arbup{n%4}%3%'"},
+   {a="(T)%-?(aN)(%s)([ui])", b="t\\arbup{an%4}%3%'"},
+   {a="([^TA])%-?(aN)(%s)([ui])", b="%1\\arbup{an%4}%3%'"},
+   {a="%-?(iN)(%s)([ui])", b="\\arbup{in%3}%2%'"},
    --
 -- {a="uN", b="\\arbup{un}"}, (now included in the last line of this table)
    {a="%-?(\"?At)%-?([ui])N", b="\\arbup{%1%2n}"},
@@ -158,24 +172,29 @@
 trigraphstrdmg = { -- trigraphs or more
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="'ll%1%2"},
-   {a="(%s)'ll(a)([%_]?[dt])", b="%1'll%2%3"},
+   {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1'll%2%3"}, --p
+   -- law: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
    -- al- + lām
    {a="^(a)l%-(l)", b="%1l-%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1%2l-%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1%2l-%3"}, --p
    -- al- + solar consonant
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2-%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2%3-%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2%3-%3"}, --p
    -- assim. art. + solar consonant
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1%2-"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-"}, --p
    -- al- + initial unstable hamza
-   {a="^(a)l%-([uai])", b="%1l-%2"},
-   {a="([%s%-])(a)l%-([uai])", b="%1%2l-%3"},
+   {a="^(a)l%-(\"?[uai])", b="%1l-%2"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\"?[uai])", b="%1%2l-%3"}, --p
    -- li-/la- + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="%1l-"},
-   {a="([%s%-])(a)l%-", b="%1%2l-"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1%2l-"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
    {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
@@ -192,7 +211,7 @@
    -- li-/la- + assim. art. + solar consonant is a special orthography
    {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%3"},
    -- art. with waṣla + initial unstable hamza
-   {a="'l%-([uai])", b="'l-%1"},   
+   {a="'l%-(\"?[uai])", b="'l-%1"},
    -- art. with waṣla + lunar consonant (i.e. what remains)
    {a="'l%-", b="'l-"},
    -- the silent wāw
@@ -205,65 +224,13 @@
    -- words ending in -āT with silent wāw/yāʾ
    {a="(_a)UA", b="A"},
    {a="(_a)U", b="A"},
-   {a="(_a)I", b="A"},
-   -- assimilations
-   {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"}
+   {a="(_a)I", b="A"}
 }
 
-trigraphstrdmgeasy = { -- see the differences below under 'easy' tag
-   -- 'llatI / 'llad_I
-   {a="^'ll(a)([%_]?[dt])", b="'ll%1%2"},
-   {a="(%s)'ll(a)([%_]?[dt])", b="%1'll%2%3"},
-   -- al- + lām
-   {a="^(a)l%-(l)", b="%1l-%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1%2l-%3"},
-   -- al- + solar consonant
-   {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2-%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2%3-%3"},
-   -- assim. art. + solar consonant
-   {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1%2-"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-"},
-   -- al- + initial unstable hamza
-   {a="^(a)l%-([uai])", b="%1l-%2"},
-   {a="([%s%-])(a)l%-([uai])", b="%1%2l-%3"},
-   -- li-/la- + art. + initial unstable hamza is a special orthography
-   {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
-   -- al- + lunar consonant (i.e. what remains)
-   {a="^(a)l%-", b="%1l-"},
-   {a="([%s%-])(a)l%-", b="%1%2l-"},
-   -- diphthongs to be resolved before ʾalif conjunctionis
-   {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
-   {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
-   -- art. with waṣla + lām
-   {a="'l%-(l)", b="'l-%1"},
-   -- art. with waṣla + solar consonant
-   {a="'l%-([%_%^%.]?[tdrzsn])", b="'%1-%1"},
-   -- li-/la- + art. + lām
-   {a="l([ai])%-l%-(l)", b="l%1-%2%2"},
-   -- assim. art. with waṣla + solar consonant
-   {a="'([%_%^%.]?[tdrzsn])%-", b="'%1-"},
-   -- li-/la- + art. + solar consonant is a special orthography
-   {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%2"},
-   -- li-/la- + assim. art. + solar consonant is a special orthography
-   {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%3"},
-   -- art. with waṣla + initial unstable hamza
-   {a="'l%-([uai])", b="'l-%1"},   
-   -- art. with waṣla + lunar consonant (i.e. what remains)
-   {a="'l%-", b="'l-"},
-   -- the silent wāw
-   {a="uU$", b="u"},
-   {a="uU(%W)", b="u%1"},
-   {a="aU$", b="a"},
-   {a="aU(%W)", b="a%1"},
-   {a="iU$", b="i"},
-   {a="iU(%W)", b="i%1"},
-   -- words ending in -āT with silent wāw/yāʾ
-   {a="(_a)UA", b="A"},
-   {a="(_a)U", b="A"},
-   {a="(_a)I", b="A"}
+idghamtrdmg = {
    -- assimilations
---easy   {a="(n)(%s)([rlmnwy])", b="%3%2%3"}
-}
+   {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"}
+} 
 
 digraphstrdmg = {
    {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza
@@ -270,20 +237,21 @@
    -- the following two are replaced with the 4 lines next for now
 --   {a="^(\"?[uai])", b="%1"},      -- initial alif without hamza
 --   {a="(%W)(\"?[uai])", b="%1%2"},      -- initial alif without hamza
-   {a="^(\"[uai])", b="'"},      -- initial alif without hamza
-   {a="(%W)(\"[uai])", b="%1'"},      -- initial alif without hamza
-   {a="^([uai])", b="%1"},      -- initial alif without hamza
-   {a="(%W)([uai])", b="%1%2"},      -- initial alif without hamza
+--   {a="^(\"[uai])", b="'"},      -- initial alif without hamza
+--   {a="(%W)(\"[uai])", b="%1'"},      -- initial alif without hamza
+   {a="^(\"?[uai])", b="%1"},      -- initial alif without hamza
+   {a="(%W)(\"?[uai])", b="%1%2"},      -- initial alif without hamza
    -- this is not necessary, take out for now:
 -- {a="([%_]?[uaiUAIY])(%s)([uai])", b="%1%2'"}, -- initial alif without hamza
-   {a="(aW)(%s)(\"?[uai])", b="awu%2%3"},
-   {a="([^%_][uai])(%s)(\"?[uai])", b="%1%2'"},
-   {a="(%_A)(%s)(\"?[uai])", b="ạ%2'"},
-   {a="(Y)(%s)(\"?[uai])", b="ạ%2'"},
-   {a="(%_a)(%s)(\"?[uai])", b="a%2'"},
-   {a="(A)(%s)(\"?[uai])", b="a%2'"},
-   {a="([%_]?[Uu])(%s)(\"?[uai])", b="u%2'"},
-   {a="([%_]?[Ii])(%s)(\"?[uai])", b="i%2'"},
+   {a="(aW)(%s)([%(%[%|%<]?)(\"?[uai])", b="awu%2%3%4"}, --p
+   {a="(UA)(%s)([%(%[%|%<]?)(\"?[uai])", b="u%2%3'"}, --p
+   {a="([^%_][uai])(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2%3'"}, --p
+   {a="(%_A)(%s)([%(%[%|%<]?)(\"?[uai])", b="ạ%2%3'"}, --p
+   {a="(Y)(%s)([%(%[%|%<]?)(\"?[uai])", b="ạ%2%3'"}, --p
+   {a="(%_a)(%s)([%(%[%|%<]?)(\"?[uai])", b="a%2%3'"}, --p
+   {a="(A)(%s)([%(%[%|%<]?)(\"?[uai])", b="a%2%3'"}, --p
+   {a="([%_]?[Uu])(%s)([%(%[%|%<]?)(\"?[uai])", b="u%2%3'"}, --p
+   {a="([%_]?[Ii])(%s)([%(%[%|%<]?)(\"?[uai])", b="i%2%3'"}, --p
    -- ʾiʿrāb hyphen (begin)
    {a="(%-)(\"?[UI]na)(%p?%s)", b="\\arbup{%2}%3"},
    {a="(%-)(\"?[UI]na)(%p?)$", b="\\arbup{%2}%3"},
@@ -298,13 +266,14 @@
    -- ʾiʿrāb hyphen (end)
    -- shorten long vowels preceding ʾalif conjunctionis
    {a="(U)(A)", b="U"},
-   {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awu%2%3"},
-   {a="(%_a)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="a%2%3"},
-   {a="(%_A)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ%2%3"},
-   {a="(A)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="a%2%3"},
-   {a="(Y)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ%2%3"},
-   {a="([%_]?[Uu])(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="u%2%3"},
-   {a="([%_]?[Ii])(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="i%2%3"},
+   --p (next 7 lines, just after %s)
+   {a="(aW)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awu%2%3"},
+   {a="(%_a)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="a%2%3"},
+   {a="(%_A)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ%2%3"},
+   {a="(A)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="a%2%3"},
+   {a="(Y)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ%2%3"},
+   {a="([%_]?[Uu])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="u%2%3"},
+   {a="([%_]?[Ii])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="i%2%3"},
    {a="%-%-", b=""},
 --   {a="T([^uai])", b="%1"},
    {a="T(%p?%s)", b="h%1"},

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua	2016-12-17 20:39:05 UTC (rev 42736)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua	2016-12-17 20:40:20 UTC (rev 42737)
@@ -201,6 +201,12 @@
    {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda
    {a="(A)(')", b="aآء"}, -- historic madda
    -- initial (needs both ^ and %W patterns)
+   -- 'aw: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
+   -- then the 'initial' rules for the remaining cases
    {a="^(')([ua])", b="أ%2"},
    {a="^(')(i)", b="إ%2"},
    {a="(%W)(')([ua])", b="%1أ%3"},
@@ -209,29 +215,29 @@
    -- ^say'aN and .zim'aN are special orthographies
    {a="(%^say)(%')(aN)", b="%1ئ%3"},
    {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
-   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
-   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)$", b="%1ء%3"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)(%W)", b="%1ء%3%4"},
 -- u
-   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
-   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
+   {a="(u)(')([uai][^%.%^%_]N?)$", b="%1ؤ%3"},
+   {a="(u)(')([uai][^%.%^%_]N?)(%W)", b="%1ؤ%3%4"},
    {a="(u)(')$", b="%1ؤ"},
    {a="(u)(')(%W)", b="%1ؤ%3"},
 -- a
    {a="(a)(')(A)$", b="%1آ"},
    {a="(a)(')(A)(%W)", b="%1آ%4"},
-   {a="(a)(')([u]N?)$", b="%1أ%3"},
-   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
+   {a="(a)(')([u][^%.%^%_]N?)$", b="%1أ%3"},
+   {a="(a)(')([u][^%.%^%_]N?)(%W)", b="%1أ%3%4"},
    {a="(a)(')(a)$", b="%1أ%3"},
    {a="(a)(')(a)(%W)", b="%1أ%3%4"},
    {a="(a)(')(aN)$", b="%1أً"},
    {a="(a)(')(aN)(%W)", b="%1أً%4"},
-   {a="(a)(')([i]N?)$", b="%1إ%3"},
-   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
+   {a="(a)(')([i][^%.%^%_]N?)$", b="%1إ%3"},
+   {a="(a)(')([i][^%.%^%_]N?)(%W)", b="%1إ%3%4"},
    {a="(a)(')$", b="%1أ"},
    {a="(a)(')(%W)", b="%1أ%3"},
 -- i
-   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
-   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
+   {a="(i)(')([uai][^%.%^%_]N?)$", b="%1ئ%3"},
+   {a="(i)(')([uai][^%.%^%_]N?)(%W)", b="%1ئ%3%4"},
    {a="(i)(')$", b="%1ئ"},
    {a="(i)(')(%W)", b="%1ئ%3"},
 --
@@ -292,6 +298,12 @@
    {a="(A)(')", b="aاء"}, -- historic madda
    --easy (end)
    -- initial (needs both ^ and %W patterns)
+   -- 'aw: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
+   -- then the 'initial' rules for the remaining cases
    {a="^(')([ua])", b="أ%2"},
    {a="^(')(i)", b="إ%2"},
    {a="(%W)(')([ua])", b="%1أ%3"},
@@ -300,29 +312,29 @@
    -- ^say'aN and .zim'aN are special orthographies
    {a="(%^say)(%')(aN)", b="%1ئ%3"},
    {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
-   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
-   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)$", b="%1ء%3"},
+   {a="([^uai])(')([uai][^%.%^%_]N?)(%W)", b="%1ء%3%4"},
 -- u
-   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
-   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
+   {a="(u)(')([uai][^%.%^%_]N?)$", b="%1ؤ%3"},
+   {a="(u)(')([uai][^%.%^%_]N?)(%W)", b="%1ؤ%3%4"},
    {a="(u)(')$", b="%1ؤ"},
    {a="(u)(')(%W)", b="%1ؤ%3"},
 -- a
    {a="(a)(')(A)$", b="%1آ"},
    {a="(a)(')(A)(%W)", b="%1آ%4"},
-   {a="(a)(')([u]N?)$", b="%1أ%3"},
-   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
+   {a="(a)(')([u][^%.%^%_]N?)$", b="%1أ%3"},
+   {a="(a)(')([u][^%.%^%_]N?)(%W)", b="%1أ%3%4"},
    {a="(a)(')(a)$", b="%1أ%3"},
    {a="(a)(')(a)(%W)", b="%1أ%3%4"},
    {a="(a)(')(aN)$", b="%1أً"},
    {a="(a)(')(aN)(%W)", b="%1أً%4"},
-   {a="(a)(')([i]N?)$", b="%1إ%3"},
-   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
+   {a="(a)(')([i][^%.%^%_]N?)$", b="%1إ%3"},
+   {a="(a)(')([i][^%.%^%_]N?)(%W)", b="%1إ%3%4"},
    {a="(a)(')$", b="%1أ"},
    {a="(a)(')(%W)", b="%1أ%3"},
 -- i
-   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
-   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
+   {a="(i)(')([uai][^%.%^%_]N?)$", b="%1ئ%3"},
+   {a="(i)(')([uai][^%.%^%_]N?)(%W)", b="%1ئ%3%4"},
    {a="(i)(')$", b="%1ئ"},
    {a="(i)(')(%W)", b="%1ئ%3"},
 --
@@ -415,27 +427,32 @@
 trigraphs = { -- trigraphs or more
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="الّ%1%2"},
-   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1الّ%2%3"},
+   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1الّ%2%3"}, --p
+   -- law: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
    -- al- + lām
    {a="^(a)l%-(l)", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"}, --p
    -- al- + solar consonant
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, --p
    -- assim. art. + solar consonant
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"}, --p
    -- al- + initial unstable hamza
    {a="^(a)l%-(\")([uai])", b="ا%1ل%3ٱ"},
-   {a="([%s%-])(a)l%-(\")([uai])", b="%1ا%2ل%4ٱ"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\")([uai])", b="%1ا%2ل%4ٱ"}, --p
    {a="^(a)l%-([uai])", b="ا%1ل%2ا"},
-   {a="([%s%-])(a)l%-([uai])", b="%1ا%2ل%3ا"},
+   {a="([%(%[%|%<%s%-])(a)l%-([uai])", b="%1ا%2ل%3ا"}, --p
    -- li-/la- + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-(\")([uai])", b="ل%1ل%3ٱ"},
    {a="l([ai])%-l%-([uai])", b="ل%1ل%2ا"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="ا%1ل"},
-   {a="([%s%-])(a)l%-", b="%1ا%2ل"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2ل"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
    {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
@@ -467,7 +484,10 @@
    -- words ending in -āT with silent wāw/yāʾ
    {a="(_a)UA", b="%1وا"},
    {a="(_a)U", b="%1و"},
-   {a="(_a)I", b="%1ي"},
+   {a="(_a)I", b="%1ي"}
+}
+
+idgham = {
    -- assimilations
    {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
 }
@@ -477,27 +497,32 @@
    {a="l%-l_ah", b="l-ll_ah"},
    -- 'llatI / 'llad_I
    {a="^'ll(a)([%_]?[dt])", b="الّ%1%2"},
-   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1الّ%2%3"},
+   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1الّ%2%3"}, --p
+   -- law: the diphthong is to be resoved into 'awi' (next 4 lines)
+   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
+   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
+   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
+   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
    -- al- + lām (easy)
    {a="^(a)l%-(l)", b="ا%1ل%2"},
-   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3"}, --p
    -- al- + solar consonant (easy)
    {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2"},
-   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3"},
+   {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3"}, --p
    -- assim. art. + solar consonant (easy)
    {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل"},
-   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل"},
+   {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل"}, --p
    -- al- + initial unstable hamza
    {a="^(a)l%-(\")([uai])", b="ا%1ل%3ٱ"},
-   {a="([%s%-])(a)l%-(\")([uai])", b="%1ا%2ل%4ٱ"},
+   {a="([%(%[%|%<%s%-])(a)l%-(\")([uai])", b="%1ا%2ل%4ٱ"}, --p
    {a="^(a)l%-([uai])", b="ا%1ل%2ا"},
-   {a="([%s%-])(a)l%-([uai])", b="%1ا%2ل%3ا"},
+   {a="([%(%[%|%<%s%-])(a)l%-([uai])", b="%1ا%2ل%3ا"}, --p
    -- li-/la- + art. + initial unstable hamza is a special orthography
    {a="l([ai])%-l%-(\")([uai])", b="ل%1ل%3ٱ"},
    {a="l([ai])%-l%-([uai])", b="ل%1ل%2ا"},
    -- al- + lunar consonant (i.e. what remains)
    {a="^(a)l%-", b="ا%1ل"},
-   {a="([%s%-])(a)l%-", b="%1ا%2ل"},
+   {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2ل"}, --p
    -- diphthongs to be resolved before ʾalif conjunctionis
    {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
    {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
@@ -529,9 +554,7 @@
    -- words ending in -āT with silent wāw/yāʾ
    {a="(_a)UA", b="%1وا"},
    {a="(_a)U", b="%1و"},
-   {a="(_a)I", b="%1ي"},
-   -- assimilations
---easy   {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
+   {a="(_a)I", b="%1ي"}
 }
 
 digraphs = {
@@ -549,12 +572,12 @@
    -- ʾiʿrāb (end)
    -- initial straight double quote gives a connective ʾalif
    {a="^\"[uai]", b="ٱ"},
-   {a="([%s%-])\"[uai]", b="%1ٱ"},
+   {a="([%(%[%|%<%s%-])\"[uai]", b="%1ٱ"}, --p
    {a="(aW)(%s)([uai])", b="awuا%2%3"},
    -- hyphen + initial alif without hamza:
    {a="(%-)([uai])([%^%_%.%`]?)(%a)", b="%1ا%3%4"},
-   {a="^([uai])", b="ا%1"},      -- initial alif without hamza
-   {a="(%s)([uai])", b="%1ا"}, -- initial alif without hamza
+   {a="^([%(%[%|%<]?)([uai])", b="%1ا%2"}, -- initial alif without hamza --p
+   {a="(%s)([%(%[%|%<]?)([uai])", b="%1%2ا"}, -- initial alif without hamza --p
    {a="%-%-", b="ـ"},
    {a="ؤؤ", b="ؤّ"},
    {a="أأ", b="أّ"},
@@ -566,6 +589,7 @@
    {a="%_t%_t", b="ثّ"},
    {a="jj", b="جّ"},
    {a="%^g%^g", b="جّ"},
+   {a="%.h%.h", b="حّ"},
    {a="xx", b="خّ"},
    {a="%_h%_h", b="خّ"},
    {a="dd", b="دّ"},
@@ -680,7 +704,11 @@
    {a="%+%@%[", b="]"},
    {a="%-%@%[", b="["},
    {a="%.", b="."},
-   {a="([^0-9])%,", b="%1،"},
+   -- replaced with the next two rules to make the Arabic comma work
+   --   after \abraces{}
+--   {a="([^0-9])%,", b="%1،"},
+   {a="%,", b="،"},
+   {a="([%d])%،", b="%1,"},
    {a="%?", b="؟"},
    {a="%;", b="؛"},
 }



More information about the tex-live-commits mailing list