Typesetting arabic with LuaLaTeX

Updated Answer (2017-12-28)

% !TEX TS-program = lualatexmk
\documentclass{article}
\usepackage{fontspec}

\setmainfont[Ligatures=TeX]{Times New Roman}
\newfontfamily\arabicfont
    [Script=Arabic,     % to get correct arabic shaping
    Scale=1.2]          % make the arabic font bigger, a matter of taste
        {Arial}     % whatever Arabic font you like

\newcommand{\textarabic}[1]     % Arabic inside LTR
    {\bgroup\textdir TRT\arabicfont #1\egroup}
\newcommand{\n}         [1]     % for digits inside Arabic text
    {\bgroup\textdir TLT #1\egroup}
\newcommand{\afootnote} [1]     % Arabic footnotes
    {\footnote{\textarabic{#1}}}
\newenvironment{Arabic}     % Arabic paragraph
    {\textdir TRT\pardir TRT\arabicfont}{}

\begin{document}

English text ``\textarabic{جملة عربية وسط جملة إنجليزية}'' with Arabic in
between. English paragraph left aligned English paragraph left aligned English
paragraph left aligned English paragraph left aligned English paragraph left
aligned English paragraph left aligned English paragraph left aligned English
paragraph left aligned English paragraph left aligned English paragraph left
aligned English paragraph left aligned.

\begin{Arabic}
فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين \n{١٢٣٤٥} فقرة عربية
محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين
فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى
اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى
اليمين\afootnote{حاشية عربية.} فقرة عربية محاذاة إلى اليمين.
\end{Arabic}

\end{document}

Old Answer

Two days ago Khaled Hosny sent me this:

\documentclass{article}
\usepackage{fontspec}

\setmainfont[Ligatures=TeX]{Junicode}
\newfontfamily\arabicfont
    [Script=Arabic,        % to get correct arabic shaping
     Scale=1.2]            % make the arabic font bigger, a matter of taste
    {Scheherazade}         % whatever Arabic font you like

\newcommand{\textarabic}[1] % Arabic inside LTR
           {\bgroup\luatextextdir TRT\arabicfont #1\egroup}
\newcommand{\n}         [1] % for digits inside Arabic text
           {\bgroup\luatextextdir TLT #1\egroup}
\newcommand{\afootnote} [1] % Arabic footnotes
           {\footnote{\textarabic{#1}}}
\newenvironment{Arabic}     % Arabic paragraph
           {\luatextextdir TRT\luatexpardir TRT\arabicfont}{}

\begin{document}

English text ``\textarabic{جملة عربية وسط جملة إنجليزية}'' with Arabic in
between. English paragraph left aligned English paragraph left aligned English
paragraph left aligned English paragraph left aligned English paragraph left
aligned English paragraph left aligned English paragraph left aligned English
paragraph left aligned English paragraph left aligned English paragraph left
aligned English paragraph left aligned.

\begin{Arabic}
فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين \n{١٢٣٤٥} فقرة عربية
محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين
فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى
اليمين فقرة عربية محاذاة إلى اليمين فقرة عربية محاذاة إلى
اليمين\afootnote{حاشية عربية.} فقرة عربية محاذاة إلى اليمين.
\end{Arabic}

\end{document}

This probably is as uptodate as it gets atm.


It is because some works is in progress specially for the bidi package, on the other hand I am waiting for some of luatex bidi bugs getting fixed. you can test things if you want:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Arabic]{font-name}
\usepackage{bidi}
\pagedir TRT\pardir TRT\bodydir TRT\textdir TRT
\begin{document}
%your Arabic text
\end{document}

Tags:

Arabic

Luatex