-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpreset.tex
More file actions
180 lines (161 loc) · 5.45 KB
/
Copy pathpreset.tex
File metadata and controls
180 lines (161 loc) · 5.45 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
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
%==================== 数学符号公式 ============
\usepackage{amsmath} % AMS LaTeX宏包
\usepackage[style=1]{mdframed}
\usepackage{amsthm}
\usepackage{pdfpages}
\usepackage{amsfonts}
\usepackage{mathrsfs} % 英文花体字 体
\usepackage{bm} % 数学公式中的黑斜体
\usepackage{manfnt} % 一些图标,如 \dbend
\usepackage{lettrine} % 首字下沉,命令\lettrine
\def\attention{\lettrine[lines=2,lraise=0,nindent=0em]{\large\textdbend\hspace{1mm}}{}}
\usepackage{longtable}
\usepackage[toc,page]{appendix}
\usepackage{geometry} % 页边距调整
\geometry{top=3.0cm,bottom=2.7cm,left=2.5cm,right=2.5cm}
\usepackage{fancyhdr}
%====================清单==========================
\usepackage{enumitem}
\setlist[description]{leftmargin=\parindent,labelindent=\parindent}
%====================公式按章编号==========================
\numberwithin{equation}{section}
\numberwithin{table}{section}
\numberwithin{figure}{section}
%================= 基本格式预置 ===========================
\pagestyle{fancy}
\fancyhf{} %四个角添加的内容
\fancyfoot[C]{~\zihao{5} \thepage~ }%页足内容,L:左,C:中,R:右
\renewcommand{\headrulewidth}{0.65pt}
\CTEXsetup[format={\centering\bfseries\zihao{3}},name={第, 章}]{section}
\CTEXsetup[nameformat={\bfseries\zihao{4}},format={\bfseries\zihao{4}}]{subsection}
\CTEXsetup[nameformat={\songti\zihao{-4}},format={\songti\zihao{-4}}]{subsubsection}
%nameformat:编号;format:文字
%================== 表格 =========================
\usepackage{makecell,rotating,multirow,diagbox}
\newcommand{\addtbl}[1]
{
\input{table/#1}
}
%================== 图片 =========================
\newcommand{\addfig}[4][0.5]
{
\begin{figure}[thbp!]
\centering\includegraphics[width=#1\linewidth]{figure/#2}
\caption{#4}
\label{#3}
\end{figure}
}
%================== 图形支持宏包 =========================
\usepackage{subfigure}
\usepackage{graphicx} % 嵌入png图像
\usepackage{color,xcolor} % 支持彩色文本、底色、文本框等
\usepackage{hyperref} % 交叉引用
%\usepackage{caption}
\usepackage[font=small,labelfont=bf,labelsep=space]{caption}
\captionsetup{figurewithin=section}
%==================== 源码和流程图 =====================
\newcommand{\addcode}[2][None]
{
\lstinputlisting[language=#1]{code/#2}
}
\usepackage{listings} % 粘贴源代码
\usepackage{xcolor}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\usepackage{xcolor}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{comment}{rgb}{0.56,0.64,0.68}
\lstset{
frame=tb,
aboveskip=3mm,
belowskip=3mm,
xleftmargin=2em,
xrightmargin=2em,
showstringspaces=false,
keepspaces=true,
columns=flexible,
framerule=1pt,
rulecolor=\color{gray!35},
backgroundcolor=\color{gray!5},
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{comment},
stringstyle=\color{dkgreen},
breaklines=true,
breakatwhitespace=true,
tabsize=2,
}
%--------------------
\hypersetup{hidelinks}
\usepackage{booktabs}
\usepackage{shorttoc}
\usepackage{tabu,tikz}
\usepackage{float}
\usepackage{multirow}
\tabcolsep=1ex
\tabulinesep=\tabcolsep
\newlength\tikzboxwidth
\newlength\tikzboxheight
\newcommand\tikzbox[1]{%
\settowidth\tikzboxwidth{#1}%
\settoheight\tikzboxheight{#1}%
\begin{tikzpicture}
\path[use as bounding box]
(-0.5\tikzboxwidth,-0.5\tikzboxheight)rectangle
(0.5\tikzboxwidth,0.5\tikzboxheight);
\node[inner sep=\tabcolsep+0.5\arrayrulewidth,line width=0.5mm,draw=black]
at(0,0){#1};
\end{tikzpicture}%
}
\makeatletter
\def\hlinew#1{%
\noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet
\reserved@a\@xhline}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}%
\usepackage{subfigure}
\usepackage{CJK}
\usepackage{ifthen}
\usepackage{graphicx}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newtheorem{Theorem}{定理}
\newtheorem{Lemma}{引理}
%%使得公式随章节自动编号
\makeatletter
\@addtoreset{equation}{section}
\makeatother
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}
%-------------------------
\usepackage{pythonhighlight}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{shapes,arrows,positioning}
\bibliographystyle{gbt7714-2005} %论文引用格式
%=================== 定理类环境定义 ===================
\newtheorem{example}{例} % 整体编号
\newtheorem{algorithm}{算法}
\newtheorem{theorem}{定理} % 按 section 编号
\newtheorem{definition}{定义}
\newtheorem{axiom}{公理}
\newtheorem{property}{性质}
\newtheorem{proposition}{命题}
\newtheorem{lemma}{引理}
\newtheorem{corollary}{推论}
\newtheorem{remark}{注解}
\newtheorem{condition}{条件}
\newtheorem{conclusion}{结论}
\newtheorem{assumption}{假设}
%==================重定义 ===================
\renewcommand{\contentsname}{目录}
\renewcommand{\abstractname}{摘要}
\renewcommand{\refname}{参考文献}
\renewcommand{\indexname}{索引}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\appendixname}{附录}
\renewcommand{\proofname}{证明}
\renewcommand{\algorithm}{算法}