Skip to content

Commit

Permalink
Add: 增加 style/theorem-bodyfont 键值控制定理环境的正文字体
Browse files Browse the repository at this point in the history
  • Loading branch information
xkwxdyy committed Apr 5, 2024
1 parent e566fe5 commit 873533e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 9 deletions.
24 changes: 21 additions & 3 deletions CCNUthesis.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\ProvidesExplClass {CCNUthesis} {2024-04-03} {v1.4.0}
\ProvidesExplClass {CCNUthesis} {2024-04-05} {v1.4.1}
{Thesis template for Central China Normal University}
\RequirePackage { l3keys2e, xparse }

Expand Down Expand Up @@ -1785,13 +1785,31 @@
head-scope = main
}
% 定理类环境

\tl_new:N \l__ccnu_theorem_body_tl
\keys_define:nn { ccnu / style }
{
% theorem-bodyfont .tl_set:N = \l__ccnu_theorem_body_tl,
theorem-bodyfont .choice:,
theorem-bodyfont / kaishu .code:n =
{
\tl_set:Nn \l__ccnu_theorem_body_tl { \ccnukaishu }
},
theorem-bodyfont / normal .code:n =
{
\tl_set:Nn \l__ccnu_theorem_body_tl { \normalfont }
},
}
\keys_set:nn { ccnu / style }
{
theorem-bodyfont = normal,
}
% 去掉.号,但只能通过新定义 style 的方式进行
\declaretheoremstyle
[
headpunct = {},
postheadspace = { 0.5em },
headindent = 2\ccwd
headindent = 2\ccwd,
bodyfont = \l__ccnu_theorem_body_tl,
]
{ ccnustyle }
\cs_new:Npn \__ccnu_declare_theorem_with_counter_within:n #1
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ QQ 1群:435903068(若满了请加2群)
QQ 2群:685329998


## [v1.4.1] - 2024-04-05

### Added

- 增加 `style/theorem-bodyfont` 键值控制定理环境的正文字体




## [v1.4.0] - 2024-04-03


Expand Down
6 changes: 6 additions & 0 deletions ccnu-setup.tex
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@
% 可选选项:default|classic|material|graylevel|prl
% 默认:default
%
theorem-bodyfont = normal,
% 定理环境的主体字体样式
% 可选选项:normal|kaishu
% 默认:normal
% normal:正常字体,和正文相同
% kaishu:中文变成楷书,英文不变
}
}

Expand Down
4 changes: 2 additions & 2 deletions doc/CCNUthesis-doc.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\documentclass{ccnudoc}

\newcommand{\DocDate}{2024-04-03}
\newcommand{\DocVersion}{v1.4.0}
\newcommand{\DocDate}{2024-04-05}
\newcommand{\DocVersion}{v1.4.1}

\input{CCNUthesis-doc-setup.tex}

Expand Down
8 changes: 8 additions & 0 deletions doc/body/usage.tex
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,14 @@ \subsubsection{论文格式} \label{subsubsec:论文格式}
\end{function}


\begin{function}[added = 2024-04-05]{style/theorem-bodyfont}
\begin{ccnusyntax}[emph={[1]theorem-bodyfont}]
theorem-bodyfont = (*<(normal)|kaishu>*)
\end{ccnusyntax}
【本|硕|博】设置定理环境的正文部分字体。默认为 \kvopt{theorem-bodyfont}{normal},表示与正文字体相同;\kvopt{theorem-bodyfont}{kaishu} 表示中文变成楷书,英文不变。
\end{function}


\begin{table}[ht]
\centering
\small
Expand Down
8 changes: 4 additions & 4 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

%********************************************
% CCNUthesis: 华中师范大学论文模板(非官方)
% update date: 2024-04-03
% version: v1.4.0
% update date: 2024-04-05
% version: v1.4.1
%
% 重要提示:
% 1. 请确保使用 UTF-8 编码保存
Expand All @@ -16,7 +16,7 @@
%********************************************


% \documentclass[type = bachelor]{CCNUthesis}
\documentclass[type = bachelor]{CCNUthesis}
% \documentclass[type = bachelor, blind-version=remove-partial-schoolname]{CCNUthesis}
% \documentclass[type = master]{CCNUthesis}
% \documentclass[type = master, copyright-version=new]{CCNUthesis}
Expand All @@ -25,7 +25,7 @@
% \documentclass[type = doctor]{CCNUthesis}
% \documentclass[type = doctor, copyright-version=new]{CCNUthesis}
% \documentclass[type = doctor, blind-version=blind-schoolname]{CCNUthesis}
\documentclass[type = doctor, copyright-version=new, version = print-doctor]{CCNUthesis}
% \documentclass[type = doctor, copyright-version=new, version = print-doctor]{CCNUthesis}


% type
Expand Down

0 comments on commit 873533e

Please sign in to comment.