texlive[42510] Master/texmf-dist: arabluatex (14nov16)

commits+karl at tug.org commits+karl at tug.org
Mon Nov 14 23:35:32 CET 2016


Revision: 42510
          http://tug.org/svn/texlive?view=revision&revision=42510
Author:   karl
Date:     2016-11-14 23:35:32 +0100 (Mon, 14 Nov 2016)
Log Message:
-----------
arabluatex (14nov16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/arabluatex/arabluatex.pdf
    trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx
    trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.ins
    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_trans.lua

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty

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

Modified: trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx	2016-11-14 22:35:23 UTC (rev 42509)
+++ trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.dtx	2016-11-14 22:35:32 UTC (rev 42510)
@@ -27,7 +27,7 @@
 %<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package-info>\ProvidesPackage{arabluatex}
 %<*package-info>
-    [2016/10/05 v1.4.5 An ArabTeX-like interface for LuaLaTeX]
+    [2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
 %</package-info>
 %
 %<*driver>
@@ -145,7 +145,8 @@
 \defaultfontfeatures{RawFeature={+liga}}
 \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps},
   RawFeature={+mark;+ccmp;+ss05;+ss06}]
-\usepackage{arabluatex}[2016/10/05]
+\usepackage{arabluatex}[2016/11/14]
+\usepackage[nopar]{quran}
 \usepackage{varioref}
 \usepackage{hypdoc}
 \hypersetup{unicode=true, colorlinks, allcolors=blue,
@@ -198,7 +199,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{379}
+% \CheckSum{561}
 %
 % \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
@@ -249,10 +250,10 @@
 % \maketitle
 % \footnotesize
 % \tableofcontents
+% \pagebreak
 % \listoftables
 % \normalsize
 %
-% \pagebreak
 % \begin{abstract}
 %   This package provides for \LuaLaTeX\ an Arab{\TeX}-like interface
 %   to generate Arabic writing from an \textsc{ascii}
@@ -579,7 +580,34 @@
 % \iffalse
 %</example>
 % \fi
-% 
+%
+% \paragraph{Caveat}
+% For some reason, left-to-right paragraphs that start with Arabic
+% words lose their indentation. For the time being, this can be
+% circumvented by appending the command \cs{indent} at the
+% commencement of such paragraphs.
+%
+% \label{ref:ltr-lists}%
+% The same remark applies to left-to-right list environments: when
+% items start with Arabic words, the \cs{arb} command must be prefixed
+% with \cs{indent}. The following example comes from \textcite[i. 213
+% C]{Wright}:--- %
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+  \begin{enumerate}[XVI.]
+  \item \indent\arb{fawA`ilu}*.
+    \begin{enumerate}[1.]
+    \item \indent\arb{fA`aluN}; as \arb{_hAtamuN} \emph{a
+        signet-ring}, ...
+    \end{enumerate}
+  \end{enumerate}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
 % \DescribeEnv{arab} Running paragraphs of Arabic text should rather
 % be placed inside an \emph{Arabic environment}
 % 
@@ -2163,7 +2191,37 @@
 % Al-intiqaADi} with the correct vowel \meta{i} in place of the %
 % \SetInputScheme{arabtex}%
 % \arb[trans]{'alif-u 'l-wa.sl-i}.
