6

Instead of "Chapter 1" I want "Chapter one", but in Arabic. one => الأول and so on.

In english, a solution exist:

\usepackage{fmtcount,etoolbox}
\makeatletter
\patchcmd{\@makechapterhead}{\thechapter}{\Numberstring{chapter}}{}{}
\patchcmd{\chaptermark}{\thechapter}{\NUMBERstring{chapter}}{}{}
\makeatother

But what about Arabic? MWE:

\documentclass[12pt,english]{book}
\usepackage{fancyhdr}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.5]{Arabic Typesetting}
\pagestyle{fancy}

\begin{document}
\selectlanguage{arabic}
\chapter{مقدمة}

\end{document}
4

I don't know if this is too late but here is a solution to your problem based on this answer: “Literal” and numerical numbering of chapters and this one too "Literal" numbering of chapters

This MWE supports up to 20 chapters but of course you can easily add more chapter numbers in words:

\documentclass[12pt,english]{book}
\usepackage{fancyhdr}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.5]{Arabic Typesetting}
\pagestyle{fancy}
\gappto\captionsarabic{\renewcommand{\chaptername}{الباب}} %to name the chapter title   الباب instead of باب
\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 
الحادي عشر\or 
الثاني عشر\or 
الثالث عشر\or 
الرابع عشر\or 
الخامس عشر\or 
السادس عشر\or  
السابع عشر\or
الثامن عشر\or 
التاسع عشر\or 
العشرون\or 

    \else
    أحتاج إلى المزيد من ترقيمات الأبواب بالحروف في ملف arbbook.cls\fi}
%next three lines is to make chapter naming use the above wordings (literal numbering in Arabic words)

\makeatletter
\patchcmd{\@makechapterhead}{\thechapter}{\words{chapter}}{}{}
\makeatother

\begin{document}
\selectlanguage{arabic}
\chapter{مقدمة}
\end{document}

This outputs:

الباب الأول

  • Forgot to remove my class name arbbook.cls. But anyway, that line actually is useless. It only acts as a warning. to the MWE will work correctly anyway. – Ahmed El Bokl Aug 11 '14 at 13:43
  • While I have solved the problem using another solution, yours indeed is a solution to the question asked. – student1 Aug 11 '14 at 18:56
  • 1
    There is a small error @Ahmed-El-Bokl, the third ordinal number is repeated. Otherwise your solution helped me a lot. – Tim Sep 29 '15 at 12:21
  • @Tim yes you are right. Thank you for pointing that out. I fixed it. – Ahmed El Bokl Feb 10 '16 at 13:41

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.