-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqc.sty
269 lines (241 loc) · 9.58 KB
/
qc.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
%-----字体大小-----
%文档的统一字体还需要手动修改
\newlength{\fntsize}
\fntsize=11pt
\usepackage[top=15mm,left=18mm,right=18mm,bottom=20mm]{geometry}
\columnsep=20pt
\usepackage[space]{ctex}
\usepackage{fontspec,xltxtra,xunicode}
%\usepackage[slantfont,boldfont,space]{xeCJK}
%\usepackage{xeCJK}
%\usepackage{CJK}
%\usepackage{verbatim}
%-----摘要设置-----
%这里定义的摘要长度是相对大小,字体改变之后需要手动调整
%\usepackage{abstract}
%\renewcommand{\abstractname}{}
%\newlength{\abstractlength}
%\abstractlength=35\fntsize
%-----字体设置-----
%黑体、楷体使用Adobe系列,宋体、仿宋使用中易系列
%抄录环境不适合使用中文,字体使用Ubuntu Mono,原先的字体是不合适的,因为空格是不等宽的;同时缩放倍数为0.8倍.暂无法实现行间转换.
%对于Mathematica环境,In前空一格;在不大于100的公式环境下,换行需要预先空出9格.
%\setCJKmainfont[BoldFont=AdobeHeitiStd-Regular, ItalicFont=AdobeKaitiStd-Regular]{SimSun}
%\setCJKsansfont{AdobeHeitiStd-Regular}
%\setmainfont{Minion Pro}
%\setCJKfamilyfont{zhhei}{AdobeHeitiStd-Regular}
\providecommand*{\heiti}{\CJKfamily{zhhei}}
%\setCJKfamilyfont{zhfs}{FangSong}
\providecommand*{\fangsong}{\CJKfamily{zhfs}}
%\setCJKfamilyfont{zhkai}{AdobeKaitiStd-Regular}
\providecommand*{\kaiti}{\CJKfamily{zhkai}}
%\setCJKfamilyfont{zhsong}{SimSong}
\providecommand*{\songti}{\CJKfamily{zhsong}}
%\setmonofont[Scale=0.8]{Ubuntu Mono}
%\setsansfont[BoldFont=HelveticaNeueLTPro-Md]{HelveticaNeueLTPro-Roman}
%-----日期设置-----
\renewcommand{\today}{\kaiti \number\year 年 \number\month 月 \number\day 日}
%\renewcommand{\today}{}
%-----标题设置-----
\usepackage{titlesec}
%-----行距设置-----
%1.2代表的是1.5倍行距;设置为2倍行距应打入1.667
%20pt对10.5pt,行距应表示为20pt/10.5pt=1.9048倍
%这里
\linespread{1.2}
\usepackage{setspace}
\setlength{\abovedisplayskip}{-10pt}
%-----颜色设置-----
\PassOptionsToPackage{svgnames}{xcolor}
\usepackage{xcolor}
\definecolor{purple}{rgb}{0.6,0.1,0.9}
\definecolor{blue}{rgb}{0.15,0.3,0.9}
\definecolor{msorange}{rgb}{0.98,0.2,0.1}
\definecolor{mediumgray}{rgb}{0.5,0.5,0.5}
\newcommand{\mog}[1]{{\color{msorange}{#1}}}
\newcommand{\blue}[1]{{\color{blue}{#1}}}
\newcommand{\prle}[1]{{\color{purple}{#1}}}
\newcommand{\mdgry}[1]{{\color{mediumgray}{#1}}}
%-----书签与引用设置-----
\usepackage[CJKbookmarks]{hyperref}
\hypersetup{%
colorlinks,
linkcolor=red,
filecolor=green,
urlcolor=blue,
citecolor=blue,
pdfstartview=FitH,
bookmarksnumbered=true,
pdfauthor=祝震予}
%-----设置引用-----
\renewenvironment{quotation}
{\list{}{\rightmargin\leftmargin}%
\item\relax\kaiti\small\hspace{1.7em}}
{\endlist}
%-----首行缩进-----
\usepackage{indentfirst}
\usepackage{setspace}
\setlength{\parindent}{2\fntsize}
%-----图表设置-----
\usepackage{graphicx}
%\usepackage[justification=centering]{caption}
\usepackage{caption}
\usepackage{subcaption}
\DeclareCaptionFont{heiti}{\heiti}
\DeclareCaptionFont{kaiti}{\kaiti}
\captionsetup{labelfont=bf, textfont=kaiti}
\renewcommand{\figurename}{图}
\newcommand{\reffig}[1]{图~\ref{#1}}
%\usepackage{subfigure}
\usepackage{float}
%使用[H]可以强制在此处插入图表
\usepackage{multirow}
\usepackage{makecell}
\setcellgapes{3pt}
\renewcommand{\tablename}{表}
\newcommand{\reftab}[1]{表~\ref{#1}}
%三线式表格
\usepackage{booktabs}
\usepackage{supertabular}
%长表格
\usepackage{enumitem}
%-----引用设置-----
%\usepackage[square,numbers,super]{natbib}
%\addtolength{\bibsep}{-0.5 em} % 缩小参考文献间的垂直间距
%\renewcommand\bibnumfmt[1]{#1.} %去掉文末文献列表的[](数字或上标模式)
%\newcommand{\bibnumfont}[1]{\textit{#1}}
%---------------定理环境---------------
%不知道为什么iint和iiint被预先定义了@_@
\let\iint\undefined
\let\iiint\undefined
%尽量不要直接定义ntheorem,而先定义amsmath(ntheorem宏包3.5节)
%这样能保证在DisplayMath中,证毕符号同样能出现.
\usepackage[ntheorem]{empheq}
\usepackage[thmmarks,amsmath]{ntheorem}
{ \theoremstyle{nonumberplain}
\theoremheaderfont{\heiti}
\theorembodyfont{\kaiti}
\theoremsymbol{\ensuremath{\Box}}
\newtheorem{proof}{证明}
}
{ \theoremstyle{nonumberplain}
\theoremheaderfont{\heiti}
\theorembodyfont{\kaiti}
\theoremsymbol{\ensuremath{\Box}}
\newtheorem{explain}{说明}
}
{ \theoremstyle{nonumberplain}
\theoremheaderfont{\bf}
\theorembodyfont{\kaiti}
\newtheorem{anecdote}{叙述}
}
{ \theoremheaderfont{\bf}
\theorembodyfont{\fangsong}
\newtheorem{principle}{原理}
}
{ \theoremheaderfont{\bf}
\theorembodyfont{\fangsong}
\newtheorem{theorem}{定理}
}
{ \theoremheaderfont{\bf}
\theorembodyfont{\fangsong}
\newtheorem{lemma}{引理}
}
{ \theoremheaderfont{\bf}
\theorembodyfont{\fangsong}
\newtheorem{definition}{定义}[section]
}
{ \theoremheaderfont{\bf}
\theorembodyfont{\fangsong}
\newtheorem{inference}{推论}[section]
}
%-----关于数学记号的说明与宏包-----
\usepackage{amsmath}
%允许分页显示公式
%\allowdisplaybreaks[4]
%向量与矩阵
%本文中,向量用粗斜体标记,矩阵用粗正体标记
%\bm加粗,\hm重粗
\usepackage{bm}
%花体可以通过\mathscr写出
\usepackage{mathrsfs}
%双线字体可以通过\mathbb调出
\usepackage{amsfonts}
\usepackage{amssymb}
%可以打出圆圈中数字的宏包
\usepackage{dsfont}
\usepackage{physics}
\usepackage{braket}
%-----其他设定-----
\newcommand{\doi}[2]{\href{https://dx.doi.org/#1}{#2}}
\usepackage[version=4]{mhchem}
\mhchemoptions{textfontcommand=\sffamily}
\mhchemoptions{mathfontcommand=\mathsf}
%-----彩色文档框-----
% Beamer Box in Article
%https://tex.stackexchange.com/questions/2504/beamer-blocks-in-ordinary-article-style-document
\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbuselibrary{skins,breakable}
\usetikzlibrary{shadings,shadows}
\tcbset{textmarker/.style={%
%skin=enhancedmiddle jigsaw,
breakable,parbox=false,
%boxrule=0mm,leftrule=1.5mm,rightrule=0mm,boxsep=0mm,arc=1mm,outer arc=0mm,
left=3mm,right=3mm,top=3mm,bottom=3mm,
%toptitle=1mm,bottomtitle=1mm
}}
\newtcolorbox{exercise}[1]{textmarker,colback=ForestGreen!5!white,colframe=ForestGreen!80!white,fontupper=\par,fontlower=\par,
title=Exercise~{#1}, fonttitle=\bfseries, colbacktitle=ForestGreen!80!white}
\newtcolorbox{warning}{textmarker,colback=OrangeRed!5!white,colframe=OrangeRed!80!white,fontupper=\fangsong\par,fontlower=\fangsong\par,
title=Warning, fonttitle=\bfseries, colbacktitle=OrangeRed!80!white}
\newtcolorbox{note}{textmarker,colback=Orange!5!white,colframe=Orange!80!white,fontupper=\fangsong\par,fontlower=\fangsong\par,
title=Note, fonttitle=\bfseries, colbacktitle=Orange!80!white}
\newtcolorbox{hint}{textmarker,colback=Peru!5!white,colframe=Peru!80!white,fontupper=\fangsong\par,fontlower=\fangsong\par,
title=Hint, fonttitle=\bfseries, colbacktitle=Peru!80!white}
\newtcolorbox{solution}{textmarker,colback=RoyalBlue!5!white,colframe=RoyalBlue!80!white,fontupper=\kaiti\par,fontlower=\kaiti\par,
title=Solution, fonttitle=\bfseries, colbacktitle=RoyalBlue!80!white}
\newtcolorbox{preuve}{textmarker,colback=RoyalBlue!5!white,colframe=RoyalBlue!80!white,fontupper=\kaiti\par,fontlower=\kaiti\par,
title=Proof, fonttitle=\bfseries, colbacktitle=RoyalBlue!80!white}
\newcommand{\tcbemph}[1]{\noindent\textsf{#1}\par}
%-------代码框----
\usepackage{listings}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\definecolor{lgray}{gray}{0.7}
\colorlet{lorange}{yellow!20!orange!80!}
\newfontfamily\Consolas{Consolas}
\lstset{ %
%language=Python, % the language of the code
basicstyle=\Consolas\footnotesize, % the size of the fonts that are used for the code
numbers=left, % where to put the line-numbers
numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it's 1, each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here))
tabsize=4, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
%title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
keywordstyle=\color{blue}, % keyword style
commentstyle=\color{dkgreen}, % comment style
stringstyle=\color{mauve}, % string literal style
%escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
morekeywords={*,...} % if you want to add more keywords to the set
}
%-----TikZ-----
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta}
%---------设定区结束----------
\DeclareMathOperator{\intinf}{\int_{- \infty}^{+ \infty}}