revert theorem usage to amsthm style

This commit is contained in:
EthanDeng
2020-06-03 20:22:15 +08:00
parent d281e3e834
commit 9ef6a5bf5a
3 changed files with 66 additions and 58 deletions

View File

@@ -10,7 +10,10 @@
\bioinfo{自定义}{信息}
\extrainfo{温柔正确的人总是难以生存,因为这世界既不温柔,也不正确。—— 比企谷八幡}
\setcounter{tocdepth}{3}
\newcommand{\dollar}{\mbox{\textdollar}}
\lstset{
mathescape = false}
\logo{logo-blue.png}
\cover{cover.jpg}
@@ -295,11 +298,11 @@ Elegant\LaTeX{} 系列模板从创立至今已经有 9 年了,我们的模板
\end{table}
如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 structurecolor、main、second、third 颜色,具体方法如下:
\begin{lstlisting}
\begin{lstlisting}[tabsize=4]]
\definecolor{structurecolor}{RGB}{0,0,0}
\definecolor{main}{RGB}{70,70,70}
\definecolor{second}{RGB}{115,45,2}
\definecolor{third}{RGB}{0,80,80}
\definecolor{third}{RGB}{0,80,80}
\end{lstlisting}
\section{封面}
@@ -596,6 +599,7 @@ The content of introduction.
\end{remark}
\part{中文}
\chapter{字体选项}
字体选项独立成章的原因是,我们希望本模板的用户关心模板使用的字体,知晓自己使用的字体以及遇到字体相关的问题能更加便捷地找到答案。
@@ -711,7 +715,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$$\mathcal{R}^n$ 中的可测集。
\begin{definition}{可积性}{int}
\begin{definition}[可积性] \label{def:int}
$ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$$E$ 上的非负简单函数,其中 $\{A_1,A_2,\ldots,A_k\}$$E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$$E$ 上的积分为 $\int_{a}^b f(x)$
\begin{equation}
\label{inter}
@@ -747,7 +751,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
$D(x)$$[0,1]$ 上是 Lebesgue 可积的并且积分值为零。但 $D(x)$$[0,1]$ 上不是 Riemann 可积的。
\end{proof}
\begin{theorem}{Fubini 定理}{fubi}
\begin{theorem}[Fubini 定理] \label{thm:fubi}
1$f(x,y)$$\mathcal{R}^p\times\mathcal{R}^q$ 上的非负可测函数,则对几乎处处的 $x\in \mathcal{R}^p$$f(x,y)$ 作为 $y$ 的函数是 $\mathcal{R}^q$ 上的非负可测函数,$g(x)=\int_{\mathcal{R}^q}f(x,y) dy$$\mathcal{R}^p$ 上的非负可测函数。并且
\begin{equation}
\label{eq:461}
@@ -763,7 +767,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
我们说一个实变或者复变量的实值或者复值函数是在区间上平方可积的,如果其绝对值的平方在该区间上的积分是有限的。所有在勒贝格积分意义下平方可积的可测函数构成一个希尔伯特空间,也就是所谓的 $L^2$ 空间,几乎处处相等的函数归为同一等价类。形式上,$L^2$ 是平方可积函数的空间和几乎处处为 0 的函数空间的商空间。
\begin{proposition}{最优性原理}{max}
\begin{proposition}[最优性原理] \label{pro:max}
如果 $u^*$$[s,T]$ 上为最优解,则 $u^*$$[s, T]$ 任意子区间都是最优解,假设区间为 $[t_0, t_1]$ 的最优解为 $u^*$ ,则 $u(t_0)=u^{*}(t_0)$,即初始条件必须还是在 $u^*$ 上。
\end{proposition}

View File

