-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathustcextra.sty
More file actions
executable file
·67 lines (64 loc) · 2.01 KB
/
ustcextra.sty
File metadata and controls
executable file
·67 lines (64 loc) · 2.01 KB
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
%%
%% This is file `ustcextra.sty':
%% extra packages and configuration.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ustcextra}
% 数学定理:
% 以下定义数学定理环境默认风格为 ustcplain。
\RequirePackage{amsmath,amsthm,amssymb}
\newtheoremstyle{ustcplain}%
{}{}%
{}{2\ccwd}%
{\bfseries}{}%
{\ccwd}{}
\theoremstyle{ustcplain}
% 定义新的定理
\newtheorem{theorem} {\ustc@theoremname} [chapter]
\newtheorem{assertion} [theorem] {\ustc@assertionname}
\newtheorem{axiom} [theorem] {\ustc@axiomname}
\newtheorem{corollary} [theorem] {\ustc@corollaryname}
\newtheorem{lemma} [theorem] {\ustc@lemmaname}
\newtheorem{proposition}[theorem] {\ustc@propositionname}
\newtheorem{definition} {\ustc@definitionname} [chapter]
\newtheorem{example} {\ustc@examplename} [chapter]
\newtheorem*{remark} {\ustc@remarkname}
% \pkg{amsthm} 单独定义了 proof 环境,这里重新定义以满足格式要求。
% 原本模仿 \pkg{amsthm} 写成 |\item[\hskip\labelsep\hskip2\ccwd #1\hskip\ccwd]|,
% 但是却会多出一些间隙。
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item\relax\hskip2\ccwd
\textbf{#1}
\hskip\ccwd\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\renewcommand\proofname\ustc@proofname
% 表格:
% 三线表
\RequirePackage{booktabs}
% 跨页表格
\RequirePackage{longtable}
% 算法和代码:
% 算法环境
\RequirePackage[boxed, algochapter, lined, linesnumbered]{algorithm2e}
\renewcommand{\listalgorithmcfname}{算法索引}
\renewcommand{\algorithmcfname}{算法}
% 代码环境
\RequirePackage{listings}
\lstset{
basicstyle=\small\ttfamily,
xleftmargin=2pc,
xrightmargin=2pc,
frame=single,
columns=flexible,
numbers=left,
}
\renewcommand{\lstlistlistingname}{代码索引}
\renewcommand{\lstlistingname}{代码}
\endinput
%%
%% End of file `ustcextra.sty'.