tcolorbox 定理

tcolorbox 定理

请问“نظرية”后面的“定理名称”怎么写

\documentclass[12pt,a4paper]{book}
\usepackage[arabic]{minitoc}

\usepackage[most]{tcolorbox}
\usepackage[pdfstartview=FitH,citecolor=red,colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
\hypersetup{linktocpage}

\newtcolorbox[auto counter,number within=section,number freestyle={\noexpand\arabic{chapter}.\noexpand\arabic{\tcbcounter}.}]{theorem}[2][]{
  breakable,
  enhanced,
  colback=violet!3!white,
  boxrule=0.5pt,
  arc=0.5pt,
  outer arc=0.5pt,
  title=نظرية~\thetcbcounter,
  label=#2
  fonttitle=\bfseries\strut,
  coltitle=purple,
  colbacktitle=violet!10!white,
  title style={
right color=violet!60!white,
    left color=teal!20!white,
    middle color=violet!30!teal!20!, 
     }, #1}{}
 
%======================================================== 
% languages & fonts===========================================
\usepackage[numbers]{natbib}

\usepackage{polyglossia}
\setdefaultlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

\setcounter{minitocdepth}{1}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Amiri}
%%


\begin{document}

\begin{theorem}{2}{name of theorem}
text
\end{theorem}
\ref{2}
\end{document}

答案1

不确定这是你喜欢的,我不懂阿拉伯语规则:

\documentclass[12pt,a4paper]{book}
\usepackage[arabic]{minitoc}

\usepackage[most]{tcolorbox}
\usepackage[pdfstartview=FitH,citecolor=red,colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
\hypersetup{linktocpage}

\newtcolorbox[auto counter,number within=section,number freestyle={\noexpand\arabic{chapter}.\noexpand\arabic{\tcbcounter}.}]{theorem}[3][]{
  breakable,
  enhanced,
  colback=violet!3!white,
  boxrule=0.5pt,
  arc=0.5pt,
  outer arc=0.5pt,
  title=نظرية~\thetcbcounter~#3,
  label=#2,
  fonttitle=\bfseries\strut,
  coltitle=purple,
  colbacktitle=violet!10!white,
  title style={
right color=violet!60!white,
    left color=teal!20!white,
    middle color=violet!30!teal!20!, 
     }, #1}{}
 
%======================================================== 
% languages & fonts===========================================
\usepackage[numbers]{natbib}

\usepackage{polyglossia}
\setdefaultlanguage[numerals=maghrib]{arabic}
\setotherlanguage{english}

\setcounter{minitocdepth}{1}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Amiri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Amiri}
%%


\begin{document}

\begin{theorem}{2}{name of theorem}
text
\end{theorem}
\ref{2}
\end{document}

在此处输入图片描述

相关内容