This commit is contained in:
EthanDeng
2022-04-09 12:06:53 +08:00
5 changed files with 245 additions and 178 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@@ -11,6 +11,7 @@
*.cb
*.cb2
.*.lb
.DS_Store
clean.bat
elegant*-cn.pdf
elegant*-en.pdf

View File

@@ -1,12 +1,16 @@
\documentclass[lang=cn,10pt]{elegantbook}
<<<<<<< HEAD
=======
>>>>>>> 7f1dedd79f9abc217ad4d62ac36c6ca3fd8eecc0
\title{ElegantBook优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作}
\author{Ethan Deng \& Liam Huang}
\institute{Elegant\LaTeX{} Program}
\date{March 8, 2022}
\version{4.2}
\date{April 9, 2022}
\version{4.3}
\bioinfo{自定义}{信息}
\extrainfo{不要以为抹消过去,重新来过,即可发生什么改变。—— 比企谷八幡}
@@ -16,31 +20,11 @@
\logo{logo-blue.png}
\cover{cover.jpg}
\usepackage{lmodern}
\setmainfont{texgyretermes}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 1.0]
\setsansfont{texgyreheros}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 1.0]
\usepackage[]{newtxmath}
% 本文档命令
\usepackage{array}
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
% 修改标题页的橙色带
% \definecolor{customcolor}{RGB}{32,178,170}
% \colorlet{coverlinecolor}{customcolor}
@@ -59,54 +43,53 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模
我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 Elegant\LaTeX{} 相关内容。
\begin{itemize}
\item 官网:\href{https://elegantlatex.org/}{https://elegantlatex.org/}
\item GitHub 址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}
\item 官网:\href{https://elegantlatex.org/}{https://elegantlatex.org/}(暂时歇业)
\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 下载地址:\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{正式发行版}\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版}
\item 微博Elegant\LaTeX{}
\item 微信公众号Elegant\LaTeX{}
\item 用户 QQ 群692108391
\item 微博Elegant\LaTeX{}(密码有点忘了)
\item 微信公众号Elegant\LaTeX{}(不定期更新)
\item 用户 QQ 群692108391(建议加群)
\item 邮件:\email{elegantlatex2e@gmail.com}
\end{itemize}
\textsf{hello world 中文输入法,英文 English is not good for me}
\section{模板安装与更新}
你可以通过免安装的方式使用本模板,包括在线使用和本地(文件夹内)使用两种方式,也可以通过 \TeX{} 发行版安装使用。
\subsection{在线使用模板}
我们把三套模板全部上传到 \href{https://www.overleaf.com/}{Overleaf} 上了,网络便利的用户可以直接通过 Overleaf 在线使用我们的模板。使用 Overleaf 的好处是无需安装 \TeX{} Live 2020,可以随时随地访问自己的文件。查找模板,请在 Overleaf 模板库里面搜索 \lstinline{elegantlatex} 即可,你也可以直接访问\href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{搜索结果}。选择适当的模板之后,将其 \lstinline{Open as Template},即可把模板存到自己账户下,然后可以自由编辑以及与别人一起协作。更多关于 Overleaf 的介绍和使用,请参考 Overleaf 的\href{https://www.overleaf.com/learn}{官方文档}
\begin{remark}
Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议使用 \hologo{pdfLaTeX} 编译。
\end{remark}
我们把三套模板全部上传到 \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{本地免安装使用}
\textbf{免安装}使用方法如下从 GitHub 或者 CTAN 下载最新版,严格意义上只需要类文件 \lstinline{elegantbook.cls}。然后将模板文件放在你的工作目录下即可使用。这样使用的好处是,无需安装,简便;缺点是,当模板更新之后,你需要手动替换 \lstinline{cls} 文件。
\textbf{免安装}使用方法如下从 GitHub 或者 CTAN 下载最新版,严格意义上只需要类文件 \lstinline{elegantbook.cls}。然后将模板文件放在你的工作目录下即可使用。这样使用的好处是,无需安装,简便;缺点是,当模板更新之后,你需要手动替换 \lstinline{cls} 文件。
\subsection{发行版安装使用}
\subsection{发行版安装与更新}
本模板测试环境为 Win10 和 TeX Live 2021如果你刚安装 \TeX{} Live 2021 用户,安装后建议升级全部宏包,升级方法:使用 cmd 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新。
本模板测试环境为
\begin{enumerate}
\item Win10 + \TeX{} Live 2022
\item Ubuntu 20.04 + \TeX{} Live 2022
\item macOS Monterey + Mac\TeX{} 2022。
\end{enumerate}
\subsection{更新问题}
\TeX Live/Mac\TeX{} 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}
如果使用 \lstinline{tlshell} 无法更新模板,请使用命令行全部更新全部宏包或者使用免安装的方法使用本模板。
通过命令行(管理员权限)输入下面的命令对 tlmgr 自身和全部宏包进行更新。
安装 \TeX{} Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即
\begin{lstlisting}
tlmgr update --self
tlmgr update --all
tlmgr update --self
tlmgr update --all
tlmgr update --self --all --reinstall-forcibly-removed
\end{lstlisting}
更多的内容请参考 \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?}
\subsection{其他发行版本}
由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live。更多关于 \TeX{} Live 的安装使用以及 C\TeX{}\TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}
由于宏包版本问题,本模板不支持 C\TeX{} 套装,请务必安装 TeX Live/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{}\TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}
\section{关于提交}
@@ -116,7 +99,7 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\chapter{ElegantBook 设置说明}
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8推荐使用 \TeX{} Live 编译。本文编写环境为 Win10 (64bit) + \TeX{} Live 2021英文支持 \hologo{pdfLaTeX},中文仅支持 \hologo{XeLaTeX} 编译。
本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8推荐使用 \TeX{} Live 编译。
\section{语言模式}
本模板内含两套基础语言环境 \lstinline{lang=cn}\lstinline{lang=en}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
@@ -125,7 +108,7 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\documentclass[lang=cn]{elegantbook}
\end{lstlisting}
除模板自带的两套语言设定之外,由网友提供的其他语言环境设置如下:
除模板自带的两套语言设定之外,由\textbf{网友}提供的其他语言环境设置如下:
\begin{itemize}
\item\href{https://github.com/VincentMVV}{VincentMVV} 提供的意大利语翻译 \lstinline{lang=it},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}
\item\href{https://github.com/abfek66}{abfek66} 提供的法语翻译 \lstinline{lang=fr},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/85}{Italian translation}
@@ -159,6 +142,7 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\documentclass[color=green]{elegantbook}
\end{lstlisting}
\begin{table}[htbp]
\caption{ElegantBook 模板中的颜色主题\label{tab:color thm}}
\centering
@@ -234,8 +218,8 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
封面中间位置的色块的颜色可以使用下面命令进行修改:
\begin{lstlisting}
\definecolor{customcolor}{RGB}{32,178,170}
\colorlet{coverlinecolor}{customcolor}
\definecolor{customcolor}{RGB}{32,178,170}
\colorlet{coverlinecolor}{customcolor}
\end{lstlisting}
\subsection{封面图}
@@ -357,6 +341,17 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
% \caption{disjoint decomposition}\label{algo_disjdecomp}
% \end{algorithm}
\subsection{修改计数器}
当前定理等环境计数器按章计数,如果想修改定理类环境按节计数,可以修改计数器选项 thmcnt
\begin{lstlisting}
\documentclass[section]{elegantbook} %or
\documentclass[thmcnt=section]{elegantbook}
\end{lstlisting}
\subsection{其他环境的使用}
其他三种环境没有选项,可以直接使用,比如 \lstinline{example} 环境的使用方法与效果:
@@ -406,12 +401,18 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\end{minipage}
\section{参考文献}
文献部分,本模板调用了 biblatex 宏包,并提供了 biber默认 和 bibtex 两个后端选项,可以使用 \lstinline{bibend} 进行修改:
此模板使用了 \hologo{biber} 来生成参考文献,也即使用 \lstinline{biblatex} 宏包,在中文示例中,使用了 \lstinline{gbt7714} 宏包。参考文献示例:\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。
\begin{lstlisting}
\documentclass[bibtex]{elegantbook}
\documentclass[bibend=bibtex]{elegantbook}
\end{lstlisting}
你可以在谷歌学术MendeleyEndnote 中获得文献条目bib item,然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候引用它们的键值bib key即可。注意需要在编译的过程中添加 \hologo{biber} 编译。
关于文献条目bib item你可以在谷歌学术MendeleyEndnote 中,然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候引用它们的键值bib key即可。
为了方便文献样式修改,模板引入了 \lstinline{bibstyle}\lstinline{citestyle} 选项默认均为数字格式numeric如果需要设置为国标 GB7714-2015需要使用
为了方便文献样式修改,模板引入了 \lstinline{bibstyle}\lstinline{citestyle} 选项默认均为数字格式numeric参考文献示例:\cite{cn1,en2,en3} 使用了中国一个大型的 P2P 平台(人人贷)的数据来检验男性投资者和女性投资者在投资表现上是否有显著差异。
如果需要设置为国标 GB7714-2015需要使用
\begin{lstlisting}
\documentclass[citestyle=gb7714-2015, bibstyle=gb7714-2015]{elegantbook}
\end{lstlisting}
@@ -606,8 +607,8 @@ LaTeX Error:
模板从 3.10 版本提供中文字体选项 \lstinline{chinesefont},可选项有
\begin{enumerate}
\item \lstinline{ctexfont}:默认选项,使用 \lstinline{ctex} 宏包根据系统自行选择字体,可能存在字体缺失的问题,更多内容参考 \lstinline{ctex} 宏包\href{https://ctan.org/pkg/ctex}{官方文档}\footnote{可以使用命令提示符,输入 \lstinline{texdoc ctex} 调出本地 \lstinline{ctex} 宏包文档}
\item \lstinline{founder}:方正字体选项调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,然后设置字体为方正四款免费字体,方正字体下载注意事项见后文。
\item \lstinline{nofont}:调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
\item \lstinline{founder}:方正字体选项\textbf{需要安装方正字体}),后台调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,然后设置字体为方正四款免费字体,方正字体下载注意事项见后文,用户只需要安装方正字体即可使用该选项
\item \lstinline{nofont}后台会调用 \lstinline{ctex} 宏包并且使用 \lstinline{fontset=none} 选项,不设定中文字体,用户可以自行设置中文字体,具体见后文。
\end{enumerate}
\begin{remark}
@@ -626,12 +627,12 @@ LaTeX Error:
如果你想完全自定义字体\footnote{这里仍然以方正字体为例。},你可以选择 \lstinline{chinesefont=nofont},然后在导言区设置
\begin{lstlisting}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}{FZKai-Z03}
\setCJKfamilyfont{zhfs}{FZFangSong-Z02}
\setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
@@ -660,7 +661,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
我们将通过三个步骤定义可测函数的积分。首先定义非负简单函数的积分。以下设 $E$$\mathcal{R}^n$ 中的可测集。
\begin{definition}[可积性] \label{def:int}
$ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$$E$ 上的非负简单函数,其中 $\{A_1,A_2,\ldots,A_k\}$$E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$$E$ 上的积分为 $\int_{a}^b f(x)$
$ f(x)=\sum\limits_{i=1}^{k} a_i \chi_{A_i}(x)$$E$ 上的\textbf{非负简单函数},中文其中 $\{A_1,A_2,\ldots,A_k\}$$E$ 上的一个可测分割,$a_1,a_2,\ldots,a_k$ 是非负实数。定义 $f$$E$ 上的积分为 $\int_{a}^b f(x)$
\begin{equation}
\label{inter}
\int_{E} f dx = \sum_{i=1}^k a_i m(A_i) \pi \alpha\beta\sigma\gamma\nu\xi\epsilon\varepsilon. \oint_{a}^b\ointop_{a}^b\prod_{i=1}^n
@@ -754,10 +755,10 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
见前文介绍,可以使用 \lstinline{scheme=chinese} 设置。
\item \question{大佬,我想把正文字体改为亮色,背景色改为黑灰色。}
页面颜色可以使用 \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.}}
\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'.}}
你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2021
\item \question{\lstinline{! LaTeX Error: Unknown option 'scheme=plain' for package 'ctex'.}}
你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2022
\item \question{我该使用什么版本?}
请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2021 内获取。
\item \question{我该使用什么编辑器?}
@@ -766,8 +767,6 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
模板的使用修改都是自由的你们声明模板来源以及模板地址GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX{} 用户作品集里。
\item \question{请问交叉引用是什么?}
本群和本模板适合有一定 \LaTeX{} 基础的用户使用,新手请先学习 \LaTeX{} 的基础,理解各种概念,否则你将寸步难行。
\item \question{定义等环境中无法使用加粗命令么?}
是这样的,默认中文并没加粗命令,如果你想在定义等环境中使用加粗命令,请使用 \lstinline{\heiti} 等字体命令,而不要使用 \lstinline{\textbf}。或者,你可以将 \lstinline|\textbf| 重新定义为 \lstinline|\heiti|。英文模式不存在这个问题。
\item \question{代码高亮环境能用其他语言吗?}
可以的ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境(\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{lsset} 命令,更多信息请参考宏包文档。
\item \question{群主,什么时候出 Beamer 的模板主题ElegantSlide 或者 ElegantBeamer}
@@ -776,7 +775,17 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\chapter{版本更新历史}
根据用户的反馈,我们不断修正和完善模板。截止到此次更新ElegantBook 模板在 GitHub 上有将近 100 次提交正式发行版本release有 17 次。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。
根据用户的反馈,我们不断修正和完善模板。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。
\datechange{2022/04/09}{版本 4.3 正式发布。}
\begin{change}
\item 放弃 newtx 系列宏包的设置,改用 TeX Gyre Terms并设置其他字体
\item 修改定理类环境内部字体设置,修复环境内部中文无法加粗问题;
\item 增加定理类环境的计数器选项 \lstinline{thmcnt},可选 \lstinline{chapter}\lstinline{section}
\item 增加 \lstinline{bibend} 选项,可选 \lstinline{bibend=biber}(默认)和 \lstinline{bibend=bibtex}
\end{change}

View File

@@ -1,12 +1,12 @@
\documentclass[11pt,fancy]{elegantbook}
\documentclass[11pt]{elegantbook}
\title{An Elegant \LaTeX{} Template for Books}
\subtitle{Classic Elegant\LaTeX{} Template}
\author{Ethan Deng \& Liam Huang}
\institute{Elegant\LaTeX{} Program}
\date{March 8, 2022}
\version{4.2}
\date{April 9, 2022}
\version{4.3}
\bioinfo{Bio}{Information}
\extrainfo{Victory won\rq t come to us unless we go to it. }
@@ -14,12 +14,10 @@
\logo{logo-blue.png}
\cover{cover.jpg}
% modify the color in the middle of titlepage
\definecolor{customcolor}{RGB}{32,178,170}
\colorlet{coverlinecolor}{customcolor}
\usepackage{mathptmx}
\begin{document}
\maketitle
@@ -34,49 +32,22 @@ Elegant\LaTeX{} Program developers are intended to provide you beautiful, elegan
Contact Infos:
\begin{itemize}
\item Homepage: \href{https://elegantlatex.org/}{https://elegantlatex.org/}
\item GitHub: \href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/}
\item CTAN: \href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook}
\item Wiki: \href{https://github.com/ElegantLaTeX/ElegantBook/wiki}{https://github.com/ElegantLaTeX/ElegantBook/wiki}
\item Download: \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{release}, \href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{latest version}
\item Weibo: Elegant\LaTeX{}
\item Wechat: Elegant\LaTeX{}
\item QQ: 692108391
\item Email: \email{elegantlatex2e@gmail.com}
\end{itemize}
\section{ElegantBook Updates}
Version 4.2 is the \textit{temporary} version before v4.3 which will be released when \TeX Live 2022 is ready, we add quick bug fix caused by newtx package updates, and multilingual translation \lstinline{lang=jp}. What\rq s new in this version:
\begin{change}
\item Bug fix due to the update of newtx fonts;
\item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages;
\item Add language option for Japanese, \lstinline{lang=jp}.
\item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022.
\end{change}
\section{Online Usage}
You can visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anywhere and anytime without local installation. To find our template, search \lstinline{elegantlatex} in the \lstinline{templates} or simply visit \href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{search result}, choose the template you prefer and \lstinline{Open as Template} to own a copy yourself to edit freely. To learn more about Overleaf, please refer to \href{https://www.overleaf.com/learn}{Documentation}.
\section{Installation and Update}
Both portable version and installation package are available, online usage is optional as well.
\subsection{To Use Templates Online}
Visit \href{https://www.overleaf.com/}{Overleaf} to use our template online anywhere and anytime without local installation. To find our template, search \lstinline{elegantlatex} in the \lstinline{templates} or simply visit \href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{search result}, choose the template you prefer and \lstinline{Open as Template} to own a copy yourself to edit freely. To learn more about Overleaf, please refer to \href{https://www.overleaf.com/learn}{Documentation}.
\begin{remark}
On Overleaf, please use \hologo{XeLaTeX} to compile articles in Chinese and \hologo{pdfLaTeX} to compile articles in English.
\end{remark}
\subsection{To Use Portable Version}
\section{Portable Version}
For portable version, simply download lastest ElegantBook-master from GitHub or CTAN (to be more accurate, download \lstinline{elegantbook.cls}) and save the file(s) under your working directory. This way of installation is simple and convenient, but you have to manually update \lstinline{cls} now and then.
\subsection{Update Templates}
If you fail to update templates using \lstinline{tlshell}, please use cmd to update all the packages or switch to portable version instead.
Use the following commands(administrator privileges) to update:
\section{Update Templates}
You can use cmd/terminal to update the tlmgr itself and all the packages, the commands are:
\begin{lstlisting}
tlmgr update --self
tlmgr update --all
@@ -84,16 +55,14 @@ tlmgr update --all
To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?}
\subsection{Other Release Versions}
If you are a \TeX{} Live 2018/2019/2020 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 2021 (default: \lstinline|C:\texlive\2021\texmf-dist\tex\latex\elegantbook| ), run \lstinline{texhash} in cmd.
\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.
\section{About Pull Request}
For some reasons, pull requests will NOT by accepted since May 20, 2019. For those who want to help improve the templates, submit issues or clone to your own repository to modify under LPPL-1.3c.
\chapter{ElegantBook Settings}
This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environment is Win10 + \TeX{} Live 2021, either \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine. \hologo{XeLaTeX} is preferred for Chinese articles.
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.
\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
@@ -111,7 +80,8 @@ Besides the two basic language translation, our user provide more options, here
\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 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}.
\end{itemize}
\begin{remark}
@@ -237,15 +207,15 @@ We defined two sets of theorem modes, \lstinline{simple} style and \lstinline{fa
In this template, we defined four different theorem class environments
\begin{itemize}
\item \textit{Theorem Environment}, 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}
\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{third}{\textbf{proposition}} environment, the color is \textcolor{third}{third}.
\end{itemize}
\item \textit{Example Environments}, including \textbf{example, exercise, problem} environment, auto numbering corresponding to chapter.
\item \textit{Example Environment}, including \textbf{example, exercise, problem} environment, auto numbering according to chapter.
\item \textit{Proof Environment}, including \textbf{proof, note} environment containing introductory symbol (\textbf{note} environment) or ending symbol (\textbf{proof} environment).
\item \textit{Conclusion Environments}, 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}
\subsection{Theorem Class Environments}
@@ -272,22 +242,32 @@ From version 4.1, you can write your theorem environments as follows:
Other theorem class environments with the same usage includes:
\begin{table}[htbp]
\centering
\caption{Theorem Class Environments}
\begin{tabular}{llll}
\toprule
Environment & Label text & Prefix & Cross-reference \\
\midrule
definition & label & def & \lstinline|\ref{def:label}| \\
theorem & label & thm & \lstinline|\ref{thm:label}| \\
lemma & label & lem & \lstinline|\ref{lem:label}| \\
corrlary & label & cor & \lstinline|\ref{cor:label}| \\
proposition & label & pro & \lstinline|\ref{pro:label}| \\
\bottomrule
\end{tabular}%
\label{tab:theorem-class}%
\centering
\caption{Theorem Class Environments}
\begin{tabular}{llll}
\toprule
Environment & Label text & Prefix & Cross-reference \\
\midrule
definition & label & def & \lstinline|\ref{def:label}| \\
theorem & label & thm & \lstinline|\ref{thm:label}| \\
lemma & label & lem & \lstinline|\ref{lem:label}| \\
corrlary & label & cor & \lstinline|\ref{cor:label}| \\
proposition & label & pro & \lstinline|\ref{pro:label}| \\
\bottomrule
\end{tabular}%
\label{tab:theorem-class}%
\end{table}%
\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}.
\begin{lstlisting}
\documentclass[section]{elegantbook} % turn the Theorem 4.1 to Theorem 4.1.1
\documentclass[thmcnt=section]{elegantbook}
\end{lstlisting}
\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}:
@@ -396,11 +376,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.
To change the bibliography style, this version introduces \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
\begin{lstlisting}
\documentclass[citestyle=numeric-comp, bibstyle=authoryear]{elegantbook}
\end{lstlisting}
We also add the \lstinline{bibend} option to this template, you can choose \lstinline{biber} (default) or \lstinline{bibtex} as you like, \lstinline{biber} is recommended.
\begin{lstlisting}
\documentclass[bibtex]{elegantbook} % or
\documentclass[bibend=bibtex]{elegantbook}
\end{lstlisting}
\section{Preface}
If you want to add a preface before the first chapter with the number of chapter unchanged, please add the preface in the following way:
@@ -534,7 +522,7 @@ For tables and figures, note that floating environment is not allowed. You have
We will define the integral of a measurable function in three steps. First, we define the integral of a nonnegative simple function. Let $E$ be the measurable set in $\mathcal{R}^N$.
\begin{definition}[Left Coset]
Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is of the form $Hx$, where $Hx = \{ hx : h \in H \}$ $\hbar$
Let $H$ be a subgroup of a group~$G$. A \emph{left coset} of $H$ in $G$ is a subset of $G$ that is of the form $xH$, where $x \in G$ and $xH = \{ xh : h \in H \}$. Similarly a \emph{right coset} of $H$ in $G$ is a subset of $G$ that is of the form $Hx$, where $Hx = \{ hx : h \in H \} \hbar$
\end{definition}
\begin{note}
@@ -624,11 +612,11 @@ We list some FAQs for users to refer to:
\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.
\item \question{Which version should I choose?}
Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2021.
Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX{} Live 2022.
\item \question{Which editor should I choose?}
You can use \TeX{} Live 2021 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2021 + \TeX{}studio is strongly recommended. I myself use VS Code and Sublime Text. 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 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}.
\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, 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?}
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?}
@@ -638,7 +626,20 @@ We list some FAQs for users to refer to:
\end{enumerate}
\chapter{Version History}
We revised our templates now and then. This section shows the version story of ElegantBook. We have nearly 100 submits and 17 releases on GitHub since uploaded.
We revised our templates now and then. This section shows the version story of ElegantBook.
\datechange{2022/04/09}{release of v4.3.}
\begin{change}
\item Remove part newtx settings, set TeX Gyre Terms/Heros fonts under \hologo{XeLaTeX}.
\item Fix Chinese fonts in the theorem environments.
\item Add theorem counter option, \lstinline{thmcnt=section}.
\item Add bib option \lstinline{bibend}, which can take value of biber and bibtex.
\item \textbf{! Warnings}: The multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}.
\end{change}
\datechange{2022/03/08}{release of v4.2.}
@@ -646,7 +647,6 @@ We revised our templates now and then. This section shows the version story of E
\item Bug fix due to the update of newtx fonts;
\item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages;
\item Add language option for Japanese, \lstinline{lang=jp}.
\item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022.
\end{change}

