mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 04:14:35 +08:00
fix the patch for hyperref before 2022/05/16
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
\documentclass[lang=cn,10pt,scheme=chinese]{elegantbook}
|
\documentclass[lang=cn,10pt]{elegantbook}
|
||||||
|
|
||||||
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
|
\title{ElegantBook:优美的 \LaTeX{} 书籍模板}
|
||||||
\subtitle{Elegant\LaTeX{} 经典之作}
|
\subtitle{Elegant\LaTeX{} 经典之作}
|
||||||
|
|
||||||
\author{Ethan Deng \& Liam Huang}
|
\author{Ethan Deng \& Liam Huang}
|
||||||
\institute{Elegant\LaTeX{} Program}
|
\institute{Elegant\LaTeX{} Program}
|
||||||
\date{May 28, 2022}
|
\date{June, 6, 2022}
|
||||||
\version{4.4}
|
\version{4.4}
|
||||||
\bioinfo{自定义}{信息}
|
\bioinfo{自定义}{信息}
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,10 @@
|
|||||||
pdfborder={0 0 0},
|
pdfborder={0 0 0},
|
||||||
linktocpage
|
linktocpage
|
||||||
}
|
}
|
||||||
|
\newif\ifELEGANT@Hy@later
|
||||||
|
\@ifpackagelater{hyperref}{2022/05/16}
|
||||||
|
{\ELEGANT@Hy@latertrue}
|
||||||
|
{\ELEGANT@Hy@laterfalse}
|
||||||
|
|
||||||
%% device settings
|
%% device settings
|
||||||
\RequirePackage{geometry}
|
\RequirePackage{geometry}
|
||||||
@@ -847,16 +851,16 @@
|
|||||||
\newcommand{\xchaptertitle}{第 \thechapter{} 章}}
|
\newcommand{\xchaptertitle}{第 \thechapter{} 章}}
|
||||||
% Hyperref 2022/05/16's changelog.txt said
|
% Hyperref 2022/05/16's changelog.txt said
|
||||||
% * nameref is loaded always and earlier (issue#235)
|
% * nameref is loaded always and earlier (issue#235)
|
||||||
\IfPackageAtLeastTF{hyperref}{2022/05/16}
|
\AtBeginDocument{
|
||||||
{
|
\ifELEGANT@Hy@later
|
||||||
\patchcmd{\NR@chapter}%
|
\patchcmd{\NR@chapter}%
|
||||||
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
{}{\fail}
|
{}{\fail}
|
||||||
}
|
\else
|
||||||
{
|
|
||||||
\patchcmd{\Hy@org@chapter}%
|
\patchcmd{\Hy@org@chapter}%
|
||||||
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
{\numberline{\thechapter}}{\numberline{\xchaptertitle}}%
|
||||||
{}{\fail}
|
{}{\fail}
|
||||||
|
\fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
{\newcommand{\xchaptertitle}{\chaptername~\thechapter~}}
|
||||||
@@ -1391,17 +1395,15 @@ 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
|
||||||
\IfPackageAtLeastTF{hyperref}{2022/05/16}
|
\ifELEGANT@Hy@later
|
||||||
{
|
|
||||||
\patchcmd{\NR@chapter}%
|
\patchcmd{\NR@chapter}%
|
||||||
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
{}{\fail}
|
{}{\fail}
|
||||||
}
|
\else
|
||||||
{
|
|
||||||
\patchcmd{\Hy@org@chapter}%
|
\patchcmd{\Hy@org@chapter}%
|
||||||
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
{\numberline{\xchaptertitle}}{\numberline{\thechapter}}%
|
||||||
{}{\fail}
|
{}{\fail}
|
||||||
}
|
\fi
|
||||||
\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