@@ -175,6 +175,7 @@ BTW, we provide Certificate of Donation for those who donated, tippers please le
\includegraphics[width=0.7\textwidth]{cert.pdf}
\end{figure}
\part{Hello world}
\chapter{ElegantBook Settings}
This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2019, either \hologo{pdfLaTeX} or \lstinline{XeLaTeX} works fine. \lstinline{XeLaTeX} is preferred for Chinese articles.
@@ -611,7 +612,7 @@ The reason is that the template redefines font for math so that no new math font
We will define the integral of a measurable function in three steps. First, we define the integral of a nonnegative simple function. Let $E$ be the measurable set in $\mathcal{R}^N$.
\begin{definition}{Left Coset}{}
\begin{definition}[Left Coset]
Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is of the form $Hx$, where $Hx = \{ hx : h \in H \}$ $\hbar$
\end{definition}
@@ -621,10 +622,11 @@ Note that a subgroup~$H$ of a group $G$ is itself a left coset of $H$ in $G$.
\lipsum[2]
\begin{theorem}{Lagrange's Theorem}{}
\begin{theorem}[Lagrange's Theorem] \label{thm:lg}
Let $G$ be a finite group, and let $H$ be a subgroup of $G$. Then the order of $H$ divides the order of $G$.
\end{theorem}
\ref{thm:lg}
\lipsum[3]

View File

@@ -8,7 +8,7 @@
%%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2020/04/12 v3.11 ElegantBook document class]
\ProvidesClass{elegantbook}[2020/04/12 v4.0.1 ElegantBook document class]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
@@ -390,6 +390,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Table}~\ref{#1}}
\renewcommand{\partname}{\color{structurecolor} Part}
\renewcommand{\chaptername}{Chapter \thechapter}
\newcommand{\authorname}{\textbf{Author: }}
\newcommand{\institutename}{\textbf{Institute: }}
@@ -565,71 +566,72 @@
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
\textcolor{third}{$\spadesuit$}};}},}
\newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def}
\newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm}
\newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos}
\newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi}
\newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro}
\newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor}
\newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem}
% \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def}
\DeclareTColorBox[auto counter,number within=chapter]{definition}{ o t\label g }{
common,defstyle,
IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm}
\DeclareTColorBox[auto counter,number within=chapter]{theorem}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos}
\DeclareTColorBox[auto counter,number within=chapter]{postulate}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi}
\DeclareTColorBox[auto counter,number within=chapter]{axiom}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\axiomname~\thetcbcounter\ (#1)}}{title=\axiomname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor}
\DeclareTColorBox[auto counter,number within=chapter]{corollary}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem}
\DeclareTColorBox[auto counter,number within=chapter]{lemma}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro}
\DeclareTColorBox[auto counter,number within=chapter]{proposition}{ o t\label g }{
common,propstyle,
IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
}{\relax}
\ifdefstring{\ELEGANT@mode}{simple}{
\let\openbox\relax
\RequirePackage{amsthm}
\let\proof\relax
% \let\proofname\relax
\let\endproof\relax
% declare a new theorem style
\newtheoremstyle{edefstyle}{3pt}{3pt}{\citshape}{-3pt}{
\newtheoremstyle{defstyle}{3pt}{3pt}{\citshape}{-3pt}{
\bfseries\color{main}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
\newtheoremstyle{ethmstyle}{3pt}{3pt}{\citshape}{-3pt}{
\newtheoremstyle{thmstyle}{3pt}{3pt}{\citshape}{-3pt}{
\bfseries\color{second}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
\newtheoremstyle{eprostyle}{3pt}{3pt}{\citshape}{-3pt}{
\newtheoremstyle{prostyle}{3pt}{3pt}{\citshape}{-3pt}{
\bfseries\color{third}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
\theoremstyle{edefstyle} % definition style
\theoremstyle{defstyle} % definition style
\newtheorem{definition}{\definitionname}[chapter]
\newtheorem{edefinition}{\definitionname}[chapter]
\newenvironment{definition}[2]{
\ifstrempty{#1}{\edefinition}{\edefinition[#1]}\ifstrempty{#2}{}{\label{def:#2}}}{
\endedefinition}
\theoremstyle{thmstyle} %theorem style
\newtheorem{theorem}{\theoremname}[chapter]
\newtheorem{lemma}{\lemmaname}[chapter]
\newtheorem{corollary}{\corollaryname}[chapter]
\newtheorem{postulate}{\postulatename}[chapter]
\newtheorem{axiom}{\axiomname}[chapter]
\theoremstyle{ethmstyle} %theorem style
\newtheorem{etheorem}{\theoremname}[chapter]
\newenvironment{theorem}[2]{
\ignorespaces\ifstrempty{#1}{\etheorem}{\etheorem[#1]}\ifstrempty{#2}{}{\label{thm:#2}}}{
\endetheorem}
\newtheorem{elemma}{\lemmaname}[chapter]
\newenvironment{lemma}[2]{
\ignorespaces\ifstrempty{#1}{\elemma}{\elemma[#1]}\ifstrempty{#2}{}{\label{lem:#2}}}{
\endelemma}
\newtheorem{ecorollary}{\corollaryname}[chapter]
\newenvironment{corollary}[2]{
\ignorespaces\ifstrempty{#1}{\ecorollary}{\ecorollary[#1]}\ifstrempty{#2}{}{\label{cor:#2}}}{
\endecorollary}
\newtheorem{epostulate}{\postulatename}[chapter]
\newenvironment{postulate}[2]{
\ifstrempty{#1}{\epostulate}{\epostulate[#1]}\ifstrempty{#2}{}{\label{pos:#2}}}{
\endepostulate}
\newtheorem{eaxiom}{\axiomname}[chapter]
\newenvironment{axiom}[2]{
\ifstrempty{#1}{\eaxiom}{\eaxiom[#1]}\ifstrempty{#2}{}{\label{axi:#2}}}{
\endaxiom}
\theoremstyle{eprostyle}
\newtheorem{eproposition}{\propositionname}[chapter]
\newenvironment{proposition}[2]{
\ifstrempty{#1}{\eproposition}{\eproposition[#1]}\ifstrempty{#2}{}{\label{pro:#2}}}{
\endeproposition}
\theoremstyle{prostyle} % proposition style
\newtheorem{proposition}{\propositionname}[chapter]
}{\relax}
% maingreen-def): example exercise problem solution