Skip to content

Commit

Permalink
废弃 \gdutchapter 命令,重定义 \chapter 命令
Browse files Browse the repository at this point in the history
  • Loading branch information
sikouhjw committed Apr 1, 2022
1 parent 5484c2e commit 476060d
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 65 deletions.
21 changes: 11 additions & 10 deletions example/Qiuyun_Zou.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
style = {
cover = {false},
font = {times*},
math-font = {times*},
cjk-font = {fandol},
cjk-font = {windows},
bib-backend = {bibtex},
Expand Down Expand Up @@ -95,8 +96,8 @@

\mainmatter

\gdutchapter{绪论}{Introduction}
\gdutsection{研究背景和意义}{Background and Significance}
\chapter{绪论}{Introduction}
\section{研究背景和意义}{Background and Significance}

标准线性模型的形式如下
\begin{equation}
Expand All @@ -118,7 +119,7 @@
$p( \mbfit y | \mbfit z ) = \prod_{a=1}^M p( y_a | z_a )$
替换了 SLM 中的加性噪声项。

\gdutsection{章节安排}{Chapters' arrangement}
\section{章节安排}{Chapters' arrangement}

本文主要研究贝叶斯重构算法及其应用,针对目前几个应用较为广泛的系统模型,
总结归纳现有的几个较为前沿的算法。本文的章节安排如下
Expand All @@ -138,12 +139,12 @@
\end{itemize}


\gdutchapter{数学基础}{Fundamentals of Mathematics}
\chapter{数学基础}{Fundamentals of Mathematics}

本章给出了本文其余章节所用到的现有数学知识。这些知识点包括:常用的矩阵
论和概率论的现有结论、贝叶斯估计原理以及因子图。

\gdutsection{矩阵论与概率论}{Theory of Matrices and Probability}
\section{矩阵论与概率论}{Theory of Matrices and Probability}

\paragraph{矩阵奇异值分解。}

Expand All @@ -159,7 +160,7 @@
$\mbf \Lambda = \Diag ( \lambda_1, \lambda_2, \cdots, \lambda_r )$
并且 $\lambda_1 \geqslant \lambda_2 \geqslant \cdots \geqslant \lambda_r \geqslant 0$

\gdutsubsection{概率论}{Theory of Probability}
\subsection{概率论}{Theory of Probability}
\begin{lemma}[标量高斯相乘引理]
假设 $\mscr N ( x | a, A )$$\mscr N ( x | b, B )$,则有
\begin{equation}
Expand All @@ -170,8 +171,8 @@
标量高斯相乘引理的证明分为两个部分,分别是指数部分和常数部分。
\end{proof}

\gdutsubsection{贝叶斯估计原理}{Principle of Bayesian Estimation}
\gdutsubsection{最小均方误差估计}{Minimum Mean Square Error Estimation}
\subsection{贝叶斯估计原理}{Principle of Bayesian Estimation}
\subsection{最小均方误差估计}{Minimum Mean Square Error Estimation}

代价函数的选择,需要从数学角度尽可能简单出发。通常考虑二次误差形、绝对误
差、成功失败误差三种情况,如\autoref{Common_cost_function} 所示。显然,最
Expand All @@ -193,8 +194,8 @@
\label{Common_cost_function}
\end{figure}

\gdutchapter{标准线性可逆问题的快速解法}{Fast Recovery of Standard Linear Inverse Problem}
\gdutsection{应用:Massive MIMO 信号检测}{Application in Massive MIMO Signal Detection}
\chapter{标准线性可逆问题的快速解法}{Fast Recovery of Standard Linear Inverse Problem}
\section{应用:Massive MIMO 信号检测}{Application in Massive MIMO Signal Detection}

VAMP算法,其计算量主要集中在矩阵求逆部分,假设迭代次数为 $T$,则其计算复杂度
$\mscr O(TN^3)$。对比各检测器的计算复杂度,得到\autoref{Comparison_diagram_of_computational_complexity_of_detector}。
Expand Down
116 changes: 76 additions & 40 deletions gdutthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,15 @@
\box_wd:N \l__ctex_tmp_box
}
}
\xpatchcmd{\tableofcontents}
{\chapter*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}}{\chapter{\contentsname}}
\xpatchcmd \tableofcontents
{
\chapter*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
}
{
\gdut_chapter { \contentsname }
}
{}{}
%% 定义双语目录
\def\en@toc@ext{tec}
Expand All @@ -307,26 +312,38 @@
}

