[Tex/LaTex] Arabic text in latex

arabicarabtexsharelatex

I'm trying to add an Arabic paragraph in my English document. This was really a big issue for me for a long time since the other solutions doesn't work with other packages I have and if I change the compiler things get corrupted. The only solution worked with me is what mentioned in this question.

The Arabic paragraph has certain words in English so I can't use the approach in the question and if I used the second option the whole paragraph appears in one line.

How to solve this issue

ِA sample of the solution I tried:

    \documentclass[a4paper,10pt]{article}
%In the preamble section include the arabtex and utf8 packages
\usepackage{arabtex}
\usepackage{utf8}

\begin{document}
%start encoding to unicode
%Note that your layout must support arabic text when compiling
\setcode{utf8}
. (Naïve Bayes) \< و ناييف باييس > (SVM ) \< تتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتتت>
\end{document}

The output is:

enter image description here
Thank you

Original paragraph:

اختبار تورنغ العام والأوتوماتيكي للتمييز بين الحاسب والإنسان (كابتشا) هو أحد أنظمة التحقق الهامة المستخدمة من قبل عدد كبير من مواقع الويب وخدمات الويب. وتهدف الكابتشا إلى حماية الخدمات الإلكترونية ومواقع الويب من الاختراق من قبل البرامج النصية الآلية والبرامج الضارة. تعد الكابتشا المستندة على النصوص وكذلك القائمة على الصوت من أقدم أنواع الكابتشا المقترحة التي ثبت أنها لاتعطي الأمان الكافي لحماية الأنظمة والخدمات. وقد تم اقتراح الكابتشا القائمة على الصور لمعالجة أوجه القصور في الكابتشا المقترحة مسبقاً. ويعرض هذا النوع من الكابتشا مهمة التعرف على الصور للتأكد ما إذا كان المستخدم إنسان حقيقي أم برنامج ضار. نظراً لأهميتها؛ فلابد من البحث عن التحديات الناجمة عن تطورات خوارزميات التعلم الآلي التي تواجه أمنها. يهدف هذا المشروع إلى استكشاف مدى قوة الكابتشا القائمةعلى الصور من خلال محاولة الكسر التلقائي للاختبارات المقدمة من قبل الكابتشا القائمة على الصور بأقل تدخل البشري ممكن. علاوة على ذلك، سيتم إجراء تحليل شامل باستخدام مقاييس الأداء وذلك من خلال المقارنة بين النماذج التي تم إنشاؤها بواسطة خوارزميات التعلم الآلي المحددة بما في ذلك الآلة متجهة الدعم (SVM) و ناييف باييس (Naïve Bayes).

even in the site the order is change, the following image clarify the right order of the words:

enter image description here

Best Answer

Why not using transliteration mode of arabic letters https://en.wikipedia.org/wiki/ArabTeX

You can insert short english text inside arabtex environment with \LR{english text}

\documentclass[12pt]{article}
\usepackage{arabtex}

\novocalize

\begin{document}

english text 

\begin{arabtex}
AxtbAr twryn.g al-`Am wAl-'wtwmAtyky l|ltmy|yz byn al-.hAsb wAl-'insAn ( kAbt^sA ) 
hw '.hd 'n.zmT al-t.hq|q al-hAmT al-mstxdmT mn qbl `d|d kbyr mn ........


..... xwArzmyAt al-t`lm al-'Aly al-m.hd|dT bmA fy dlk al-'AlT mt.jhT al-d`m \LR{(SVM)} 
wnAy|yf bAy|ys \LR{(Naive Bayes)}
\end{arabtex}


\end{document} 
Related Question