-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreamble.tex
106 lines (105 loc) · 4.31 KB
/
preamble.tex
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
%preamble.tex
%-----------------------------------------------------%
\usepackage{xeCJK}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\linespread{1.25}\selectfont
\usepackage{indentfirst}
\setlength{\parindent}{2em}
\setlength{\parskip}{1em}
\usepackage[left=3.18cm,right=3.18cm,top=2.54cm,bottom=2.54cm]{geometry}
%----------------------代码-------------------------%
\usepackage{listings}
\lstset{
%行号
numbers=left,
%背景框
framexleftmargin=10mm,
frame=none,
%背景色
%backgroundcolor=\color[rgb]{1,1,0.76},
backgroundcolor=\color[RGB]{245,245,244},
%样式
keywordstyle=\bf\color{blue},
identifierstyle=\bf,
numberstyle=\color[RGB]{0,192,192},
commentstyle=\it\color[RGB]{0,96,96},
stringstyle=\rmfamily\slshape\color[RGB]{128,0,0},
%显示空格
showstringspaces=false}
%--------------------------------------------------%
%--------------------------页眉页脚-------------------------------%
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO]{\leftmark}
\fancyhead[LE]{\rightmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{\markboth{第\thechapter 章\qquad #1}{}}
%----------------------------------------------------------------%
\renewcommand{\today}{\number\year 年\number\month 月\number\day 日}
\renewcommand{\contentsname}{目 \quad 录}
\usepackage{titlesec}
\titleformat{\chapter}{\centering\Huge\bfseries}{第\,\thechapter\,章}{1em}{}
%---------------汉化参考文献--------------------%
%\renewcommand{\abstractname}{摘 \quad 要} %如果是article类用\refname;如果是book类用\bibname
%\renewcommand{\refname}{参考文献}
%\renewcommand{\bibname}{参考文献}
%----------------中英文摘要---------------------%
\newcommand{\enabstractname}{Abstract}
\newcommand{\cnabstractname}{摘要}
\newenvironment{enabstract}{%英文摘要
\par\small
\noindent\mbox{}\hfill{\bfseries \enabstractname}\hfill\mbox{}\par
\vskip 2.5ex}{\par\vskip 2.5ex}
\newenvironment{cnabstract}{%中文摘要
\par\small
\noindent\mbox{}\hfill{\bfseries \cnabstractname}\hfill\mbox{}\par
\vskip 2.5ex}{\par\vskip 2.5ex}
%---------------------------------------------%
\newcommand{\upcite}[1]{\textsuperscript{\cite{#1}}}%参考文献在右上角
\bibliographystyle{plain}
%------------汉化图表标题--------%
\usepackage{caption}
\renewcommand\figurename{\hei 图}
\renewcommand\tablename{\hei 表}
%-----------自动生成书签------------%
\usepackage[bookmarks=true]{hyperref}
%----------------------------------------字体---------------------------------%
\usepackage{fontspec,xunicode,xltxtra}
\newfontfamily\youyuan{YouYuan}
\newfontfamily\hwcaiyun{STCaiyun}
\newfontfamily\hwhupo{STHupo}
\newfontfamily\yaoti{FZYaoTi}
\newfontfamily\kaiti{simkai.ttf}
\newfontfamily\xsong{NSimSun}
\newfontfamily\hwsong{STSong}
\newfontfamily\yahei{Microsoft YaHei}
\newfontfamily\songti{SimSun}
\newfontfamily\hwfangsong{STFangsong}
\newfontfamily\weiti{STXinwei}
\newfontfamily\heiti{SimHei}
\newfontfamily\hwxingkai{STXingkai}
\newfontfamily\hwlishu{STLiti}
\newfontfamily\zhongsong{STZhongsong}
\newfontfamily\shuti{FZShuTi}
\newfontfamily\hwhei{STXihei}
\newfontfamily\lishu{LiSu}
\newfontfamily\hwkai{STKaiti}
\renewcommand{\baselinestretch}{1.25}
%--------------------------------------字号---------------------------------%
\usepackage{fontspec,xunicode,xltxtra}
\newcommand{\chuhao}{\fontsize{42pt}{\baselineskip}\selectfont} %初号
\newcommand{\xiaochuhao}{\fontsize{36pt}{\baselineskip}\selectfont} %小初号
\newcommand{\yihao}{\fontsize{28pt}{\baselineskip}\selectfont} %一号
\newcommand{\erhao}{\fontsize{21pt}{\baselineskip}\selectfont} %二号
\newcommand{\xiaoerhao}{\fontsize{18pt}{\baselineskip}\selectfont} %小二号
\newcommand{\sanhao}{\fontsize{15.75pt}{\baselineskip}\selectfont} %三号
\newcommand{\sihao}{\fontsize{14pt}{\baselineskip}\selectfont} %四号
\newcommand{\xiaosihao}{\fontsize{12pt}{\baselineskip}\selectfont} %小四号
\newcommand{\wuhao}{\fontsize{10.5pt}{\baselineskip}\selectfont} %五号
\newcommand{\xiaowuhao}{\fontsize{9pt}{\baselineskip}\selectfont} %小五号
\newcommand{\liuhao}{\fontsize{7.875pt}{\baselineskip}\selectfont} %六号
\newcommand{\qihao}{\fontsize{5.25pt}{\baselineskip}\selectfont} %七号