-
Notifications
You must be signed in to change notification settings - Fork 150
/
dtx-style.sty
228 lines (194 loc) · 7.03 KB
/
dtx-style.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
%%
%% This is file `dtx-style.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% njuthesis.dtx (with options: `dtx-style')
%% This is a generated file.
%%
%% Copyright (C) 2013-2017, Haixing Hu.
%% Department of Computer Science and Technology, Nanjing University.
%%
%% Home Page of the Project: http://haixing-hu.github.io/nju-thesis/
%%
%% It may be distributed and/or modified under the conditions of the LaTeX Project
%% Public License, either version 1.2 of this license or (at your option) any
%% later version. The latest version of this license is in
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%%
%% This is the manual-style file of the njuthesis package with XeLaTeX.
\RequirePackage{etoolbox}
\ProvidesPackage{dtx-style}
\RequirePackage{amssymb}
\RequirePackage{calc}
\RequirePackage{array,longtable}
\RequirePackage{fancybox,fancyvrb}
\RequirePackage{xcolor}
\RequirePackage{txfonts}
\RequirePackage{xltxtra}
\RequirePackage{subfigure}
\RequirePackage{marvosym}
\RequirePackage{booktabs}
\RequirePackage{paralist}
\RequirePackage{enumitem}
\RequirePackage{titlesec}
\RequirePackage{titling}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{indentfirst}
\RequirePackage[CJKnumber,CJKchecksingle]{xeCJK}
\RequirePackage[hyphens]{url} % must be load before hypdoc package
\RequirePackage{hypdoc} % it will load hyperref package
\RequirePackage[normalem]{ulem}
\hypersetup{%
unicode=false,
hyperfootnotes=true,
hyperindex=true,
pageanchor=true,
CJKbookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksopenlevel=0,
breaklinks=true,
colorlinks=false,
plainpages=false,
pdfpagelabels,
pdfborder=0 0 0%
}
\newcommand{\env}[1]{\texttt{#1}}
\hypersetup{colorlinks=true,urlcolor=blue}
\newcommand*{\njut@enfn@main}{Times New Roman}
\newcommand*{\njut@enfn@sans}{Arial}
\newcommand*{\njut@enfn@mono}{Courier New}
\newcommand*{\njut@zhfn@songti}{Adobe Song Std}
\newcommand*{\njut@zhfn@heiti}{Adobe Heiti Std}
\newcommand*{\njut@zhfn@kaishu}{Adobe Kaiti Std}
\newcommand*{\njut@zhfn@fangsong}{Adobe Fangsong Std}
\setCJKfamilyfont{song}{\njut@zhfn@songti}
\setCJKfamilyfont{hei}{\njut@zhfn@heiti}
\setCJKfamilyfont{kai}{\njut@zhfn@kaishu}
\setCJKfamilyfont{fangsong}{\njut@zhfn@fangsong}
\setCJKmainfont[BoldFont={\njut@zhfn@heiti},
ItalicFont={\njut@zhfn@kaishu}]{\njut@zhfn@songti}
\setCJKsansfont{\njut@zhfn@heiti}
\setCJKmonofont{\njut@zhfn@fangsong}
\setmainfont{\njut@enfn@main}
\setsansfont{\njut@enfn@sans}
\setmonofont{\njut@enfn@mono}
\newcommand*{\songti}{\CJKfamily{song}}
\newcommand*{\heiti}{\CJKfamily{hei}}
\newcommand*{\kaishu}{\CJKfamily{kai}}
\newcommand*{\fangsong}{\CJKfamily{fangsong}}
\renewcommand{\contentsname}{目\hspace{2em}录}
\renewcommand{\abstractname}{摘\hspace{2em}要}
\renewcommand{\indexname}{索\hspace{2em}引}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\refname}{参考文献}
\setlength{\parskip}{4pt plus1pt minus0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\parindent}{2em}
\addtolength{\oddsidemargin}{-1cm}
\advance\textwidth 1.5cm
\addtolength{\topmargin}{-1cm}
\addtolength{\headsep}{0.3cm}
\addtolength{\textheight}{2.3cm}
\newcommand{\zhdash}{\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex}
\renewcommand{\baselinestretch}{1.3}
\DefineVerbatimEnvironment{shell}{Verbatim}%
{frame=single,framerule=0.1mm,rulecolor=\color{black},%
framesep=2mm,fontsize=\small,gobble=1}
\DefineVerbatimEnvironment{example}{Verbatim}%
{frame=single,framerule=0.1mm,rulecolor=\color{black},%
framesep=2mm,baselinestretch=1.2,fontsize=\small,gobble=1}
\long\def\myentry#1{\vskip5pt\par\noindent\llap{{\color{blue}\fangsong #1}}%
\marginpar{\strut}\hskip\parindent}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\large\bfseries}
\titleformat*{\subsubsection}{\normalsize\bfseries}
\titleformat*{\paragraph}{\normalsize\bfseries}
\titleformat*{\subparagraph}{\normalsize\bfseries}
\pretitle{\begin{center}\huge\bfseries}
\posttitle{\par\end{center}\vskip 1em}
\preauthor{\begin{center}
\large \lineskip 0.5em}
\postauthor{\par\end{center}}
\predate{\begin{center}\large}
\postdate{\par\end{center}}
\renewcommand{\tableofcontents}{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\section*{\hfill\contentsname\hfill}%
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\newcolumntype{C}[1]{>{\centering\let\newline\\%
\arraybackslash\hspace{0pt}}p{#1}}
\font\manfnt=manfnt
\newcommand*{\dangericon}{\manfnt\char127}
\newenvironment{note}
{\vskip1.5ex\par\noindent\llap{\dangericon\hskip2mm}\textbf{注意:}}
{\vskip1.5ex}
\newenvironment{syntax}
{\begin{center}}
{\end{center}}
\newenvironment{suggestion}
{\par\noindent\textbf{建议:}}{}
\setlist{%
topsep=0.3em, % 列表顶端的垂直空白
partopsep=0pt, % 列表环境前面紧接着一个空白行时其顶端的额外垂直空白
itemsep=0ex plus 0.1ex, % 列表项之间的额外垂直空白
parsep=0pt, % 列表项内的段落之间的垂直空白
leftmargin=1.5em, % 环境的左边界和列表之间的水平距离
rightmargin=0em, % 环境的右边界和列表之间的水平距离
labelsep=0.5em, % 包含标签的盒子与列表项的第一行文本之间的间隔
labelwidth=2em, % 包含标签的盒子的正常宽度;若实际宽度更宽,则使用实际宽度。
}
\setlist[itemize,1]{label=$\bullet$}
\setlist[itemize,2]{label=$\blacksquare$}
\setlist[itemize,3]{label=$\Diamondblack$}
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\geometry{headheight=2.6cm,headsep=3mm,footskip=13mm}
\geometry{top=3.5cm,bottom=3.5cm,left=3.2cm,right=3.2cm}
\newcommand*{\std}[1]{{\normalfont #1}}
%% \newcommand{\env}[1]{\texttt{#1}}
\makeatletter
\renewcommand*{\tableofcontents}{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\section*{\hfill\contentsname\hfill}%
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\addcontentsline{toc}{section}{\contentsname}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother
\IndexPrologue{\clearpage\section*{\hfill\indexname\hfill}%
\markboth{\indexname}{\indexname}%
\addcontentsline{toc}{section}{\indexname}%
斜体数字表示对应项的描述所在页面的页码, %
带下划线的数字表示对应项的定义所在的代码行号,%
其他数字表示对应项所被引用的代码行号。%
}
\setcounter{IndexColumns}{2}
\newcommand{\dashnumber}[2]%
{{#1}\kern.07em\rule[.5ex]{.4em}{.1ex}\kern.07em{#2}}
\endinput
%%
%% End of file `dtx-style.sty'.