Skip to content

Commit 1a65543

Browse files
committed
Fix invalid cite-style option before natbib loaded (Fix #327)
1 parent 7c0d710 commit 1a65543

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- 专业学位类型 `professional-type` 为空时不再显示括号([#325](https://github.com/ustctug/ustcthesis/issues/325))。
1818

19+
# Fixed
20+
21+
- 修复了载入 `natbib` 前设置 `cite-style` 无效的问题([#327](https://github.com/ustctug/ustcthesis/issues/327))。
22+
1923
## [v3.3.1] - 2021-12-10
2024

2125
### Changed

ustcthesis.cls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@
339339
},
340340
}
341341

342+
% 将 \ustc@cite@style 置空方便后续进行判断。
343+
\def\ustc@cite@style{}
344+
342345
\newif\ifustc@degree@graduate
343346
\newcommand\ustc@set@graduate{%
344347
\ifustc@degree@bachelor
@@ -2720,6 +2723,12 @@
27202723
\@namedef{bibstyle@ustcthesis-authoryear}{\bibstyle@authoryear}
27212724
\@namedef{bibstyle@ustcthesis-bachelor}{\bibstyle@super}
27222725
%
2726+
% 如果载入 `natbib` 前设置了 `cite-style`,这里先进行配置。
2727+
% https://github.com/ustctug/ustcthesis/issues/327
2728+
\ifx\ustc@cite@style\@empty\else
2729+
\citestyle{\ustc@cite@style}%
2730+
\fi
2731+
%
27232732
% 定义接口 cite-style 切换引用样式。
27242733
\ustc@option@hook{cite-style}{%
27252734
\citestyle{\ustc@cite@style}%

0 commit comments

Comments
 (0)