arabluatex - undefined control sequence

I have a simple test document

\documentclass{article}
\usepackage{fontspec,luatextra}
\usepackage{arabluatex}
\begin{document}
hello \arb{EaAlam}
\end{document}


Which fails with:

! Undefined control sequence.
\arb code ...@tempa \al@mode@voc \bgroup \textdir  TRT\arabicfont      \luadirect
l.6 hello \arb{EaAlam}


I can see from the log that it finds arabluatex.sty:

(/usr/local/share/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty
(/usr/local/share/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the ?' option.
(/usr/local/share/texmf-dist/tex/latex/amsmath/amstext.sty


I don't know where to look to fix this. Any suggestions would be much appreciated.

(I'm running on FreeBSD 10.3 and manually installed the arabluatex package.)

• Welcome to TeX.SX! I had to change the font name, but with an up-to-date TeX distribution I get no error. – egreg Jun 19 '16 at 9:14
• as with egreg, I got no error after changing the font but you should probably not load luatextra these days it is just a thin wrapper loading several unneeded packages including fixltx2e which generates the warning Package fixltx2e Warning: fixltx2e is not required with releases after 2015 – David Carlisle Jun 19 '16 at 9:21
• I have same error with texlive 2015 on windows, when changed to texlive 2016 the error disappear. – Salim Bou Jun 19 '16 at 21:36
• I just installed the Droid Arabic Naskh font from Parabola Linux repos. Then I didn't get any error with your mwe, either with texlive 2015 and arabluatex 1.2 or with texlive 2016 and arabluatex 1.3. I suspect something is wrong in your installation. Maybe a full .log file with \listfiles would help. – Robert Alessi Jun 20 '16 at 8:39
• Another quick comment on your mwe (which has nothing to do with your issue): what you put inside \arb{} is Buckwalter notation; it should be ArabTeX instead, like so: Hello \arb{Alam}. – Robert Alessi Jun 20 '16 at 8:44

\textdir is the culprit: about one year ago the prefix luatex was removed from the primitives \luatexXYZ and the like. Actually, the names of such internal primitives have always been without the prefix, but they were 'activated' with the 'luatex' prefix. See What happened to \luatextextdir? for more information.
The solution is either to install the latest texlive 2016 on your system or to replace every occurrence of \textdir with \luatextextdir in arabluatex.sty. But this is actually more a workaround than a solution.
• Off-topic question: may I know how can I underline an Arabic text inside txarab environment since \underline typesets the Arabic words in a wrong way? – Diaa Jan 1 '19 at 13:17
• @Diaa You can use the ulem package. Just load it, and you may say for example: \txarab{دَخَلَ \uline{مُبتَسِمًا}}. That said, the development version of arabluatex (see: gitlab.com/ralessi/arabluatex) has more refinements and also uses ulem internally. I should be out soon. – Robert Alessi Jan 1 '19 at 17:25