When I use two different languages like English and Arabic (one is written form left to right and the other is written from right to left), the equation numbers are written in Arabic, e.g. 14, but when I use \ref
it returns 41. I tried \textRL
, but the format of the number changes from Arabic to English. So I need all numbers in the document to be written in the same format (English or Arabic), any suggestion please?
I use this code.
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[english,arabic]{babel}
\usepackage[LAE]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
نبين فلتحكم الكلي يما يلي قانون
% here there are equations more than ten
\begin{equation}\label{eq:lyap_tot}
\color{blue}{\boxed{\color{black}u=u_\theta-u_x}}
\end{equation}
figure \ref{lyap_tot} shows ... % here the returned number is written in arabic
% but from left to right ( the real number is 14 and the retunred number is 41)
\end{document}
Best Answer
Here your code with
polyglossia
which requireXeLaTeX
engine\setdefaultlanguage[calendar=gregorian,numerals=maghrib]{arabic}
, optionnumerals=maghrib
for arabic form of numerals 1, 2, 3, .... in opposite tonumerals=machriq
for Indian form ٣ ٢ ١ .....\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Name_of_font}
Code
Result