diff --git a/CHANGELOG.md b/CHANGELOG.md index a4bffef..c0f0d88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## Added + +- 新增对 `\noopsort` 的支持,与 `xampl.bib` 兼容([CTeX-org/forum#315](https://github.com/CTeX-org/forum/issues/315))。 + ## [v2.1.6] - 2024-03-08 ## Added diff --git a/gbt7714.dtx b/gbt7714.dtx index dad5e23..7633f61 100644 --- a/gbt7714.dtx +++ b/gbt7714.dtx @@ -810,6 +810,15 @@ % \end{macrocode} % \end{environment} % +% Patch \pkg{natbib} 内部命令,以支持 \cs{noopsort}。 +% 参考 \url{https://tex.stackexchange.com/a/39718/82731}。 +% \begin{macrocode} +\let\NAT@bare@aux\NAT@bare +\def\NAT@bare#1(#2){% + \begingroup\edef\x{\endgroup + \unexpanded{\NAT@bare@aux#1}(\@firstofone#2)}\x} +% \end{macrocode} +% % \begin{macro}{\url} % 使用 \pkg{xurl} 宏包的方法,增加 URL 可断行的位置。 % \begin{macrocode} diff --git a/gbt7714.sty b/gbt7714.sty index 2f92190..6ced533 100644 --- a/gbt7714.sty +++ b/gbt7714.sty @@ -293,6 +293,10 @@ \if*#2*\else\textsuperscript{#2}\fi \fi}{#1}{#2}} \renewcommand\@biblabel[1]{[#1]\hfill} +\let\NAT@bare@aux\NAT@bare +\def\NAT@bare#1(#2){% + \begingroup\edef\x{\endgroup + \unexpanded{\NAT@bare@aux#1}(\@firstofone#2)}\x} \g@addto@macro\UrlBreaks{% \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9% \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M