2

I would like to use Glenn from fncychap with polyglossia to looks like the following picture but it doesn't work at all

enter image description here

here's my MNW

\documentclass[12pt,a4paper]{extbook}
%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\usepackage[Glenn]{fncychap}

\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic, AutoFakeSlant=-0.02]{Amiri}
\setsansfont[Script=Arabic,Scale=1.5]{Amiri}

\begin{document}
\tableofcontents
\chapter{محسن}
\section{محسن}
\subsection{محسن}
\end{document}
2
  • 1
    try to load fncychap last.
    – touhami
    Feb 21, 2017 at 16:25
  • yes it's works but i got باب 1 Instead of الباب الاول
    – Educ
    Feb 21, 2017 at 16:33

1 Answer 1

1

Here is a solution

\documentclass[12pt,a4paper]{extbook}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic, AutoFakeSlant=-0.02]{Amiri}
\setsansfont[Script=Arabic,Scale=1.5]{Amiri}
\usepackage[Glenn]{fncychap}
\usepackage{etoolbox}
\makeatletter
\patchcmd\DOCH{{\@chapapp}\space \CNoV\thechapter}{\mtchapter}{}{}
\newcommand{\mtchapter}{%
الباب
\ifcase\value{chapter}\or
 الأول
\or
الثاني
\or
الثالث
\or
الرابع
\or
الخامس
\fi}
\makeatother

\begin{document}
\tableofcontents
\chapter{التحليل التوافقي}
\section{محسن}
\subsection{محسن}
\end{document}

enter image description here

7
  • 1
    For my case I prefer the small names for the chapternames.. the command \gappto\captionsarabic{\renewcommand{\chaptername}{الباب}} changes the name of the chapter and the command \ChNumVar{\Large} puts the literal chapter number in the good dimension Feb 21, 2017 at 17:42
  • 1
    @Educ would you take a look, and find some small improvements, on the last edition of my answer on my publication you commented. Salam for you and touhami, and happy texifiying Feb 22, 2017 at 5:31
  • @FaouziBellalouna Salam for you
    – touhami
    Feb 22, 2017 at 14:56
  • please @touhami if I added commande for hyperref I get an error. \usepackage[bookmarksnumbered=true]{hyperref} \hypersetup{ colorlinks = true, linkcolor = blue, citecolor = blue, urlcolor = blue} Aug 8, 2019 at 18:37
  • @PolineSandra I am sorry, i can't ansower for now I have no arabtex no xelatex. Can you please ask new question with a MWE?
    – touhami
    Aug 9, 2019 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .