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}
Educ
  • 4,362

1 Answers1

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

touhami
  • 19,520
  • 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

    – Faouzi Bellalouna Feb 21 '17 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 – Faouzi Bellalouna Feb 22 '17 at 05:31
  • @FaouziBellalouna Salam for you – touhami Feb 22 '17 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} – Poline Sandra Aug 08 '19 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 09 '19 at 09:47
  • that's ok @touhami thank you for all – Poline Sandra Aug 09 '19 at 20:47
  • @PolineSandra you need to load hyperref before polyglossia and see this question – touhami Aug 18 '19 at 17:48