Skip to content

Commit

Permalink
Fix keyword separator (fix #354)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 13, 2022
1 parent f7db43e commit f488fa2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- 更新 2022 年 3 月版本科生的参考文献格式([#346](https://github.com/ustctug/ustcthesis/issues/346))。
- 研究生的关键词分隔符为空一字和“, ”。

### Fixed

- 修正 `biblatex` 的参考文献表中期刊名的大小写([#338](https://github.com/ustctug/ustcthesis/issues/338))。
- 消除本科生封面的 overfull box 警告([#345](https://github.com/ustctug/ustcthesis/issues/345))。
- 修正本科生的关键词分隔符为“、”和“, ”([#354](https://github.com/ustctug/ustcthesis/issues/354))。

## [v3.3.2] - 2022-03-25

Expand Down
9 changes: 6 additions & 3 deletions ustcthesis-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,15 @@ \subsection{摘要和章节}

\DescribeOption{keywords}
\DescribeOption{keywords*}
摘要的关键词应使用 \cs{ustcsetup} 的接口进行设置,
只要在摘要结束前即可,比如:
摘要的关键词应使用 \cs{ustcsetup} 的接口进行设置,在录入时使用西文逗号隔开,
比如:
\begin{latex}
\begin{abstract}
这里是摘要。
\ustcsetup{keywords = {论文;摘要;关键词}}
\ustcsetup{
keywords = {学位论文, 摘要, 关键词},
keywords* = {dissertation, abstract, keywords},
}
\end{abstract}
\end{latex}

Expand Down
18 changes: 14 additions & 4 deletions ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2335,10 +2335,14 @@

% 中文摘要环境。
\newcommand\ustc@keywords@text{%
\ustc@clist@use{\ustc@keywords}{;}%
\ifustc@degree@graduate
\ustc@clist@use{\ustc@keywords}{\quad}%
\else
\ustc@clist@use{\ustc@keywords}{、}%
\fi
}
\newcommand\ustc@keywords@en@text{%
\ustc@clist@use{\ustc@keywords@en}{; }%
\ustc@clist@use{\ustc@keywords@en}{, }%
}
\newenvironment{abstract}{%
\ustcsetup{language=chinese}%
Expand All @@ -2349,6 +2353,9 @@
\ustc@reset@main@language
}

\newbox\ustc@keywords@box
\newlength\ustc@keywords@width

% 英文摘要环境
\newenvironment{abstract*}{%
\ustcsetup{language=english}%
Expand All @@ -2362,8 +2369,11 @@
\endgroup
\fi
}{
\par\null\par\noindent\hangindent=5.3em\relax
\textbf{Key Words}: \ustc@keywords@en@text\par
\par\null\par\noindent
\savebox\ustc@keywords@box{\textbf{Key Words}: }%
\ustc@keywords@width=\linewidth
\advance\ustc@keywords@width-\wd\ustc@keywords@box
\textbf{Key Words}: \parbox[t]{\ustc@keywords@width}{\ustc@keywords@en@text\par}\par
\ifustc@degree@graduate
\cleardoublepage
\fi
Expand Down

0 comments on commit f488fa2

Please sign in to comment.