这个 tex 文件有错误,该如何改进?
Runaway argument?
{
! Paragraph ended before \tcb@theo@label was complete.
<to be read again>
\par
l.79 \begin{definition}{}{}
谢谢
\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
正如聊天中评论的那样乌尔丽克·菲舍尔{def}
如果你删除最后一行之前的注释:
\newtcbtheorem
[]% init options
{definition}% name
{تعريف}
% title
{%
colback=green!5,
colframe=green!35!black,
fonttitle=\bfseries,
}% options
{def}% prefix
你得到一个输出(不知道它是否正确)(用 编译xelatex
)。