Skip to content

Commit

Permalink
Revert removing notoccite and apply hyperref patch (Fix #293)
Browse files Browse the repository at this point in the history
This reverts commit 39eb7c0.
  • Loading branch information
zepinglee committed Jun 4, 2021
1 parent df7fa7c commit d6c1253
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/install-texlive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ BIBLATEX_PKGS="biber biblatex biblatex-gb7714-2015 xstring";
NOMENCL_PKGS="nomencl koma-script xkeyval";

BIN_PKGS="latexmk l3build";
REQUIRED_PKGS="$XECJK_PKGS $CTEX_PKGS caption footmisc filehook multirow \
titlesec unicode-math";
REQUIRED_PKGS="$XECJK_PKGS $CTEX_PKGS caption footmisc filehook notoccite \
multirow titlesec unicode-math";
FONT_PKGS="fandol tex-gyre xits";
EXTRA_PKGS="$ALGORITHM2E_PKGS $BIBLATEX_PKGS $NOMENCL_PKGS siunitx";
DOC_PKGS="booktabs listings xcolor";
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- 修正了与 `chapterbib` 宏包的兼容性。
- 去掉 `notoccite` 宏包,防止造成 PDF 书签中页码的错误(#293)。
- 修正了本科生 PDF 书签中页码的错误(#293)。
- 修正了表题的字体(#295)。
- 修正了 `article` 只有 `date` 时年份缺失的问题(#299)。
- 修正了 biblatex 参考文献的页眉(#311)。
Expand Down
1 change: 1 addition & 0 deletions ustcthesis-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ \subsection{依赖宏包}
\pkg{footmisc},
\pkg{geometry},
\pkg{graphicx},
\pkg{notoccite},
\pkg{titletoc},
\pkg{url},
\pkg{unicode-math}。
Expand Down
13 changes: 13 additions & 0 deletions ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@
\RequirePackage{caption}
\RequirePackage[perpage]{footmisc}
\RequirePackage{url}
\RequirePackage{notoccite}
\RequirePackage{multirow}

% 如果用户在导言区未调用 \pkg{biblatex},则自动调用 \pkg{natbib}。
Expand Down Expand Up @@ -3052,6 +3053,18 @@
\def\theoremautorefname{定理}
\def\HyRef@autopageref#1{\hyperref[{#1}]{第~\pageref*{#1} 页}}
\fi
%
% 本科生需要在 \tableofcontents 处切换 \pagenumbering,
% 在使用了 notoccite 后会导致 PDF 书签的页码有误(#293),
% 所以需要补充 https://tex.stackexchange.com/a/593839/82731 的 patch。
\def\HyPL@StorePageLabel#1{%
\begingroup
\edef\Hy@tempa{\the\Hy@abspage<<#1>>}%
\immediate\write\@mainaux{%
\string\HyPL@Entry{\Hy@tempa}%
}%
\endgroup
}
}


Expand Down

0 comments on commit d6c1253

Please sign in to comment.