-% 
+%
+% \section{Unicode Arabic input}
+% \label{sec:unicode-input}
+% \NEWfeature{v1.5} As said above in \vref{sec:buckwalter-scheme}
+% about the Buckwalter input scheme, even though \package{arabluatex}
+% is primarily designed to process the Arab\TeX\ notation, it also
+% accepts unicode Arabic input. It should be noted that
+% \package{arabluatex} does in no way interfere with unicode Arabic
+% input: none of the options |voc|, |fullvoc|, |novoc| or |trans| will
+% have any effect on plain unicode Arabic for the time being.
+%
+% That said, there are two ways of inserting unicode
+% Arabic:
+% \begin{compactenum}[(a)] 
+% \item \DescribeMacro{\txarb} The \cs{txarb}\marg{unicode Arabic}
+%   command for inserting unicode Arabic text in paragraphs;
+% \item The \DescribeEnv{txarab} |txarab| environment for inserting
+%   running paragraphs of Arabic text, like so:---\\%
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+  \begin{txarab}
+    <Unicode Arabic text>
+  \end{txarab}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi
+% \end{compactenum}
+%
 % \section{\LaTeX\ Commands in Arabic environments}
 % \label{sec:commands-in-arb}
 % \paragraph{General principle} \label{ref:cmd-inside-arabic}\LaTeX\
@@ -2296,6 +2354,133 @@
 %</example>
 % \fi
 %
