-
Notifications
You must be signed in to change notification settings - Fork 5
/
ecnu.sty
325 lines (282 loc) · 10.6 KB
/
ecnu.sty
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
% 论文版面要求:
% 统一按 word 格式A4纸(页面设置按word默认值)编排、打印、制作。
% 正文内容字体为宋体;字号为小4号;字符间距为标准;行距为25磅(约0.88175cm)。
\ProvidesPackage{ecnu}
%%%%% ===== 页面设置
\RequirePackage[a4paper,top=2.54cm,bottom=2.54cm,left=3.17cm,right=3.17cm,%
includehead,includefoot]{geometry}
\setlength{\parindent}{2em}
\setlength{\parskip}{0.5em}
%%%%% =====章节 标题 设置
\ctexset{%
contentsname={目\ \ 录},
listfigurename={插\ 图\ 目\ 录},
listtablename={表\ 格\ 目\ 录},
bibname={\centerline{参\ 考\ 文\ 献}},
chapter={name={第,章},
number=\chinese{chapter},
nameformat={\zihao{2}\bfseries},
titleformat={\zihao{2}\bfseries},
beforeskip={-10pt},
afterskip={20pt}
},
section={format=\centering,
nameformat={\zihao{3}\bfseries},
titleformat={\zihao{3}\bfseries},
afterskip={1ex plus 0.2ex}
},
subsection={format=\raggedright,
nameformat={\zihao{4}\bfseries},
titleformat={\zihao{4}\bfseries},
afterskip={0.5ex plus 0.1ex}
}
}
%%%%% ===== 中英文字体
\setmainfont{Times New Roman}
%\setsansfont{Myriad Pro} % 无衬线字体 sans serif \sffamily
%\setmonofont{Consolas} % 等宽字体 typewriter \ttfamily
%\newcommand{\Times}{\fontspec{Times New Roman}}
%% 中文字体
%\setCJKmainfont[BoldFont={Microsoft YaHei},ItalicFont={KaiTi}]{NSimSun}
%\setCJKsansfont{Microsoft YaHei}
%\setCJKmonofont{KaiTi}
%\setCJKfamilyfont{STSong}{方正小标宋_GBK}\newcommand{\STSong}{\CJKfamily{STSong}}
\setCJKfamilyfont{STSong}{STZhongsong}\newcommand{\STSong}{\CJKfamily{STSong}}
%%%%% ===== 常用宏包
\RequirePackage{amsmath,amssymb,amsfonts,bm}
\RequirePackage[amsmath,thref,thmmarks,hyperref]{ntheorem}
\RequirePackage{graphicx,xcolor,float}
\RequirePackage{fancyhdr}
\RequirePackage{IEEEtrantools}
\RequirePackage{subfigure}
\RequirePackage[subfigure]{tocloft} % 设置目录中的条目间距
\RequirePackage{booktabs} % toprule, midrule, bottomrule
\RequirePackage{varwidth} % 可变宽度的 parbox
\RequirePackage{epstopdf} % eps图片
\RequirePackage{graphicx}
\RequirePackage{setspace}
\RequirePackage{fancybox}
\RequirePackage{framed}
\RequirePackage{algorithm,algorithmicx}
\RequirePackage{pgf,tikz}
\usetikzlibrary{shapes,arrows,automata}
\RequirePackage{color,nicefrac}
\RequirePackage{lineno}
\RequirePackage{multirow}
\RequirePackage{enumerate}
\modulolinenumbers[5]
%%%%% ===== 参考文献与链接
\definecolor{pblue}{rgb}{0.1, 0.6, 0.2}
\RequirePackage[numbers,sort&compress,sectionbib]{natbib}
\RequirePackage[xetex]{hyperref}
\hypersetup{CJKbookmarks=true,colorlinks=true,citecolor=pblue,%
linkcolor=pblue,urlcolor=pblue,bookmarksnumbered=true,%
bookmarksopen=true,breaklinks=true}
%\renewcommand*{\backrefalt}[4]{%
%\ifcase #1 No citations.%
%\or Cited on page #2.%
%\else Cited on pages #2.%
%\else #1 Cited on pages #2.%
%\fi
%}
%%%%% ===== 浮动图表的标题
\definecolor{ddblue}{rgb}{0.2, 0.5, 0.8}
\RequirePackage[margin=2em,labelsep=space,skip=0.5em,font=normalfont]{caption}
\DeclareCaptionFormat{mycaption}{{\heiti\color{dblue} #1}#2{\kaishu #3}}
\captionsetup{format=mycaption,tablewithin=chapter,figurewithin=chapter}
\allowdisplaybreaks[4]
%%%%% ===== 算法
\RequirePackage{algpseudocode}
%%%%% ===== 设置页面
%%%%% ===== 设置数学公式
\numberwithin{equation}{chapter}
\allowdisplaybreaks
%%%%% ===== 设置页眉和页脚
%\pagestyle{fancy}
\pagestyle{empty}
\fancyhf{} % 清除以前对页眉页脚的设置
%\newcommand{\makeheadrule}{%% 定义页眉与正文间双隔线
% \makebox[0pt][l]{\rule[.7\baselineskip]{\headwidth}{0.3pt}}%0.4
% \rule[0.85\baselineskip]{\headwidth}{1.0pt}\vskip-.8\baselineskip}
%\makeatletter
%\renewcommand{\headrule}{%
% {\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi\makeheadrule}}
%\makeatother
%\renewcommand{\chaptermark}[1]{\markboth{\CTEXthechapter \ #1}{}}
%\renewcommand{\sectionmark}[1]{\markright{\thesection \ #1}{}}
%\fancyhead[RO,LE]{{\small\songti\rightmark}} % 节标题
%\fancyhead[RO,LE]{{\small\songti\leftmark}} % 章标题
%\fancyhead[CO,CE]{华东师范大学博士学位论文}
%\fancyhead[RO,LE]{$\cdot$ {\small\thepage} $\cdot$}
\fancyfoot[CO,CE]{{\thepage}}
%%%%% ===== 定理类环境
\definecolor{dblue}{rgb}{0.2, 0.5, 0.8}
\theorempostskipamount0em
\theoremstyle{plain}
\theoremheaderfont{\normalfont\heiti\color{dblue}}
\theorembodyfont{\normalfont\kaishu\color{black}}
\theoremindent0em
\theoremseparator{\hspace{0.2em}}
\theoremnumbering{arabic}
\newtheorem{theorem}{定理}[chapter]
\newtheorem{lemma}[theorem]{引理}
\newtheorem{corollary}[theorem]{推论}
\newtheorem{proposition}[theorem]{命题}
\newtheorem{property}[theorem]{性质}
\newtheorem{definition}{定义}[chapter]
\newtheorem{remark}{注记}[chapter]
\newtheorem{criterion}{规则}[chapter]
\newtheorem{conjecture}[theorem]{猜想}
%
%\theoremheaderfont{\normalfont\itshape\color{blue}}
\theorembodyfont{\normalfont\rmfamily\color{black}}
\newtheorem{example}{例}[chapter]
\theoremstyle{nonumberplain}
\theorempreskip{0em}
\theoremsymbol{\ensuremath{\Box}}
\newtheorem{proof}{证明}
%%%%% ===== 算法
\definecolor{dgray}{rgb}{0.4, 0.4, 0.4}
\floatname{algorithm}{\color{dblue} 算法}
\algrenewcommand{\algorithmiccomment}[1]{\quad{\color{dgray}$\rhd$\ #1}}
\numberwithin{algorithm}{chapter}
\renewcommand{\listalgorithmname}{算\ 法\ 目\ 录}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% ===== 封面 =====
\makeatletter
\def\class#1{\def\@class{#1}}\def\@class{}
\def\security#1{\def\@security{#1}}\def\@security{}
\def\graduateyear#1{\def\@graduateyear{#1}}\def\@graduateyear{}
\def\ctitle#1{\def\@ctitle{#1}}\def\@ctitle{}
\def\ctitleB#1{\def\@ctitleB{#1}}\def\@ctitleB{}
\def\caffil#1{\def\@caffil{#1}}\def\@caffil{}
\def\cmajor#1{\def\@cmajor{#1}}\def\@cmajor{}
\def\cdirection#1{\def\@cdirection{#1}}\def\@cdirection{}
\def\cauthor#1{\def\@cauthor{#1}}\def\@cauthor{}
\def\studentid#1{\def\@studentid{#1}}\def\@studentid{}
\def\csupervisor#1{\def\@csupervisor{#1}}\def\@csupervisor{}
\def\csupervisorA#1{\def\@csupervisorA{#1}}\def\@csupervisorA{}
\def\csupervisorB#1{\def\@csupervisorB{#1}}\def\@csupervisorB{}
\def\cdate#1{\def\@cdate{#1}}\def\@cdate{}
\def\edegree#1{\def\@edegree{#1}}\def\@edegree{}
\def\etitle#1{\def\@etitle{#1}}\def\@etitle{}
\def\eaffil#1{\def\@eaffil{#1}}\def\@eaffil{}
\def\emajor#1{\def\@emajor{#1}}\def\@emajor{}
\def\edirection#1{\def\@edirection{#1}}\def\@edirection{}
\def\edirectionB#1{\def\@edirectionB{#1}}\def\@edirectionB{}
\def\eauthor#1{\def\@eauthor{#1}}\def\@eauthor{}
\def\esupervisor#1{\def\@esupervisor{#1}}\def\@esupervisor{}
\def\esupervisorA#1{\def\@esupervisorA{#1}}\def\@esupervisorA{}
\def\esupervisorB#1{\def\@esupervisorB{#1}}\def\@esupervisorB{}
\def\edate#1{\def\@edate{#1}}\def\@edate{}
\newcommand{\mcc}[1]{\multicolumn{1}{c}{\underline{\makebox[10em][l]{#1}}}}
\newcommand{\mce}[1]{\multicolumn{1}{c}{\underline{\makebox[15em][l]{#1}}}}
\def\makecover{
\begin{titlepage}
%%%%% ===== 中文封面
\pdfbookmark[0]{中文封面}{ccover}
\linespread{1.1}\zihao{4}\ziju{0.05}
\noindent{\@graduateyear\,届研究生博士学位论文}\smallskip
\par\noindent\hspace*{-12pt}
\setlength{\tabcolsep}{2pt}
\begin{tabular}[t]{rl}
分\hspace{7.5pt}类\hspace{7.5pt}号:
&\ \underline{\makebox[6em][l]{\hfill\@class\hfill}} \\[1.5ex]
密\hspace{2em}级:&\ \underline{\makebox[6em][l]{\hfill\@security\hfill}}
\end{tabular}
\hfill
\begin{tabular}[t]{rl}
学校代码:&\ \underline{\makebox[6em][l]{\hfill10269\hfill}} \\[1.5ex]
学\hspace{2em}号:&\ \underline{\makebox[6em][l]{\hfill\@studentid\hfill}}
\end{tabular}
\vspace{3em}
\begin{center}
% \raisebox{1ex}[0pt][0pt]{
% \includegraphics[width=0.15\textwidth]{ecnu_logo.eps}}\ \
\includegraphics[width=0.75\textwidth,height=5em]{preface/images/ecnu}
\bigskip
{%\STSong
% \zihao{-2}\textbf{East China Normal University} \\[0.5ex]
% \zihao{2} \\[1ex]
% \zihao{-2} \textbf{MASTER'S DISSERTATION}
% title
\vspace{5em}
\scalebox{1.3}[1.3]{
{\zihao{1}
\heiti
\bf
\noindent
\begin{tabular}{c}
\@ctitle
\end{tabular}
}
}
% \parbox[t]{0.26\textwidth}{\zihao{1} 论文题目:\,}
% \begin{varwidth}[t]{.75\linewidth}\linespread{1.3}\zihao{1} \@ctitle \linebreak\end{varwidth}
\vfill\linespread{1}\selectfont\zihao{-2}
\renewcommand{\arraystretch}{1.2}
\scalebox{1.1}[1.1]{
\begin{tabular}{p{0cm}p{5.5em}@{\extracolsep{0.5ex}}cc}
~ & 院 \hfill 系: & & \mcc{\hfill\@caffil\hfill } \\
~ & 专 \hfill 业: & & \mcc{\hfill\@cmajor\hfill}\\
~ & 研 \hfill 究 \hfill 方 \hfill 向:& & \mcc{\hfill\@cdirection\hfill}\\
~ & 指\hfill 导\hfill 老\hfill 师:& & \mcc{\hfill\@csupervisorA\hfill}\\
% ~ & \hfill& & \mcc{\hfill\@csupervisorB\hfill}\\
~ & 论\hfill 文\hfill 作\hfill 者:& & \mcc{\hfill\@cauthor\hfill}\\
\end{tabular}
}
}
{\Large\vfill\@cdate}
\end{center}
\clearpage % {\pagestyle{empty}\cleardoublepage}
%%%%% ===== 英文封面
\thispagestyle{empty}
\pdfbookmark[0]{英文封面}{ecover}
\noindent Dissertation for Doctorate Degree in \@graduateyear
\hfill University Code:\, 10269\par\medskip
\mbox{}\hfill Student ID:\, \@studentid
\vspace{6.5em}
\begin{center}
{\zihao{-0} East China Normal University}
%\scalebox{1.15}[1.6]{\bfseries EAST CHINA NORMAL UNIVERSITY}
% title
\vspace{5em}
\scalebox{1.2}[1.2]{
{\zihao{-1}
\bf
\noindent
\begin{tabular}{c}
\@etitle
\end{tabular}
}}
% \vspace{6em}{\bfseries
% \parbox[t]{0.125\textwidth}{\zihao{2} Title:}
% \begin{varwidth}[t]{.75\linewidth}\linespread{1.4}\zihao{2} \@etitle \linebreak\end{varwidth}}
\vfill\linespread{1.5}\selectfont\mdseries
\renewcommand{\arraystretch}{1.1}
\scalebox{1}[1.0]{\setlength{\tabcolsep}{0.5ex}
\scalebox{1.2}[1.2]{
\begin{tabular}{rl}
Department: & \mce{\hfill\@eaffil\hfill} \\
Major: & \mce{\hfill\@emajor\hfill}\\
Research Direction: & \mce{\hfill\@edirection\hfill}\\
% \hfill & \mce{\hfill\@edirectionB\hfill}\\
Supervisor: & \mce{\hfill\@esupervisorA\hfill}\\
% \hfill & \mce{\hfill\@esupervisorB\hfill}\\
Candidate: & \mce{\hfill\@eauthor\hfill}\\
\end{tabular}
}
}
{\Large
\vfill
\@edate
}
\end{center}
\end{titlepage}
\makeatother
}
% \zihao{-4}
%%%%% ===== 其他
\RequirePackage{ulem}
\def\ULthickness{1pt}
%%%%% ===== 自定义命令