This repository was archived by the owner on Sep 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJLUThesis.cls
305 lines (252 loc) · 11.7 KB
/
JLUThesis.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
%% start of file `JLUThesis.cls'.
%% Copyright 2022 Shem([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
%-------------------------------------------------------------------------------
% 标识
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{JLUThesis}[2014/06/10 v1.1 Beijing Jiaotong University Thesis document class]
\LoadClass[UTF8, fntef, fancyhdr, oneside, a4paper, cs4size]{ctexbook} % 论文使用A4纸,默认小四号字体
\RequirePackage{geometry}
\RequirePackage{tocloft}
\RequirePackage{amsmath}
\RequirePackage{amsfonts,amssymb}
\RequirePackage{graphicx}
\RequirePackage{setspace}
\RequirePackage[colorlinks,linkcolor=black,citecolor=black]{hyperref}
\RequirePackage{algorithmicx,algorithm,algpseudocode}
\RequirePackage{amsthm}
\RequirePackage{caption}
\RequirePackage[super,square,comma]{natbib} % 引用形式为上标和方括号
\setmainfont{Times New Roman}
\setCJKfamilyfont{cusong}[AutoFakeBold = {2.17}]{simsun.ttc}
\renewcommand*{\songti}{\CJKfamily{cusong}}
\renewcommand{\baselinestretch}{1.5}
\floatname{algorithm}{算法}
\newtheorem{theorem}{\indent 定理}[section]
\newtheorem{lemma}[theorem]{\indent 引理}
\newtheorem{proposition}[theorem]{\indent 命题}
\newtheorem{corollary}[theorem]{\indent 附注}
\newtheorem{definition}{\indent 定义}[section]
\newtheorem{example}{\indent 例}[section]
\newtheorem{remark}{\indent 注}[section]
%\newenvironment{solution}{\begin{proof}[\indent\bf 解]}{\end{proof}}
\renewcommand{\proofname}{\indent \bf 证明}
%\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
%\itshape
#1\@addpunct{}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
%\makeatother
% % English theorem environment
% \newtheorem{theorem}{Theorem}[section]
% \newtheorem{lemma}[theorem]{Lemma}
% \newtheorem{proposition}[theorem]{Proposition}
% \newtheorem{corollary}[theorem]{Corollary}
% \newtheorem{definition}{Definition}[section]
% \newtheorem{remark}{Remark}[section]
% \newtheorem{example}{Example}[section]
% \newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}
% 版面上空2cm,下空2.5cm (5mm留给voffset),左空3cm,右空3cm
\geometry{a4paper, top = 20mm, bottom = 25mm, left = 30mm, right = 30mm}
%-------------------------------------------------------------------------------
% 加载配置文件
%-------------------------------------------------------------------------------
\input{JLUThesis.cfg}
%-------------------------------------------------------------------------------
% 封面设计
%-------------------------------------------------------------------------------
\newcommand{\clearpagebyprint}{\if@twoside\cleardoublepage\else\clearpage\fi}
\newcommand{\fillinblank}[2]{\CJKunderline{\makebox[#1]{#2}}}
\newcommand{\makecover}{
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{1mm}}
\quad \\[0.42cm]
{\centering\includegraphics[width = 0.8\textwidth]{figures/logo.png}\\[0.77cm] }
\center
\songti \zihao{-0} \bfseries 本科生毕业论文(设计) \\[2.58cm]
\songti \zihao{3} \bfseries 中文题目 \hspace{-0.4cm} \underline{\makebox[11cm]{\songti \zihao{3} \bfseries \cover@ctitlef}} \\[3pt]
\hspace{2cm} \underline{\makebox[11cm]{\songti \zihao{3} \bfseries \cover@ctitles}} \\
\songti \zihao{3} \bfseries 英文题目 \hspace{-0.4cm} \underline{\makebox[11cm]{\songti \zihao{3} \bfseries \cover@etitlef}} \\[3pt]
\hspace{2cm} \underline{\makebox[11cm]{\songti \zihao{3} \bfseries \cover@etitles}} \\[2.6cm]
\songti \zihao{3} \bfseries 学生姓名 \underline{\makebox[11cm]{\cover@author}} \\[3pt]
\songti \zihao{3} \bfseries 学\hspace{2em}号 \underline{\makebox[11cm]{\cover@studentid}} \\[3pt]
\songti \zihao{3} \bfseries 学\hspace{2em}院 \underline{\makebox[11cm]{\cover@school}} \\[3pt]
\songti \zihao{3} \bfseries 专\hspace{2em}业 \underline{\makebox[11cm]{\cover@major}} \\[3pt]
\songti \zihao{3} \bfseries 指导教师 \underline{\makebox[11cm]{\cover@mentor}} \\[1.3cm]
{\songti \zihao{3} \bfseries \cover@time}
\vfill
\end{titlepage}
}
%-------------------------------------------------------------------------------
% 页眉页脚设计
%-------------------------------------------------------------------------------
% \setlength{\topmargin}{-5mm} % 页眉顶端距离页边距的距离
\setlength{\headheight}{10mm}
\setlength{\headsep}{5mm}
\setlength{\footskip}{5mm}
\fancypagestyle{style@empty}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{style@onlyfoot}{
\fancyhf{}
\fancyfoot[R]{\zihao{-5} \thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{style@normal}{
\fancyhead{}
\fancyhead[C]{\zihao{-4} \kaishu 吉林大学\hspace{0.5em}计算机科学与技术学院\hspace{0.5em}毕业论文}
\fancyfoot{}
\fancyfoot[R]{\zihao{-5} \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
%\renewcommand{\headruleskip}{2.5pt}
}
%-------------------------------------------------------------------------------
% 承诺书
%-------------------------------------------------------------------------------
\newcommand{\commitment}[0]{
\setlength{\baselineskip}{30pt}
\chapter*{\zihao{-2} \songti \commitment@title}
% \addcontentsline{toc}{chapter}{\commitment@title}
\vspace{1.5cm}
{\zihao{4} \songti \commitment@content} \\[10cm]
\leftline{\zihao{4} \songti \hspace{8cm} \commitment@sign} \\
\rightline{\zihao{4} \songti \commitment@time \hspace{2cm}}
\vfill
}
%-------------------------------------------------------------------------------
% 摘要
%-------------------------------------------------------------------------------
% 中文摘要
\newcommand{\cabstract}[2]{
\pagestyle{style@empty}
\setlength{\baselineskip}{18pt}
\chapter*{\textnormal{\zihao{-3} \songti \cover@ctitle}}
\thispagestyle{style@empty}
\bigskip
\begin{center}
\zihao{4} \songti \bfseries \abstract@cabstract % 摘要标题四号字
\end{center}
\zihao{-4} \songti #1 % 摘要正文小四号字
\bigskip
\noindent \zihao{4} \songti {\bfseries {\abstract@ckeywords}}
\zihao{-4} \songti #2
}
% 英文摘要
\newcommand{\eabstract}[2]{
\pagestyle{style@empty}
\setlength{\baselineskip}{18pt}
\chapter*{\textnormal{\zihao{-3} \songti \cover@etitle}}
\thispagestyle{style@empty}
\begin{flushright}
\zihao{-3}
Author: \cover@eauthor
Supervisor: \cover@ementor
\end{flushright}
\begin{center}
\zihao{4} \songti \bfseries \abstract@eabstract % 摘要标题四号字
\end{center}
\zihao{-4} \songti #1 % 摘要正文小四号字
\bigskip
\noindent \zihao{4} \songti {\bfseries {\abstract@ekeywords}}
\zihao{-4} \songti #2
}
%-------------------------------------------------------------------------------
% 目录
%-------------------------------------------------------------------------------
\renewcommand{\contentsname}{目 \hspace{2pt} 录}
% \renewcommand{\cftafterZtitle}{[\baselineskip]\mbox{}\hfill{\normalfont Page}\hfill}
\renewcommand{\cfttoctitlefont}{\hfill\Large\bfseries} % title 前间隔
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand\cftchapfont{\songti \zihao{4}}
\renewcommand\cftsecfont{\songti \zihao{4}}
\renewcommand\cftsubsecfont{\songti \zihao{4}}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\cftchappagefont }{} % 设置索引不加粗
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} % 目录后一行连续的点
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % 目录后一行连续的点
\setlength{\cftbeforetoctitleskip}{0pt} % title 上间隔
\setlength{\cftaftertoctitleskip}{0pt} % title 下间隔
\setlength{\cftbeforechapskip}{10.5pt} % chapter 间隔
\setlength{\cftbeforesecskip}{10.5pt} % section 间隔
\setlength{\cftbeforesubsecskip}{10.5pt} % subsection 间隔
\setlength{\cftchapindent}{0pt} % 设置 chapter 部分缩进
\setlength{\cftsecindent}{10pt} % 设置 section 部分缩进
\setlength{\cftsubsecindent}{20pt} % 设置 subsubsection 缩进
\settowidth{\cftchapnumwidth}{\cftsecfont 1.1} % 设置 chapter 内容部分缩进
\settowidth{\cftsecnumwidth}{\cftsecfont 1.1} % 设置 section 内容部分缩进
\settowidth{\cftsubsecnumwidth}{\cftsecfont 1.1} % 设置 subsection 内容部分缩进
%-------------------------------------------------------------------------------
% 版面及标题格式
%-------------------------------------------------------------------------------
\ctexset {
chapter = {
format = \centering \zihao{3} \songti \bfseries,
titleformat = \hspace{0pt}, % -10pt
beforeskip = {-20pt}, % -15pt
afterskip = {25pt}, % 5pt
number = \arabic{chapter},
pagestyle = style@normal
},
section = {
format = \raggedright \zihao{4} \songti \bfseries,
titleformat = \hspace{0pt}, % -10pt
beforeskip = {20pt}, % 0pt
afterskip = {20pt}, % 5pt
},
subsection = {
format = \raggedright \zihao{-4} \songti \bfseries,
titleformat = \hspace{0pt}, % -10pt
afterskip = {15pt}, % 5pt
},
subsubsection = {
format = \zihao{-4} \songti,
afterskip = {15pt}, % 0pt
}
}
%-------------------------------------------------------------------------------
% 图表标题格式
%-------------------------------------------------------------------------------
\DeclareCaptionFont{heiti}{\heiti\zihao{5}}
\renewcommand{\thefigure}{\thechapter-\arabic{figure}} % 图标题格式为章节号-图号
\captionsetup[figure]{textfont=heiti, labelfont=heiti, labelsep=space} % 图标题为黑体
\renewcommand{\thetable}{\thechapter-\arabic{table}} % 表标题格式为章节号-表号
\captionsetup[table]{textfont=heiti, labelfont=heiti, labelsep=space} % 表标题为黑体
%-------------------------------------------------------------------------------
% 致谢
%-------------------------------------------------------------------------------
\newcommand{\acknowledgement}[1]{
\setlength{\baselineskip}{20pt}
\chapter*{\zihao{-3} \songti 致\hspace{1em}谢}
\addcontentsline{toc}{chapter}{致\hspace{1em}谢}
\markboth{\zihao{-5} \songti 致\hspace{1em}谢}{\zihao{-5} \songti 致\hspace{1em}谢} % 定制页眉
\vspace{0.5cm}
{\songti \zihao{-4} #1}
}
%-------------------------------------------------------------------------------
% 参考文献
%-------------------------------------------------------------------------------
\newcommand{\reference}[1]{
\chapter*{\zihao{3} \songti 参考文献}
\addcontentsline{toc}{chapter}{参考文献}
% \markboth{\zihao{-5} \songti 参考文献}{\zihao{-5} \songti 参考文献} % 定制页眉
\vspace{0.5cm}
{
\setlength{\bibsep}{0pt}
\songti \zihao{5} #1
}
}
\endinput