Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
LaureatePoet committed Apr 9, 2022
1 parent 23f6ff2 commit f3319fa
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 14 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [v1.0.4] - 2022-04-09

### Added

- add GitHub workflow compile Test.

### Changed

-

### Removed

-

### Fixed

- 修复了载入 `natbib` 前设置 `cite-style` 无效的问题([ustcthesis#327](https://github.com/ustctug/ustcthesis/issues/327))。
- 修正了 biblatex 参考文献的页眉。([ustcthesis#311](https://github.com/ustctug/ustcthesis/issues/311)
- 修正`Makefile`文件。(感谢[@zepinglee](https://github.com/zepinglee))([#9](https://github.com/HFUTTUG/HFUT_Thesis/issues/9)
- 修改因`publications`环境造成的“不兼容TeX Live 2017-2020”。(感谢[@zepinglee](https://github.com/zepinglee))([#9](https://github.com/HFUTTUG/HFUT_Thesis/issues/9)


## [v1.0.3] - 2021-08-15

### Added
Expand Down Expand Up @@ -85,6 +107,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

-

[v1.0.4]: https://github.com/HFUTTUG/HFUT_Thesis/releases/tag/v1.0.4
[v1.0.3]: https://github.com/HFUTTUG/HFUT_Thesis/releases/tag/v1.0.3
[v1.0.2]: https://github.com/HFUTTUG/HFUT_Thesis/releases/tag/v1.0.2
[v1.0.1]: https://github.com/HFUTTUG/HFUT_Thesis/releases/tag/v1.0.1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MAIN = main
NAME = hfutthesis
CLSFILES = $(NAME).cls
BSTFILES = $(NAME)-numerical.bst $(NAME)-authoryear.bst $(NAME)-bachelor.bst
BSTFILES = $(NAME)-numerical.bst $(NAME)-bachelor.bst

SHELL = bash
LATEXMK = latexmk -xelatex
Expand Down
6 changes: 3 additions & 3 deletions chapters/floats.tex
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ \section{插图}
事实上,这种做法已经过时。
而且每次编译时都要要调用外部工具解析 eps,导致降低编译速度。
所以我们推荐矢量图直接使用 pdf 格式,位图使用 jpeg 或 png 格式。
\begin{figure}[h]
\begin{figure}[!ht]
\centering
\includegraphics[width=0.3\textwidth]{hfut-badge.pdf}
% \bicaption{图号、图题置于图的下方}{The figure number and title are placed at the bottom of the figure} % 硕博学位论文 图表中英文标题
Expand All @@ -64,7 +64,7 @@ \section{插图}
不建议使用 \pkg{subfigure} 或 \pkg{subfig} 等宏包。\par

对于硕博是中英文图标题,示例如图~\ref{fig:example-zh-en}:
\begin{figure}[h]
\begin{figure}[!ht]
\centering
\includegraphics[height=1.5cm]{hfut-name.pdf}
\bicaption{合肥工业大学}{Hefei University of Technology} % 硕博学位论文 图表中英文标题
Expand All @@ -76,7 +76,7 @@ \section{算法环境}
模板中使用 \pkg{algorithm2e} 宏包实现算法环境。关于该宏包的具体用法,
请阅读宏包的官方文档。

\begin{algorithm}[h]
\begin{algorithm}[!ht]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
Expand Down
22 changes: 21 additions & 1 deletion hfutthesis-bachelor.bbx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\ProvidesFile{ustcthesis-bachelor.bbx}[2021/01/19 v1.0 USTCThesis biblatex
\ProvidesFile{hfuthesis-bachelor.bbx}[2021/01/19 v1.0 HFUT_Thesis biblatex
bibliography style]

\RequireBibliographyStyle{gb7714-2015}
Expand All @@ -17,3 +17,23 @@
#1\isdot
}%
}

\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{%
\iffieldundef{url}{\MakeSentenceCase{#1}}{%
\href{\thefield{url}}{#1}}}{\MakeSentenceCase{#1}}}

\DeclareFieldFormat{booktitlecase}{\MakeCapital{#1}}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{\bibtitlefont%
\printfield[booktitlecase]{booktitle}%
\setunit{\subtitlepunct}%
\printfield[booktitlecase]{booksubtitle}}%
\newunit%标点换成下一句
\setunit{\subtitlepunct}}%
\printfield{booktitleaddon}}
2 changes: 1 addition & 1 deletion hfutthesis-bachelor.cbx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\ProvidesFile{ustcthesis-bachelor.cbx}[2021/01/19 v1.0 USTCThesis biblatex
\ProvidesFile{hfutthesis-bachelor.cbx}[2021/01/19 v1.0 HFUT_Thesis biblatex
citation style]

\RequireCitationStyle{gb7714-2015}
2 changes: 1 addition & 1 deletion hfutthesis-inline.cbx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\ProvidesFile{ustcthesis-inline.cbx}[2021/01/19 v1.0 USTCThesis biblatex
\ProvidesFile{hfutthesis-inline.cbx}[2021/01/19 v1.0 HFUT_Thesis biblatex
citation style]

\RequireCitationStyle{gb7714-2015}
Expand Down
23 changes: 22 additions & 1 deletion hfutthesis-numeric.bbx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\ProvidesFile{ustcthesis-numeric.bbx}[2021/01/19 v1.0 USTCThesis biblatex
\ProvidesFile{hfutthesis-numeric.bbx}[2021/01/19 v1.0 HFUT_Thesis biblatex
bibliography style]

\RequireBibliographyStyle{gb7714-2015}
Expand All @@ -7,3 +7,24 @@
gbpub = false,
gbalign = left,
}


\DeclareFieldFormat{titlecase}{\iftoggle{bbx:titlelink}{%
\iffieldundef{url}{\MakeSentenceCase{#1}}{%
\href{\thefield{url}}{#1}}}{\MakeSentenceCase{#1}}}

\DeclareFieldFormat{booktitlecase}{\MakeCapital{#1}}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{\bibtitlefont%
\printfield[booktitlecase]{booktitle}%
\setunit{\subtitlepunct}%
\printfield[booktitlecase]{booksubtitle}}%
\newunit%标点换成下一句
\setunit{\subtitlepunct}}%
\printfield{booktitleaddon}}
2 changes: 1 addition & 1 deletion hfutthesis-numeric.cbx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\ProvidesFile{ustcthesis-numeric.cbx}[2021/01/19 v1.0 USTCThesis biblatex
\ProvidesFile{hfutthesis-numeric.cbx}[2021/01/19 v1.0 HFUT_Thesis biblatex
citation style]

\RequireCitationStyle{gb7714-2015}
28 changes: 23 additions & 5 deletions hfutthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
%

\NeedsTeXFormat{LaTeX2e}[2017/04/15]
\newcommand\hfutthesisversion{v1.0.3}
\ProvidesClass{hfutthesis}[2021/08/15 {\hfutthesisversion} hfut thesis template]
\newcommand\hfutthesisversion{v1.0.4}
\ProvidesClass{hfutthesis}[2022/04/09 {\hfutthesisversion} hfut thesis template]

% 报错和警告
\newcommand\hfut@error[1]{%
Expand Down Expand Up @@ -1769,7 +1769,7 @@
\else
\ifhfut@degree@master
\newcommand\hfut@thesis@name{硕士学位论文}
\newcommand\hfut@thesis@name@en{A Dissertation Submitted for the Degree of Maste}
\newcommand\hfut@thesis@name@en{A Dissertation Submitted for the Degree of Master}
\newcommand\hfut@thesis@name@encover{MASTER'S DISSERTATION}
\else
\newcommand\hfut@thesis@name{本科毕业设计(论文)}
Expand Down Expand Up @@ -1826,6 +1826,13 @@
\if@restonecol\twocolumn \else \newpage \fi
}

% TODO: 做一些定义用以实现:不定长, 自动换行且有定长下划线的“论文标题”
% from:
% https://github.com/CTeX-org/forum/issues/208
% https://syvshc.github.io/2021-08-04-thesis-title/
% https://zhuanlan.zhihu.com/p/51494365


% 中文封面:
% 抬头黑体 12 磅;
% 论文类型:研究生黑体 48 磅,本科生黑体42磅;
Expand Down Expand Up @@ -2983,9 +2990,17 @@
\@namedef{bibstyle@hfutthesis-authoryear}{\bibstyle@authoryear}
\@namedef{bibstyle@hfutthesis-bachelor}{\bibstyle@super}
%
% 如果载入 `natbib` 前设置了 `cite-style`,这里先进行配置。
% https://github.com/ustctug/ustcthesis/issues/327
\ifx\hfut@cite@style\@empty\else
\citestyle{\hfut@cite@style}%
\fi
%
% 定义接口 cite-style 切换引用样式。
\hfut@option@hook{cite-style}{%
\ifx\@begindocumenthook\@undefined
\citestyle{\hfut@cite@style}%
\fi
}
%
% 如果文献序号作为叙述文字的一部分,需要临时将文献序号与正文平排
Expand Down Expand Up @@ -3259,7 +3274,10 @@
\ifthenelse{\equal{\blx@bbxfile}{mla-new}}{\def\bibname{WORKS CITED}}{}
}
\DeclareRobustCommand\inlinecite{\parencite}
\defbibheading{bibliography}[\bibname]{\@mainmatterfalse\chapter*{\bibname}}
\defbibheading{bibliography}[\bibname]{%
\@mainmatterfalse
\chapter{\bibname}%
}
\renewcommand\bibfont{%
\fontsize{10.5bp}{20bp}\selectfont
}
Expand Down Expand Up @@ -3292,7 +3310,6 @@
\newenvironment{publications}{%
\@mainmatterfalse
\ctexset{
tocdepth = 0,
chapter/format = \centering\sffamily\bfseries\fontsize{18bp}{18bp}\selectfont,
chapter/beforeskip = 9bp,
chapter/afterskip = 27bp,
Expand All @@ -3306,6 +3323,7 @@
\chapter{\hfut@publication@name}%
\renewcommand\thesection{\arabic{section}}
\setenumerate[1]{itemsep = 0pt, parsep = 0pt, label = (\arabic*)}
\setcounter{tocdepth}{0}
\setcounter{section}{0}
}{}

Expand Down

0 comments on commit f3319fa

Please sign in to comment.