15 Commits

Author SHA1 Message Date
ranwang
083a52026c gitattributes 2026-02-28 11:59:51 +08:00
ranwang
81bc14a063 re-release since 2026 2026-02-27 10:12:10 +08:00
EthanDeng
f9f002a586 update readme 2022-12-31 10:37:33 +08:00
EthanDeng
56f3042066 Merge branch 'master' of github.com:ElegantLaTeX/ElegantBook 2022-12-31 10:26:44 +08:00
EthanDeng
4611cd6d7b fix version 2022-12-31 10:26:35 +08:00
sikouhjw
ea643e3783 Merge pull request #235 from sikouhjw/master
修改文档中排序方式的解释
2022-12-30 20:09:07 +08:00
sikouhjw
ba69287a64 修改文档中排序方式的解释 2022-12-30 20:06:53 +08:00
EthanDeng
5d8a544e0e last version 2022-12-25 23:29:15 +08:00
syvshc
9b8b09df54 修复带星号的定理类环境的 \thetcbcounter 未定义的问题. 2022-10-22 01:03:09 +08:00
EthanDeng
99eb12f4c4 fix toc width 2022-09-18 19:41:42 +08:00
EthanDeng
cf516c7f2e fix version 2022-09-18 19:18:55 +08:00
EthanDeng
ecf5bf6309 bib usage error 2022-08-23 16:15:55 +08:00
Dongsheng Deng
a495c98ca4 Merge pull request #215 from ElegantLaTeX/usesamecnt
Usesamecnt
2022-08-23 15:19:26 +08:00
syvshc
e4c102f011 - 增强对定理类环境的计数器的控制
- 增加文档类选项 `usesamecnt`, 使全文的定理类环境计数器统一.
- 为 `\elegantnewtheorem` 增加新的可选参数, 来选择该定理类环境的计数器统一的计数器
2022-08-17 04:15:39 +08:00
syvshc
aeefa43d01 删除多余的 beforechap 2022-08-17 00:49:45 +08:00
6 changed files with 186 additions and 98 deletions

8
.gitattributes vendored Normal file
View File

@@ -0,0 +1,8 @@
* text=auto
*.tex text eol=lf
.gitignore text eol=lf
LICENSE text eol=lf
*.md text eol=lf
.gitattributes text eol=lf
*.cls text eol=lf
*.bib text eol=lf

View File

