From 3f7c85e5c7f4dc7958e0bd88940a41032519e0e1 Mon Sep 17 00:00:00 2001 From: syvshc Date: Fri, 6 May 2022 12:40:09 +0800 Subject: [PATCH] fix #194 --- elegantbook.cls | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/elegantbook.cls b/elegantbook.cls index 4c2b7a6..9ac0eca 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -920,15 +920,18 @@ \textcolor{third}{$\spadesuit$}};}},} % \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def} \DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ g o t\label g }{ - common,defstyle, - IfValueTF={#1} - {title={\definitionname~\thetcbcounter\ (#1)}} - { - IfValueTF={#2} - {title={\definitionname~\thetcbcounter\ (#2)}} - {title=\definitionname~\thetcbcounter} - }, - IfBooleanTF={#3}{label={#4}}{label={def:#4}}} + common,defstyle, + IfValueTF={#1} + {title={\definitionname~\thetcbcounter\ (#1)}} + { + IfValueTF={#2} + {title={\definitionname~\thetcbcounter\ (#2)}} + {title=\definitionname~\thetcbcounter} + }, + IfValueT={#4} + {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}{ g o t\label g }{ common,thmstyle, @@ -939,7 +942,9 @@ {title={\theoremname~\thetcbcounter\ (#2)}} {title=\theoremname~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={thm:#4}}} + IfValueT={#4} + {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}{ g o t\label g }{ common,thmstyle, @@ -950,7 +955,9 @@ {title={\postulatename~\thetcbcounter\ (#2)}} {title=\postulatename~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={pos:#4}}} + IfValueT={#4} + {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}{ g o t\label g }{ common,thmstyle, @@ -961,7 +968,9 @@ {title={\axiomname~\thetcbcounter\ (#2)}} {title=\axiomname~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={axi:#4}}} + IfValueT={#4} + {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}{ g o t\label g }{ common,thmstyle, @@ -972,7 +981,9 @@ {title={\corollaryname~\thetcbcounter\ (#2)}} {title=\corollaryname~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={cor:#4}}} + IfValueT={#4} + {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}{ g o t\label g }{ common,thmstyle, @@ -983,7 +994,9 @@ {title={\lemmaname~\thetcbcounter\ (#2)}} {title=\lemmaname~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={lem:#4}}} + IfValueT={#4} + {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}{ g o t\label g }{ common,propstyle, @@ -994,7 +1007,9 @@ {title={\propositionname~\thetcbcounter\ (#2)}} {title=\propositionname~\thetcbcounter} }, - IfBooleanTF={#3}{label={#4}}{label={pro:#4}}} + IfValueT={#4} + {IfBooleanTF={#3}{label={#4}}{label={pro:#4}}} + } }{\relax}