View File

@@ -8,7 +8,7 @@
%%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{elegantbook}[2022/03/08 v4.2 ElegantBook document class]
\ProvidesClass{elegantbook}[2022/04/09 v4.3 ElegantBook document class]
%%%
@@ -27,6 +27,7 @@
\DeclareStringOption[marginfalse]{marginpar}
\DeclareStringOption[onecol]{toc}
\DeclareStringOption{scheme}
% ----- backward compatibility
\DeclareVoidOption{green}{\ekv{color=green}}
\DeclareVoidOption{cyan}{\ekv{color=cyan}}
@@ -34,10 +35,10 @@
\DeclareVoidOption{gray}{\ekv{color=gray}}
\DeclareVoidOption{black}{\ekv{color=black}}
\DeclareVoidOption{nocolor}{\ekv{color=none}}
\DeclareStringOption[ctexfont]{chinesefont}
\DeclareVoidOption{chinese}{\ekv{scheme=chinese}}
\DeclareStringOption[ctexfont]{chinesefont}
\DeclareVoidOption{ctexfont}{\ekv{chinesefont=ctexfont}}
\DeclareVoidOption{founder}{\ekv{chinesefont=founder}}
\DeclareVoidOption{nofont}{\ekv{chinesefont=nofont}}
@@ -45,7 +46,13 @@
\DeclareVoidOption{en}{\ekv{lang=en}}
\DeclareVoidOption{cn}{\ekv{lang=cn}}
\DeclareVoidOption{it}{\ekv{lang=it}}
\DeclareVoidOption{fr}{\ekv{lang=fr}}
\DeclareVoidOption{nl}{\ekv{lang=nl}}
\DeclareVoidOption{hu}{\ekv{lang=hu}}
\DeclareVoidOption{de}{\ekv{lang=de}}
\DeclareVoidOption{mn}{\ekv{lang=mn}}
\DeclareVoidOption{pt}{\ekv{lang=pt}}
\DeclareVoidOption{jp}{\ekv{lang=jp}}
\DeclareVoidOption{fancy}{\ekv{mode=fancy}}
\DeclareVoidOption{simple}{\ekv{mode=simple}}
@@ -59,7 +66,7 @@
\DeclareStringOption[numeric-comp]{citestyle}
\DeclareStringOption[numeric]{bibstyle}
\DeclareVoidOption{newtx}{\ekv{math=newtx}}
\DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}}
\DeclareVoidOption{cm}{\ekv{math=cm}}
@@ -70,6 +77,14 @@
\DeclareVoidOption{onecol}{\ekv{toc=onecol}}
\DeclareVoidOption{twocol}{\ekv{toc=twocol}}
\DeclareStringOption[chapter]{thmcnt}
\DeclareVoidOption{chapter}{\ekv{thmcnt=chapter}}
\DeclareVoidOption{section}{\ekv{thmcnt=section}}
\DeclareStringOption[biber]{bibend}
\DeclareVoidOption{biber}{\ekv{bibend=biber}}
\DeclareVoidOption{bibtex}{\ekv{bibend=bibtex}}
% ----- Math option -----
\newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}}
@@ -135,6 +150,7 @@
footskip=4mm
}}{\relax}
\RequirePackage{indentfirst,comment}
% fontsetting
\ifdefstring{\ELEGANT@math}{mtpro2}{
@@ -146,34 +162,53 @@
\renewcommand{\baselinestretch}{1.2}
\PassOptionsToPackage{no-math}{fontspec}
\PassOptionsToPackage{quiet}{fontspec}
\RequirePackage{iftex}
\ifdefstring{\ELEGANT@lang}{cn}{
\ifXeTeX
\ifdefstring{\ELEGANT@chinesefont}{founder}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}{FZKai-Z03}
\setCJKfamilyfont{zhfs}{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\else
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\fi
\ifXeTeX
\RequirePackage[no-math]{fontspec}
\setmainfont{texgyretermes}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 1.0]
\setsansfont{texgyreheros}[
UprightFont = *-regular ,
BoldFont = *-bold ,
ItalicFont = *-italic ,
BoldItalicFont = *-bolditalic ,
Extension = .otf ,
Scale = 0.9]
\else
\RequirePackage{newtxtext}
\RequirePackage[scaled=.90]{helvet}
\fi
\ifdefstring{\ELEGANT@lang}{cn}{
\ifdefstring{\ELEGANT@chinesefont}{founder}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKmonofont[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\setCJKfamilyfont{zhsong}{FZShuSong-Z01}
\setCJKfamilyfont{zhhei}{FZHei-B01}
\setCJKfamilyfont{zhkai}[BoldFont={FZHei-B01}]{FZKai-Z03}
\setCJKfamilyfont{zhfs}[BoldFont={FZHei-B01}]{FZFangSong-Z02}
\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{nofont}{
\RequirePackage[UTF8,scheme=plain,fontset=none]{ctex}}{\relax}
\ifdefstring{\ELEGANT@chinesefont}{ctexfont}{
\RequirePackage[UTF8,scheme=plain]{ctex}}{\relax}
\AfterEndPreamble{
% \renewcommand{\itshape}{\kaishu}
\setlength\parindent{2\ccwd}}
}{\relax}
@@ -202,6 +237,25 @@
\fi
\RequirePackage{anyfontsize}
\ifdefstring{\ELEGANT@math}{newtx}{
\RequirePackage{newtxmath}
\let\Bbbk\relax
\RequirePackage{esint}
%%% use yhmath pkg, uncomment following code
% \let\oldwidering\widering
% \let\widering\undefined
% \RequirePackage{yhmath}
% \let\widering\oldwidering
%%% use esvect pkg, uncomment following code
% \RequirePackage{esvect}
\DeclareSymbolFont{CMlargesymbols}{OMX}{cmex}{m}{n}
\let\sumop\relax\let\prodop\relax
\DeclareMathSymbol{\sumop}{\mathop}{CMlargesymbols}{"50}
\DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51}
}{\relax}
% ----- Handle Colors -----
%%
@@ -330,7 +384,7 @@
\RequirePackage[
backend=biber,
backend=\ELEGANT@bibend,
citestyle=\ELEGANT@citestyle,
bibstyle=\ELEGANT@bibstyle]{biblatex}
\defbibheading{elegantbook}[\ebibname]{#1}
@@ -801,7 +855,6 @@
%%define the note and proof environment
\RequirePackage{pifont,manfnt,bbding}
\RequirePackage[many]{tcolorbox}
@@ -855,37 +908,37 @@
\node[anchor=south east, outer sep=0pt] at (\linewidth-width,0) {
\textcolor{third}{$\spadesuit$}};}},}
% \newtcbtheorem[auto counter,number within=chapter]{definition}{\definitionname}{defstyle}{def}
\DeclareTColorBox[auto counter,number within=chapter]{definition}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{definition}{ o t\label g }{
common,defstyle,
IfValueTF={#1}{title={\definitionname~\thetcbcounter\ (#1)}}{title=\definitionname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{theorem}{\theoremname}{thmstyle}{thm}
\DeclareTColorBox[auto counter,number within=chapter]{theorem}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{theorem}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\theoremname~\thetcbcounter\ (#1)}}{title=\theoremname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{postulate}{\postulatename}{thmstyle}{pos}
\DeclareTColorBox[auto counter,number within=chapter]{postulate}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{postulate}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\postulatename~\thetcbcounter\ (#1)}}{title=\postulatename~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{axiom}{\axiomname}{thmstyle}{axi}
\DeclareTColorBox[auto counter,number within=chapter]{axiom}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{axiom}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\axiomname~\thetcbcounter\ (#1)}}{title=\axiomname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{corollary}{\corollaryname}{thmstyle}{cor}
\DeclareTColorBox[auto counter,number within=chapter]{corollary}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{corollary}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\corollaryname~\thetcbcounter\ (#1)}}{title=\corollaryname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{lemma}{\lemmaname}{thmstyle}{lem}
\DeclareTColorBox[auto counter,number within=chapter]{lemma}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{lemma}{ o t\label g }{
common,thmstyle,
IfValueTF={#1}{title={\lemmaname~\thetcbcounter\ (#1)}}{title=\lemmaname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}
% \newtcbtheorem[auto counter,number within=chapter]{proposition}{\propositionname}{propstyle}{pro}
\DeclareTColorBox[auto counter,number within=chapter]{proposition}{ o t\label g }{
\DeclareTColorBox[auto counter,number within=\ELEGANT@thmcnt]{proposition}{ o t\label g }{
common,propstyle,
IfValueTF={#1}{title={\propositionname~\thetcbcounter\ (#1)}}{title=\propositionname~\thetcbcounter},
IfBooleanTF={#2}{label=#3}{}}}{\relax}
@@ -908,17 +961,17 @@
\theoremstyle{defstyle} % definition style
\newtheorem{definition}{\definitionname}[chapter]
\newtheorem{definition}{\definitionname}[\ELEGANT@thmcnt]
\theoremstyle{thmstyle} %theorem style
\newtheorem{theorem}{\theoremname}[chapter]
\newtheorem{lemma}{\lemmaname}[chapter]
\newtheorem{corollary}{\corollaryname}[chapter]
\newtheorem{postulate}{\postulatename}[chapter]
\newtheorem{axiom}{\axiomname}[chapter]
\newtheorem{theorem}{\theoremname}[\ELEGANT@thmcnt]
\newtheorem{lemma}{\lemmaname}[\ELEGANT@thmcnt]
\newtheorem{corollary}{\corollaryname}[\ELEGANT@thmcnt]
\newtheorem{postulate}{\postulatename}[\ELEGANT@thmcnt]
\newtheorem{axiom}{\axiomname}[\ELEGANT@thmcnt]
\theoremstyle{prostyle} % proposition style
\newtheorem{proposition}{\propositionname}[chapter]
\newtheorem{proposition}{\propositionname}[\ELEGANT@thmcnt]
}{\relax}
% maingreen-def): example exercise problem solution
@@ -1003,6 +1056,7 @@
\RequirePackage{adforn}
\newenvironment{problemset}[1][\xchaptertitle~\exercisename]{
\vspace*{10pt}
\begin{center}
\phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\xchaptertitle~\exercisename}{\exercisename}}
% \markboth{#1}{\rightmark}
@@ -1231,4 +1285,7 @@
\setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~999}}}
}%
}
}
}
% restore the tt default family to lmodern tt family
\renewcommand\ttdefault{lmtt}