将 scheme=chinese 时的“第1章”改为“第一章”

This commit is contained in:
syvshc
2022-05-28 03:16:38 +08:00
parent 48f19691fc
commit b1585deeb9
2 changed files with 18 additions and 9 deletions

View File

@@ -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}

View File

@@ -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}{}%