Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
xkwxdyy committed Feb 24, 2022
2 parents d853f4d + c38f0f1 commit ee9e30b
Show file tree
Hide file tree
Showing 18 changed files with 5,005 additions and 7,088 deletions.
606 changes: 425 additions & 181 deletions CCNUthesis-main.bib

Large diffs are not rendered by default.

Binary file removed CCNUthesis-manual.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions CCNUthesis-manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
author = {夏康玮 \quad 林康益},
title = {CCNUthesis用户手册},
email = {[email protected]},
date = {2022-01-31},
version = {0.0.1},
date = {2022-02-19},
version = {1.0.3},
github-repository = {https://github.com/xkwxdyy/CCNUthesis},
gitee-repository = {https://gitee.com/xkwxdyy/CCNUthesis},
}
Expand Down
273 changes: 163 additions & 110 deletions CCNUthesis.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\ProvidesExplClass{CCNUthesis}
{2022-02-01}{v1.0.2}
{2022-02-19}{v1.0.3}
{Thesis template for Central China Normal University}
\RequirePackage { xtemplate, l3keys2e }

Expand All @@ -17,6 +17,12 @@
\@ifpackagelater {#1} { 2020/07/17 }
{ } { \msg_error:nnn { ccnuthesis } { l3-too-old } {#1} }
}
\msg_new:nnn { ccnuthesis } { unsupported-engine }
{
The~ ccnuthesis~ class~ requires~ either~ XeTeX~ or~ LuaTeX. \\\\
"#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\
your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex".
}
\sys_if_engine_xetex:F
{
\sys_if_engine_luatex:F
Expand All @@ -25,12 +31,6 @@
{ \c_sys_engine_str }
}
}
\msg_new:nnn { ccnuthesis } { unsupported-engine }
{
The~ ccnuthesis~ class~ requires~ either~ XeTeX~ or~ LuaTeX. \\\\
"#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\
your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex".
}
\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 @@ -194,7 +194,7 @@
{
{ no-math } { fontspec },
{ perpage } { footmisc },
{ amsmath, thmmarks } { ntheorem }
% { amsmath, thmmarks } { ntheorem }
}
{ \PassOptionsToPackage #1 }
\LoadClass { ctexbook }
Expand All @@ -207,7 +207,7 @@
geometry,
fancyhdr,
footmisc,
ntheorem,
% ntheorem,
graphicx,
longtable,
caption,
Expand All @@ -220,6 +220,8 @@
adjustbox,
calc,
etoolbox,
amsthm,
thmtools
}
\RequirePackage[titles]{tocloft}
\graphicspath{{figures/}{logo/}}
Expand Down Expand Up @@ -909,96 +911,96 @@
\hbox_to_wd:nn { 1.5 em } { \@thefnmark \hfil }
#1
}
\clist_const:Nn \c__ccnu_thm_style_plain_clist
{ plain, margin, change }
\clist_const:Nn \c__ccnu_thm_style_break_clist
{ break, marginbreak, changebreak }
\tl_new:N \l__ccnu_thm_style_tl
\tl_new:N \l__ccnu_thm_header_font_tl
\tl_new:N \l__ccnu_thm_body_font_tl
\tl_new:N \l__ccnu_thm_qed_tl
\tl_new:N \l__ccnu_thm_counter_tl
\keys_define:nn { ccnu / theorem }
{
style .tl_set:N = \l__ccnu_thm_style_tl,
header-font .tl_set:N = \l__ccnu_thm_header_font_tl,
body-font .tl_set:N = \l__ccnu_thm_body_font_tl,
qed .tl_set:N = \l__ccnu_thm_qed_tl,
counter .tl_set:N = \l__ccnu_thm_counter_tl
}
\cs_new_eq:NN \__ccnu_thm_ntheorem_style:n \theoremstyle
\cs_new_eq:NN \__ccnu_thm_ntheorem_new:w \newtheorem
\RenewDocumentCommand \newtheorem { s o m m }
{
\IfBooleanTF {#1}
{ \tl_set:Nn \l__ccnu_thm_qed_tl { \ensuremath { \square } } }
{ \tl_set:Nn \l__ccnu_thm_qed_tl { } }
\tl_set:Nn \l__ccnu_thm_style_tl { plain }
\IfValueT {#2} { \keys_set:nn { ccnu / theorem } {#2} }
\ccnu_thm_set_header_font:V \l__ccnu_thm_header_font_tl
\ccnu_thm_set_body_font:V \l__ccnu_thm_body_font_tl
\ccnu_thm_set_qed:V \l__ccnu_thm_qed_tl
\IfBooleanTF {#1}
{
\clist_if_in:nVF { plain, break } \l__ccnu_thm_style_tl
{
\clist_if_in:NVTF
\c__ccnu_thm_style_plain_clist \l__ccnu_thm_style_tl
{ \__ccnu_thm_redefine_style:n { plain } }
{
\clist_if_in:NVTF
\c__ccnu_thm_style_break_clist \l__ccnu_thm_style_tl
{ \__ccnu_thm_redefine_style:n { break } }
{
\__ccnu_error:nx { unknown-theorem-style }
{ \l__ccnu_thm_style_tl }
}
}
}
\tl_put_left:Nn \l__ccnu_thm_style_tl { nonumber }
\ccnu_thm_new_no_number:Vxx \l__ccnu_thm_style_tl {#3} {#4}
}
{
\clist_clear:N \l__ccnu_tmpa_clist
\clist_concat:NNN \l__ccnu_tmpa_clist
\c__ccnu_thm_style_plain_clist \c__ccnu_thm_style_break_clist
\clist_if_in:NVF \l__ccnu_tmpa_clist \l__ccnu_thm_style_tl
{
\__ccnu_error:nx { unknown-theorem-style }
{ \l__ccnu_thm_style_tl }
}
\ccnu_thm_new:VVxx \l__ccnu_thm_style_tl \l__ccnu_thm_counter_tl
{#3} {#4}
}
}
\cs_new:Npn \__ccnu_thm_redefine_style:n #1
{
\__ccnu_warning:nxx { redefine-theorem-style }
{#1} { \l__ccnu_thm_style_tl }
\tl_set:Nn \l__ccnu_thm_style_tl {#1}
}
\__ccnu_msg_new:nn { redefine-theorem-style }
{ Theorem~ style~ "#2"~ will~ be~ redefined~ as~ "#1". }
\__ccnu_msg_new:nn { unknown-theorem-style }
{ Theorem~ style~ "#1"~ is~ unknown. }
\cs_new:Npn \ccnu_thm_new:nnnn #1#2#3#4
{
\__ccnu_thm_ntheorem_style:n {#1}
\__ccnu_thm_ntheorem_new:w {#3} {#4} [#2]
}
\cs_generate_variant:Nn \ccnu_thm_new:nnnn { VVxx }
\cs_new:Npn \ccnu_thm_new_no_number:nnn #1#2#3
{
\__ccnu_thm_ntheorem_style:n {#1}
\__ccnu_thm_ntheorem_new:w {#2} {#3}
}
\cs_generate_variant:Nn \ccnu_thm_new_no_number:nnn { Vxx }
\cs_new:Npn \ccnu_thm_set_qed:n #1 { \theoremsymbol {#1} }
\cs_new:Npn \ccnu_thm_set_header_font:n #1 { \theoremheaderfont {#1} }
\cs_new:Npn \ccnu_thm_set_body_font:n #1 { \theorembodyfont {#1} }
\cs_generate_variant:Nn \ccnu_thm_set_qed:n { V }
\cs_generate_variant:Nn \ccnu_thm_set_header_font:n { V }
\cs_generate_variant:Nn \ccnu_thm_set_body_font:n { V }
% \clist_const:Nn \c__ccnu_thm_style_plain_clist
% { plain, margin, change }
% \clist_const:Nn \c__ccnu_thm_style_break_clist
% { break, marginbreak, changebreak }
% \tl_new:N \l__ccnu_thm_style_tl
% \tl_new:N \l__ccnu_thm_header_font_tl
% \tl_new:N \l__ccnu_thm_body_font_tl
% \tl_new:N \l__ccnu_thm_qed_tl
% \tl_new:N \l__ccnu_thm_counter_tl
% \keys_define:nn { ccnu / theorem }
% {
% style .tl_set:N = \l__ccnu_thm_style_tl,
% header-font .tl_set:N = \l__ccnu_thm_header_font_tl,
% body-font .tl_set:N = \l__ccnu_thm_body_font_tl,
% qed .tl_set:N = \l__ccnu_thm_qed_tl,
% counter .tl_set:N = \l__ccnu_thm_counter_tl
% }
% \cs_new_eq:NN \__ccnu_thm_ntheorem_style:n \theoremstyle
% \cs_new_eq:NN \__ccnu_thm_ntheorem_new:w \newtheorem
% \RenewDocumentCommand \newtheorem { s o m m }
% {
% \IfBooleanTF {#1}
% { \tl_set:Nn \l__ccnu_thm_qed_tl { \ensuremath { \square } } }
% { \tl_set:Nn \l__ccnu_thm_qed_tl { } }
% \tl_set:Nn \l__ccnu_thm_style_tl { plain }
% \IfValueT {#2} { \keys_set:nn { ccnu / theorem } {#2} }
% \ccnu_thm_set_header_font:V \l__ccnu_thm_header_font_tl
% \ccnu_thm_set_body_font:V \l__ccnu_thm_body_font_tl
% \ccnu_thm_set_qed:V \l__ccnu_thm_qed_tl
% \IfBooleanTF {#1}
% {
% \clist_if_in:nVF { plain, break } \l__ccnu_thm_style_tl
% {
% \clist_if_in:NVTF
% \c__ccnu_thm_style_plain_clist \l__ccnu_thm_style_tl
% { \__ccnu_thm_redefine_style:n { plain } }
% {
% \clist_if_in:NVTF
% \c__ccnu_thm_style_break_clist \l__ccnu_thm_style_tl
% { \__ccnu_thm_redefine_style:n { break } }
% {
% \__ccnu_error:nx { unknown-theorem-style }
% { \l__ccnu_thm_style_tl }
% }
% }
% }
% \tl_put_left:Nn \l__ccnu_thm_style_tl { nonumber }
% \ccnu_thm_new_no_number:Vxx \l__ccnu_thm_style_tl {#3} {#4}
% }
% {
% \clist_clear:N \l__ccnu_tmpa_clist
% \clist_concat:NNN \l__ccnu_tmpa_clist
% \c__ccnu_thm_style_plain_clist \c__ccnu_thm_style_break_clist
% \clist_if_in:NVF \l__ccnu_tmpa_clist \l__ccnu_thm_style_tl
% {
% \__ccnu_error:nx { unknown-theorem-style }
% { \l__ccnu_thm_style_tl }
% }
% \ccnu_thm_new:VVxx \l__ccnu_thm_style_tl \l__ccnu_thm_counter_tl
% {#3} {#4}
% }
% }
% \cs_new:Npn \__ccnu_thm_redefine_style:n #1
% {
% \__ccnu_warning:nxx { redefine-theorem-style }
% {#1} { \l__ccnu_thm_style_tl }
% \tl_set:Nn \l__ccnu_thm_style_tl {#1}
% }
% \__ccnu_msg_new:nn { redefine-theorem-style }
% { Theorem~ style~ "#2"~ will~ be~ redefined~ as~ "#1". }
% \__ccnu_msg_new:nn { unknown-theorem-style }
% { Theorem~ style~ "#1"~ is~ unknown. }
% \cs_new:Npn \ccnu_thm_new:nnnn #1#2#3#4
% {
% \__ccnu_thm_ntheorem_style:n {#1}
% \__ccnu_thm_ntheorem_new:w {#3} {#4} [#2]
% }
% \cs_generate_variant:Nn \ccnu_thm_new:nnnn { VVxx }
% \cs_new:Npn \ccnu_thm_new_no_number:nnn #1#2#3
% {
% \__ccnu_thm_ntheorem_style:n {#1}
% \__ccnu_thm_ntheorem_new:w {#2} {#3}
% }
% \cs_generate_variant:Nn \ccnu_thm_new_no_number:nnn { Vxx }
% \cs_new:Npn \ccnu_thm_set_qed:n #1 { \theoremsymbol {#1} }
% \cs_new:Npn \ccnu_thm_set_header_font:n #1 { \theoremheaderfont {#1} }
% \cs_new:Npn \ccnu_thm_set_body_font:n #1 { \theorembodyfont {#1} }
% \cs_generate_variant:Nn \ccnu_thm_set_qed:n { V }
% \cs_generate_variant:Nn \ccnu_thm_set_header_font:n { V }
% \cs_generate_variant:Nn \ccnu_thm_set_body_font:n { V }
\captionsetup [ figure ]
{
font = small,
Expand Down Expand Up @@ -2098,20 +2100,70 @@
info / secret-level = none,
info / school-id = { 10246 },
info / date = { \zhtoday },
theorem / header-font = { \sffamily },
theorem / body-font = { \ccnu@kai },
theorem / counter = { chapter }
% 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 }
\newtheorem { definition } { \c__ccnu_name_definition_tl }
\newtheorem { example } { \c__ccnu_name_example_tl }
\newtheorem { lemma } { \c__ccnu_name_lemma_tl }
\newtheorem { theorem } { \c__ccnu_name_theorem_tl }
% \newtheorem* { proof } { \c__ccnu_name_proof_tl }
% \newtheorem { axiom } { \c__ccnu_name_axiom_tl }
% \newtheorem { corollary } { \c__ccnu_name_corollary_tl }
% \newtheorem { definition } { \c__ccnu_name_definition_tl }
% \newtheorem { example } { \c__ccnu_name_example_tl }
% \newtheorem { lemma } { \c__ccnu_name_lemma_tl }
% \newtheorem { theorem } { \c__ccnu_name_theorem_tl }

\cs_new:Npn \__xdyymath_declare_theorem_with_counter_within:n #1
{
\declaretheorem
[
name = \clist_item:nn {#1} {1} ,
refname = \clist_item:nn {#1} {2} ,
within = \clist_item:nn {#1} {3} ,
]
{ \clist_item:nn {#1} {4} }
}
\cs_new:Npn \__xdyymath_declare_theorem_with_counter_sibling:n #1
{
\declaretheorem
[
name = \clist_item:nn {#1} {1} ,
refname = \clist_item:nn {#1} {2} ,
sibling = \clist_item:nn {#1} {3} ,
]
{ \clist_item:nn {#1} {4} }
}
\cs_new:Npn \__xdyymath_declare_theorem_without_counter:n #1
{
\declaretheorem
[
name = \clist_item:nn {#1} {1} ,
refname = \clist_item:nn {#1} {2},
numbered = no,
% headpunct = {},
style = withoutcounterstyle
]
{ \clist_item:nn {#1} {3} }
}
\clist_map_function:nN
{
{ 定理, 定理, chapter, theorem },
{ 例, 例, chapter, example },
{ 问题, 问题, chapter, question },
}\__xdyymath_declare_theorem_with_counter_within:n

\clist_map_function:nN
{
{ 定义, 定义, theorem, definition },
{ 性质, 性质, theorem, property },
{ 命题, 命题, theorem, proposition },
{ 推论, 推论, theorem, corollary },
{ 引理, 引理, theorem, lemma },
{ 公理, 公理, theorem, axiom },
{ 反例, 反例, theorem, antiexample },
{ 猜想, 猜想, theorem, conjecture },
}\__xdyymath_declare_theorem_with_counter_sibling:n

% 去掉目录的页码
% https://tex.stackexchange.com/questions/38847/clear-tableofcontents-page-in-book-or-report
Expand Down Expand Up @@ -2222,4 +2274,5 @@
% 可以是单个文件,也可以是用英文逗号 “,” 隔开的一组文件
% 如果使用 biblatex,则必须明确给出 .bib 后缀名
}
}
}

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 更新日志

## [v1.0.3] - 2022-02-19
### Fixed
- 修复`msg`报错

### Changed
- 重新修改定理类环境

## [v1.0.2] - 2022-02-01
### Changed
- 修改`choices`宏包为`xchoices`宏包
Expand Down
2 changes: 1 addition & 1 deletion back/Appendix.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ \chapter*{附录}

此处可以写调查问卷,访谈记录等

\verb|xchoices{}|环境可以排版任意个选项,用\verb|\item|分隔即可(现将代码注释掉,如有需要取消注释即可,如果不需要,可自行删除或不管(因为不影响编译效果)
\verb|xchoices|环境可以排版任意个选项,用\verb|\item|分隔即可(现将代码注释掉,如有需要取消注释即可,如果不需要,可自行删除或不管(因为不影响编译效果)

% \begin{xchoices}
% \item 选项1
Expand Down
2 changes: 1 addition & 1 deletion body/chapter1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ \section{研究背景}
\subsection{前人工作}


测试 \parencite{邱泽奇建构与分化}
测试 \parencite{邱泽奇建构与分化} %带方括号的引用 \cite 为无格式的引用
\section{研究背景}
Loading

0 comments on commit ee9e30b

Please sign in to comment.