-
Notifications
You must be signed in to change notification settings - Fork 4
/
zufe.cls
279 lines (239 loc) · 9.13 KB
/
zufe.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
% Zhejiang University of Finance & Economics
% This is file "zufe.cls".
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{ZUFEPaper}
[2020/02/07 v1.0 ZUFE Thesis Proposal class]
\newif\if@bit@bachelor
\newif\if@bit@master
\newif\if@bit@doctor
% 判断是否有副标题,默认没有
\newif\ifhaveSubTitle\haveSubTitlefalse
% 有副标题则将值设为true,显示副标题
\newcommand{\have@SubTitle}{}
\newcommand{\haveSub}[1]{\haveSubTitletrue\renewcommand{\have@SubTitle}{#1}}
% 字号----------------------------------------------------------------
\DeclareRobustCommand{\chuhao}{\fontsize{42pt}{50.4pt}\selectfont}
\DeclareRobustCommand{\xiaochu}{\fontsize{36pt}{43.2pt}\selectfont}
\DeclareRobustCommand{\yihao}{\fontsize{26pt}{31.2pt}\selectfont}
\DeclareRobustCommand{\xiaoyi}{\fontsize{24pt}{28.8pt}\selectfont}
\DeclareRobustCommand{\erhao}{\fontsize{22pt}{26.4pt}\selectfont}
\DeclareRobustCommand{\xiaoer}{\fontsize{18pt}{21.6pt}\selectfont}
\DeclareRobustCommand{\sanhao}{\fontsize{16pt}{19.2pt}\selectfont}
\DeclareRobustCommand{\xiaosan}{\fontsize{15pt}{18pt}\selectfont}
\DeclareRobustCommand{\sihao}{\fontsize{14pt}{16.8pt}\selectfont}
\DeclareRobustCommand{\shisanbang}{\fontsize{13pt}{15.pt}\selectfont}
\DeclareRobustCommand{\xiaosi}{\fontsize{12pt}{14.4pt}\selectfont}
\DeclareRobustCommand{\wuhao}{\fontsize{10.5pt}{12.6pt}\selectfont}
\DeclareRobustCommand{\xiaowu}{\fontsize{9pt}{10.8pt}\selectfont}
\DeclareRobustCommand{\liuhao}{\fontsize{7.5pt}{9pt}\selectfont}
\DeclareRobustCommand{\xiaoliu}{\fontsize{6.5pt}{7.8pt}\selectfont}
\DeclareRobustCommand{\qihao}{\fontsize{5.5pt}{6.6pt}\selectfont}
\DeclareRobustCommand{\bahao}{\fontsize{5pt}{6pt}\selectfont}
% 字号----------------------------------------------------------------
\DeclareOption{bachelor}{\@bit@bachelortrue}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ExecuteOptions{bachelor}
\ProcessOptions\relax
\LoadClass[UTF8,AutoFakeBold,AutoFakeSlant,zihao=-4,oneside,openany]{ctexbook}
\RequirePackage[a4paper,left=2.5cm,right=2.5cm,top=3.5cm,bottom=2.5cm]{geometry}
\RequirePackage{xeCJK}
\RequirePackage{titletoc}
% \RequirePackage{fontspec}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{fancyhdr}
\RequirePackage{pdfpages}
\RequirePackage{setspace}
\RequirePackage{booktabs}
\RequirePackage{multirow}
\RequirePackage{caption}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\RequirePackage{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{pdfpages}
\RequirePackage[
backend=biber,
style=gb7714-2015,
gbalign=gb7714-2015,
gbnamefmt=lowercase,
gbpub=false,
doi=false,
url=false,
eprint=false,
isbn=false,
]{biblatex}
% 参考文献
% \addbibresource{./Reference.bib}
\setromanfont{Times New Roman}
\setCJKfamilyfont{xihei}[AutoFakeBold,AutoFakeSlant]{[simhei.TTF]} % 若希望使用本机字体,也可以用 {STXihei} 来调用
\newcommand{\xihei}{\CJKfamily{xihei}}
\setCJKfamilyfont{kaitigb}[AutoFakeBold,AutoFakeSlant]{[kaiti_GB2312.TTF]}
\newcommand{\kaitigb}{\CJKfamily{kaitigb}}
\fancypagestyle{ZUFEThesis}{
% 页眉高度
\setlength{\headheight}{20pt}
% 页码高度(不完美,比规定稍微靠下 2mm)
\setlength{\footskip}{14pt}
\fancyhf{}
% 定义页眉、页码
\fancyhead[C]{\xiaowu\ziju{0.08}\songti{浙江财经大学本科生毕业论文(设计)}}
\fancyfoot[C]{\songti\zihao{5} \thepage}
% 页眉分割线稍微粗一些
\renewcommand{\headrulewidth}{0.4pt}
}
\ctexset{chapter={
name = {},
number = {\arabic{chapter}},
format = {\heiti \bfseries \centering \zihao{3}},
aftername = \hspace{9bp},
pagestyle = ZUFEThesis,
beforeskip = 32bp,
afterskip = 32bp,
fixskip = true,
% 防止 chapter 换页
break = {}
}
}
\ctexset{section={
number = {\thechapter.\hspace{4bp}\arabic{section}},
format = {\heiti \raggedright \bfseries \zihao{4}},
aftername = \hspace{8bp},
beforeskip = 20bp plus 1ex minus .2ex,
afterskip = 18bp plus .2ex,
fixskip = true,
}
}
\ctexset{subsection={
number = {\thechapter.\hspace{3bp}\arabic{section}.\hspace{3bp}\arabic{subsection}},
format = {\heiti \bfseries \raggedright \zihao{-4}},
aftername = \hspace{7bp},
beforeskip = 17bp plus 1ex minus .2ex,
afterskip = 14bp plus .2ex,
fixskip = true,
}
}
\addtocontents{toc}{\protect\hypersetup{hidelinks}}
\renewcommand{\contentsname}{
\fontsize{16pt}{\baselineskip}
\normalfont\heiti{目~~~~录}
\vspace{-8pt}
}
\titlecontents{chapter}[0pt]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
\titlecontents{section}[1\ccwd]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
\titlecontents{subsection}[2\ccwd]{\songti \zihao{-4}}
{\thecontentslabel\hspace{\ccwd}}{}
{\hspace{.5em}\titlerule*{.}\contentspage}
\renewcommand{\frontmatter}{
\pagenumbering{Roman}
\pagestyle{ZUFEThesis}
}
\renewcommand{\mainmatter}{
\pagenumbering{arabic}
\pagestyle{ZUFEThesis}
}
\setlength{\abovecaptionskip}{11pt}
\setlength{\belowcaptionskip}{9pt}
\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
\DeclareCaptionFont{kaitigb}{\kaitigb}
\captionsetup[figure]{font=kaitigb,labelsep=quad}
\renewcommand{\thetable}{\thechapter.\arabic{table}}
\DeclareCaptionFont{kaitigb}{\kaitigb}
\captionsetup[table]{font={kaitigb},labelsep=quad,skip=2pt}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
\renewcommand{\theequation}{\arabic{chapter}-\arabic{equation}}
\newcommand{\unnumchapter}[1]{
\chapter*{\vskip 10bp\textmd{#1} \vskip -6bp}
\addcontentsline{toc}{chapter}{#1}
\stepcounter{chapter}
}
\RequirePackage{algorithm,algpseudocode,float}
\RequirePackage{lipsum}
% 伪代码跨页-----------------------------------------------------------------------
\makeatletter
\newenvironment{breakablealgorithm}
{% \begin{breakablealgorithm}
\begin{center}
\refstepcounter{algorithm}% New algorithm
\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled
\renewcommand{\caption}[2][\relax]{% Make a new \caption
{\raggedright\textbf{\ALG@name~\thealgorithm} ##2\par}%
\ifx\relax##1\relax % #1 is \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}%
\else % #1 is not \relax
\addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}%
\fi
\kern2pt\hrule\kern2pt
}
}{% \end{breakablealgorithm}
\kern2pt\hrule\relax% \@fs@post for \@fs@ruled
\end{center}
}
\makeatother
% 伪代码跨页-----------------------------------------------------------------------
\RequirePackage{listings}
% 用来设置附录中代码的样式
\lstset{
basicstyle = \sffamily, % 基本代码风格
keywordstyle = \bfseries, % 关键字风格
commentstyle = \rmfamily\itshape, % 注释的风格,斜体
stringstyle = \ttfamily, % 字符串风格
flexiblecolumns, % 别问为什么,加上这个
numbers = left, % 行号的位置在左边
showspaces = false, % 是否显示空格,显示了有点乱,所以不现实了
numberstyle = \zihao{-5}\ttfamily, % 行号的样式,小五号,tt等宽字体
showstringspaces = false,
captionpos = t, % 这段代码的名字所呈现的位置,t指的是top上面
frame = lrtb, % 显示边框
}
\lstdefinestyle{Python}{
language = Python, % 语言选Python
basicstyle = \zihao{-5}\ttfamily,
numberstyle = \zihao{-5}\ttfamily,
keywordstyle = \color{blue},
keywordstyle = [2] \color{teal},
stringstyle = \color{magenta},
commentstyle = \color{red}\ttfamily,
breaklines = true, % 自动换行,建议不要写太长的行
columns = fixed, % 如果不加这一句,字间距就不固定,很丑,必须加
basewidth = 0.5em,
}
\lstdefinestyle{Java}{
language = [AspectJ]Java, % 语言选Java
basicstyle = \zihao{-5}\ttfamily,
numberstyle = \zihao{-5}\ttfamily,
keywordstyle = \color{blue},
keywordstyle = [2] \color{teal},
stringstyle = \color{magenta},
commentstyle = \color{red}\ttfamily,
breaklines = true, % 自动换行,建议不要写太长的行
columns = fixed, % 如果不加这一句,字间距就不固定,很丑,必须加
basewidth = 0.5em,
}
\lstdefinestyle{C++}{
language = c++, % 语言选Python
basicstyle = \zihao{-5}\ttfamily,
numberstyle = \zihao{-5}\ttfamily,
keywordstyle = \color{blue},
keywordstyle = [2] \color{teal},
stringstyle = \color{magenta},
commentstyle = \color{red}\ttfamily,
breaklines = true, % 自动换行,建议不要写太长的行
columns = fixed, % 如果不加这一句,字间距就不固定,很丑,必须加
basewidth = 0.5em,
}
\endinput
%%
%% End of file `zufe.cls'.