diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 728e69f..da93ec6 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -90,7 +90,7 @@ tlmgr update --self --all --reinstall-forcibly-removed \section{关于提交} -出于某些因素的考虑,Elegant\LaTeX{} 项目自 2019 年 5 月 20 日开始,\textbf{不再接受任何非作者预约性质的提交}(pull request)!如果你想改进模板,你可以给我们提交 issues,或者可以在遵循协议(LPPL-1.3c)的情况下,克隆到自己仓库下进行修改。 +出于某些因素的考虑,Elegant\LaTeX{} 项目自 2019 年 5 月 20 日开始,\textbf{不再接受任何非作者预约性质的提交}(pull request)!如果你想改进模板,你可以给我们提交 issues,或者可以在遵循协议(LPPL-1.3c)的情况下,克隆到自己仓库下进行修改。 \chapter{ElegantBook 设置说明} @@ -300,6 +300,8 @@ tlmgr update --self --all --reinstall-forcibly-removed \midrule definition & label & def & \lstinline|\ref{def:label}| \\ theorem & label & thm & \lstinline|\ref{thm:label}| \\ + postulate & label & pos & \lstinline|\ref{pos:label}| \\ + axiom & label & axi & \lstinline|\ref{axi:label}|\\ lemma & label & lem & \lstinline|\ref{lem:label}| \\ corollary & label & cor & \lstinline|\ref{cor:label}| \\ proposition & label & pro & \lstinline|\ref{pro:label}| \\ diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 00e7f67..2e5abb0 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -250,6 +250,8 @@ Other theorem class environments with the same usage includes: \midrule definition & label & def & \lstinline|\ref{def:label}| \\ theorem & label & thm & \lstinline|\ref{thm:label}| \\ + postulate & label & pos & \lstinline|\ref{pos:label}| \\ + axiom & label & axi & \lstinline|\ref{axi:label}|\\ lemma & label & lem & \lstinline|\ref{lem:label}| \\ corrlary & label & cor & \lstinline|\ref{cor:label}| \\ proposition & label & pro & \lstinline|\ref{pro:label}| \\ diff --git a/elegantbook.cls b/elegantbook.cls index 0966c3f..24baa13 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -908,40 +908,83 @@ \node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) { \textcolor{third}{$\spadesuit$}};}},} % \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ o t\label g }{ - common,defstyle, - IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ g o t\label g }{ + common,thmstyle, + IfValueTF={#1} + {title={\definitionname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\definitionname~\thetcbcounter\ (#2)}} + {title=\definitionname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={def:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{theorem}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{theorem}{ g o t\label g }{ common,thmstyle, - IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + IfValueTF={#1} + {title={\theoremname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\theoremname~\thetcbcounter\ (#2)}} + {title=\theoremname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={thm:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{postulate}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{postulate}{ g o t\label g }{ common,thmstyle, - IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + IfValueTF={#1} + {title={\postulatename~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\postulatename~\thetcbcounter\ (#2)}} + {title=\postulatename~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={pos:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{axiom}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{axiom}{ g o t\label g }{ common,thmstyle, - IfValueTF={#1}{title={\axiomname~\thetcbcounter\ (#1)}}{title=\axiomname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + IfValueTF={#1} + {title={\axiomname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\axiomname~\thetcbcounter\ (#2)}} + {title=\axiomname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={axi:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{corollary}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{corollary}{ g o t\label g }{ common,thmstyle, - IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + IfValueTF={#1} + {title={\corollaryname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\corollaryname~\thetcbcounter\ (#2)}} + {title=\corollaryname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={cor:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{lemma}{ o t\label g }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{lemma}{ g o t\label g }{ common,thmstyle, - IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + IfValueTF={#1} + {title={\lemmaname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\lemmaname~\thetcbcounter\ (#2)}} + {title=\lemmaname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={lem:#4}}} % \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro} - \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ o t\label g }{ - common,propstyle, - IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}}}{\relax} + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ g o t\label g }{ + common,thmstyle, + IfValueTF={#1} + {title={\propositionname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\propositionname~\thetcbcounter\ (#2)}} + {title=\propositionname~\thetcbcounter} + }, + IfBooleanTF={#3}{label=#4}{label={pro:#4}}} +}{\relax} \ifdefstring{\ELEGANT@mode}{simple}{