I am using some code from here which allows me to use ordinal numbers in arabic for the chapter titles.
I also want to change the title spacing. I am only a little familiar with titlesec. The \titlespacing command requires an earlier setting of \titleformat (page 5 of titlesec documentation) but I don't know how to incorporate the patchcmd in the MWE inside the \titleformat format command.
How can I use titlesec as well as my arabic ordinal numbers?
The commented-out line in the MWE is the setting I would like for my title spacing.
\documentclass[12pt,oneside]{report}
\usepackage{titlesec}
\usepackage{polyglossia}
\setmainlanguage[numerals=mashriq]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic]{Times New Roman}
\gappto\captionsarabic{\renewcommand{\chaptername}{الباب}}
\newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname}
\def\xwords#1{\ifcase#1\or
الأول\or
الثاني\or
الثالث\or
الرابع\or
الخامس\or
\else
you need to supply additional numbers \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
% \titlespacing{\chapter}{0pt}{0ex plus 9ex minus 9ex}{0ex plus 9ex minus 9ex}
\begin{document}
\chapter{ددد}
\end{document}
titlesecafter the patch? – cfr Oct 11 '15 at 16:24titlesecmust be beforepolyglossia, andpolyglossiamust be before the patch. But even apart from this, the\titlespacingcommand has no effect unless i issue a\titleformatcommand, which I don't know how to do with the ordinal patch. – Tim Oct 11 '15 at 16:41