diff --git a/elegantbook-cn.tex b/elegantbook-cn.tex index 92fc152..3526973 100644 --- a/elegantbook-cn.tex +++ b/elegantbook-cn.tex @@ -1,15 +1,15 @@ -\documentclass[cn,10pt]{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{March 8, 2022} +\version{4.2} \bioinfo{自定义}{信息} -\extrainfo{各人自扫门前雪,休管他人瓦上霜。—— 陈元靓} +\extrainfo{不要以为抹消过去,重新来过,即可发生什么改变。—— 比企谷八幡} \setcounter{tocdepth}{3} @@ -20,37 +20,14 @@ \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 @@ -72,23 +49,6 @@ Elegant\LaTeX{} 项目组致力于打造一系列美观、优雅、简便的模 \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{} 发行版安装使用。 @@ -152,7 +112,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} @@ -796,6 +757,17 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 根据用户的反馈,我们不断修正和完善模板。截止到此次更新,ElegantBook 模板在 GitHub 上有将近 100 次提交,正式发行版本(release)有 17 次。由于 3.00 之前版本与现在版本差异非常大,在此不列出 3.00 之前的更新内容。 + +\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 正式发布。} \begin{change} @@ -933,8 +905,8 @@ Lebesgue 积分有几种不同的定义方式。我们将采用逐步定义非 \item 颜色名字重命名。 \end{change} -\nocite{*} -\printbibliography +\nocite{*} +\printbibliography[heading=bibintoc, title=\ebibname] \appendix \chapter{基本数学工具} diff --git a/elegantbook-en.tex b/elegantbook-en.tex index 739a92f..dfe4057 100644 --- a/elegantbook-en.tex +++ b/elegantbook-en.tex @@ -5,8 +5,8 @@ \author{Ethan Deng \& Liam Huang} \institute{Elegant\LaTeX{} Program} -\date{May. 2, 2021} -\version{4.1} +\date{March 8, 2022} +\version{4.2} \bioinfo{Bio}{Information} \extrainfo{Victory won\rq t come to us unless we go to it. } @@ -47,16 +47,15 @@ Contact Infos: \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: +Version 4.2 is the \textit{temporary} version before v4.3 which will be released when \TeX Live 2022 is ready, we add quick bug fix caused by newtx package updates, and multilingual translation \lstinline{lang=jp}. What\rq s new in this version: + +\begin{change} + \item Bug fix due to the update of newtx fonts; + \item Add `Chapter' in TOC, and redefine \lstinline{\chaptername} to unify the logic under different languages; + \item Add language option for Japanese, \lstinline{lang=jp}. + \item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022. +\end{change} -\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. @@ -639,6 +638,15 @@ We list some FAQs for users to refer to: \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. +\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}. + \item \textbf{! Warnings}: Due to this `urgent' fonts bug and TOC modification, the multilingual option may cause some unexpected errors, you can report in this \href{https://github.com/ElegantLaTeX/ElegantBook/issues/170}{issue}, I will fix it after the releases of \TeX{} Live 2022. +\end{change} + \datechange{2021/05/02}{release of v4.1.} @@ -688,7 +696,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/elegantbook.cls b/elegantbook.cls index 9a63626..f2f075c 100644 --- a/elegantbook.cls +++ b/elegantbook.cls @@ -344,16 +344,17 @@ \RequirePackage{makecell,lipsum,hologo} %%中文结构名字 + +%% 章节设置 +\RequirePackage[center,pagestyles]{titlesec} +\RequirePackage[title,titletoc,header]{appendix} + + \RequirePackage[ backend=biber, citestyle=\ELEGANT@citestyle, bibstyle=\ELEGANT@bibstyle]{biblatex} - - - -%% 章节设置 - -\RequirePackage{appendix} +\defbibheading{elegantbook}[\ebibname]{#1} \ifdefstring{\ELEGANT@lang}{cn}{ \renewcommand{\baselinestretch}{1.3} @@ -365,13 +366,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 时间:} @@ -398,12 +398,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: }} @@ -428,6 +432,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:} @@ -441,7 +446,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: }} @@ -466,6 +471,7 @@ \newcommand{\introductionname}{Introduzione} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Aggiornamenti:} + \newcommand{\ebibname}{Bibliografia} \newcommand{\historyname}{Cronologia delle versioni} }{\relax} @@ -476,7 +482,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: }} @@ -501,6 +507,7 @@ \renewcommand{\introductionname}{Introduction} \renewcommand{\problemsetname}{Exercice} \renewcommand{\updatename}{Mises à jour:} + \newcommand{\ebibname}{Bibliographie} \renewcommand{\historyname}{Historique des versions} }{\relax} @@ -510,7 +517,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: }} @@ -536,6 +543,7 @@ \newcommand{\problemsetname}{Probleemcomplex} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Update:} + \newcommand{\ebibname}{Bibliographie} \newcommand{\historyname}{Versie Geschiedenis} }{\relax} @@ -545,7 +553,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: }} @@ -571,6 +579,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} @@ -584,7 +593,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: }} @@ -610,6 +619,7 @@ \newcommand{\introductionname}{Einleitung} \newcommand\bioinfo[2]{\gdef\@bioinfo{\textbf{#1}: #2}} \newcommand{\updatename}{Updates:} + \renewcommand{\ebibname}{Bibliographie} \newcommand{\historyname}{Version der Geschichte} }{\relax} @@ -618,7 +628,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: }} @@ -644,6 +654,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} @@ -654,7 +665,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{Огноо: }} @@ -680,15 +691,17 @@ \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{\spanishchaptername}{Capítulo \thechapter} + \renewcommand{\chaptername}{Capítulo} \newcommand{\authorname}{\textbf{Autor: }} \newcommand{\institutename}{\textbf{Instituição: }} \newcommand{\datename}{\textbf{Data: }} @@ -714,9 +727,53 @@ \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 @@ -736,12 +793,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}{% @@ -959,9 +1023,9 @@ \RequirePackage{adforn} -\newenvironment{problemset}[1][\chaptername~\;\exercisename]{ +\newenvironment{problemset}[1][\xchaptertitle~\exercisename]{ \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} @@ -986,7 +1050,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} @@ -1000,8 +1064,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}{% @@ -1163,3 +1226,30 @@ \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}}} + }% + } +} \ No newline at end of file