L TEX ﻚﺗﻻ ماﺪﺨﺘﺳ ﺔﻴﺑﺮﻌﻟا ﺔﺑﺎﺘﻛ ﺔﻣﺪﺨﺘﺴﳌا قﺮﻄﻟا ﺾﻌﺑ: Writing Arabic with L Tex. Some useful methods
L TEX ﻚﺗﻻ ماﺪﺨﺘﺳ ﺔﻴﺑﺮﻌﻟا ﺔﺑﺎﺘﻛ ﺔﻣﺪﺨﺘﺴﳌا قﺮﻄﻟا ﺾﻌﺑ: Writing Arabic with L Tex. Some useful methods
.
Dr. Mohamed Faouzi Bellalouna
( LaTeX)
.
.
.
.
..
.
.
With the help of God, I got some skills in terms of writing mathematics in arabic using Latex software, which became the
universal language for writing mathematics in dierent languages.
In advanced level, the mathematics writes in universal language, based on the Latin alphabet and from left to right, while
its notions are introduced, explained, and generally written in the original language of the authors.
This report deals with introducing dierent ways to use Latex for the arabic language, and Righ-To-Left written languages
in general. Most of the skills introduced have been used by the author to write a book on the theory of probability, currently in
the process of advising. Its published in the same philosophy of Latex as an opensource software, yearning to share knowledge.
It assumes that the reader is a user of the original Latex, in english, for writing mathematics, in dierent formats and styles,
kind of equations and so on...
[email protected]
[email protected]
I
LATEX
2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... 3
10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.1 . . . . . . manyfoot
17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . titleps 5
18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . 6
19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . import 8
22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.8.1 . . . . . . . graphicx
23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . includeonly 9
24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exam.cls 10
1
.1 2
1
. ) :
(
.Miktex
.http://www.miktex.org/download
) . (Compilation 64 Mbs 32 Mbs
. ) (Complete ) 4 ( .
) (Basic ) (package
.
.Ghostscript
.http://www.ghostscript.com/download/gsdnld.html
"" .ps .
.Ghostview
.http://pages.cs.wisc.edu/ ghost/gsview/get50.htm
.ps
.Texmaker
.http://www.xm1math.net/texmaker/download.html
) (Editor .tex .
Texmaker .tex .pdf XeLatex
:
Xelatex+viewpdfBuild QuickTexmaker ConfigureOptions
2
tex :
}\documentclass[options]{type
)( Preamble
}\begin{document
}\end{document
.
.
}{ ] [ . :
.2 4
\documentclass[14pt,a4paper]{extbook}
\usepackage{titlesec}
\usepackage{amsmath,amssymb}
\makeatletter
\tagsleft@false
\makeatother % Puts the equations numbers on the right
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Traditional Arabic}
\begin{document}
\pagestyle{empty}
$X$
$\sigma^2$ $\mu$
\begin{equation*}
f(x) = \frac{1}{\sqrt{2 \pi} \sigma} e^{-(x - \mu)^{2} /2\sigma^{2}}
\qquad - \infty < x < \infty
\end{equation*}
\end{document}
%
.%
:
\usepackage{titlesec} \ usepackage{amssymb} \ usepackage{amsmath}
.
\makeatletter\tagsleft@false\makeatother
\mathchardef\times="2202
. \( times )
\ usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
(! ) numerals=maghrib
.\setotherlanguage{english}
\newfontfamily{arabicfont}[Script=Arabic,Scale=1.2]{Traditional Arabic}
X 2
1
)(2.1
2 2
= )f (x e(x) /2 <<x
2
.3 ... 6
... 3
.
:
]}[section{}\newtheorem{Theo
}{}\newtheorem{Prop
}{}\newtheorem{Example
}}}\renewcommand\theExample{{\bf \arabic{section}\alph{Example
}}}\renewcommand\theTheo{{\bf \arabic{section}.\arabic{Theo
\arabic \alph .
:
3 . 1 . 3.1 .
3 . 2 . 3.2 .
.
10
}\begin{Example
1
}\begin{Example }\begin{Example
}\end{Example
8 5
}\begin{Example
}\end{Example }\end{Example
2
}\begin{Example }\begin{Example
}\end{Example
9 6
}\begin{Example
}\end{Example }\end{Example
3
}\begin{Example }\begin{Example
}\end{Example
10 7
}\begin{Example
}\end{Example }\end{Example
4
}\end{Example
3 1
3 8 3 5
3 2
3 9 3 6
3 3
3 10 3 7
3 4
10 :
3 11
3 18 3 15
3 12
3 19 3 16
3 13
3 20 3 17
3 14
.3 ... 8
8:
3 24 3 21
3 27
3 25 3 22
3 28
3 26 3 23
.10 .
.
:
9 8 7 6 5 4 3 2 1
90 80 70 60 50 40 30 20 10
1000 900 800 700 600 500 400 300 200 100
23 ) 23 ( "" 3+20=23
20 3 .
:
https://en.wikipedia.org/wiki/Abjad_numerals
.
.
:
http://ar.wikipedia.org/wiki/%D8%AD%D8%B3%D8%A7%D8%A8%D8%A7%D9%84%D8%AC%D9%85%D9%84
"" . :
}}\renewcommand{\theExample}{\arabic{section}\abjadcount{Example
\abjadcount
.
11 .19
3 17 3 14 3 11
3 18 3 15 3 12
3 19 3 16 3 13
20 :28
3 26 3 23 3 20
3 27 3 24 3 21
3 28 3 25 3 22
...28
3 29
3 30
3 31
.4 10
4
. }\footnote 1 {
.
11
}\renewcommand{\footnoterule
}}{\raggedleft\vspace*{-3pt}\rule{2in}{0.4pt}\vspace*{2.6pt
"" 2
.4 12
. :
}}\def\efootnote#1{\leftfootnoterule\LTRfootnote{\hspace*{2pt}\LR{#1
}}\stepcounter{footnote
polyglossia :
\LTRfootnote \RTLfootnote
3 An english footnote
13
4 5 \textwidthfootnoterule .
4
5 An english footnote
.4 14
. .
:
. .
12 11 10 9 8 7
7
8
9
10 First
footnote
11 Second footnote
12 Third footnote
15
manyfoot 1.4.1
http://www.ctan.org/pkg/manyfoot
manyfoot .
para*
\usepackage[para*]{manyfoot}
: ( Preamble) \ usepackage{polyglossia}
.4 16
. 1 2 3 :
\}footnoteB {
\}footnoteB { \}footnoteB {
\footnoteC \footnoteB 4 5 6
:
{First footnote}, {Second footnote}, {Third footnote}.
1 2 3
4 First footnote 5 Second footnote 6 Third footnote
17
titleps 5
http://www.ctan.org/pkg/titleps
.
\usepackage{titleps}
\newpagestyle{Mystyle}{
\setheadrule{.1pt}% Header rule
\sethead[]% even left
[]% even centre
[]% even right
{}% odd left
{}% odd centre
{}% odd right
}
\pagestyle{Mystyle}
\newpagestyle{mymain}{
\setheadrule{.4pt}% Header rule
\sethead[\thepage]% even left
[]% even centre
\; ]
\thesection.\;\normalsize\sectiontitle]% even right
{ }
%{} odd left
{}% odd centre
{\thepage}% odd right
\setfootrule{.4pt}% Header rule
\setfoot
[]% even left
[\textcolor{red}{\fbox{{{[
% even centre
[]% even right
{}% odd left
{\textcolor{red}{\fbox{{{{
% odd centre
{}% odd right
}
.6 "" 18
6 ""
: 1 2 3
.
}\newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname
\def\xwords#1{\ifcase#1\or
\or
\or
\or
\or
\or
\or
\or
\or
\or
\or
\else
}I need more words\fi
19
}\usepackage{fmultico} % or \usepackage{multicol
\setlength{\columnseprule}{0.1pt} % width of rule
}\begin{multicols}{2 . multicol .
} \end{multicols}{2:
{Y y fY (y) > 0: }= y
) (X, Y ) f (x, y
)f (x, y
= )fX|Y (x|y
)fY (y
}\begin{multicols}{3 3
.8 import 20
import 8
\include .\input
C: Maths Mybook 3 CHAP1
CHAP2 CHAP3 tex file1.tex file2.tex file3.tex
Mainfile.tex .
:
CHAP2 CHAP3
" " ) (The absolute path :
% The Mainfile.tex
}\documentclass[options]{type
Preamble
}\begin{document
21
\input{C:/Maths/Mybook/Chap1/file1.tex}
\input{C:/Maths/Mybook/Chap2/file2.tex}
\input{C:/Maths/Mybook/Chap3/file3.tex}
\end{document}
.
: D: Maths
: Mainfile.tex
% The Mainfile.tex
\documentclass[options]{type}
Preamble
\begin{document}
\input{D:/Maths/Mybook/Chap1/file1.tex}
\input{D:/Maths/Mybook/Chap2/file2.tex}
\input{D:/Maths/Mybook/Chap3/file3.tex}
\end{document}
!! Mainfile.tex
" " import
:( The relative path)
% The Mainfile.tex
\documentclass[options]{type}
Preamble
\usepackage{import}
\begin{document}
.8 import 22
}\import{./Chap1/}{file1.tex
}\import{./Chap2/}{file2.tex
}\import{./Chap3/}{file3.tex
}\end{document
1.8.1 graphicx
graphicx
- - Fig . :
}\usepackage{graphicx
}}\graphicspath{{Chap1/Fig/}{Chap2/Fig/}{Chap3/Fig/
23
. includeonly 9
Mybook.tex ) (5 :
}\documentclass[options]{type
Preamble
}\begin{document
}\include{Chap1.tex
}\include{Chap2.tex
}\include{Chap3.tex
}\include{Chap4.tex
}\include{Chap5.tex
}\end{document
) (Chapxxx.tex Mybook.tex
. ,
. :
}\documentclass[options]{type
Preamble
}\includeonly{Chap3.tex
}\begin{document
}\include{Chap1.tex
}\include{Chap2.tex
}\include{Chap3.tex
}\include{Chap4.tex
}\include{Chap5.tex
}\end{document
.\includeonly ).(Chap3
.10 Exam.cls 24
Exam.cls 10
Exam .
) ( pdf
\printanswers
tex .
.