+% \subsection{Environments}
+% \label{sec:environments}
+% \changes{v1.5}{2016/11/14}{Environments may be nested inside the
+%   \texttt{arab} environment}
+% \NEWfeature{v1.5} Environments such as
+% \arabluaverb{\begin{quote}... \end{quote}} may be nested inside the
+% |arab| environment. Up to one optional argument may be passed to
+% each nested environment, like so:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+\begin{arab}
+  \begin{<environment>}[<options>]
+    <Arabic text>
+  \end{<environment>}
+\end{arab}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi
+%
+% In the following example, the \package{quoting} package is used:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+  \setquotestyle{arabic}
+  \begin{arab}[fullvoc]
+    kAna \cap{'abU} \cap{'l-hu_dayli} 'ahd_A 'il_A \cap{muwaysiN}
+    dajAjaTaN. wa-kAnat dajAjatu-hu 'llatI 'ahdA-hA dUna mA kAna
+    yuttaxa_du li-\cap{muwaysiN}. wa-l_akinna-hu bi-karami-hi
+    wa-bi-.husni xuluqi-hi 'a.zhara 'l-ta`ajjuba min simani-hA
+    wa-.tIbi la.hmi-hA. wa-kAna <\cap{'abU} \cap{'l-hu_dayli}> yu`rafu
+    bi-'l-'imsAki 'l-^sadIdi. fa-qAla: \enquote{wa-kayfa ra'ayta yA
+      \cap{'abA} \cap{`imrAna} tilka 'l-dajAjaTa?} qAla:
+    \enquote{kAnat `ajabaN mina 'l-`ajabi!}  fa-yaqUlu:
+    \begin{quoting}[begintext=», endtext=«]
+      wa-tadrI mA jinsu-hA? wa-tadrI mA sinnu-hA?  fa-'inna
+      'l-dajAjaTa 'inna-mA ta.tIbu bi-'l-jinsi wa-'l-sinni. wa-tadrI
+      bi-'ayyi ^say'iN kunnA nusamminu-hA? wa-fI 'ayyi makAniN kunnA
+      na`lifu-hA?
+    \end{quoting}
+    fa-lA yazAlu fI h_a_dA wa-'l-'A_haru ya.d.haku .da.hkaN na`rifu-hu
+    na.hnu wa-lA ya`rifu-hu \cap{'abU} \cap{'l-hu_dayli}.
+  \end{arab}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
+% \subsubsection{Lists}
+% \label{sec:lists}
+% Lists environments are also accepted inside the |arab|
+% environment. One may either use any of the three standard list
+% environments, viz. |itemize|, |enumerate| and |description| or use a
+% package that provides additional refinements such as
+% \package{paralist}.
+%
+% To take a first example, should one wish to typeset a list of
+% manuscripts, the |description| environment may be used like so:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+ \setRL\paragraph{\arb[novoc]{rumUzi 'l-kitAbi}}\setLR
+ \begin{arab}[novoc]
+  \begin{description}
+   \item[b] max.tU.tu 'l-maktabaTi 'l-'ahliyyaTi bi-\cap{bArIs} 2860
+    `arabiyyuN.
+   \item[s] max.tU.tu 'l-maktabaTi 'l-'ahliyyaTi bi-\cap{bArIs} 2859
+    `arabiyyuN.
+   \item[m] max.tU.tu majlisi \arb[novoc]{^sUrAY malY} .tahrAna 521.
+  \end{description}
+ \end{arab}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
+% As a second example, the contents of a treatise may be typeset with
+% the standard list environments, like so:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+  \setRL\centerline{\arb{\textbf{al-qAnUnu fI 'l-.tibbi}}}\setLR
+  \begin{arab}
+    \begin{itemize}
+    \item \textbf{al-fannu 'l-'awwalu} fI .haddi 'l-.tibbi
+      wa-maw.dU`Ati-hi mina 'l-'umUri 'l-.tabI`iyyaTi wa-ya^stamilu
+      `al_A sittaTi ta`AlImiN
+      \begin{itemize}
+        \item \textbf{al-ta`lImu 'l-'awwalu} [wa-huwa fa.slAni]
+          \begin{itemize}
+          \item \textbf{al-fa.slu 'l-'awwalu}
+          \end{itemize}
+      \end{itemize}
+    \end{itemize}
+  \end{arab}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
+%
+% \paragraph{Caveat}
+% The various French definition files of the \package{babel} package
+% viz. |acadian|, |canadien|, |francais|, |frenchb| or |french| all
+% redefine the list environments, which breaks the standard definition
+% file that is used by \package{arabluatex}. Therefore,
+% \package{babel-french} must be loaded with the option
+% |StandardLayout=true|, like so:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+\usepackage[french]{babel}
+\frenchbsetup{StandardLayout=true}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi%
+% This option will prevent \package{babel-french} from interfering
+% with the layout of the document. Then the package \package{paralist}
+% may be used to make the lists \enquote*{compact} as
+% \package{babel-french} do.
+%
 % \subsection{\package{csquotes}}
 % \label{sec:csquotes}
 % The recommended way of inserting quotation marks in running Arabic
@@ -2357,6 +2542,48 @@
 % \iffalse
 %</example>
 % \fi
+%
+% \subsection{\package{quran}}
+% \label{sec:pkg-quran}
+% \changes{v1.5}{2016/11/14}{Compatibility with the \textsf{quran}
+% package} \package{arabluatex} is compatible with the \package{quran}
+% package so that both can be used in conjunction with one another for
+% typesetting the \arb[trans]{\cap{qur'An}}. As \package{quran} draws
+% the text of the \arb[trans]{\cap{qur'An}} from a unicode encoded
+% database, its commands have to be passed as arguments to the
+% \cs{txarb} command for short insertions in left-to-right paragraphs,
+% or inserted inside the \index{txarab=txarab (environment)}|txarab|
+% environment for typesetting running paragraphs of
+% \arb[trans]{\cap{qur'An}}\emph{ic} text (see above
+% \vref{sec:unicode-input} for more details). Please note that
+% \package{arabluatex} takes care of formatting the Arabic: therefore,
+% it is recommended to load the \package{quran} package with the
+% option |nopar|, after \package{arabluatex} itself has been loaded,
+% like so:--- %
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluaverbatim}
+  \usepackage{arabluatex}
+  \usepackage[nopar]{quran}
+\end{arabluaverbatim}
+% \iffalse
+%</example>
+% \fi
+%
+% As an example, the following code will typeset the \arb[trans]{sUraT}
+% \arb[trans]{al-\cap{fAti.haT}}:---
+% \iffalse
+%<*example>
+% \fi
+\begin{arabluacode}
+  \begin{txarab}
+    \quransurah[1]
+  \end{txarab}
+\end{arabluacode}
+% \iffalse
+%</example>
+% \fi
 % 
 % \section{Future work}
 % \label{sec:future-work}
@@ -2399,7 +2626,7 @@
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{arabluatex}%
-[2016/10/05 v1.4.5 An ArabTeX-like interface for LuaLaTeX]
+[2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
 \RequirePackage{ifluatex}
 %    \end{macrocode}
 % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning
@@ -2426,20 +2653,20 @@
 \def\al at mode@novoc{novoc}
 \def\al at mode@trans{trans}
 %    \end{macrocode}
-% The following line will be used in the next release of
-% \package{arabluatex}:
-%    \begin{macrocode}
-% \newif\ifal at mode@defined
-%    \end{macrocode}
 % Packages that are required by \package{arabluatex}:
 %    \begin{macrocode}
+\RequirePackage{etoolbox}
+\RequirePackage{arabluatex-patch}
 \RequirePackage{fontspec}
 \RequirePackage{amsmath}
-\RequirePackage{etoolbox}
 \RequirePackage{luacode}
 \RequirePackage{xparse}
 \RequirePackage{environ}
 %    \end{macrocode}
+% The following boolean will be set to |true| in |RL| mode:
+%    \begin{macrocode}
+\newbool{al at rlmode}
+%    \end{macrocode}
 % Here begins the real work: load |arabluatex.lua|:
 %    \begin{macrocode}
 \luadirect{dofile(kpse.find_file("arabluatex.lua"))}
@@ -2462,13 +2689,13 @@
 %   This neutralizes what is defined by the same command in
 %   \package{luabidi}:
 %    \begin{macrocode}
-\AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}}
+\AtBeginDocument{\def\setRL{\booltrue{al at rlmode}\pardir TRT\textdir TRT}}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\setLR}
 %   The same applies to \cs{setLR}:
 %    \begin{macrocode}
-\AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}}
+\AtBeginDocument{\def\setLR{\boolfalse{al at rlmode}\pardir TLT\textdir TLT}}
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\LR} This command typesets its argument from left to
@@ -2599,12 +2826,12 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\txarb} \cs{txarb} sets the direction to right-to-left
-%   and selects the Arabic font. As it is supposed to be used
-%   internally by several Lua functions, this command is not
-%   documented, but available to the user should he wish to insert
+%   and selects the Arabic font. It is used internally by several Lua
+%   functions, but available to the user should he wish to insert
 %   |utf8| Arabic text in his document.
 % \begin{macro}{\txtrans} \cs{txtrans} is used internally by several
-% Lua functions to insert transliterated Arabic text.
+% Lua functions to insert transliterated Arabic text. Therefore, it is
+% not documented.
 %    \begin{macrocode}
 \DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir
   TRT\arabicfont#1\egroup}
@@ -2613,6 +2840,18 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \begin{environment}{txarab}
+%   \changes{v1.5}{2016/11/14}{New \texttt{txarab} environment for
+%   typesetting running paragraphs in unicode Arabic} The |txarab|
+%   environment does for paragraphs the same as \cs{txarb} does for
+%   short insertions of |utf8| Arabic text.
+%    \begin{macrocode}
+\NewDocumentEnvironment{txarab}{}{%
+  \par%
+  \booltrue{al at rlmode}%
+  \pardir TRT\textdir TRT\arabicfont}{\par}
+%    \end{macrocode}
+% \end{environment}
 % \begin{macro}{\arb}
 %   The \cs{arb} command detects which Arabic mode is to be used,
 %   either globally if no option is set, or locally, then passes its
@@ -2652,20 +2891,24 @@
 \NewEnviron{arab}[1][\al at mode]%
 {\par\edef\@tempa{#1}%
   \ifx\@tempa\al at mode@voc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processvoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al at mode@fullvoc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al at mode@novoc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processnovoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
-  \else \ifx\@tempa\al at mode@trans%
+  \else%
+  \ifx\@tempa\al at mode@trans%
   \bgroup\pardir TLT\textdir TLT\al at trans@style%
   \luadirect{tex.sprint(processtrans(\luastringO{\BODY},
     \luastringO{\al at trans@convention},
@@ -2737,15 +2980,144 @@
 %    \end{macrocode}
 % \end{macro}
 % That is it. Say goodbye before leaving.
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \subsection*{Patches}
+% \label{sec:patches}
+%
+% \iffalse
+%<*patch>
+% \fi
 %    \begin{macrocode}
-\endinput
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{arabluatex-patch}%
+[2016/11/14 v1.0 patches for arabluatex]
 %    \end{macrocode}
+% I have put in a separate |.sty| file external lines of code that
+% I had to patch for a good reason. I hate doing this, and hopefully,
+% most of these lines will disappear as soon as they are not required
+% anymore.
 %
-% \printbibliography[heading=bibintoc]
+% The following is taken from |latex.ltx|. I had to make this patch
+% for I could not find a way to process the list environments in
+% right-to-left mode. The \LuaTeX\ primitives \cs{bodydir} and
+% \cs{pagedir} will eventually allow us to get rid of this:
+%    \begin{macrocode}
+\def\list#1#2{%
+  \ifnum \@listdepth >5\relax
+    \@toodeep
+  \else
+    \global\advance\@listdepth\@ne
+  \fi
+  \rightmargin\z@
+  \listparindent\z@
+  \itemindent\z@
+  \csname @list\romannumeral\the\@listdepth\endcsname
+  \def\@itemlabel{#1}%
+  \let\makelabel\@mklab
+  \@nmbrlistfalse
+  #2\relax
+  \@trivlist
+  \parskip\parsep
+  \parindent\listparindent
+  \advance\linewidth -\rightmargin
+  \advance\linewidth -\leftmargin
+%    \end{macrocode}
+% patch begins:
+%    \begin{macrocode}
+  \ifbool{al at rlmode}{\advance\@totalleftmargin \rightmargin}%
+  {\advance\@totalleftmargin \leftmargin}
+%    \end{macrocode}
+% patch ends.
+%    \begin{macrocode}
+  \parshape \@ne \@totalleftmargin \linewidth
+  \ignorespaces}
+\def\@item[#1]{%
+  \if at noparitem
+    \@donoparitem
+  \else
+    \if at inlabel
+      \indent \par
+    \fi
+    \ifhmode
+      \unskip\unskip \par
+    \fi
+    \if at newlist
+      \if at nobreak
+        \@nbitem
+      \else
+        \addpenalty\@beginparpenalty
+        \addvspace\@topsep
+        \addvspace{-\parskip}%
+      \fi
+    \else
+      \addpenalty\@itempenalty
+      \addvspace\itemsep
+    \fi
+    \global\@inlabeltrue
+  \fi
+  \everypar{%
+    \@minipagefalse
+    \global\@newlistfalse
+    \if at inlabel
+      \global\@inlabelfalse
+      {\setbox\z@\lastbox
+       \ifvoid\z@
+         \kern-\itemindent
+       \fi}%
+      \box\@labels
+      \penalty\z@
+    \fi
+    \if at nobreak
+      \@nobreakfalse
+      \clubpenalty \@M
+    \else
+      \clubpenalty \@clubpenalty
+      \everypar{}%
+    \fi}%
+  \if at noitemarg
+    \@noitemargfalse
+    \if at nmbrlist
+      \refstepcounter\@listctr
+    \fi
+  \fi
+%    \end{macrocode}
+% patch begins:
+%    \begin{macrocode}
+  \ifbool{al at rlmode}{\sRLbox\@tempboxa{\makelabel{#1}}}{%
+  \sbox\@tempboxa{\makelabel{#1}}}%
+  \ifbool{al at rlmode}{\global\setbox\@labels\hbox dir TRT}%
+  {\global\setbox\@labels\hbox}{%
+%    \end{macrocode}
+% patch ends.
+%    \begin{macrocode}
+    \unhbox\@labels
+    \hskip \itemindent
+    \hskip -\labelwidth
+    \hskip -\labelsep
+    \ifdim \wd\@tempboxa >\labelwidth
+      \box\@tempboxa
+    \else
+      \hbox to\labelwidth {\unhbox\@tempboxa}%
+    \fi
+    \hskip \labelsep}%
+  \ignorespaces}
+%    \end{macrocode}
+% This is adapted from Vafa Khalighi's \package{bidi} package. Thanks
+% to him.
+%    \begin{macrocode}
+\long\def\sRLbox#1#2{\setbox#1\hbox dir TRT{%
+  \color at setgroup#2\color at endgroup}}
+%    \end{macrocode}
 %
 % \iffalse
-%</package>
+%</patch>
 % \fi
 %
+% \printbibliography[heading=bibintoc]
+%
 % \Finale
 \endinput

Modified: trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.ins
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.ins	2016-11-14 22:35:23 UTC (rev 42509)
+++ trunk/Master/texmf-dist/source/lualatex/arabluatex/arabluatex.ins	2016-11-14 22:35:32 UTC (rev 42510)
@@ -73,7 +73,10 @@
 
 \endpreamble
 
-\generate{\file{arabluatex.sty}{\from{arabluatex.dtx}{package}}}
+\generate{%
+		  \file{arabluatex.sty}{\from{arabluatex.dtx}{package}}
+		  \file{arabluatex-patch.sty}{\from{arabluatex.dtx}{patch}}
+		  }
 
 \Msg{***********************************************************}
 \Msg{*}
@@ -83,6 +86,7 @@
 \Msg{* more on this}
 \Msg{*}
 \Msg{* \space\space arabluatex.sty}
+\Msg{* \space\space arabluatex-patch.sty}
 \Msg{* \space\space arabluatex.lua}
 \Msg{* \space\space arabluatex_voc.lua}
 \Msg{* \space\space arabluatex_fullvoc.lua}

Added: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty	2016-11-14 22:35:32 UTC (rev 42510)
@@ -0,0 +1,136 @@
+%%
+%% This is file `arabluatex-patch.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% arabluatex.dtx  (with options: `patch')
+%% 
+%% This is a generated file.
+%% 
+%% This file is part of the `arabluatex' package
+%% 
+%% ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
+%% Copyright (C) 2016  Robert Alessi
+%% 
+%% Please send error reports and suggestions for improvements to Robert
+%% Alessi <alessi at robertalessi.net>
+%% 
+%% This program is free software: you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by
+%% the Free Software Foundation, either version 3 of the License, or
+%% (at your option) any later version.
+%% 
+%% This program is distributed in the hope that it will be useful, but
+%% WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%% General Public License for more details.
+%% 
+%% You should have received a copy of the GNU General Public License
+%% along with this program.  If not, see
+%% <http://www.gnu.org/licenses/>.
+%% 
+%% This release of 'arabluatex' consists of the following source files:
+%% - arabluatex.ins
+%% - arabluatex.dtx
+%% - arabluatex.lua
+%% - arabluatex_voc.lua
+%% - arabluatex_fullvoc.lua
+%% - arabluatex_novoc.lua
+%% - arabluatex_trans.lua
+%% 
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{arabluatex-patch}%
+[2016/11/14 v1.0 patches for arabluatex]
+\def\list#1#2{%
+  \ifnum \@listdepth >5\relax
+    \@toodeep
+  \else
+    \global\advance\@listdepth\@ne
+  \fi
+  \rightmargin\z@
+  \listparindent\z@
+  \itemindent\z@
+  \csname @list\romannumeral\the\@listdepth\endcsname
+  \def\@itemlabel{#1}%
+  \let\makelabel\@mklab
+  \@nmbrlistfalse
+  #2\relax
+  \@trivlist
+  \parskip\parsep
+  \parindent\listparindent
+  \advance\linewidth -\rightmargin
+  \advance\linewidth -\leftmargin
+  \ifbool{al at rlmode}{\advance\@totalleftmargin \rightmargin}%
+  {\advance\@totalleftmargin \leftmargin}
+  \parshape \@ne \@totalleftmargin \linewidth
+  \ignorespaces}
+\def\@item[#1]{%
+  \if at noparitem
+    \@donoparitem
+  \else
+    \if at inlabel
+      \indent \par
+    \fi
+    \ifhmode
+      \unskip\unskip \par
+    \fi
+    \if at newlist
+      \if at nobreak
+        \@nbitem
+      \else
+        \addpenalty\@beginparpenalty
+        \addvspace\@topsep
+        \addvspace{-\parskip}%
+      \fi
+    \else
+      \addpenalty\@itempenalty
+      \addvspace\itemsep
+    \fi
+    \global\@inlabeltrue
+  \fi
+  \everypar{%
+    \@minipagefalse
+    \global\@newlistfalse
+    \if at inlabel
+      \global\@inlabelfalse
+      {\setbox\z@\lastbox
+       \ifvoid\z@
+         \kern-\itemindent
+       \fi}%
+      \box\@labels
+      \penalty\z@
+    \fi
+    \if at nobreak
+      \@nobreakfalse
+      \clubpenalty \@M
+    \else
+      \clubpenalty \@clubpenalty
+      \everypar{}%
+    \fi}%
+  \if at noitemarg
+    \@noitemargfalse
+    \if at nmbrlist
+      \refstepcounter\@listctr
+    \fi
+  \fi
+  \ifbool{al at rlmode}{\sRLbox\@tempboxa{\makelabel{#1}}}{%
+  \sbox\@tempboxa{\makelabel{#1}}}%
+  \ifbool{al at rlmode}{\global\setbox\@labels\hbox dir TRT}%
+  {\global\setbox\@labels\hbox}{%
+    \unhbox\@labels
+    \hskip \itemindent
+    \hskip -\labelwidth
+    \hskip -\labelsep
+    \ifdim \wd\@tempboxa >\labelwidth
+      \box\@tempboxa
+    \else
+      \hbox to\labelwidth {\unhbox\@tempboxa}%
+    \fi
+    \hskip \labelsep}%
+  \ignorespaces}
+\long\def\sRLbox#1#2{\setbox#1\hbox dir TRT{%
+  \color at setgroup#2\color at endgroup}}
+\endinput
+%%
+%% End of file `arabluatex-patch.sty'.


Property changes on: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex-patch.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua	2016-11-14 22:35:23 UTC (rev 42509)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua	2016-11-14 22:35:32 UTC (rev 42510)
@@ -29,6 +29,9 @@
 
 local function protectarb(str)
    str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3")
+   str = string.gsub(str, "(\\begin.?)(%b{})(%b[])", "\\@begin%3%2")
+   str = string.gsub(str, "(\\begin.?)(%b{})", "\\@begin%2")
+   str = string.gsub(str, "(\\end.?)(%b{})", "\\@end%2")
    str = string.gsub(str, "\\par", "\\p at r{}")
    str = string.gsub(str, "\\@@par", "\\p at r{}")
 return str
@@ -36,11 +39,21 @@
 
 local function unprotectarb(str)
    str = string.gsub(str, "(\\@arb)(%[.-%])(%b{})", "\\arb%2%3")
+   str = string.gsub(str, "(\\@begin)(%b[])(%b{})", "\\begin%3%2")
+   str = string.gsub(str, "(\\@begin)(%b{})", "\\begin%2")
+   str = string.gsub(str, "(\\@end)(%b{})", "\\end%2")
    str = string.gsub(str, "\\p at r{}", "\\par")
 return str
 end
 
 local function breakcmd(str)
+   -- process \item[], then \item[]
+	str = string.gsub(str, "\\(item.?)(%b[])",
+	  function(tag, body)
+	  body = string.sub(body, 2, -2)
+	  return string.format("}\\item[\\arb{%s}] \\arb{", body)
+	end)
+	str = string.gsub(str, "(\\item)(%s+)", "%1{}%2")
    -- \edtext
    str = string.gsub(str, "\\(edtext.-)(%b{})(%b{})",
 	function(tag, bodylem, bodyvar)

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty	2016-11-14 22:35:23 UTC (rev 42509)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty	2016-11-14 22:35:32 UTC (rev 42510)
@@ -41,7 +41,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{arabluatex}%
-[2016/10/05 v1.4.5 An ArabTeX-like interface for LuaLaTeX]
+[2016/11/14 v1.5 An ArabTeX-like interface for LuaLaTeX]
 \RequirePackage{ifluatex}
 \ifluatex\else
  \PackageError{arabluatex}{lualatex needed}{%
@@ -60,12 +60,14 @@
 \def\al at mode@fullvoc{fullvoc}
 \def\al at mode@novoc{novoc}
 \def\al at mode@trans{trans}
+\RequirePackage{etoolbox}
+\RequirePackage{arabluatex-patch}
 \RequirePackage{fontspec}
 \RequirePackage{amsmath}
-\RequirePackage{etoolbox}
 \RequirePackage{luacode}
 \RequirePackage{xparse}
 \RequirePackage{environ}
+\newbool{al at rlmode}
 \luadirect{dofile(kpse.find_file("arabluatex.lua"))}
 \luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))}
 \AtBeginDocument{\ifdefined\arabicfont\relax\else
@@ -72,8 +74,8 @@
 \PackageWarning{arabluatex}{\string\arabicfont\ is not defined.^^JI
   will try to load Amiri}%
 \newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}%
-\AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}}
-\AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}}
+\AtBeginDocument{\def\setRL{\booltrue{al at rlmode}\pardir TRT\textdir TRT}}
+\AtBeginDocument{\def\setLR{\boolfalse{al at rlmode}\pardir TLT\textdir TLT}}
 \AtBeginDocument{\ifdef{\LR}%
   {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}
   {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}}
@@ -109,6 +111,10 @@
   TRT\arabicfont#1\egroup}
 \DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir
   TLT\al at trans@font#1\egroup}
+\NewDocumentEnvironment{txarab}{}{%
+  \par%
+  \booltrue{al at rlmode}%
+  \pardir TRT\textdir TRT\arabicfont}{\par}
 \DeclareDocumentCommand{\arb}{O{\al at mode} +m}%
 {\edef\@tempa{#1}%
   \ifx\@tempa\al at mode@voc%
@@ -137,20 +143,24 @@
 \NewEnviron{arab}[1][\al at mode]%
 {\par\edef\@tempa{#1}%
   \ifx\@tempa\al at mode@voc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processvoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al at mode@fullvoc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al at mode@novoc%
+  \booltrue{al at rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
   \luadirect{tex.sprint(processnovoc(\luastringO{\BODY},
     \luastringO{\al at arb@rules}, \luastringO{\al at input@scheme}))}\egroup%
-  \else \ifx\@tempa\al at mode@trans%
+  \else%
+  \ifx\@tempa\al at mode@trans%
   \bgroup\pardir TLT\textdir TLT\al at trans@style%
   \luadirect{tex.sprint(processtrans(\luastringO{\BODY},
     \luastringO{\al at trans@convention},

Modified: trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua	2016-11-14 22:35:23 UTC (rev 42509)
+++ trunk/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua	2016-11-14 22:35:32 UTC (rev 42510)
@@ -267,7 +267,13 @@
 
 digraphstrdmg = {
    {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza
-   {a="^(\"?[uai])", b="%1"},      -- initial alif without hamza
+   -- 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
    -- 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"},



More information about the tex-live-commits mailing list