-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1547,7 +1547,16 @@ Copyright (C) 2023 by Rui-Zhi Li <[email protected]> | |
\@@_sanitize_chapter_title:n {#1} | ||
\group_begin: | ||
\ctexset { chapter / numbering = false } | ||
\chapter [ \l_@@_tmpa_tl ] {#1} | ||
% 使用正则表达式匹配只包含英文字符的标题 | ||
\regex_match:nnTF {^[A-Za-z]+$} {#1} | ||
{ | ||
% 如果标题只包含英文字符,则将标题设置为罗马字体 | ||
\chapter [ \l_@@_tmpa_tl ] {\rmfamily #1} | ||
} | ||
{ | ||
% 如果标题不只包含英文字符,则保持默认字体 | ||
\chapter [ \l_@@_tmpa_tl ] {#1} | ||
} | ||
\group_end: | ||
\@@_chapter_header:n {#1} | ||
} | ||
|