Skip to content

Commit b302128

Browse files
refactor(UTE)!: 本科英文模板的 Arial 换为 Times,与中文模板一致
恢复方法: ```latex \BITSetup{ style/non-CJK-font-in-headings = sans, } ```
1 parent 832c1fb commit b302128

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

bithesis-doc.tex

+22-1
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,27 @@ \subsubsection{样式信息}
985985
\end{optdesc}
986986
\end{function}
987987

988+
\begin{function}[added=2024-07-09]{style/non-CJK-font-in-headings}
989+
\begin{bitsyntax}[emph={[1]non-CJK-font-in-headings}]
990+
non-CJK-font-in-headings = (*(serif)|sans*)
991+
\end{bitsyntax}
992+
993+
\textit{对于中文模板,此选项一般不需要用户自行修改。}
994+
995+
设置标题中拉丁字母、数字等非汉字部分的字体。
996+
大致 |serif| 对应 Times New Roman,|sans| 对应 Arial。
997+
默认为 |serif|。
998+
999+
“标题”除了包含正文标题,还包含摘要页的论文题目、摘要标题,目录、参考文献、附录的标题等。
1000+
1001+
学校官方规范中,目前描述较模糊;若从正文、封面类推,应为 Times New Roman。
1002+
2024年学校(本科)教务部老师回答其它问题时提到:“所有毕业设计过程文件及论文涉及到的英文和数字用 Times New Roman。”
1003+
当年实际提交时,用 Times New Roman、Arial 甚至字偶间距不正常的黑体都能通过。
1004+
总之,“这不是重点,美观就行”。
1005+
1006+
若设为 |sans|,请同时参考 |misc/arialFont| 选项。
1007+
\end{function}
1008+
9881009
\begin{function}[added=2023-03-29]{style/mathFont}
9891010
\begin{bitsyntax}[emph={[1]mathFont}]
9901011
mathFont = (*(cm)|asana|fira|...|xits|none*)
@@ -1268,7 +1289,7 @@ \subsubsection{其他配置}
12681289

12691290
\textit{此选项一般不需要用户自行修改。}
12701291

1271-
本科生毕业设计模板(全英文专业)需要设置 Arial 字体。
1292+
早期(2022年及以前)\BIThesisTemplates{UTE}需要设置 Arial 字体。
12721293
在 Windows 和 macOS 中,该字体已经安装;在 Linux 中需要用户自行安装(如果你是 WSL 用户,可参照\ref{sec:word-fonts}直接使用 Windows 下的字体)。
12731294
\end{function}
12741295

bithesis.dtx

+17-14
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,10 @@
844844
{ \flushbottom }
845845
},
846846
pageVerticalAlign .initial:n = {top},
847+
non-CJK-font-in-headings .choice:,
848+
non-CJK-font-in-headings / serif .code:n = { \bool_set_false:N \l_@@_arial_as_title_font_bool },
849+
non-CJK-font-in-headings / sans .code:n = { \bool_set_true:N \l_@@_arial_as_title_font_bool },
850+
non-CJK-font-in-headings .initial:n = {serif},
847851
% 数学字体配置
848852
mathFont .choices:nn = {
849853
asana, bonum, cm, concrete, dejavu, erewhon, euler,
@@ -1207,21 +1211,20 @@
12071211
}
12081212
}
12091213

1210-
\@@_if_thesis_english:TF {
1214+
\bool_if:NTF \l_@@_arial_as_title_font_bool {
1215+
% 手动指定时要加载 Arial
1216+
\newfontfamily\arialfamily{Arial}
1217+
} {
1218+
% 即使未指定,本科全英文专业模板的声明也需要 Arial
12111219
\@@_if_thesis_int_type:nT {3} {
1212-
% 对于本科全英文专业模板
1213-
% Font Arial is needed.
12141220
\newfontfamily\arialfamily{Arial}
12151221
}
1216-
1217-
} {
1218-
% 对于其他的中文模板,
1219-
% 需要加载细黑体。
1220-
\tl_if_blank:VTF \l_@@_cover_xihei_font_path_tl {}
1221-
{
1222-
\setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]
1223-
{\l_@@_cover_xihei_font_path_tl}
1224-
}
1222+
}
1223+
% 无论中英文,封面都可能需要细黑体。
1224+
\tl_if_blank:VTF \l_@@_cover_xihei_font_path_tl {}
1225+
{
1226+
\setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]
1227+
{\l_@@_cover_xihei_font_path_tl}
12251228
}
12261229

12271230
% 对于本科全英文专业模板,需要自定义日期格式。
@@ -1341,9 +1344,9 @@
13411344
% 定义标题字体。
13421345
% \begin{macrocode}
13431346
\cs_new:Npn \l_@@_title_font_cs:n #1 {
1344-
\@@_if_thesis_int_type:nTF {3}
1347+
\bool_if:NTF \l_@@_arial_as_title_font_bool
13451348
{
1346-
% 尽管是英文模板,但仍可能出现中文,因此需设置中文字体
1349+
% 即使是英文模板,仍可能出现中文,也需设置中文字体
13471350
\heiti\arialfamily #1
13481351
} {
13491352
% 西文保持原本的 Times New Roman。黑体一般不搭配衬线体,但学校要求如此。

0 commit comments

Comments
 (0)