\documentclass[UTF8,AutoFakeBold]{szu2024}
\renewcommand{\titleCN}{研究}
\renewcommand{\titleEN}{The Research}
% 文本
\usepackage{ctex}
\usepackage{fancyhdr}
% dgq package
\usepackage{makecell}
\usepackage{fontspec}
%圆
%\usepackage{xeCJK}
%%adding package 边距设置
\usepackage[left=31.7mm,right=31.7mm,top=25.4mm,bottom=25.4mm]{geometry}
\usepackage{titlesec}
\usepackage{setspace} %使用调整行距的包
\usepackage{subfigure,floatrow}
\usepackage{url}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{caption,cite,amsbsy,amsmath,amsfonts,multirow,color,array,booktabs,colortbl}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{pdfpages}
\usepackage{changepage}
\usepackage{titlesec}
% \usepackage{algorithmicx,algorithm}
\usepackage{epsfig,bm}
\usepackage{slashbox}
\usepackage{enumitem}
\usepackage{amssymb,amsthm,amssymb}
\usepackage{graphicx,subfigure}
\usepackage{graphicx}
\usepackage{ulem}
\usepackage{floatrow}
\usepackage{arydshln} % 加载arydshln宏包
\usepackage{tabularx}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=bottom}
\newfloatcommand{capbtabboxTable}{table}[][\FBwidth]
\newfloatcommand{capbtabboxFigure}{figure}[][\FBwidth]
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}
\newtheorem{definition}{定义}[] % 跟随三级标题排序
\newtheorem{theorem}{定理}[] %跟随二级标题排序
\newtheorem{lemma}[theorem]{引理}
\newtheorem{corollary}[theorem]{推论}
\newtheorem{proposition}{命题}[]
% 重新调整参考文献项目之间的行距
\usepackage{bibspacing}
\setlength{\bibspacing}{1\baselineskip}
%给目录和参考文献加上超链接
%\usepackage[hidelinks]{hyperref}
%引用
\newcommand{\upcite}[1]{{\textsuperscript{\cite{#1}}}}
%defines the height of the header
% \setlength{\headheight}{15pt}
\setlength{\headheight}{23pt}
\setlength{\headsep}{7.25mm}
\hypersetup{
pdfborder = {0 0 0}
}
\newfontfamily\sectionef{Arial}
%\titleformat{\section}{\center\zihao{3}\heiti\bfseries\sectionef}{第\,\zhnumber{\thesection}\,章}{1em}{}
\ctexset{
section={
format+ = \heiti\bfseries\zihao{3},
name = {第,章},
number = \chinese{section}
}
}
\titleformat{\subsection}{\zihao{-3}\heiti\bfseries\sectionef}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\zihao{4}\bfseries\fontspec{songti-Bold.otf}}{\thesubsubsection}{1em}{}
\titlecontents{section}[0em]{\bfseries\zihao{-4}}{\contentspush{\thecontentslabel\hspace{1em}}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}%
\titlecontents{subsection}[1em]{\ttfamily\zihao{-4}}{{\thecontentslabel}\hspace{1em}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}
\titlecontents{subsubsection}[1.8em]{\ttfamily\zihao{-4}}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}
%document begin
\begin{document}
%封面 自行配置生成pdf文件导入即可
\includepdf[pages={1,2}]{chapter/cover.pdf}
%中英文摘要 以及 缩写表
\input{chapter/abstract.tex}
\setlength{\baselineskip}{23pt} %设置行距23磅
\tableofcontents %目录
%%%%%%%%% 图索引和表索引
% \renewcommand\listfigurename{\songti\zihao{2}{\textbf{图~~目~~录}}}
% \renewcommand\listtablename{\songti\zihao{2}{\textbf{表~~目~~录}}}
% \renewcommand{\figurename}{图}
% \renewcommand{\tablename}{表}
\makeatletter %
\@addtoreset{equation}{section}
\makeatother %
% 公式更改为3-2样式
\renewcommand\theequation{{\thesection}-{\arabic{equation}}}
%%%%%%%%%% 表每节重新标号
\makeatletter %
\@addtoreset{table}{section}
\makeatother %
\renewcommand{\thetable}{\thesection-\arabic{table}}
\captionsetup[table]{labelsep=space, labelfont=bf}
%%%%%%%% 图每节重新标号
\makeatletter %
\@addtoreset{figure}{section}
\makeatother %
\renewcommand{\thefigure}{\thesection-\arabic{figure}}
\captionsetup[figure]{labelsep=space, labelfont=bf}
%labelfont=normalfont}
% subfigure重新编号\ref
\makeatletter
\renewcommand{\p@subfigure}{\thefigure}
\makeatother
%adding chapters 1-5 从1开始计数
\setcounter{page}{1}
\input{chapter/cp1.tex}
\input{chapter/cp2.tex}
\input{chapter/cp3.tex}
\input{chapter/cp4.tex}
\input{chapter/cp5.tex}
\clearpage
%参考文献
\fancyhead{}
\fancyhead[C]{\songti\zihao{5}{参考文献}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\begin{spacing}{1.8}
\bibliographystyle{gbt7714-2005}
\bibliography{ref_paper}
\end{spacing}
\clearpage
\fancyhead{}
\fancyhead[C]{\songti\zihao{5}{致谢}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\input{chapter/thanks.tex}
\clearpage
\fancyhead{}
\fancyhead[C]{\songti\zihao{5}{攻读硕士学位期间的学术成果}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\input{chapter/myPapers.tex}
\end{document}
%当需要在论文末尾插入相关的文件,可以生成pdf文件格式进行附加,附加一页就是1,多页就是1,2,3
%\includepdf[pages={1}]{chapter/comment.pdf}
%\includepdf[pages={1}]{chapter/decision.pdf}
\NeedsTeXFormat{LaTeX2e}[2007/10/19]
\ProvidesClass{szu2024}
[2024/1/24 v1 Thesis Template for SZU Postgraduate]
\LoadClass[cs4size,12pt,a4paper,fntef,UTF8]{ctexart}[2024/1/24]
\RequirePackage{amsmath,amsthm,amsfonts,amssymb,bm,times,fancyhdr}
\RequirePackage{epigraph, titlesec, textcomp, ctex}
\RequirePackage{hyperref,caption,titletoc}
\DeclareCaptionFont{wuhao}{\zihao{5}}
%\DeclareCaptionFont{bfseries}{\bfseries}
\newcommand{\xiaowu}{\zihao{-5}}
\newcommand{\xiaochu}{\fontsize{0}{0}\selectfont}
\CTEXdigits{\mynumber}{2024}
% % 设置表格标题格式
%\captionsetup[table]{labelfont=bfseries, font=bf}
% 设置图形标题格式
% 设置表格标题格式 加粗 字体大小
\captionsetup{font={bf, wuhao}}
\renewcommand{\thefigure}{\arabic{figure}} %图表的计数方式
\renewcommand{\thetable}{\arabic{table}} %图表的计数方式
\renewcommand{\contentsname}{\heiti\zihao{3}{\textbf{目~录}\vspace{1\baselineskip}}}
\renewcommand\refname{\heiti\zihao{-3}{\textbf{参~考~文~献}}}
%上标方式
\makeatletter
\def\@cite#1#2{\textsuperscript{[{#1\if@tempswa , #2\fi}]}}
\makeatother
\newcommand{\titleCN}[1][~]{#1}
\newcommand{\titleEN}[1][~]{#1}
\newcommand{\newContects}{section}
%全局英文字体
\setmainfont{Times New Roman}
%全文字体
\setCJKmainfont{simsun.ttc}
%设置页眉的横线
\renewcommand{\headrule}{%
\hrule width\headwidth height1.5pt % 粗直线
\vspace{1pt} % 1pt的空白间隔
\hrule width\headwidth height0.75pt % 细直线
}
%设置目录树显示深度
\setcounter{tocdepth}{3}
%调整目录显示规则
% \titlecontents{section}[0em]{\bfseries\zihao{-4}}{\contentspush{\thecontentslabel\hspace{1em}}}{}{\titlerule*{$\cdot$}\contentspage\vspace{1.6pt}}%
% \titlecontents{subsection}[2em]{\zihao{-4}}{\thecontentslabel\hspace{1em}}{}{\titlerule*{$\cdot$}\contentspage\vspace{1.6pt}}
% \titlecontents{subsubsection}[4em]{\zihao{-4}}{\thecontentslabel\hspace{1em}}{}{\titlerule*{$\cdot$}\contentspage\vspace{1.6pt}}
% 自定义小节标题编号的样式
%\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} % 编号字体设置为黑体
%图标目录设置 没使用
\titlecontents{figure}[0em]{\zihao{4}}{图~\thecontentslabel\hspace{1em}}{}{\titlerule*{$\cdot$}\contentspage}
\titlecontents{table}[0em]{\zihao{4}}{表~\thecontentslabel\hspace{1em}}{}{\titlerule*{$\cdot$}\contentspage}
%目录样式
\let\savedtableofcontents\tableofcontents
%//相关设置
\renewcommand{\tableofcontents}{%
\pagestyle{plain}
\savedtableofcontents
\newpage
\pagenumbering{arabic}
\pagestyle{fancy} % 页眉横线样式
\fancyhead{}
%\fancyhead[C]{\songti\zihao{5}{\titleCN}}
% 全局页眉 设置为章节标题
\fancyhead[C]{\songti\zihao{5}\leftmark}
%全局页号设置
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\setcounter{page}{1}
}
%参考文献样式
\let\savedbibliographystyle\bibliographystyle
\renewcommand{\bibliographystyle}[1]{
\newpage
%中文字体
\phantomsection % 添加超链接的目标位置
\hypertarget{references}{} % 设置超链接的目标位置
\setstretch{1.25}
\addcontentsline{toc}{\newContects}{\songti\textbf{参考文献}} % \zihao{-4}
\songti\zihao{5}
\savedbibliographystyle{#1}
}
%中文摘要
\newenvironment{abstractCN}{
\newpage
\pagenumbering{Roman}
\thispagestyle{fancy}
\fancyhead[C]{\songti\zihao{5}{\titleCN}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
% 让加入的目录带超链接
\phantomsection % 添加超链接的目标位置
\hypertarget{abstractCN}{} % 设置超链接的目标位置
\addcontentsline{toc}{\newContects}{\songti\textbf{摘~要}} % 在目录中显示摘要
\vspace{1\baselineskip}
\begin{center}
% {\heiti\zihao{3}
\heiti\zihao{3}{\textbf{~\\}}
\heiti\zihao{3}{\textbf{摘~~要}}
\end{center}
\vspace{1\baselineskip}
\songti\zihao{-4}
}{}
%中文关键词
\newenvironment{keywordCN}{
\fancyhead[C]{\songti\zihao{5}{\titleCN}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\vspace{2\baselineskip} %空两行
\songti\zihao{-4}
\thispagestyle{fancy}
\noindent{{\heiti\zihao{-4}\textbf{关键词:}}}
}
{\newpage}
%英文摘要
\newenvironment{abstractEN}{
\newpage
\thispagestyle{fancy}
\fancyhead[C]{\songti\zihao{5}{\titleEN}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\phantomsection % 添加超链接的目标位置
\hypertarget{abstractEN}{} % 设置超链接的目标位置
\addcontentsline{toc}{\newContects}{\textbf{ABSTRACT}} %\zihao{-4}% 在目录中显示摘要
\vspace{1\baselineskip}
\begin{center}
\songti\zihao{3}{\textbf{~\\}}
\setmainfont{Arial}{\zihao{3}{\textbf{ABSTRACT}} }
\end{center}
\vspace{1\baselineskip}
\songti\zihao{-4}
}{}
%英文关键词
\newenvironment{keywordEN}{
\fancyhead[C]{\songti\zihao{5}{\titleEN}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\vspace{2\baselineskip} %空两行
\songti\zihao{-4}
\thispagestyle{fancy}
\noindent{\textbf{Key words: }}
}
{\newpage}
% 定义符号和缩略语说明
\newenvironment{signAndABC}{
\newpage
\thispagestyle{fancy}
\fancyhead[C]{\songti\zihao{5}{符号和缩略语说明}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\phantomsection % 添加超链接的目标位置
\hypertarget{signAndABC}{} % 设置超链接的目标位置
\addcontentsline{toc}{\newContects}{\textbf{符号和缩略语说明}} % 在目录中显示摘要\zihao{-4}
\vspace{1\baselineskip}
\begin{center}
\songti\zihao{3}{\textbf{~\\}}
{\heiti\zihao{3}{\textbf{符号和缩略语说明}} }
\end{center}
\vspace{1\baselineskip}
\songti\zihao{-4}
}{\newpage}
%定义附录环境 致谢
\newenvironment{szuAppendix}[1]{
\newpage
\phantomsection % 添加超链接的目标位置
\hypertarget{szuAppendix}{} % 设置超链接的目标位置
\addcontentsline{toc}{\newContects}{\textbf{致~谢}} % 在目录中显示附录 \zihao{-4}
\vspace{1\baselineskip}
\begin{center}
\songti\zihao{3}{\textbf{~\\}}
\heiti\bfseries\zihao{3}{#1}
\end{center}
\vspace{0.5\baselineskip}
\songti\zihao{5}
}{}
%定义附录环境 攻读硕士学位期间研究成果
\newenvironment{szuAppendixB}[1]{
\newpage
\thispagestyle{fancy}
\fancyhead[C]{\songti\zihao{5}{\titleEN}}
\fancyfoot[C]{\songti\zihao{5}{\thepage}}
\phantomsection % 添加超链接的目标位置
\hypertarget{szuAppendixB}{} % 设置超链接的目标位置
\addcontentsline{toc}{\newContects}{\textcolor{blue}{\underline{\textbf{#1}}}} % 在目录中显示附\zihao{-4}
\vspace{1\baselineskip}
\begin{center}
\songti\zihao{3}{\textbf{~\\}}
\heiti\bfseries\zihao{3}{#1}
\end{center}
\vspace{0.5\baselineskip}
\songti\zihao{5}
}{}
% section title设置
% \ctexset{
% section = {
% name={第,章},number={\chinese{section}},
% format+={\heiti\bfseries\zihao{3}},
% titleformat={\heiti \zihao {3}},
% numberformat={\heiti \zihao {3}},
% beforeskip = 10.0ex plus 0.2ex minus .2ex,
% %afterskip用于设置章节标题后的垂直间距
% afterskip = 10.0ex plus 0.2ex minus .2ex,
% },
% subsection = {
% name={,},number={\thesubsection},
% format+={\heiti\bfseries\zihao{-3}},
% titleformat={\heiti \zihao {-3}},
% numberformat={\heiti \zihao {-3}},
% beforeskip={24pt},afterskip={6pt},
% },
% subsubsection = {
% name={,},number={\thesubsubsection},
% format+={\songti\bfseries\zihao{4}},
% titleformat={\songti \zihao {4}},
% numberformat={\songti \zihao {4}},
% beforeskip={12pt},afterskip={6pt},
% }
% }
%\CTEXsetup[name={第,章},number={\chinese{section}}]{section}
%\CTEXsetup[format+={\heiti\bfseries\zihao{3}}]{section}
%\CTEXsetup[name={,},number={\thesubsection}]{subsection}
%\CTEXsetup[format+={\heiti\bfseries\zihao{-3}}]{subsection}
%\CTEXsetup[name={,},number={\thesubsubsection}]{subsubsection}
%\CTEXsetup[format+={\songti\bfseries\zihao{4}}]{subsubsection}
\setCJKfamilyfont{sectionfont}{SimHei} % 设置一级和二级标题字体为黑体
\setCJKfamilyfont{subsectionfont}{SimHei}
%\CTEXsetup[name={第,章},number={\chinese{section}},format+={\heiti\bfseries\zihao{3}}]{section}
%\CTEXsetup[name={,},number={\ti\thesubsection},format+={\heiti\bfseries\zihao{-3}}]{subsection}
%\CTEXsetup[name={,},number={\thesubsubsection},format+={\songti\bfseries\zihao{4}}]{subsubsection}
%\ctexset{
% section={
% format+ = \heiti\bfseries\zihao{3},
% name = {第,章},
% number = \chinese{section}
% },
% subsection={
% format+ = \heiti\zihao{-3},
% %仅输出subsection编号且为中文
% name = {,},
% },
% subsubsection={
% format+=\songti\zihao{4},
% %设置对齐方式为居中对齐
% %仅输出subsubsection编号,格式为阿拉伯数字,打字机字体
% number = {\ttfamily\thesubsubsection},
% name = {,},
% }
%}
%\titlecontents{section}[0em]{\bfseries\zihao{-4}}{\contentspush{\thecontentslabel\hspace{1em}}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}%
%\titlecontents{subsection}[1em]{\ttfamily\zihao{-4}}{{\thecontentslabel}\hspace{1em}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}
%\titlecontents{subsubsection}[1.8em]{\ttfamily\zihao{-4}}{\thecontentslabel\hspace{1em}}{}{\titlerule*[0.4pc]{.}\contentspage\vspace{1.6pt}}
\endinput