Skip to content

Commit 681ed0f

Browse files
committed
fix: add more.
1 parent 8ad8bf8 commit 681ed0f

File tree

8 files changed

+69
-24
lines changed

8 files changed

+69
-24
lines changed

Diff for: bithesis.dtx

+10-4
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,9 @@
754754
mathFont .initial:n = {cm},
755755
% Options that will be pass to `unicode-math` pkgs.
756756
unicodeMathOptions .tl_set:N = \l_@@_unicode_math_options_tl,
757+
% Windows 平台开启宋体伪粗体。
758+
windowsSimSunFakeBold .bool_set:N = \l_@@_style_windows_simsum_fake_bold,
759+
windowsSimSunFakeBold .initial:n = {false},
757760
}
758761
% \end{macrocode}
759762
%
@@ -883,7 +886,6 @@
883886
\RequirePackage{listings}
884887
\RequirePackage{enumitem}
885888
\RequirePackage{fmtcount}
886-
\RequirePackage{ifplatform}
887889
% \end{macrocode}
888890
%
889891
% 抑制 \pkg{hyperref} 中对 |\hskip| 的 warning 信息。
@@ -1042,9 +1044,13 @@
10421044
% \begin{macrocode}
10431045
\ctex_at_end_preamble:n {
10441046
% 针对 Windows 字体采用 Fake Bold 宋体
1045-
\ifwindows
1046-
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
1047-
\fi
1047+
\bool_if:NT \l_@@_style_windows_simsum_fake_bold
1048+
{
1049+
\RequirePackage{ifplatform}
1050+
\ifwindows
1051+
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
1052+
\fi
1053+
}
10481054

10491055
% 在导言区末尾加载数学字体。
10501056
\@@_load_font:

Diff for: templates/graduate-thesis/bithesis.cls

+10-4
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@
502502
mathFont .initial:n = {cm},
503503
% Options that will be pass to `unicode-math` pkgs.
504504
unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl,
505+
% Windows 平台开启宋体伪粗体。
506+
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
507+
windowsSimSunFakeBold .initial:n = {false},
505508
}
506509
\keys_define:nn { bithesis / TOC }
507510
{
@@ -579,7 +582,6 @@
579582
\RequirePackage{listings}
580583
\RequirePackage{enumitem}
581584
\RequirePackage{fmtcount}
582-
\RequirePackage{ifplatform}
583585
\pdfstringdefDisableCommands{%
584586
\let\quad\empty
585587
}
@@ -668,9 +670,13 @@
668670
}
669671
\ctex_at_end_preamble:n {
670672
% 针对 Windows 字体采用 Fake Bold 宋体
671-
\ifwindows
672-
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
673-
\fi
673+
\bool_if:NT \l__bithesis_style_windows_simsum_fake_bold
674+
{
675+
\RequirePackage{ifplatform}
676+
\ifwindows
677+
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
678+
\fi
679+
}
674680

675681
% 在导言区末尾加载数学字体。
676682
\__bithesis_load_font:

Diff for: templates/graduate-thesis/main.tex

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
},
8282
style = {
8383
pageVerticalAlign = scattered,
84+
% 开启 Windows 平台下的中易宋体伪粗体。
85+
% windowsSimSunFakeBold = true,
8486
},
8587
publications = {
8688
% 以下两个选项将影响「攻读学位期间发表论文与研究成果清单」中名称列表的省略阈值。

Diff for: templates/paper-translation/bithesis.cls

+10-4
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@
502502
mathFont .initial:n = {cm},
503503
% Options that will be pass to `unicode-math` pkgs.
504504
unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl,
505+
% Windows 平台开启宋体伪粗体。
506+
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
507+
windowsSimSunFakeBold .initial:n = {false},
505508
}
506509
\keys_define:nn { bithesis / TOC }
507510
{
@@ -579,7 +582,6 @@
579582
\RequirePackage{listings}
580583
\RequirePackage{enumitem}
581584
\RequirePackage{fmtcount}
582-
\RequirePackage{ifplatform}
583585
\pdfstringdefDisableCommands{%
584586
\let\quad\empty
585587
}
@@ -668,9 +670,13 @@
668670
}
669671
\ctex_at_end_preamble:n {
670672
% 针对 Windows 字体采用 Fake Bold 宋体
671-
\ifwindows
672-
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
673-
\fi
673+
\bool_if:NT \l__bithesis_style_windows_simsum_fake_bold
674+
{
675+
\RequirePackage{ifplatform}
676+
\ifwindows
677+
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
678+
\fi
679+
}
674680

675681
% 在导言区末尾加载数学字体。
676682
\__bithesis_load_font:

Diff for: templates/undergraduate-thesis-en/bithesis.cls

+10-4
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@
502502
mathFont .initial:n = {cm},
503503
% Options that will be pass to `unicode-math` pkgs.
504504
unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl,
505+
% Windows 平台开启宋体伪粗体。
506+
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
507+
windowsSimSunFakeBold .initial:n = {false},
505508
}
506509
\keys_define:nn { bithesis / TOC }
507510
{
@@ -579,7 +582,6 @@
579582
\RequirePackage{listings}
580583
\RequirePackage{enumitem}
581584
\RequirePackage{fmtcount}
582-
\RequirePackage{ifplatform}
583585
\pdfstringdefDisableCommands{%
584586
\let\quad\empty
585587
}
@@ -668,9 +670,13 @@
668670
}
669671
\ctex_at_end_preamble:n {
670672
% 针对 Windows 字体采用 Fake Bold 宋体
671-
\ifwindows
672-
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
673-
\fi
673+
\bool_if:NT \l__bithesis_style_windows_simsum_fake_bold
674+
{
675+
\RequirePackage{ifplatform}
676+
\ifwindows
677+
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
678+
\fi
679+
}
674680

675681
% 在导言区末尾加载数学字体。
676682
\__bithesis_load_font:

Diff for: templates/undergraduate-thesis/bithesis.cls

+10-4
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@
502502
mathFont .initial:n = {cm},
503503
% Options that will be pass to `unicode-math` pkgs.
504504
unicodeMathOptions .tl_set:N = \l__bithesis_unicode_math_options_tl,
505+
% Windows 平台开启宋体伪粗体。
506+
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
507+
windowsSimSunFakeBold .initial:n = {false},
505508
}
506509
\keys_define:nn { bithesis / TOC }
507510
{
@@ -579,7 +582,6 @@
579582
\RequirePackage{listings}
580583
\RequirePackage{enumitem}
581584
\RequirePackage{fmtcount}
582-
\RequirePackage{ifplatform}
583585
\pdfstringdefDisableCommands{%
584586
\let\quad\empty
585587
}
@@ -668,9 +670,13 @@
668670
}
669671
\ctex_at_end_preamble:n {
670672
% 针对 Windows 字体采用 Fake Bold 宋体
671-
\ifwindows
672-
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
673-
\fi
673+
\bool_if:NT \l__bithesis_style_windows_simsum_fake_bold
674+
{
675+
\RequirePackage{ifplatform}
676+
\ifwindows
677+
\setCJKmainfont{SimSun}[AutoFakeBold,AutoFakeSlant]
678+
\fi
679+
}
674680

675681
% 在导言区末尾加载数学字体。
676682
\__bithesis_load_font:

Diff for: templates/undergraduate-thesis/chapters/1_chapter1.tex

+13-3
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,25 @@ \section{字体效果表格}
8484
% 行:宋体、黑体、楷体、Serif、Sans Serif、Typewriter、Math
8585

8686
\begin{table}[htb]
87+
\linespread{1.5}
88+
\zihao{5}
89+
\centering
90+
\caption{字体效果表格}
8791
\begin{tabular}{@{}lllll@{}}
8892
\toprule
8993
& Regular & Bold & Italic & Bold Italic \\ \midrule
90-
宋体 & 宋体 & \textbf{宋体粗体} & \textit{楷体} & \textbf{\textit{楷书粗体}} \\
91-
黑体 & {\heiti{}黑体} & \textbf{\heiti{}黑体粗体} & \textit{\heiti{}黑体斜体} & \textit{\textbf{\heiti{}黑体粗体}} \\
92-
楷体 & {\kaishu{}楷书} & \textbf{\kaishu{}楷书粗体} & \textit{\kaishu{}斜体楷体} & \cellcolor[HTML]{FFCB2F} \textbf{\textit{\kaishu{}楷书粗斜体}} \\
94+
宋体 & 宋体 & \cellcolor{orange}\textbf{宋体粗体} & \textit{楷体} & \cellcolor{gray}\textbf{\textit{楷书粗斜体}} \\
95+
黑体 & {\heiti{}黑体} & \textbf{\heiti{}黑体粗体} & \textit{\heiti{}黑体斜体} & \cellcolor{gray}\textit{\textbf{\heiti{}黑体粗斜体}} \\
96+
楷体 & {\kaishu{}楷书} & \textbf{\kaishu{}楷书粗体} & \textit{\kaishu{}斜体楷体} & \cellcolor{gray}\textbf{\textit{\kaishu{}楷书粗斜体}} \\
9397
Serif(Roman/Normal) & Regular & \textbf{Bold} & \textit{Italic} & \textbf{\textit{Bold Italic}} \\
9498
Sans Serif & \textsf{Regular} & \textbf{\textsf{Bold}} & \textit{\textsf{Bold}} & \textbf{\textit{\textsf{Bold}}} \\
9599
Typewriter & \texttt{Regular} & \textbf{\texttt{Bold}} & \textit{\texttt{Bold}} & \textbf{\textit{\texttt{Bold}}} \\
96100
Math & $\mathnormal{Regular} \mathrm{Roman}$ & $\mathbf{Bold}$ & $\mathit{Italic}$ & $\mathbf{\mathit{Bold Italic}}$ \\ \bottomrule
97101
\end{tabular}
98102
\end{table}
103+
104+
\begin{itemize}[nosep]
105+
\item \colorbox{orange}{宋体粗体}在 Windows 下会成为黑体。这是因为 Windows 的中易宋体没有粗体字重而进行的妥协。
106+
如果想要获得宋体粗体的样式,请在配置中开启伪粗体选项。
107+
\item \colorbox{gray}{粗斜体}的效果是因操作系统字体而定的,中文写作中不会使用这种字形,可以忽略。
108+
\end{itemize}

Diff for: templates/undergraduate-thesis/main.tex

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@
5757
% externalSupervisor = 左偏树,
5858
},
5959
style = {
60-
% 保持参考文献的缩进样式与 Word 模板一致。
60+
% 学校提供的 Word 模板没有使用悬挂缩进。
61+
% 因此通过关闭这个选项保持参考文献的缩进样式与 Word 模板一致。
6162
% 如果你不需要此样式,请将此行注释掉。
6263
bibliographyIndent = false,
64+
% 开启 Windows 平台下的中易宋体伪粗体。
65+
% windowsSimSunFakeBold = true,
6366
}
6467
}
6568

0 commit comments

Comments
 (0)