Skip to content

Commit

Permalink
fix: 修复国家图书馆封面的死循环 (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
atxy-blip committed Nov 29, 2022
1 parent d5089e6 commit c1ebef8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### 修复

- 修复研究生封面上导师信息的居中问题 - [#165]
- 修复国家图书馆封面的编译死循环问题 - [#170]

## [1.1.0] - 2022-10-23

Expand Down Expand Up @@ -480,6 +481,7 @@
[#150]: https://github.com/nju-lug/NJUThesis/discussions/150
[#155]: https://github.com/nju-lug/NJUThesis/discussions/155
[#165]: https://github.com/nju-lug/NJUThesis/discussions/165
[#170]: https://github.com/nju-lug/NJUThesis/issues/170

[更新日志]: https://keepachangelog.com/zh-CN/1.0.0/
[语义化版本]: https://semver.org/lang/zh-CN/
Expand Down
2 changes: 1 addition & 1 deletion docs/njuthesis-sample.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
% 自行载入所需宏包
% \usepackage{subcaption} % 嵌套小幅图像,比 subfig 和 subfigure 更新更好
% \usepackage{siunitx} % 标准单位符号
% \usepackage[version=4]{mhchem} % 物理百宝箱
% \usepackage{physics} % 物理百宝箱
% \usepackage[version=4]{mhchem} % 绘制分子式
% \usepackage{listings} % 展示代码
% \usepackage{algorithm,algorithmic} % 展示算法伪代码
Expand Down
28 changes: 19 additions & 9 deletions source/njuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ To produce the documentation run the original source files ending with
%
% 以下宏包可以在文档类选项中禁用:
% \begin{itemize}
% \item \pkg{amsthm} 和 \pkg{create-theorem},提供定理类环境支持。
% \item \pkg{ntheorem},提供定理类环境支持。
% \item \pkg{unicode-math},负责处理 Unicode 编码的 OpenType 数学字体。
% \item \pkg{footmisc},处理脚注。
% \item \pkg{enumitem},调整列表环境。
Expand Down Expand Up @@ -3135,11 +3135,16 @@ To produce the documentation run the original source files ending with
\cs_new_protected:Npn \@@_box_multiline:NNNN #1#2#3#4
{
\int_set:Nn #1 { 1 }
\int_set:Nn #2 { \clist_count:N #3 }
\int_compare:nF { #2 > 4 } { \int_set:Nn #2 { 4 } }
\int_set:Nn #2 { \int_max:nn { \clist_count:N #3 } { 4 } }
\int_do_until:nn { #1 > #2 }
{
\clist_pop:NN #3 \l_@@_tmpa_tl
% \end{macrocode}
% \changes{v1.1}{2022/11/29}{修复空返回值在国家图书馆封面引发的死循环。}
% 防止空的返回值引发死循环。
% \begin{macrocode}
\quark_if_no_value:NT \l__nju_tmpa_tl
{ \tl_set_eq:NN \l_@@_tmpa_tl \c_empty_tl }
\@@_box_ulined:NN #4 \l_@@_tmpa_tl \tex_par:D
\int_incr:N #1
}
Expand Down Expand Up @@ -5811,7 +5816,16 @@ To produce the documentation run the original source files ending with
% \changes{v1.1}{2022/10/16}{新增悬挂缩进选项。}
% 是否悬挂缩进。
% \begin{macrocode}
hang .bool_gset:N = \g_@@_fn_hang_bool,
hang .choice:,
hang / true .code:n =
{
\cs_set:Npn \@@_fn_hang:
{
\int_set:Nn \tex_hangafter:D { 1 }
\dim_set_eq:NN \tex_hangindent:D \c_@@_fnhang_dim
}
},
hang / false .code:n = { \@@_cs_clear:N \@@_fn_hang: },
hang .initial:n = true
}
% \end{macrocode}
Expand Down Expand Up @@ -5868,11 +5882,7 @@ To produce the documentation run the original source files ending with
\mode_leave_vertical:
\hbox_to_wd:nn { \c_@@_fnhang_dim } { \@thefnmark \tex_hfil:D }
\tex_penalty:D \@M
\bool_if:NT \g_@@_fn_hang_bool
{
\int_set:Nn \tex_hangafter:D { 1 }
\dim_set_eq:NN \tex_hangindent:D \c_@@_fnhang_dim
}
\@@_fn_hang:
#1
}
}
Expand Down

0 comments on commit c1ebef8

Please sign in to comment.