From b1585deeb93c6225e95994f5117f0a105b3cbc08 Mon Sep 17 00:00:00 2001 From: syvshc Date: Sat, 28 May 2022 03:16:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20scheme=3Dchinese=20=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E7=AC=AC1=E7=AB=A0=E2=80=9D=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E2=80=9C=E7=AC=AC=E4=B8=80=E7=AB=A0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- elegantbook-cn.tex | 7 ++++--- elegantbook.cls | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index a4fa018..c1de8c3 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,11 +1,11 @@ -\documentclass[lang=cn,10pt]{elegantbook} +\documentclass[lang=cn,10pt,scheme=chinese]{elegantbook} \title{ElegantBook:优美的 \LaTeX{} 书籍模板} \subtitle{Elegant\LaTeX{} 经典之作} \author{Ethan Deng \& Liam Huang} \institute{Elegant\LaTeX{} Program} -\date{May 25, 2022} +\date{May 28, 2022} \version{4.4} \bioinfo{自定义}{信息} @@ -926,11 +926,12 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 根据用户的反馈,我们不断修正和完善模板。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。 -\datechange{2022/05/25}{版本 4.4 正式发布。} +\datechange{2022/05/28}{版本 4.4 正式发布。} \begin{change} \item \textbf{重要改动}:提供了一个定义定理类环境的命令 \lstinline|\elegantnewtheorem|。 \item \textbf{重要改动}:为所有内置定理类环境提供了带星号的版本,带星号的定理类环境不会编号,修复 \href{https://github.com/ElegantLaTeX/ElegantBook/issues/167}{issue: \#167}; + \item \textbf{重要改动}:在 \lstinline{scheme=chinese} 下将目录中的“第 1 章”修改为“第一章”; \item 将 TeX Gyre Termes 改为 TeX Gyre TermesX,使英文部分字形与 newtx 系列宏包更相近; \item 重写了内置定理类环境的实现方法,修复了一些 bug,由于修改部分较大,如果引入了新的 bug,请及时在 QQ 群或 \href{https://github.com/ElegantLaTeX}{Github} 上进行反馈; \end{change} diff --git a/elegantbook.cls b/elegantbook.cls index 555ac65..61b09c8 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -844,8 +844,12 @@ \ifdefstring{\ELEGANT@lang}{cn}{ \ifdefstring{\ELEGANT@scheme}{chinese}{ \newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{ - \newcommand{\xchaptertitle}{第 \thechapter{} 章}} }{ - \newcommand{\xchaptertitle}{\chaptername~\thechapter~}} + \newcommand{\xchaptertitle}{第 \thechapter{} 章}} + \patchcmd{\NR@chapter}% + {\numberline{\thechapter}}{\numberline{\xchaptertitle}}% + {}{\fail} + } + {\newcommand{\xchaptertitle}{\chaptername~\thechapter~}} \setcounter{secnumdepth}{5} \titleformat{\chapter}[\style]{\bfseries}{ @@ -1369,13 +1373,17 @@ beforechap\newpage% % https://tex.stackexchange.com/questions/56839/chaptername-is-used-even-for-appendix-chapters-in-toc -\usepackage{calc} -\usepackage[titles]{tocloft} +\RequirePackage{calc} +\RequirePackage[titles]{tocloft} \ifdefstring{\ELEGANT@lang}{cn}{ - \renewcommand{\cftchappresnum}{\beforechap\space} - \renewcommand{\cftchapaftersnum}{\space\afterchap} + % \renewcommand{\cftchappresnum}{\beforechap\space} + % \renewcommand{\cftchapaftersnum}{\space\afterchap} \setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}} \g@addto@macro\appendix{% + % recover \thechapter in the \NR@chapter's \numberline + \patchcmd{\NR@chapter} + {\numberline{\xchaptertitle}} + {\numberline{\thechapter}}{}{} \addtocontents{toc}{% \protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}% \protect\renewcommand{\protect\cftchapaftersnum}{}%