-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmy-math-note.sty
245 lines (202 loc) · 9.28 KB
/
my-math-note.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
\ProvidesPackage{my-math-note}
%\usepackage{showframe}% 在页面中绘制框线(DEBUG用)
\usepackage{textcomp}% 需要COPYLEFT符号
\usepackage{xcolor,latexcolors}%颜色
\usepackage{etoolbox}% 循环测试\whileboolexpr
\usepackage{seqsplit}% 自动切割素数表
\usepackage{textgreek}% 在文本模式下使用希腊字母
\usepackage{xparse}
\usepackage{fnbreak}% 如果一个脚注被切割后跨页排版,可以在log日志文件里发出警告提示.
%--------------------------------------
% table
\usepackage{multirow}% 【deprecated】
\usepackage{longtable}% 长表格【deprecated】
\usepackage{tabularray}% 提供 tblr 环境,绘制更好看的表格,替代 tabular 环境
\UseTblrLibrary{diagbox}
\usepackage[a4paper,total={7in,8in}]{geometry}
\usepackage[%hyperref
pdfauthor={\pdfauthor},
pdftitle={\pdftitle},
unicode=true,
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
bookmarks=true,
pdfpagemode=UseOutlines,
]{hyperref}
\usepackage{pdflscape} % 单页横置
% 矩阵初等变换
\def\addeq{+\hspace{-4pt}=}
\def\subeq{-\hspace{-5pt}=}
\def\muleq{\times\hspace{-6pt}=}
\def\diveq{/\hspace{-5pt}=}
\usepackage{graphicx}
\usepackage{math-arc} % 表示曲线弧
%--------------------------------------
\usepackage{mathrsfs} % \mathscr
\usepackage{amssymb}%https://mirror.aarnet.edu.au/pub/CTAN/fonts/amsfonts/doc/amssymb.pdf
\usepackage{amsmath}
\usepackage{centernot}
\def\notimplies{\centernot\implies}
\def\notiff{\centernot\iff}
\def\napprox{\not\approx}
\newcommand{\rel}[1]{ \mathcal{#1} } % 关系
\usepackage{math-operator}
%--------------------------------------
\usepackage[%cleveref
nosort%禁止压缩引用
]{cleveref} % 放在hyperref,amsmath后面
\def\crefpairconjunction{ 和 }
\def\creflastconjunction{ 和 }%列表式引用,最后一个连词
\def\crefnamezh#1#2{\crefname{#1}{#2}{#2}}%汉语词汇没有单复数的差别,因此第二、三个参数是相同的
\def\crefnamezhrm#1#2{\crefnamezh{#1}{#2}\creflabelformat{#1}{##2{\rm##1}##3}}%
\crefnamezhrm{figure}{图}%
\crefnamezhrm{table}{表}%
\crefnamezhrm{equation}{公式}%
\crefnamezh{chapter}{}%
\creflabelformat{chapter}{#2第#1章#3}%
\crefnamezh{section}{}%
\creflabelformat{section}{第\kern2pt#2#1#3\kern2pt节}%
\crefnamezhrm{equation-system}{方程组}%
\crefnamezhrm{trigonometric-series}{三角级数}%
\crefnamezhrm{polynomial}{多项式}%
\crefnamezhrm{quadratic-equation}{一元二次方程}%
\crefnamezhrm{cubic-equation}{一元三次方程}%
\crefnamezhrm{differential-equation}{微分方程}
\crefnamezhrm{first-order-ordinary-differential-equation}{一阶微分方程}
\crefnamezhrm{first-order-linear-homogeneous-ordinary-differential-equation}{一阶线性齐次微分方程}
\crefnamezhrm{first-order-linear-nonhomogeneous-ordinary-differential-equation}{一阶线性非齐次微分方程}
\NewDocumentCommand\pagecref{m}{第~\labelcpageref{#1}~页}
% If the amsthm package is used with a non-AMS documentclass and with the amsmath
% package, amsthm must be loaded after amsmath, not before.
\usepackage{amsthm}%https://mirror.aarnet.edu.au/pub/CTAN/macros/latex/required/amscls/doc/amsthdoc.pdf
\def\newtheoremWithCrefName#1#2#3{%
\newtheorem{#1}{#2}[#3]%
\crefnamezh{#1}{#2}%
\creflabelformat{#1}{##2{\rm##1}##3}%
}
\theoremstyle{plain}
\newtheoremWithCrefName{proposition}{命题}{section}
\newtheoremWithCrefName{lemma}{引理}{section}
\newtheoremWithCrefName{theorem}{定理}{section}
\newtheoremWithCrefName{corollary}{推论}{section}
\newtheoremWithCrefName{property}{性质}{section}
\theoremstyle{definition}
\newtheoremWithCrefName{definition}{定义}{chapter}
\newtheoremWithCrefName{axiom}{公理}{chapter}
\newtheoremWithCrefName{example}{例}{section}
\newtheorem*{solution}{解}
\theoremstyle{remark}
\newtheorem*{remark}{评注}
%--------------------------------------
\usepackage{physics}%http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/physics/physics.pdf
% Must be loaded after pkg{amsmath}
\let\vb\boldsymbol%覆盖定义
\usepackage{siunitx}%国际单位
\AtBeginDocument{\RenewCommandCopy\qty\SI}%`siunitx'包与`physics'包有冲突,`\qty'命令会被自动禁用,只有利用左边这条命令才能启用`siunitx'包的`\qty'命令
\usepackage{extarrows}%necessary for \xlongequal
\def\toP{\xlongrightarrow{P}}%依概率收敛于
%--------------------------------------
\usepackage{tikz} % 绘图库
\usetikzlibrary{quotes}
\usetikzlibrary{angles}
\usetikzlibrary{intersections}
\usetikzlibrary{shapes.geometric,arrows}%流程图(flow chart)
\usetikzlibrary{arrows.meta}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}%计算长度
\usetikzlibrary{decorations.markings}%用来在几何图形旁边标注长度
\usepackage{pgffor} % for 循环
\usepackage{pgfplots} % axis环境,用于直接绘制给定函数式的图像
\pgfplotsset{compat=newest}
\usepgfplotslibrary{polar} % 极坐标下函数绘制
\usepackage{subcaption} % necessary for subfigure environment
\usepackage{ifthen} % 条件判断
\usepackage{mathtools}%https://mirror.aarnet.edu.au/pub/CTAN/macros/latex/contrib/mathtools/mathtools.pdf
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} % 向上取整
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} % 向下取整
\DeclarePairedDelimiter{\round}{[}{]} % 四舍五入
\DeclarePairedDelimiterX{\opair}[1]{\langle}{\rangle}{#1} % 有序对
\DeclarePairedDelimiterX{\ImageOfSetUnderRelation}[1]{[\kern-2pt[}{]\kern-2pt]}{\kern1pt #1 \kern1pt}% 集合 A 在关系 F 下的像
\def\defeq{\xlongequal{\rm def}}%符号(系统)定义
\def\defeq{:=}
\def\defiff{\overset{\triangle}{\iff}}%符号(系统)定义
%--------------------------------------
\usepackage{math-set} % 描述法表示集合
\usepackage{natural-set} % 以纯粹集合论的语言表示自然数
%--------------------------------------
\usepackage{esint}% necessary for \varoiint
\let\oldoiint\oiint
\let\oiint\varoiint
\let\varoiint\oldoiint
\let\oldoiint\undefined
\let\oldphi\phi
\let\phi\varphi
\let\varphi\oldphi
\let\oldphi\undefined
\let\oldepsilon\epsilon
\let\epsilon\varepsilon
\let\varepsilon\oldepsilon
\let\oldepsilon\undefined
\renewcommand{\vec}[1]{ \overrightarrow{#1} }
\newcommand{\jacobi}[2]{ \pdv{ (#1) }{ (#2) } }%向量值函数微积分 雅克比式
\newcommand{\ft}{ \mathfrak{F} }%傅里叶变换
\newcommand{\lt}{ \mathfrak{L} }%拉普拉斯变换
\usepackage{upgreek}\def\tau{\uptau}% 代替\tau
%\let\emptyset\varnothing % 空集
\def\iu{\kern1pt\mathrm{i}\kern1pt} % 虚数单位
\def\complexconjugate#1{\kern1pt\overline{#1}\kern1pt}% 共轭复数
\def\Powerset{\mathscr{P}}
\def\vectorinnerproduct#1#2{#1\cdot#2}%向量内积
\def\pvint{\PV\int}%广义积分的柯西主值
\NewDocumentCommand{\MatrixEntry}{ m m }{#1(#2)}%矩阵的元素
\def\MatrixMinor#1#2{#1\kern-3.8pt\begin{pmatrix}#2\end{pmatrix}}%矩阵的子式(第一个参数放矩阵名,例如“\vb{A}”;第二参数放选定的行与列)
\def\truediv#1#2{#2\mid#1}%整除符号.表示第一个参数是第二个参数的因子.
\def\gcd#1{\operatorname{gcd}(#1)}%最大公约数
\def\lcm#1{\operatorname{lcm}(#1)}%最小公倍数
\def\hessian{\vb{\operatorname{H}}}%黑森矩阵
\def\increment{\Delta}%增量%U+2206
\NewDocumentCommand{\UniformlyConverge}{ o }{%一致收敛
%@param: #1 一致收敛区间【可选】
\IfNoValueTF{#1}{\rightrightarrows}{\overset{#1}{\rightrightarrows}}
}
\def\IntegerQuotient{(\omega\times\omega)/\kern-2pt\sim}%基于集合论定义的整数集(其中 \omega 是基于集合论定义的自然数集)
\def\RationalQuotient{(\mathbb{Z}\times\mathbb{Z}^*)/\kern-2pt\sim}%基于集合论定义的有理数集
\usepackage{mathdots} % necessary for \iddots
\usepackage{chinese-footnote} % 中文脚注标号
\usepackage{math-tuple} % 用于代替我之前定义的 \v 命令,表记序列
\usepackage{enumitem}%利用这个包,可以修改列表序号样式
\setlist[enumerate,1]{%在全局修改1级enumerate环境\item的label
label={\rm\arabic*.},
}
\setlist[enumerate,2]{%在全局修改2级enumerate环境\item的label
label={\rm(\alph*)},
}
\setlist[itemize,2]{%在全局修改2级itemize环境\item的label
label={$\triangleright$},
}
\setlist{%
itemindent=1em,%修改enumitem全局设置,使得item序号对齐悬挂缩进2个字
}
%\usepackage{enumitem-zref}%可以用\ref引用enumerate列表中的item
% 对subsubsection编号,并编入目录
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
% 概念表
\def\DefineConcept#1{{\color{blue}\rm\bf#1}}
\newenvironment{flowchart}{\begin{figure}[htb]
%@see: https://www.geeksforgeeks.org/what-is-a-flowchart-and-its-types/
%@see: https://www.overleaf.com/learn/latex/LaTeX_Graphics_using_TikZ%3A_A_Tutorial_for_Beginners_(Part_3)%E2%80%94Creating_Flowcharts
\centering
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{tikzpicture}[node distance=2cm]
}{
\end{tikzpicture}
\caption{}
\end{figure}
}