mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 04:14:35 +08:00
为兼容 2022/05/16 前的 hyperref 增加判断
This commit is contained in:
@@ -844,10 +844,20 @@
|
|||||||
\ifdefstring{\ELEGANT@lang}{cn}{
|
\ifdefstring{\ELEGANT@lang}{cn}{
|
||||||
\ifdefstring{\ELEGANT@scheme}{chinese}{
|
\ifdefstring{\ELEGANT@scheme}{chinese}{
|
||||||
\newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{
|
\newcommand{\xchaptertitle}{第\zhnumber{\arabic{chapter}}章} }{
|
||||||
\newcommand{\xchaptertitle}{第 \thechapter{} 章}}
|
\newcommand{\xchaptertitle}{第 \thechapter{} 章}}
|
||||||
\patchcmd{\NR@chapter}%
|
% Hyperref 2022/05/16's changelog.txt said
|
||||||
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
% * nameref is loaded always and earlier (issue#235)
|
||||||
{}{\fail}
|
\IfPackageAtLeastTF{hyperref}{2022/05/16}
|
||||||
|
{
|
||||||
|
\patchcmd{\NR@chapter}%
|
||||||
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
|
{}{\fail}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
\patchcmd{\Hy@org@chapter}%
|
||||||
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
|
{}{\fail}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
{\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
||||||
|
|
||||||
@@ -1381,9 +1391,17 @@ beforechap\newpage%
|
|||||||
\setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}}
|
\setlength{\cftchapnumwidth}{\widthof{\textbf{附录~999}}}
|
||||||
\g@addto@macro\appendix{%
|
\g@addto@macro\appendix{%
|
||||||
% recover \thechapter in the \NR@chapter's \numberline
|
% recover \thechapter in the \NR@chapter's \numberline
|
||||||
\patchcmd{\NR@chapter}
|
\IfPackageAtLeastTF{hyperref}{2022/05/16}
|
||||||
{\numberline{\xchaptertitle}}
|
{
|
||||||
{\numberline{\thechapter}}{}{}
|
\patchcmd{\NR@chapter}%
|
||||||
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
|
{}{\fail}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
\patchcmd{\Hy@org@chapter}%
|
||||||
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
|
{}{\fail}
|
||||||
|
}
|
||||||
\addtocontents{toc}{%
|
\addtocontents{toc}{%
|
||||||
\protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
|
\protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}%
|
||||||
\protect\renewcommand{\protect\cftchapaftersnum}{}%
|
\protect\renewcommand{\protect\cftchapaftersnum}{}%
|
||||||
|
|||||||
Reference in New Issue
Block a user