[Tex/LaTex] Typesetting a document using Arabic script

arabicbabellanguages

I'm using TeXlive (2009-7) on Ubuntu 10.04. I've installed texlive-lang-arabic and I can't find out how should I compose the preamble to be able to use it. The babel's documentation I've found in the Internet http://www.tug.org/texlive/Contents/live/texmf-dist/doc/generic/babel/ is probably out-of-date (September 2009), because Arabic is not mentioned as supported language, and aptitude show texlive-lang-arabic gives as the result:

This package includes the following CTAN packages: 
 arabi -- (La)TeX support for Arabic and Farsi, compliant with Babel.
 arabtex -- Macros and fonts for typesetting Arabic.
 hyphen-arabic --
 hyphen-farsi --

I could't find any documentation of the newly installed package. I'm even not sure if the package allows what I want, i.e. writing using Arabic script directly and not, as it was the case with arabtex, in transcription (and Arabic script was appearing only in output).

If I've missed some relevant information, I can complete my question.

UPDATE

Thanks for everybody. First of all, I've tried to apply Mustail's solution. I've composed the preamble based on his example (mostly the same, just without Persian). I run for it XeLaTeX. Compilation failed, the .log file said that I need xetex package. I had texlive-xetex installed and xetex is mentioned as part of it. Searching further in the Internet I've found that all information about XeLaTeX I can find not match with my LaTeX installation.

I've decided to try the solution proposed by Caramdir and I've made a new TeX Live installation following the instruction in the link. I can't compile any file as I don't have LaTeX nor pdfLaTeX installed and I don't want to install it in other way I've installed TeX Live. In the documentation about installation I've found that I should run tlmgr to manage my LaTeX installation, but I can't do it, command not found.

I have still previous installation of TeX Live on one computer, I can test both (by aptitude and downloaded from tug.org).

Maybe I should post another question concerning installation of TeX Live from tug.org, but I try first here, maybe it's not a real problem but just an omission of something obvious from my part.

UPDATE 2

I was trying to compile Mehro's exemple document (using instalation of LaTeX from Ubuntu packages), without succes. This is the terminal's output (starting from first warning):

Package polyglossia Warning: No hyphenation patterns were loaded for `arabic'
(polyglossia)                I will use the patterns loaded for \language=0
(polyglossia)                instead on input line 7.

) (./mehro.aux)
kpathsea: Running mktextfm 
/usr/share/texmf/web2c/mktexnam: Could not map source abbreviation 6 for 600.
/usr/share/texmf/web2c/mktexnam: Need to update /usr/share/texmf-texlive/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
This is METAFONT, Version 2.718281 (TeX Live 2009/Debian)


kpathsea: Running mktexmf 
! I can't find file `'.
<*> \mode:=ljfour; mag:=1; nonstopmode; input

Please type another input file name
! Emergency stop.
<*> \mode:=ljfour; mag:=1; nonstopmode; input

Transcript written on mfput.log.
grep: .log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ' failed to make .tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font \zf@basefont="" not loadable: Metric (TFM) file or installed font not fo
und.
<to be read again> 
                   \zf@family@fontdeflmr 
l.15 ...abic: \textarabic{السلام عليكم}

? ^C! Interruption.
<argument> ...@family@fontdef\f@family \endcsname 
                                                  " at \f@size pt \zf@check@...

I had a look in Polyglossia documentation, but I didn't find there nothing what could help me to compile document.

It seems I have more general problem with fonts for XeTeX. Fontspec documentation opens but should lack of some fonts as I see white gaps in some places. The termial output is quite long and consist almost of 'error' messages. This are just few lines of it:

Error: Missing language pack for 'Adobe-Japan1' mapping 
Error: Unknown font tag 'F5.1' 
Error (24124): No font in show 
Error: Unknown font tag 'F5.1' 

UPDATE 3

I have maneged to install Linux Liberation O and Scheherazade via Ubuntu Sotware Center (although I still can't understand why I could't do that via Synaptic nor aptitude…), so Meho's and Alan's exemple files are compiled succesfully.

Documentation became readable after installation of poppeler data. I'm still not able to compile Mustail's exemple file, but having acces to documentation I can try to solve it.

Thanks a lot for everybody for your help.

Best Answer

I usually use XeLaTeX with Polyglossia. A quick example:

\documentclass{book}

\usepackage{setspace}

\usepackage{fontspec}
\usepackage{polyglossia}

\setmainlanguage{english}
\setotherlanguage{arabic}

\newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{Scheherazade}

\begin{document}

Some latin text and inline arabic: \textarabic{السلام عليكم}

And for larger blocks of text you can use Arabic environment:

\begin{Arabic}

العربية أكثر لغات المجموعة السامية متحدثينَ، وإحدى أكثر اللغات انتشارًا في العالم، يتحدثها أكثر من 422 مليون نسمة،1 ويتوزع متحدثوها في المنطقة المعروفة باسم الوطن العربي، بالإضافة إلى العديد من المناطق الأخرى المجاورة كالأحواز وتركيا وتشاد ومالي السنغال وإرتيريا. اللغة العربية ذات أهمية قصوى لدى المسلمين، فهي لغة مقدسة (لغة القرآن)، ولا تتم الصلاة (وعبادات أخرى) في الإسلام إلا بإتقان بعض من كلماتها. العربية هي أيضا لغة شعائرية رئيسية لدى عدد من الكنائس المسيحية في الوطن العربي، كما كتبت بها الكثير من أهم الأعمال الدينية والفكرية اليهودية في العصور الوسطى. وأثّر انتشار الإسلام، وتأسيسه دولاً، في ارتفاع مكانة اللغة العربية، وأصبحت لغة السياسة والعلم والأدب لقرون طويلة في الأراضي التي حكمها المسلمون، وأثرت العربية، تأثيرًا مباشرًا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية والفارسية والكردية والأوردية والماليزية والإندونيسية والألبانية وبعض اللغات الإفريقية الأخرى مثل الهاوسا والسواحيلية، وبعض اللغات الأوروبية وخاصةً المتوسطية منها كالإسبانية والبرتغالية والمالطية والصقلية. كما أنها تدرس بشكل رسمي أو غير رسمي في الدول الإسلامية والدول الإفريقية المحاذية للوطن العربي.

العربية لغة رسمية في كل دول الوطن العربي إضافة إلى كونها لغة رسمية في تشاد وإريتيريا وإسرائيل. وهي إحدى اللغات الرسمية الست في منظمة الأمم المتحدة.

تحتوي العربية على 28 حرفًا مكتوبًا. ويرى بعض اللغويين أنه يجب إضافة حرف الهمزة إلى حروف العربية، ليصبح عدد الحروف 29. تكتب العربية من اليمين إلى اليسار - مثلها اللغة الفارسية والعبرية وعلى عكس الكثير من اللغات العالمية - ومن أعلى الصفحة إلى أسفلها.

\end{Arabic}

To get even spacing between lines, you can use \verb|\lineskiplimit| command (locally or globally, preferably locally) and set spacing with \verb|setspace| or \verb|leading| package to avoid possible overlapping:

\begin{Arabic}
\lineskiplimit=-1000pt
\setstretch{1.2}

العربية أكثر لغات المجموعة السامية متحدثينَ، وإحدى أكثر اللغات انتشارًا في العالم، يتحدثها أكثر من 422 مليون نسمة،1 ويتوزع متحدثوها في المنطقة المعروفة باسم الوطن العربي، بالإضافة إلى العديد من المناطق الأخرى المجاورة كالأحواز وتركيا وتشاد ومالي السنغال وإرتيريا. اللغة العربية ذات أهمية قصوى لدى المسلمين، فهي لغة مقدسة (لغة القرآن)، ولا تتم الصلاة (وعبادات أخرى) في الإسلام إلا بإتقان بعض من كلماتها. العربية هي أيضا لغة شعائرية رئيسية لدى عدد من الكنائس المسيحية في الوطن العربي، كما كتبت بها الكثير من أهم الأعمال الدينية والفكرية اليهودية في العصور الوسطى. وأثّر انتشار الإسلام، وتأسيسه دولاً، في ارتفاع مكانة اللغة العربية، وأصبحت لغة السياسة والعلم والأدب لقرون طويلة في الأراضي التي حكمها المسلمون، وأثرت العربية، تأثيرًا مباشرًا أو غير مباشر على كثير من اللغات الأخرى في العالم الإسلامي، كالتركية والفارسية والكردية والأوردية والماليزية والإندونيسية والألبانية وبعض اللغات الإفريقية الأخرى مثل الهاوسا والسواحيلية، وبعض اللغات الأوروبية وخاصةً المتوسطية منها كالإسبانية والبرتغالية والمالطية والصقلية. كما أنها تدرس بشكل رسمي أو غير رسمي في الدول الإسلامية والدول الإفريقية المحاذية للوطن العربي.

العربية لغة رسمية في كل دول الوطن العربي إضافة إلى كونها لغة رسمية في تشاد وإريتيريا وإسرائيل. وهي إحدى اللغات الرسمية الست في منظمة الأمم المتحدة.

تحتوي العربية على 28 حرفًا مكتوبًا. ويرى بعض اللغويين أنه يجب إضافة حرف الهمزة إلى حروف العربية، ليصبح عدد الحروف 29. تكتب العربية من اليمين إلى اليسار - مثلها اللغة الفارسية والعبرية وعلى عكس الكثير من اللغات العالمية - ومن أعلى الصفحة إلى أسفلها.

\end{Arabic}

\end{document}