# Titlesec and Arabxetex

Is there a conflict between arabxetex and titlesec? In the MWE below, it seems that titlesec is ignored (though it does not give any error or warning).

\documentclass[10pt]{book}

\usepackage{titlesec}
\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[display]
{\bfseries\Large}
{\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{4ex}
{\titlerule
\vspace{2ex}%
\filright}
[\vspace{2ex}%
\titlerule]

\usepackage[fullvoc]{arabxetex}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\begin{document}
\chapter{My Chapter}

Test

\end{document}

• may be \usepackage[fullvoc]{arabxetex} should be loaded before titleformating... Not tested, but it seems possible for me that arabxetex could redefine titles – koleygr Oct 15 '17 at 12:46
• @koleygr Change of order gives this error message: Package bidi Error: Oops! you have loaded package titlesec after bidi package. Please load package titlesec before bidi package, and then try to run xelatex on your document again. – blackened Oct 15 '17 at 12:49
• Ok... try to place \usepackage[fullvoc]{arabxetex} just after \usepackage{titlesec} and give the rest of the commands under that – koleygr Oct 15 '17 at 13:08

Here is my tested answer (but without arabic text):

\documentclass[10pt]{book}

\usepackage{titlesec}
\usepackage[fullvoc]{arabxetex}
\newfontfamily\arabicfont[Script=Arabic]{Linux Libertine O}

\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[display]
{\bfseries\Large}
{\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{4ex}
{\titlerule
\vspace{2ex}%
\filright}
[\vspace{2ex}%
\titlerule]

\begin{document}
\chapter{My Chapter}

Test

\end{document}


Output:

• This ordering works. I hope someone would explain the reason. – blackened Oct 15 '17 at 13:52
• @blackened As I said in my first comment, arabxetex redefines chapter styles. If you make your changes to chapter using \titleformat command before loading arabxetex, the last (arabxetex) will redefine the chapter to its default. So, you have to give the \titleformat command after loading arabxetex – koleygr Oct 15 '17 at 14:38
• You just missed my word titleformating from this first comment that was refering to the \titleformat command and not to the titlesec package – koleygr Oct 15 '17 at 14:40