@@ -1,7 +1,7 @@
<!-- Author : Dongsheng Deng & Liam Huang--> <!-- Author : Dongsheng Deng & Liam Huang & Ran Wang-->
<!-- Program Email: elegantlatex2e@gmail.com --> <!-- Program Email: elegantlatex2e@gmail.com (inactive) & ranwang.osbert@outlook.com -->
[Homepage](https://elegantlatex.org/) | [Github](https://github.com/ElegantLaTeX/ElegantBook) | [CTAN](https://ctan.org/pkg/elegantbook) | [Download](https://github.com/ElegantLaTeX/ElegantBook/releases) | [Github](https://github.com/ElegantLaTeX/ElegantBook) | [CTAN](https://ctan.org/pkg/elegantbook) | [Download](https://github.com/ElegantLaTeX/ElegantBook/releases) |
![License](https://img.shields.io/ctan/l/elegantbook.svg) ![CTAN Version](https://img.shields.io/ctan/v/elegantbook.svg) ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantBook.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantBook.svg) ![License](https://img.shields.io/ctan/l/elegantbook.svg) ![CTAN Version](https://img.shields.io/ctan/v/elegantbook.svg) ![Github Version](https://img.shields.io/github/release/ElegantLaTeX/ElegantBook.svg) ![Repo Size](https://img.shields.io/github/repo-size/ElegantLaTeX/ElegantBook.svg)
@@ -9,19 +9,20 @@
# ElegantBook: 优美的 LaTeX 书籍模板 An Elegant LaTeX Template for Books # ElegantBook: 优美的 LaTeX 书籍模板 An Elegant LaTeX Template for Books
ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Ethan Deng](https://github.com/EthanDeng) 和 [Liam Huang](https://github.com/Liam0205) 创立,现在主要由 [Ethan Deng](https://github.com/EthanDeng)、[乙醇](https://github.com/syvshc)和[死抠](https://github.com/sikouhjw)维护。如果你有其他问题、建议或者报告 bug可以提交 issues 或者加入我们的 QQ 用户交流群692108391。 ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Ethan Deng](https://github.com/EthanDeng) 和 [Liam Huang](https://github.com/Liam0205) 创立,而后由 [Ethan Deng](https://github.com/EthanDeng)、[乙醇](https://github.com/syvshc)和[死抠](https://github.com/sikouhjw)维护。自2026年起由[啸行](https://github.com/OsbertWang)负责维护和发行。如果你有其他问题、建议或者报告 bug可以提交 issues 或者加入我们的 QQ 用户交流群692108391。
ElegantBook is designed for writing books, created by [Ethan Deng](https://github.com/EthanDeng) and [Liam Huang](https://github.com/Liam0205), and maintained by [Ethan Deng](https://github.com/EthanDeng), [syvshc](https://github.com/syvshc) and [sikouhjw](https://github.com/sikouhjw). Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues or contact us at elegantlatex2e@gmail.com. ElegantBook is a template designed for LaTeX book writing, created by [Ethan Deng](https://github.com/EthanDeng) and [Liam Huang](https://github.com/Liam0205), and later maintained by [Ethan Deng](https://github.com/EthanDeng), [ethanol](https://github.com/syvshc), and [sikouhjw](https://github.com/sikouhjw). Since 2026, [Osbert Wang](https://github.com/OsbertWang) has been responsible for its maintenance and distribution. If you have any questions, suggestions, or need to report bugs, feel free to submit issues or join our QQ user group: 692108391.
**本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。**
**This template was discontinued as of January 1, 2023, and its use was not recommended. However, due to its large user base, it has been re-released since 2026. To ensure that users of previous versions can still access the documentation, this documentation retains past information.**
## 致谢 Acknowledgement ## 致谢 Acknowledgement
特别感谢 [sikouhjw](https://github.com/sikouhjw) 和 [syvshc](https://github.com/syvshc) 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 ElegantLaTeX 相关问题的回复。特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。 特别感谢 [sikouhjw](https://github.com/sikouhjw) 和 [syvshc](https://github.com/syvshc) 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 ElegantLaTeX 相关问题的回复。特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。
Thank [sikouhjw](https://github.com/sikouhjw) and [syvshc](https://github.com/syvshc) for their quick response to Github issues and continuously support work for ElegantLaTeX community. Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion. Thank [sikouhjw](https://github.com/sikouhjw) and [syvshc](https://github.com/syvshc) for their quick response to Github issues and continuously support work for ElegantLaTeX community. Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion.
## 协议 License ## 协议 License
本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。 本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。
@@ -29,7 +30,6 @@ Thank [sikouhjw](https://github.com/sikouhjw) and [syvshc](https://github.com/sy
This work is released under the LaTeX Project Public License, v1.3c or later. This work is released under the LaTeX Project Public License, v1.3c or later.
## 衍生品 Derivative Works ## 衍生品 Derivative Works
+ [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown)[XiangyunHuang](https://github.com/XiangyunHuang) 开发并维护的基于 ElegantBook 的 Bookdown 模板。 + [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown)[XiangyunHuang](https://github.com/XiangyunHuang) 开发并维护的基于 ElegantBook 的 Bookdown 模板。

View File

@@ -1,15 +1,15 @@
\documentclass[lang=cn,10pt,newtx]{elegantbook} \documentclass[lang=cn,newtx,10pt,scheme=chinese]{elegantbook}
\title{ElegantBook优美的 \LaTeX{} 书籍模板} \title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作} \subtitle{Elegant\LaTeX{} 经典之作}
\author{Ethan Deng \& Liam Huang} \author{Ethan Deng \& Liam Huang \& syvshc \& sikouhjw \& Osbert Wang}
\institute{Elegant\LaTeX{} Program} \institute{Elegant\LaTeX{} Program}
\date{Aug 15, 2022} \date{2026/2/27}
\version{4.4} \version{4.6}
\bioinfo{自定义}{信息} \bioinfo{自定义}{信息}
\extrainfo{要让一群人团结起来,需要的不是英明的领导,而是共同的敌人。—— 比企谷八幡} \extrainfo{\textcolor{red}{\bfseries 注意本模板自2023年1月1日起停止维护。然而鉴于用户群体庞大自2026年起恢复维护并重新发布。}}
\setcounter{tocdepth}{3} \setcounter{tocdepth}{3}
@@ -38,25 +38,22 @@
\chapter{Elegant\LaTeX{} 系列模板介绍} \chapter{Elegant\LaTeX{} 系列模板介绍}
Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。大版本改动较大,请关注版本信息,在未开始使用模板钱,建议直接选择最新正式版本! \begin{quotation}
\textbf{\textcolor{red}{本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}}
\end{quotation}
Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。大版本改动较大,请关注版本信息,在未开始使用模板前,建议直接选择最新正式版本!
本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 Elegant\LaTeX{} 相关内容。 本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 Elegant\LaTeX{} 相关内容。
\begin{itemize} \begin{itemize}
\item 官网:\href{https://elegantlatex.org/}{https://elegantlatex.org/}
\item GitHub 地址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/} \item GitHub 地址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}
\item CTAN 地址:\href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook} \item CTAN 地址:\href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook}
\item 下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{正式发行版}\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版} \item 下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{正式发行版}\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版}
\item 微博Elegant\LaTeX{}
\item 微信公众号Elegant\LaTeX{}
\item Bilibili\href{https://space.bilibili.com/516479629}{ElegantLaTeX} \item Bilibili\href{https://space.bilibili.com/516479629}{ElegantLaTeX}
\item 用户 QQ 群692108391 \item 用户 QQ 群692108391
\item 邮件:\email{elegantlatex2e@gmail.com}
\end{itemize} \end{itemize}
\begin{quotation}
\textbf{注意:} 由于 ElegantLaTeX 的模板涉及宏包和设定比较多,不建议没有 \LaTeX{} 基础的用户使用。我们会通过 \href{https://space.bilibili.com/516479629}{B 站}进行直播或者交流分享会,录屏也将发布在该账户下,如果大家在模板的使用上有问题,可以观看视频、加群咨询或者查看模板自带的文档说明(如果安装了 TeX Live可以使用在命令行提示符下运行 \lstinline{texdoc elegantbook} 命令获得模板的说明文档。
\end{quotation}
\section{模板安装与更新} \section{模板安装与更新}
@@ -74,9 +71,9 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模
本模板测试环境为 本模板测试环境为
\begin{enumerate} \begin{enumerate}
\item Win10 + \TeX{} Live 2022 \item Win11 + \TeX{} Live 2025
\item Ubuntu 20.04 + \TeX{} Live 2022 \item Ubuntu 22.04 + \TeX{} Live 2025
\item macOS Monterey + Mac\TeX{} 2022 \item macOS + Mac\TeX{} 2025
\end{enumerate} \end{enumerate}
\TeX Live/Mac\TeX{} 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍} \TeX Live/Mac\TeX{} 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}
@@ -96,20 +93,6 @@ tlmgr update --self --all --reinstall-forcibly-removed
由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{}\TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍} 由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{}\TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}
\section{关于提交}
由于精力有限,本人维护模板的时间并不多,考虑到模板的用户还挺多,本模板自 2022 年 8 月开始开放特性提交features pull requests不过在提交之前请务必在 issue 区将问题、解决方式以及对应的示例(最简单的使用示例)写清楚,我们会根据 issue 的信息,接受合适的提交。
\section{赞助}
如果您非常喜爱我们的模板你还可以选择赞助的方式支持这个项目赞助主要用于网站域名和服务器的购买、QQ 用户群的维护以及对于管理员的奖励。赞赏费用的使用解释权归 ElegantLaTeX/EthanDeng 所有,不接受监督。
\begin{figure}[htbp]
\centering
\includegraphics[width=0.5\textwidth]{donate.jpg}
\end{figure}
\chapter{ElegantBook 设置说明} \chapter{ElegantBook 设置说明}
@@ -446,24 +429,36 @@ tlmgr update --self --all --reinstall-forcibly-removed
\documentclass[thmcnt=section]{elegantbook} \documentclass[thmcnt=section]{elegantbook}
\end{lstlisting} \end{lstlisting}
如果希望全局的定理类环境使用同一个计数器,可以使用文档类选项 \lstinline{usesamecnt}
\begin{lstlisting}
\documentclass[usesamecnt]{elegantbook}
\end{lstlisting}
\subsection{自定义定理类环境} \subsection{自定义定理类环境}
4.4 版本新增了一个自定义定理类环境的命令:\lstinline|\elegantnewtheorem|,它的参数含义如下: 4.4 版本新增了一个自定义定理类环境的命令:\lstinline|\elegantnewtheorem|,它的参数含义如下:
\begin{lstlisting} \begin{lstlisting}
% fancy 模式(默认) % fancy 模式(默认)
\elegantnewtheorem{env}{title}{style}{prefix} \elegantnewtheorem{env}{title}{style}{prefix}[numbered-like]
% simple 模式 % simple 模式
\elegantnewtheorem{env}{title}{style} \elegantnewtheorem{env}{title}{style}[numbered-like]
\end{lstlisting} \end{lstlisting}
该命令可以同时定义编号环境 \lstinline|env| 和不编号环境 \lstinline|env*|。 该命令可以同时定义编号环境 \lstinline|env| 和不编号环境 \lstinline|env*|。
其中 \lstinline|style| 支持的参数有:\lstinline|defstyle|\lstinline|thmstyle|\lstinline|prostyle|,分别对应“定义”,“定理”,“命题”三种样式。 其中 \lstinline|style| 支持的参数有:\lstinline|defstyle|\lstinline|thmstyle|\lstinline|prostyle|,分别对应“定义”,“定理”,“命题”三种样式。
如果添加了可选参数 \lstinline{numbered-like},将会使该定理类环境与名为 \lstinline{numbered-like} 的定理类环境使用同一计数器。\textbf{注意}:该参数在使用 \lstinline{usesamecnt} 选项时不起作用,并且会在终端以及 \lstinline{.log} 文件中输出一个警告,来提示用户该选项不起作用:
\begin{lstlisting}
[numbered-like] won't make sence with option
`usesamecnt'.
\end{lstlisting}
\begin{itemize} \begin{itemize}
\item 在炫彩模式(\lstinline{fancy})下,需要 4 个参数来定义一个新的定理类环境,分别是: \item 在炫彩模式(\lstinline{fancy})下,需要 5 个参数来定义一个新的定理类环境,分别是:
定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀: 定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀,(可选)该定理类环境继承的定理类环境
\begin{lstlisting} \begin{lstlisting}
% 导言区 % 导言区
@@ -501,8 +496,8 @@ Class elegantbook Warning: Because you didn't provide a prefix.
(elegantbook) on input line 3. (elegantbook) on input line 3.
\end{lstlisting} \end{lstlisting}
\item 在简单模式(\lstinline{simple})下,需要 3 个参数来定义一个新的定理类环境,分别是: \item 在简单模式(\lstinline{simple})下,需要 4 个参数来定义一个新的定理类环境,分别是:
定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀: 定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀,(可选)该定理类环境继承的定理类环境
\begin{lstlisting} \begin{lstlisting}
% 导言区 % 导言区
\elegantnewtheorem{examplesimple}{自定义定理类环境}{thmstyle} \elegantnewtheorem{examplesimple}{自定义定理类环境}{thmstyle}
@@ -582,7 +577,7 @@ Class elegantbook Warning: Because you didn't provide a prefix.
之前我们将文献调用的命令放在模板里面,然后用户反馈 \lstinline{\cite} 命令无法自动补全,因此我们新版本将其拿到外面来,新版本打印参考文献的命令的方法是,在导言区(也即 \lstinline|\begin{document}| 之前),加入: 之前我们将文献调用的命令放在模板里面,然后用户反馈 \lstinline{\cite} 命令无法自动补全,因此我们新版本将其拿到外面来,新版本打印参考文献的命令的方法是,在导言区(也即 \lstinline|\begin{document}| 之前),加入:
\begin{lstlisting} \begin{lstlisting}
\lstinline|\addbibresource[location=local]{reference.bib}|。 \addbibresource[location=local]{reference.bib}
\end{lstlisting} \end{lstlisting}
然后再需要打印文献的地方使用: 然后再需要打印文献的地方使用:
@@ -610,12 +605,15 @@ Class elegantbook Warning: Because you didn't provide a prefix.
\documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook} \documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook}
\end{lstlisting} \end{lstlisting}
如果需要添加排序方式,可以在导言区加入下面命令: 在使用
\begin{lstlisting} \begin{lstlisting}
\ExecuteBibliographyOptions{sorting=ynt} \documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook}
\end{lstlisting} \end{lstlisting}
后,排序方式为按引用先后排序。如果不使用国标 GB7714-2015 并且需要添加排序方式,可以在导言区加入下面命令:
如果使用的是国标,可以将 \lstinline{ynt} 改为 \lstinline{gb7714-2015},使文献按照国标规定进行文献排序。 \begin{lstlisting}
\ExecuteBibliographyOptions{sorting=<name>}
\end{lstlisting}
其中 \lstinline{<name>} 可以是 nty, nyt, nyvt, anyt, anyvt, ynt, ydnt, none, count, debug 的其中之一,更多排序相关请参考 biblatex 宏包手册的 3.1.2.1 节。
\section{添加序章} \section{添加序章}
@@ -896,8 +894,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
2$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$ 上的可积函数。而且~\eqref{eq:461} 成立。 2$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$ 上的可积函数。而且~\eqref{eq:461} 成立。
\end{theorem} \end{theorem}
\ref{thm:fubi}
\begin{note} \begin{note}
在本模板中引理lemma推论corollary的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。 在本模板中引理lemma推论corollary的样式和定理~\ref{thm:fubi} 的样式一致,包括颜色,仅仅只有计数器的设置不一样。
\end{note} \end{note}
@@ -927,7 +923,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\end{property} \end{property}
\begin{conclusion} \begin{conclusion}
回归分析regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。 回归分析regression analysis 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。
\end{conclusion} \end{conclusion}
\begin{problemset} \begin{problemset}
@@ -946,11 +942,11 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\item \question{大佬,我想把正文字体改为亮色,背景色改为黑灰色。} \item \question{大佬,我想把正文字体改为亮色,背景色改为黑灰色。}
页面颜色可以使用 \lstinline{\pagecolor} 命令设置,文本命令可以参考\href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{这里}进行设置。 页面颜色可以使用 \lstinline{\pagecolor} 命令设置,文本命令可以参考\href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{这里}进行设置。
\item \question{\lstinline{! LaTeX Error: Unknown option 'scheme=plain' for package 'ctex'.}} \item \question{\lstinline{! LaTeX Error: Unknown option 'scheme=plain' for package 'ctex'.}}
你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2022 你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2025
\item \question{我该使用什么版本?} \item \question{我该使用什么版本?}
请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2021 内获取。 请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2025 内获取。
\item \question{我该使用什么编辑器?} \item \question{我该使用什么编辑器?}
你可以使用 \TeX{} Live 2021 自带的编辑器 \TeX{}works 或者使用 \TeX{}studio\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX{} Live 2021 + \TeX{}studio。我自己用 VS Code 和 Sublime Text相关的配置说明请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX{} 编译环境配置Visual Studio Code 配置简介}\href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX{} 编写环境} 你可以使用 \TeX{} Live 2025 自带的编辑器 \TeX{}works 或者使用 \TeX{}studio\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX{} Live 2025 + \TeX{}studio。我(注:此为前维护者)自己用 VS Code 和 Sublime Text相关的配置说明请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX{} 编译环境配置Visual Studio Code 配置简介}\href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX{} 编写环境}
\item \question{您好,我们想用您的 ElegantBook 模板写一本书。关于机器学习的教材,希望获得您的授权,谢谢您的宝贵时间。} \item \question{您好,我们想用您的 ElegantBook 模板写一本书。关于机器学习的教材,希望获得您的授权,谢谢您的宝贵时间。}
模板的使用修改都是自由的你们声明模板来源以及模板地址GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX{} 用户作品集里。 模板的使用修改都是自由的你们声明模板来源以及模板地址GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX{} 用户作品集里。
\item \question{请问交叉引用是什么?} \item \question{请问交叉引用是什么?}
@@ -965,6 +961,22 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
根据用户的反馈,我们不断修正和完善模板。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。 根据用户的反馈,我们不断修正和完善模板。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。
\datechange{2026/02/27}{发布 v4.6 版本} \textcolor{blue}{\bfseries 恢复维护}
\begin{change}
\item 确认新维护者啸行并恢复维护。
\item 鉴于用户群体庞大,模板重新发布。
\item 更新以支持 \TeX{} Live 2025 及当前主流操作系统Windows 11、Ubuntu 24.04 LTS、macOS
\end{change}
\datechange{2022/12/31}{版本 4.5} \textcolor{red}{\bfseries 停止维护!}
\datechange{2022/08/17}{版本 4.5 pre}
\begin{change}
\item \textbf{重要改动}:提供了一个新的文档类选项 \lstinline|usesamecnt|,可以使全局的定理类环境使用同一个计数器。
\item \textbf{重要改动}:修改了 \lstinline|\elegantnewtheorem| 命令,使其有第五个(可选)参数。
\end{change}
\datechange{2022/08/15}{版本 4.4 正式发布。} \datechange{2022/08/15}{版本 4.4 正式发布。}
\begin{change} \begin{change}
@@ -973,7 +985,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\item \textbf{重要改动}:在 \lstinline{scheme=chinese} 下将目录中的“第 1 章”修改为“第一章”; \item \textbf{重要改动}:在 \lstinline{scheme=chinese} 下将目录中的“第 1 章”修改为“第一章”;
\item 将 TeX Gyre Termes 改为 TeX Gyre TermesX使英文部分字形与 newtx 系列宏包更相近; \item 将 TeX Gyre Termes 改为 TeX Gyre TermesX使英文部分字形与 newtx 系列宏包更相近;
\item 重写了内置定理类环境的实现方法,修复了一些 bug由于修改部分较大如果引入了新的 bug请及时在 QQ 群或 \href{https://github.com/ElegantLaTeX}{Github} 上进行反馈; \item 重写了内置定理类环境的实现方法,修复了一些 bug由于修改部分较大如果引入了新的 bug请及时在 QQ 群或 \href{https://github.com/ElegantLaTeX}{Github} 上进行反馈;
\item 删除 Gitee 仓库地址,恢复 GitHub 提交pull requests) \item 删除 Gitee 仓库地址,恢复 GitHub 提交pull requests
\item 将参考文献命令添加到导言区,使编辑器能够对参考文献自动补全。 \item 将参考文献命令添加到导言区,使编辑器能够对参考文献自动补全。
\end{change} \end{change}

View File

@@ -3,13 +3,13 @@
\title{An Elegant \LaTeX{} Template for Books} \title{An Elegant \LaTeX{} Template for Books}
\subtitle{Classic Elegant\LaTeX{} Template} \subtitle{Classic Elegant\LaTeX{} Template}
\author{Ethan Deng \& Liam Huang} \author{Ethan Deng, Liam Huang, syvshc, sikouhjw \& Osbert Wang}
\institute{Elegant\LaTeX{} Program} \institute{Elegant\LaTeX{} Program}
\date{Aug 15, 2022} \date{Feb. 27, 2026}
\version{4.4} \version{4.6}
\bioinfo{Bio}{Information} \bioinfo{Bio}{Information}
\extrainfo{Victory won\rq t come to us unless we go to it. } \extrainfo{\textcolor{red}{\bfseries Caution: This template will no longer be maintained since January 1st, 2023. However, due to its large user base, maintenance has resumed and the template has been re-released as of 2026.}}
\logo{logo-blue.png} \logo{logo-blue.png}
\cover{cover.jpg} \cover{cover.jpg}
@@ -59,10 +59,13 @@ tlmgr update --all
To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?}
\section{Other Release Versions} \section{Other Release Versions}
If you are a \TeX{} Live 2018/2019/2020/2021 user and would like to update, the official solution is to uninstall the previous version. If you want to save the bother of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of \TeX{} Live 2022 (default: \lstinline|C:\texlive\2022\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd.
If you are using a \TeX{} Live version prior to 2025 and wish to update the template, the official solution is to uninstall the previous version.
If you want to save the trouble of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of your \TeX{} Live (default for \TeX{} Live 2025: \lstinline|C:\texlive\2025\texmf-dist\tex\latex\elegantbook|; replace "2025" with your actual version), and then run \lstinline{texhash} in the command prompt.
\chapter{ElegantBook Settings} \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 environments are Win10/Ubuntu 20.04/macOS + \TeX{} Live 2022/ Mac\TeX{} 2022, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine for \lstinline{lang=en}.
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 environments are Windows 10/11, Ubuntu 24.04 LTS, and macOS with \TeX{} Live 2025/ Mac\TeX{} 2025. Both \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine for \lstinline{lang=en}.
\section{Languages} \section{Languages}
We defined one option named \lstinline{lang} which has two basic values, \lstinline{lang=en} (default) , \lstinline{lang=cn}. Different values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as We defined one option named \lstinline{lang} which has two basic values, \lstinline{lang=en} (default) , \lstinline{lang=cn}. Different values will alter the captions of figure/table, abstract name, refname, etc. You can use this option as
@@ -643,7 +646,7 @@ and expand the ones already used\index{keywords!used}.
$R^2$ & 0.220 & 0.293 \\ $R^2$ & 0.220 & 0.293 \\
\bottomrule \bottomrule
\multicolumn{3}{l}{\scriptsize Standard errors in parentheses} \\ \multicolumn{3}{l}{\scriptsize Standard errors in parentheses} \\
\multicolumn{3}{l}{\scriptsize *** p<0.01, ** p<0.05, * p<0.1} \\ \multicolumn{3}{l}{\scriptsize *** $p < 0.01$, ** $p<0.05$, * $p<0.1$} \\
\end{tabular}% \end{tabular}%
\end{table}% \end{table}%
@@ -675,9 +678,9 @@ We list some FAQs for users to refer to:
\item \question{I want to customize font and background color.} \item \question{I want to customize font and background color.}
Please use \lstinline{pagecolor} to change background color, refer to \href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{this} to customize font. Please use \lstinline{pagecolor} to change background color, refer to \href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{this} to customize font.
\item \question{Which version should I choose?} \item \question{Which version should I choose?}
Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2022. Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2025.
\item \question{Which editor should I choose?} \item \question{Which editor should I choose?}
You can use \TeX{} Live 2022 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2022 + \TeX{}studio is strongly recommended. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}. You can use \TeX{} Live 2025 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2025 + \TeX{}studio is strongly recommended. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}.
\item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.} \item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.}
Feel free to use our templates by pointing out our copyright. For other issues, please refer to LPPL-1.3c. If you want to show us your work, you can share the URL with us afterwards. Feel free to use our templates by pointing out our copyright. For other issues, please refer to LPPL-1.3c. If you want to show us your work, you can share the URL with us afterwards.
\item \question{What is cross reference?} \item \question{What is cross reference?}
@@ -691,6 +694,21 @@ We list some FAQs for users to refer to:
\chapter{Version History} \chapter{Version History}
We revised our templates now and then. This section shows the version story of ElegantBook. We revised our templates now and then. This section shows the version story of ElegantBook.
\datechange{2026/02/27}{release of v4.6} \textcolor{blue}{\bfseries Maintenance Resumed}
\begin{change}
\item Maintenance resumed under new maintainer Osbert Wang.
\item Template re-released due to large user base.
\item Updated to support \TeX{} Live 2025 and current operating systems (Windows 11, Ubuntu 24.04 LTS, macOS).
\end{change}
\datechange{2022/12/31}{release of v4.5.} \textcolor{red}{\bfseries Stop Maintenance}
\begin{change}
\item Add new document option \lstinline|usesamecnt| for same thm counter for all theme environments;
\item Add 5-th optional parameter for \lstinline|elegantnewtheorem|.
\end{change}
\datechange{2022/08/15}{release of v4.4.} \datechange{2022/08/15}{release of v4.4.}

View File

@@ -1,22 +1,19 @@
%%%%%%%%%%%%%%%%%%%%%% % -----------------------------------------------------------------------------
%% start of file `elegantbook.cls'. % Start of file `elegantbook.cls'.
%% Copyright 2013-2022 ElegantLaTeX (elegantlatex2e@gmail.com) % Copyright 2013-2022 ElegantLaTeX (elegantlatex2e@gmail.com)
%% % Copyright 2026- ElegantLaTeX (maintained by ranwang.osbert@outlook.com)
%% This work may be distributed and/or modified freely % This work may be distributed and/or modified under the conditions of the LaTeX Project Public License,
%% available at https://github.com/ElegantLaTeX/ElegantBook % either version 1.3c of this license or (at your option) any later version.
% % It is available at https://github.com/ElegantLaTeX/ElegantBook
%%%%%%%%%%%%%%%%%%%%% % -----------------------------------------------------------------------------
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2022/04/09 v4.3 ElegantBook document class] \ProvidesClass{elegantbook}[2026/2/27 v4.6 ElegantBook document class]
%%% %%%
\RequirePackage{kvoptions} \RequirePackage{kvoptions}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys} \SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys}
\newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}} \newcommand{\ekv}[1]{\kvsetkeys{ELEGANT}{#1}}
% ----- Colors ----- % ----- Colors -----
\DeclareStringOption[blue]{color} \DeclareStringOption[blue]{color}
\DeclareStringOption[en]{lang} \DeclareStringOption[en]{lang}
@@ -56,6 +53,7 @@
\DeclareVoidOption{fancy}{\ekv{mode=fancy}} \DeclareVoidOption{fancy}{\ekv{mode=fancy}}
\DeclareVoidOption{simple}{\ekv{mode=simple}} \DeclareVoidOption{simple}{\ekv{mode=simple}}
\DeclareBoolOption[false]{usesamecnt}
\DeclareVoidOption{answer}{\ekv{result=answer}} \DeclareVoidOption{answer}{\ekv{result=answer}}
\DeclareVoidOption{noanswer}{\ekv{result=noanswer}} \DeclareVoidOption{noanswer}{\ekv{result=noanswer}}
@@ -895,6 +893,19 @@
\RequirePackage[many]{tcolorbox} \RequirePackage[many]{tcolorbox}
% \newlength{\normalparindent} % \newlength{\normalparindent}
% \setlength{\normalparindent}{\parindent} % \setlength{\normalparindent}{\parindent}
\newcommand{\ELEGANT@tmp@tl}{}
\ifELEGANT@usesamecnt
\newcounter{ELEGANT@samecnt}
\counterwithin{ELEGANT@samecnt}{\ELEGANT@thmcnt}
\tcbset{
new/usesamecnt/.style = {use counter = ELEGANT@samecnt}
}
\else
\tcbset{
new/usesamecnt/.style = {}
}
\fi
\ifdefstring{\ELEGANT@mode}{fancy}{ \ifdefstring{\ELEGANT@mode}{fancy}{
\tcbset{ \tcbset{
common/.style={ common/.style={
@@ -944,9 +955,16 @@
\textcolor{third}{$\spadesuit$}};}}, \textcolor{third}{$\spadesuit$}};}},
ELEGANT@title/.code n args={2} ELEGANT@title/.code n args={2}
{ {
\ifblank{#2}
{\tcbset{title={\csname #1name\endcsname~\thetcbcounter}}} \tcbset
{\tcbset{title={\csname #1name\endcsname~\thetcbcounter\ (#2)}}} {
title=
{
\csname #1name\endcsname~%
\ifdef{\thetcbcounter}{\thetcbcounter}{}%
\ifblank{#2}{}{\ (#2)}
}
}
}, },
ELEGANT@label/.code n args={2} ELEGANT@label/.code n args={2}
{ {
@@ -962,14 +980,23 @@
% will define two environments: numbered ``theorem'' and no-numbered ``theorem*'' % will define two environments: numbered ``theorem'' and no-numbered ``theorem*''
% WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition, % WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition,
% WARNING FOR MULTILINGUAL: it should be defined in language settings. % WARNING FOR MULTILINGUAL: it should be defined in language settings.
\newcommand{\ELEGANT@newtheorem}[3]{ \NewDocumentCommand \ELEGANT@newtheorem { m m m O{} }{
\ifcsundef{#1name}{% \ifcsundef{#1name}{%
\ClassError{elegantbook}{% \ClassError{elegantbook}{%
\ #1name undefined, \MessageBreak \ #1name undefined, \MessageBreak
Please check in language setting Please check in language setting
}{} }{}
}{\relax} }{\relax}
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{#1}{ g o t\label g }{ \expandafter\ifblank\expandafter{#4}{
\tcbset{
new/usecnt/.style={}
}
}{
\tcbset{
new/usecnt/.style= {use counter from = #4}
}
}
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt,usesamecnt,usecnt]{#1}{ g o t\label g }{
common,#3, common,#3,
IfValueTF={##1} IfValueTF={##1}
{ELEGANT@title={#1}{##1}} {ELEGANT@title={#1}{##1}}
@@ -998,8 +1025,8 @@
} }
% define several environment % define several environment
% we define headers like \definitionname before % we define headers like \definitionname before
\ELEGANT@newtheorem{definition}{def}{defstyle}
\ELEGANT@newtheorem{theorem}{thm}{thmstyle} \ELEGANT@newtheorem{theorem}{thm}{thmstyle}
\ELEGANT@newtheorem{definition}{def}{defstyle}
\ELEGANT@newtheorem{postulate}{pos}{thmstyle} \ELEGANT@newtheorem{postulate}{pos}{thmstyle}
\ELEGANT@newtheorem{axiom}{axi}{thmstyle} \ELEGANT@newtheorem{axiom}{axi}{thmstyle}
\ELEGANT@newtheorem{corollary}{cor}{thmstyle} \ELEGANT@newtheorem{corollary}{cor}{thmstyle}
@@ -1030,16 +1057,24 @@
% will define two environments: numbered ``theorem'' and no-numbered ``theorem*'' % will define two environments: numbered ``theorem'' and no-numbered ``theorem*''
% WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition, % WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition,
% WARNING FOR MULTILINGUAL: it should be defined in language settings. % WARNING FOR MULTILINGUAL: it should be defined in language settings.
\newcommand{\ELEGANT@newtheorem}[2]{ \NewDocumentCommand \ELEGANT@newtheorem { m m O{} } {
\theoremstyle{#2} \theoremstyle{#2}
\newtheorem{#1}{\csname #1name\endcsname}[\ELEGANT@thmcnt] \ifELEGANT@usesamecnt
\newtheorem{#1}[ELEGANT@samecnt]{\csname #1name\endcsname}
\else
\ifblank{#3}{
\newtheorem{#1}{\csname #1name\endcsname}[\ELEGANT@thmcnt]
}{
\newtheorem{#1}[#3]{\csname #1name\endcsname}
}
\fi
\newtheorem*{#1*}{\csname #1name\endcsname} \newtheorem*{#1*}{\csname #1name\endcsname}
} }
% define several environment % define several environment
% we define headers like \definitionname before % we define headers like \definitionname before
\ELEGANT@newtheorem{definition}{defstyle}
\ELEGANT@newtheorem{theorem}{thmstyle} \ELEGANT@newtheorem{theorem}{thmstyle}
\ELEGANT@newtheorem{definition}{defstyle}
\ELEGANT@newtheorem{postulate}{thmstyle} \ELEGANT@newtheorem{postulate}{thmstyle}
\ELEGANT@newtheorem{axiom}{thmstyle} \ELEGANT@newtheorem{axiom}{thmstyle}
\ELEGANT@newtheorem{corollary}{thmstyle} \ELEGANT@newtheorem{corollary}{thmstyle}
@@ -1056,12 +1091,19 @@
% and a warning will be raised % and a warning will be raised
\newcommand{\ELEGANT@newtheorem@warning}{} \newcommand{\ELEGANT@newtheorem@warning}{}
\newcommand{\ELEGANT@newtheorem@error}{} \newcommand{\ELEGANT@newtheorem@error}{}
\NewDocumentCommand\elegantnewtheorem{ m m m g } \newcommand{\ELEGANT@usesamecnt@warning}{}
\NewDocumentCommand\elegantnewtheorem{ m m m g O{} }
{ {
\renewcommand{\ELEGANT@usesamecnt@warning}{
\ClassWarning{elegantbook}{%
[#5] won't make sence with option \MessageBreak
`usesamecnt'.
}
}
\renewcommand{\ELEGANT@newtheorem@warning}{ \renewcommand{\ELEGANT@newtheorem@warning}{
\ClassWarning{elegantbook}{% \ClassWarning{elegantbook}{%
Because you didn't provide a prefix. \MessageBreak Because you didn't provide a prefix, \MessageBreak
We use #1 as the default prefix. \MessageBreak we use #1 as the default prefix. \MessageBreak
You have to use \MessageBreak You have to use \MessageBreak
\ref{#1:label} to refer a \MessageBreak \ref{#1:label} to refer a \MessageBreak
\begin{#1}{name}{label} environment. \MessageBreak \begin{#1}{name}{label} environment. \MessageBreak
@@ -1078,11 +1120,16 @@
The 4th parameter ``prefix'' isn't allowed. The 4th parameter ``prefix'' isn't allowed.
} }
} }
\ifELEGANT@usesamecnt
\ifblank{#5}{}{\ELEGANT@usesamecnt@warning}
\else
\renewcommand{\ELEGANT@tmp@tl}{#5}
\fi
\expandafter\def\csname #1name\endcsname{#2} \expandafter\def\csname #1name\endcsname{#2}
\ifdefstring{\ELEGANT@mode}{simple}{% \ifdefstring{\ELEGANT@mode}{simple}{%
\IfValueTF{#4} \IfValueTF{#4}
{\ELEGANT@newtheorem@error} {\ELEGANT@newtheorem@error}
{\ELEGANT@newtheorem{#1}{#3}} {\ELEGANT@newtheorem{#1}{#3}[\ELEGANT@tmp@tl]}
}{\relax} }{\relax}
\ifdefstring{\ELEGANT@mode}{fancy}{% \ifdefstring{\ELEGANT@mode}{fancy}{%
\IfValueTF{#4} \IfValueTF{#4}
@@ -1090,13 +1137,13 @@
\def\ELEGANT@temp@prefix{#4} \def\ELEGANT@temp@prefix{#4}
\ifdefempty{\ELEGANT@temp@prefix} \ifdefempty{\ELEGANT@temp@prefix}
{ {
\ELEGANT@newtheorem{#1}{#1}{#3} \ELEGANT@newtheorem{#1}{#1}{#3}[\ELEGANT@tmp@tl]
\ELEGANT@newtheorem@warning \ELEGANT@newtheorem@warning
} }
{\ELEGANT@newtheorem{#1}{#4}{#3}} {\ELEGANT@newtheorem{#1}{#4}{#3}[\ELEGANT@tmp@tl]}
} }
{ {
\ELEGANT@newtheorem{#1}{#1}{#3} \ELEGANT@newtheorem{#1}{#1}{#3}[\ELEGANT@tmp@tl]
\ELEGANT@newtheorem@warning \ELEGANT@newtheorem@warning
} }
}{\relax} }{\relax}
@@ -1321,9 +1368,9 @@
breaklines=true, breaklines=true,
keywordstyle=\color{winered}, keywordstyle=\color{winered},
commentstyle=\color{gray}, commentstyle=\color{gray},
emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,figure,fig,image,img,table,itemize,enumerate,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament}, emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,figure,fig,image,img,table,itemize,enumerate,ctex,microtype,description,times,booktabs,tabular,PDFLaTeX,XeLaTeX,type1cm,BibTeX,device,color,mode,lang,amsthm,tcolorbox,titlestyle,cite,ctex,listings,base,math,scheme,toc,esint,chinesefont,amsmath,bibstyle,natbib,pgfornament,addbibresource,printbibliography},
emphstyle={\color{frenchplum}}, emphstyle={\color{frenchplum}},
morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,section,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf,elegantnewtheorem,thmcnt,colorlet}, morekeywords={DeclareSymbolFont,SetSymbolFont,toprule,midrule,bottomrule,institute,version,includegraphics,setmainfont,setsansfont,setmonofont ,setCJKmainfont,setCJKsansfont,setCJKmonofont,RequirePackage,figref,tabref,email,maketitle,keywords,definecolor,extrainfo,logo,cover,subtitle,appendix,chapter,section,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf,elegantnewtheorem,thmcnt,colorlet,usesamecnt},
frame=single, frame=single,
tabsize=2, tabsize=2,
rulecolor=\color{structurecolor}, rulecolor=\color{structurecolor},
@@ -1387,7 +1434,7 @@
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else \renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}% \hbox{}%
\thispagestyle{empty}% \thispagestyle{empty}%
beforechap\newpage% \newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi} \if@twocolumn\hbox{}\newpage\fi\fi\fi}
@@ -1397,7 +1444,10 @@ beforechap\newpage%
\ifdefstring{\ELEGANT@lang}{cn}{ \ifdefstring{\ELEGANT@lang}{cn}{
% \renewcommand{\cftchappresnum}{\beforechap\space} % \renewcommand{\cftchappresnum}{\beforechap\space}
% \renewcommand{\cftchapaftersnum}{\space\afterchap} % \renewcommand{\cftchapaftersnum}{\space\afterchap}
\setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}} % \setlength{\cftchapnumwidth}{\widthof{\textbf{附录~十一}}}
\renewcommand{\numberline}[1]{%
\@cftbsnum #1\@cftasnum~\@cftasnumb ~%
}
\g@addto@macro\appendix{% \g@addto@macro\appendix{%
% recover \thechapter in the \NR@chapter's \numberline % recover \thechapter in the \NR@chapter's \numberline
\ifELEGANT@Hy@later \ifELEGANT@Hy@later

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB