Skip to content

Commit c00f6e4

Browse files
committed
WIP: finish UT migration
1 parent 045c120 commit c00f6e4

File tree

8 files changed

+119
-220
lines changed

8 files changed

+119
-220
lines changed

Diff for: templates/undergraduate-thesis/bitundergrad.cls

+92-20
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
studentId .tl_set:N = \l_bit_studentid_tl,
6161
mentor .tl_set:N = \l_bit_mentor_tl,
6262
externalMentor .tl_set:N = \l_bit_externalmentor_tl,
63+
keywords .tl_set:N = \l_@@_info_keywords_tl,
64+
keywords .default:n = {北京理工大学;本科生;毕业设计(论文)},
65+
keywordsEn .tl_set:N = \l_@@_info_keywords_en_tl,
66+
keywordsEn .default:n = {BIT; Undergraduate; Graduation Project (Thesis)}
6367
}
6468

6569
\keys_define:nn { bitundergrad / misc }
@@ -131,7 +135,7 @@
131135

132136
\RenewDocumentCommand \contentsname {} {
133137
\fontsize{16pt}{\baselineskip}
134-
\normalfont\heiti{目\hspace{1em}录}
138+
\normalfont\heiti{目\quad 录}
135139
\vspace{-8pt}
136140
}
137141

@@ -153,6 +157,11 @@
153157
\RenewDocumentCommand \mainmatter {} {
154158
\pagenumbering{arabic}
155159
\pagestyle{BIThesis}
160+
% 正文 22 磅的行距
161+
\setlength{\parskip}{0em}
162+
\setstretch{1.53}
163+
% 修复脚注出现跨页的问题
164+
\interfootnotelinepenalty=10000
156165
}
157166

158167
\setlength{\abovecaptionskip}{11pt}
@@ -217,18 +226,6 @@
217226
\DeclareDocumentCommand \BITUndergraduateThesisSetup { m }
218227
{ \keys_set:nn { bitundergrad } { #1 }}
219228

220-
\DeclareDocumentCommand \unnumchapter {m} {
221-
\chapter*{\vskip 10bp\textmd{#1} \vskip -6bp}
222-
\addcontentsline{toc}{chapter}{#1}
223-
\stepcounter{chapter}
224-
}
225-
% \newcommand{\unnumchapter}[1]{
226-
% \chapter*{\vskip 10bp\textmd{#1} \vskip -6bp}
227-
% \addcontentsline{toc}{chapter}{#1}
228-
% \stepcounter{chapter}
229-
% }
230-
231-
232229
% Usage: \dunderline{<line_thickness>}{<text>}
233230
% \cs_set:Npn \dunderline #1#2 {
234231
% {
@@ -323,6 +320,7 @@
323320
}
324321
}
325322

323+
% TODO:
326324
\NewDocumentEnvironment {abstract} {}
327325
{
328326
\zihao{-4}
@@ -334,8 +332,8 @@
334332

335333
\vspace*{2mm}
336334

337-
{\let\clearpage\relax \chapter*{\textmd{摘\hspace{1em}要}}}
338-
\addcontentsline{toc}{chapter}{摘\hspace{1em}要}
335+
{\let\clearpage\relax \chapter*{\textmd{摘\quad 要}}}
336+
\addcontentsline{toc}{chapter}{摘\quad 要}
339337
\setcounter{page}{1}
340338

341339
\vspace*{1mm}
@@ -344,7 +342,7 @@
344342
\setlength{\parskip}{0em}\par
345343
}
346344
{
347-
\vspace{4ex}\noindent\textbf{\heiti 关键词:北京理工大学;本科生;毕业设计(论文)}\par
345+
\vspace{4ex}\noindent\textbf{\heiti 关键词:\l_@@_info_keywords_tl}\par
348346
\newpage
349347
}
350348

@@ -369,13 +367,87 @@
369367
\setlength{\parskip}{0em}\par
370368
}
371369
{
372-
\par\vspace{3ex}\noindent\textbf{Key Words: BIT; Undergraduate; Graduation Project (Thesis)}
370+
\par\vspace{3ex}\noindent\textbf{Key Words:~\l_@@_info_keywords_en_tl}
373371
\newpage
374372
}
375373

374+
\NewDocumentEnvironment {conclusion} {}
375+
{
376+
\ctexset{
377+
chapter = {
378+
numbering = false,
379+
beforeskip = 18bp,
380+
format = {\heiti \mdseries \centering \zihao{3}},
381+
afterskip = 26bp,
382+
},
383+
section/number = \arabic{section}
384+
}
385+
386+
\stepcounter{chapter}
387+
\chapter{\quad}
388+
\renewcommand{\thechapter}{结论}
389+
}
390+
{}
376391

377-
\DeclareDocumentCommand \MakeReviewTable {}
392+
\NewDocumentEnvironment {bibprint} {}
378393
{
379-
\group_begin:
380-
\group_end:
394+
\ctexset{
395+
chapter = {
396+
numbering = false,
397+
beforeskip = 18bp,
398+
format = {\heiti \mdseries \centering \zihao{3}},
399+
afterskip = 26bp,
400+
},
401+
}
402+
% 设置参考文献字号为 5 号
403+
\renewcommand*{\bibfont}{\zihao{5}}
404+
% 设置参考文献各个项目之间的垂直距离为 0
405+
\setlength{\bibitemsep}{0ex}
406+
\setlength{\bibnamesep}{0ex}
407+
\setlength{\bibinitsep}{0ex}
408+
% 设置单倍行距
409+
\renewcommand{\baselinestretch}{1.2}
410+
% 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距
411+
\setlength{\biblabelsep}{1.7mm}
412+
% 设置参考文献后文缩进为 0(与 Word 模板保持一致)
413+
\RenewDocumentCommand \itemcmd {} {
414+
\addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用
415+
\mkgbnumlabel{\printfield{labelnumber}}
416+
\hspace{\biblabelsep}
417+
}
418+
}
419+
{}
420+
421+
\NewDocumentEnvironment {appendices} {}
422+
{
423+
\ctexset{
424+
chapter = {
425+
numbering = false,
426+
beforeskip = 18bp,
427+
format = {\heiti \mdseries \centering \zihao{3}},
428+
afterskip = 26bp,
429+
},
430+
section/number = 附录\Alph{section},
431+
subsection/number = \Alph{section}. \arabic{subsection},
432+
}
433+
\chapter{\quad}
434+
\renewcommand{\thechapter}{附录}
435+
}
436+
{}
437+
438+
\NewDocumentEnvironment {acknowledgements} {}
439+
{
440+
\ctexset{
441+
chapter = {
442+
numbering = false,
443+
beforeskip = 18bp,
444+
format = {\heiti \mdseries \centering \zihao{3}},
445+
afterskip = 26bp,
446+
},
447+
section/number = \arabic{section},
448+
subsection/number = \arabic{section}. \arabic{subsection},
449+
}
450+
\chapter{\quad}
451+
\renewcommand{\thechapter}{致谢}
381452
}
453+
{}

Diff for: templates/undergraduate-thesis/main.tex

+2-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
name = 惠计算,
3636
studentId = 11xxxxxxxx,
3737
mentor = 张哈希,
38-
% externalMentor = 左偏树,
38+
keywords = {北京理工大学;本科生;毕业设计(论文)},
39+
keywordsEn = {BIT; Undergraduate; Graduation Project (Thesis)},
3940
}
4041
}
4142

@@ -114,19 +115,10 @@
114115
% 摘要:在摘要相应的 TeX 文件处进行摘要部分的撰写
115116
\input{chapters/0_abstract.tex}
116117

117-
% 目录:如无特殊需要,本部分无需改动
118-
% \input{misc/2_toc.tex}
119-
120118
\MakeTOC
121119

122120
% 正文开始
123121
\mainmatter
124-
% 正文 22 磅的行距
125-
\setlength{\parskip}{0em}
126-
\setstretch{1.53}
127-
% \renewcommand{\baselinestretch}{1.53}
128-
% 修复脚注出现跨页的问题
129-
\interfootnotelinepenalty=10000
130122

131123
% 第一章
132124
\input{chapters/1_chapter1.tex}

Diff for: templates/undergraduate-thesis/misc/0_cover.tex

-98
This file was deleted.

Diff for: templates/undergraduate-thesis/misc/2_toc.tex

-28
This file was deleted.

Diff for: templates/undergraduate-thesis/misc/3_conclusion.tex

+7-11
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@
1919
%
2020
% Compile with: xelatex -> biber -> xelatex -> xelatex
2121

22-
\unnumchapter{结~~~~论}
23-
\renewcommand{\thechapter}{结论}
22+
\begin{conclusion}
23+
% 结论部分尽量不使用 \subsection 二级标题,只使用 \section 一级标题
2424

25-
\ctexset{
26-
section/number = \arabic{section}
27-
}
25+
% 这里插入一个参考文献,仅作参考
26+
本文结论……。\cite{李成智2004飞行之梦}
2827

29-
% 结论部分尽量不使用 \subsection 二级标题,只使用 \section 一级标题
28+
\textcolor{blue}{结论作为毕业设计(论文)正文的最后部分单独排写,但不加章号。结论是对整个论文主要结果的总结。在结论中应明确指出本研究的创新点,对其应用前景和社会、经济价值等加以预测和评价,并指出今后进一步在本研究方向进行研究工作的展望与设想。结论部分的撰写应简明扼要,突出创新性。阅后删除此段。}
3029

31-
% 这里插入一个参考文献,仅作参考
32-
本文结论……。\cite{李成智2004飞行之梦}
30+
\textcolor{blue}{结论正文样式与文章正文相同:宋体、小四;行距:22 磅;间距段前段后均为 0 行。阅后删除此段。}
31+
\end{conclusion}
3332

34-
\textcolor{blue}{结论作为毕业设计(论文)正文的最后部分单独排写,但不加章号。结论是对整个论文主要结果的总结。在结论中应明确指出本研究的创新点,对其应用前景和社会、经济价值等加以预测和评价,并指出今后进一步在本研究方向进行研究工作的展望与设想。结论部分的撰写应简明扼要,突出创新性。阅后删除此段。}
35-
36-
\textcolor{blue}{结论正文样式与文章正文相同:宋体、小四;行距:22 磅;间距段前段后均为 0 行。阅后删除此段。}

Diff for: templates/undergraduate-thesis/misc/4_reference.tex

+4-20
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,9 @@
2121
%
2222
% 如无特殊需要,本页面无需更改
2323

24-
% 参考文献开始
25-
\unnumchapter{参考文献}
26-
\renewcommand{\thechapter}{参考文献}
27-
28-
% 设置参考文献字号为 5 号
29-
\renewcommand*{\bibfont}{\zihao{5}}
30-
% 设置参考文献各个项目之间的垂直距离为 0
31-
\setlength{\bibitemsep}{0ex}
32-
\setlength{\bibnamesep}{0ex}
33-
\setlength{\bibinitsep}{0ex}
34-
% 设置单倍行距
35-
\renewcommand{\baselinestretch}{1.2}
36-
% 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距
37-
\setlength{\biblabelsep}{0.5mm}
38-
% 设置参考文献后文缩进为 0(与 Word 模板保持一致)
39-
\renewcommand{\itemcmd}{
40-
\addvspace{\bibitemsep} % 恢复 \bibitemsep 的作用
41-
\mkgbnumlabel{\printfield{labelnumber}}
42-
\hspace{\biblabelsep}}
43-
% 删除默认的「参考文献 / Reference」标题,使用上面定义的 section 标题
24+
\begin{bibprint}
25+
26+
\chapter{参考文献}
4427

4528
% -------------------------------- 示例内容 ------------------------------------- %
4629
\textcolor{blue}{参考文献书写规范}
@@ -134,3 +117,4 @@
134117

135118
% 在使用时,请删除/注释上方示例内容,并启用下方语句以输出所有的参考文献
136119
% \printbibliography[heading=none]
120+
\end{bibprint}

0 commit comments

Comments
 (0)