From c536351538213b032ece45860e3b1e4c6eeec5c0 Mon Sep 17 00:00:00 2001 From: myhsia Date: Sat, 28 Feb 2026 15:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=B8=80=E4=BA=9B=E7=94=A8?= =?UTF-8?q?=E6=B3=95=201.=20=E6=B3=A8=E6=84=8F.gitignore=20=E8=A6=81?= =?UTF-8?q?=E6=8A=8A=20build=20=E6=96=87=E4=BB=B6=E5=A4=B9=E5=8A=A0?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=202.=20=E7=B1=BB=E4=BC=BC=20`\LaTeX{}=20`=20?= =?UTF-8?q?=E7=9A=84=20hologo=20=E6=9B=BF=E6=8D=A2=E4=B8=BA=20`\LaTeX\=20`?= =?UTF-8?q?=203.=20lua=20=E4=B8=AD,=20=E7=94=B1=E4=BA=8E=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BA=86=20`latexmk`,=20=E5=88=99=E9=9C=80=E8=A6=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=20`typesetruns`=20=E4=B8=BA=201,=20=E5=90=A6=E5=88=99?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BB=96=E7=BB=99=E4=BD=A0=E8=B7=91=E4=B8=89?= =?UTF-8?q?=E9=81=8D,=20=E6=B5=AA=E8=B4=B9=E6=97=B6=E9=97=B4;=20`l3build`?= =?UTF-8?q?=20=E5=AE=98=E6=96=B9=E6=8F=90=E4=BE=9B=E4=BA=86=20specialtypes?= =?UTF-8?q?etting=20=E7=94=A8=E6=88=B7=E6=8E=A5=E5=8F=A3,=20=E6=97=A0?= =?UTF-8?q?=E9=9C=80=E7=94=A8=20`string.match`=20=E8=BF=99=E7=A7=8D?= =?UTF-8?q?=E5=86=85=E9=83=A8=E5=91=BD=E4=BB=A4;=20description=20=E7=AD=89?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E6=96=AD=E8=A1=8C=EF=BC=8C=20=E5=90=A6?= =?UTF-8?q?=E5=88=99=20CTAN=20=E6=94=B6=E5=88=B0=E7=9A=84=E4=B9=9F?= =?UTF-8?q?=E6=98=AF=E6=96=AD=E8=A1=8C=E7=89=88,=20=E8=99=BD=E7=84=B6?= =?UTF-8?q?=E4=BB=96=E4=BB=AC=E4=BC=9A=E4=BA=BA=E5=B7=A5=E5=B9=B2=E9=A2=84?= =?UTF-8?q?=E9=98=BB=E6=AD=A2=E8=BF=99=E4=B8=80=E8=A1=8C=E4=B8=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ build.lua | 27 ++++++++++------------- elegantbook-cn.tex | 54 +++++++++++++++++++++++----------------------- elegantbook-en.tex | 32 +++++++++++++-------------- 4 files changed, 57 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index 086d2ad..a625eee 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,9 @@ elegant*-en.pdf *.synctex.gz *.synctex.gz(busy) *.pdfsync +/build +*.curlopt +*.zip ## Auxiliary and intermediate files from other packages: # algorithms diff --git a/build.lua b/build.lua index 76b29d1..b024213 100644 --- a/build.lua +++ b/build.lua @@ -1,5 +1,5 @@ --[==========================================[-- - L3BUILD FILE FOR ELEGANTBOOK + L3BUILD FILE FOR ELEGANTBOOK Check PDF File & Directory After Build --]==========================================]-- @@ -17,11 +17,7 @@ repository = "https://github.com/" .. maintainid .. "/" .. module announcement = "" note = "" summary = "Elegant LaTeX Template for Books" -description = [[ -ElegantBook is designed for writing Books. This template is based on -the standard LaTeX book class. The goal of this template is -to make the writing process more elegant. -]] +description = [[ElegantBook is designed for writing Books. This template is based on the standard LaTeX book class. The goal of this template is to make the writing process more elegant.]] --[==========================================[-- Build, Pack and Upload To CTAN @@ -30,10 +26,15 @@ to make the writing process more elegant. ctanzip = module excludefiles = {"*~"} textfiles = {"*.md", "LICENSE", "*.lua", "*.cls", "*.bib"} +typesetexe = "latexmk -pdf" typesetfiles = {module .. "-cn.tex", module .. "-en.tex"} +typesetopts = "-interaction=nonstopmode" typesetsuppfiles = {"*.cls", "*.bib"} +typesetruns = 1 imagesuppdir = "image" figuresuppdir = "figure" +specialtypesetting = specialtypesetting or {} +specialtypesetting[module .. "-cn.tex"] = {cmd = "latexmk -xelatex"} uploadconfig = { pkg = module, @@ -55,16 +56,10 @@ uploadconfig = { update = true } --- cn uses XeLaTeX, en uses pdfLaTeX -function typeset(file, dir, exe) - dir = dir or typesetdir - local cmd - if string.match(file, "%-cn%.tex$") then - cmd = "latexmk -pdfxe -interaction=nonstopmode " - else - cmd = "latexmk -pdf -interaction=nonstopmode " - end - return run(dir, cmd .. file) +function tex(file, dir, cmd) + dir = dir or "." + cmd = cmd or typesetexe .. " " .. typesetopts + return run(dir, cmd .. " " .. file) end -- Copy required files into the typeset build dir diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 7054797..2a5c95c 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,10 +1,10 @@ \documentclass[lang=cn,newtx,10pt,scheme=chinese]{elegantbook} -\title{ElegantBook:优美的 \LaTeX{} 书籍模板} -\subtitle{Elegant\LaTeX{} 经典之作} +\title{ElegantBook:优美的 \LaTeX\ 书籍模板} +\subtitle{Elegant\LaTeX\ 经典之作} \author{Ethan Deng \& Liam Huang \& syvshc \& sikouhjw \& Osbert Wang} -\institute{Elegant\LaTeX{} Program} +\institute{Elegant\LaTeX\ Program} \date{2026/2/27} \version{4.6} \bioinfo{自定义}{信息} @@ -36,16 +36,16 @@ \mainmatter -\chapter{Elegant\LaTeX{} 系列模板介绍} +\chapter{Elegant\LaTeX\ 系列模板介绍} \begin{quotation} \textbf{\textcolor{red}{本模板自 2023 年 1 月 1 日起停止维护,并不建议使用,但鉴于用户群体庞大,自 2026 年起重新发布。为保证之前版本的用户仍能查阅说明文档,本说明文档保留了过往信息。}} \end{quotation} -Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。大版本改动较大,请关注版本信息,在未开始使用模板前,建议直接选择最新正式版本! +Elegant\LaTeX\ 项目组致力于打造一系列美观、优雅、简便的模板方便用户使用。目前由 \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote},\href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook},\href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper} 组成,分别用于排版笔记,书籍和工作论文。大版本改动较大,请关注版本信息,在未开始使用模板前,建议直接选择最新正式版本! -本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX{} 或者 Elegant\LaTeX{} 相关内容。 +本文将介绍本模板的一些设置内容以及基本使用方法。如果您有其他问题,建议或者意见,欢迎在 GitHub 上给我们提交 \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} 或者邮件联系我们。我们的联系方式如下,建议加入用户 QQ 群提问,这样能更快获得准确的反馈,加群时请备注 \LaTeX\ 或者 Elegant\LaTeX\ 相关内容。 \begin{itemize} \item GitHub 地址:\href{https://github.com/ElegantLaTeX/}{https://github.com/ElegantLaTeX/} \item CTAN 地址:\href{https://ctan.org/pkg/elegantbook}{https://ctan.org/pkg/elegantbook} @@ -57,11 +57,11 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \section{模板安装与更新} -你可以通过免安装的方式使用本模板,包括在线使用和本地(文件夹内)使用两种方式,也可以通过 \TeX{} 发行版安装使用。 +你可以通过免安装的方式使用本模板,包括在线使用和本地(文件夹内)使用两种方式,也可以通过 \TeX\ 发行版安装使用。 \subsection{在线使用模板} -我们把三套模板全部上传到 \href{https://www.overleaf.com/}{Overleaf} 上了,网络便利的用户可以直接通过 Overleaf 在线使用我们的模板。使用 Overleaf 的好处是无需安装 \TeX{} Live,可以随时随地访问自己的文件。查找模板,请在 Overleaf 模板库里面搜索 \lstinline{elegantlatex} 即可,你也可以直接访问\href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{搜索结果}。选择适当的模板之后,将其 \lstinline{Open as Template},即可把模板存到自己账户下,然后可以自由编辑以及与别人一起协作。更多关于 Overleaf 的介绍和使用,请参考 Overleaf 的\href{https://www.overleaf.com/learn}{官方文档}。 +我们把三套模板全部上传到 \href{https://www.overleaf.com/}{Overleaf} 上了,网络便利的用户可以直接通过 Overleaf 在线使用我们的模板。使用 Overleaf 的好处是无需安装 \TeX~Live,可以随时随地访问自己的文件。查找模板,请在 Overleaf 模板库里面搜索 \lstinline{elegantlatex} 即可,你也可以直接访问\href{https://www.overleaf.com/latex/templates?addsearch=elegantlatex}{搜索结果}。选择适当的模板之后,将其 \lstinline{Open as Template},即可把模板存到自己账户下,然后可以自由编辑以及与别人一起协作。更多关于 Overleaf 的介绍和使用,请参考 Overleaf 的\href{https://www.overleaf.com/learn}{官方文档}。 \subsection{本地免安装使用} @@ -71,14 +71,14 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 本模板测试环境为 \begin{enumerate} - \item Win11 + \TeX{} Live 2025; - \item Ubuntu 22.04 + \TeX{} Live 2025; - \item macOS + Mac\TeX{} 2025。 + \item Win11 + \TeX~Live 2025; + \item Ubuntu 22.04 + \TeX~Live 2025; + \item macOS + Mac\TeX\ 2025。 \end{enumerate} -\TeX Live/Mac\TeX{} 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}。 +\TeX Live/Mac\TeX\ 的安装请参考啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX\ 安装的介绍}。 -安装 \TeX{} Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即 +安装 \TeX~Live 之后,安装后建议升级全部宏包,升级方法:使用 cmd 或 terminal 运行 \lstinline{tlmgr update --all},如果 tlmgr 需要更新,请使用 cmd 运行 \lstinline{tlmgr update --self},如果更新过程中出现了中断,请改用 \lstinline{tlmgr update --self --all --reinstall-forcibly-removed} 更新,也即 \begin{lstlisting} tlmgr update --self @@ -86,17 +86,17 @@ 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?} +更多的内容请参考 \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/Mac\TeX{}。更多关于 \TeX{} Live 的安装使用以及 C\TeX{} 与 \TeX{} Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX{} 安装的介绍}。 +由于宏包版本问题,本模板不支持 \CTeX\ 套装,请务必安装 \TeX~Live/Mac\TeX。更多关于 \TeX~Live 的安装使用以及 \CTeX\ 与 \TeX~Live 的兼容、系统路径问题,请参考官方文档以及啸行的\href{https://github.com/OsbertWang/install-latex-guide-zh-cn/releases/}{一份简短的关于安装 \LaTeX\ 安装的介绍}。 \chapter{ElegantBook 设置说明} -本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX{} Live 编译。 +本模板基于基础的 book 文类,所以 book 的选项对于本模板也是有效的(纸张无效,因为模板有设备选项)。默认编码为 UTF-8,推荐使用 \TeX~Live 编译。 \section{语言模式} 本模板内含两套基础语言环境 \lstinline{lang=cn}、\lstinline{lang=en}。改变语言环境会改变图表标题的引导词(图,表),文章结构词(比如目录,参考文献等),以及定理环境中的引导词(比如定理,引理等)。不同语言模式的启用如下: @@ -221,7 +221,7 @@ tlmgr update --self --all --reinstall-forcibly-removed \subsection{封面图} -本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX{} 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}。},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用。 +本模板使用的封面图片来源于 \href{https://pixabay.com/en/tea-time-poetry-coffee-reading-3240766/}{pixabay.com}\footnote{感谢 China\TeX\ 提供免费图源网站,另外还推荐 \href{https://www.pexels.com/}{pexels.com}。},图片完全免费,可用于任何场景。封面图片的尺寸为 $1280 \times 1024$, 更换图片的时候请\textbf{严格}按照封面图片尺寸进行裁剪。推荐一个免费的在线图片裁剪网站 \href{https://www.fotor.com/cn}{fotor.com}。用户 QQ 群内有一些合适尺寸的封面,欢迎取用。 \subsection{徽标} @@ -747,7 +747,7 @@ The content of introduction. 本模板定义了一个数学字体选项(\lstinline{math}),可选项有三个: \begin{enumerate} - \item \lstinline{math=cm}(默认),使用 \LaTeX{} 默认数学字体(推荐,无需声明); + \item \lstinline{math=cm}(默认),使用 \LaTeX\ 默认数学字体(推荐,无需声明); \item \lstinline{math=newtx},使用 \lstinline{newtxmath} 设置数学字体(潜在问题比较多)。 \item \lstinline{math=mtpro2},使用 \lstinline{mtpro2} 宏包设置数学字体,要求用户已经成功安装此宏包。 \end{enumerate} @@ -804,7 +804,7 @@ LaTeX Error: \end{enumerate} \subsection{方正字体选项} -由于使用 \lstinline{ctex} 宏包默认调用系统已有的字体,部分系统字体缺失严重,因此,用户希望能够使用其它字体,我们推荐使用方正字体。方正的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}、{\fangsong 方正仿宋}四款字体均可免费试用,且可用于商业用途。用户可以自行从\href{http://www.foundertype.com/}{方正字体官网}下载此四款字体,在下载的时候请\textbf{务必}注意选择 GBK 字符集,也可以使用 \href{https://www.latexstudio.net/}{\LaTeX{} 工作室}提供的\href{https://pan.baidu.com/s/1BgbQM7LoinY7m8yeP25Y7Q}{方正字体,提取码为:njy9} 进行安装。安装时,{\kaishu Win 10 用户请右键选择为全部用户安装,否则会找不到字体。} +由于使用 \lstinline{ctex} 宏包默认调用系统已有的字体,部分系统字体缺失严重,因此,用户希望能够使用其它字体,我们推荐使用方正字体。方正的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}、{\fangsong 方正仿宋}四款字体均可免费试用,且可用于商业用途。用户可以自行从\href{http://www.foundertype.com/}{方正字体官网}下载此四款字体,在下载的时候请\textbf{务必}注意选择 GBK 字符集,也可以使用 \href{https://www.latexstudio.net/}{\LaTeX\ 工作室}提供的\href{https://pan.baidu.com/s/1BgbQM7LoinY7m8yeP25Y7Q}{方正字体,提取码为:njy9} 进行安装。安装时,{\kaishu Win 10 用户请右键选择为全部用户安装,否则会找不到字体。} \begin{figure}[!htb] \centering @@ -942,15 +942,15 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \item \question{大佬,我想把正文字体改为亮色,背景色改为黑灰色。} 页面颜色可以使用 \lstinline{\pagecolor} 命令设置,文本命令可以参考\href{https://tex.stackexchange.com/questions/278544/xcolor-what-is-the-equivalent-of-default-text-color}{这里}进行设置。 \item \question{\lstinline{! LaTeX Error: Unknown option 'scheme=plain' for package 'ctex'.}} - 你用的 C\TeX{} 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 C\TeX{} 套装了,请卸载并安装 \TeX{} Live 2025。 + 你用的 \CTeX\ 套装吧?这个里面的 \lstinline{ctex} 宏包已经是已经是 10 年前的了,与本模板使用的 \lstinline{ctex} 宏集有很大区别。不建议 \CTeX\ 套装了,请卸载并安装 \TeX~Live 2025。 \item \question{我该使用什么版本?} - 请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX{} Live 2025 内获取。 + 请务必使用\href{https://github.com/ElegantLaTeX/ElegantBook/releases}{最新正式发行版},发行版间不定期可能会有更新(修复 bug 或者改进之类),如果你在使用过程中没有遇到问题,不需要每次更新\href{https://github.com/ElegantLaTeX/ElegantBook/archive/master.zip}{最新版},但是在发行版更新之后,请尽可能使用最新版(发行版)!最新发行版可以在 GitHub 或者 \TeX~Live 2025 内获取。 \item \question{我该使用什么编辑器?} - 你可以使用 \TeX{} Live 2025 自带的编辑器 \TeX{}works 或者使用 \TeX{}studio,\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX{} Live 2025 + \TeX{}studio。我(注:此为前维护者)自己用 VS Code 和 Sublime Text,相关的配置说明,请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX{} 编译环境配置:Visual Studio Code 配置简介} 和 \href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX{} 编写环境}。 + 你可以使用 \TeX~Live 2025 自带的编辑器 \TeX works 或者使用 \TeX studio,\TeX works 的自动补全,你可以参考我们的总结 \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works 自动补全}。推荐使用 \TeX~Live 2025 + \TeX studio。我(注:此为前维护者)自己用 VS Code 和 Sublime Text,相关的配置说明,请参考 \href{https://github.com/EthanDeng/vscode-latex}{\LaTeX\ 编译环境配置:Visual Studio Code 配置简介} 和 \href{https://github.com/EthanDeng/sublime-text-latex}{Sublime Text 搭建 \LaTeX\ 编写环境}。 \item \question{您好,我们想用您的 ElegantBook 模板写一本书。关于机器学习的教材,希望获得您的授权,谢谢您的宝贵时间。} - 模板的使用修改都是自由的,你们声明模板来源以及模板地址(GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX{} 用户作品集里。 + 模板的使用修改都是自由的,你们声明模板来源以及模板地址(GitHub 地址)即可,其他未尽事宜按照开源协议 LPPL-1.3c。做好之后,如果方便的话,可以给我们一个链接,我把你们的教材放在 Elegant\LaTeX\ 用户作品集里。 \item \question{请问交叉引用是什么?} - 本群和本模板适合有一定 \LaTeX{} 基础的用户使用,新手请先学习 \LaTeX{} 的基础,理解各种概念,否则你将寸步难行。 + 本群和本模板适合有一定 \LaTeX\ 基础的用户使用,新手请先学习 \LaTeX\ 的基础,理解各种概念,否则你将寸步难行。 \item \question{代码高亮环境能用其他语言吗?} 可以的,ElegantBook 模板用的是 \lstinline{listings} 宏包,你可以在环境(\lstinline{lstlisting})之后加上语言(比如 Python 使用 \lstinline{language=Python} 选项),全局语言修改请使用 \lstinline{lstset} 命令,更多信息请参考宏包文档。 \item \question{群主,什么时候出 Beamer 的模板(主题),ElegantSlide 或者 ElegantBeamer?} @@ -966,7 +966,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \begin{change} \item 确认新维护者啸行并恢复维护。 \item 鉴于用户群体庞大,模板重新发布。 - \item 更新以支持 \TeX{} Live 2025 及当前主流操作系统(Windows 11、Ubuntu 24.04 LTS、macOS)。 + \item 更新以支持 \TeX~Live 2025 及当前主流操作系统(Windows 11、Ubuntu 24.04 LTS、macOS)。 \end{change} \datechange{2022/12/31}{版本 4.5} \textcolor{red}{\bfseries 停止维护!} @@ -1026,7 +1026,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \begin{change} \item \textbf{重要修正}:修复因为 \lstinline{gbt7714} 宏包更新导致的 \lstinline{natbib option clash} 错误; - \item 由于 \lstinline{pgfornament} 宏包未被 \TeX{} Live 2020 收录,因此删除 base 相关的内容; + \item 由于 \lstinline{pgfornament} 宏包未被 \TeX~Live 2020 收录,因此删除 base 相关的内容; \item 修复部分环境的空格问题; \item 增加了意大利语言选项 \lstinline{lang=it}。 \end{change} @@ -1036,7 +1036,7 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \begin{change} \item 增加数学字体选项 \lstinline{math},可选项为 \lstinline{newtx} 和 \lstinline{cm}。\\ - \textbf{重要提示}:原先通过 \lstinline{newtxmath} 宏包设置的数学字体改为 \LaTeX{} 默认数学字体,如果需要保持原来的字体,需要显式声明数学字体(\lstinline{math=newtx}); + \textbf{重要提示}:原先通过 \lstinline{newtxmath} 宏包设置的数学字体改为 \LaTeX\ 默认数学字体,如果需要保持原来的字体,需要显式声明数学字体(\lstinline{math=newtx}); \item 新增中文字体选项 \lstinline{chinesefont},可选项为 \lstinline{ctexfont}、\lstinline{founder} 和 \lstinline{nofont}。 \item 将封面作者信息设置为可选,并且增加自定义信息命令 \lstinline{\bioinfo}; \item 在说明文档中增加版本历史,新增 \lstinline{\datechange} 命令和 \lstinline{change} 环境; diff --git a/elegantbook-en.tex b/elegantbook-en.tex index bbc4a0e..f08015e 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -1,10 +1,10 @@ \documentclass[11pt]{elegantbook} -\title{An Elegant \LaTeX{} Template for Books} -\subtitle{Classic Elegant\LaTeX{} Template} +\title{An Elegant \LaTeX\ Template for Books} +\subtitle{Classic Elegant\LaTeX\ Template} \author{Ethan Deng, Liam Huang, syvshc, sikouhjw \& Osbert Wang} -\institute{Elegant\LaTeX{} Program} +\institute{Elegant\LaTeX\ Program} \date{Feb. 27, 2026} \version{4.6} \bioinfo{Bio}{Information} @@ -30,8 +30,8 @@ \mainmatter -\chapter{Elegant\LaTeX{} Templates} -Elegant\LaTeX{} Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX{} is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}. +\chapter{Elegant\LaTeX\ Templates} +Elegant\LaTeX\ Program developers are intended to provide you beautiful, elegant, user-friendly templates. Currently, the Elegant\LaTeX\ is composed of \href{https://github.com/ElegantLaTeX/ElegantNote}{ElegantNote}, \href{https://github.com/ElegantLaTeX/ElegantBook}{ElegantBook}, \href{https://github.com/ElegantLaTeX/ElegantPaper}{ElegantPaper}, designed for typesetting notes, books, and working papers respectively. Latest releases are strongly recommended! This guide is aimed at briefly introducing the 101 of this template. For any other question, suggestion or comment, feel free to contact us on GitHub \href{https://github.com/ElegantLaTeX/ElegantBook/issues}{issues} or email us at \email{elegantlatex2e@gmail.com}. Contact Infos: \begin{itemize} @@ -56,16 +56,16 @@ tlmgr update --self tlmgr update --all \end{lstlisting} -To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX{} distribution?} +To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \TeX\ distribution?} \section{Other Release Versions} -If you are using a \TeX{} Live version prior to 2025 and wish to update the template, the official solution is to uninstall the previous version. -If you want to save the trouble of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of your \TeX{} Live (default for \TeX{} Live 2025: \lstinline|C:\texlive\2025\texmf-dist\tex\latex\elegantbook|; replace "2025" with your actual version), and then run \lstinline{texhash} in the command prompt. +If you are using a \TeX~Live version prior to 2025 and wish to update the template, the official solution is to uninstall the previous version. +If you want to save the trouble of uninstallation and re-installation, please copy \lstinline{elegantbook.cls} to the installation directory of your \TeX~Live (default for \TeX~Live 2025: \lstinline|C:\texlive\2025\texmf-dist\tex\latex\elegantbook|; replace "2025" with your actual version), and then run \lstinline{texhash} in the command prompt. \chapter{ElegantBook Settings} -This template is based on the Standard \LaTeX{} book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX{} Live is recommended. The test environments are Windows 10/11, Ubuntu 24.04 LTS, and macOS with \TeX{} Live 2025/ Mac\TeX{} 2025. Both \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine for \lstinline{lang=en}. +This template is based on the Standard \LaTeX\ book class, so the options of book class work as well (Note that the option of papersize has no effect due to \lstinline{device} option). The default encoding is UTF-8 while \TeX~Live is recommended. The test environments are Windows 10/11, Ubuntu 24.04 LTS, and macOS with \TeX~Live 2025/ Mac\TeX\ 2025. Both \hologo{pdfLaTeX} or \hologo{XeLaTeX} works fine for \lstinline{lang=en}. \section{Languages} 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 @@ -372,7 +372,7 @@ This template uses \lstinline{tikz} to customize the list environments, with \ls \section{Fonts} \textcolor{red}{\bfseries Alert} After v3.10, newtx is reset to cm, together with other two options, the \lstinline{math} font option offers: \begin{enumerate} - \item \lstinline{math=cm}(default), use \LaTeX{} default math font (recommended). + \item \lstinline{math=cm}(default), use \LaTeX\ default math font (recommended). \item \lstinline{math=newtx}, use \lstinline{newtxmath} math font (may bring about bugs). \item \lstinline{math=mtpro2}, use \lstinline{mtpro2} package to set math font. \end{enumerate} @@ -678,13 +678,13 @@ 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 2025. + Please use \href{https://github.com/ElegantLaTeX/ElegantBook/releases}{Latest Release} via GitHub or \TeX~Live 2025. \item \question{Which editor should I choose?} - You can use \TeX{} Live 2025 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX{}works autocomplete}. \TeX{} Live 2025 + \TeX{}studio is strongly recommended. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}. + You can use \TeX~Live 2025 built-in \TeX works or \TeX Studio. You may refer to \href{https://github.com/EthanDeng/texworks-autocomplete}{\TeX works autocomplete}. \TeX~Live 2025 + \TeX studio is strongly recommended. Related configurations can be found at \href{https://github.com/EthanDeng/vscode-latex}{vscode-latex} and \href{https://github.com/EthanDeng/sublime-text-latex}{sublime-text-latex}. \item \question{Hello, we want to use ElegantBook to write a book about machine learning and would like your authorization.} 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. + 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?} Yes, \lstinline{listings} package is used in ElegantBook, hence language is optional(e.g. \lstinline{language=Python}). For global setting, use \lstinline{lstset}. For more information, please refer to package documentations. \item \question{When will Beamer template (ElegantSlide or ElegantBeamer) forthcoming?} @@ -699,7 +699,7 @@ We revised our templates now and then. This section shows the version story of E \begin{change} \item Maintenance resumed under new maintainer Osbert Wang. \item Template re-released due to large user base. - \item Updated to support \TeX{} Live 2025 and current operating systems (Windows 11, Ubuntu 24.04 LTS, macOS). + \item Updated to support \TeX~Live 2025 and current operating systems (Windows 11, Ubuntu 24.04 LTS, macOS). \end{change} \datechange{2022/12/31}{release of v4.5.} \textcolor{red}{\bfseries Stop Maintenance} @@ -761,7 +761,7 @@ We revised our templates now and then. This section shows the version story of E \begin{change} \item \textbf{! Fix}: Fix \lstinline{natbib option clash} problems caused by \lstinline{gbt7714} updates. - \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX{} Live 2020. + \item Remove \lstinline{base} decorations and its options since \lstinline{pgfornament} package is not included in \TeX~Live 2020. \item Fix spacing problem in some environments. \item Introduce language option for Italian, \lstinline{lang=it}. \end{change} @@ -771,7 +771,7 @@ We revised our templates now and then. This section shows the version story of E \begin{change} \item Introduce \lstinline{math} for math font, optional styles are \lstinline{newtx} and \lstinline{cm}.\\ - \textbf{Notice}: The math font \lstinline{newtxmath} in previous versions is reset to default \LaTeX{} math font, to keep previous math font, please declare \lstinline{math=newtx}. + \textbf{Notice}: The math font \lstinline{newtxmath} in previous versions is reset to default \LaTeX\ math font, to keep previous math font, please declare \lstinline{math=newtx}. \item Introduce \lstinline{chinesefont} option, with \lstinline{founder}, \lstinline{ctexfont} and \lstinline{nofont} available. \item Turn author information on the cover optional and add customized command \lstinline{\bioinfo}. \item Add version history with command \lstinline{\datechange} and environment \lstinline{change}.