diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 728e69f..a81f074 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 设置说明} @@ -258,7 +258,7 @@ tlmgr update --self --all --reinstall-forcibly-removed \item \textit{定理类环境},包含标题和内容两部分,全部定理类环境的编号均以章节编号。根据格式的不同分为 3 种 \begin{itemize} \item \textcolor{main}{\textbf{definition}} 环境,颜色为 \textcolor{main}{main}; - \item \textcolor{second}{\textbf{theorem、lemma、corollary}} 环境,颜色为 \textcolor{second} {second}; + \item \textcolor{second}{\textbf{theorem、lemma、corollary、axiom、postulate}} 环境,颜色为 \textcolor{second} {second}; \item \textcolor{third}{\textbf{proposition}} 环境,颜色为 \textcolor{third}{third}。 \end{itemize} \item \textit{示例类环境},有 \textbf{example、problem、exercise} 环境(对应于例、例题、练习),自动编号,编号以章节为单位,其中 \textbf{exercise} 有提示符。 @@ -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..14f24f2 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -210,7 +210,7 @@ In this template, we defined four different theorem class environments \item \textit{Theorem Environments}, including title and content, numbering corresponding to chapter. Three types depending on the format: \begin{itemize} \item \textcolor{main}{\textbf{definition}} environment, the color is \textcolor{main}{main}; - \item \textcolor{second}{\textbf{theorem, lemma, corollary}} environment, the color is \textcolor{second} {second}; + \item \textcolor{second}{\textbf{theorem, lemma, corollary, axiom, postulate}} environment, the color is \textcolor{second} {second}; \item \textcolor{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}. \end{itemize} \item \textit{Example Environment}, including \textbf{example, exercise, problem} environment, auto numbering according to chapter. @@ -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..187d620 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 }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ g o t\label g }{ common,defstyle, - IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}} + 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 }{ + \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ g o t\label g }{ common,propstyle, - IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter}, - IfBooleanTF={#2}{label=#3}{}}}{\relax} + 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}{