Skip to content

Commit

Permalink
Merge branch 'date' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
xkwxdyy committed Mar 25, 2022
2 parents 838d4b8 + ac34f76 commit 31e2255
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
47 changes: 40 additions & 7 deletions CCNUthesis.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\ProvidesExplClass{CCNUthesis}
{2022-03-18}{v1.1.2}
{2022-03-25}{v1.1.3}
{Thesis template for Central China Normal University}
\RequirePackage { xtemplate, l3keys2e }

Expand Down Expand Up @@ -31,6 +31,10 @@
{ \c_sys_engine_str }
}
}

\NewDocumentCommand \ccnusetup { m }
{ \keys_set:nn { ccnu } {#1} }

\box_new:N \l__ccnu_tmpa_box
\clist_new:N \l__ccnu_tmpa_clist
\clist_new:N \l__ccnu_tmpb_clist
Expand Down Expand Up @@ -1117,8 +1121,9 @@
{ \int_set_eq:NN \l__ccnu_info_degree_type_int \l_keys_choice_int },
title .tl_set:N = \l__ccnu_info_title_tl,
title* .tl_set:N = \l__ccnu_info_title_en_tl,
date .tl_set:N = \l__ccnu_info_date_tl,
level .tl_set:N = \l__ccnu_info_level_tl,
year .int_set:N = \l__ccnu_info_year_int,
month .int_set:N = \l__ccnu_info_month_int,
level .tl_set:N = \l__ccnu_info_level_tl,
author .tl_set:N = \l__ccnu_info_author_tl,
author* .tl_set:N = \l__ccnu_info_author_en_tl,
supervisor .tl_set:N = \l__ccnu_info_supervisor_tl,
Expand Down Expand Up @@ -1367,6 +1372,31 @@
\cs_set_eq:NN \ccnu_set_to_width:Nn \settowidth
\dim_new:N \l__ccnu_date_zero_radius_dim
% \ccnu_set_to_width:Nn \l__ccnu_date_zero_radius_dim {二}

% 将输入的年份转化为封面底下的年份
\int_new:N \l__ccnu_info_year_single_digit_int
\int_new:N \l__ccnu_info_year_ten_digit_int

\cs_new:Npn \__ccnu_info_year_set:
{
% 将数字减去2000
\int_set:Nn \l_tmpa_int { \l__ccnu_info_year_int - 2000}
% 取十位数
\int_set:Nn \l__ccnu_info_year_ten_digit_int
{
\int_div_truncate:nn { \l_tmpa_int } { 10 }
}
% 取个位数
\int_set:Nn \l__ccnu_info_year_single_digit_int
{
\l_tmpa_int - 10 * \l__ccnu_info_year_ten_digit_int
}
% 将两个数字转化为中文
\zhnumber { \int_use:N \l__ccnu_info_year_ten_digit_int }
\,
\zhnumber { \int_use:N \l__ccnu_info_year_single_digit_int }
}

\cs_new_protected:Npn \__ccnu_cover_info:
{
\tl_set:Nx \l__ccnu_cover_info_left_width_tl
Expand Down Expand Up @@ -1404,7 +1434,10 @@
% \node[minimum~size = \dim_use:N \l__ccnu_date_zero_radius_dim, circle, draw] (titledate){};
% }
二二\,\,\,\,\zhnumber{ \int_use:N \c_sys_month_int }\,\,
\__ccnu_info_year_set:
\,\,
\zhnumber{ \int_use:N \l__ccnu_info_month_int }\,
};
\node[] (type) at ([shift = {(0 , -0.35\paperheight)}]current~page.north) {\zihao{-1} \sffamily 本科毕业论文(设计)};
% \node[] (titlecontent) at ([shift = {(0.05\paperheight, 0)}]current~page.center) {\zihao{-2} \bfseries \UnderlineCentered{8cm}{1.6mm}{\tl_use:N \l__ccnu_info_title_tl}};
Expand Down Expand Up @@ -2225,13 +2258,13 @@
info / degree = academic,
info / secret-level = none,
info / school-id = { 10246 },
info / date = { \zhtoday },
info / year = { \int_use:N \c_sys_year_int },
info / month = { \int_use:N \c_sys_month_int },
% theorem / header-font = { \sffamily },
% theorem / body-font = { \ccnu@kai },
% theorem / counter = { chapter }
}
\NewDocumentCommand \ccnusetup { m }
{ \keys_set:nn { ccnu } {#1} }

% \newtheorem* { proof } { \c__ccnu_name_proof_tl }
% \newtheorem { axiom } { \c__ccnu_name_axiom_tl }
% \newtheorem { corollary } { \c__ccnu_name_corollary_tl }
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [v1.1.2] - 2022-03-18

### Added

- 增加了封面下方时间的输入接口

## [v1.1.2] - 2022-03-18

### Changed

- 由于 `Linux` 没有 `Times New Roman` 字体,更改数学字体为 `times`
Expand Down
7 changes: 5 additions & 2 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
keyword1,
keyword2,
keyword3
}
},
% 如有需要可以手动调整封面底的年和月,否则默认为「编译时」的年和月
% year = {2022},
% month = {4}
},
style = {
cjk-font = fandol,
Expand Down Expand Up @@ -118,7 +121,7 @@
$p$ & 动量 \\
$\psi(x)$ & 波函数 \\
\end{notation}

乘积为 $\frac{4}{9}$ 时,乘积为 $4 / 9$



Expand Down

0 comments on commit 31e2255

Please sign in to comment.