Skip to content

Commit 6d45404

Browse files
committed
fix: standardize algo ref name.
1 parent 743c8a7 commit 6d45404

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: bithesis.dtx

+14-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,14 @@
691691
tabularFontSize .tl_set:N = \l_@@_misc_tabular_font_size_tl,
692692
tabularFontSize .initial:n = {5},
693693
arialFont .tl_set:N = \l_@@_misc_arial_font_path_tl,
694-
autoref / algo .tl_set:N = \algoautorefname,
694+
autoref / algo .code:n = {
695+
% 定义算法的 autoref
696+
\tl_set:Nn \algorithmautorefname {#1}
697+
% 定义算法标题
698+
\AtBeginDocument{
699+
\tl_set:Nn \ALG@name {#1}
700+
}
701+
},
695702
autoref / algo .initial:n = {\g_@@_const_autoref_algo_tl},
696703
autoref / them .tl_set:N = \themautorefname,
697704
autoref / them .initial:n = {\g_@@_const_autoref_them_tl},
@@ -1560,12 +1567,14 @@
15601567
\captionsetup[table]{font=small,labelsep=quad}
15611568
% 其它 caption 也参照上述格式
15621569
\captionsetup[lstlisting]{font=small,labelsep=quad}
1570+
\captionsetup[algorithm]{font=small,labelsep=quad}
15631571
} {
15641572
\tl_set:Nn \g_@@_label_divide_char_tl {-}
15651573
% 本科生模板无 caption 字距要求
15661574
\captionsetup[figure]{font=small,labelsep=space}
15671575
\captionsetup[table]{font=small,labelsep=space}
15681576
\captionsetup[lstlisting]{font=small,labelsep=space}
1577+
\captionsetup[algorithm]{font=small,labelsep=space}
15691578
}
15701579
% \end{macrocode}
15711580
%
@@ -1586,6 +1595,10 @@
15861595
\cs_gset:Npn \thelstlisting {\thechapter\g_@@_label_divide_char_tl\arabic{lstlisting}}
15871596
\cs_gset:Npn \lstlistingname {\c_@@_label_code_tl}
15881597

1598+
% 算法变成「章节号-序号」
1599+
\cs_gset:Npn \thealgorithm
1600+
{\thechapter\g__bithesis_label_divide_char_tl\arabic{algorithm}}
1601+
15891602
% 默认的情况下,保留公式和上下文的一定间距。(会比 Word 稍宽一些)
15901603
\setlength{\abovedisplayskip}{\l_@@_style_math_above_display_skip_dim}
15911604
\setlength{\abovedisplayshortskip}{\l_@@_style_math_above_display_skip_dim}

0 commit comments

Comments
 (0)