%% provide \@enTableOfContents
\let\@enTableOfContents\tableofcontents
\cs_new_eq:NN \@enTableOfContents \tableofcontents
\@ifundefined {chapter}
{ % e.g., article.cls
\xpatchcmd\@enTableOfContents
{\@starttoc{toc}}
{\endgroup\@starttoc{\en@toc@ext}}
{}{\fail}
\xpatchcmd \@enTableOfContents
{
\@starttoc{toc}
}
{
\endgroup
\@starttoc{\en@toc@ext}
}
{ } { \fail }
}
{ % e.g., book.cls
\xpatchcmd\@enTableOfContents
{\chapter}
\xpatchcmd \@enTableOfContents
{
\gdut_chapter
}
{
\begingroup
\chapter
\gdut_chapter
}
{ } { \fail }
\xpatchcmd \@enTableOfContents
{
\@starttoc{toc}
}
{
\endgroup
\@starttoc{\en@toc@ext}
}
{}{\fail}
\xpatchcmd\@enTableOfContents
{\@starttoc{toc}}
{\endgroup\@starttoc{\en@toc@ext}}
{}{\fail}
{ } { \fail }
}

%% modify to write two toc entries
Expand Down Expand Up @@ -1189,14 +1206,29 @@
\gdutmaketitle
}
%% 定义双语章节
\let\mychapter=\chapter
\let\mysection=\section
\let\mysubsection=\subsection
\def\gdutchapter#1#2{\enSectionTitle{#2}\mychapter{#1}}
\def\gdutsection#1#2{\enSectionTitle{#2}\mysection{#1}}
\def\gdutsubsection#1#2{\enSectionTitle{#2}\mysubsection{#1}}
\def\gdutbackmatter{\ctexset{chapter/numbering=false}}
\def\gdutbacksection#1{\section*{#1}}
\cs_new_protected:Npn \__gdut_backup_chapter_helper:n #1
{
\cs_new_eq:cc { gdut_ #1 } { #1 }
}
\clist_map_inline:nn { chapter, section, subsection } { \__gdut_backup_chapter_helper:n {#1} }
\cs_new_protected:Npn \__gdut_set_chapter_helper:n #1
{
\exp_args:Nc \RenewDocumentCommand { #1 } { m m }
{
\enSectionTitle { ##2 }
\use:c { gdut_ #1 } { ##1 }
}
\cs_new_eq:cc { gdut #1 } { #1 }
}
\clist_map_inline:nn { chapter, section, subsection } { \__gdut_set_chapter_helper:n {#1} }
\NewDocumentCommand \gdutbackmatter { }
{
\ctexset{ chapter/numbering = false }
}
\NewDocumentCommand \gdutbacksection { m }
{
\gdut_section* { #1 }
}
%% 定义成果列表
\newenvironment{results}
{\list{\@biblabel{\@arabic\c@enumiv}}%
Expand Down Expand Up @@ -1235,7 +1267,7 @@
}
{
\phantomsection
\chapter*{学位论文独创性声明}
\gdut_chapter*{学位论文独创性声明}
\addcontentsline{toc}{chapter}{学位论文独创性声明及学位论文版权使用授权声明}
\addcontentsline{tec}{chapter}{Statement~of~original~authorship~and~copyright~licensing~declaration}
\markboth{学位论文独创性声明及学位论文版权使用授权声明}{}
Expand All @@ -1245,7 +1277,7 @@
\begingroup \centering \hspace*{5\ccwd}论文作者签名:\hspace*{5\ccwd}日期:\par \endgroup
\ctexset{chapter/break = {}}
\vspace*{3\baselineskip}
\chapter*{学位论文版权使用授权声明}
\gdut_chapter*{学位论文版权使用授权声明}
\vspace*{\baselineskip+0.9\ccwd}
\c__gdut_auth_decl_text_tl\par
\vspace*{\baselineskip}
Expand Down Expand Up @@ -1283,9 +1315,12 @@
\NewDocumentEnvironment { abstract* } { }
{ \__gdut_abstract_en_begin: } { \__gdut_abstract_en_end: }
\cs_new_protected:Npn \__gdut_abstract_begin:
{ \pagestyle{fancy}\pagenumbering{Roman}\gdutchapter{摘要}{ABSTRACT(IN~CHINESE)} }
{
\pagestyle { fancy }
\pagenumbering { Roman }
\chapter { 摘要 } { ABSTRACT ( IN~CHINESE ) } }
\cs_new_protected:Npn \__gdut_abstract_en_begin:
{ \gdutchapter{ABSTRACT}{ABSTRACT(IN~ENGLISH)} }
{ \chapter { ABSTRACT } { ABSTRACT ( IN~ENGLISH ) } }
\cs_new_protected:Npn \__gdut_abstract_end:
{
\__gdut_keywords:nNn
Expand Down Expand Up @@ -1317,7 +1352,7 @@
}
\cs_new_protected:Npn \__gdut_notation_begin:
{
\gdutchapter{物理量名称及符号表}{Table~of~physical~quantity~names~and~symbols}
\chapter{物理量名称及符号表}{Table~of~physical~quantity~names~and~symbols}
}
\cs_new_protected:Npn \__gdut_notation_long_table_setup:
{
Expand Down Expand Up @@ -1397,7 +1432,7 @@
}
}
{ \exp_args:NV \bibliographystyle \l__gdut_bib_style_tl }
\cs_set:Npn \bibsection { \gdutchapter{参考文献}{References} }
\cs_set:Npn \bibsection { \chapter{参考文献}{References} }
\NewDocumentCommand \printbibliography { o }
{
\exp_args:NV \bibliography \l__gdut_bib_resource_clist
Expand Down Expand Up @@ -1428,7 +1463,7 @@
{
\clist_map_function:NN \l__gdut_bib_resource_clist \addbibresource
\__gdut_biblatex_allow_url_break:
\defbibheading { bibliography } [ 参考文献 ] { \gdutchapter{##1}{References} }
\defbibheading { bibliography } [ 参考文献 ] { \chapter{##1}{References} }
\setlength { \bibitemsep } { 0pt }
}
\cs_new_protected:Npn \__gdut_pass_options_to_biblatex:n #1
Expand Down Expand Up @@ -1545,14 +1580,15 @@
\cs_set_eq:NN \qquad \c_space_tl
}
}
\cs_new:Npn \gduttableofcontents {
\enSectionTitle{CONTENTS(IN~CHINESE)}
\renewcommand\cftchapaftersnumb{\hspace{6.5pt}}
\tableofcontents
\renewcommand\cftchapaftersnumb{\hspace{0pt}}
\enSectionTitle{CONTENTS(IN~ENGLISH)}
\enTableOfContents
}
\cs_new:Npn \gduttableofcontents
{
\renewcommand \cftchapaftersnumb { \hspace{6.5pt} }
\enSectionTitle { CONTENTS ( IN~CHINESE ) }
\tableofcontents
\renewcommand \cftchapaftersnumb { \hspace{0pt} }
\enSectionTitle { CONTENTS ( IN~ENGLISH ) }
\enTableOfContents
}
\ctex_at_end_preamble:n
{
\bool_if:NTF \l__gdut_bibtex_bool
Expand Down
16 changes: 8 additions & 8 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@

\mainmatter

\gdutchapter{绪论}{Introduction}
\chapter{绪论}{Introduction}

\gdutsection{本课题研究背景及研究意义}{Background and significance of research}
\section{本课题研究背景及研究意义}{Background and significance of research}
随着科学技术的进步,产品逐渐向精密化和高性能化发展,具有毫米及微米尺度
微沟槽结构的金属零部件在国防军事、航空航天、新能源、新材料、生物医学、半导
体器件等领域的高技术产品中扮演的角色愈加重要。

\gdutsection{微沟槽电解加工国内外相关研究现状}{Analysis of the research status at home and abroad}
\gdutsubsection{成型电极电解加工}{Shaped cathode electrochemical machining}
\section{微沟槽电解加工国内外相关研究现状}{Analysis of the research status at home and abroad}
\subsection{成型电极电解加工}{Shaped cathode electrochemical machining}
采用与微沟槽结构形状对应的成型阴极,例如薄板阴极,片状阴极等,进行微沟
槽电解加工,其特点是方便一次成型微沟槽形状。南京航空航天大学吕焱明等进行了
大长宽比深窄槽电解加工阴极设计以及工艺试验研究\gdutcite{chendengyuan2000guoshi},如\autoref{fig:example} 所示,具体参考\autoref{sub-fig-1} 和\autoref{sub-fig-2},再参考\autoref{eq:example},再再参考\autoref{tab:example}。
Expand Down Expand Up @@ -185,7 +185,7 @@ \subsubsection{微沟槽电解加工国内外相关研究现状}
测试 test\gdutcite*{woerdelun2012jingji}。

\gdutbackmatter
\gdutchapter{结论与展望}{Conclusion and prospect}
\chapter{结论与展望}{Conclusion and prospect}
\gdutbacksection{研究结论}
\zhlipsum[1]

Expand All @@ -195,7 +195,7 @@ \subsubsection{微沟槽电解加工国内外相关研究现状}
\nocite{*}% 列出全部参考文献
\printbibliography

\gdutchapter{攻读学位期间取得与学位论文相关的成果}{Publication and patents during study}
\chapter{攻读学位期间取得与学位论文相关的成果}{Publication and patents during study}

\gdutbacksection{发表和投稿与学位论文相关学术论文}

Expand All @@ -216,12 +216,12 @@ \subsubsection{微沟槽电解加工国内外相关研究现状}

\gdutstatement

\gdutchapter{致谢}{Acknowlegements}
\chapter{致谢}{Acknowlegements}
\zhlipsum[1]

\gdutappendix

\gdutchapter{附录标题}{The appendix title}
\chapter{附录标题}{The appendix title}
对需要收录于学位论文中且又不适合书写于正文中的附加数据、资料、详细
公式推导、计算机程序等有特色的内容,可做为附录排写。
\end{document}
17 changes: 10 additions & 7 deletions user-manual/gdutthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2016,17 +2016,20 @@ Copyright (C) 2017&ndash;2021 by Xiangdong Zeng <[email protected]>.
%^^A! idea to split the source file into several parts. The page
%^^A! numbers in main matter are shown in arabic numerals.
%^^A!
% \begin{function}{\gdutchapter,\gdutsection,\gdutsubsection,\subsubsection,\paragraph,\subparagraph}
% \begin{fdusyntax}[deletetexcs={\gdutchapter,\gdutsection,\gdutsubsection,\subsubsection,\paragraph,\subparagraph},%
% morekeywords={\gdutchapter,\gdutsection,\gdutsubsection,\subsubsection,\paragraph,\subparagraph}]
% \gdutchapter(*\marg{中文标题}*)(*\marg{英文标题}*)
% \gdutsection(*\marg{中文标题}*)(*\marg{英文标题}*)
% \gdutsubsection(*\marg{中文标题}*)(*\marg{英文标题}*)
% \begin{function}{\chapter,\section,\subsection,\subsubsection,\paragraph,\subparagraph,\gdutchapter,\gdutsection,\gdutsubsection}
% \begin{fdusyntax}[deletetexcs={\chapter,\section,\subsection,\gdutchapter,\gdutsection,\gdutsubsection,\subsubsection,\paragraph,\subparagraph},%
% morekeywords={\chapter,\section,\subsection,\gdutchapter,\gdutsection,\gdutsubsection,\subsubsection,\paragraph,\subparagraph}]
% \chapter(*\marg{中文标题}*)(*\marg{英文标题}*)
% \section(*\marg{中文标题}*)(*\marg{英文标题}*)
% \subsection(*\marg{中文标题}*)(*\marg{英文标题}*)
% \subsubsection(*\marg{中文标题}*)
% \paragraph(*\marg{款的引导句}*)
% \subparagraph(*\marg{项的引导句}*)
% \gdutchapter(*\marg{中文标题}*)(*\marg{英文标题}*)
% \gdutsection(*\marg{中文标题}*)(*\marg{英文标题}*)
% \gdutsubsection(*\marg{中文标题}*)(*\marg{英文标题}*)
% \end{fdusyntax}
% 生成章节标题。|\gdut...| 的章节命令是为了生成中英文目录
% 生成章节标题。|\gdut...| 命令是过时命令,仅为兼容使用
% \end{function}
%
% \begin{function}{axiom,corollary,definition,example,lemma,proof,theorem}
Expand Down

0 comments on commit 476060d

Please sign in to comment.