1
\documentclass[12pt]{book}

\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{etoolbox}
\usepackage{multicol}
\usepackage{titleps}

\usepackage{amsmath,amssymb}


%\usepackage{framed}
%\usepackage[framed]{ntheorem}

%\newframedtheorem{theorem}{مبرهنة}[section]

%\renewcommand{\thetheorem}{\arabic{theorem}.\arabic{section}.\arabic{chapter}}

\newtheorem{theorem}{مبرهنة}[chapter]

\usepackage{geometry}
%\geometry{paperwidth=150mm, paperheight=200mm, top=5mm, bottom=5mm}
%\pagestyle{empty}

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

\makeatletter
\pretocmd{\@chapter}{\begingroup \renewcommand{\thechapter}{{\words{chapter}}}}{}{}
\apptocmd{\@chapter}{\endgroup}{}{}
\makeatother
\titlecontents{lsection}
  [2.3em]{\small}{\contentslabel{2.3em}}
  {\hspace*{-2.3em}}
  {}
\titlecontents{lsubsection}
  [4.6em]{\small}{\contentslabel{2.3em}}
  {\hspace*{-2.3em}}
  {}

\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \words{chapter}}{20pt}{\Huge}
\titlespacing{\chapter}
  {0pt}{40pt}{-10pt}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  MACRO FOR LITERAL NUMBERING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname}
\def\xwords#1{\ifcase#1\or
الأول\or
الثاني\or
الثالث\or
الرابع\or
الخامس\or
السادس\or
السابع\or
الثامن\or
التاسع\or
العاشر\or
الحادي عشر\or
الثاني عشر\or
الثالث عشر\or
الرابع عشر\or
الخامس عشر\or
السادس عشر\or
السابع عشر\or
الثامن عشر\or
التاسع عشر\or
العشرون\or
\else
I need more words\fi}

% \usepackage{etoolbox} %% uncomment if 'etoolbox' isn't already being loaded
\makeatletter
\patchcmd{\@makechapterhead}{\thechapter}{\words{chapter}}{}{}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  END MACRO FOR LITERAL NUMBERING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     REDEFINING NAMES IN ARABIC      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gappto\captionsarabic{\renewcommand{\contentsname}{المحتويات}}
\gappto\captionsarabic{\renewcommand{\chaptername}{الفصل}}
\gappto\captionsarabic{\def\figurename{رسم}}
\gappto\captionsarabic{\renewcommand{\tablename}{جدول}}
\gappto\captionsarabic{\renewcommand{\indexname}{\textbf{الثبت}}}
\gappto\captionsarabic{\renewcommand{\appendixname}{\textbf{الملحق}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   MACRO FOR PARTIAL CONTENTS     %%%%%%%%%%%%%%%%%%%%%%%
% start of Werner's code
% http://tex.stackexchange.com/a/37732/3954
\setlength{\columnseprule}{0.1pt}
\makeatletter
\patchcmd{\endmulticols}{\par}{\par\xdef\@@tpd{\the\prevdepth}}{}{}
\newenvironment{multicolumns}[1]
  {% \begin{multicolumns}{<cols>}
   \par\nobreak % don't break a page here
   \kern\dimexpr\the\prevdepth+\multicolsep\relax % don't take into account the depth of the preceding line + #2
   {\columnseprulecolor\hrule height 0.4pt} % the rule, same width as \columnseprule
   \kern-\multicolsep % space after the rule
   \nointerlineskip % no additional space after the rule
   \begin{multicols}{#1}
  }
  {% \end{multicolumns}
   \end{multicols}%
   \par\nobreak % don't break a page here
   \kern\dimexpr\@@tpd-\multicolsep\relax % don't take into account the depth of the preceding line + #2
   {\columnseprulecolor\hrule height 0.4pt} % the rule, same width as \columnseprule
   \kern\multicolsep % space after the rule
   \nointerlineskip % no additional space after the rule
  }
\makeatother
% end of Werner's code

%%%     Commands for generateing the ptc
\newcommand\buildptc{%
\vspace*{-40pt}
  \startcontents[chapter]
{\large\noindent\bf
المحتوى}
\vspace*{-5pt}
  \begin{multicolumns}{2}
  \printcontents[chapter]{l}{0}{\setcounter{secnumdepth}{3}}
  \end{multicolumns}%
%%%\vspace*{-40pt}
\vspace*{5pt}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   END MACRO FOR PARTIAL CONTENTS     %%%%%%%%%%%%%%%%%%%%%%%





%%%%%%%%%%%%%%%%%% REDEFINES \THECHAPTER IN CONTENTS
\makeatletter
\pretocmd{\@chapter}{\begingroup \renewcommand{\thechapter}{{\words{chapter}}}}{}{}
\apptocmd{\@chapter}{\endgroup}{}{}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{titletoc}%
\titlecontents{chapter}% <section-type>
  [0pt]% <left>
  {\bfseries\vspace*{10pt}}% <above-code>
  {\normalsize\chaptername\ \thecontentslabel.\;}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\normalsize\hfill\contentspage}% <filler-page-format>

\usepackage[Glenn]{fncychap}
\ChNumVar{\Large}% Dimension of the number of the chapter in the first page... instead of the default...\ChNumVar{\Huge}

\renewcommand{\thesection}{\arabic{section}}
\begin{document}

\end{document}

I found this template, but I don't know how to define proof-> برهان corollary-> نتيجة

  • 1
    In addition to using amsthm, you might be interested in the work Khaled Hosny's done to support Arabic and Persian math with OpenType fonts. – Davislor Sep 8 '18 at 23:36
1

The template uses the package amsthm for defining theorems etc. You can define a proof- and corollary-environment similarly to theorem \newtheorem{proof}{برهان}[chapter]. The optional argument sets the numbering to chapter numbers. You may also want to change the theorem style with \theoremstyle{} and plain or definition or remark as argument. For more detailed information have a look at the documentation especially page 7 for the styles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.