3

I'm using the packages polyglossia and Xepersian, I have a problem with third level enumerate, I cannot use \Alph numbering in the whole document,

\documentclass[12pt,a4paper]{book}
\usepackage[nonamebreak, square, comma, sort&compress]{natbib}
\usepackage{polyglossia}
\setmainlanguage[calendar=gregorian, numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Amiri}
\setotherlanguage{english}


\usepackage{xepersian}
\settextfont{Amiri}
\setlatintextfont[Scale=1.5]{Amiri}



\let\oldthebibliography=\thebibliography
  \let\endoldthebibliography=\endthebibliography
  \renewenvironment{thebibliography}[1]{%
    \begin{oldthebibliography}{#1}%
      \setlength{\parskip}{2ex}%vertical space between items
        }%
  {%
    \end{oldthebibliography}%
  }

\begin{document}

 كز هنا في الحديث على  نظام زي‌تك لأنه أحد أفضل الحلول المتاحة  \citep{ماجدة2012تطوير}
 نفترض هنا وجود معرفة مسبقة
 \cite{kopka2004guide}
 \begin{enumerate}
\item Test one
\item Test two
\begin{enumerate}%problem
\item Test one one
\item Test two two
\end{enumerate}%problem
\item Test three
\item Test four
\end{enumerate}

\bibliographystyle{asa-fa}

\bibliography{MyReferences}

\end{document}
4
  • Why use of polyglossia with xepersian together, one is enough.
    – Salim Bou
    Jul 4, 2017 at 17:27
  • What do you mean with Alph in arabic script
    – Salim Bou
    Jul 4, 2017 at 17:28
  • I struggled long time to solve the problem of using References Arabic (RTL) and English (LTR) simultaneously, the only solution that i found is Xepersian with \Natbib package. Jul 4, 2017 at 18:04
  • What i mean by \Alph is: in my document it is impossible to use \Alph numbering whether for \subfigure or Third level list etc. Jul 4, 2017 at 18:08

1 Answer 1

1

If you do a slight modification to your MWE it will solve the error. i.e. change:

\setmainlanguage[calendar=gregorian, numerals=maghrib]{arabic}

to

\selectlanguage[calendar=gregorian, numerals=maghrib]{arabic}

This will solve the problem. Hence the updated MWE is:

\documentclass[12pt,a4paper]{book}
\usepackage[nonamebreak, square, comma, sort&compress]{natbib}
\usepackage{polyglossia}
\selectlanguage[calendar=gregorian, numerals=maghrib]{arabic}
%\setmainlanguage[calendar=gregorian, numerals=maghrib]{arabic}
\newfontfamily\arabicfont[Script=Arabic, Scale=1.5]{Amiri}
\setotherlanguage{english}
\TOCLanguage{arabic}


\usepackage{xepersian}
\settextfont{Amiri}
\setlatintextfont[Scale=1.5]{Amiri}


\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
  \setlength{\parskip}{2ex}%vertical space between items
    }%
{%
\end{oldthebibliography}%
}

\begin{document}

 كز هنا في الحديث على  نظام زي‌تك لأنه أحد أفضل الحلول المتاحة  \citep{ماجدة2012تطوير}
 نفترض هنا وجود معرفة مسبقة
 \cite{kopka2004guide}
\begin{enumerate}
\item Test one
\item Test two
\begin{enumerate}%problem
\item Test one one
\item Test two two
\end{enumerate}%problem
\item Test three
\item Test four
\end{enumerate}

\bibliographystyle{asa-fa}

\bibliography{MyReferences}

\end{document}

Hope this helps.

4
  • Thank you @Jagath, this solution does not work, i get the error ! You can't use `\setlanguage' in vertical mode. Jul 4, 2017 at 13:29
  • Oops! A typo. Could you please change setlanguage to selectlanguage.
    – Jagath
    Jul 4, 2017 at 16:29
  • Thank you @Jagath, this option changes the main language of the document from Arabic to Persian e.g. default \tableofcontents, \listoffigures, \today and \listoftables ... Jul 5, 2017 at 0:00
  • @AbdoElfengour: Sorry. I am not familiar with these languages. Could you please put this \TOCLanguage{arabic} in preamble after loading the package.
    – Jagath
    Jul 5, 2017 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.