Skip to content

Commit

Permalink
feat: support hyphenation by default.
Browse files Browse the repository at this point in the history
fix: 357
  • Loading branch information
fky2015 committed Jun 17, 2023
1 parent aa8c4db commit 9b849dd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 4 additions & 3 deletions bithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@
% Windows 平台开启宋体伪粗体。
windowsSimSunFakeBold .bool_set:N = \l_@@_style_windows_simsum_fake_bold,
windowsSimSunFakeBold .initial:n = {false},
% 控制英文是否使用 hyphen 进行换行
hyphen .bool_set:N = \l_@@_style_hyphen_bool,
hyphen .initial:n = {true},
}
% \end{macrocode}
%
Expand Down Expand Up @@ -1474,13 +1477,11 @@
% 是的,这是祖传代码。
% 在英文模式下禁用,因为这段代码会禁用 hyphenation.
% \begin{macrocode}
\@@_if_thesis_english:TF{
\bool_if:NF \l_@@_style_hyphen_bool {
\hbadness=10000
}{
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
}
% \end{macrocode}
%
Expand Down
7 changes: 4 additions & 3 deletions templates/graduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@
% Windows 平台开启宋体伪粗体。
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
windowsSimSunFakeBold .initial:n = {false},
% 控制英文是否使用 hyphen 进行换行
hyphen .bool_set:N = \l__bithesis_style_hyphen_bool,
hyphen .initial:n = {true},
}
\keys_define:nn { bithesis / TOC }
{
Expand Down Expand Up @@ -1020,13 +1023,11 @@
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\__bithesis_if_thesis_english:TF{
\bool_if:NF \l__bithesis_style_hyphen_bool {
\hbadness=10000
}{
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
Expand Down
7 changes: 4 additions & 3 deletions templates/paper-translation/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@
% Windows 平台开启宋体伪粗体。
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
windowsSimSunFakeBold .initial:n = {false},
% 控制英文是否使用 hyphen 进行换行
hyphen .bool_set:N = \l__bithesis_style_hyphen_bool,
hyphen .initial:n = {true},
}
\keys_define:nn { bithesis / TOC }
{
Expand Down Expand Up @@ -1020,13 +1023,11 @@
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\__bithesis_if_thesis_english:TF{
\bool_if:NF \l__bithesis_style_hyphen_bool {
\hbadness=10000
}{
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
Expand Down
7 changes: 4 additions & 3 deletions templates/undergraduate-thesis-en/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@
% Windows 平台开启宋体伪粗体。
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
windowsSimSunFakeBold .initial:n = {false},
% 控制英文是否使用 hyphen 进行换行
hyphen .bool_set:N = \l__bithesis_style_hyphen_bool,
hyphen .initial:n = {true},
}
\keys_define:nn { bithesis / TOC }
{
Expand Down Expand Up @@ -1020,13 +1023,11 @@
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\__bithesis_if_thesis_english:TF{
\bool_if:NF \l__bithesis_style_hyphen_bool {
\hbadness=10000
}{
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
Expand Down
7 changes: 4 additions & 3 deletions templates/undergraduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@
% Windows 平台开启宋体伪粗体。
windowsSimSunFakeBold .bool_set:N = \l__bithesis_style_windows_simsum_fake_bold,
windowsSimSunFakeBold .initial:n = {false},
% 控制英文是否使用 hyphen 进行换行
hyphen .bool_set:N = \l__bithesis_style_hyphen_bool,
hyphen .initial:n = {true},
}
\keys_define:nn { bithesis / TOC }
{
Expand Down Expand Up @@ -1020,13 +1023,11 @@
\cs_gset:Npn \lstlistingname {\c__bithesis_label_code_tl}
}
\captionsetup[lstlisting]{font=small,labelsep=space}
\__bithesis_if_thesis_english:TF{
\bool_if:NF \l__bithesis_style_hyphen_bool {
\hbadness=10000
}{
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
Expand Down

0 comments on commit 9b849dd

Please sign in to comment.