mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-03-28 10:14:37 +08:00
Compare commits
49 Commits
v4.3
...
aca39291e8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aca39291e8 | ||
|
|
e6b9a3b7a7 | ||
|
|
6ab78eb6ed | ||
|
|
edef9fbc58 | ||
|
|
c536351538 | ||
|
|
e8777c67dd | ||
|
|
297025913d | ||
|
|
24896705bf | ||
|
|
083a52026c | ||
|
|
81bc14a063 | ||
|
|
f9f002a586 | ||
|
|
56f3042066 | ||
|
|
4611cd6d7b | ||
|
|
ea643e3783 | ||
|
|
ba69287a64 | ||
|
|
5d8a544e0e | ||
|
|
9b8b09df54 | ||
|
|
99eb12f4c4 | ||
|
|
cf516c7f2e | ||
|
|
ecf5bf6309 | ||
|
|
a495c98ca4 | ||
|
|
e4c102f011 | ||
|
|
aeefa43d01 | ||
|
|
81bf10a58b | ||
|
|
94152955a2 | ||
|
|
d7febb69f7 | ||
|
|
85176416ad | ||
|
|
4c9ca031d8 | ||
|
|
4cc89482f8 | ||
|
|
f91390ddfc | ||
|
|
35f058868e | ||
|
|
4949004371 | ||
|
|
ccb5464463 | ||
|
|
b1585deeb9 | ||
|
|
48f19691fc | ||
|
|
5b410a1cff | ||
|
|
3f7c85e5c7 | ||
|
|
5c0f54819a | ||
|
|
81a25970e8 | ||
|
|
63d0dda991 | ||
|
|
921777db03 | ||
|
|
3c6c0f163c | ||
|
|
b3108df9c2 | ||
|
|
083483f7b5 | ||
|
|
b1f7d7b30d | ||
|
|
db7fd517dd | ||
|
|
6f2173674f | ||
|
|
d11253214e | ||
|
|
943493a29c |
9
.gitattributes
vendored
Normal file
9
.gitattributes
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
* 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
|
||||||
|
build.lua text eol=lf
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,6 +44,9 @@ elegant*-en.pdf
|
|||||||
*.synctex.gz
|
*.synctex.gz
|
||||||
*.synctex.gz(busy)
|
*.synctex.gz(busy)
|
||||||
*.pdfsync
|
*.pdfsync
|
||||||
|
/build
|
||||||
|
*.curlopt
|
||||||
|
*.zip
|
||||||
|
|
||||||
## Auxiliary and intermediate files from other packages:
|
## Auxiliary and intermediate files from other packages:
|
||||||
# algorithms
|
# algorithms
|
||||||
|
|||||||
33
README-CN.md
33
README-CN.md
@@ -1,33 +0,0 @@
|
|||||||
<!-- Author : Dongsheng Deng & Liam Huang-->
|
|
||||||
<!-- Program Email: elegantlatex2e@gmail.com -->
|
|
||||||
|
|
||||||
[Homepage](https://elegantlatex.org/) | [Github](https://github.com/ElegantLaTeX/ElegantBook) | [CTAN](https://ctan.org/pkg/elegantbook) | [Download](https://github.com/ElegantLaTeX/ElegantBook/releases) | [Wiki](https://github.com/ElegantLaTeX/ElegantBook/wiki) | [Weibo](https://weibo.com/elegantlatex)
|
|
||||||
|
|
||||||
   
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# ElegantBook 优美的 LaTeX 书籍模板
|
|
||||||
|
|
||||||
ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Dongsheng Deng](https://ddswhu.me/) 和 [Liam Huang](https://liam.page/) 创立,模板创立的初衷是方便我们自己做笔记 :smile:。如果你有其他问题、建议或者报告 bug,可以提交 issues 或者给我们发邮件:elegantlatex2e@gmail.com。QQ 用户交流群:692108391,欢迎加入。
|
|
||||||
|
|
||||||
## 重要提示
|
|
||||||
|
|
||||||
**重要提示**:ElegantLaTeX 项目 **不接受** 任何非预授权的提交(pull requests)!
|
|
||||||
|
|
||||||
## 致谢
|
|
||||||
|
|
||||||
特别感谢 [sikouhjw](https://github.com/sikouhjw) 和 [syvshc](https://github.com/syvshc) 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 ElegantLaTeX 相关问题的回复。
|
|
||||||
特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。
|
|
||||||
|
|
||||||
如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。
|
|
||||||
|
|
||||||
## 协议
|
|
||||||
|
|
||||||
本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。如果是衍生作品,请务必加入协议声明和模板信息(github、CTAN 地址)。
|
|
||||||
|
|
||||||
## 衍生作
|
|
||||||
|
|
||||||
+ [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown):[XiangyunHuang](https://github.com/XiangyunHuang) 开发并维护的基于 ElegantBook 的 Bookdown 模板。
|
|
||||||
+ [bookdownplus](https://github.com/pzhaonet/bookdownplus):应网友要求,[pzhaonet](https://github.com/pzhaonet) 在 bookdownplus 收录了 ElegantPaper 模板,并为 Mac 做了字体适配。
|
|
||||||
+ [PanBook](https://github.com/annProg/PanBook):[annProg](https://github.com/annProg) 开发并维护的基于 Markdown 写作的工作流,收录了 ElegantBook 和 ElegantPaper 模板。
|
|
||||||
35
README.md
35
README.md
@@ -1,34 +1,37 @@
|
|||||||
<!-- 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) | [Wiki](https://github.com/ElegantLaTeX/ElegantBook/wiki) | [Weibo](https://weibo.com/elegantlatex)
|
[Github](https://github.com/ElegantLaTeX/ElegantBook) | [CTAN](https://ctan.org/pkg/elegantbook) | [Download](https://github.com/ElegantLaTeX/ElegantBook/releases) |
|
||||||
|
|
||||||
   
|
   
|
||||||
|
|
||||||
-------
|
-------
|
||||||
|
|
||||||
# ElegantBook: An Elegant LaTeX Template for Books
|
# ElegantBook: 优美的 LaTeX 书籍模板 An Elegant LaTeX Template for Books
|
||||||
|
|
||||||
ElegantBook is designed for writing books, created by [Dongsheng Deng](https://ddswhu.me/) and [Liam Huang](https://liam.page/). Just enjoy it! If you have any questions, suggestions or bug reports, you can create issues or contact us at elegantlatex2e@gmail.com.
|
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。
|
||||||
|
|
||||||
## Important Notes
|
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.
|
||||||
|
|
||||||
For some reasons, __unauthorized__ pull requests are **UNACCEPTABLE** since May 20, 2019. For those who want to help revise the templates, submit issues or clone to your own repository to modify under the LPPL-1.3c.
|
**本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。**
|
||||||
|
|
||||||
## Acknowledgement
|
**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.**
|
||||||
|
|
||||||
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.
|
## 致谢 Acknowledgement
|
||||||
|
|
||||||
Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion.
|
特别感谢 [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.
|
||||||
|
|
||||||
## License
|
## 协议 License
|
||||||
|
|
||||||
|
本模板发布遵循 LaTeX 项目公共许可证 1.3 c 或更高版本。
|
||||||
|
如果是衍生作品,请务必加入协议声明和模板信息(github、CTAN 地址)。
|
||||||
|
|
||||||
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 模板。
|
||||||
|
+ [bookdownplus](https://github.com/pzhaonet/bookdownplus):应网友要求,[pzhaonet](https://github.com/pzhaonet) 在 bookdownplus 收录了 ElegantPaper 模板,并为 Mac 做了字体适配。
|
||||||
+ [ElegantBookdown](https://github.com/XiangyunHuang/ElegantBookdown):[XiangyunHuang](https://github.com/XiangyunHuang) developed a Bookdown template based on ElegantBook.
|
+ [PanBook](https://github.com/annProg/PanBook):[annProg](https://github.com/annProg) 开发并维护的基于 Markdown 写作的工作流,收录了 ElegantBook 和 ElegantPaper 模板。
|
||||||
+ [bookdownplus](https://github.com/pzhaonet/bookdownplus): maintained by [pzhaonet](https://github.com/pzhaonet).
|
|
||||||
+ [PanBook](https://github.com/annProg/PanBook):a markdown-based writing workflow Developed by [annProg](https://github.com/annProg).
|
|
||||||
|
|||||||
102
build.lua
Normal file
102
build.lua
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
--[==========================================[--
|
||||||
|
L3BUILD FILE FOR ELEGANTBOOK
|
||||||
|
Check PDF File & Directory After Build
|
||||||
|
--]==========================================]--
|
||||||
|
|
||||||
|
--[==========================================[--
|
||||||
|
Basic Information
|
||||||
|
Do Check Before Upload
|
||||||
|
--]==========================================]--
|
||||||
|
module = "elegantbook"
|
||||||
|
version = "2.60"
|
||||||
|
maintainer = "Ran Wang"
|
||||||
|
uploader = maintainer
|
||||||
|
maintainid = "ElegantLaTeX"
|
||||||
|
email = "ranwang.osbert@outlook.com"
|
||||||
|
repository = "https://github.com/" .. maintainid .. "/" .. module
|
||||||
|
announcement = ""
|
||||||
|
note = ""
|
||||||
|
summary = "Elegant LaTeX Template for Books"
|
||||||
|
description = [[ElegantBook is designed for writing Books. This template is based on the standard LaTeX book class. The goal of this template is to make the writing process more elegant.]]
|
||||||
|
|
||||||
|
--[==========================================[--
|
||||||
|
Build, Pack and Upload To CTAN
|
||||||
|
Do not Modify Unless Necessary
|
||||||
|
--]==========================================]--
|
||||||
|
ctanzip = module
|
||||||
|
excludefiles = {"*~"}
|
||||||
|
textfiles = {"*.md", "LICENSE", "*.lua", "*.cls", "*.bib"}
|
||||||
|
typesetexe = "latexmk -pdf"
|
||||||
|
typesetfiles = {module .. "-cn.tex", module .. "-en.tex"}
|
||||||
|
typesetopts = "-interaction=nonstopmode"
|
||||||
|
typesetruns = 1
|
||||||
|
typesetsuppfiles = {"*.cls", "*.bib"}
|
||||||
|
imagesuppdir = "image"
|
||||||
|
figuresuppdir = "figure"
|
||||||
|
specialtypesetting = specialtypesetting or {}
|
||||||
|
specialtypesetting[module .. "-cn.tex"] = {cmd = "latexmk -pdfxe"}
|
||||||
|
|
||||||
|
uploadconfig = {
|
||||||
|
pkg = module,
|
||||||
|
version = version,
|
||||||
|
author = maintainer,
|
||||||
|
uploader = uploader,
|
||||||
|
email = email,
|
||||||
|
summary = summary,
|
||||||
|
description = description,
|
||||||
|
announcement = announcement,
|
||||||
|
note = note,
|
||||||
|
license = "lppl1.3c",
|
||||||
|
ctanPath = "/macros/latex/contrib/" .. module .. "/",
|
||||||
|
home = repository,
|
||||||
|
support = repository .. "/issues",
|
||||||
|
bugtracker = repository .. "/issues",
|
||||||
|
repository = repository,
|
||||||
|
development = "https://github.com/" .. maintainid,
|
||||||
|
update = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function tex(file, dir, cmd)
|
||||||
|
dir = dir or "."
|
||||||
|
cmd = cmd or typesetexe .. " " .. typesetopts
|
||||||
|
return run(dir, cmd .. " " .. file)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Copy required files into the typeset build dir
|
||||||
|
function docinit_hook()
|
||||||
|
-- Copy .cls, .bib support files
|
||||||
|
for _, glob in pairs(typesetsuppfiles) do
|
||||||
|
cp(glob, currentdir, typesetdir)
|
||||||
|
end
|
||||||
|
-- Copy image subdirectory
|
||||||
|
for _, subdir in pairs({imagesuppdir, figuresuppdir}) do
|
||||||
|
local dest = typesetdir .. "/" .. subdir
|
||||||
|
mkdir(dest)
|
||||||
|
cp("*", subdir, dest)
|
||||||
|
end
|
||||||
|
-- Copy tex source files
|
||||||
|
for _, texfile in pairs(typesetfiles) do
|
||||||
|
cp(texfile, currentdir, typesetdir)
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Pack CTAN directory: cls, bib, tex sources, PDFs, and asset subdirs
|
||||||
|
function copyctan()
|
||||||
|
local pkgdir = ctandir .. "/" .. ctanpkg
|
||||||
|
mkdir(pkgdir)
|
||||||
|
for _, glob in pairs(typesetsuppfiles) do
|
||||||
|
cp(glob, currentdir, pkgdir)
|
||||||
|
end
|
||||||
|
for _, texfile in pairs(typesetfiles) do
|
||||||
|
cp(texfile, currentdir, pkgdir)
|
||||||
|
end
|
||||||
|
for _, glob in pairs(pdffiles or {"*.pdf"}) do
|
||||||
|
cp(glob, typesetdir, pkgdir)
|
||||||
|
end
|
||||||
|
for _, subdir in pairs({imagesuppdir, figuresuppdir}) do
|
||||||
|
local dest = pkgdir .. "/" .. subdir
|
||||||
|
mkdir(dest)
|
||||||
|
cp("*", subdir, dest)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
\documentclass[lang=cn,10pt]{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{April 9, 2022}
|
\date{2026/2/27}
|
||||||
\version{4.3}
|
\version{4.6}
|
||||||
\bioinfo{自定义}{信息}
|
\bioinfo{自定义}{信息}
|
||||||
|
|
||||||
\extrainfo{不要以为抹消过去,重新来过,即可发生什么改变。—— 比企谷八幡}
|
\extrainfo{\textcolor{red}{\bfseries 注意:本模板自2023年1月1日起停止维护。然而,鉴于用户群体庞大,自2026年起恢复维护并重新发布。}}
|
||||||
|
|
||||||
\setcounter{tocdepth}{3}
|
\setcounter{tocdepth}{3}
|
||||||
|
|
||||||
@@ -21,8 +21,11 @@
|
|||||||
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
|
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
|
||||||
|
|
||||||
% 修改标题页的橙色带
|
% 修改标题页的橙色带
|
||||||
% \definecolor{customcolor}{RGB}{32,178,170}
|
\definecolor{customcolor}{RGB}{32,178,170}
|
||||||
% \colorlet{coverlinecolor}{customcolor}
|
\colorlet{coverlinecolor}{customcolor}
|
||||||
|
\usepackage{cprotect}
|
||||||
|
|
||||||
|
\addbibresource[location=local]{reference.bib} % 参考文献,不要删除
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
@@ -33,30 +36,32 @@
|
|||||||
|
|
||||||
\mainmatter
|
\mainmatter
|
||||||
|
|
||||||
\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} 组成,分别用于排版笔记,书籍和工作论文。强烈推荐使用最新正式版本!本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。
|
\begin{quotation}
|
||||||
|
\textbf{\textcolor{red}{本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}}
|
||||||
|
\end{quotation}
|
||||||
|
|
||||||
我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 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} 组成,分别用于排版笔记,书籍和工作论文。大版本改动较大,请关注版本信息,在未开始使用模板前,建议直接选择最新正式版本!
|
||||||
|
|
||||||
|
|
||||||
|
本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 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 Gitee 地址:\href{https://gitee.com/ElegantLaTeX}{https://gitee.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 Bilibili:\href{https://space.bilibili.com/516479629}{ElegantLaTeX}
|
||||||
\item 微信公众号:Elegant\LaTeX{}(不定期更新)
|
\item 用户 QQ 群:692108391
|
||||||
\item 用户 QQ 群:692108391(建议加群)
|
|
||||||
\item 邮件:\email{elegantlatex2e@gmail.com}
|
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
|
|
||||||
\section{模板安装与更新}
|
\section{模板安装与更新}
|
||||||
|
|
||||||
你可以通过免安装的方式使用本模板,包括在线使用和本地(文件夹内)使用两种方式,也可以通过 \TeX{} 发行版安装使用。
|
你可以通过免安装的方式使用本模板,包括在线使用和本地(文件夹内)使用两种方式,也可以通过 \TeX\ 发行版安装使用。
|
||||||
|
|
||||||
\subsection{在线使用模板}
|
\subsection{在线使用模板}
|
||||||
|
|
||||||
我们把三套模板全部上传到 \href{https://www.overleaf.com/}{Overleaf} 上了,网络便利的用户可以直接通过 Overleaf 在线使用我们的模板。使用 Overleaf 的好处是无需安装 \TeX{} Live,可以随时随地访问自己的文件。查找模板,请在 Overleaf 模板库里面搜索 \lstinline{elegantlatex} 即可,你也可以直接访问\href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{搜索结果}。选择适当的模板之后,将其 \lstinline{Open as Template},即可把模板存到自己账户下,然后可以自由编辑以及与别人一起协作。更多关于 Overleaf 的介绍和使用,请参考 Overleaf 的\href{https://www.overleaf.com/learn}{官方文档}。
|
我们把三套模板全部上传到 \href{https://www.overleaf.com/}{Overleaf} 上了,网络便利的用户可以直接通过 Overleaf 在线使用我们的模板。使用 Overleaf 的好处是无需安装 \TeX~Live,可以随时随地访问自己的文件。查找模板,请在 Overleaf 模板库里面搜索 \lstinline{elegantlatex} 即可,你也可以直接访问\href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{搜索结果}。选择适当的模板之后,将其 \lstinline{Open as Template},即可把模板存到自己账户下,然后可以自由编辑以及与别人一起协作。更多关于 Overleaf 的介绍和使用,请参考 Overleaf 的\href{https://www.overleaf.com/learn}{官方文档}。
|
||||||
|
|
||||||
\subsection{本地免安装使用}
|
\subsection{本地免安装使用}
|
||||||
|
|
||||||
@@ -66,14 +71,14 @@ 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\ 安装的介绍}。
|
||||||
|
|
||||||
安装 \TeX{} Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即
|
安装 \TeX~Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
tlmgr update --self
|
tlmgr update --self
|
||||||
@@ -81,21 +86,17 @@ tlmgr update --all
|
|||||||
tlmgr update --self --all --reinstall-forcibly-removed
|
tlmgr update --self --all --reinstall-forcibly-removed
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
更多的内容请参考 \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?}
|
更多的内容请参考 \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX\ distribution?}
|
||||||
|
|
||||||
\subsection{其他发行版本}
|
\subsection{其他发行版本}
|
||||||
|
|
||||||
由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{} 与 \TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}。
|
由于宏包版本问题,本模板不支持 \CTeX\ 套装,请务必安装 \TeX~Live/Mac\TeX。更多关于 \TeX~Live 的安装使用以及 \CTeX\ 与 \TeX~Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX\ 安装的介绍}。
|
||||||
|
|
||||||
|
|
||||||
\section{关于提交}
|
|
||||||
|
|
||||||
出于某些因素的考虑,Elegant\LaTeX{} 项目自 2019 年 5 月 20 日开始,\textbf{不再接受任何非作者预约性质的提交}(pull request)!如果你想改进模板,你可以给我们提交 issues,或者可以在遵循协议(LPPL-1.3c)的情况下,克隆到自己仓库下进行修改。
|
|
||||||
|
|
||||||
|
|
||||||
\chapter{ElegantBook 设置说明}
|
\chapter{ElegantBook 设置说明}
|
||||||
|
|
||||||
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX{} Live 编译。
|
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX~Live 编译。
|
||||||
|
|
||||||
\section{语言模式}
|
\section{语言模式}
|
||||||
本模板内含两套基础语言环境 \lstinline{lang=cn}、\lstinline{lang=en}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
|
本模板内含两套基础语言环境 \lstinline{lang=cn}、\lstinline{lang=en}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
|
||||||
@@ -180,7 +181,7 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 structurecolor、main、second、third 颜色,具体方法如下:
|
如果需要自定义颜色的话请选择 \lstinline{nocolor} 选项或者使用 \lstinline{color=none},然后在导言区定义 structurecolor、main、second、third 颜色,具体方法如下:
|
||||||
\begin{lstlisting}[tabsize=4]]
|
\begin{lstlisting}[tabsize=4]
|
||||||
\definecolor{structurecolor}{RGB}{0,0,0}
|
\definecolor{structurecolor}{RGB}{0,0,0}
|
||||||
\definecolor{main}{RGB}{70,70,70}
|
\definecolor{main}{RGB}{70,70,70}
|
||||||
\definecolor{second}{RGB}{115,45,2}
|
\definecolor{second}{RGB}{115,45,2}
|
||||||
@@ -197,13 +198,13 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
\centering
|
\centering
|
||||||
\caption{封面元素信息}
|
\caption{封面元素信息}
|
||||||
\begin{tabular}{p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}}
|
\begin{tabular}{p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}|p{0.07\textwidth}p{0.15\textwidth}}
|
||||||
\toprule
|
\hline
|
||||||
信息 & 命令 & 信息 & 命令 & 信息 & 命令 \\
|
信息 & 命令 & 信息 & 命令 & 信息 & 命令 \\
|
||||||
\midrule
|
\hline
|
||||||
标题 & \lstinline|\title| & 副标题 & \lstinline|\subtitle| & 作者 & \lstinline|\author| \\
|
标题 & \lstinline|\title| & 副标题 & \lstinline|\subtitle| & 作者 & \lstinline|\author| \\
|
||||||
机构 & \lstinline|\institute| & 日期 & \lstinline|\date| & 版本 & \lstinline|\version| \\
|
机构 & \lstinline|\institute| & 日期 & \lstinline|\date| & 版本 & \lstinline|\version| \\
|
||||||
箴言 & \lstinline|\extrainfo| & 封面图 & \lstinline|\cover| & 徽标 & \lstinline|\logo| \\
|
箴言 & \lstinline|\extrainfo| & 封面图 & \lstinline|\cover| & 徽标 & \lstinline|\logo| \\
|
||||||
\bottomrule
|
\hline
|
||||||
\end{tabular}
|
\end{tabular}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
@@ -220,7 +221,7 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
|
|
||||||
\subsection{封面图}
|
\subsection{封面图}
|
||||||
|
|
||||||
本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX{} 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}。},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用。
|
本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX\ 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}。},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用。
|
||||||
|
|
||||||
\subsection{徽标}
|
\subsection{徽标}
|
||||||
|
|
||||||
@@ -258,59 +259,140 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
\item \textit{定理类环境},包含标题和内容两部分,全部定理类环境的编号均以章节编号。根据格式的不同分为 3 种
|
\item \textit{定理类环境},包含标题和内容两部分,全部定理类环境的编号均以章节编号。根据格式的不同分为 3 种
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \textcolor{main}{\textbf{definition}} 环境,颜色为 \textcolor{main}{main};
|
\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}。
|
\item \textcolor{third}{\textbf{proposition}} 环境,颜色为 \textcolor{third}{third}。
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\item \textit{示例类环境},有 \textbf{example、problem、exercise} 环境(对应于例、例题、练习),自动编号,编号以章节为单位,其中 \textbf{exercise} 有提示符。
|
\item \textit{示例类环境},有 \textbf{example、problem、exercise} 环境(对应于例、例题、练习),自动编号,编号以章节为单位,其中 \textbf{exercise} 有提示符。
|
||||||
\item \textit{提示类环境},有 \textbf{note} 环境,特点是:无编号,有引导符。
|
\item \textit{提示类环境},有 \textbf{note} 环境,特点是:无编号,有引导符。
|
||||||
\item \textit{结论类环境},有 \textbf{conclusion、assumption、property、remark、solution} 环境\footnote{本模板还添加了一个 result 选项,用于隐藏 \lstinline{solution} 和 \lstinline{proof} 环境,默认为显示(\lstinline{result=answer}),隐藏使用 \lstinline{result=noanswer}。},三者均以粗体的引导词为开头,和普通段落格式一致。
|
\item \textit{结论类环境},有 \textbf{conclusion、assumption、property、remark、solution} 环境\footnote{本模板还添加了一个 \lstinline|result| 选项,用于隐藏 \lstinline{solution} 和 \lstinline{proof} 环境,默认为显示(\lstinline{result=answer}),隐藏使用 \lstinline{result=noanswer}。},三者均以粗体的引导词为开头,和普通段落格式一致。
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
|
其中,定理类环境均有带星号的版本:\textcolor{main}{\textbf{definition*}}、\textcolor{second}{\textbf{theorem*}}、\textcolor{second}{\textbf{lemma*}}、\textcolor{second}{\textbf{corollary*}}、\textcolor{second}{\textbf{axiom*}}、\textcolor{second}{\textbf{postulate*}}、\textcolor{third}{\textbf{proposition*}},带星号的定理类环境不会编号。
|
||||||
|
|
||||||
\subsection{定理类环境的使用}
|
\subsection{定理类环境的使用}
|
||||||
|
|
||||||
由于本模板使用了 \lstinline{tcolorbox} 宏包来定制定理类环境,所以和普通的定理环境的使用有些许区别,定理的使用方法如下:
|
\subsubsection{\texttt{fancy} 模式}
|
||||||
|
|
||||||
|
在 \lstinline{fancy} 模式下使用了 \lstinline{tcolorbox} 宏包来定制定理类环境,所以和普通的定理环境的使用有些许区别,有编号定理的使用方法如下:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
|
% 有名字,有标签
|
||||||
\begin{theorem}{theorem name}{label}
|
\begin{theorem}{theorem name}{label}
|
||||||
The content of theorem.
|
这是一个有名字和标签的定理。
|
||||||
|
用 \ref{thm:label} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,有标签
|
||||||
|
\begin{theorem}{}{label no name}
|
||||||
|
这是一个没有名字但是有标签的定理。
|
||||||
|
用 \ref{thm:label no name} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 有名字,无标签
|
||||||
|
\begin{theorem}{theorem name}{}
|
||||||
|
这是一个有名字但是没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
最后的 {} 可以省略不写。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,无标签
|
||||||
|
\begin{theorem}{}{}
|
||||||
|
这是一个没有名字也没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
两个 {} 均可以省略不写。
|
||||||
\end{theorem}
|
\end{theorem}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
第一个必选项 \lstinline{theorem name} 是定理的名字,第二个必选项 \lstinline{label} 是交叉引用时所用到的标签,交叉引用的方法为 \verb|\ref{thm:label}|。请注意,交叉引用时必须加上前缀 \lstinline{thm:}。
|
第一个选项 \lstinline{theorem name} 是定理的名字,如果定理没有名字请使用 \lstinline|{}|\cprotect\footnote{除非这个定理也没有标签,否则不能省略。}。第二个选项 \lstinline{label} 是交叉引用时所用到的标签,如果定理没有标签,可以不写 \lstinline|{label}| 或使用 \lstinline|{}|。交叉引用的方法为 \lstinline|\ref{thm:label}|。请注意,交叉引用时必须加上前缀 \lstinline{thm:}。其他相同用法的定理类环境见表 \ref{tab:theorem-class}。
|
||||||
|
|
||||||
在用户多次反馈下,4.x 之后,引入了原生定理的支持方式,也就是使用可选项方式:
|
不编号的定理使用方法如下:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\begin{theorem}[theorem name] \label{thm:theorem-label}
|
% 有名字
|
||||||
The content of theorem.
|
\begin{theorem*}{theorem name}
|
||||||
\end{theorem}
|
这是一个不编号的有名字的定理。
|
||||||
% or
|
这个定理不能被引用。
|
||||||
\begin{theorem} \label{thm:theorem-withou-name}
|
\end{theorem*}
|
||||||
The content of theorem without name.
|
% 无名字
|
||||||
\end{theorem}
|
\begin{theorem*}{}
|
||||||
|
这是一个不编号且没有名字的定理。
|
||||||
|
最后的 {} 可以省略不写。
|
||||||
|
这个定理不能被引用。
|
||||||
|
\end{theorem*}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
其中的选项 \lstinline{theorem name} 是定理的名字,如果没有名字可以不写 \lstinline|{theorem name}| 或使用 \lstinline|{}|
|
||||||
其他相同用法的定理类环境有:
|
|
||||||
|
|
||||||
\begin{table}[htbp]
|
\begin{table}[htbp]
|
||||||
\centering
|
\centering
|
||||||
\caption{定理类环境}
|
\caption{定理类环境}
|
||||||
\begin{tabular}{llll}
|
\begin{tabular}{llll}
|
||||||
\toprule
|
\toprule
|
||||||
环境名 & 标签名 & 前缀 & 交叉引用 \\
|
环境名 & 标签名 & 前缀 & 交叉引用 \\
|
||||||
\midrule
|
\midrule
|
||||||
definition & label & def & \lstinline|\ref{def:label}| \\
|
definition & label & def & \lstinline|\ref{def:label}| \\
|
||||||
theorem & label & thm & \lstinline|\ref{thm:label}| \\
|
theorem & label & thm & \lstinline|\ref{thm:label}| \\
|
||||||
lemma & label & lem & \lstinline|\ref{lem:label}| \\
|
postulate & label & pos & \lstinline|\ref{pos:label}| \\
|
||||||
corollary & label & cor & \lstinline|\ref{cor:label}| \\
|
axiom & label & axi & \lstinline|\ref{axi:label}|\\
|
||||||
proposition & label & pro & \lstinline|\ref{pro:label}| \\
|
lemma & label & lem & \lstinline|\ref{lem:label}| \\
|
||||||
\bottomrule
|
corollary & label & cor & \lstinline|\ref{cor:label}| \\
|
||||||
\end{tabular}%
|
proposition & label & pro & \lstinline|\ref{pro:label}| \\
|
||||||
\label{tab:theorem-class}%
|
\bottomrule
|
||||||
\end{table}%
|
\end{tabular}%
|
||||||
|
\label{tab:theorem-class}%
|
||||||
|
\end{table}%
|
||||||
|
|
||||||
|
在用户多次反馈下,在 4.1 版本引入了原生定理的支持方式,使用方法如下:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
% 有名字,有标签
|
||||||
|
\begin{theorem}[theorem name]\label{thm:label}
|
||||||
|
这是一个有名字和标签的定理。
|
||||||
|
用 \ref{thm:label} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,有标签
|
||||||
|
\begin{theorem}\label{thm:label no name}
|
||||||
|
这是一个没有名字但是有标签的定理。
|
||||||
|
用 \ref{thm:label no name} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 有名字,无标签
|
||||||
|
\begin{theorem}[theorem name]
|
||||||
|
这是一个有名字但是没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,无标签
|
||||||
|
\begin{theorem}
|
||||||
|
这是一个没有名字也没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
\end{theorem}
|
||||||
|
\end{lstlisting}
|
||||||
|
这时引用不需要加前缀,\lstinline{\ref} 中的内容与 \lstinline{\label} 中的内容相同,换句话说,这时的使用方法与使用原生定理环境的时候几乎相同。
|
||||||
|
|
||||||
|
\subsubsection{\texttt{simple} 模式}
|
||||||
|
|
||||||
|
在 \lstinline{simple} 模式下使用了 \lstinline{amsthm} 宏包,定理类环境使用方法与原生一致,定理的使用方法如下:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
% 有名字,有标签
|
||||||
|
\begin{theorem}[theorem name]\label{thm:label}
|
||||||
|
这是一个有名字和标签的定理。
|
||||||
|
用 \ref{thm:label} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,有标签
|
||||||
|
\begin{theorem}\label{thm:label no name}
|
||||||
|
这是一个没有名字但是有标签的定理。
|
||||||
|
用 \ref{thm:label no name} 来引用这个定理。
|
||||||
|
\end{theorem}
|
||||||
|
% 有名字,无标签
|
||||||
|
\begin{theorem}[theorem name]
|
||||||
|
这是一个有名字但是没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
\end{theorem}
|
||||||
|
% 无名字,无标签
|
||||||
|
\begin{theorem}
|
||||||
|
这是一个没有名字也没有标签的定理。
|
||||||
|
这个定理不能被引用。
|
||||||
|
\end{theorem}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
% \subsection{算法环境}
|
% \subsection{算法环境}
|
||||||
|
|
||||||
|
|
||||||
% \begin{algorithm}\label{alg:test}
|
% \begin{algorithm}\label{alg:test}
|
||||||
% \Input{A bitmap $I$ of size $w \times l$}
|
% \Input{A bitmap $I$ of size $w \times l$}
|
||||||
% \Output{A partition of the bitmap}
|
% \Output{A partition of the bitmap}
|
||||||
@@ -340,13 +422,105 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
|
|
||||||
\subsection{修改计数器}
|
\subsection{修改计数器}
|
||||||
|
|
||||||
当前定理等环境计数器按章计数,如果想修改定理类环境按节计数,可以修改计数器选项 thmcnt:
|
当前定理等环境计数器按章计数,如果想修改定理类环境按节计数,可以修改计数器选项 \lstinline{thmcnt},可用选项为 \lstinline{chapter} (默认)与 \lstinline{section}:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[section]{elegantbook} %or
|
\documentclass[section]{elegantbook} %or
|
||||||
\documentclass[thmcnt=section]{elegantbook}
|
\documentclass[thmcnt=section]{elegantbook}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
|
如果希望全局的定理类环境使用同一个计数器,可以使用文档类选项 \lstinline{usesamecnt}:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\documentclass[usesamecnt]{elegantbook}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
\subsection{自定义定理类环境}
|
||||||
|
|
||||||
|
4.4 版本新增了一个自定义定理类环境的命令:\lstinline|\elegantnewtheorem|,它的参数含义如下:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
% fancy 模式(默认)
|
||||||
|
\elegantnewtheorem{env}{title}{style}{prefix}[numbered-like]
|
||||||
|
% simple 模式
|
||||||
|
\elegantnewtheorem{env}{title}{style}[numbered-like]
|
||||||
|
\end{lstlisting}
|
||||||
|
该命令可以同时定义编号环境 \lstinline|env| 和不编号环境 \lstinline|env*|。
|
||||||
|
|
||||||
|
其中 \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}
|
||||||
|
\item 在炫彩模式(\lstinline{fancy})下,需要 5 个参数来定义一个新的定理类环境,分别是:
|
||||||
|
定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀,(可选)该定理类环境继承的定理类环境:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
% 导言区
|
||||||
|
\elegantnewtheorem{examplefancy}{自定义定理类环境}{thmstyle}{exfancy}
|
||||||
|
% 正文
|
||||||
|
\begin{examplefancy}{定理名}{label}
|
||||||
|
这里是自定义定理类环境 \ref{exfancy:label}
|
||||||
|
\end{examplefancy}
|
||||||
|
\begin{examplefancy*}{定理名}
|
||||||
|
这里是无编号自定义定理类环境
|
||||||
|
\end{examplefancy*}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
如果不给出第四个参数,或第四个参数置空的话,将会用定理类环境名来作为默认前缀,即
|
||||||
|
\begin{lstlisting}
|
||||||
|
% 导言区
|
||||||
|
\elegantnewtheorem{test}{TEST}{thmstyle}
|
||||||
|
% 或
|
||||||
|
\elegantnewtheorem{test}{TEST}{thmstyle}{}
|
||||||
|
% 正文
|
||||||
|
\begin{test}{name}{label}
|
||||||
|
默认前缀为 test。
|
||||||
|
使用 \ref{test:label} 来引用这个定理类环境。
|
||||||
|
\end{test}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
这时会在终端以及 \verb|.log| 文件中输出一个警告信息来提示用户没有定义前缀:
|
||||||
|
|
||||||
|
\begin{lstlisting}[language=bash]
|
||||||
|
Class elegantbook Warning: Because you didn't provide a prefix.
|
||||||
|
(elegantbook) We use test as the default prefix.
|
||||||
|
(elegantbook) You have to use
|
||||||
|
(elegantbook) \ref {test:label} to refer a
|
||||||
|
(elegantbook) \begin {test}{name}{label} environment.
|
||||||
|
(elegantbook) on input line 3.
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
\item 在简单模式(\lstinline{simple})下,需要 4 个参数来定义一个新的定理类环境,分别是:
|
||||||
|
定理类环境名,定理类环境的标题,定理类环境的样式,该定理类环境的前缀,(可选)该定理类环境继承的定理类环境:
|
||||||
|
\begin{lstlisting}
|
||||||
|
% 导言区
|
||||||
|
\elegantnewtheorem{examplesimple}{自定义定理类环境}{thmstyle}
|
||||||
|
% 正文
|
||||||
|
\begin{examplesimple}[定理名]\label{exsimple:label}
|
||||||
|
这里是自定义定理类环境 \ref{exsimple:label}
|
||||||
|
\end{examplesimple}
|
||||||
|
\begin{examplesimple*}[定理名]
|
||||||
|
这里是无编号自定义定理类环境
|
||||||
|
\end{examplesimple*}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
如果此时错误地给出了第四个参数,那么将会在终端以及 \verb|.log| 文件中输出一个错误信息:
|
||||||
|
\begin{lstlisting}
|
||||||
|
% elegantbook-cn.tex
|
||||||
|
\elegantnewtheorem{test}{TEST}{thmstyle}{}
|
||||||
|
% .log file
|
||||||
|
./elegantbook-cn.tex:3: Class elegantbook Error: You can't set a prefix in mode ``simple''.
|
||||||
|
(elegantbook) Just use
|
||||||
|
(elegantbook) \elegantnewtheorem {test}{TEST}{thmstyle} .
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
\subsection{其他环境的使用}
|
\subsection{其他环境的使用}
|
||||||
|
|
||||||
@@ -397,7 +571,25 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
\end{minipage}
|
\end{minipage}
|
||||||
|
|
||||||
\section{参考文献}
|
\section{参考文献}
|
||||||
文献部分,本模板调用了 biblatex 宏包,并提供了 biber(默认) 和 bibtex 两个后端选项,可以使用 \lstinline{bibend} 进行修改:
|
|
||||||
|
\subsection{打印文献}
|
||||||
|
|
||||||
|
之前我们将文献调用的命令放在模板里面,然后用户反馈 \lstinline{\cite} 命令无法自动补全,因此我们新版本将其拿到外面来,新版本打印参考文献的命令的方法是,在导言区(也即 \lstinline|\begin{document}| 之前),加入:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\addbibresource[location=local]{reference.bib}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
然后再需要打印文献的地方使用:
|
||||||
|
\begin{lstlisting}
|
||||||
|
\printbibliography[heading=bibintoc, title=\ebibname]
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
其中 \lstinline{reference.bib} 为参考文献存放的文件,需要放在项目文件夹下。
|
||||||
|
|
||||||
|
\subsection{修改文献格式}
|
||||||
|
|
||||||
|
此外,本模板调用了 biblatex 宏包,并提供了 biber(默认) 和 bibtex 两个后端选项,可以使用 \lstinline{bibend} 进行修改:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[bibtex]{elegantbook}
|
\documentclass[bibtex]{elegantbook}
|
||||||
@@ -413,12 +605,16 @@ tlmgr update --self --all --reinstall-forcibly-removed
|
|||||||
\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 并且需要添加排序方式,可以在导言区加入下面命令:
|
||||||
|
\begin{lstlisting}
|
||||||
|
\ExecuteBibliographyOptions{sorting=<name>}
|
||||||
|
\end{lstlisting}
|
||||||
|
其中 \lstinline{<name>} 可以是 nty, nyt, nyvt, anyt, anyvt, ynt, ydnt, none, count, debug 的其中之一,更多排序相关请参考 biblatex 宏包手册的 3.1.2.1 节。
|
||||||
|
|
||||||
启用国标之后,可以加入 \lstinline{sorting=gb7714-2015}。
|
|
||||||
|
|
||||||
\section{添加序章}
|
\section{添加序章}
|
||||||
|
|
||||||
@@ -483,7 +679,7 @@ The content of introduction.
|
|||||||
|
|
||||||
|
|
||||||
效果如下:
|
效果如下:
|
||||||
\begin{problemset}
|
\begin{problemset}[我的题目]
|
||||||
\item exercise 1
|
\item exercise 1
|
||||||
\item exercise 2
|
\item exercise 2
|
||||||
\item exercise 3
|
\item exercise 3
|
||||||
@@ -551,7 +747,7 @@ The content of introduction.
|
|||||||
|
|
||||||
本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个:
|
本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个:
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item \lstinline{math=cm}(默认),使用 \LaTeX{} 默认数学字体(推荐,无需声明);
|
\item \lstinline{math=cm}(默认),使用 \LaTeX\ 默认数学字体(推荐,无需声明);
|
||||||
\item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。
|
\item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。
|
||||||
\item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。
|
\item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
@@ -568,12 +764,12 @@ The content of introduction.
|
|||||||
|
|
||||||
如果使用 \lstinline{newtx} 系列字体宏包,需要注意下连字符的问题。
|
如果使用 \lstinline{newtx} 系列字体宏包,需要注意下连字符的问题。
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
|
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \sin x
|
||||||
\end{equation}
|
\end{equation}
|
||||||
的代码为
|
的代码为
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
|
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \sin x
|
||||||
\end{equation}
|
\end{equation}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
@@ -607,12 +803,8 @@ LaTeX Error:
|
|||||||
\item \lstinline{nofont}:后台会调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
|
\item \lstinline{nofont}:后台会调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
|
|
||||||
\begin{remark}
|
|
||||||
使用 \lstinline{founder} 选项或者 \lstinline{nofont} 时,必须使用 \hologo{XeLaTeX} 进行编译。
|
|
||||||
\end{remark}
|
|
||||||
|
|
||||||
\subsection{方正字体选项}
|
\subsection{方正字体选项}
|
||||||
由于使用 \lstinline{ctex} 宏包默认调用系统已有的字体,部分系统字体缺失严重,因此,用户希望能够使用其它字体,我们推荐使用方正字体。方正的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}、{\fangsong 方正仿宋}四款字体均可免费试用,且可用于商业用途。用户可以自行从\href{http://www.foundertype.com/}{方正字体官网}下载此四款字体,在下载的时候请\textbf{务必}注意选择 GBK 字符集,也可以使用 \href{https://www.latexstudio.net/}{\LaTeX{} 工作室}提供的\href{https://pan.baidu.com/s/1BgbQM7LoinY7m8yeP25Y7Q}{方正字体,提取码为:njy9} 进行安装。安装时,{\kaishu Win 10 用户请右键选择为全部用户安装,否则会找不到字体。}
|
由于使用 \lstinline{ctex} 宏包默认调用系统已有的字体,部分系统字体缺失严重,因此,用户希望能够使用其它字体,我们推荐使用方正字体。方正的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}、{\fangsong 方正仿宋}四款字体均可免费试用,且可用于商业用途。用户可以自行从\href{http://www.foundertype.com/}{方正字体官网}下载此四款字体,在下载的时候请\textbf{务必}注意选择 GBK 字符集。安装时,{\kaishu Windows 11 用户请右键选择为全部用户安装,否则会找不到字体。}
|
||||||
|
|
||||||
\begin{figure}[!htb]
|
\begin{figure}[!htb]
|
||||||
\centering
|
\centering
|
||||||
@@ -699,11 +891,9 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
\int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx.
|
\int_{\mathcal{R}^p\times\mathcal{R}^q} f(x,y) dxdy=\int_{\mathcal{R}^p}\left(\int_{\mathcal{R}^q}f(x,y)dy\right)dx.
|
||||||
\end{equation}
|
\end{equation}
|
||||||
|
|
||||||
(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$ 上的可积函数。而且~\ref{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}
|
||||||
@@ -733,7 +923,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
\end{property}
|
\end{property}
|
||||||
|
|
||||||
\begin{conclusion}
|
\begin{conclusion}
|
||||||
回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。
|
回归分析(regression analysis) 是确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。运用十分广泛,回归分析按照涉及的变量的多少,分为一元回归和多元回归分析;按照因变量的多少,可分为简单回归分析和多重回归分析;按照自变量和因变量之间的关系类型,可分为线性回归分析和非线性回归分析。
|
||||||
\end{conclusion}
|
\end{conclusion}
|
||||||
|
|
||||||
\begin{problemset}
|
\begin{problemset}
|
||||||
@@ -751,20 +941,18 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
见前文介绍,可以使用 \lstinline{scheme=chinese} 设置。
|
见前文介绍,可以使用 \lstinline{scheme=chinese} 设置。
|
||||||
\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[breaklines]{Package ctex Error: CTeX fontset 'Mac' is unavailable.}}
|
|
||||||
在 Mac 系统下,中文编译请使用 \hologo{XeLaTeX}。
|
|
||||||
\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。
|
你用的 \CTeX\ 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 \CTeX\ 套装了,请卸载并安装 \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{请问交叉引用是什么?}
|
||||||
本群和本模板适合有一定 \LaTeX{} 基础的用户使用,新手请先学习 \LaTeX{} 的基础,理解各种概念,否则你将寸步难行。
|
本群和本模板适合有一定 \LaTeX\ 基础的用户使用,新手请先学习 \LaTeX\ 的基础,理解各种概念,否则你将寸步难行。
|
||||||
\item \question{代码高亮环境能用其他语言吗?}
|
\item \question{代码高亮环境能用其他语言吗?}
|
||||||
可以的,ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境(\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{lsset} 命令,更多信息请参考宏包文档。
|
可以的,ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境(\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{lstset} 命令,更多信息请参考宏包文档。
|
||||||
\item \question{群主,什么时候出 Beamer 的模板(主题),ElegantSlide 或者 ElegantBeamer?}
|
\item \question{群主,什么时候出 Beamer 的模板(主题),ElegantSlide 或者 ElegantBeamer?}
|
||||||
由于 Beamer 中有一个很优秀的主题 \href{https://github.com/matze/mtheme}{Metropolis}。后续确定不会再出任何主题/模板,请大家根据需要修改已有主题。
|
由于 Beamer 中有一个很优秀的主题 \href{https://github.com/matze/mtheme}{Metropolis}。后续确定不会再出任何主题/模板,请大家根据需要修改已有主题。
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
@@ -773,11 +961,38 @@ 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 正式发布。}
|
||||||
|
|
||||||
|
\begin{change}
|
||||||
|
\item \textbf{重要改动}:提供了一个定义定理类环境的命令 \lstinline|\elegantnewtheorem|;
|
||||||
|
\item \textbf{重要改动}:为所有内置定理类环境提供了带星号的版本,带星号的定理类环境不会编号,修复 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/167}{issue: \#167};
|
||||||
|
\item \textbf{重要改动}:在 \lstinline{scheme=chinese} 下将目录中的“第 1 章”修改为“第一章”;
|
||||||
|
\item 将 TeX Gyre Termes 改为 TeX Gyre TermesX,使英文部分字形与 newtx 系列宏包更相近;
|
||||||
|
\item 重写了内置定理类环境的实现方法,修复了一些 bug,由于修改部分较大,如果引入了新的 bug,请及时在 QQ 群或 \href{https://github.com/ElegantLaTeX}{Github} 上进行反馈;
|
||||||
|
\item 删除 Gitee 仓库地址,恢复 GitHub 提交(pull requests);
|
||||||
|
\item 将参考文献命令添加到导言区,使编辑器能够对参考文献自动补全。
|
||||||
|
\end{change}
|
||||||
|
|
||||||
\datechange{2022/04/09}{版本 4.3 正式发布。}
|
\datechange{2022/04/09}{版本 4.3 正式发布。}
|
||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item 放弃 newtx 系列宏包的设置,改用 TeX Gyre Terms,并设置其他字体;
|
\item 放弃 newtx 系列宏包的设置,改用 TeX Gyre Termes,并设置其他字体;
|
||||||
\item 修改定理类环境内部字体设置,修复环境内部中文无法加粗问题;
|
\item 修改定理类环境内部字体设置,修复环境内部中文无法加粗问题;
|
||||||
\item 增加定理类环境的计数器选项 \lstinline{thmcnt},可选 \lstinline{chapter} 和 \lstinline{section};
|
\item 增加定理类环境的计数器选项 \lstinline{thmcnt},可选 \lstinline{chapter} 和 \lstinline{section};
|
||||||
\item 增加 \lstinline{bibend} 选项,可选 \lstinline{bibend=biber}(默认)和 \lstinline{bibend=bibtex}。
|
\item 增加 \lstinline{bibend} 选项,可选 \lstinline{bibend=biber}(默认)和 \lstinline{bibend=bibtex}。
|
||||||
@@ -811,7 +1026,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item \textbf{重要修正}:修复因为 \lstinline{gbt7714} 宏包更新导致的 \lstinline{natbib option clash} 错误;
|
\item \textbf{重要修正}:修复因为 \lstinline{gbt7714} 宏包更新导致的 \lstinline{natbib option clash} 错误;
|
||||||
\item 由于 \lstinline{pgfornament} 宏包未被 \TeX{} Live 2020 收录,因此删除 base 相关的内容;
|
\item 由于 \lstinline{pgfornament} 宏包未被 \TeX~Live 2020 收录,因此删除 base 相关的内容;
|
||||||
\item 修复部分环境的空格问题;
|
\item 修复部分环境的空格问题;
|
||||||
\item 增加了意大利语言选项 \lstinline{lang=it}。
|
\item 增加了意大利语言选项 \lstinline{lang=it}。
|
||||||
\end{change}
|
\end{change}
|
||||||
@@ -821,7 +1036,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item 增加数学字体选项 \lstinline{math},可选项为 \lstinline{newtx} 和 \lstinline{cm}。\\
|
\item 增加数学字体选项 \lstinline{math},可选项为 \lstinline{newtx} 和 \lstinline{cm}。\\
|
||||||
\textbf{重要提示}:原先通过 \lstinline{newtxmath} 宏包设置的数学字体改为 \LaTeX{} 默认数学字体,如果需要保持原来的字体,需要显式声明数学字体(\lstinline{math=newtx});
|
\textbf{重要提示}:原先通过 \lstinline{newtxmath} 宏包设置的数学字体改为 \LaTeX\ 默认数学字体,如果需要保持原来的字体,需要显式声明数学字体(\lstinline{math=newtx});
|
||||||
\item 新增中文字体选项 \lstinline{chinesefont},可选项为 \lstinline{ctexfont}、\lstinline{founder} 和 \lstinline{nofont}。
|
\item 新增中文字体选项 \lstinline{chinesefont},可选项为 \lstinline{ctexfont}、\lstinline{founder} 和 \lstinline{nofont}。
|
||||||
\item 将封面作者信息设置为可选,并且增加自定义信息命令 \lstinline{\bioinfo};
|
\item 将封面作者信息设置为可选,并且增加自定义信息命令 \lstinline{\bioinfo};
|
||||||
\item 在说明文档中增加版本历史,新增 \lstinline{\datechange} 命令和 \lstinline{change} 环境;
|
\item 在说明文档中增加版本历史,新增 \lstinline{\datechange} 命令和 \lstinline{change} 环境;
|
||||||
@@ -926,13 +1141,14 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
|
|||||||
\item 修改英文字体为 \lstinline{newtx} 系列,另外大型操作符号维持 cm 字体。
|
\item 修改英文字体为 \lstinline{newtx} 系列,另外大型操作符号维持 cm 字体。
|
||||||
\item 中文字体改用 \lstinline{ctex} 宏包自动设置。
|
\item 中文字体改用 \lstinline{ctex} 宏包自动设置。
|
||||||
\item 删除 \lstinline{xeCJK} 字体设置,原因是不同系统字体不方便统一。
|
\item 删除 \lstinline{xeCJK} 字体设置,原因是不同系统字体不方便统一。
|
||||||
\item 定理换用 \lstinline{tcolobox} 宏包定义,并基本维持原有的定理样式,优化显示效果,支持跨页;定理类名字重命名,如 etheorem 改为 theorem 等等。
|
\item 定理换用 \lstinline{tcolorbox} 宏包定义,并基本维持原有的定理样式,优化显示效果,支持跨页;定理类名字重命名,如 etheorem 改为 theorem 等等。
|
||||||
\item 删去自定义的缩进命令 \lstinline{\Eindent}。
|
\item 删去自定义的缩进命令 \lstinline{\Eindent}。
|
||||||
\item 添加参考文献宏包 \lstinline{natbib}。
|
\item 添加参考文献宏包 \lstinline{natbib}。
|
||||||
\item 颜色名字重命名。
|
\item 颜色名字重命名。
|
||||||
\end{change}
|
\end{change}
|
||||||
|
|
||||||
\nocite{*}
|
\nocite{*}
|
||||||
|
|
||||||
\printbibliography[heading=bibintoc, title=\ebibname]
|
\printbibliography[heading=bibintoc, title=\ebibname]
|
||||||
\appendix
|
\appendix
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
\documentclass[11pt]{elegantbook}
|
\documentclass[11pt]{elegantbook}
|
||||||
|
|
||||||
\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{April 9, 2022}
|
\date{Feb. 27, 2026}
|
||||||
\version{4.3}
|
\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}
|
||||||
@@ -17,6 +17,9 @@
|
|||||||
% modify the color in the middle of titlepage
|
% modify the color in the middle of titlepage
|
||||||
\definecolor{customcolor}{RGB}{32,178,170}
|
\definecolor{customcolor}{RGB}{32,178,170}
|
||||||
\colorlet{coverlinecolor}{customcolor}
|
\colorlet{coverlinecolor}{customcolor}
|
||||||
|
\usepackage{cprotect}
|
||||||
|
|
||||||
|
\addbibresource[location=local]{reference.bib} % bib
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
@@ -27,8 +30,8 @@
|
|||||||
|
|
||||||
\mainmatter
|
\mainmatter
|
||||||
|
|
||||||
\chapter{Elegant\LaTeX{} Templates}
|
\chapter{Elegant\LaTeX\ Templates}
|
||||||
Elegant\LaTeX{} Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX{} is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}.
|
Elegant\LaTeX\ Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX\ is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}.
|
||||||
|
|
||||||
Contact Infos:
|
Contact Infos:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
@@ -53,19 +56,20 @@ tlmgr update --self
|
|||||||
tlmgr update --all
|
tlmgr update --all
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
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 environment is Win10/Ubuntu 20.04/macOS + \TeX{} Live 2022/ Mac\TeX{} 2022, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine.
|
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
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[en]{elegantbook}
|
\documentclass[en]{elegantbook}
|
||||||
\documentclass[lang=en]{elegantbook}
|
\documentclass[lang=en]{elegantbook}
|
||||||
@@ -78,7 +82,7 @@ Besides the two basic language translation, our user provide more options, here
|
|||||||
\item French translation \lstinline{lang=fr}, provided by \href{https://github.com/abfek66}{abfek66} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation};
|
\item French translation \lstinline{lang=fr}, provided by \href{https://github.com/abfek66}{abfek66} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation};
|
||||||
\item Dutch Translation \lstinline{lang=nl}, provided by \href{https://github.com/inktvis75}{inktvis75} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/108}{Dutch Translation};
|
\item Dutch Translation \lstinline{lang=nl}, provided by \href{https://github.com/inktvis75}{inktvis75} , please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/108}{Dutch Translation};
|
||||||
\item Hungarian translation \lstinline{lang=hu}, provided by \href{https://github.com/palkotamas}{palkotamas}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation};
|
\item Hungarian translation \lstinline{lang=hu}, provided by \href{https://github.com/palkotamas}{palkotamas}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation};
|
||||||
\item Deutsch translation \lstinline{lang=de}, provided by Lisa, please refer to\href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation};
|
\item Deutsch translation \lstinline{lang=de}, provided by Lisa, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation};
|
||||||
\item Spanish translation \lstinline{lang=es}, provided by Gustavo A. Corradi, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation};
|
\item Spanish translation \lstinline{lang=es}, provided by Gustavo A. Corradi, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation};
|
||||||
\item Mongolian translation \lstinline{lang=mn}, provided by \href{https://github.com/Altantsooj}{Altantsooj}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation};
|
\item Mongolian translation \lstinline{lang=mn}, provided by \href{https://github.com/Altantsooj}{Altantsooj}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation};
|
||||||
\item Japanese translation \lstinline{lang=jp}, provided by \href{https://github.com/inusturbo}{inusturbo}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/172}{Japanese translation}.
|
\item Japanese translation \lstinline{lang=jp}, provided by \href{https://github.com/inusturbo}{inusturbo}, please refer to \href{https://github.com/ElegantLaTeX/ElegantBook/issues/172}{Japanese translation}.
|
||||||
@@ -96,7 +100,7 @@ The option for device (\lstinline{device}) was originally used in ElegantNote, n
|
|||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\section{Color Themes}
|
\section{Color Themes}
|
||||||
This template contains 5 color themes, i.e. \textcolor{structure1}{\lstinline{green}}\footnote{Original default theme.}, \textcolor{structure2}{\lstinline{cyan}}, \textcolor{structure3}{\lstinline{blue}}(default), \textcolor{structure4}{\lstinline{gray}}, \textcolor{structure5}{\lstinline{black}}. You can choose \lstinline{green} with
|
This template contains 5 color themes, i.e., \textcolor{structure1}{\lstinline{green}}\footnote{Original default theme.}, \textcolor{structure2}{\lstinline{cyan}}, \textcolor{structure3}{\lstinline{blue}}(default), \textcolor{structure4}{\lstinline{gray}}, \textcolor{structure5}{\lstinline{black}}. You can choose \lstinline{green} with
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[green]{elegantbook} %or
|
\documentclass[green]{elegantbook} %or
|
||||||
\documentclass[color=green]{elegantbook}
|
\documentclass[color=green]{elegantbook}
|
||||||
@@ -210,7 +214,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:
|
\item \textit{Theorem Environments}, including title and content, numbering corresponding to chapter. Three types depending on the format:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \textcolor{main}{\textbf{definition}} environment, the color is \textcolor{main}{main};
|
\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}.
|
\item \textcolor{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
\item \textit{Example Environment}, including \textbf{example, exercise, problem} environment, auto numbering according to chapter.
|
\item \textit{Example Environment}, including \textbf{example, exercise, problem} environment, auto numbering according to chapter.
|
||||||
@@ -218,49 +222,91 @@ In this template, we defined four different theorem class environments
|
|||||||
\item \textit{Conclusion Environment}, including \textbf{conclusion, assumption, property, remark and solution}\footnote{We also define an option \lstinline{result}, which can hide the \lstinline{solution} and \lstinline{proof} environments. You can switch between \lstinline{result=answer} and \lstinline{result=noanswer}.} environments, all of which begin with boldfaced words, with format consistent with normal paragraphs.
|
\item \textit{Conclusion Environment}, including \textbf{conclusion, assumption, property, remark and solution}\footnote{We also define an option \lstinline{result}, which can hide the \lstinline{solution} and \lstinline{proof} environments. You can switch between \lstinline{result=answer} and \lstinline{result=noanswer}.} environments, all of which begin with boldfaced words, with format consistent with normal paragraphs.
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
|
All of theorem environments have star versions: \textcolor{main}{\textbf{definition*}}, \textcolor{second}{\textbf{theorem*}}, \textcolor{second}{\textbf{lemma*}}, \textcolor{second}{\textbf{corollary*}}, \textcolor{second}{\textbf{axiom*}}, \textcolor{second}{\textbf{postulate*}}, \textcolor{third}{\textbf{proposition*}}. Environments with an asterisk are not numbered.
|
||||||
|
|
||||||
\subsection{Theorem Class Environments}
|
\subsection{Theorem Class Environments}
|
||||||
Since the template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows:
|
|
||||||
\begin{lstlisting}
|
|
||||||
\begin{theorem}{theorem name}{label text}
|
|
||||||
The content of theorem.
|
|
||||||
\end{theorem}
|
|
||||||
\end{lstlisting}
|
|
||||||
|
|
||||||
The first parameter \lstinline{<theorem name>} represents the name of the theorem, and the second parameter \lstinline{label} represents the label used in cross-reference with \verb|ref{thm:label}|. Note that cross-references must be prefixed with \lstinline{thm:}.
|
\subsubsection{\lstinline{fancy} mode}
|
||||||
|
|
||||||
From version 4.1, you can write your theorem environments as follows:
|
In \lstinline{fancy} mode, the template uses the \lstinline{tcolorbox} package to customize the theorem class environments, it is slightly different from the normal theorem environments. The usage is as follows:
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\begin{theorem}[theorem name]\label{thm:label text}
|
% name + label
|
||||||
The content of theorem.
|
\begin{theorem}{theorem name}{label}
|
||||||
\end{theorem}
|
The content of a theorem with name and label.
|
||||||
% or
|
Use \ref{thm:label} to refer this theorem.
|
||||||
\begin{theorem}
|
\end{theorem}
|
||||||
The content of theorem.
|
% no name + label
|
||||||
\end{theorem}
|
\begin{theorem}{}{label no name}
|
||||||
\end{lstlisting}
|
The content of a theorem without name.
|
||||||
|
Use \ref{thm:label no name} to refer this theorem.
|
||||||
|
\end{theorem}
|
||||||
|
% name + no label
|
||||||
|
\begin{theorem}{theorem name}{}
|
||||||
|
The content of a theorem without label.
|
||||||
|
Can't refer this theorem.
|
||||||
|
The last {} can be removed.
|
||||||
|
\end{theorem}
|
||||||
|
% no name + no label
|
||||||
|
\begin{theorem}{}{}
|
||||||
|
The content of a theorem without name and label.
|
||||||
|
Can't refer this theorem.
|
||||||
|
Both of {} can be removed.
|
||||||
|
\end{theorem}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
The first parameter \lstinline{theorem name} represents the name of the theorem. If the current theorem has no name, please use \lstinline|{}|\cprotect\footnote{Unless this theorem has neither no label, you should not omit this \verb|{}|.}, and the second parameter \lstinline{label} represents the label used in cross-reference with \verb|\ref{thm:label}|. Note that cross-references must be prefixed with \lstinline{thm:}.
|
||||||
|
|
||||||
Other theorem class environments with the same usage includes:
|
Other theorem class environments with the same usage includes:
|
||||||
|
|
||||||
\begin{table}[htbp]
|
\begin{table}[htbp]
|
||||||
\centering
|
\centering
|
||||||
\caption{Theorem Class Environments}
|
\caption{Theorem Class Environments}
|
||||||
\begin{tabular}{llll}
|
\begin{tabular}{llll}
|
||||||
\toprule
|
\toprule
|
||||||
Environment & Label text & Prefix & Cross-reference \\
|
Environment & Label text & Prefix & Cross-reference \\
|
||||||
\midrule
|
\midrule
|
||||||
definition & label & def & \lstinline|\ref{def:label}| \\
|
definition & label & def & \lstinline|\ref{def:label}| \\
|
||||||
theorem & label & thm & \lstinline|\ref{thm:label}| \\
|
theorem & label & thm & \lstinline|\ref{thm:label}| \\
|
||||||
lemma & label & lem & \lstinline|\ref{lem:label}| \\
|
postulate & label & pos & \lstinline|\ref{pos:label}| \\
|
||||||
corrlary & label & cor & \lstinline|\ref{cor:label}| \\
|
axiom & label & axi & \lstinline|\ref{axi:label}|\\
|
||||||
proposition & label & pro & \lstinline|\ref{pro:label}| \\
|
lemma & label & lem & \lstinline|\ref{lem:label}| \\
|
||||||
\bottomrule
|
corrlary & label & cor & \lstinline|\ref{cor:label}| \\
|
||||||
\end{tabular}%
|
proposition & label & pro & \lstinline|\ref{pro:label}| \\
|
||||||
\label{tab:theorem-class}%
|
\bottomrule
|
||||||
\end{table}%
|
\end{tabular}%
|
||||||
|
\label{tab:theorem-class}%
|
||||||
|
\end{table}%
|
||||||
|
|
||||||
|
From version 4.1, you can write your theorem environments as follows:
|
||||||
|
\begin{lstlisting}
|
||||||
|
\begin{theorem}[theorem name]\label{thm:theorem-label}
|
||||||
|
The content of theorem.
|
||||||
|
\end{theorem}
|
||||||
|
% or
|
||||||
|
\begin{theorem}\label{thm:theorem-without-name}
|
||||||
|
The content of theorem.
|
||||||
|
\end{theorem}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
In this case, cross-reference don't have to be prefixed, i.e. the parameter of \lstinline{\ref} is the same as that of \lstinline{\label}.
|
||||||
|
|
||||||
|
\subsubsection{\lstinline{simple} mode}
|
||||||
|
|
||||||
|
In \lstinline{simple} mode, the template uses the \lstinline{amsthm} package to customize the theorem class environments. The usage is as follows:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\begin{theorem}[theorem name]\label{thm:theorem-label}
|
||||||
|
The content of theorem.
|
||||||
|
\end{theorem}
|
||||||
|
% or
|
||||||
|
\begin{theorem}\label{thm:theorem-without-name}
|
||||||
|
The content of theorem without name.
|
||||||
|
\end{theorem}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
\subsection{Counter for Theorem Environments}
|
\subsection{Counter for Theorem Environments}
|
||||||
|
|
||||||
You can use \lstinline{thmcnt} option to control the theorem counter/number display style for the theorem environments, the acceptable options are \lstinline{chapter} (default) and \lstinline{section}.
|
You can use \lstinline{thmcnt} option to control the theorem counter/number display style for the theorem environments, the acceptable options are \lstinline{chapter} (default) and \lstinline{section}:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\documentclass[section]{elegantbook} % turn the Theorem 4.1 to Theorem 4.1.1
|
\documentclass[section]{elegantbook} % turn the Theorem 4.1 to Theorem 4.1.1
|
||||||
@@ -268,7 +314,6 @@ You can use \lstinline{thmcnt} option to control the theorem counter/number disp
|
|||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Other Customized Environments}
|
\subsection{Other Customized Environments}
|
||||||
The other three math environments can be called directly since there are no additional option for them, e.g. \lstinline{example}:
|
The other three math environments can be called directly since there are no additional option for them, e.g. \lstinline{example}:
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
@@ -327,7 +372,7 @@ This template uses \lstinline{tikz} to customize the list environments, with \ls
|
|||||||
\section{Fonts}
|
\section{Fonts}
|
||||||
\textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm, together with other two options, the \lstinline{math} font option offers:
|
\textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm, together with other two options, the \lstinline{math} font option offers:
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item \lstinline{math=cm}(default), use \LaTeX{} default math font (recommended).
|
\item \lstinline{math=cm}(default), use \LaTeX\ default math font (recommended).
|
||||||
\item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs).
|
\item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs).
|
||||||
\item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font.
|
\item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font.
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
@@ -339,13 +384,13 @@ If you use \lstinline{newtx} fonts, type in:
|
|||||||
|
|
||||||
When you are using \lstinline{newtx}, please pay attention to the hyphens. For instance,
|
When you are using \lstinline{newtx}, please pay attention to the hyphens. For instance,
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f}
|
\int_{R^q} f(x,y) dy.\emph{of\kern0pt f} \sin x
|
||||||
\end{equation}
|
\end{equation}
|
||||||
|
|
||||||
The corresponding code is:
|
The corresponding code is:
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
\begin{equation}
|
\begin{equation}
|
||||||
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f}
|
\int_{R^q} f(x,y) dy.\emph{of \kern0pt f} \sin x
|
||||||
\end{equation}
|
\end{equation}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
@@ -375,6 +420,19 @@ This template uses biblatex to generate the bibliography, the default citestyle
|
|||||||
|
|
||||||
If you want to use biblatex, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The biber will automatically generate the bibliography for the reference you cited.
|
If you want to use biblatex, you must create a file named \lstinline{reference.bib}, add bib items (from Google Scholar, Mendeley, EndNote, and etc.) to \lstinline{reference.bib} file, then cite the bibkey in the \lstinline{tex} file. The biber will automatically generate the bibliography for the reference you cited.
|
||||||
|
|
||||||
|
In order to get the editors' auto-completion working, you need to add following code in your preamble:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\addbibresource[location=local]{reference.bib}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
Then include the print commands where you want to print the bibliography:
|
||||||
|
\begin{lstlisting}
|
||||||
|
\printbibliography[heading=bibintoc, title=\ebibname]
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To change the bibliography style, this version introduces two options: \lstinline{citestyle} and \lstinline{bibstyle}, please refer to \href{https://ctan.org/pkg/biblatex}{CTAN:biblatex} for more detail about these options. You can change your bibliography style as
|
To change the bibliography style, this version introduces two options: \lstinline{citestyle} and \lstinline{bibstyle}, please refer to \href{https://ctan.org/pkg/biblatex}{CTAN:biblatex} for more detail about these options. You can change your bibliography style as
|
||||||
|
|
||||||
@@ -532,19 +590,27 @@ Note that a subgroup~$H$ of a group $G$ is itself a left coset of $H$ in $G$.
|
|||||||
\lipsum[2]
|
\lipsum[2]
|
||||||
|
|
||||||
\begin{theorem}[Lagrange's Theorem] \label{thm:lg}
|
\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$.
|
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}
|
\end{theorem}
|
||||||
|
|
||||||
\ref{thm:lg}
|
As theorem \ref{thm:lg} refered.
|
||||||
|
|
||||||
\lipsum[3]
|
\lipsum[3]
|
||||||
|
|
||||||
|
|
||||||
|
\begin{theorem}{theorem name}{label text}
|
||||||
|
The content of theorem.
|
||||||
|
\end{theorem}
|
||||||
|
|
||||||
|
we can refer this theorem as \ref{thm:label text}.
|
||||||
|
|
||||||
|
|
||||||
\begin{proposition}[Size of Left Coset]
|
\begin{proposition}[Size of Left Coset]
|
||||||
Let $H$ be a finite subgroup of a group $G$. Then each left coset of $H$ in $G$ has the same number of elements as $H$.
|
Let $H$ be a finite subgroup of a group $G$. Then each left coset of $H$ in $G$ has the same number of elements as $H$.
|
||||||
\end{proposition}
|
\end{proposition}
|
||||||
|
|
||||||
\begin{proof}
|
\begin{proof}
|
||||||
Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and $z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh = z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$, and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required.
|
Let $z$ be some element of $xH \cap yH$. Then $z = xa$ for some $a \in H$, and $z = yb$ for some $b \in H$. If $h$ is any element of $H$ then $ah \in H$ and $a^{-1}h \in H$, since $H$ is a subgroup of $G$. But $zh = x(ah)$ and $xh = z(a^{-1}h)$ for all $h \in H$. Therefore $zH \subset xH$ and $xH \subset zH$, and thus $xH = zH$. Similarly $yH = zH$, and thus $xH = yH$, as required.
|
||||||
\end{proof}
|
\end{proof}
|
||||||
|
|
||||||
\begin{figure}[htbp]
|
\begin{figure}[htbp]
|
||||||
@@ -580,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}%
|
||||||
|
|
||||||
@@ -612,13 +678,13 @@ 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?}
|
||||||
This template is aimed at who are not a complete beginner for \LaTeX{}. Please learn more about \LaTeX{} before using this template.
|
This template is aimed at who are not a complete beginner for \LaTeX. Please learn more about \LaTeX\ before using this template.
|
||||||
\item \question{Is the language for code highlighting optional?}
|
\item \question{Is the language for code highlighting optional?}
|
||||||
Yes, \lstinline{listings} package is used in ElegantBook, hence language is optional(e.g. \lstinline{language=Python}). For global setting, use \lstinline{lstset}. For more information, please refer to package documentations.
|
Yes, \lstinline{listings} package is used in ElegantBook, hence language is optional(e.g. \lstinline{language=Python}). For global setting, use \lstinline{lstset}. For more information, please refer to package documentations.
|
||||||
\item \question{When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?}
|
\item \question{When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?}
|
||||||
@@ -628,11 +694,40 @@ 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.}
|
||||||
|
|
||||||
|
\begin{change}
|
||||||
|
\item Add custome theorem definition command \lstinline{\elegantnewtheorem};
|
||||||
|
\item Fix star environment(*) for inner environments (\href{https://github.com/ElegantLaTeX/ElegantBook/issues/167}{issue \#167});
|
||||||
|
\item Change English fonts from TeX Gyre Termes to TeX Gyre TermesX;
|
||||||
|
\item Re-construct some theorem environments to enchance compatibility;
|
||||||
|
\item Remove Gitee repo due the privacy policy;
|
||||||
|
\item Re-open Github pull requests.
|
||||||
|
\end{change}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\datechange{2022/04/09}{release of v4.3.}
|
\datechange{2022/04/09}{release of v4.3.}
|
||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item Remove part newtx settings, set TeX Gyre Terms/Heros fonts under \hologo{XeLaTeX}.
|
\item Remove part newtx settings, set TeX Gyre Termes/Heros fonts under \hologo{XeLaTeX}.
|
||||||
\item Fix Chinese fonts in the theorem environments.
|
\item Fix Chinese fonts in the theorem environments.
|
||||||
\item Add theorem counter option, \lstinline{thmcnt=section}.
|
\item Add theorem counter option, \lstinline{thmcnt=section}.
|
||||||
\item Add bib option \lstinline{bibend}, which can take value of biber and bibtex.
|
\item Add bib option \lstinline{bibend}, which can take value of biber and bibtex.
|
||||||
@@ -666,7 +761,7 @@ We revised our templates now and then. This section shows the version story of E
|
|||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item \textbf{! Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates.
|
\item \textbf{! Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates.
|
||||||
\item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX{} Live 2020.
|
\item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX~Live 2020.
|
||||||
\item Fix spacing problem in some environments.
|
\item Fix spacing problem in some environments.
|
||||||
\item Introduce language option for Italian, \lstinline{lang=it}.
|
\item Introduce language option for Italian, \lstinline{lang=it}.
|
||||||
\end{change}
|
\end{change}
|
||||||
@@ -676,7 +771,7 @@ We revised our templates now and then. This section shows the version story of E
|
|||||||
|
|
||||||
\begin{change}
|
\begin{change}
|
||||||
\item Introduce \lstinline{math} for math font, optional styles are \lstinline{newtx} and \lstinline{cm}.\\
|
\item Introduce \lstinline{math} for math font, optional styles are \lstinline{newtx} and \lstinline{cm}.\\
|
||||||
\textbf{Notice}: The math font \lstinline{newtxmath} in previous versions is reset to default \LaTeX{} math font, to keep previous math font, please declare \lstinline{math=newtx}.
|
\textbf{Notice}: The math font \lstinline{newtxmath} in previous versions is reset to default \LaTeX\ math font, to keep previous math font, please declare \lstinline{math=newtx}.
|
||||||
\item Introduce \lstinline{chinesefont} option, with \lstinline{founder}, \lstinline{ctexfont} and \lstinline{nofont} available.
|
\item Introduce \lstinline{chinesefont} option, with \lstinline{founder}, \lstinline{ctexfont} and \lstinline{nofont} available.
|
||||||
\item Turn author information on the cover optional and add customized command \lstinline{\bioinfo}.
|
\item Turn author information on the cover optional and add customized command \lstinline{\bioinfo}.
|
||||||
\item Add version history with command \lstinline{\datechange} and environment \lstinline{change}.
|
\item Add version history with command \lstinline{\datechange} and environment \lstinline{change}.
|
||||||
@@ -697,12 +792,12 @@ We revised our templates now and then. This section shows the version story of E
|
|||||||
\item Revise \lstinline{problemset}.
|
\item Revise \lstinline{problemset}.
|
||||||
\end{change}
|
\end{change}
|
||||||
|
|
||||||
|
|
||||||
\nocite{en2,en3}
|
\nocite{en2,en3}
|
||||||
|
|
||||||
\printbibliography[heading=bibintoc, title=\ebibname]
|
\printbibliography[heading=bibintoc, title=\ebibname]
|
||||||
|
|
||||||
\appendix
|
\appendix
|
||||||
% \renewcommand\chaptername{\eappendix \thechapter}
|
|
||||||
|
|
||||||
\chapter{Mathematical Tools}
|
\chapter{Mathematical Tools}
|
||||||
|
|
||||||
|
|||||||
364
elegantbook.cls
364
elegantbook.cls
@@ -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}}
|
||||||
@@ -123,6 +121,10 @@
|
|||||||
pdfborder={0 0 0},
|
pdfborder={0 0 0},
|
||||||
linktocpage
|
linktocpage
|
||||||
}
|
}
|
||||||
|
\newif\ifELEGANT@Hy@later
|
||||||
|
\@ifpackagelater{hyperref}{2022/05/16}
|
||||||
|
{\ELEGANT@Hy@latertrue}
|
||||||
|
{\ELEGANT@Hy@laterfalse}
|
||||||
|
|
||||||
%% device settings
|
%% device settings
|
||||||
\RequirePackage{geometry}
|
\RequirePackage{geometry}
|
||||||
@@ -165,13 +167,16 @@
|
|||||||
\PassOptionsToPackage{quiet}{fontspec}
|
\PassOptionsToPackage{quiet}{fontspec}
|
||||||
\RequirePackage{iftex}
|
\RequirePackage{iftex}
|
||||||
|
|
||||||
\ifXeTeX
|
\ifpdftex
|
||||||
|
\RequirePackage{newtxtext}
|
||||||
|
\RequirePackage[scaled=.90]{helvet}
|
||||||
|
\else
|
||||||
\RequirePackage[no-math]{fontspec}
|
\RequirePackage[no-math]{fontspec}
|
||||||
\setmainfont{texgyretermes}[
|
\setmainfont{TeXGyreTermesX}[
|
||||||
UprightFont = *-regular ,
|
UprightFont = *-Regular ,
|
||||||
BoldFont = *-bold ,
|
BoldFont = *-Bold ,
|
||||||
ItalicFont = *-italic ,
|
ItalicFont = *-Italic ,
|
||||||
BoldItalicFont = *-bolditalic ,
|
BoldItalicFont = *-BoldItalic ,
|
||||||
Extension = .otf ,
|
Extension = .otf ,
|
||||||
Scale = 1.0]
|
Scale = 1.0]
|
||||||
|
|
||||||
@@ -182,14 +187,11 @@
|
|||||||
BoldItalicFont = *-bolditalic ,
|
BoldItalicFont = *-bolditalic ,
|
||||||
Extension = .otf ,
|
Extension = .otf ,
|
||||||
Scale = 0.9]
|
Scale = 0.9]
|
||||||
\else
|
|
||||||
\RequirePackage{newtxtext}
|
|
||||||
\RequirePackage[scaled=.90]{helvet}
|
|
||||||
\fi
|
\fi
|
||||||
|
|
||||||
\ifdefstring{\ELEGANT@lang}{cn}{
|
\ifdefstring{\ELEGANT@lang}{cn}{
|
||||||
\ifdefstring{\ELEGANT@chinesefont}{founder}{
|
\ifdefstring{\ELEGANT@chinesefont}{founder}{
|
||||||
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
|
\RequirePackage[UTF8, scheme=plain, fontset=none]{ctex}
|
||||||
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
|
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
|
||||||
\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
|
\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
|
||||||
\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
|
\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
|
||||||
@@ -203,10 +205,14 @@
|
|||||||
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
|
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
|
||||||
|
|
||||||
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
|
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
|
||||||
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}
|
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
|
||||||
|
\xeCJKsetup{AutoFakeBold=true}
|
||||||
|
}{\relax}
|
||||||
|
|
||||||
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
|
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
|
||||||
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
|
\RequirePackage[UTF8,scheme=plain]{ctex}
|
||||||
|
\xeCJKsetup{AutoFakeBold=true}
|
||||||
|
}{\relax}
|
||||||
|
|
||||||
\AfterEndPreamble{
|
\AfterEndPreamble{
|
||||||
\setlength\parindent{2\ccwd}}
|
\setlength\parindent{2\ccwd}}
|
||||||
@@ -238,7 +244,19 @@
|
|||||||
|
|
||||||
\RequirePackage{anyfontsize}
|
\RequirePackage{anyfontsize}
|
||||||
\ifdefstring{\ELEGANT@math}{newtx}{
|
\ifdefstring{\ELEGANT@math}{newtx}{
|
||||||
|
\let\oldencodingdefault\encodingdefault
|
||||||
|
\let\oldrmdefault\rmdefault
|
||||||
|
\let\oldsfdefault\sfdefault
|
||||||
|
\let\oldttdefault\ttdefault
|
||||||
|
\def\encodingdefault{T1}
|
||||||
|
\renewcommand{\rmdefault}{ntxtlf}
|
||||||
|
\renewcommand{\sfdefault}{qhv}
|
||||||
|
\renewcommand{\ttdefault}{ntxtt}
|
||||||
\RequirePackage{newtxmath}
|
\RequirePackage{newtxmath}
|
||||||
|
\let\encodingdefault\oldencodingdefault
|
||||||
|
\let\rmdefault\oldrmdefault
|
||||||
|
\let\sfdefault\oldsfdefault
|
||||||
|
\let\ttdefault\oldttdefault
|
||||||
\let\Bbbk\relax
|
\let\Bbbk\relax
|
||||||
\RequirePackage{esint}
|
\RequirePackage{esint}
|
||||||
%%% use yhmath pkg, uncomment following code
|
%%% use yhmath pkg, uncomment following code
|
||||||
@@ -387,7 +405,6 @@
|
|||||||
backend=\ELEGANT@bibend,
|
backend=\ELEGANT@bibend,
|
||||||
citestyle=\ELEGANT@citestyle,
|
citestyle=\ELEGANT@citestyle,
|
||||||
bibstyle=\ELEGANT@bibstyle]{biblatex}
|
bibstyle=\ELEGANT@bibstyle]{biblatex}
|
||||||
\defbibheading{elegantbook}[\ebibname]{#1}
|
|
||||||
|
|
||||||
\ifdefstring{\ELEGANT@lang}{cn}{
|
\ifdefstring{\ELEGANT@lang}{cn}{
|
||||||
\renewcommand{\baselinestretch}{1.3}
|
\renewcommand{\baselinestretch}{1.3}
|
||||||
@@ -833,8 +850,22 @@
|
|||||||
\ifdefstring{\ELEGANT@lang}{cn}{
|
\ifdefstring{\ELEGANT@lang}{cn}{
|
||||||
\ifdefstring{\ELEGANT@scheme}{chinese}{
|
\ifdefstring{\ELEGANT@scheme}{chinese}{
|
||||||
\newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{
|
\newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{
|
||||||
\newcommand{\xchaptertitle}{第 \thechapter{} 章}} }{
|
\newcommand{\xchaptertitle}{第 \thechapter{} 章}}
|
||||||
\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
% Hyperref 2022/05/16's changelog.txt said
|
||||||
|
% * nameref is loaded always and earlier (issue#235)
|
||||||
|
\AtBeginDocument{
|
||||||
|
\ifELEGANT@Hy@later
|
||||||
|
\patchcmd{\NR@chapter}%
|
||||||
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
|
{}{\fail}
|
||||||
|
\else
|
||||||
|
\patchcmd{\Hy@org@chapter}%
|
||||||
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
|
{}{\fail}
|
||||||
|
\fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
||||||
|
|
||||||
\setcounter{secnumdepth}{5}
|
\setcounter{secnumdepth}{5}
|
||||||
\titleformat{\chapter}[\style]{\bfseries}{
|
\titleformat{\chapter}[\style]{\bfseries}{
|
||||||
@@ -855,11 +886,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%define the note and proof environment
|
%%define the
|
||||||
|
%%definition theorem postulate axiom corollary lemma proposition
|
||||||
|
%%and proof environment
|
||||||
\RequirePackage{pifont,manfnt,bbding}
|
\RequirePackage{pifont,manfnt,bbding}
|
||||||
\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={
|
||||||
@@ -899,49 +945,94 @@
|
|||||||
overlay unbroken and last={
|
overlay unbroken and last={
|
||||||
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
|
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
|
||||||
\textcolor{second}{$\heartsuit$}};}},
|
\textcolor{second}{$\heartsuit$}};}},
|
||||||
propstyle/.style={
|
prostyle/.style={
|
||||||
common,
|
common,
|
||||||
colframe=third,
|
colframe=third,
|
||||||
colback=third!5,
|
colback=third!5,
|
||||||
colbacktitle=third,
|
colbacktitle=third,
|
||||||
overlay unbroken and last={
|
overlay unbroken and last={
|
||||||
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
|
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
|
||||||
\textcolor{third}{$\spadesuit$}};}},}
|
\textcolor{third}{$\spadesuit$}};}},
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def}
|
ELEGANT@title/.code n args={2}
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ o t\label g }{
|
{
|
||||||
common,defstyle,
|
|
||||||
IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter},
|
\tcbset
|
||||||
IfBooleanTF={#2}{label=#3}{}}
|
{
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm}
|
title=
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{theorem}{ o t\label g }{
|
{
|
||||||
common,thmstyle,
|
\csname #1name\endcsname~%
|
||||||
IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter},
|
\ifdef{\thetcbcounter}{\thetcbcounter}{}%
|
||||||
IfBooleanTF={#2}{label=#3}{}}
|
\ifblank{#2}{}{\ (#2)}
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos}
|
}
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{postulate}{ o t\label g }{
|
}
|
||||||
common,thmstyle,
|
},
|
||||||
IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter},
|
ELEGANT@label/.code n args={2}
|
||||||
IfBooleanTF={#2}{label=#3}{}}
|
{
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi}
|
\ifblank{#2}
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{axiom}{ o t\label g }{
|
{}{\tcbset{label={#1:#2}}}
|
||||||
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}
|
% define an internal control sequence \ELEGANT@newtheorem for fancy mode's newtheorem
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{corollary}{ o t\label g }{
|
% #1 is the environment name, #2 is the prefix of label, #3 is the style
|
||||||
common,thmstyle,
|
% style: thmstyle, defstyle, prostyle
|
||||||
IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter},
|
% e.g. \ELEGANT@newtheorem{theorem}{thm}{thmstyle}
|
||||||
IfBooleanTF={#2}{label=#3}{}}
|
% will define two environments: numbered ``theorem'' and no-numbered ``theorem*''
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem}
|
% WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition,
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{lemma}{ o t\label g }{
|
% WARNING FOR MULTILINGUAL: it should be defined in language settings.
|
||||||
common,thmstyle,
|
\NewDocumentCommand \ELEGANT@newtheorem { m m m O{} }{
|
||||||
IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter},
|
\ifcsundef{#1name}{%
|
||||||
IfBooleanTF={#2}{label=#3}{}}
|
\ClassError{elegantbook}{%
|
||||||
% \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro}
|
\ #1name undefined, \MessageBreak
|
||||||
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ o t\label g }{
|
Please check in language setting
|
||||||
common,propstyle,
|
}{}
|
||||||
IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter},
|
}{\relax}
|
||||||
IfBooleanTF={#2}{label=#3}{}}}{\relax}
|
\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,
|
||||||
|
IfValueTF={##1}
|
||||||
|
{ELEGANT@title={#1}{##1}}
|
||||||
|
{
|
||||||
|
IfValueTF={##2}
|
||||||
|
{ELEGANT@title={#1}{##2}}
|
||||||
|
{ELEGANT@title={#1}{}}
|
||||||
|
},
|
||||||
|
IfValueT={##4}
|
||||||
|
{
|
||||||
|
IfBooleanTF={##3}
|
||||||
|
{label={##4}}
|
||||||
|
{ELEGANT@label={#2}{##4}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\DeclareTColorBox{#1*}{ g o }{
|
||||||
|
common,#3,
|
||||||
|
IfValueTF={##1}
|
||||||
|
{ELEGANT@title={#1}{##1}}
|
||||||
|
{
|
||||||
|
IfValueTF={##2}
|
||||||
|
{ELEGANT@title={#1}{##2}}
|
||||||
|
{ELEGANT@title={#1}{}}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
% define several environment
|
||||||
|
% we define headers like \definitionname before
|
||||||
|
\ELEGANT@newtheorem{theorem}{thm}{thmstyle}
|
||||||
|
\ELEGANT@newtheorem{definition}{def}{defstyle}
|
||||||
|
\ELEGANT@newtheorem{postulate}{pos}{thmstyle}
|
||||||
|
\ELEGANT@newtheorem{axiom}{axi}{thmstyle}
|
||||||
|
\ELEGANT@newtheorem{corollary}{cor}{thmstyle}
|
||||||
|
\ELEGANT@newtheorem{lemma}{lem}{thmstyle}
|
||||||
|
\ELEGANT@newtheorem{proposition}{pro}{prostyle}
|
||||||
|
}{\relax}
|
||||||
|
|
||||||
|
|
||||||
\ifdefstring{\ELEGANT@mode}{simple}{
|
\ifdefstring{\ELEGANT@mode}{simple}{
|
||||||
@@ -951,7 +1042,7 @@
|
|||||||
% \let\proofname\relax
|
% \let\proofname\relax
|
||||||
\let\endproof\relax
|
\let\endproof\relax
|
||||||
|
|
||||||
% declare a new theorem style
|
% declare new theorem styles: defstyle, thmstyle, prostyle
|
||||||
\newtheoremstyle{defstyle}{3pt}{3pt}{\citshape}{-3pt}{
|
\newtheoremstyle{defstyle}{3pt}{3pt}{\citshape}{-3pt}{
|
||||||
\bfseries\color{main}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
|
\bfseries\color{main}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
|
||||||
\newtheoremstyle{thmstyle}{3pt}{3pt}{\citshape}{-3pt}{
|
\newtheoremstyle{thmstyle}{3pt}{3pt}{\citshape}{-3pt}{
|
||||||
@@ -959,21 +1050,105 @@
|
|||||||
\newtheoremstyle{prostyle}{3pt}{3pt}{\citshape}{-3pt}{
|
\newtheoremstyle{prostyle}{3pt}{3pt}{\citshape}{-3pt}{
|
||||||
\bfseries\color{third}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
|
\bfseries\color{third}}{}{0.5em}{\thmname{#1} \thmnumber{#2} \thmnote{(#3)}}
|
||||||
|
|
||||||
|
% define an internal control sequence \ELEGANT@newtheorem for simple mode's newtheorem
|
||||||
|
% #1 is the environment name, #2 is the style
|
||||||
|
% style: thmstyle, defstyle, prostyle
|
||||||
|
% e.g. \ELEGANT@newtheorem{theorem}{thmstyle}
|
||||||
|
% will define two environments: numbered ``theorem'' and no-numbered ``theorem*''
|
||||||
|
% WARNING FOR MULTILINGUAL: this cs will automatically find \theoremname's definition,
|
||||||
|
% WARNING FOR MULTILINGUAL: it should be defined in language settings.
|
||||||
|
\NewDocumentCommand \ELEGANT@newtheorem { m m O{} } {
|
||||||
|
\theoremstyle{#2}
|
||||||
|
\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}
|
||||||
|
}
|
||||||
|
|
||||||
\theoremstyle{defstyle} % definition style
|
% define several environment
|
||||||
\newtheorem{definition}{\definitionname}[\ELEGANT@thmcnt]
|
% we define headers like \definitionname before
|
||||||
|
\ELEGANT@newtheorem{theorem}{thmstyle}
|
||||||
\theoremstyle{thmstyle} %theorem style
|
\ELEGANT@newtheorem{definition}{defstyle}
|
||||||
\newtheorem{theorem}{\theoremname}[\ELEGANT@thmcnt]
|
\ELEGANT@newtheorem{postulate}{thmstyle}
|
||||||
\newtheorem{lemma}{\lemmaname}[\ELEGANT@thmcnt]
|
\ELEGANT@newtheorem{axiom}{thmstyle}
|
||||||
\newtheorem{corollary}{\corollaryname}[\ELEGANT@thmcnt]
|
\ELEGANT@newtheorem{corollary}{thmstyle}
|
||||||
\newtheorem{postulate}{\postulatename}[\ELEGANT@thmcnt]
|
\ELEGANT@newtheorem{lemma}{thmstyle}
|
||||||
\newtheorem{axiom}{\axiomname}[\ELEGANT@thmcnt]
|
\ELEGANT@newtheorem{proposition}{prostyle}
|
||||||
|
|
||||||
\theoremstyle{prostyle} % proposition style
|
|
||||||
\newtheorem{proposition}{\propositionname}[\ELEGANT@thmcnt]
|
|
||||||
}{\relax}
|
}{\relax}
|
||||||
|
|
||||||
|
% define an user control sequence \elegantnewtheorem
|
||||||
|
% #1 is the evironment, #2 is the theorem header
|
||||||
|
% #3 is the style #4 is the prefix for fancy mode
|
||||||
|
% style: thmstyle, defstyle, prostyle
|
||||||
|
% if #4 is given in simple mode, an error will be raised
|
||||||
|
% if #4 isn't given in fancy mode, the prefix will be set equal to #1,
|
||||||
|
% and a warning will be raised
|
||||||
|
\newcommand{\ELEGANT@newtheorem@warning}{}
|
||||||
|
\newcommand{\ELEGANT@newtheorem@error}{}
|
||||||
|
\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}{
|
||||||
|
\ClassWarning{elegantbook}{%
|
||||||
|
Because you didn't provide a prefix, \MessageBreak
|
||||||
|
we use #1 as the default prefix. \MessageBreak
|
||||||
|
You have to use \MessageBreak
|
||||||
|
\ref{#1:label} to refer a \MessageBreak
|
||||||
|
\begin{#1}{name}{label} environment. \MessageBreak
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\renewcommand{\ELEGANT@newtheorem@error}{
|
||||||
|
\ClassError{elegantbook}{%
|
||||||
|
You can't set a prefix in mode ``simple''.\MessageBreak
|
||||||
|
Just use \MessageBreak
|
||||||
|
\elegantnewtheorem{#1}{#2}{#3}
|
||||||
|
}{%
|
||||||
|
We are using ``amsthm'' package to \MessageBreak
|
||||||
|
generate theorem-like theorem. \MessageBreak
|
||||||
|
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}
|
||||||
|
\ifdefstring{\ELEGANT@mode}{simple}{%
|
||||||
|
\IfValueTF{#4}
|
||||||
|
{\ELEGANT@newtheorem@error}
|
||||||
|
{\ELEGANT@newtheorem{#1}{#3}[\ELEGANT@tmp@tl]}
|
||||||
|
}{\relax}
|
||||||
|
\ifdefstring{\ELEGANT@mode}{fancy}{%
|
||||||
|
\IfValueTF{#4}
|
||||||
|
{
|
||||||
|
\def\ELEGANT@temp@prefix{#4}
|
||||||
|
\ifdefempty{\ELEGANT@temp@prefix}
|
||||||
|
{
|
||||||
|
\ELEGANT@newtheorem{#1}{#1}{#3}[\ELEGANT@tmp@tl]
|
||||||
|
\ELEGANT@newtheorem@warning
|
||||||
|
}
|
||||||
|
{\ELEGANT@newtheorem{#1}{#4}{#3}[\ELEGANT@tmp@tl]}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
\ELEGANT@newtheorem{#1}{#1}{#3}[\ELEGANT@tmp@tl]
|
||||||
|
\ELEGANT@newtheorem@warning
|
||||||
|
}
|
||||||
|
}{\relax}
|
||||||
|
}
|
||||||
|
|
||||||
% main(green-def): example exercise problem solution
|
% main(green-def): example exercise problem solution
|
||||||
% second(orange-thm): proof note remark
|
% second(orange-thm): proof note remark
|
||||||
% third(blue-prop): assumptions property conclusion custom
|
% third(blue-prop): assumptions property conclusion custom
|
||||||
@@ -1045,6 +1220,7 @@
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
\newenvironment{introduction}[1][\introductionname]{
|
\newenvironment{introduction}[1][\introductionname]{
|
||||||
\begin{tcolorbox}[introductionsty,title={#1}]
|
\begin{tcolorbox}[introductionsty,title={#1}]
|
||||||
\begin{multicols}{2}
|
\begin{multicols}{2}
|
||||||
@@ -1192,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,hypersetup,mainmatter,frontmatter,tableofcontents,elegantpar,heiti,kaishu,lstset,pagecolor,zhnumber,marginpar,part,equote,marginnote,bioinfo,datechange,listofchange,lvert,lastpage,songti,heiti,fangsong,setCJKfamilyfont,textbf},
|
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},
|
||||||
@@ -1233,7 +1409,7 @@
|
|||||||
\begin{enumerate}[label=\small\protect\circled{\arabic*}]}{
|
\begin{enumerate}[label=\small\protect\circled{\arabic*}]}{
|
||||||
\end{enumerate}}
|
\end{enumerate}}
|
||||||
|
|
||||||
\addbibresource[location=local]{reference.bib}
|
|
||||||
|
|
||||||
\renewcommand\tableofcontents{%
|
\renewcommand\tableofcontents{%
|
||||||
\hypersetup{linktoc=all, linkcolor=black}
|
\hypersetup{linktoc=all, linkcolor=black}
|
||||||
@@ -1251,7 +1427,8 @@
|
|||||||
\@starttoc{toc}
|
\@starttoc{toc}
|
||||||
\end{multicols}}{
|
\end{multicols}}{
|
||||||
\@starttoc{toc}}
|
\@starttoc{toc}}
|
||||||
\if@restonecol\twocolumn\fi}
|
\if@restonecol\twocolumn\fi
|
||||||
|
\hypersetup{linkcolor=winered}}
|
||||||
|
|
||||||
|
|
||||||
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
|
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
|
||||||
@@ -1262,13 +1439,26 @@
|
|||||||
|
|
||||||
|
|
||||||
% https://tex.stackexchange.com/questions/56839/chaptername-is-used-even-for-appendix-chapters-in-toc
|
% https://tex.stackexchange.com/questions/56839/chaptername-is-used-even-for-appendix-chapters-in-toc
|
||||||
\usepackage{calc}
|
\RequirePackage{calc}
|
||||||
\usepackage[titles]{tocloft}
|
\RequirePackage[titles]{tocloft}
|
||||||
\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
|
||||||
|
\ifELEGANT@Hy@later
|
||||||
|
\patchcmd{\NR@chapter}%
|
||||||
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
|
{}{\fail}
|
||||||
|
\else
|
||||||
|
\patchcmd{\Hy@org@chapter}%
|
||||||
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
|
{}{\fail}
|
||||||
|
\fi
|
||||||
\addtocontents{toc}{%
|
\addtocontents{toc}{%
|
||||||
\protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
|
\protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
|
||||||
\protect\renewcommand{\protect\cftchapaftersnum}{}%
|
\protect\renewcommand{\protect\cftchapaftersnum}{}%
|
||||||
|
|||||||
Reference in New Issue
Block a user