generated from cqu-bdsc/CQUThesis
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcquthesis.sty
150 lines (125 loc) · 5.01 KB
/
cquthesis.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
\ProvidesPackage{cquthesis}[2016/06/09 The place for your beloved packages and customization.]
%=====你可以在这里使用\RequirePackage[包选项]{包名称}导入想用的Package=======
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[linesnumbered,ruled,vlined,resetcount,algochapter]{algorithm2e}
\usepackage{dsfont}
\usepackage{mathrsfs}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subeqnarray}
\usepackage{cases}
\usepackage{dutchcal}
\usepackage{xeCJK}
\usepackage{lastpage} % 导入lastpage宏包
\usepackage{titlesec}
% 调整间距
\titlespacing*{\chapter}{0pt}{-50pt}{40pt}
% 目录格式设置
\usepackage{tocloft}
% 设置一级标题的字体样式
\renewcommand{\cftchapfont}{\bfseries\zihao{4}}
% 设置二级标题的字体样式
\renewcommand{\cftsecfont}{\bfseries\zihao{5}}
\renewcommand{\cftsecindent}{12bp}
% 设置三级标题的字体样式和缩进
\renewcommand{\cftsubsecfont}{\zihao{5}}
\renewcommand{\cftsubsecindent}{25bp}
% 设置章标题的编号宽度
\setlength{\cftchapnumwidth}{0em}
% 设置章标题的编号和标题之间的间距
\renewcommand{\cftchapaftersnum}{\hspace{1em}}
% 设置二级标题的编号宽度
\setlength{\cftsecnumwidth}{0em}
% 设置二级标题的编号和标题之间的间距
\renewcommand{\cftsecaftersnum}{\hspace{1em}}
% 设置三级标题的编号宽度
\setlength{\cftsubsecnumwidth}{0em}
% 设置三级标题的编号和标题之间的间距
\renewcommand{\cftsubsecaftersnum}{\hspace{1em}}
% 设置页码字体
\renewcommand{\cftchappagefont}{\normalfont}
\renewcommand{\cftsecpagefont}{\normalfont}
\renewcommand{\cftsubsecpagefont}{\normalfont}
\usepackage{titletoc} % 引入 titletoc 宏包
\titlecontents{figure}
[0pt] % 左边距
{\fontsize{10.5}{15}图~\selectfont\parskip0pt\parindent0pt} % 字体设置和行距
{\thecontentslabel\enspace} % 编号
{}
{\titlerule*[0.3pc]{.}\contentspage}
\titlecontents{table}
[0pt] % 左边距
{\fontsize{10.5}{15}表~\selectfont\parskip0pt\parindent0pt} % 字体设置和行距
{\thecontentslabel\enspace} % 编号
{}
{\titlerule*[0.3pc]{.}\contentspage}
% 消除章节之间的间距
\newcommand{\removelofgap}{\addtocontents{lof}{\vspace{-10pt}}}
\newcommand{\removelotgap}{\addtocontents{lot}{\vspace{-10pt}}}
\usepackage{tocloft}
% 设置 listoffigures 和 listoftables 标题字体为三号黑体
\renewcommand{\cftloftitlefont}{\centering\CJKfontspec{SimHei}\fontsize{16}{20}\selectfont\hspace*{\fill}}
\renewcommand{\cftlottitlefont}{\centering\CJKfontspec{SimHei}\fontsize{16}{20}\selectfont\hspace*{\fill}}
% 在 listoffigures 和 listoftables 标题前后各空一行
\renewcommand{\cftbeforeloftitleskip}{\baselineskip} % 标题前空一行
\renewcommand{\cftafterloftitleskip}{\baselineskip} % 标题后空一行
\renewcommand{\cftbeforelottitleskip}{\baselineskip} % 标题前空一行
\renewcommand{\cftafterlottitleskip}{\baselineskip} % 标题后空一行
\usepackage{setspace}
%=====以及定义你自己的功能和常量=======
\newcommand{\speakyourlove}[1][Mom]{\emph{#1, I Love You!}}
% 晶向指数支持,如果需要请取消下面两行注释:
% \RequirePackage{miller}
% \pretocmd{\hkl}{{ }}{}{}
%
% 物理符号宏包:
%\RequirePackage{physics}
%
% 计算机算法宏包:
\RequirePackage{algorithmic}
%
% 绘图宏包:
%\RequirePackage{tikz}
%
% 绘制电路图:
%\RequirePackage{circuitikz}
% 这两个个宏包仅供参考,未必使用:
% \RequirePackage{floatflt} % 图文混排用宏包
% \RequirePackage{rotating} % 图形和表格的控制旋转
%========一些推荐功能=========
% 用中文双引号括起文字
\newcommand{\qthis}[1]{{``}#1{''}}
%交叉引用图X、表X、方程X(此处为向前兼容,强烈推荐使用\autoref{label})
\newcommand{\figref}[1]{图\ref{#1}}
\newcommand{\tabref}[1]{表\ref{#1}}
%\eqref已经改写过
%================================
%**********代码开发区域***********
%================================
% 借用 ltxdoc 里面的几个命令。
\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
\def\cmd@to@cs#1#2{\char\number`#2\relax}
\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
\DeclareRobustCommand\csgo[2]{\cs{#1\{#2\}}}
\newcommand*{\meta}[1]{{%
\ensuremath{\langle}\rmfamily\itshape#1\/\ensuremath{\rangle}}}
\providecommand\marg[1]{%
{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
\providecommand\oarg[1]{%
{\ttfamily[}\meta{#1}{\ttfamily]}}
\providecommand\parg[1]{%
{\ttfamily(}\meta{#1}{\ttfamily)}}
\providecommand\pkg[1]{{\sffamily#1}}
% 文件夹列表
\usepackage{dirtree}
% The following is a dummy icon command
\newcommand\myicon[1]{{\color{#1}\rule{2ex}{2ex}}}
% If you have actual icon images, use \includegraphics to include them
% If you are generating them, put in the appropriate code for them here
% now we make a command for a folder/file which inserts the icon and its label
% adjust this as needed. If you only have 2 icons, then you could create
% a \myfile and \myfolder command with the icon fixed.
\newcommand{\myfolder}[2]{\myicon{#1}\ {#2}}