# Question about compilation in Arabic tex

I found this tex files but it gives me many errors (in \fancyhfoffset,\mainmatter,..): i compile with xelatex and texlive 2017

how to do ?

thank you

\documentclass{book}
\usepackage[dvips]{graphicx}
\usepackage{boxedminipage}
\usepackage{slashbox} % PROBLEME
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{minitoc}
\usepackage{rotating}
\usepackage{titlesec, color}
\usepackage{fmultico}%PERMET MULTICOLUMN ARABE
%%%----------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
%%%----------------------------------------
\usepackage{pdflscape}
%%%----------------------------------------
\makeatletter\renewcommand*\l@section{\@dottedtocline{1}{3.8pt}{1cm}}
\makeatother
%%%----------------------------------------
\usepackage{enumitem}
\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
%%%----------------------------------------
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\topmargin=-2.25cm
\usepackage{xeindex}%PACKAGE DE LINDEX
\makeindex
\usepackage{minitoc}
\dominitoc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%footnote a droite %%%%%%%%%%%%%%%%%%%%%%%%%         FOOTNOTE A DROITE AINSI QUE LE TRAIT    %%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\footnoterule}{\raggedleft\vspace*{-3pt}\rule{2in}{0.4pt}\vspace*{2.6pt}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\rightfootnoterule
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%SINON LE FORMAT DU HEADING EST TROP  PETIT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%ENTRE CROCHET PAGE PAIRE LAUTRE IMPAIRE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\setcounter{tocdepth}{2}%%%%%%%%%%%%%%%%%%JUSQUAUX SOUS-SECTIONS
\setcounter{minitocdepth}{1}%%%%%%%%%%%%%%%%%%JUSQUAUX SECTIONS POUR MINITOC
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% NEW COMMAND Polyglossia %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%REDEFINITION DES COMMANDES DE ARABTEX QUE NE CONNAIT PAS POLYGLOSSIA
\renewcommand{\textarabic}[1]{\mbox{\RL{#1}}}
%%%\newcommand{\textLR}[1]{\LR{\rmfamily #1}}
\newcommand{\ARmbox}[1]{\mbox{\RL{#1}}}
\newcommand{\textLR}[1]{\mbox{\LR{#1}}}
\newcommand{\textRL}[1]{\mbox{\RL{#1}}}

\title{\parbox{12cm}{
%\includegraphics[width=2cm]{uko-logo.png} \\
\rule{12cm}{4pt}
\medskip
{الجبر}
\\[-4mm]
\rule{12cm}{4pt}
\end{center}
\hfill\footnotesize
تأليف:
\\[2cm]
%{\Large الطبعة }
\\[2cm]
}}

\author{ ترجمة:  كلية العلوم\\جامعة }
\date{}
\scrollmode
%%%----------------------------------------
\mainmatter
\pagenumbering{arabic}
\def\thepage{\arabic{page}}
\renewcommand{\thethm}{\textbf{{\thechapter}.\textLR{\arabic{thm}}.\arabic{section}}}
%%%--------------------------------------------
\begin{document}

\end{document}

• This template is a bit of a mess. First, do you have slashbox.sty installed? Next, change all occurrences of \bf to bfseries. Next, remove duplicate lines, such as \newfontfamily\headingfont[]{Tahoma}. And if it’s not essential for demonstrating the problem, change Traditional Arabic to Amiri, since that’s in TeX Live, so that more of us will be able to test your example. – Thérèse Jul 16 '18 at 16:25
• \bfseries or just bfseries @Thérèse – Vrouvrou Jul 16 '18 at 16:41
• \bfseries (comments can’t be edited unless you notice the mistake quickly!). \bf is a symptom of a very old template, so you should remove line by line until you have a minimal example to reproduce the problem. – Thérèse Jul 16 '18 at 16:43
• i stil have a problem with \fancyhfoffset – Vrouvrou Jul 16 '18 at 16:45
• If you comment that line out, does the rest of the file compile? – Thérèse Jul 16 '18 at 16:56