summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/elegantbook
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/elegantbook')
-rw-r--r--macros/latex/contrib/elegantbook/README-CN.md2
-rw-r--r--macros/latex/contrib/elegantbook/README.md2
-rw-r--r--macros/latex/contrib/elegantbook/elegantbook-cn.pdfbin1107125 -> 1062407 bytes
-rw-r--r--macros/latex/contrib/elegantbook/elegantbook-cn.tex179
-rw-r--r--macros/latex/contrib/elegantbook/elegantbook-en.pdfbin1082920 -> 756261 bytes
-rw-r--r--macros/latex/contrib/elegantbook/elegantbook-en.tex145
-rw-r--r--macros/latex/contrib/elegantbook/elegantbook.cls310
-rw-r--r--macros/latex/contrib/elegantbook/image/cert.pdfbin103979 -> 0 bytes
-rw-r--r--macros/latex/contrib/elegantbook/image/donate.jpgbin141078 -> 0 bytes
9 files changed, 408 insertions, 230 deletions
diff --git a/macros/latex/contrib/elegantbook/README-CN.md b/macros/latex/contrib/elegantbook/README-CN.md
index 1b31dab34a..438d4fb195 100644
--- a/macros/latex/contrib/elegantbook/README-CN.md
+++ b/macros/latex/contrib/elegantbook/README-CN.md
@@ -17,6 +17,8 @@ ElegantBook 是为 LaTeX 书籍写作而设计的模板,由 [Dongsheng Deng](h
## 致谢
+特别感谢 [sikouhjw](https://github.com/sikouhjw) 长期以来对于 Github 上 issue 的快速回应,以及各个社区论坛对于 ElegantLaTeX 相关问题的回复。
+
特别感谢 ChinaTeX 以及 [LaTeX 工作室](http://www.latexstudio.net/)对于本系列模板的大力宣传与推广。
如果你喜欢我们的模板,你可以在 Github 上收藏我们的模板。
diff --git a/macros/latex/contrib/elegantbook/README.md b/macros/latex/contrib/elegantbook/README.md
index 582d36380c..6e3bc0df80 100644
--- a/macros/latex/contrib/elegantbook/README.md
+++ b/macros/latex/contrib/elegantbook/README.md
@@ -17,6 +17,8 @@ For some reasons, __unauthorized__ pull requests are **UNACCEPTABLE** since May
## Acknowledgement
+Thank [sikouhjw](https://github.com/sikouhjw) for his quick response to Github issues and continuously support work for ElegantLaTeX.
+
Thank ChinaTeX and [LaTeX Studio](http://www.latexstudio.net/) for their promotion.
diff --git a/macros/latex/contrib/elegantbook/elegantbook-cn.pdf b/macros/latex/contrib/elegantbook/elegantbook-cn.pdf
index efecb61556..5b8edc4de9 100644
--- a/macros/latex/contrib/elegantbook/elegantbook-cn.pdf
+++ b/macros/latex/contrib/elegantbook/elegantbook-cn.pdf
Binary files differ
diff --git a/macros/latex/contrib/elegantbook/elegantbook-cn.tex b/macros/latex/contrib/elegantbook/elegantbook-cn.tex
index 714436ee70..728e69fbe9 100644
--- a/macros/latex/contrib/elegantbook/elegantbook-cn.tex
+++ b/macros/latex/contrib/elegantbook/elegantbook-cn.tex
@@ -1,15 +1,15 @@
-\documentclass[cn,10pt,math=newtx,citestyle=gb7714-2015,bibstyle=gb7714-2015]{elegantbook}
+\documentclass[lang=cn,10pt]{elegantbook}
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
\subtitle{Elegant\LaTeX{} 经典之作}
\author{Ethan Deng \& Liam Huang}
\institute{Elegant\LaTeX{} Program}
-\date{May 2, 2021}
-\version{4.1}
+\date{April 9, 2022}
+\version{4.3}
\bioinfo{自定义}{信息}
-\extrainfo{各人自扫门前雪,休管他人瓦上霜。—— 陈元靓}
+\extrainfo{不要以为抹消过去,重新来过,即可发生什么改变。—— 比企谷八幡}
\setcounter{tocdepth}{3}
@@ -20,37 +20,15 @@
\usepackage{array}
\newcommand{\ccr}[1]{\makecell{{\color{#1}\rule{1cm}{1cm}}}}
-\definecolor{customcolor}{RGB}{32,178,170}
-\colorlet{coverlinecolor}{customcolor}
+% 修改标题页的橙色带
+% \definecolor{customcolor}{RGB}{32,178,170}
+% \colorlet{coverlinecolor}{customcolor}
\begin{document}
\maketitle
\frontmatter
-\chapter*{特别声明}
-
-\markboth{Introduction}{前言}
-
-自 2019 年 Elegant\LaTeX{} 系列模板上线 GitHub、CTAN 以来,受到很多用户的喜爱。
-
-2020 年,我打算做 Elegant\LaTeX{} 的最后一个版本,也就是原定计划 ElegantBook 4.x 版本为 Elegant\LaTeX{} 系列模板的终止符。基于我想把 4.x 做成一个最终版本,我计划了很多事情,包括将代码转为 dtx,将三个模板的文档打包进 dtx 里面,然后重新设计封面,补充各种页面,增加元素等等。我想的很多,但是做起来并不是很顺利,中间也发生了很多事情,不想解释。直至今年 4 月,我决定,不论如何,先把 4.1 发布出来。
-
-\vskip 0.5cm
-
-另外,在临近 Elegant\LaTeX{} 模板告别之际,我想和各位用户说:多分享,多奉献。
-
-\vskip 0.5cm
-
-\underline{如果你无法认同我的想法,建议直接删除本模板。}
-
-\vskip 1.5cm
-
-\begin{flushright}
-Ethan Deng\\
-May 2, 2021
-\end{flushright}
-
\tableofcontents
\mainmatter
@@ -61,70 +39,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}
-
-\section{ElegantBook 更新说明}
-
-此次为 4.x 第一个版本,在 3.x 基础上,主要更新了定理以及参考文献的支持方式,具体内容有:
-
-\begin{enumerate}
- \item \textbf{重要改动}:由原先的 \hologo{BibTeX} 改为 biblatex 编译方式(后端为 \lstinline{biber}),请注意两者之间的差异;
- \item \textbf{重要改进}:修改对于定理写法兼容方式,提高数学公式代码的兼容性;
- \item 页面设置改动,默认页面更宽;方便书写和阅读;
- \item 支持目录文字以及页码跳转;
- \item 不再维护 \hologo{pdfLaTeX} 中文支持方式,请务必使用 \hologo{XeLaTeX} 编译中文文稿。
- \item 增加多语言选项,法语 \lstinline{lang=fr}、德语 \lstinline{lang=de}、荷兰语 \lstinline{lang=nl}、匈牙利语 \lstinline{lang=hu}、西班牙语 \lstinline{lang=es}、蒙古语 \lstinline{lang=mn} 等。
-\end{enumerate}
-
-\begin{note}
-如果你使用旧版本切换到新版本时,遇到问题时,请核对文档中是否有 \lstinline{pageanchor} 字样。如果有,请删除文档中的 \lstinline|\hypersetup{pageanchor=true}|,并且在 \lstinline{\maketitle} 和 \lstinline{\tableofcontents} 之间添加 \lstinline{\frontmatter}。2.x 版本的用户请仔细查看\href{https://github.com/ElegantLaTeX/ElegantBook/wiki/convert}{跨版本转换}。
-\end{note}
-
\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} 文件。
-
-\subsection{发行版安装使用}
+\textbf{免安装}使用方法如下:从 GitHub 或者 CTAN 下载最新版,严格意义上只需要类文件 \lstinline{elegantbook.cls}。然后将模板文件放在你的工作目录下即可使用。这样使用的好处是,无需安装,简便;缺点是,当模板更新之后,你需要手动替换 \lstinline{cls} 文件。
-本模板测试环境为 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} 更新。
+\subsection{发行版安装与更新}
-\subsection{更新问题}
+本模板测试环境为
+\begin{enumerate}
+ \item Win10 + \TeX{} Live 2022;
+ \item Ubuntu 20.04 + \TeX{} Live 2022;
+ \item macOS Monterey + Mac\TeX{} 2022。
+\end{enumerate}
-如果使用 \lstinline{tlshell} 无法更新模板,请使用命令行全部更新全部宏包或者使用免安装的方法使用本模板。
+\TeX Live/Mac\TeX{} 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}。
-通过命令行(管理员权限)输入下面的命令对 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/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{关于提交}
@@ -134,7 +95,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}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下:
@@ -143,7 +104,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};
@@ -152,7 +113,8 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\item 由 \href{https://github.com/palkotamas}{palkotamas} 提供的匈牙利语翻译 \lstinline{lang=hu},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/111}{Hungarian translation};
\item 由 Lisa 提供的德语翻译 \lstinline{lang=de},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/113}{Deutsch translation};
\item 由 Gustavo A. Corradi 提供的西班牙语的翻译 \lstinline{lang=es},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/133}{Spanish translation};
- \item 由 \href{https://github.com/Altantsooj}{Altantsooj} 提供的蒙古语的翻译 \lstinline{lang=mn},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation}。
+ \item 由 \href{https://github.com/Altantsooj}{Altantsooj} 提供的蒙古语的翻译 \lstinline{lang=mn},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/137}{Mongolian translation};
+ \item 由 \href{https://github.com/inusturbo}{inusturbo} 提供的日本语的翻译 \lstinline{lang=jp},相关讨论见 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/172}{Japanese Translation}。
\end{itemize}
@@ -176,6 +138,7 @@ Overleaf 上,中文需要使用 \hologo{XeLaTeX} 进行编译,英文建议
\documentclass[color=green]{elegantbook}
\end{lstlisting}
+
\begin{table}[htbp]
\caption{ElegantBook 模板中的颜色主题\label{tab:color thm}}
\centering
@@ -251,8 +214,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{封面图}
@@ -374,6 +337,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} 环境的使用方法与效果:
@@ -423,12 +397,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}
-你可以在谷歌学术,Mendeley,Endnote 中获得文献条目(bib item),然后把它们添加到 \lstinline{reference.bib} 中。在文中引用的时候,引用它们的键值(bib key)即可。注意需要在编译的过程中添加 \hologo{biber} 编译。
+关于文献条目(bib item),你可以在谷歌学术,Mendeley,Endnote 中取,然后把它们添加到 \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}
@@ -623,8 +603,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}
@@ -643,12 +623,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}}
@@ -677,7 +657,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
@@ -771,10 +751,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{我该使用什么编辑器?}
@@ -783,8 +763,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?}
@@ -793,7 +771,28 @@ 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}
+
+
+
+\datechange{2022/03/08}{版本 4.2 正式发布。}
+
+\begin{change}
+ \item 对于 newtx 系列宏包更新导致的字体 bug 的修复;
+ \item 修缮目录格式,为了达到这个目的,重新改写 \lstinline{\chaptername} 的重定义语句;
+ \item 增加日语 \lstinline{lang=jp} 设定。
+ \item 这个版本为一个临时性版本,在 \TeX Live 2022 发布之后,将尽快发布 4.3 版本,由于对于中文的改动比较大,可能会出现预期之外的 bug,有问题可以在 QQ 群或者 Github 反馈。
+\end{change}
\datechange{2021/05/02}{版本 4.1 正式发布。}
@@ -933,8 +932,8 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非
\item 颜色名字重命名。
\end{change}
-\nocite{*}
-\printbibliography
+\nocite{*}
+\printbibliography[heading=bibintoc, title=\ebibname]
\appendix
\chapter{基本数学工具}
diff --git a/macros/latex/contrib/elegantbook/elegantbook-en.pdf b/macros/latex/contrib/elegantbook/elegantbook-en.pdf
index d1580ffb4d..102ca2c429 100644
--- a/macros/latex/contrib/elegantbook/elegantbook-en.pdf
+++ b/macros/latex/contrib/elegantbook/elegantbook-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/elegantbook/elegantbook-en.tex b/macros/latex/contrib/elegantbook/elegantbook-en.tex
index 739a92f64d..00e7f67208 100644
--- a/macros/latex/contrib/elegantbook/elegantbook-en.tex
+++ b/macros/latex/contrib/elegantbook/elegantbook-en.tex
@@ -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{May. 2, 2021}
-\version{4.1}
+\date{April 9, 2022}
+\version{4.3}
\bioinfo{Bio}{Information}
\extrainfo{Victory won\rq t come to us unless we go to it. }
@@ -14,10 +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}
-
\begin{document}
\maketitle
@@ -32,50 +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{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{ElegantBook Updates}
-
-Version 4.1 is the first version of 3.x, we add support for biblatex, theorem, and multilingual translation. What\rq s new in this version:
-
-\begin{enumerate}
- \item \textbf{! Big Change}: Change the bibliography method from \hologo{BibTeX} to biblatex(with backend \lstinline{biber});
- \item \textbf{! Big Change}: Add support for the default theorem writing method (with optional name and label);
- \item Add left and right space;
- \item Support hyperlink from the text of TOC;
- \item Remove the \hologo{pdfLaTeX} compatiblity check for Chinese.
- \item Add multilingual support, for french \lstinline{lang=fr}, dutch \lstinline{lang=nl}, Hungarian \lstinline{lang=hu}, Spanish \lstinline{lang=es}, Mongolian \lstinline{lang=mn} etc.
-\end{enumerate}
-
-\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
@@ -83,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
@@ -110,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}
@@ -236,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}
@@ -271,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}:
@@ -395,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:
@@ -533,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}
@@ -623,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?}
@@ -637,7 +626,28 @@ 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.}
+
+\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}.
+\end{change}
\datechange{2021/05/02}{release of v4.1.}
@@ -688,7 +698,8 @@ We revised our templates now and then. This section shows the version story of E
\end{change}
\nocite{en2,en3}
-\printbibliography
+
+\printbibliography[heading=bibintoc, title=\ebibname]
\appendix
% \renewcommand\chaptername{\eappendix \thechapter}
diff --git a/macros/latex/contrib/elegantbook/elegantbook.cls b/macros/latex/contrib/elegantbook/elegantbook.cls
index ae05a7c3a5..0966c3fc12 100644
--- a/macros/latex/contrib/elegantbook/elegantbook.cls
+++ b/macros/latex/contrib/elegantbook/elegantbook.cls
@@ -1,6 +1,6 @@
%%%%%%%%%%%%%%%%%%%%%%
%% start of file `elegantbook.cls'.
-%% Copyright 2013-2021 ElegantLaTeX (elegantlatex2e@gmail.com)
+%% Copyright 2013-2022 ElegantLaTeX (elegantlatex2e@gmail.com)
%%
%% This work may be distributed and/or modified freely
%% available at https://github.com/ElegantLaTeX/ElegantBook
@@ -8,8 +8,10 @@
%%%%%%%%%%%%%%%%%%%%%
% % !Mode:: "TeX:UTF-8"
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{elegantbook}[2021/05/02 v4.1 ElegantBook document class]
+\ProvidesClass{elegantbook}[2022/04/09 v4.3 ElegantBook document class]
+
+%%%
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{family=ELEGANT, prefix=ELEGANT@, setkeys=\kvsetkeys}
@@ -25,6 +27,7 @@
\DeclareStringOption[marginfalse]{marginpar}
\DeclareStringOption[onecol]{toc}
\DeclareStringOption{scheme}
+
% ----- backward compatibility
\DeclareVoidOption{green}{\ekv{color=green}}
\DeclareVoidOption{cyan}{\ekv{color=cyan}}
@@ -32,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}}
@@ -43,6 +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}}
@@ -56,7 +66,6 @@
\DeclareStringOption[numeric-comp]{citestyle}
\DeclareStringOption[numeric]{bibstyle}
-
\DeclareVoidOption{newtx}{\ekv{math=newtx}}
\DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}}
\DeclareVoidOption{cm}{\ekv{math=cm}}
@@ -68,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}}}
@@ -133,6 +150,7 @@
footskip=4mm
}}{\relax}
+
\RequirePackage{indentfirst,comment}
% fontsetting
\ifdefstring{\ELEGANT@math}{mtpro2}{
@@ -144,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}
+
+\ifXeTeX
+ \RequirePackage[no-math]{fontspec}
+ \setmainfont{texgyretermes}[
+ UprightFont = *-regular ,
+ BoldFont = *-bold ,
+ ItalicFont = *-italic ,
+ BoldItalicFont = *-bolditalic ,
+ Extension = .otf ,
+ Scale = 1.0]
- \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
+ \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}
@@ -199,7 +236,6 @@
\newcommand{\cfs}{\normalfont}
\fi
-\RequirePackage{newtxtext}
\RequirePackage{anyfontsize}
\ifdefstring{\ELEGANT@math}{newtx}{
\RequirePackage{newtxmath}
@@ -220,6 +256,7 @@
\DeclareMathSymbol{\prodop}{\mathop}{CMlargesymbols}{"51}
}{\relax}
+
% ----- Handle Colors -----
%% 章节以及页脚图形
@@ -340,16 +377,17 @@
\RequirePackage{makecell,lipsum,hologo}
%%中文结构名字
-\RequirePackage[
- backend=biber,
- citestyle=\ELEGANT@citestyle,
- bibstyle=\ELEGANT@bibstyle]{biblatex}
-
-
%% 章节设置
+\RequirePackage[center,pagestyles]{titlesec}
+\RequirePackage[title,titletoc,header]{appendix}
-\RequirePackage{appendix}
+
+\RequirePackage[
+ backend=\ELEGANT@bibend,
+ citestyle=\ELEGANT@citestyle,
+ bibstyle=\ELEGANT@bibstyle]{biblatex}
+\defbibheading{elegantbook}[\ebibname]{#1}
\ifdefstring{\ELEGANT@lang}{cn}{
\renewcommand{\baselinestretch}{1.3}
@@ -361,13 +399,12 @@
\renewcommand{\listfigurename}{插图目录}
\renewcommand{\listtablename}{表格目录}
\renewcommand{\bibname}{参考文献}
+ \newcommand{\ebibname}{参考文献}
\renewcommand{\appendixname}{附录}
+ \renewcommand{\appendixtocname}{附录}
\renewcommand{\indexname}{索\hspace{2em}引}
\newcommand\figref[1]{\textbf{图}~\ref{#1}}
\newcommand\tabref[1]{\textbf{表}~\ref{#1}}
- \ifdefstring{\ELEGANT@scheme}{chinese}{
- \renewcommand{\chaptername}{第\zhnumber{\arabic{chapter}}章}}{
- \renewcommand{\chaptername}{第 \thechapter{} 章}}
\newcommand{\authorname}{\citshape 作者:}
\newcommand{\institutename}{\citshape 组织:}
\newcommand{\datename}{\citshape 时间:}
@@ -394,12 +431,16 @@
\newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}:#2}}
\newcommand{\updatename}{更新:}
\newcommand{\historyname}{版本更新历史}
- }{\relax}
+ \newcommand{\beforechap}{第}
+ \newcommand{\afterchap}{章}
+}{\relax}
+
+
\ifdefstring{\ELEGANT@lang}{en}{
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Table}~\ref{#1}}
- \renewcommand{\chaptername}{Chapter \thechapter}
+ \renewcommand{\chaptername}{Chapter}
\renewcommand{\partname}{\color{structurecolor} Part}
\newcommand{\authorname}{\textbf{Author: }}
\newcommand{\institutename}{\textbf{Institute: }}
@@ -424,6 +465,7 @@
\newcommand{\propertyname}{Property}
\newcommand{\introductionname}{Introduction}
\renewcommand{\appendixname}{Appendix}
+ \newcommand{\ebibname}{Bibliography}
% \newcommand{\problemsetname}{Exercise}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Updates:}
@@ -437,7 +479,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figura}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Tabella}~\ref{#1}}
- \renewcommand{\chaptername}{Chapter \thechapter}
+ \renewcommand{\chaptername}{Chapter}
\newcommand{\authorname}{\textbf{Autore: }}
\newcommand{\institutename}{\textbf{Istituto: }}
\newcommand{\datename}{\textbf{Data: }}
@@ -462,6 +504,7 @@
\newcommand{\introductionname}{Introduzione}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Aggiornamenti:}
+ \newcommand{\ebibname}{Bibliografia}
\newcommand{\historyname}{Cronologia delle versioni}
}{\relax}
@@ -472,7 +515,7 @@
\setlength\parindent{2em}
\renewcommand\figref[1]{\textbf{Figure}\ref{#1}}
\renewcommand\tabref[1]{\textbf{Tableau}\ref{#1}}
- \renewcommand{\chaptername}{Chapitre \thechapter}
+ \renewcommand{\chaptername}{Chapitre}
\renewcommand{\authorname}{\textbf{Auteur: }}
\renewcommand{\institutename}{\textbf{Institut: }}
\renewcommand{\datename}{\textbf{Date: }}
@@ -497,6 +540,7 @@
\renewcommand{\introductionname}{Introduction}
\renewcommand{\problemsetname}{Exercice}
\renewcommand{\updatename}{Mises à jour:}
+ \newcommand{\ebibname}{Bibliographie}
\renewcommand{\historyname}{Historique des versions}
}{\relax}
@@ -506,7 +550,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figuur}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Tabel}~\ref{#1}}
- \renewcommand{\chaptername}{Hoofdstuk \arabic{chapter}}
+ \renewcommand{\chaptername}{Hoofdstuk}
\newcommand{\authorname}{\textbf{Auteur: }}
\newcommand{\institutename}{\textbf{Instituut: }}
\newcommand{\datename}{\textbf{Datum: }}
@@ -532,6 +576,7 @@
\newcommand{\problemsetname}{Probleemcomplex}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Update:}
+ \newcommand{\ebibname}{Bibliographie}
\newcommand{\historyname}{Versie Geschiedenis}
}{\relax}
@@ -541,7 +586,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\ref{#1}~\textbf{Ábra}}
\newcommand\tabref[1]{\ref{#1}~\textbf{Táblázat}}
- \renewcommand{\chaptername}{\thechapter ~ fejezet}
+ \renewcommand{\chaptername}{Fejezet}
\newcommand{\authorname}{\textbf{Szerző: }}
\newcommand{\institutename}{\textbf{Intézmény: }}
\newcommand{\datename}{\textbf{Dátum: }}
@@ -567,6 +612,7 @@
\newcommand{\problemsetname}{Feladatok}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Frissítve:}
+ \newcommand{\ebibname}{Bibliográfia}
\newcommand{\historyname}{Korábbi verziók}
}{\relax}
@@ -580,7 +626,7 @@
\renewcommand{\listtablename}{Tabellenverzeichnis}
\renewcommand{\bibname}{Bibliographie}
\renewcommand{\appendixname}{Anhang}
- \renewcommand{\chaptername}{Kapitel \thechapter}
+ \renewcommand{\chaptername}{Kapitel}
\newcommand{\authorname}{\textbf{Autor: }}
\newcommand{\institutename}{\textbf{Institut: }}
\newcommand{\datename}{\textbf{Datum: }}
@@ -606,6 +652,7 @@
\newcommand{\introductionname}{Einleitung}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Updates:}
+ \renewcommand{\ebibname}{Bibliographie}
\newcommand{\historyname}{Version der Geschichte}
}{\relax}
@@ -614,7 +661,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figura}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Tabla}~\ref{#1}}
- \renewcommand{\spanishchaptername}{Capítulo \thechapter}
+ \renewcommand{\spanishchaptername}{Capítulo}
\newcommand{\authorname}{\textbf{Autor: }}
\newcommand{\institutename}{\textbf{Instituto: }}
\newcommand{\datename}{\textbf{Fecha: }}
@@ -640,6 +687,7 @@
\newcommand{\problemsetname}{Ejercicio}
\newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Actualización:}
+ \newcommand{\ebibname}{Bibliografía}
\newcommand{\historyname}{Historial de versiones}
}{\relax}
@@ -650,7 +698,7 @@
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Зураг}\ref{#1}}
\newcommand\tabref[1]{\textbf{Хүснэгт}\ref{#1}}
- \renewcommand{\chaptername}{Бүлэг \thechapter}
+ \renewcommand{\chaptername}{Бүлэг}
\newcommand{\authorname}{\textbf{Зохиогч: }}
\newcommand{\institutename}{\textbf{Сургууль: }}
\newcommand{\datename}{\textbf{Огноо: }}
@@ -676,9 +724,89 @@
\newcommand{\problemsetname}{Бодлогууд}
\newcommand\bioinfo[2]{\gdef@bioinfo{\textbf{#1}: #2}}
\newcommand{\updatename}{Шинэчлэлтүүд:}
+ \newcommand{\ebibname}{Ном зүй}
\newcommand{\historyname}{Хувилбарын түүх}
}{\relax}
+
+\ifdefstring{\ELEGANT@lang}{pt}{
+ \RequirePackage[portuguese]{babel}
+ \setlength\parindent{2em}
+ \newcommand\figref[1]{\textbf{Figura}~\ref{#1}}
+ \newcommand\tabref[1]{\textbf{Tabela}~\ref{#1}}
+ \renewcommand{\chaptername}{Capítulo}
+ \newcommand{\authorname}{\textbf{Autor: }}
+ \newcommand{\institutename}{\textbf{Instituição: }}
+ \newcommand{\datename}{\textbf{Data: }}
+ \newcommand{\versionname}{\textbf{Versão: }}
+ \newcommand{\notename}{Observação}
+ \newcommand{\proofname}{Demostração}
+ \newcommand{\problemname}{Problema}
+ \newcommand{\definitionname}{Definição}
+ \newcommand{\theoremname}{Teorema}
+ \newcommand{\axiomname}{Axioma}
+ \newcommand{\postulatename}{Postulado}
+ \newcommand{\lemmaname}{Lema}
+ \newcommand{\propositionname}{Proposição}
+ \newcommand{\corollaryname}{Corolário}
+ \newcommand{\examplename}{Exemplo}
+ \newcommand{\exercisename}{Exercício}
+ \newcommand{\remarkname}{Comentário}
+ \newcommand{\assumptionname}{Assunto}
+ \newcommand{\conclusionname}{Conclusão}
+ \newcommand{\solutionname}{Soluções}
+ \newcommand{\propertyname}{Propiedade}
+ \newcommand{\introductionname}{Introdução}
+ \newcommand{\problemsetname}{Questão}
+ \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
+ \newcommand{\updatename}{Atualização: }
+ \newcommand{\ebibname}{Bibliografia}
+ \newcommand{\historyname}{Histórico de versões}
+}{\relax}
+
+
+\ifdefstring{\ELEGANT@lang}{jp}{
+ \RequirePackage{luatexja}
+ \setlength\parindent{2em}
+ \renewcommand{\contentsname}{目次}
+ \newcommand\figref[1]{\textbf{図}~\ref{#1}}
+ \newcommand\tabref[1]{\textbf{表}~\ref{#1}}
+ \renewcommand{\partname}{\color{structurecolor}}
+ \renewcommand{\listfigurename}{イラストカタログ}
+ \renewcommand{\listtablename}{表カタログ}
+ \renewcommand{\bibname}{参考文献}
+ \renewcommand{\appendixname}{付録}
+ \renewcommand{\chaptername}{第 \thechapter 章}
+ \newcommand{\authorname}{\textbf{著者:}}
+ \newcommand{\institutename}{\textbf{組織団体:}}
+ \newcommand{\datename}{\textbf{日付:}}
+ \newcommand{\versionname}{\textbf{\citshape バージョン:}}
+ \newcommand{\notename}{ノート}
+ \newcommand{\proofname}{証明}
+ \newcommand{\problemname}{問題}
+ \newcommand{\definitionname}{定義}
+ \newcommand{\theoremname}{定理}
+ \newcommand{\axiomname}{公理}
+ \newcommand{\postulatename}{公準}
+ \newcommand{\lemmaname}{補題}
+ \newcommand{\propositionname}{命題}
+ \newcommand{\corollaryname}{系}
+ \newcommand{\examplename}{例題}
+ \newcommand{\instancename}{例}
+ \newcommand{\exercisename}{練習}
+ \newcommand{\remarkname}{注}
+ \newcommand{\assumptionname}{仮設}
+ \newcommand{\conclusionname}{結論}
+ \newcommand{\solutionname}{解答}
+ \newcommand{\propertyname}{性質}
+ \newcommand{\introductionname}{内容概要}
+ \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}}
+ \newcommand{\updatename}{更新:}
+ \newcommand{\ebibname}{参考文献}
+ \newcommand{\historyname}{バージョン更新履歴}
+}{\relax}
+
+
\graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}}
\RequirePackage{tikz} %% load tikz without tikz
@@ -698,12 +826,19 @@
\setlist[itemize,2]{label={\eitemii}}
\setlist[itemize,3]{label={\eitemiii}}
-
-\RequirePackage[center,pagestyles]{titlesec}
\RequirePackage{apptools}
+
+% appendix chapter:
+
+\ifdefstring{\ELEGANT@lang}{cn}{
+ \ifdefstring{\ELEGANT@scheme}{chinese}{
+ \newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{
+ \newcommand{\xchaptertitle}{第 \thechapter{} 章}} }{
+ \newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
+
\setcounter{secnumdepth}{5}
\titleformat{\chapter}[\style]{\bfseries}{
- \filcenter\LARGE\enspace\bfseries{\color{structurecolor} \IfAppendix{\appendixname\;\thechapter}{\chaptername}\;}}{1pt}{
+ \filcenter\LARGE\enspace\bfseries{\color{structurecolor} \IfAppendix{\appendixname\;\thechapter\;}{\xchaptertitle\;}}}{1pt}{
\LARGE\bfseries\color{structurecolor}\filcenter}[]
\titleformat{\section}[hang]{\bfseries}{
\Large\bfseries{\color{structurecolor}\thesection}\enspace}{1pt}{%
@@ -720,7 +855,6 @@
-
%%define the note and proof environment
\RequirePackage{pifont,manfnt,bbding}
\RequirePackage[many]{tcolorbox}
@@ -774,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}
@@ -827,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}
% main(green-def): example exercise problem solution
@@ -921,9 +1055,10 @@
\RequirePackage{adforn}
-\newenvironment{problemset}[1][\chaptername~\;\exercisename]{
+\newenvironment{problemset}[1][\xchaptertitle~\exercisename]{
+ \vspace*{10pt}
\begin{center}
- \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\chaptername\;\exercisename}{\exercisename}}
+ \phantomsection\addcontentsline{toc}{section}{\texorpdfstring{\xchaptertitle~\exercisename}{\exercisename}}
% \markboth{#1}{\rightmark}
\markright{#1}
\textcolor{structurecolor}{\Large\bfseries\adftripleflourishleft~#1~\adftripleflourishright}
@@ -948,7 +1083,7 @@
\fancyhf{}
-\fancyfoot[c]{\color{structurecolor}\scriptsize\thepage}
+\fancyfoot[c]{\color{structurecolor}\small\thepage}
\if@twoside
\fancyhead[EL]{\color{structurecolor}\cnormal\leftmark}
\fancyhead[OR]{\color{structurecolor}\cnormal\rightmark}
@@ -962,8 +1097,7 @@
% \renewcommand{\headrule}{}
\fancypagestyle{plain}{\renewcommand{\headrulewidth}{0pt}\fancyhf{}\renewcommand{\headrule}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\, #1}{}}
-\renewcommand{\chaptermark}[1]{\markboth{\chaptername\, #1}{}}
-
+\renewcommand{\chaptermark}[1]{\markboth{\xchaptertitle\, #1}{}}
\renewcommand*{\maketitle}{%
@@ -1058,7 +1192,7 @@
breaklines=true,
keywordstyle=\color{winered},
commentstyle=\color{gray},
- emph={elegantpaper,fontenc,fontspec,xeCJK,citestyle,FiraMono,xunicode,newtxmath,figure,fig,image,img,table,itemize,enumerate,newtxtext,newtxtt,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},
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},
frame=single,
@@ -1125,3 +1259,33 @@
\thispagestyle{empty}%
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
+
+
+% https://tex.stackexchange.com/questions/56839/chaptername-is-used-even-for-appendix-chapters-in-toc
+\usepackage{calc}
+\usepackage[titles]{tocloft}
+\ifdefstring{\ELEGANT@lang}{cn}{
+ \renewcommand{\cftchappresnum}{\beforechap\space}
+ \renewcommand{\cftchapaftersnum}{\space\afterchap}
+ \setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}}
+ \g@addto@macro\appendix{%
+ \addtocontents{toc}{%
+ \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
+ \protect\renewcommand{\protect\cftchapaftersnum}{}%
+ }%
+ }
+}{
+ \renewcommand{\cftchappresnum}{\chaptername\space}
+ \renewcommand{\cftchapaftersnum}{\space}
+ \setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~9}}}
+ \g@addto@macro\appendix{%
+ \addtocontents{toc}{%
+ \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
+ \protect\renewcommand{\protect\cftchapaftersnum}{}%
+ \setlength{\cftchapnumwidth}{\widthof{\textbf{Appendix~999}}}
+ }%
+ }
+}
+
+% restore the tt default family to lmodern tt family
+\renewcommand\ttdefault{lmtt} \ No newline at end of file
diff --git a/macros/latex/contrib/elegantbook/image/cert.pdf b/macros/latex/contrib/elegantbook/image/cert.pdf
deleted file mode 100644
index 0ff3e5029c..0000000000
--- a/macros/latex/contrib/elegantbook/image/cert.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/latex/contrib/elegantbook/image/donate.jpg b/macros/latex/contrib/elegantbook/image/donate.jpg
deleted file mode 100644
index 60741efcde..0000000000
--- a/macros/latex/contrib/elegantbook/image/donate.jpg
+++ /dev/null
Binary files differ