aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arabluatex.dtx30
-rw-r--r--arabluatex.lua9
2 files changed, 25 insertions, 14 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx
index 8bebc86..8605219 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -27,7 +27,7 @@
27%<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01] 27%<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
28%<package-info>\ProvidesPackage{arabluatex} 28%<package-info>\ProvidesPackage{arabluatex}
29%<*package-info> 29%<*package-info>
30 [2018/06/24 v1.12 An ArabTeX-like interface for LuaLaTeX] 30 [2018/08/27 v1.13 An ArabTeX-like interface for LuaLaTeX]
31%</package-info> 31%</package-info>
32% 32%
33%<*driver> 33%<*driver>
@@ -158,7 +158,7 @@
158\usepackage{newunicodechar} 158\usepackage{newunicodechar}
159\newunicodechar{ǧ}{ǧ} % Old Standard does not include ǧ/Ǧ 159\newunicodechar{ǧ}{ǧ} % Old Standard does not include ǧ/Ǧ
160\newunicodechar{Ǧ}{Ǧ} % 160\newunicodechar{Ǧ}{Ǧ} %
161\usepackage{arabluatex}[2018/06/24] 161\usepackage{arabluatex}[2018/08/27]
162\usepackage[nopar]{quran} 162\usepackage[nopar]{quran}
163\usepackage[noindex]{nameauth} 163\usepackage[noindex]{nameauth}
164\usepackage{varioref} 164\usepackage{varioref}
@@ -260,7 +260,7 @@
260%</driver> 260%</driver>
261% \fi 261% \fi
262% 262%
263% \CheckSum{0} 263% \CheckSum{890}
264% 264%
265% \CharacterTable 265% \CharacterTable
266% {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 266% {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
@@ -2222,6 +2222,11 @@ word that \cs{arbnull} is applied to.
2222% environment instead of \textsc{ascii} Arab\TeX\ or Buckwalter input 2222% environment instead of \textsc{ascii} Arab\TeX\ or Buckwalter input
2223% schemes. See \vref{sec:unicode-input} for more details. 2223% schemes. See \vref{sec:unicode-input} for more details.
2224% 2224%
2225% \DescribeOption{color} |color|$=$\meta{color name}
2226% \hfill\arabluaverb{Default: not set}\\
2227% \NEWfeature{v1.13} The color in which lines of poetry are to be
2228% rendered.
2229%
2225% \label{ref:poetry-export} 2230% \label{ref:poetry-export}
2226% \DescribeOption{export} |export|$=$|true|\verb+|+|false| 2231% \DescribeOption{export} |export|$=$|true|\verb+|+|false|
2227% \hfill\arabluaverb{Default: false}\\ 2232% \hfill\arabluaverb{Default: false}\\
@@ -2693,7 +2698,8 @@ word that \cs{arbnull} is applied to.
2693% 2698%
2694% \Cref{tab:arbcolor-diacritics} gives the Arab\TeX\ equivalents for 2699% \Cref{tab:arbcolor-diacritics} gives the Arab\TeX\ equivalents for
2695% the diacritics to be printed inside or just after \cs{arbcolor}. 2700% the diacritics to be printed inside or just after \cs{arbcolor}.
2696% 2701%
2702% \needspace{7\baselineskip}
2697% \begin{longtable}{lllll} 2703% \begin{longtable}{lllll}
2698% \bottomrule 2704% \bottomrule
2699% \caption*{\Cref*{tab:arbcolor-diacritics}: Arab\TeX\ diacritics 2705% \caption*{\Cref*{tab:arbcolor-diacritics}: Arab\TeX\ diacritics
@@ -4233,7 +4239,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4233% \begin{macrocode} 4239% \begin{macrocode}
4234\NeedsTeXFormat{LaTeX2e} 4240\NeedsTeXFormat{LaTeX2e}
4235\ProvidesPackage{arabluatex}% 4241\ProvidesPackage{arabluatex}%
4236[2018/06/24 v1.12 An ArabTeX-like interface for LuaLaTeX] 4242[2018/08/27 v1.13 An ArabTeX-like interface for LuaLaTeX]
4237\RequirePackage{ifluatex} 4243\RequirePackage{ifluatex}
4238% \end{macrocode} 4244% \end{macrocode}
4239% \package{arabluatex} requires \hologo{LuaLaTeX} of course. Issue a 4245% \package{arabluatex} requires \hologo{LuaLaTeX} of course. Issue a
@@ -4511,7 +4517,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4511% to be used outside Arabic environments for proper names. It takes as 4517% to be used outside Arabic environments for proper names. It takes as
4512% argument one or more Arabic words, each of which will be rendered in 4518% argument one or more Arabic words, each of which will be rendered in
4513% upright roman style with its first letter uppercased. 4519% upright roman style with its first letter uppercased.
4514% \begin{macro}{\prname*}\changes{v1.13}{2018/08/26}{Renders proper 4520% \begin{macro}{\prname*}\changes{v1.13}{2018/08/27}{Renders proper
4515% names already converted to Unicode in upright roman style} 4521% names already converted to Unicode in upright roman style}
4516% Unlike \cs{prname}, \cs{prname*} does not take |arabtex| or 4522% Unlike \cs{prname}, \cs{prname*} does not take |arabtex| or
4517% |buckwalter| input as argument, but already Unicode converted 4523% |buckwalter| input as argument, but already Unicode converted
@@ -4593,7 +4599,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4593% marks in Arabic environments} 4599% marks in Arabic environments}
4594% \cs{arbmark}\oarg{rl\textbar{}lr}\marg{shorthand} takes one 4600% \cs{arbmark}\oarg{rl\textbar{}lr}\marg{shorthand} takes one
4595% argument from a list of defined elements. 4601% argument from a list of defined elements.
4596% \changes{v1.13}{2018/08/26}{New optional argument: either 4602% \changes{v1.13}{2018/08/27}{New optional argument: either
4597% \texttt{rl} or \texttt{lr}} The mark to be inserted is determined 4603% \texttt{rl} or \texttt{lr}} The mark to be inserted is determined
4598% by contextual analysis or by an optional argument, either |rl| or 4604% by contextual analysis or by an optional argument, either |rl| or
4599% |lr|. This command is coded in Lua. 4605% |lr|. This command is coded in Lua.
@@ -4657,7 +4663,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4657% different options: |mode|, |width|, |gutter|, |metre|, |color|, 4663% different options: |mode|, |width|, |gutter|, |metre|, |color|,
4658% |utf|, |delim| and |export|; all of them are defined here just 4664% |utf|, |delim| and |export|; all of them are defined here just
4659% before the |arabverse| 4665% before the |arabverse|
4660% environment. \changes{v1.13}{2018/08/26}{New options 4666% environment. \changes{v1.13}{2018/08/27}{New options
4661% \texttt{color} and \texttt{export} to \texttt{arabverse} 4667% \texttt{color} and \texttt{export} to \texttt{arabverse}
4662% environment.} 4668% environment.}
4663% \begin{macrocode} 4669% \begin{macrocode}
@@ -4846,7 +4852,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4846% 4852%
4847% \paragraph*{Exporting Unicode Arabic to external file} 4853% \paragraph*{Exporting Unicode Arabic to external file}
4848% \begin{macro}{\SetArbOutSuffix} 4854% \begin{macro}{\SetArbOutSuffix}
4849% \changes{v1.13}{2018/08/26}{Sets a suffix to be appended to the 4855% \changes{v1.13}{2018/08/27}{Sets a suffix to be appended to the
4850% filename of the external Unicode file.}By default, |_out| is the 4856% filename of the external Unicode file.}By default, |_out| is the
4851% suffix to be appended to the external file in which 4857% suffix to be appended to the external file in which
4852% \package{arabluatex} exports Unicode in place of 4858% \package{arabluatex} exports Unicode in place of
@@ -4858,7 +4864,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4858% \end{macrocode} 4864% \end{macrocode}
4859% \end{macro} 4865% \end{macro}
4860% \begin{macro}{\ArbOutFile} 4866% \begin{macro}{\ArbOutFile}
4861% \changes{v1.13}{2018/08/26}{Silently exports its argument in the 4867% \changes{v1.13}{2018/08/27}{Silently exports its argument in the
4862% selected external file.} 4868% selected external file.}
4863% \cs{ArbOutFile}\oarg{newline}\marg{string} silently exports 4869% \cs{ArbOutFile}\oarg{newline}\marg{string} silently exports
4864% \meta{string} to the external selected file. It may take |newline| 4870% \meta{string} to the external selected file. It may take |newline|
@@ -4879,7 +4885,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4879% \end{macro} 4885% \end{macro}
4880% \end{macro} 4886% \end{macro}
4881% \begin{environment}{arabexport} 4887% \begin{environment}{arabexport}
4882% \changes{v1.13}{2018/08/26}{Processes and print its argument in 4888% \changes{v1.13}{2018/08/27}{Processes and print its argument in
4883% the current file and exports it in full Unicode in the external 4889% the current file and exports it in full Unicode in the external
4884% selected \texttt{.tex} file.} The |arabexport| environment 4890% selected \texttt{.tex} file.} The |arabexport| environment
4885% processes and prints its argument unchanged to the current |.pdf| 4891% processes and prints its argument unchanged to the current |.pdf|
@@ -4917,7 +4923,7 @@ wa-ya.sIru ta.hta 'l-jild-i
4917% \end{macrocode} 4923% \end{macrocode}
4918% \end{environment} 4924% \end{environment}
4919% \begin{macro}{\arbpardir} 4925% \begin{macro}{\arbpardir}
4920% \changes{v1.13}{2018/08/26}{Sets the direction of Arabic paragraphs 4926% \changes{v1.13}{2018/08/27}{Sets the direction of Arabic paragraphs
4921% once they are converted to Unicode.} \cs{arbpardir} is automatically 4927% once they are converted to Unicode.} \cs{arbpardir} is automatically
4922% inserted by \package{arabluatex} at the beginning of Arabic 4928% inserted by \package{arabluatex} at the beginning of Arabic
4923% paragraphs converted to Unicode so that they are printed in the 4929% paragraphs converted to Unicode so that they are printed in the
diff --git a/arabluatex.lua b/arabluatex.lua
index 8fc31bc..4db23a2 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -683,12 +683,17 @@ local function processarbtoutf(str)
683 end) 683 end)
684 return string.format("%s{%s}", tag, body) 684 return string.format("%s{%s}", tag, body)
685 end) 685 end)
686
686 str = string.gsub(str, "(\\txarb%s?)(%b{})", function(tag, body) 687 str = string.gsub(str, "(\\txarb%s?)(%b{})", function(tag, body)
687 body = string.sub(body, 2, -2) 688 body = string.sub(body, 2, -2)
688 body = string.gsub(body, "(\\abjad%s?)(%b{})", function(btag, bbody) 689 body = string.gsub(body, "(\\abjad%s?)(%b{})", function(btag, bbody)
689 bbody = string.sub(bbody, 2, -2) 690 bbody = string.sub(bbody, 2, -2)
690 bbody = abjadify(bbody) 691 if tonumber(bbody) ~= nil then
691 return string.format("\\aemph{\\arb[novoc]{%s}}", bbody) 692 bbody = abjadify(bbody)
693 return string.format("\\aemph{\\arb[novoc]{%s}}", bbody)
694 else
695 return string.format("%s{%s}", btag, bbody)
696 end
692 end) 697 end)
693 body = string.gsub(body, "(\\arbmark%s?)(%b{})", function(btag, bbody) 698 body = string.gsub(body, "(\\arbmark%s?)(%b{})", function(btag, bbody)
694 bbody = string.sub(bbody, 2, -2) 699 bbody = string.sub(bbody, 2, -2)