0

I have an error with this tex files, how to improve it ?

Runaway argument?
{
! Paragraph ended before \tcb@theo@label was complete.
<to be read again> 
                   \par 
l.79 \begin{definition}{}{}

thank you

\documentclass[12pt,a4paper,openany]{book}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{titleps}


\usepackage{tcolorbox}

\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {definition}% name
  {تعريف}
  % title
  {%
    colback=green!5,
    colframe=green!35!black,
    fonttitle=\bfseries,
  }% options
% {def}% prefix



\usepackage{polyglossia}
\setmainlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.1,AutoFakeSlant=-0.03]{Amiri}
\setsansfont[Script=Arabic,Scale=1.1]{Amiri}

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

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




\newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname}
\def\xwords#1{\ifcase#1\or
الأول\or
\else
I need more words\fi}

\makeatletter

\makeatother

\makeatletter
\pretocmd{\@chapter}{\begingroup \renewcommand{\thechapter}{{\words{chapter}}}}{}{}
\apptocmd{\@chapter}{\endgroup}{}{}
\makeatother


\renewcommand{\thesection}{\arabic{section}}
\parindent=0mm

\begin{document}
\chapter{واحد}
\section{ح}


\section{حاول}

\begin{definition}{}{}
ليكن
\end{definition}

\end{document}

1 Answer 1

0

As commented in chat by Ulrike Fischer if you remove the comment before {def} in the last line of:

\newtcbtheorem
  []% init options
  {definition}% name
  {تعريف}
  % title
  {%
    colback=green!5,
    colframe=green!35!black,
    fonttitle=\bfseries,
  }% options
{def}% prefix

you get an output (no idea if it's correct) (compiled with xelatex).

enter image description here

4
  • please how to obtain the numeration of definition with respect to the section for example 1.2 not 1,2,3 ,... Nov 19, 2020 at 16:06
  • please @Rmano have you an idea ? Nov 19, 2020 at 16:19
  • as @skillmon told you add number within=section in the option of the \newtcbtheorm (between the brackes where it says `%init options). I suggest reading the manual...
    – Rmano
    Nov 19, 2020 at 17:02
  • thank you very much it works !@Rmano Nov 19, 2020 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .