-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeXplatesMathematics.sty
/
TeXplatesMathematics.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
% TeXplates/Mathematics.sty
% v0.10.2
% https://github.com/HoyanMok/TeXplates
\ProvidesPackage{TeXplatesMathematics}
% \RequirePackage{CJK} % for Chinese charactors appearing in the reference.
\RequirePackage{biblatex} %[style=gb7714-2015]{biblatex} 可以选择样式
% 令参考资料能够加入目录中:
\defbibheading{bibliography}[\bibname]{%
% \addcontentsline{toc}{chapter}{参考文献}
\chapter{#1}%
\markboth{#1}{#1}}
\RequirePackage[notbib, notindex]{tocbibind} % 解决TOC在TOC中的问题
\RequirePackage{imakeidx} %索引
\makeindex[intoc, title={Index}]
\makeindex[intoc, name=symbol, title={Symbol List}]
\newcommand*{\indexbf}[1]{\emph{\textbf{#1}}\index{#1}} % Index for definition
\newcommand*{\indexmath}[2][\ ]{#2\index[symbol]{#1@$#2$}} % Used Symbol
% \indexmath[name for sort]{display}
% 对目录项等的修改
\RequirePackage{chngcntr}
\counterwithout{section}{chapter} % So that the section won't reset when newing a chapter
\renewcommand{\thesection}{\textmd{\S}\arabic{section}}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
% 引用的宏包:
% 宏包的使用, 可以在命令行运行texdoc <宏包名>获得文档
\RequirePackage{multicol} % 分栏 (全局分栏建议在文档类处设置)
\RequirePackage{amsmath} % AMS数学标准
\makeatletter % '@' now normal "letter"
\@addtoreset{equation}{section} % 每次换section就把equation清零
\makeatother % '@' is restored as "non-letter"
\renewcommand\theequation{\oldstylenums{\arabic{section}}%
-\oldstylenums{\arabic{equation}}} % 显示为section数-equation数
\RequirePackage{amssymb} % 数学符号
\RequirePackage{mathrsfs} % 花体
\RequirePackage{amsthm} %定义、证明、定理等
\theoremstyle{plain}
\newtheorem{axiom}{Axiom} %公理
\newtheorem{theorem}{Theorem}[section] %定理
\newtheorem{corollary}{Corollary} %推论
\newtheorem{lemma}{Lemma} %引理
\theoremstyle{definition}
% \newtheorem{definition}{Definition}[section] %定义
\newtheorem{proposition}{Proposition} %命题
\renewcommand{\proofname}{\textbf{Proof}}
\RequirePackage{xcolor} % 颜色
\definecolor{ORANGE}{HTML}{FF4500} % used for generation in mycolor.space
\definecolor{BLUE}{HTML}{0087FF}
\definecolor{GREEN}{HTML}{00A763}
\definecolor{ORANGEfaded}{HTML}{F2B199}
\definecolor{ORANGEfaded2}{HTML}{FFE6D6}
\definecolor{BLUEfaded}{HTML}{86AEE1}
\definecolor{BLUEfaded2}{HTML}{DBF2FF}
\definecolor{GREENvivide}{HTML}{00A300}
\definecolor{GREENdeep}{HTML}{006D00}
\RequirePackage{mdframed}
\mdfdefinestyle{definitionstyle}{%
backgroundcolor = BLUEfaded2,%
innerleftmargin = 5pt,%
innerrightmargin = 5pt,%
innertopmargin = 0pt,%
linewidth = 0pt,%
frametitlerule=true,%
frametitlebackgroundcolor=BLUEfaded,%
frametitlerulewidth=0pt,%
frametitleaboveskip=0.5pt,%
frametitlebelowskip=0.5pt,%
}
\mdtheorem[%
style=definitionstyle,%
theoremtitlefont=\normalfont%
]{definition}{Definition}[section]
\RequirePackage{mathtools}
\renewcommand{\thetheorem}{%
\arabic{section}.\arabic{theorem}%
} % 公式编号不显示`\S`
\renewcommand{\thedefinition}{%
\arabic{section}.\arabic{definition}%
} % 定义编号不显示`\S`
\RequirePackage{esint} % 积分
\RequirePackage{siunitx} % 标准SI数值和单位处理
\RequirePackage{tikz} % 绘图
\usetikzlibrary{cd}
\RequirePackage{booktabs}
\RequirePackage{float} % 浮动体 (供图片, 表格等) 扩展, 主要用于提供h模式
\RequirePackage{graphicx} % 插入图片
\RequirePackage{titlepic}
\RequirePackage[font=small, skip=5pt]{caption} % 缩小题注字体和题注与图片距离
\RequirePackage{subcaption} % 子图和子图的题注
\RequirePackage{svg} % svg位图
\RequirePackage{wrapfig} % 简单的图文绕排
\RequirePackage[inline]{enumitem} % 编号
% 新列表:
\newlist{conditionlist}{enumerate}{2}
\setlist[conditionlist,1]{topsep = 0pt, itemsep = 0pt, parsep = 0pt,%
label=\arabic*), leftmargin=2\parindent}
\setlist[conditionlist,2]{topsep = 0pt, itemsep = 0pt, parsep = 0pt,%
label=\alph*), leftmargin=3\parindent}
\RequirePackage{geometry} % 调整页边距
% \geometry{left=1.6cm,right=1.6cm}
\RequirePackage{xr-hyper} % 跨文件引用
\RequirePackage[colorlinks=true,bookmarks=true]{hyperref} % 引用, 交叉引用, 图表等的链接; 生成书签
\hypersetup{%
linkcolor=ORANGE,%
citecolor=BLUE,%
urlcolor=GREEN,%
bookmarksopen = true}% 更多设置请查阅: texdoc hyperref
% 定义一些笔者常用的指令:
\newcommand{\me}{\mathrm{e}} % 自然对数的底
\newcommand{\mi}{\mathrm{i}} % 虚数单位
\newcommand*{\dif}[1][]
{\mathop{}\!\mathrm{d}^{#1}} % 微分算子d
\newcommand*{\basis}[1]{\hat{\boldsymbol{#1}}} % 基底
\newcommand*{\bv}[1]{\boldsymbol{#1}} % 向量加粗
\newcommand*{\IFF}{\;\leftrightarrow\;} % 充要条件
\newcommand*{\then}{\;\rightarrow\;}
\newcommand*{\diff}[3][1]
{\if#11%
\frac{\mathrm{d} #2}{\mathrm{d} #3}% 导数\diff{y}{x}
\else%
\frac{\mathrm{d}^{#1} #2}{\mathrm{d} {#3}^{#1}}% n阶导数\diff[n]{y}{x}
\fi}
\newcommand*{\pdiff}[3][1]
{\if#11%
\frac{\partial #2}{\partial #3}% 偏导数\pdiff{y}{x}
\else%
\frac{\partial^{#1} #2}{\partial {#3}^{#1}}% n阶偏导数\pdiff[n]{y}{x}
\fi}
\newcommand{\emphbf}[1]{\emph{\textbf{#1}}}
\newcommand{\hence}{\ensuremath{\quad \Rightarrow \quad}}
\newcommand{\dummy}{-}
% \indexbf 的定义见前imakeidx的引用下
% \renewenvironment{align}{%
% \begin{equation}
% \begin{aligned}
% }{
% \end{aligned}
% \end{equation}
% \ignorespacesafterend
% }
% \NewCommandCopy\old\equation
% \NewCommandCopy\endoldequation\endequation
% \renewenvironment{equation}{%
% \oldequation
% \begin{aligned}
% }{%
% \end{aligned}
% \endoldequation
% \ignorespacesafterend
% }
% 对页眉等的修改
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
\fancyhead[RO,LE]{\thepage}
\fancyhead[RE]{\small\textsc{\nouppercase{\leftmark}}}
\fancyhead[LO]{\small\textsc{\nouppercase{\rightmark}}}
\renewcommand{\headrulewidth}{0.4pt}
% 笔者习惯的运算符:
\DeclareMathOperator{\tg}{tg}
\DeclareMathOperator{\ctg}{ctg}
\DeclareMathOperator{\arctg}{arctg}
\DeclareMathOperator{\sh}{sh}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\ran}{ran}
\DeclareMathOperator{\interior}{int}
\DeclareMathOperator{\card}{card}
\DeclareMathOperator{\SO}{SO}
\DeclareMathOperator{\SU}{SU}
\DeclareMathOperator{\GL}{GL}
\DeclareMathOperator{\so}{\mathfrak{so}}
\DeclareMathOperator{\su}{\mathfrak{su}}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\Inn}{Inn}
\DeclareMathOperator{\End}{End}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\sign}{sign}
\DeclareMathOperator{\vol}{vol}
\DeclareMathOperator{\Nat}{Nat}
\DeclareMathOperator{\Ric}{Ric}
\DeclareMathOperator{\Hess}{Hess}
\DeclareMathOperator{\Riem}{Riem}
\DeclareMathOperator{\ad}{ad}
\DeclareMathOperator{\Ad}{Ad}
% Categories
\newcommand{\catname}[1]{\mathsf{#1}}
\DeclareMathOperator{\obj}{obj}
\DeclareMathOperator{\Set}{\catname{Set}}
\DeclareMathOperator{\Top}{\catname{Top}}
\DeclareMathOperator{\Mod}{\catname{Mod}}
\DeclareMathOperator{\Grp}{\catname{Grp}}
\DeclareMathOperator{\Ab}{\catname{Ab}}
\DeclareMathOperator{\Ring}{\catname{Ring}}
\DeclareMathOperator{\CRing}{\catname{CRing}}
\DeclareMathOperator{\Asc}{\catname{Asc}}
\DeclareMathOperator{\Ord}{\catname{Ord}}
\DeclareMathOperator{\hTop}{\catname{hTop}}
% \DeclareMathOperator*{\指令}{显示}
% 带星号的版本会像\lim一样