Debian Codegraph @

texmf-dist/source/latex/cquthesis/cquthesis.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2016 by Zhennan Li <[email protected]>
4 %
5 % This file may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in:
9 %
10 % http://www.latex-project.org/lppl.txt
11 %
12 % and version 1.3 or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later.
14 %
15 % \fi
16 %
17 % \iffalse
18 %<*driver>
19 \ProvidesFile{cquthesis.dtx}[2020/06/23 v1.50 Chongqing University Thesis Template]
20 \documentclass{ltxdoc}
21 \usepackage{dtx-style}
22
23 \EnableCrossrefs
24 \CodelineIndex
25 \RecordChanges
26
27 \begin{document}
28 \DocInput{\jobname.dtx}
29 \end{document}
30 %</driver>
31 % \fi
32 %
33 % \CheckSum{1893}
34 %
35 % \CharacterTable
36 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
37 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
38 % Digits \0\1\2\3\4\5\6\7\8\9
39 % Exclamation \! Double quote \" Hash (number) \#
40 % Dollar \$ Percent \% Ampersand \&
41 % Acute accent \' Left paren \( Right paren \)
42 % Asterisk \* Plus \+ Comma \,
43 % Minus \- Point \. Solidus \/
44 % Colon \: Semicolon \; Less than \<
45 % Equals \= Greater than \> Question mark \?
46 % Commercial at \@ Left bracket \[ Backslash \\
47 % Right bracket \] Circumflex \^ Underscore \_
48 % Grave accent \` Left brace \{ Vertical bar \|
49 % Right brace \} Tilde \~}
50 %
51 % \DoNotIndex{\newenvironment,\@bsphack,\@empty,\@esphack,\sfcode}
52 % \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter}
53 % \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection}
54 % \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter}
55 % \DoNotIndex{\RequirePackage,\setcounter,\setlength,\string,\strut}
56 % \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage}
57 % \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\}
58 % \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
59 % \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand}
60 % \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect}
61 % \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize}
62 % \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny}
63 % \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty}
64 % \DoNotIndex{\textbf,\textit,\textsf,\textsc}
65 % \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad}
66 % \DoNotIndex{\centering,\raggedright,\ref}
67 % \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize}
68 % \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne}
69 % \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass}
70 % \DoNotIndex{\AtBeginDocument,\AtEndDocument}
71 %
72 % \GetFileInfo{\jobname.dtx}
73 %
74 % \changes{v0.0.1}{2016/04/03}{模板开始编写。}
75 % \changes{v0.6.9}{2016/05/09}{主体功能完工,迁移模板到生产环境中继续开发。}
76 % \changes{v0.7.5}{2016/05/10}{生产环境建立,模板完成测试。}
77 % \changes{v0.8.1}{2016/05/12}{重绘了论文封面,增加了专业硕士选项。}
78 % \changes{v0.8.5}{2016/05/13}{完成了示例文件。}
79 % \changes{v0.8.7}{2016/05/14}{上线前最后一批修正。}
80 % \changes{v0.8.9}{2016/05/15}{模板登陆Github,开始参与2016年重庆大学毕业设计工作。}
81 % \changes{v0.9.4}{2016/05/19}{用户文档撰写完成,CQUThesis提交至CTAN审核。}
82 % \changes{v0.9.7}{2016/06/09}{参与了2016年重庆大学毕业设计工作后,模板根据实际测试情况作了一番改进,Beta测试落下帷幕。}
83 % \changes{v0.9.7}{2016/06/09}{拆分了\file{cquthesis.sty}宏包,将其大部分内容并入\file{cquthesis.cls}和\file{cquthesis.cfg}。}
84 % \changes{v1.00}{2016/06/17}{最后一些小修补,今年的毕设工作完全结束了。目前本科方面的格式审查没有问题,研究生和博士生哪边还没有数据。}
85 % \changes{v1.00}{2016/06/17}{版本号格式从vX.Y.Z改为vX.YZ,更简洁一些。}
86 % \changes{v1.10}{2016/06/21}{增加了CQUThesis的开发工具Makefile和makewin.bat,现在它对\LaTeX 中高阶用户和开发者更加友好,文档也相应更新了。}
87 % \changes{v1.14}{2016/08/18}{改进了\file{makewin.bat},默认的thesis选项加入了自动判定,如果dtx没有解包,程序会自动解包。这也就是说,新手可以在几乎所有情况下放心地通过双击makewin.bat来完成编译了。}
88 % \changes{v1.20}{2017/05/30}{新增选项blankleft,可选目录和章节右开时空白的左页是否让页眉页脚空白。}
89 % \changes{v1.20}{2017/05/30}{调整了几个可选项的默认值,现在,openright默认开启。}
90 % \changes{v1.20}{2017/05/30}{新功能:盲审模式,由开关blindtrail和\cs{secretize}宏以及\env{secretizeEnv}环境构成。}
91 % \changes{v1.20}{2017/05/30}{再次改进了\file{makewin.bat},现在,Windows用户以管理员身份运行\file{makewin.bat}时不再会遭遇路径错误了。此外,\file{makewin.bat}有中英文两个版本了。}
92 % \changes{v1.30}{2018/02/23}{从\href{https://github.com/zepinglee/gbt7714-bibtex-style}{上游供应商zepinglee/gbt7714-bibtex-style}更新了\file{cqunumerical.bst}。}
93 % \changes{v1.40}{2019/10/12}{修复了\href{https://github.com/nanmu42/CQUThesis/issues/44}{Issue 44}。}
94 %
95 %
96 % \def\indexname{代码索引}
97 % \def\glossaryname{更新记录}
98 % \IndexPrologue{\section{\indexname}}
99 % \GlossaryPrologue{\section{\glossaryname}}
100 %
101 % \title{\bfseries\color{blue!50!black}\cquthesis:重庆大学毕业论文\LaTeX 模板}
102 % \author{{\fangsong 李振楠\footnote{\href{https://nanmu.me/zh-cn/about/}{中文页面},\href{https://nanmu.me/en/about}{About in English}}}\\[5pt]\texttt{[email protected]}}
103 % \date{\fileversion\ (\filedate)}
104 % \maketitle\thispagestyle{empty}
105 % \vspace{\stretch{1}}
106 % \begin{center}
107 % \includegraphics[height=7cm]{figures/CQUbadge}
108 % \end{center}
109 % \vspace{\stretch{2}}
110 % \begin{abstract}\noindent
111 % \cquthesis\footnote{\url{https://github.com/nanmu42/CQUThesis}}是重庆大学毕业论文的\LaTeX{}模板,支持学士(文学、理工)、硕士(学术、专业)、博士论文的排版。
112 % \end{abstract}
113 % \vspace{\stretch{1}}
114 % \def\abstractname{用户协议}
115 % \begin{abstract}\noindent
116 % \begin{enumerate}
117 % \item 本模板按照LaTeX Project Public License发布,协议版本号为1.3或以后的任何版本(随你意);
118 % \item 截止本文档编译时,重庆大学教务处和研究生院只提供了\href{https://github.com/nanmu42/CQUThesis/tree/master/toolkit}{毕业论文写作指南},没有提供官方模板,也没有授权或认证任何第三方模板为官方模板\footnote{\href{http://jq.qq.com/?_wv=1027&k=2HvYu95}{重庆大学\TeX 用户组}做过推动学校\href{https://github.com/CQUtug/TeXProposal}{认证\cquthesis}的努力。}。本模板是按照写作指南的参考实现,模板作者自当尽力,但不保证审查老师不提意见。在开始使用前,您同意,任何由于本模板而引起的论文格式审查问题与本模板作者无关。
119 % \end{enumerate}
120 % \vskip2cm
121 % \end{abstract}
122 %
123 %
124 % \clearpage
125 % \pagestyle{fancy}
126 % \begin{multicols}{2}[
127 % \setlength{\columnseprule}{.4pt}
128 % \setlength{\columnsep}{18pt}]
129 % \tableofcontents
130 % \end{multicols}
131 % \clearpage
132 %
133 % \section{欢迎!}
134 %\cquthesis{}是重庆大学毕业论文的\LaTeX{}模板,支持学士、硕士、博士论文的排版。合理使用本模板可以大大减轻重庆大学毕业生在毕业论文撰写过程中的排版工作量。
135 %
136 %\cquthesis{}根据重庆大学《重庆大学本科设计(论文)撰写规范化要求(2007年修订版)》和《重庆大学博士、硕士论文撰写格式标准(2007年修订版)》编写,力求合规,简洁,易于实现,用户友好。
137 %
138 % 本模板的特色:
139 %\begin{itemize}
140 % \item 支持重庆大学本科(文学、理工)、硕士(学术、专业)、博士的毕业论文格式;
141 % \item 内置封面、目录、索引、授权书等论文部件,可按需自动生成;
142 % \item 自动侦测文档页数,生成相应的单面打印/双面打印PDF文件;
143 % \item 预置一批优化过的宏包和小功能,包含中英双语题注及配套图录、表录,国际标准单位、化学式支持、三线表等,可按需开启;
144 % \item 支持基于cwl文件的代码补全,makefile功能能够在Linux, Mac, Windows三平台通用。
145 % \end{itemize}
146 %
147 % 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据第~\ref{sec:howtoask}节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代码的贡献。
148 %
149 % \note{模板的作用在于减少论文写作过程中格式调整的时间,前提是遵守模板的用法,否则即便用了\cquthesis 也难以保证输出的论文符合学校规范。}
150 %
151 % \section{安装}
152 % \label{sec:installation}
153 %
154 % \subsection{系统要求}
155 % \label{sec:sysrequire}
156 % 本模板用到的宏包比较多,这些包在常见的\TeX{}发行版中都有,按照您操作系统的不同,您可以选择不同的\TeX{}发行版:
157 % \begin{itemize}
158 % \item Windows用户,推荐使用Mik \TeX ,这是一个专为Windows环境设计的\TeX 发行版,下载体积小,而且可以自主解决宏包依赖问题;
159 % \item Linux和Mac用户,推荐使用\TeX Live,这是一套大而全的\TeX{}发行版,考虑到使用这两个系统的用户动手能力相对较强,\TeX Live没法自己解决依赖这个问题应该不是很让人头疼\footnote{使用宏包管理器或者从CTAN获取依赖宏包。}。
160 % \end{itemize}
161 %
162 % 本模板在Windows和Mac环境下的\TeX Live发行版中都进行了编译测试。
163 %
164 % \note{在条件允许的情况下,强烈推荐您使用\XeTeX 引擎进行编译工作。}
165 %
166 % \subsection{获取\cquthesis}
167 % 您可通过三个主要途径获取\cquthesis :
168 %
169 % \begin{itemize}
170 % \item 造访\cquthesis 的 \href{https://github.com/nanmu42/CQUThesis}{Github主页}下载最新的开发版本,这是更新最快,功能最全的版本(含工具箱Toolkit);
171 % \item 访问本模板\href{https://www.ctan.org/pkg/cquthesis}{CTAN官方镜像}下载发行版,这个版本定期从预发行版本同步(不含工具箱Toolkit\footnote{这是出于许可证方面的考虑。});
172 % \item 使用Mik \TeX 或\TeX Live的宏包管理功能直接获得本模板,这个方式不含模板示例文件。
173 % \end{itemize}
174 %
175 % 除此之外,\cquthesis{}不拥有也不维护任何其他镜像。
176 %
177 %
178 % \subsection{模板的组成部分}
179 % 下表列出了 \cquthesis{} 的主要文件及其功能介绍:
180 %
181 % \begin{longtable}{l|p{8cm}}
182 % \toprule
183 % {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule
184 % \endfirsthead
185 % \midrule
186 % {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule
187 % \endhead
188 % \endfoot
189 % \endlastfoot
190 % cquthesis.ins & \textsc{DocStrip} 驱动文件(用于安装或更新) \\
191 % cquthesis.dtx & \textsc{DocStrip} 源文件(用于安装或更新)\\
192 % makefile & GNU make配置文件(Mac和Linux)\\
193 % makewin.bat & Windows版make \\\midrule
194 % cquthesis.cls & \LaTeX 模板文件\\
195 % cquthesis.cfg & 模板配置文件\\
196 % cqunumerical.bst & 参考文献样式文件\\
197 % cquthesis.cwl & 代码着色和自动补全配置文件\\\midrule
198 % main.tex & 示例文档主文件\\
199 % contents/ & 示例文档章节具体内容\\
200 % figures/ & 示例文档图片路径\\
201 % ref/ & 示例文档参考文献目录\\
202 % toolkit/ & 额外的写作工具箱\\
203 % cquthesis.sty & 为示例文档加载其它宏包\\\midrule
204 % README-English & 英文安装提示,推荐中高阶用户阅读\\
205 % README.md & Readme\\
206 % \textbf{cquthesis.pdf} & 用户手册(本文档)\\\bottomrule
207 % \end{longtable}
208 %
209 % \note{\file{cquthesis.cls}和\file{cquthesis.cfg}以及\file{cqunumerical.bst}可以由\file{cquthesis.ins}和\file{cquthesis.dtx}生成,从\cquthesis { }v1.10之后,\file{cquthesis.cls}和\file{cquthesis.cfg}不再做预先提取,这个工作交给用户,整个过程很简单,请见\ref{sec:install}节。}
210 %
211 % \subsection{安装}
212 % \label{sec:install}
213 % 得益于GNU make和makewin.bat,\cquthesis 的安装十分便利。
214 % 下载\cquthesis{}的\file*{.zip}压缩包后请将整个文件夹解压出来,进入文件夹后:
215 % \begin{itemize}
216 % \item Windows用户可以直接双击运行\file{makewin.bat};
217 %
218 % \item Linux和Mac用户请在Bash窗口中进行如下操作:
219 %
220 % \begin{shell}
221 % cd cquthesis
222 % make thesis
223 % \end{shell}
224 %\end{itemize}
225 %
226 % 即可完成\cquthesis 的安装和示例文档的编译。
227 %
228 % \subsection{升级}
229 % \cquthesis 的升级很方便,下载最新的开发版,将zip文件中的\file{cquthesis.dtx} 和\file{cquthesis.ins} 覆盖掉工作文件夹中的相应文件后:
230 % \begin{itemize}
231 % \item Windows用户请在文件夹空白处{\heiti 按住Shift键再点击书鼠标右键},选择“在此处打开命令窗口”,运行下列命令:
232 %
233 % \begin{shell}
234 % makewin extract
235 % \end{shell}
236 %
237 % \item Linux和Mac用户请在Bash窗口中进行如下操作:
238 %
239 % \begin{shell}
240 % cd cquthesis
241 % make cls
242 % \end{shell}
243 %\end{itemize}
244 %
245 % 即可完成\cquthesis 的升级。
246 %
247 % \subsection{编译用户手册}
248 % 如果您需要编译用户手册,请定位到解压后的文件夹:
249 % \begin{itemize}
250 % \item Windows用户请在文件夹空白处{\heiti 按住Shift键再点击书鼠标右键},选择“在此处打开命令窗口”,运行下列命令:
251 %
252 % \begin{shell}
253 % makewin doc
254 % \end{shell}
255 %
256 % \item Linux和Mac用户请在Bash窗口中进行如下操作:
257 %
258 % \begin{shell}
259 % cd cquthesis
260 % make doc
261 % \end{shell}
262 %\end{itemize}
263 %
264 % \note{关于make命令和makewin命令的更多用法,请使用help命令进行查询,Windows用户请在命令行中运行makewin help,Linux和Mac用户请打开\file{Makefile}文件查看。}
265 % \section{使用说明}
266 % \label{sec:usage}
267 % 本手册假定用户已经能处理一般的 \LaTeX{} 文档,并对\BibTeX{} 有一定了解。如果从来没有接触过 \TeX 和 \LaTeX,建议先学习相关的基础知识。磨刀不误砍柴工!
268 %
269 % 对\LaTeX 还不熟悉的同学,推荐参考\href{http://bbs.ctex.org/forum.php?mod=viewthread&tid=68619}{《\LaTeX{}学习笔记》}。
270 %
271 %
272 % \subsection{代码自动补全}
273 % \cquthesis 为支持代码自动补全的\LaTeX 编辑器提供了代码补全配置文件\file{cquthesis.cwl}。如果您的编辑器有代码补全功能(如\TeX Studio),那么您可以将\file{cquthesis.cwl}放置在编辑器可以识别的位置,即可享受代码着色和代码自动补全带来的便利。
274 %
275 % 支持代码补全功能的编辑器有很多种,这里无法一一枚举,关于\file{cquthesis.cwl}的放置位置,请使用搜索引擎查找答案。推荐的关键词:“您的编辑器名称”+ cwl + location。
276 %
277 % 对于Windows平台的\TeX Studio用户,您可使用【Win+R】快捷键打开“运行”,在其中输入:
278 %
279 % \begin{shell}
280 % %APPDATA%\texstudio\completion\user
281 % \end{shell}
282 %
283 % 然后在打开的文件夹中放入\file{cquthesis.cwl},重启\TeX Studio即可。Linux和Mac的\TeX Studio用户可参照这个思路进行操作。
284 %
285 % \subsection{示例文件}
286 % \cquthesis 是一个功能高度专门化的文档类,没有示例文档的用户会发现很难下手。推荐新用户从模板自带的示例文档入手,里面包括了论文写作用到的所有命令及其使用方法,只需要用自己的内容进行相应替换就可以。对于不清楚的命令可以查阅本手册。下面的例子描述了模板中章节的组织形式,来自于示例文档,具体内容可以参考模板附带的 \file{main.tex} 和 \file{contents/}。
287 %
288 % 您可以在您熟悉的IDE(写作环境)中对\file{main.tex}进行编译,推荐使用\XeTeX 进行编译,一般来说,\LaTeX 的编译原则就是多次运行编译命令,直到不再出现警告。这里提供命令行编译方法供您参考:
289 %
290 % \begin{shell}
291 % # 示意:定位到文件夹
292 % cd cquthesis
293 % # 1.发现文件中的引用关系,文件后缀\textsf{.tex}可省略
294 % xelatex main
295 % # 2.编译参考文件源文件,生成\textsf{.bbl}文件
296 % bibtex main
297 % # 3.解决文件中的交叉引用
298 % xelatex main
299 % # 4.生成完整的pdf文件
300 % xelatex main
301 % # 5.更新目录
302 % xelatex main
303 % \end{shell}
304 %
305 % \note{实际情况中,您只需使用make或者makewin就可以自动完成以上所有工作\footnote{make和makewin调用latexmk来完成编译工作,比示意的编译命令更加灵活,能够自主确定必要的编译次数,可以明显缩短编译时间。}。}
306 %
307 % 下面是示例文件中主文件\file{main.tex}的内容:
308 %
309 % \lstinputlisting[style=lstStyleLaTeX]{main.tex}
310 %
311 % \subsection{论文选项}
312 % \DescribeOption{type=}
313 % 选择论文类型,必须项,当前支持:\option{bachelor},\option{master},\option{doctor}。如:
314 % \begin{latex}
315 % % 博士论文
316 % \documentclass[type=doctor,]{cquthesis}
317 %
318 % % 硕士论文
319 % \documentclass[type=master,]{cquthesis}
320 % \end{latex}
321 %
322 % \DescribeOption{liberalformat}
323 % 本科生可选,开启后将使用文学类标题格式,使用中文数字对各级标题进行计数,本选项默认关闭。
324 %
325 % \note{以下所有可选项在不使用时自动取默认值。}
326 %
327 % \DescribeOption{proffesionalmaster=}
328 % 研究生可选,值为\textsf{true}时按专业硕士要求排版(影响封面),值为\textsf{false}时按学术硕士要求排版,默认值为\textsf{false},例如:
329 % \begin{latex}
330 % % 学术硕士论文
331 % \documentclass[type=master,proffesionalmaster=false,]{cquthesis}
332 % % 上面相当于:
333 % \documentclass[type=master,]{cquthesis}
334 %
335 % % 专业硕士论文
336 % \documentclass[type=master,proffesionalmaster=true,]{cquthesis}
337 % \end{latex}
338 % \DescribeOption{printmode=}
339 % 可选项,确定单双页打印模式,有三个值可用,默认采用自动判定(auto):
340 % \begin{description}
341 % \item[\option{auto}] 模板会按照学校要求和论文类型自动判定打印模式;
342 % \item[\option{oneside}] 强制以单页模式打印,适合最后提交电子版时;
343 % \item[\option{twoside}] 强制以双页模式打印。
344 % \end{description}
345 %
346 % \DescribeOption{bilinguallist=}
347 % 从版本v1.12开始,\cquthesis 开始支持图、表、公式的中英双语题注。除此之外,就像您期待的那样,表录、图录、公式目录页有了自己的英文版本,它们全部按双语题注的内容自动生成。这是一个可选项,有三个值可用:
348 % \begin{description}
349 % \item[\option{off}] 缺省默认,模板不会生成表录、图录、公式目录的英文版本;
350 % \item[\option{combined}] 模板会生成表录、图录、公式目录的英文版本,它们会在中文版本中逐条嵌入;
351 % \item[\option{apart}] 模板会生成表录、图录、公式目录的英文版本,它们独立于中文版本,与其一同输出。
352 % \end{description}
353 %
354 % 有关双语题注的用法和英文版本表录等文档部件的位置调整方式,请参阅第\ref{sec:bicaptions}节。
355 %
356 % \note{以上三个选项仅与表录、图录、公式目录相关,不会影响双语题注的功能。}
357 %
358 % \DescribeOption{openany}
359 % \DescribeOption{openright}
360 % 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{openright},在这种情况下,如果前一章的最后一页也是奇数,那么模板会自动生成一个空白页以保证新章节右开。这个选项适合页数较多的论文,您可根据实际情况和个人喜好选择是否开启。默认值\option{openright},本选项在单页打印时自动失效。
361 %
362 % \DescribeOption{blankleft}
363 % 开启此项,并且在 \option{openright}开启的情况下,模板生成的空白页纯粹空白,不含页眉页脚,本选项默认关闭。
364 %
365 % \DescribeOption{seriftoc}
366 % 开启此项,目录中的不同级别会采用不同的字号和字体,这是按照学校word样例的实现。但是,蹊跷的是,样例里的这些做法在官方文件里却没有体现,而且一二级标题字号差别太大,个人观点有碍美观,所以这里列为可选项,适用于三级标题很多的情况。本选项默认关闭。
367 %
368 % \DescribeOption{continuoustoc}
369 % 使用后论文的目录和索引不会自动开启新页,转而以连续的形式编排,这个选项适合索引内容较少但又想使用索引的用户。在开启后,您可能需要在\file{main.tex}中使用\cs{clearpage}来对索引部分进行手动分页。本选项默认关闭。
370 %
371 % \DescribeOption{abstractopenright}
372 % 开启此项,双页打印模式时中英文摘要右开,这算是开发中的一个彩蛋。本选项默认关闭。
373 %
374 % \DescribeOption{blindtrail}
375 % 盲审模式开关,盲审模式由宏\cs{secretize}和环境\env{secretizeEnv}构成,在盲审模式开启时:
376 % \begin{itemize}
377 % \item 宏\cs{secretize}内的内容会被三个星号***替代;
378 % \item 环境\env{secretizeEnv}的内容会输出为一片空白。
379 % \end{itemize}
380 % \cquthesis 默认为封面作者及导师姓名配置宏\cs{secretize},为致谢的内容部分配置环境\env{secretize},如果您有更多需求,可以自行配置。
381 %
382 % \DescribeOption{draft}
383 % 草稿模式,推荐在写作时开启。这个模式下,\LaTeX 不会加载图片,不会渲染文档内超链接,部分宏包会跳过一些工作以降低编译难度,结合\cs{includeonly}命令可以大大提高预览速度,例如:
384 %
385 % \begin{latex}
386 % % 这是代码片段
387 % \includeonly{contents/experiment,contents/analysis,}
388 % \include{contents/intrduction}
389 % \include{contents/experiment}
390 % \include{contents/analysis}
391 % \include{contents/conclusion}
392 % \end{latex}
393 %
394 % 此时\LaTeX 只会渲染\file*{contents/experiment}和\file*{contents/analysis},从而加速预览。
395 % \subsection{中文字体}
396 % \label{sec:chinese-fonts}
397 %
398 % \subsubsection{字体配置}
399 % \label{sec:font-config}
400 % 正确配置中文字体是使用模板的第一步。模板调用 \CTeX 宏包,提供如下字体使用方式:
401 % \begin{itemize}
402 % \item 基于传统 \pkg{CJK} 包,使用 \LaTeX、Pdf\LaTeX\ 编译。
403 % \item 基于 \pkg{xeCJK} 包,使用 \XeLaTeX\ 编译。(推荐方法)
404 % \end{itemize}
405 %
406 % 模板默认使用 \CTeX 的字体配置。关于中文字体安装、配置的所有问题不在本模板讨论范围。
407 %
408 % \subsubsection{字体命令}
409 % \label{sec:fontcmds}
410 % \myentry{字体}
411 % \DescribeMacro{\songti}
412 % \DescribeMacro{\fangsong}
413 % \DescribeMacro{\heiti}
414 % \DescribeMacro{\kaishu}
415 % 用来切换宋体、仿宋、黑体、楷体四种基本字体。
416 %
417 % \begin{latex}
418 % {\songti 爆竹声中一岁除,春风送暖入屠苏。}
419 % {\fangsong 家家乞巧望秋月,穿尽红丝几万条。}
420 % {\heiti 黄沙百战穿金甲,不破楼兰终不还。}
421 % {\kaishu 君不见走马川行雪海边,平沙莽莽黄入天。}
422 % \end{latex}
423 %
424 % 效果如下:
425 %
426 % {\songti 爆竹声中一岁除,春风送暖入屠苏。}\space
427 % {\fangsong 家家乞巧望秋月,穿尽红丝几万条。}
428 %
429 % {\heiti 黄沙百战穿金甲,不破楼兰终不还。}\space
430 % {\kaishu 君不见走马川行雪海边,平沙莽莽黄入天。}
431 %
432 % \DescribeMacro{\zihao}
433 % \cquthesis 使用\CTeX 的原生字体命令,使用中文字号:
434 % \begin{latex}
435 % \zihao{-4} % 后文使用小四号
436 % {\zihao{2} 使用二号字的段落} % 大括号外又回到小四号
437 % \end{latex}
438 %
439 % \subsection{封面信息和摘要}
440 % \label{sec:titlepage}
441 % \subsubsection{设置方法}
442 % 封面信息提供两种配置方法:一是通过统一设置命令\cs{cqusetup} 通过\emph{key=value}形式完成;二是每个信息利用命令独立设置,其中命令的名字跟 \emph{key} 相同。两种方式可以交叉使用,并按顺序执行(即对同一项,后来的设置会覆盖前面的)。以 \texttt{c} 开头的命令跟中文相关,\texttt{e} 开头则为对应的英文。
443 %
444 % \DescribeMacro{\cqusetup}
445 % \cs{cqusetup} 用法与常见 \emph{key=value}命令相同,如下:
446 % \begin{latex}
447 % \cqusetup{
448 % key1 = value1,
449 % key2 = {a value, with comma},
450 % }
451 % % 可以多次调用
452 % \cqusetup{
453 % key3 = value3,
454 % key1 = anothervalue, % 覆盖 value1
455 % }
456 % \end{latex}
457 %
458 % \note{\cs{cqusetup} 使用 \pkg{kvoptions} 机制,所以配置项之间不能有空行,否则会报错。}
459 %
460 % 大多数命令的使用方法都是: \cs{command}\marg{arg},例外者将具体指出。这些命令都在示例文档的 \file{contents/cover.tex} 中。
461 %
462 % \subsubsection{文章标题}
463 % \DescribeMacro{\ctitle}
464 % \DescribeMacro{\etitle}
465 % 设置论文的中文标题和英文标题,标题中可以使用两个右斜杠进行手动换行。
466 % \begin{latex}
467 % \ctitle{论文标题//这是标题的第二行//第三行//最好别有第四行}
468 % \etitle{Title in English// the 2nd line}
469 % % 以上命令和以下命令等价:
470 % \cqusetup{
471 % ctitle={论文中文题目},
472 % etitle={Thesis English Title},
473 % }
474 % \end{latex}
475 %
476 % \note{下文描述的所有命令都有和自己等价的\cs{cqusetup}形式,请留意。}
477 %
478 % \subsubsection{个人信息}
479 %
480 % \DescribeMacro{\cauthor}
481 % \DescribeMacro{\eauthor}
482 % 作者信息,其中英文信息使用拼音书写。
483 %
484 % \DescribeMacro{\csupervisor}
485 % \DescribeMacro{\esupervisor}
486 % 导师的中英文信息,填写范例:
487 % \begin{latex}
488 % \cqusetup{
489 % csupervisor = {匡振义~~教授}, % 使用连字符来进行不会断行的空格
490 % esupervisor = {Prof. Zhenyi Kuang},
491 % }%
492 % \end{latex}
493 %
494 % \DescribeMacro{\cpsupervisor}
495 % \DescribeMacro{\epsupervisor}
496 % 仅专硕填写,兼职导师姓名和拼音。
497 %
498 % \note{在\file{cover.tex}中自己用不上的字段可以坐视不理、注释、删除(随你意)。模板在v 0.9.7 版本后更新了运作机制,\textbf{不再需要}主动注释掉不需要的字段以获得正确的封面排版。}
499 %
500 % \DescribeMacro{\cassistsupervisor}
501 % \DescribeMacro{\cextrasupervisor}
502 % \DescribeMacro{\eassistsupervisor}
503 % 本科毕业设计中,有的同学会有助理指导老师或者在校外进行毕业设计(常见于保研的同学),这时需要在论文封面上标注自己的“助理指导教师”或“校外指导教师”。在使用时需要注意:1.这三个字段中,不使用的项目要求留空为正反大括号;2.“助理指导教师”和“校外指导教师”的英文都填写在\cs{eassistsupervisor}中,如果两类指导老师同时存在(这个情况太少了),可以使用正反大括号括起,括号内以逗号分隔。
504 %
505 % \note{这是v 1.14 版本中的新增功能。}
506 %
507 % \DescribeMacro{\cmajor}
508 % \DescribeMacro{\emajor}
509 % 填写自己的专业名称,专硕不用这个字段。在专业名称太长的时候封面可能会不够美观,这时可以使用\cs{zihao}来调整这一个字段的字号大小。详情请见\file{cover.tex}。
510 %
511 % \subsubsection{成文日期}
512 %
513 % \DescribeMacro{\mycdate}
514 % \DescribeMacro{\myedate}
515 % 自行指定封面的中英文成文日期。
516 %
517 % 默认情况下,封面底部的中英文成文日期自动生成,如果您需要自行指定成文日期,请取消\file{cover.tex}中\cs{mycdate}和\cs{myedate}的注释,按参考格式填入日期。
518 %
519 % \subsubsection{关键词和摘要}
520 % \myentry{关键词}
521 % \DescribeMacro{\ckeywords}
522 % \DescribeMacro{\ekeywords}
523 % 关键词用英文逗号分割写入相应的命令中,模板会解析各关键词并生成符合不同论文格式。
524 % 要求的关键词格式。
525 %
526 % \begin{latex}
527 % \cqusetup{
528 % ckeywords={关键词 1, 关键词 2},
529 % ekeywords={keyword 1, keyword 2}
530 % }
531 % % 等价:
532 % \ckeywords{关键词 1, 关键词 2}
533 % \ekeywords{keyword 1, keyword 2}
534 % \end{latex}
535 %
536 % \myentry{摘要}
537 % \DescribeEnv{cabstract}
538 % \DescribeEnv{eabstract}
539 % 摘要只能使用环境命令来设置,不支持\cs{cqusetup}。
540 %
541 % \begin{latex}
542 % \begin{cabstract}
543 % 摘要请写在这里…
544 % \end{cabstract}
545 %
546 % \begin{eabstract}
547 % Here comes the abstract in English...
548 % \end{eabstract}
549 % \end{latex}
550 %
551 % \subsection{前置部分}
552 %
553 % 以下内容对应\file{main.tex}中的内容。
554 % \subsubsection{封面}
555 % \DescribeMacro{\makecover}
556 % 生成封面,包含中英文封面。
557 %
558 % \myentry{开启前置部分}
559 % \DescribeMacro{\frontmatter}
560 % 前置部分标识符,其后的命令将被模板认作属于前置部分。前置部分包含封面后到绪论前的内容。
561 %
562 % \DescribeMacro{\makeabstract}
563 % 生成中英文摘要。
564 %
565 % \subsubsection{目录和索引表}
566 % 目录、插图、表格和公式等索引命令分别如下,将其插入到期望的位置即可:
567 %
568 % \DescribeMacro{\tableofcontents}
569 % \DescribeMacro{\listoffigures}
570 % \DescribeMacro{\listoftables}
571 % \DescribeMacro{\listofequations}
572 % \begin{longtable}{ll}
573 % \toprule
574 % {\heiti 用途} & {\heiti 命令} \\
575 % \midrule
576 % 目录 & \cs{tableofcontents} \\
577 % 插图索引 & \cs{listoffigures} \\
578 % 表格索引 & \cs{listoftables} \\
579 % 公式索引 & \cs{listofequations} \\
580 % \bottomrule
581 % \end{longtable}
582 %
583 % \LaTeX{} 默认支持插图和表格索引,是通过 \cs{caption} 命令完成的,因此它们必须出现在浮动环境中,否则不被计数。
584 %
585 % \subsubsection{符号对照表}
586 % \DescribeEnv{denotation}
587 % 主要符号表环境,跟 \env{description} 类似,使用方法参见示例文件。带两个个可选参数,用来指定列表左侧缩进和列表左右距离。(全去掉时默认:20mm,30mm)
588 % \begin{latex}
589 % \begin{denotation}
590 % \item[E] 能量
591 % \item[m] 质量
592 % \item[c] 光速
593 % \end{denotation}
594 % \end{latex}
595 %
596 % 如果默认符号列的宽度不满意,可以通过参数来调整:
597 % \begin{latex}
598 % \begin{denotation}[10mm][40mm] % 左侧缩进10mm,左右距离40mm
599 % \item[E] 能量
600 % \item[m] 质量
601 % \item[c] 光速
602 % \end{denotation}
603 % \end{latex}
604 %
605 % \subsection{主体部分}
606 %
607 % \myentry{开启主体部分}
608 % \DescribeMacro{\mainmatter}
609 % 主体部分标识符,其后的命令将被模板认作属于主体部分。主体部分包含从绪论到结论的所有内容。
610 %
611 % \DescribeMacro{\include}
612 % 使用该命令从\file{contents/}中导入子文件,配合\cs{includeonly}\marg{子文件名}命令可加速预览。
613 %
614 % \subsection{后置部分}
615 %
616 % \myentry{开启后置部分}
617 % \DescribeMacro{\backmatter}
618 % 后置部分标识符,其后的命令将被模板认作属于后置部分。后置部分包含从致谢开始的所有内容。
619 %
620 % \myentry{致谢}
621 % 致谢部分使用普通的\cs{chapter}命令创建即可。
622 %
623 % \DescribeMacro{\bibliographystyle}
624 % \DescribeMacro{\bibliography}
625 % 定义参考文献样式,指定参考文献源。
626 %
627 % 其中参考文献的\textsf{.bib文件}推荐使用\textsf{Jabref}来进行处理。
628 %
629 % \note{如果您的文献资料来源于Web of Science一类的数据库导出,那么您很可能需要使用\textsf{Jabref}一类的文献bib数据管理工具对数据进行清理,以去除每个字段外围的双层花括号(目前已知DOI字段的双层括号会使得参考文献列表出现格式问题)。清理过程是自动而无害的。}
630 %
631 %
632 % \DescribeMacro{\cquauthpage}
633 % 生成原创说明和授权书,这个命令可以带一个\oarg{PDF文件地址}作为参数。这样,在您和您的导师签名之后,您可以单独扫描一下签过名的原创说明和授权书,以\cs{cquauthpage}\oarg{pdf文件地址}的形式将扫描页放入论文的PDF文件中的对应位置。
634 %
635 % \subsection{宏包和特色功能}
636 % \subsubsection{双语题注}
637 % \label{sec:bicaptions}
638 % \DescribeMacro{\bicaption}
639 % 在学校的相关格式文件中,硕士生和博士生的表格和插图的题注需要中英对照,使用\cs{bicaption}\marg{中文题注}\marg{英文题注}命令代替\cs{caption}即可解决这个问题,示例如下:
640 %
641 % \begin{latex}
642 % \begin{figure}[tbh]
643 % \centering
644 % \includegraphics[width=0.7\linewidth]{figures/TEST}
645 % \bicaption{这是一张测试用图片}{This figure is for test only}
646 % \label{fig:cqubadge}
647 % \end{figure}
648 % \end{latex}
649 %
650 % 在题注很长的时候,为了防止题注对应的表录(或图录)的条目太长,可使用\cs{bicaption}\oarg{短中文}\marg{中文题注}\oarg{短英文}\marg{英文题注}来解决这个问题:
651 % \begin{latex}
652 % \begin{tabularx}{cc}
653 % \bicaption[这是表录中的段条目]{这是一个很长很长很长的中文题注,你可以写很多行}%
654 % [This is a really short one.]{Linebreak is for demostration only. It's okay to go without it.}
655 % \label{fig:cqubadge}
656 % 我 & 在\\
657 % 测 & 试\\
658 % \end{tabularx}
659 % \end{latex}
660 % \DescribeMacro{\eqlist}
661 % 重要算式列表\cs{eqlist}和\cs{listeq}命令从v1.12版本后也支持中英双语,用法是\cs{eqlist}\marg{中文}\oarg{英文},请注意括号。
662 %
663 % 上面的这些用法都在\cquthesis 的示例文件中有所体现,供您参考。
664 %
665 % \note{英文版本的重要算式列表需要在\option{bilinguallist=}\option{combined}或者\option{apart}时才会生效。另外,当且仅当在\option{bilinguallist=}\option{apart}时,\file{main.tex}中的\cs{listoffiguresEN},\cs{listoftablesEN}和\cs{listofequationsEN}才会发挥作用,此时您可以通过调整这些命令的位置来调整图录、表录、方程式列表各自之间以及中英文版本之间的顺序。}
666 % \subsubsection{数学环境}
667 % \label{sec:math}
668 % \cquthesis{} 定义了常用的数学环境:
669 %
670 % \begin{center}
671 % \begin{tabular}{*{7}{l}}\toprule
672 % axiom & theorem & definition & proposition & lemma & conjecture &\\
673 % 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\midrule
674 % proof & corollary & example & exercise & assumption & remark & problem \\
675 % 证明 & 推论 & 例子& 练习 & 假设 & 注释 & 问题\\\bottomrule
676 % \end{tabular}
677 % \end{center}
678 %
679 % 比如:
680 % \begin{latex}
681 % \begin{definition}
682 % 道千乘之国,敬事而信,节用而爱人,使民以时。
683 % \end{definition}
684 % \end{latex}
685 % 产生(自动编号):
686 % \medskip
687 %
688 % \noindent\framebox[\linewidth][l]{{\heiti 定义~1.1~~~} % {道千乘之国,敬事而信,节用而爱人,使民以时。}}
689 %
690 % \smallskip
691 % 列举出来的数学环境毕竟是有限的,如果想用\emph{胡说}这样的数学环境,那么可以定义:
692 % \begin{latex}
693 % \newtheorem{nonsense}{胡说}[chapter]
694 % \end{latex}
695 %
696 % 然后这样使用:
697 % \begin{latex}
698 % \begin{nonsense}
699 % 契丹武士要来中原夺武林秘笈。—— 慕容博
700 % \end{nonsense}
701 % \end{latex}
702 % 产生(自动编号):
703 %
704 % \medskip
705 % \noindent\framebox[\linewidth][l]{{\heiti 胡说~1.1~~~} % {契丹武士要来中原夺武林秘笈。—— 慕容博}}
706 %
707 % \subsubsection{引用方式}
708 %
709 % \DescribeMacro{\inlinecite}
710 % \DescribeMacro{\onlinecite}
711 % 参考文献引用有两种模式:(1)上标模式。比如``同样的工作有多$^{[1,2]}$\ldots''。(2)正文模式。比如``文[3]中详细说明了\ldots''。其中上标模式使用远比正文模式频繁,所以为了符合使用习惯,上标模式仍然用常规的\cs{cite}\marg{key},而\cs{inlinecite}\marg{key} 则用来生成正文模式。
712 %
713 % 出于易用性考虑,\cs{onlinecite}被安排为\cs{inlinecite}的别名,两者的作用完全一致,可相互替换。
714 %
715 % \subsubsection{自动编号}
716 %
717 % \DescribeMacro{\xuhao}
718 % \DescribeMacro{\xuhaotype}
719 % \DescribeMacro{\resetxuhao}
720 % \DescribeMacro{\xuhaoseparator}
721 % \DescribeMacro{\rownum}
722 % \DescribeMacro{\rownumtype}
723 % \DescribeMacro{\resetrownum}
724 % \DescribeMacro{\rownumseparator}
725 % \cs{xuhao}命令用来解决表格序号列手动编号的烦恼,这个命令也可以用在行内列表等场景,其中:
726 %\begin{itemize}
727 % \item \cs{xuhao}\oarg{1}用于将计数器设置为1,并输出1;
728 % \item \cs{xuhao}不带参数时每次使用将计数器加1,并输出这个值;
729 % \item \cs{xuhaotype}\oarg{1-6}可设置\cs{xuhao}的输出类型,1--6分别为阿拉伯数字、大写字母、小写字母、大写罗马数字、小写罗马数字、带圈数字(这一项仅支持1--10的数)
730 % \item \cs{resetxuhao}用于重置计数器为1,但不作输出;
731 % \item \cs{xuhaoseparator}用于定义每个序号之后的分割符,默认为空,您可以使用\cs{renewcommand}来更新其定义。
732 %\end{itemize}
733 %
734 % \begin{latex}
735 % \xuhaotype[3]
736 % \renewcommand{\xuhaoseparator}{.}
737 % \xuhao[1] \xuhao \xuhao \xuhao[1] \xuhao \xuhao \xuhao \xuhao
738 % % 输出为:a. b. c. a. b. c. d. e.
739 % \end{latex}
740 %
741 % \note{考虑到不同用户的语言习惯,\cs{rownum}, \cs{rownumtype}, \cs{resetrownum}分别是\cs{xuhao}, \cs{xuhaotype}, \cs{resetxuhao}的别名,可以相互替换。}
742 %
743 % 向前兼容:老旧命令\cs{setxuhao}和\cs{xuhaotype}的作用相同。
744 %
745 % \subsubsection{表格命令}
746 % 在表格中,\cs{bigcell}内的内容可以自主换行;\cs{headcell}括起的内容会在单元格中居中和加黑;\cs{colsep}用来设定列间距,默认值为12pt,这个命令在表格开始绘制之前有效。
747 %
748 % 使用范例请参阅示例文档的附录部分。
749 %
750 % 本模板已经自动载入了许多表格相关的宏包:
751 % \begin{itemize}
752 % \item 如果您是熟练的\LaTeX 用户,\pkg{array}, \pkg{tabularx}, \pkg{booktabs}, \pkg{longtable}, \pkg{multirow}和\pkg{diagbox}会是您得力的助手,其中,\pkg{tabularx}和\pkg{longtable}的字号已经预先适配为五号字;
753 % \item \cquthesis 还预先载入了\pkg{tabu}宏包,如果您熟悉这个宏包,或者愿意负担一些学习成本,那么\pkg{tabu}宏包的强大功能会让您满意。
754 % \end{itemize}
755 %
756 % \subsection{其他说明}
757 % 本文档的最后一节有宏索引,对中阶及以上用户或许会有帮助。
758 %
759 % \subsection{提问和新功能需求}\label{sec:howtoask}
760 % 遇到难以解决的问题了?欢迎您向我反馈,您可以:
761 % \begin{itemize}
762 % \item 在Github上\href{https://github.com/nanmu42/cquthesis/issues}{提交Issue};
763 % \item 加入\href{http://jq.qq.com/?_wv=1027&k=2HvYu95}{重庆大学\TeX 用户组}进行讨论\footnote{即使您不是重庆大学的学子,只要您对\TeX 足够热爱并且为人友善,我们也会热诚地欢迎您。}。
764 %\end{itemize}
765 %
766 % 大家的反馈为模板提高带来机会。
767 % \section{致谢}
768 % 这个模板是站在巨人肩膀上的成果,感谢\LaTeXe{}计划,感谢CTeX开发组提供的中文解决方案,感谢薛瑞尼副教授(Github: xueruini/ThuThesis),感谢WeiJianWen同学(Github: weijianwen/SJTUThesis),感谢中国科学技术大学TeX用户组(Github: ustctug/gbt-7714-2015)。向你们致以真诚的问候和感激!
769 %
770 % 世界因你们更美好。
771 %
772 % \StopEventually{\PrintChanges\PrintIndex}
773 % \clearpage
774 % \section{实现细节}
775 % 下面这些内容面向\LaTeX 宏包开发者或者对\cquthesis 开发感兴趣的用户,如果您有任何意见或建议或想法,都欢迎到Github\href{https://github.com/nanmu42/cquthesis/issues}{提交Issue}。您对模板开发或者本文档的撰写的任何贡献都会受到诚挚欢迎!
776 % \subsection{模板信息}
777 % \begin{macrocode}
778 %<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
779 %<cls>\ProvidesClass{cquthesis}
780 %<cfg>\ProvidesFile{cquthesis.cfg}
781 %<cls|cfg>[2019/10/12 v1.40 Chongqing University Thesis Template]
782 % \end{macrocode}
783 % 定义一些开发常量:
784 % \begin{macrocode}
785 %<*cls>
786 \hyphenation{Cqu-Thesis}
787 \newcommand{\cquthesis}{\textsc{CquThesis}}
788 \def\version{1.30}
789 %</cls>
790 % \end{macrocode}
791 % \file{cquthesis.cfg}中,涉及文档部件的部分常量:
792 % \changes{v0.9.0}{2016/05/16}{把目录加入到了PDF书签中。}
793 % \begin{macrocode}
794 %<*cfg>
795 \def\cqueqshortname {式}
796 \def\cqu@denotation@name {主要符号对照表}
797 \def\shorttablename {表}
798 \def\shorttablenameEN {Table}
799 \def\shortfigurename {图}
800 \def\shortfigurenameEN {Fig.}
801 \def\listofequationsname {重要算式索引}
802 \def\listofequationsnameEN {\textbf{List of Equations}}
803 \def\listoffiguresnameEN {\textbf{List of Figures}}
804 \def\listoftablesnameEN {\textbf{List of Tables}}
805 \def\cqu@bib@name {参考文献}
806 \def\cqu@tocnameinbkmark {目{ }录}
807 \newcommand{\parenthesesthis}[1]{(#1)}
808 %</cfg>
809 % \end{macrocode}
810 % \subsection{选项的定义和处理}
811 % 使用Key=Value方式进行选项设置,定义前缀和族。
812 % \begin{macrocode}
813 %<*cls>
814 \RequirePackage{kvoptions}
815 \SetupKeyvalOptions{
816 family=cqu,
817 prefix=cqu@,
818 setkeys=\kvsetkeys}
819 % \end{macrocode}
820 % 定义用户类型
821 % \begin{macrocode}
822 \newif\ifcqu@bachelor
823 \newif\ifcqu@master
824 \newif\ifcqu@doctor
825 \cqu@bachelorfalse\cqu@masterfalse\cqu@doctorfalse
826 \define@key{cqu}{type}{%
827 \expandafter\csname cqu@#1true\endcsname}
828 % \end{macrocode}
829 % 定义是否使用本科文学类论文标题格式
830 % \begin{macrocode}
831 \DeclareBoolOption{liberalformat}
832 % \end{macrocode}
833 % 专业硕士标记
834 % \begin{macrocode}
835 \DeclareBoolOption[true]{academic}
836 \DeclareComplementaryOption{proffesionalmaster}{academic}
837 % \end{macrocode}
838 % 每个章首页是否右开
839 % \begin{macrocode}
840 \DeclareBoolOption[false]{openany}
841 \DeclareComplementaryOption{openright}{openany}
842 % \end{macrocode}
843 % 右开时空白的左页是否让页眉页脚空白
844 % \begin{macrocode}
845 \DeclareBoolOption[false]{blankleft}
846 % \end{macrocode}
847 % 双页模式下英文摘要页右开
848 % \begin{macrocode}
849 \DeclareBoolOption[false]{abstractopenright}
850 % \end{macrocode}
851 % 盲审模式开关
852 % \begin{macrocode}
853 \DeclareBoolOption[false]{blindtrail}
854 % \end{macrocode}
855 % 论文是单面打印还是双面打印(默认:自动,手动模式一般不用)
856 % \begin{macrocode}
857 \newif\if@onesideprint
858 \newif\if@twosideprint
859 \newif\if@autoprint
860 \@onesideprintfalse\@twosideprintfalse\@autoprintfalse
861 \define@key{cqu}{printmode}{%
862 \expandafter\csname @#1printtrue\endcsname}
863 % \end{macrocode}
864 % 论文是否保密(默认:关),尚未支持,在计划中
865 % \begin{macrocode}
866 \DeclareBoolOption[false]{secret}
867 % \end{macrocode}
868 % 目录中的不同级别采用不同的字号和字体,适用于三级标题很多的情况
869 % \begin{macrocode}
870 \DeclareBoolOption[false]{seriftoc}
871 % \end{macrocode}
872 % 目录和索引不会自动新开一页,适用于索引内容较少时
873 % \begin{macrocode}
874 \DeclareBoolOption{continuoustoc}
875 % \end{macrocode}
876 % 双语图录、表录、公式列表开关
877 % \begin{macrocode}
878 \newif\if@bioff
879 \newif\if@bicombined
880 \newif\if@biapart
881 \@biofffalse\@bicombinedfalse\@biapartfalse
882 \define@key{cqu}{bilinguallist}{%
883 \@biofffalse\@bicombinedfalse\@biapartfalse
884 \expandafter\csname @bi#1true\endcsname}
885 % \end{macrocode}
886 % 传递选项给CTeXBook
887 % \begin{macrocode}
888 \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
889 % \end{macrocode}
890 % 打开默认选项,处理选项
891 % \begin{macrocode}
892 \kvsetkeys{cqu}{}
893 \ProcessKeyvalOptions*
894 \PassOptionsToPackage{no-math}{fontspec}
895 % \end{macrocode}
896 % 为CTeXBook定义选项,使用CTeX原生的的Openright和Openany解决方案:
897 % \begin{macrocode}
898 \ifcqu@openany
899 \LoadClass[openany,a4paper,oneside,UTF8,zihao=-4,scheme=plain,linespread=1.39,space=auto]{ctexbook}
900 \else
901 \LoadClass[openright,a4paper,oneside,UTF8,zihao=-4,scheme=plain,linespread=1.39,space=auto]{ctexbook}
902 \fi
903 % \end{macrocode}
904 % 用户必须提供用户类型:
905 % \begin{macrocode}
906 \ifcqu@bachelor\relax\else
907 \ifcqu@master\relax\else
908 \ifcqu@doctor\relax\else
909 \ClassError{cquthesis}%
910 {Specified thesis type is obligatory: \MessageBreak
911 type=[bachelor|master|doctor]}{}
912 \fi
913 \fi
914 \fi
915 % \end{macrocode}
916 % 如果没有指定合适的打印方式则缺省使用自动模式
917 % \begin{macrocode}
918 \if@autoprint\relax\else
919 \if@onesideprint\relax\else
920 \if@twosideprint\relax\else
921 \ClassWarning{cquthesis}%
922 {Unexpected or missing print mode, processing with AUTO: \MessageBreak
923 printmode=[oneside|twoside|auto]}{}
924 \@autoprinttrue
925 \fi
926 \fi
927 \fi
928 % \end{macrocode}
929 % 如果没有正确指定图录表录的双语模式,取默认值off:
930 % \begin{macrocode}
931 \if@bioff\relax\else
932 \if@bicombined\relax\else
933 \if@biapart\relax\else
934 \kvsetkeys{cqu}{bilinguallist=off,}
935 \ClassWarning{cquthesis}%
936 {Unexpected or missing bilingual list mode, processing with OFF: \MessageBreak
937 bilinguallist=[off|combined|apart]}{}
938 \fi
939 \fi
940 \fi
941 % \end{macrocode}
942 % \subsection{载入宏包}
943 %
944 % 使用成熟的宏包而不是自己造轮子几乎总是一个不错的选择,\LaTeX 的强大之处就在这诸多宏包。
945 %
946 % 这几个宏包用于提升\LaTeXe 的命令定义和命令处理性能
947 % \begin{macrocode}
948 \RequirePackage{etoolbox}
949 \RequirePackage{xparse}
950 \RequirePackage{environ}
951 \RequirePackage{calc}
952 \RequirePackage{ifxetex}
953 % \end{macrocode}
954 %
955 % 数学是\LaTeX 关心的大问题,这里先引入\pkg{amsmath}宏包,避免一些载入顺序引发的问题:
956 % \begin{macrocode}
957 \RequirePackage{fontspec}
958 \RequirePackage{amsmath}
959 \RequirePackage{amssymb}
960 \RequirePackage{amsfonts}
961 % \end{macrocode}
962 %
963 % 一些字体相关的宏包:
964 % \begin{macrocode}
965 \RequirePackage[defaultsups]{newtxtext}
966 \RequirePackage{pifont}
967 \RequirePackage{xeCJKfntef}
968 % \end{macrocode}
969 %
970 % 解决各种文档部件需求,如表格、题注、插图等
971 % \changes{v0.9.41}{2016/05/25}{修正了\pkg{tgcursor}使\cs{textbf}失效的Bug,现在起使用\pkg{courier}代替。}
972 % \changes{v1.12}{2016/07/06}{得益于\pkg{caption}和\pkg{bicaption}和\pkg{newfloat}三个宏包,\cquthesis 支持双语题注了。}
973 % \begin{macrocode}
974 \RequirePackage{newfloat}
975 \RequirePackage{caption}
976 \RequirePackage[labelformat=simple]{subcaption}
977 \RequirePackage{bicaption}
978 \RequirePackage{array}
979 \RequirePackage{tabularx}
980 \RequirePackage{booktabs}
981 \RequirePackage{longtable}
982 \RequirePackage{multirow}
983 \RequirePackage{diagbox}
984 \RequirePackage{tabu}
985 \RequirePackage{courier}
986 \RequirePackage{graphicx}
987 \RequirePackage{pdfpages}
988 \RequirePackage[shortlabels,inline]{enumitem}
989 \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem}
990 % \end{macrocode}
991 %
992 % 解决页面类问题和脚注,其中\pkg{varwidth}用来代替老版本中的\pkg{pbox}。\pkg{xcolor}用来提供色彩支持,\pkg{metalogo}用来提供\cs{XeTeX}等命令支持。
993 % \begin{macrocode}
994 \RequirePackage{changepage}
995 \RequirePackage{afterpage}
996 \RequirePackage[bottom,perpage,hang,symbol*]{footmisc}
997 \raggedbottom
998 \RequirePackage{varwidth}
999 \RequirePackage{xcolor}
1000 \RequirePackage{metalogo}
1001 \RequirePackage{xspace}
1002 % \end{macrocode}
1003 %
1004 % 参考文献格式和优化:
1005 % \begin{macrocode}
1006 \RequirePackage[numbers,square,comma,super,sort&compress]{natbib}
1007 % \end{macrocode}
1008 %
1009 % \changes{v0.9.7}{2016/06/09}{目录、图录和表录的章节间隔不再突兀了。}
1010 % 删除默认模板(\file{book.cls})在章之间引入的垂直间隔。要放在\pkg{hyperref}之前才会生效。
1011 % \begin{macrocode}
1012 \patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{} % lof
1013 \patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{} % lot
1014 % \end{macrocode}
1015 %
1016 % 文档超链接
1017 % \begin{macrocode}
1018 \RequirePackage[hyperfootnotes=false,]{hyperref}
1019 % \end{macrocode}
1020 %
1021 % 配置超链接
1022 % \begin{macrocode}
1023 \hypersetup{%
1024 linktoc=all,
1025 bookmarksnumbered=true,
1026 bookmarksopen=true,
1027 bookmarksopenlevel=1,
1028 breaklinks=true,
1029 colorlinks=false,
1030 plainpages=false,
1031 pdfborder=0 0 0}
1032 \urlstyle{same}
1033 % \end{macrocode}
1034 %
1035 % 对\XeTeX 进行专门配置,解决一些字体问题:
1036 % \begin{macrocode}
1037 \ifxetex
1038 \def\CJK@null{\kern\CJKnullspace\Unicode{48}{7}\kern\CJKnullspace}
1039 \defaultfontfeatures{Mapping=tex-text}
1040 \fi
1041 \RequirePackage{tocloft}
1042 \ifxetex
1043 \hypersetup{%
1044 CJKbookmarks=true}
1045 \else
1046 \hypersetup{%
1047 unicode=true,
1048 CJKbookmarks=false}
1049 \fi
1050 % \end{macrocode}
1051 %
1052 % \subsection{页面类设置}
1053 % \subsubsection{页面功能}
1054 % \begin{macro}{\cleardoublepage}
1055 % 首页右开的时候,全空的左页不留页眉页脚,这个功能受blankleft开关影响
1056 % \begin{macrocode}
1057 \let\cqu@cleardoublepage\cleardoublepage
1058 \renewcommand{\cleardoublepage}{%
1059 \clearpage{\ifcqu@blankleft\pagestyle{style@empty}\fi\cqu@cleardoublepage}
1060 }%\cleardoublepage
1061 % \end{macrocode}
1062 % \end{macro}
1063 % \begin{macro}{\cqu@addblankpage}
1064 % 用来在强制完成空页工作,注意这里的pagestyle调整范围在花括号之内,这个功能受blankleft开关影响
1065 % \begin{macrocode}
1066 \newcommand\cqu@addblankpage{%
1067 \afterpage{%
1068 {\null\ifcqu@blankleft\pagestyle{style@empty}\fi\clearpage}}}
1069 % \end{macrocode}
1070 % \end{macro}
1071 %
1072 % \subsubsection{论文的三个部分}
1073 % \begin{macro}{\frontmatter}
1074 % \begin{macro}{\mainmatter}
1075 % \begin{macro}{\backmatter}
1076 % \changes{v0.9.0}{2016/05/16}{修正了不该编号的致谢页眉。}
1077 % 用来在\file{main.tex}中开启不同的文章部分:前置、主体、后置
1078 % \begin{macrocode}
1079 \newif\if@backmatter
1080 \renewcommand{\frontmatter}{%
1081 \@backmatterfalse
1082 \cleardoublepage
1083 \pagenumbering{Roman}
1084 \pagestyle{style@normal}
1085 \ctexset{chapter/numbering = false,}
1086 }
1087 \renewcommand{\mainmatter}{%
1088 \@backmatterfalse
1089 \cleardoublepage
1090 \pagenumbering{arabic}
1091 \pagestyle{style@normal}
1092 \ctexset{chapter/numbering = true,}
1093 }
1094 \renewcommand{\backmatter}{%
1095 \@backmattertrue
1096 \cleardoublepage
1097 \ctexset{chapter/numbering = false,
1098 section/number = \Alph{section},
1099 section/name = {,.},
1100 subsection/number = \CTEXthesection{}\arabic{subsection},}%
1101 \setcounter{chapter}{0}
1102 }
1103 % \end{macrocode}
1104 % \end{macro}
1105 % \end{macro}
1106 % \end{macro}
1107 %
1108 % \subsubsection{页面设置}
1109 % 定义页面,页眉页脚,先建立页面环境,完成分页再决定单双面打印
1110 % \changes{v1.20}{2017/05/30}{页眉页脚高度以及垂直间距向Word版本靠拢。}
1111 % \begin{macrocode}
1112 \RequirePackage{geometry}
1113 \geometry{
1114 a4paper, ignoreall, nomarginpar,
1115 inner=25mm, outer=25mm, top=30mm, bottom=28mm,
1116 bindingoffset=10mm, head=16mm, headsep=11mm, foot=12mm, footnotesep=5mm}
1117 % \end{macrocode}
1118 %
1119 % \subsubsection{单双页打印的自动判定}
1120 % 重庆大学的单双面打印和论文实际页数有关,此处读取前置部分后的最大页码,自动判断是否需要双面打印。很有趣,本科生70页想要双面打印比硕士生60页还难。此处立flag用来配合\cs{cqu@addblankpage}
1121 % \begin{macrocode}
1122 \RequirePackage{totcount}
1123 \regtotcounter[auxfile=maxpage.aux]{page}
1124 \if@autoprint
1125 \ifcqu@bachelor
1126 \ifnum\totvalue{page}>70 \@twosideprinttrue\else\@onesideprinttrue\fi
1127 \else
1128 \ifnum \totvalue{page}>60 \@twosideprinttrue\else\@onesideprinttrue\fi
1129 \fi
1130 \fi
1131 % \end{macrocode}
1132 %
1133 % 在log中记录下打印模式:
1134 % \begin{macrocode}
1135 \if@onesideprint
1136 \ClassWarning{cquthesis}{Printing under oneside mode.}{}
1137 \else
1138 \if@twosideprint
1139 \geometry{twoside}
1140 \ClassWarning{cquthesis}{Printing under twoside mode.}{}
1141 \fi
1142 \fi
1143 % \end{macrocode}
1144 %
1145 % \subsubsection{页眉和页脚}
1146 % 页眉页脚共有三种模式: 1. 页眉页脚全空(用于标题页、主体部分另页右开等);2. 用来修正双页打印时的页眉遮挡问题(右开的索引页眉不再是\cs{cqu@thesisname});3. 页眉页脚齐全(用于一般正文页面,这里自动判定用户类型和打印单双面)。
1147 %
1148 % 定制页眉页脚模式,全部以style@开头。
1149 % \begin{macrocode}
1150 \RequirePackage{fancyhdr}
1151 \fancypagestyle{style@empty}{%
1152 \fancyhf{}
1153 \renewcommand{\headrulewidth}{0pt}
1154 \renewcommand{\footrulewidth}{0pt}}
1155 \fancypagestyle{style@fixhead}{%
1156 \fancyhead{}
1157 \fancyhead[C]{\zihao{-5}\songti\leftmark}
1158 \fancyfoot{}
1159 \fancyfoot[C]{\zihao{-5}\thepage}
1160 \renewcommand{\headrulewidth}{0.4pt}
1161 \renewcommand{\footrulewidth}{0pt}}
1162 \fancypagestyle{style@normal}{%
1163 \fancyhead{}
1164 \if@twosideprint
1165 \fancyhead[EC]{\zihao{-5}\songti\cqu@thesisname}
1166 \fancyhead[OC]{\zihao{-5}\songti\leftmark}
1167 \else
1168 \fancyhead[L]{\zihao{-5}\songti\cqu@thesisname}
1169 \fancyhead[R]{\zihao{-5}\songti\leftmark}
1170 \fi
1171 \fancyfoot{}
1172 \fancyfoot[C]{\zihao{-5}\thepage}
1173 \renewcommand{\headrulewidth}{0.4pt}
1174 \renewcommand{\footrulewidth}{0pt}}
1175 % \end{macrocode}
1176 % \begin{macro}{\cqu@fixhead}
1177 % 修正页眉遮挡,这个命令要在标题生成的地方使用
1178 % \begin{macrocode}
1179 \newcommand{\cqu@fixhead}{%
1180 \if@twosideprint %仅双页打印需要修正
1181 \checkoddpage
1182 \ifoddpage\relax\else
1183 \thispagestyle{style@fixhead}
1184 \fi
1185 \fi
1186 }%\cqu@fixhead
1187 % \end{macrocode}
1188 % \end{macro}
1189 % 修正fancyhdr的问题,同时让页眉不显示第0章的编号:
1190 % \begin{macrocode}
1191 \AtBeginDocument{%
1192 \pagestyle{style@empty}
1193 \renewcommand{\chaptermark}[1]{%
1194 \ifnum\value{chapter}>0%
1195 \@mkboth{\CTEXthechapter\hskip\ccwd#1}{}%
1196 \else
1197 \@mkboth{#1}{}%
1198 \fi}}%\chaptermark
1199 % \end{macrocode}
1200 %
1201 % \subsection{段落设置}
1202 % LaTeX使用\cs{if@afterindent}来决定要不要让标题后的第一个自然段缩进,中文环境下好像并没有个人喜好之类的问题,我们这里让它一直为True。
1203 % \begin{macrocode}
1204 \let\@afterindentfalse\@afterindenttrue
1205 \@afterindenttrue
1206 % \end{macrocode}
1207 % 每个自然段之间空1/10行距,增加可读性
1208 % \begin{macrocode}
1209 \setlength{\parskip}{0.1\baselineskip}
1210 % \end{macrocode}
1211 % 全文首行缩进两字符,全角标点,去掉列表中项目之间的额外间隔(enumitem)
1212 % \begin{macrocode}
1213 \ctexset{%
1214 punct=quanjiao,
1215 autoindent=true,
1216 space=auto}
1217 \setlist{
1218 nosep,
1219 itemjoin = {{;}}
1220 }%setlist
1221 %</cls>
1222 % \end{macrocode}
1223 %
1224 % \subsection{各级标题}
1225 % 各级标题设置,使用\option{fixskip}来抑制三级和四级标题的额外间距。这里的\option{beforeskip}和\option{afterskip}是与Word样例对比后通过尝试得出的。
1226 % \changes{v1.16}{2016/12/07}{去除了三级和四级标题的额外垂直间距。}
1227 % \begin{macrocode}
1228 %<*cfg>
1229 \ctexset{%
1230 chapter = {%
1231 pagestyle = style@normal,
1232 name = {},
1233 format = \sffamily\heiti\centering,
1234 nameformat = \zihao{3},
1235 titleformat = \zihao{3},
1236 aftername = \hskip\ccwd,
1237 number = {\ifcqu@liberalformat\chinese{chapter}\else\thechapter\fi},
1238 beforeskip = 13bp,
1239 afterskip = 24bp,
1240 },
1241 section = {%
1242 name = {},
1243 format = \sffamily\heiti\raggedright,
1244 nameformat = \bfseries\zihao{-3},
1245 titleformat = \zihao{-3},
1246 aftername = \hskip\ccwd,
1247 number = {\ifcqu@liberalformat\parenthesesthis{\chinese{section}}\else\thesection\fi},
1248 beforeskip = 24bp plus 1ex minus .2ex,
1249 afterskip = 6bp plus .2ex,
1250 },
1251 subsection = {%
1252 name = {},
1253 format = \sffamily\heiti\raggedright,
1254 nameformat = \bfseries\zihao{4},
1255 titleformat = \zihao{4},
1256 aftername = \hskip\ccwd,
1257 number = {\ifcqu@liberalformat\arabic{subsection}\else\thesubsection\fi},
1258 beforeskip = 12bp plus 1bp,
1259 afterskip = 10bp,
1260 fixskip = true,
1261 },
1262 subsubsection = {
1263 name = {},
1264 runin = false,
1265 indent = \parindent,
1266 aftertitle = {},
1267 numbering = true,
1268 number = {\ifcqu@liberalformat\parenthesesthis{\arabic{subsubsection}}\else\@circlenum{subsubsection}\fi},
1269 numberformat+ = {\ifcqu@liberalformat\relax\else\zihao{4}\fi},
1270 beforeskip = 10bp plus .5bp,
1271 afterskip = 10bp,
1272 fixskip = true,
1273 },
1274 appendix = {%
1275 numbering = false,
1276 name = {},
1277 },
1278 % \end{macrocode}
1279 % 出于各级标题间区分度的考虑,不支持五级及以上的标题:
1280 % \begin{macrocode}
1281 paragraph = {
1282 name = {},
1283 runin = true,
1284 aftertitle = {\ClassError{cquthesis}%
1285 {Level-5 and below sections are unsupported intentionally.}{}},
1286 beforeskip = 1ex plus 0.5ex minus .2ex,
1287 afterskip = 1em,
1288 },
1289 subparagraph = {
1290 name = {},
1291 runin = true,
1292 indent = \parindent,
1293 indent = 0pt,
1294 aftertitle = {\ClassError{cquthesis}%
1295 {Level-5 and below sections are unsupported intentionally.}{}},
1296 beforeskip = 1ex plus 0.5ex minus .2ex,
1297 afterskip = 1em,
1298 },
1299 appendixname=附录,
1300 contentsname={目\hskip\ccwd 录},
1301 listfigurename={插图索引},
1302 listtablename={表格索引},
1303 figurename=图,
1304 tablename=表,
1305 bibname=参考文献,
1306 indexname=索引,
1307 }
1308 %</cfg>
1309 % \end{macrocode}
1310 %
1311 % \subsection{文档部件}
1312 % \subsubsection{带圈数字}
1313 % \begin{macro}{\@circlenum}
1314 % \changes{v0.8.9}{2016/05/15}{修正了\cs{@circlenum}无法在嵌套在\env{minipage}中的表格中正常运作的问题,问题原因没有具体查清,但是使用\pkg{footmisc}另外造轮子过了。清华的模板也有这个问题,已提交Issue协助修正。}
1315 % 带圈数字功能,最多处理10个。注意这里\cs{@circlenum}要接受的是\textsf{counter}里的值,所以需要\cs{value}来处理,如果用数字直接做\cs{@circlenum}的参数,要去掉\cs{value}才能编译通过,另外,\cs{ding}接受的参数为字符串,所以这里要用上\cs{the}。
1316 %
1317 % 这个命令用于生成第四级标题。
1318 % \begin{macrocode}
1319 %<*cls>
1320 \def\@circlenum#1{%
1321 \ifnum \value{#1} >10
1322 \ClassError{cquthesis}%
1323 {More than 10 subsubsections in a subsection cannot be handled.}{}
1324 \fi
1325 \ding{\the\numexpr\value{#1}+171\relax}%
1326 }
1327 % \end{macrocode}
1328 % \end{macro}
1329 %
1330 % \subsubsection{脚注}
1331 % 设置分割线、字号和悬挂缩进
1332 % \begin{macrocode}
1333 \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
1334 \let\cqu@footnotesize\footnotesize
1335 \renewcommand{\footnotesize}{\cqu@footnotesize\zihao{-5}}
1336 \footnotemargin1.5em\relax
1337 % \end{macrocode}
1338 %
1339 % 脚注部分将标注换为正文大小,这个过程是动态的:
1340 % \begin{macrocode}
1341 \let\cqu@makefnmark\@makefnmark
1342 \def\cqu@@makefnmark{\mbox{{\normalfont\@thefnmark}}}
1343 \pretocmd{\@makefntext}{\let\@makefnmark\cqu@@makefnmark}{}{}
1344 \apptocmd{\@makefntext}{\let\@makefnmark\cqu@makefnmark}{}{}
1345 %</cls>
1346 % \end{macrocode}
1347 % footmisc定义新脚注symbol,minipage需要额外定义一行,脚注不能大于10
1348 % \begin{macrocode}
1349 %<*cfg>
1350 \DefineFNsymbols{cqufnsymbol}{
1351 {\ding{172}} {\ding{173}}
1352 {\ding{174}} {\ding{175}}
1353 {\ding{176}} {\ding{177}}
1354 {\ding{178}} {\ding{179}}
1355 {\ding{180}} {\ding{181}}
1356 }%cqufnsymbol
1357 \setfnsymbol{cqufnsymbol}
1358 \renewcommand\thempfootnote{\fnsymbol{mpfootnote}}
1359 \pretocmd{\thefootnote}{%
1360 \ifnum \value{footnote} >10
1361 \ClassError{cquthesis}%
1362 {More than 10 footnotes in a single page are not supported.}{}
1363 \fi
1364 }{}{}
1365 \pretocmd{\thempfootnote}{%
1366 \ifnum \value{mpfootnote} >10
1367 \ClassError{cquthesis}%
1368 {More than 10 footnotes in a single page are not supported.}{}
1369 \fi
1370 }{}{}
1371 %</cfg>
1372 % \end{macrocode}
1373 %
1374 % \subsubsection{数学公式和定理环境}
1375 % 数学公式断行
1376 % \begin{macrocode}
1377 %<*cls>
1378 \allowdisplaybreaks[4]
1379 \let\cqu@tagform@\tagform@
1380 \renewcommand{\eqref}[1]{\cqueqshortname\textup{(\ref{#1})}}
1381 % \end{macrocode}
1382 %
1383 % 定理环境
1384 % \begin{macrocode}
1385 \theorembodyfont{\rmfamily\songti}
1386 \theoremheaderfont{\rmfamily\heiti}
1387 %</cls>
1388 % \end{macrocode}
1389 %
1390 % 定理环境中文定义在.cfg中完成
1391 % \begin{macrocode}
1392 %<*cfg>
1393 \theoremsymbol{\ensuremath{\ding{110}}}
1394 \newtheorem*{proof}{证明}
1395 \theoremstyle{plain}
1396 \theoremsymbol{}
1397 \theoremseparator{:}
1398 \newtheorem{assumption}{假设}[chapter]
1399 \newtheorem{definition}{定义}[chapter]
1400 \newtheorem{proposition}{命题}[chapter]
1401 \newtheorem{lemma}{引理}[chapter]
1402 \newtheorem{theorem}{定理}[chapter]
1403 \newtheorem{axiom}{公理}[chapter]
1404 \newtheorem{corollary}{推论}[chapter]
1405 \newtheorem{exercise}{练习}[chapter]
1406 \newtheorem{example}{例}[chapter]
1407 \newtheorem{remark}{注释}[chapter]
1408 \newtheorem{problem}{问题}[chapter]
1409 \newtheorem{conjecture}{猜想}[chapter]
1410 %</cfg>
1411 % \end{macrocode}
1412 %
1413 % \subsubsection{化学式和国际标准单位}
1414 % 很棒的化学式和方程支持。不过这里需要补足中文排版中的空格尴尬:
1415 % \begin{macrocode}
1416 %<*cls>
1417 \RequirePackage[version=4]{mhchem}
1418 \AtBeginDocument{\pretocmd{\ce}{{ }}{}{}}
1419 % \end{macrocode}
1420 % \begin{macro}{\cec}
1421 % 在命令里使用逗号快速分隔多个化学式:
1422 % \begin{macrocode}
1423 \newcommand{\cec}[1]{\cesplit{{\,\ }{\0}}{#1}}
1424 % \end{macrocode}
1425 % \end{macro}
1426 % SI单位支持
1427 % \begin{macrocode}
1428 \RequirePackage{siunitx}
1429 \RequirePackage{upgreek}
1430 \ifxetex
1431 \sisetup{%
1432 math-micro = {\upmu},
1433 text-micro = {\textmu},
1434 }%\sisetup
1435 \fi
1436 %</cls>
1437 % \end{macrocode}
1438 %
1439 % \begin{macrocode}
1440 %<*cfg>
1441 \sisetup{%
1442 list-final-separator = { 和 },
1443 list-pair-separator = { 和 },
1444 range-phrase = {~},
1445 }%\sisetup
1446 % \end{macrocode}
1447 %
1448 % \subsubsection{自动交叉引用}
1449 % \begin{macro}{\autoref}
1450 % 使用\cs{autoref}可以进行自动判定目标类型的交叉引用,这里对其进行定制:
1451 % \begin{macrocode}
1452 % 这里定制\autoref{label}
1453 \AtBeginDocument{%
1454 \def\figureautorefname{图}
1455 \def\tableautorefname{表}
1456 \def\partautorefname{卷}
1457 \def\appendixautorefname{附录}
1458 \def\equationautorefname{式}
1459 \def\Itemautorefname{列表}
1460 \def\chapterautorefname{章}
1461 \def\sectionautorefname{节}
1462 \def\subsectionautorefname{小节}
1463 \def\subsubsectionautorefname{条目}
1464 \def\paragraphautorefname{自然段}
1465 \def\Hfootnoteautorefname{脚注}
1466 \def\AMSautorefname{式}
1467 \def\theoremautorefname{理论}
1468 \def\pageautorefname{页}
1469 }%\AtBeginDocument
1470 %</cfg>
1471 % \end{macrocode}
1472 % \end{macro}
1473 %
1474 % \subsubsection{浮动对象}
1475 % 设定浮动对象与文字的间距
1476 % \changes{v1.16}{2016/12/07}{优化浮动对象与文字的间距。}
1477 % \begin{macrocode}
1478 %<*cls>
1479 \setlength{\floatsep}{20bp plus2bp minus2bp}
1480 \setlength{\intextsep}{20bp plus2bp minus2bp}
1481 \setlength{\textfloatsep}{20bp plus2bp minus2bp}
1482 \setlength{\@fptop}{6bp plus2bp}
1483 \setlength{\@fpsep}{12bp plus2bp}
1484 \setlength{\@fpbot}{6bp plus2bp}
1485 % \end{macrocode}
1486 % 让浮动对象的页面缺省值更宽松
1487 % \begin{macrocode}
1488 \renewcommand{\textfraction}{0.15}
1489 \renewcommand{\topfraction}{0.85}
1490 \renewcommand{\bottomfraction}{0.65}
1491 \renewcommand{\floatpagefraction}{0.60}
1492 % \end{macrocode}
1493 %
1494 % \subsubsection{题注和表格}
1495 % 主体部分的题注和后置部分的题注需要做分别支持。
1496 % \begin{macro}{\thefigure}
1497 % \begin{macro}{\thetable}
1498 % \begin{macro}{\theequation}
1499 % 重新定义了图、表、公式的计数系统:
1500 % \begin{macrocode}
1501 \AtBeginDocument{%
1502 \renewcommand{\thefigure}{%
1503 \if@backmatter
1504 \CTEXthesection \@arabic \c@figure
1505 \else
1506 \ifnum \c@chapter >\z@ \thechapter .\fi \@arabic \c@figure
1507 \fi}
1508 \renewcommand{\thetable}{%
1509 \if@backmatter
1510 \CTEXthesection \@arabic \c@table
1511 \else
1512 \ifnum \c@chapter >\z@ \thechapter .\fi \@arabic \c@table
1513 \fi}
1514 \renewcommand{\theequation}{%
1515 \if@backmatter
1516 \CTEXthesection \@arabic \c@equation
1517 \else
1518 \ifnum \c@chapter >\z@ \thechapter .\fi \@arabic \c@equation
1519 \fi}
1520 }
1521 % \end{macrocode}
1522 % \end{macro}
1523 % \end{macro}
1524 % \end{macro}
1525 % 定制表格和插图的题注样式,这里注意\pkg{caption}宏包在设置表格的\option{position}为\option{top}时,\option{aboveskip}和\option{belowskip}的定义会相互调换,即\option{top}时反义,\option{bottom}时字面义。
1526 % \changes{v1.12}{2016/07/06}{题注的字体设置对中英文都进行了适配。}
1527 % \changes{v1.16}{2016/12/07}{正文中的题注的名称和序号不再加粗,同时优化了题注和插图(插表)的垂直距离。}
1528 % \changes{v1.20}{2017/05/30}{现在,题注有多行时,最后一行会进行居中处理。}
1529 % \begin{macrocode}
1530 \def\cqu@tabular{\zihao{5}\@tabular}
1531 \DeclareCaptionLabelFormat{cqu}{{\zihao{5}\rmfamily\songti #1~#2}}
1532 \DeclareCaptionLabelSeparator{cqu}{\hspace{0.5\ccwd}}
1533 \DeclareCaptionFont{cqu}{\zihao{5}\rmfamily\songti}
1534 \captionsetup{justification=centerlast}
1535 \captionsetup{labelformat=cqu,labelsep=cqu,font=cqu}
1536 \captionsetup[table]{position=top,belowskip=6bp,aboveskip=0bp}
1537 \captionsetup[figure]{position=bottom,belowskip=0bp,aboveskip=6bp}
1538 \captionsetup[sub]{font=cqu,skip=6bp}
1539 \renewcommand{\thesubfigure}{(\alph{subfigure})}
1540 \renewcommand{\thesubtable}{(\alph{subtable})}
1541 % \end{macrocode}
1542 % \begin{macro}{\bicaption}
1543 % \changes{v1.50}{2020/06/23}{修改了双语图注的声明顺序,以适应新版\cs{bicaption}的变更。}
1544 % 这里对\cs{bicaption}这个命令进行设置,题注的第二语言默认为英文,用户可以重定义\cs{shorttablenameEN}和\cs{shortfigurenameEN}
1545 % \begin{macrocode}
1546 \DeclareCaptionOption{bi-first}[]{%
1547 \def\tablename{\shorttablename}
1548 \def\figurename{\shortfigurename}
1549 }%bi-first
1550 \DeclareCaptionOption{bi-second}[]{%
1551 \def\tablename{\shorttablenameEN}
1552 \def\figurename{\shortfigurenameEN}
1553 }%bi-second
1554 \captionsetup[bi-first]{bi-first}
1555 \captionsetup[bi-second]{bi-second}
1556 % \end{macrocode}
1557 % \end{macro}
1558 % \begin{macro}{\listoffiguresEN}
1559 % \begin{macro}{\listoftablesEN}
1560 % 按照三种不同情况进行不同的工作:1、如果不开启双语索引,则去掉命令作用,将创建出的list作为黑洞;2、要求中英文编录到一起时不分离索引文件:
1561 % \begin{macrocode}
1562 \DeclareFloatingEnvironment[fileext=lofEN]{figuresEN}[\shortfigurenameEN][\listoffiguresnameEN]
1563 \DeclareFloatingEnvironment[fileext=lotEN]{tablesEN}[\shorttablenameEN][\listoftablesnameEN]
1564 % \end{macrocode}
1565 % 3、中英文分开编译
1566 % \begin{macrocode}
1567 \if@bicombined\relax
1568 \else
1569 \captionsetup[bi-second]{listtype+=sEN}
1570 \fi
1571 \if@biapart\relax
1572 \else
1573 \AtBeginDocument{%
1574 \let\listoffiguresEN\relax
1575 \let\listoftablesEN\relax
1576 \let\listofequationsEN\relax
1577 }%AtBeginDocument
1578 \fi
1579 % \end{macrocode}
1580 % \end{macro}
1581 % \end{macro}
1582 % 调整表格字号,调整每列之间的间距,单元格内垂直居中
1583 % \begin{macrocode}
1584 \AtBeginEnvironment{tabularx}{\begingroup\zihao{5}}
1585 \AtEndEnvironment{tabularx}{\endgroup}
1586 \setlength{\tabcolsep}{12pt}
1587 \renewcommand{\tabularxcolumn}[1]{m{#1}}
1588 % \end{macrocode}
1589 % \begin{macro}{\bigcell}
1590 % \begin{macro}{\headcell}
1591 % \begin{macro}{\colsep}
1592 % 在表格中,\cs{bigcell}内的内容可以主动换行;\cs{headcell}用来做表头;\cs{colsep}用来设定列间距,默认值为12pt。
1593 % \begin{macrocode}
1594 \newcommand{\bigcell}[1]{\vspace{6pt}\begin{varwidth}{\linewidth}#1\end{varwidth}\vspace{6pt}}
1595 \newcommand{\headcell}[1]{\multicolumn{1}{c}{\heiti #1}}
1596 \newcommand{\colsep}[1][12pt]{\setlength{\tabcolsep}{#1}}
1597 % \end{macrocode}
1598 % \end{macro}
1599 % \end{macro}
1600 % \end{macro}
1601 %
1602 % longtable方面也需要做设置
1603 % \begin{macrocode}
1604 \setlength{\LTpre}{\bigskipamount}
1605 \setlength{\LTpost}{\bigskipamount}
1606 \let\cqu@LT@array\LT@array
1607 \def\LT@array{\zihao{5}\cqu@LT@array}
1608 % \end{macrocode}
1609 %
1610 % \subsubsection{代码环境}
1611 % \begin{environment}{lstStyleBase}
1612 % \changes{v1.00}{2016/06/17}{将代码环境的基础字号改为了\cs{footnotesize},原先的\cs{scriptsize}实在太小了。}
1613 % 载入\pkg{listings}宏包,定义基础代码环境,注意这个环境只是个模板,没有提供直接使用的接口:
1614 % \begin{macrocode}
1615 \RequirePackage{listings}
1616 \lstdefinestyle{lstStyleBase}{%
1617 basicstyle=\footnotesize\ttfamily,
1618 aboveskip=\medskipamount,
1619 belowskip=\medskipamount,
1620 lineskip=0pt,
1621 boxpos=c,
1622 showlines=false,
1623 extendedchars=true,
1624 upquote=true,
1625 tabsize=2,
1626 showtabs=false,
1627 showspaces=false,
1628 showstringspaces=false,
1629 numbers=left,
1630 numberstyle=\tiny,
1631 linewidth=\linewidth,
1632 xleftmargin=4pt,
1633 xrightmargin=0pt,
1634 resetmargins=false,
1635 breaklines=true,
1636 breakatwhitespace=false,
1637 breakindent=0pt,
1638 breakautoindent=true,
1639 columns=flexible,
1640 keepspaces=true,
1641 framesep=3pt,
1642 rulesep=2pt,
1643 framerule=1pt,
1644 backgroundcolor=\color{gray!5},
1645 stringstyle=\color{green!40!black!100},
1646 keywordstyle=\bfseries\color{blue!50!black},
1647 commentstyle=\slshape\color{black!60}}
1648 \lstdefinestyle{lstStyleCplus}{%
1649 style=lstStyleBase,
1650 frame=l,
1651 rulecolor=\color{blue},
1652 language=C++}
1653 \lstdefinestyle{lstStylePython}{%
1654 style=lstStyleBase,
1655 frame=l,
1656 rulecolor=\color{cyan},
1657 language=Python}
1658 % \end{macrocode}
1659 % \end{environment}
1660 % \begin{environment}{C++}
1661 % \changes{v1.16}{2016/12/07}{出于简明的考虑,\env{Cplus}环境现在已经更名为\env{C++}环境。\env{Cplus}环境为历史兼容而保留定义。修改了语言环境定义中的一个错误,现在C++和Python环境能够正确地进行代码上色了。}
1662 % \begin{environment}{Python}
1663 % \cquthesis 内置了两个代码环境,\env{C++}和\env{Python},您可以参照代码在\file{cquthesis.sty}中定义自己的环境。\env{Cplus}环境为历史兼容而保留定义。
1664 % \begin{macrocode}
1665 \lstnewenvironment{C++}{\lstset{style=lstStyleCplus}}{}
1666 \lstnewenvironment{Cplus}{\lstset{style=lstStyleCplus}}{}
1667 \lstnewenvironment{Python}{\lstset{style=lstStylePython}}{}
1668 % \end{macrocode}
1669 % \end{environment}
1670 % \end{environment}
1671 %
1672 % \subsubsection{自定义计数器}
1673 % 这个计数器可以在很多环境下使用,例如表格中的序号,文章中行内的编号等等:
1674 % \begin{macro}{\xuhao}
1675 % \begin{macro}{\resetxuhao}
1676 % \begin{macro}{\xuhaotype}
1677 % \begin{macro}{\xuhaoseparator}
1678 % \cs{xuhao}会自增并输出内容,\cs{resetxuhao}或者\cs{xuhao}\oarg{1}会将序号置为1,后者会输出,\cs{xuhaotype}用来设定序号风格,\cs{xuhaoseparator}为序号之后的分隔符,可以用\cs{renewcommand}来定义。
1679 % \begin{macrocode}
1680 \newcounter{cquXuHao}
1681 \newcounter{cquXuHaoType}
1682 \setcounter{cquXuHaoType}{1}
1683 \newcommand{\xuhaoseparator}{}
1684 \newcommand{\xuhaotype}[1][1]{
1685 \ifnum #1>6 \ClassError{cquthesis}%
1686 {Available choices from 1-6.}{}%
1687 \fi
1688 \setcounter{cquXuHaoType}{#1}
1689 }%\xuhaotype
1690 \newcommand{\output@xuhao}{%
1691 \ifcase\value{cquXuHaoType}
1692 \or \arabic{cquXuHao} %1
1693 \or \Alph{cquXuHao} %2
1694 \or \alph{cquXuHao} %3
1695 \or \Roman{cquXuHao} %4
1696 \or \roman{cquXuHao} %5
1697 \or \ifnum\value{cquXuHao}>9\ClassError{cquthesis}%
1698 {Xuhao(rownum) of type-6 must be under 10.}{}%
1699 \else\fnsymbol{cquXuHao}
1700 \fi %6
1701 \fi
1702 }%\output@xuhao
1703 \newcommand{\xuhao}[1][0]{
1704 \ifcase #1
1705 \stepcounter{cquXuHao} %0
1706 \output@xuhao\xuhaoseparator\xspace
1707 \or \resetxuhao\stepcounter{cquXuHao} %1
1708 \output@xuhao\xuhaoseparator\xspace
1709 \fi
1710 }%\xuhao
1711 \newcommand{\resetxuhao}{\setcounter{cquXuHao}{0}}
1712 % \end{macrocode}
1713 % \end{macro}
1714 % \end{macro}
1715 % \end{macro}
1716 % \end{macro}
1717 % \begin{macro}{\rownum}
1718 % \begin{macro}{\resetrownum}
1719 % \begin{macro}{\rownumtype}
1720 % \begin{macro}{\rownumseparator}
1721 % 考虑到不同用户的喜好,这里设定一组别名,同时处理\cs{setxuhao}这个兼容性问题。
1722 % \begin{macrocode}
1723 \let\rownum\xuhao
1724 \let\resetrownum\resetxuhao
1725 \let\rownumtype\xuhaotype
1726 \let\setxuhao\xuhaotype
1727 \let\rownumseparator\xuhaoseparator
1728 % \end{macrocode}
1729 % \end{macro}
1730 % \end{macro}
1731 % \end{macro}
1732 % \end{macro}
1733 %
1734 % \subsection{盲审模式}
1735 %
1736 % \begin{macro}{\secretize}
1737 % 定义盲审模式工具宏\cs{secretize}:
1738 % \begin{macrocode}
1739 \newcommand{\secretize}[1]{%
1740 \ifcqu@blindtrail
1741 {***}
1742 \else
1743 {#1}
1744 \fi
1745 }
1746 % \end{macrocode}
1747 % \end{macro}
1748 %
1749 % \begin{environment}{secretizeEnv}
1750 % 定义盲审模式工具环境\env{secretizeEnv}:
1751 % \begin{macrocode}
1752 \newcommand{\cqu@@secretizeenv}[1]{\long\gdef\cqu@secretizeenv{#1}}
1753 \newenvironment{secretizeEnv}{\Collect@Body\cqu@@secretizeenv}{%
1754 \ifcqu@blindtrail
1755 \relax
1756 \else
1757 \cqu@secretizeenv
1758 \fi
1759 }
1760 % \end{macrocode}
1761 % \end{environment}
1762 %
1763 % \subsection{封面绘制}
1764 % \subsubsection{信息录入}
1765 % \begin{macro}{\cqu@def@term}
1766 % 定义一个Key--Definer:
1767 % \begin{macrocode}
1768 \def\cqu@def@term #1{%
1769 \define@key{cqu}{#1}{\csname #1\endcsname{##1}}
1770 \expandafter\gdef\csname #1\endcsname##1{%
1771 \expandafter\gdef\csname cqu@#1\endcsname{##1}}
1772 \csname #1\endcsname{}}
1773 % \end{macrocode}
1774 % \end{macro}
1775 % 下面定义一批会用在封面的变量:
1776 %
1777 % 论文的中英文题目(封面第二行)
1778 % \begin{macrocode}
1779 \cqu@def@term{ctitle}
1780 \cqu@def@term{etitle}
1781 % \end{macrocode}
1782 %
1783 % 作者的信息(校徽下方)
1784 % \begin{macrocode}
1785 \cqu@def@term{cauthor}
1786 \cqu@def@term{eauthor}
1787 \cqu@def@term{studentid}
1788 \cqu@def@term{csupervisor}
1789 \cqu@def@term{esupervisor}
1790 \cqu@def@term{cassistsupervisor}
1791 \cqu@def@term{cextrasupervisor}
1792 \cqu@def@term{eassistsupervisor}
1793 \cqu@def@term{cpsupervisor}
1794 \cqu@def@term{epsupervisor}
1795 \cqu@def@term{cmajor}
1796 \cqu@def@term{emajor}
1797 \cqu@def@term{cclass}
1798 \cqu@def@term{edgree}
1799 % \end{macrocode}
1800 %
1801 % 底部的学院名称和日期
1802 % \begin{macrocode}
1803 \cqu@def@term{cdepartment}
1804 \cqu@def@term{edepartment}
1805 \cqu@def@term{mycdate}
1806 \cqu@def@term{myedate}
1807 %</cls>
1808 % \end{macrocode}
1809 % 日期的中英文支持
1810 % \begin{macrocode}
1811 %<*cfg>
1812 \newcommand{\MONTH}{%
1813 \ifcase\the\month
1814 \or January% 1
1815 \or February% 2
1816 \or March% 3
1817 \or April% 4
1818 \or May% 5
1819 \or June% 6
1820 \or July% 7
1821 \or August% 8
1822 \or September% 9
1823 \or October% 10
1824 \or November% 11
1825 \or December% 12
1826 \fi}
1827 \def\cdate{\zhdigits{\the\year}年\zhnumber{\the\month}月}
1828 \def\edate{\MONTH{ }\the\year}
1829 %</cfg>
1830 % \end{macrocode}
1831 %
1832 % 收集关键词并且做关键词分割
1833 % \begin{macrocode}
1834 %<*cls>
1835 \def\cqu@parse@keywords#1{
1836 \define@key{cqu}{#1}{\csname #1\endcsname{##1}}
1837 \expandafter\gdef\csname cqu@#1\endcsname{}
1838 \expandafter\gdef\csname #1\endcsname##1{
1839 \@for\reserved@a:=##1\do{
1840 \expandafter\ifx\csname cqu@#1\endcsname\@empty\else
1841 \expandafter\g@addto@macro\csname cqu@#1\endcsname{%
1842 \ignorespaces\csname cqu@#1@separator\endcsname}
1843 \fi
1844 \expandafter\expandafter\expandafter\g@addto@macro%
1845 \expandafter\csname cqu@#1\expandafter\endcsname\expandafter{\reserved@a}}}}
1846 \cqu@parse@keywords{ckeywords}
1847 \cqu@parse@keywords{ekeywords}
1848 % \end{macrocode}
1849 %
1850 % 使用kvoptions提供key=value格式支持
1851 % \begin{macrocode}
1852 \def\cqusetup{\kvsetkeys{cqu}}
1853 % \end{macrocode}
1854 %
1855 % \subsubsection{绘制中文封面}
1856 % \begin{macro}{\make@cover@CN}
1857 % \changes{v0.9.7}{2016/06/09}{使用\pkg{varwidth}代替了\pkg{pbox}。}
1858 % 基本上的思路是能复用就复用,姓名那几行分为左右两个\env{varwidth}:
1859 % \changes{v1.00}{2016/06/17}{现在,标题中的英文和中文统一使用无衬线字体。}
1860 % \changes{v1.14}{2016/08/18}{本科封面新增“助理指导教师”“校外指导教师”的字段,自动判定是否有输入,有则显示,无则不显示。}
1861 % \begin{macrocode}
1862 \newcommand{\make@cover@CN}{%
1863 \thispagestyle{style@empty}
1864 \begin{center}
1865 \rule{0mm}{15mm}
1866 \sffamily\heiti
1867 \ifcqu@bachelor
1868 \zihao{-2}\cqu@thesistypenameCN
1869 \\ \vspace{\stretch{1}}
1870 \zihao{2}\cqu@ctitle
1871 \\ \vspace{\stretch{2}}
1872 \includegraphics[width=6cm]{CQUbadge.pdf}
1873 \\ \vspace{\stretch{2}}
1874 \else
1875 \zihao{2}\cqu@ctitle
1876 \\ \vspace{\stretch{1}}
1877 \includegraphics[width=6cm]{CQUbadge.pdf}
1878 \\ \vspace{\stretch{1}}
1879 \zihao{-2}\cqu@thesistypenameCN
1880 \ifcqu@master{}\\\cqu@mastertype\fi
1881 \\ \vspace{\stretch{2}}
1882 \fi
1883 \ifcqu@bachelor
1884 \zihao{3}
1885 \begin{varwidth}{\textwidth}
1886 \begin{CJKfilltwosides}{4.5\ccwd}
1887 \cqu@studentCN\cqu@title@separatorCN\\
1888 \cqu@studentnumCN\cqu@title@separatorCN\\
1889 \cqu@supervisorCN\cqu@title@separatorCN\\
1890 \ifdefstring{\cqu@cassistsupervisor}{}{\relax}{{\zihao{5}\begin{CJKfilltwosides}{66bp}\cqu@assistsupervisorCN\end{CJKfilltwosides}}\hfill\cqu@title@separatorCN\\}
1891 \ifdefstring{\cqu@cextrasupervisor}{}{\relax}{{\zihao{5}\begin{CJKfilltwosides}{66bp}\cqu@extrasupervisorCN\end{CJKfilltwosides}}\hfill\cqu@title@separatorCN\\}
1892 \cqu@majorCN\cqu@title@separatorCN
1893 \end{CJKfilltwosides}
1894 \end{varwidth}
1895 \else
1896 \zihao{3}
1897 \begin{varwidth}{\textwidth}
1898 \begin{CJKfilltwosides}{4.5\ccwd}
1899 \cqu@studentCN\cqu@title@separatorCN\\
1900 \cqu@supervisorCN\cqu@title@separatorCN\\
1901 \ifcqu@academic
1902 \cqu@majorCN\cqu@title@separatorCN\\
1903 \else
1904 \cqu@psupervisorCN\cqu@title@separatorCN\\
1905 \fi
1906 \cqu@majorclassCN\cqu@title@separatorCN
1907 \end{CJKfilltwosides}
1908 \end{varwidth}
1909 \fi
1910 \hskip.5\ccwd
1911 \zihao{3}
1912 \begin{varwidth}{\textwidth}%
1913 \mbox{\cqu@cauthor}\\
1914 \ifcqu@bachelor\cqu@studentid\\\fi
1915 \cqu@csupervisor\\ %不要放在盒子里
1916 \ifcqu@academic %这里有点复杂
1917 \ifcqu@bachelor
1918 \ifdefstring{\cqu@cassistsupervisor}{}{\relax}{\cqu@cassistsupervisor\\}
1919 \ifdefstring{\cqu@cextrasupervisor}{}{\relax}{\cqu@cextrasupervisor\\}
1920 \fi
1921 \mbox{\cqu@cmajor}
1922 \ifcqu@bachelor\relax\else\\\cqu@cclass\fi
1923 \else
1924 \cqu@cpsupervisor\\
1925 \cqu@cclass
1926 \fi
1927 \end{varwidth}
1928 \\ \vspace{\stretch{2}}
1929 \zihao{-2}\cqu@universitynameCN\cqu@cdepartment\\[1mm]
1930 \zihao{3}\ifdefempty{\cqu@mycdate}{\cdate}{\cqu@mycdate}
1931 \vspace{10mm}
1932 \end{center}}
1933 % \end{macrocode}
1934 % \end{macro}
1935 %
1936 % \subsubsection{绘制英文封面}
1937 % \begin{macro}{\make@cover@EN}
1938 % 英文封面由于不需要汉字两端对齐,相对来说排版难度低一些:
1939 % \changes{v1.14}{2016/08/18}{“助理指导教师”“校外指导教师”的英文字段也相应添加,同样自动判定是否有输入来决定是否显示。}
1940 % \changes{v1.16}{2016/12/07}{修正英文封面的指导教师的表达。另外,让“by”加粗了。}
1941 % \begin{macrocode}
1942 \newcommand{\make@cover@EN}{%
1943 \cleardoublepage
1944 \thispagestyle{style@empty}
1945 \begin{center}
1946 \rule{0mm}{15mm}
1947 \sffamily
1948 \ifcqu@bachelor
1949 \zihao{-2}\cqu@thesistypenameEN
1950 \\ \vspace{\stretch{2}}
1951 \zihao{-1}\textbf{\cqu@etitle}
1952 \\ \vspace{\stretch{1}}
1953 \includegraphics[width=5cm]{CQUbadge.pdf}
1954 \\ \vspace{\stretch{2}}
1955 \zihao{3}\textbf{\cqu@studentEN\cqu@title@separatorEN\mbox{\cqu@eauthor}}\\
1956 \cqu@supervisorEN\mbox{\cqu@esupervisor}\\
1957 \ifdefstring{\cqu@eassistsupervisor}{}{\relax}{\cqu@assistsupervisorEN\cqu@title@separatorEN\mbox{\cqu@eassistsupervisor}\\}
1958 \cqu@majorEN\cqu@title@separatorEN\mbox{\cqu@emajor}
1959 \else
1960 \zihao{-1}\textbf{\cqu@etitle}
1961 \\ \vspace{\stretch{2}}
1962 \includegraphics[width=5cm]{CQUbadge.pdf}
1963 \\ \vspace{\stretch{2}}
1964 \zihao{3}\cqu@thesistypenameEN
1965 \\[1mm]
1966 \textbf{\cqu@workby}
1967 \\[2mm]
1968 \zihao{3}\mbox{\textbf{\cqu@eauthor}}
1969 \\ \vspace{\stretch{1}}
1970 \textbf{\cqu@supervisorEN}\textbf{\cqu@esupervisor}\\
1971 \ifcqu@academic\relax\else\textbf{\cqu@psupervisorEN\cqu@title@separatorEN\cqu@epsupervisor}\\\fi
1972 \textbf{\cqu@majorEN\cqu@title@separatorEN}\mbox{\textbf{\cqu@emajor}}
1973 \fi
1974 \\ \vspace{\stretch{2}}
1975 \zihao{-2}\cqu@edepartment\\\cqu@universitynameEN\\[1mm]
1976 \ifdefempty{\cqu@myedate}{\textbf{\edate}}{\textbf{\cqu@myedate}}
1977 \vspace{10mm}
1978 \end{center}}
1979 % \end{macrocode}
1980 % \end{macro}
1981 %
1982 % \subsubsection{PDF文件属性配置}
1983 % \begin{macro}{\makecover}
1984 % 定义一个总体调用的\cs{makecover},在画封面的同时把PDF属性也做了:
1985 % \begin{macrocode}
1986 \def\makecover{%
1987 \hypersetup{%
1988 pdftitle = {\cqu@ctitle},
1989 pdfauthor = {\cqu@cauthor},
1990 pdfsubject = {\cqu@thesistypenameCN},
1991 pdfkeywords = {\cqu@ckeywords},
1992 pdfcreator = {CQUThesis--v\version, a LaTeX template.}
1993 }
1994 \phantomsection
1995 \pdfbookmark[-1]{\cqu@ctitle}{ctitle}
1996 \make@cover@CN
1997 \make@cover@EN
1998 }%makecover
1999 % \end{macrocode}
2000 % \end{macro}
2001 %
2002 % \subsection{摘要}
2003 % \subsubsection{信息收集}
2004 % 论文的中英文摘要
2005 % \begin{macrocode}
2006 \newcommand{\cqu@@cabstract}[1]{\long\gdef\cqu@cabstract{#1}}
2007 \newenvironment{cabstract}{\Collect@Body\cqu@@cabstract}{}
2008 \newcommand{\cqu@@eabstract}[1]{\long\gdef\cqu@eabstract{#1}}
2009 \newenvironment{eabstract}{\Collect@Body\cqu@@eabstract}{}
2010 % \end{macrocode}
2011 %
2012 % \subsubsection{生成摘要}
2013 % \begin{macro}{\makeabstract}
2014 % 生成摘要的命令
2015 % \begin{macrocode}
2016 \def\makeabstract{%
2017 \cleardoublepage
2018 \normalsize
2019 \cqu@makeabstract
2020 }%makeabstract
2021 \newcommand{\cqu@makeabstract}{%
2022 \clearpage
2023 \chapter[\cqu@cabstract@tocname]{\cqu@cabstract@name}
2024 \pagestyle{style@normal}
2025 \cqu@fixhead
2026 \pagenumbering{Roman}
2027 \cqu@cabstract
2028 \vskip12bp
2029 \cqu@put@kw{\heiti\cqu@ckw@title\cqu@title@separatorCN}{\cqu@ckeywords}
2030 \if@twosideprint\ifcqu@openany\ifcqu@abstractopenright\cqu@addblankpage\fi\fi\fi
2031 \chapter[\cqu@eabstract@tocname]{\sffamily\textbf{\cqu@eabstract@name}}
2032 \cqu@fixhead
2033 \cqu@eabstract
2034 \vskip12bp
2035 \cqu@put@kw{\textbf{\cqu@ekw@title\cqu@title@separatorEN}}{\cqu@ekeywords}
2036 }
2037 % \end{macrocode}
2038 % \end{macro}
2039 % 排版关键词:
2040 % \begin{macrocode}
2041 \newbox\cqu@kw
2042 \newcommand{\cqu@put@kw}[2]{%
2043 \begingroup
2044 \setbox\cqu@kw=\hbox{#1}
2045 \noindent\hangindent\wd\cqu@kw\hangafter1
2046 \box\cqu@kw#2\par
2047 \endgroup}
2048 % \end{macrocode}
2049 %
2050 % \subsection{独创声明和授权书}
2051 % \begin{macro}{\cquauthpage}
2052 % 绘制独创性声明和授权书页面
2053 % \begin{macrocode}
2054 \NewDocumentCommand{\cqu@makeauth}{o}{%
2055 \clearpage
2056 \thispagestyle{style@empty}
2057 \IfNoValueTF{#1}{%
2058 \rule{0mm}{5mm}
2059 \begin{center}
2060 \zihao{3}
2061 \begin{CJKfilltwosides}{6\ccwd}
2062 \heiti{}\cqu@innotitle
2063 \end{CJKfilltwosides}
2064 \end{center}
2065 \vspace{2mm}
2066 \zihao{-4}
2067 \par\cqu@innobody
2068 \\[5mm]
2069 \par\cqu@innosignature\hfill\cqu@signdate
2070 \vspace{15mm}
2071 \begin{center}
2072 \zihao{3}\heiti
2073 \cqu@authtitle
2074 \end{center}
2075 \vspace{2mm}
2076 \zihao{-4}
2077 \par\cqu@authbody
2078 \\[15mm]
2079 \begin{minipage}{\textwidth}
2080 \begin{minipage}{15\ccwd}
2081 \cqu@authsignaturestu\\[10mm]
2082 \cqu@signdate
2083 \end{minipage}
2084 \hfill
2085 \begin{minipage}{15\ccwd}
2086 \cqu@authsignaturesup\\[10mm]
2087 \cqu@signdate
2088 \end{minipage}
2089 \end{minipage}
2090 }{
2091 \includepdf{#1}
2092 }
2093 }%\cqu@makeauth
2094 \let\cquauthpage\cqu@makeauth
2095 %</cls>
2096 % \end{macrocode}
2097 % \end{macro}
2098 % 定义封面用到的文字常量
2099 % \begin{macrocode}
2100 %<*cfg>
2101 \def\cqu@ckeywords@separator{,}
2102 \def\cqu@ekeywords@separator{, }
2103 \def\cqu@title@separatorCN{:}
2104 \def\cqu@title@separatorEN{:~}
2105 \def\cqu@cabstract@tocname{中文摘要}
2106 \def\cqu@eabstract@tocname{英文摘要}
2107 \def\cqu@cabstract@name{摘\hskip\ccwd{}要}
2108 \def\cqu@eabstract@name{ABSTRACT}
2109 \def\cqu@ckw@title{关键词}
2110 \def\cqu@ekw@title{Key words}
2111 \def\cqu@workby{by}
2112 \ifcqu@bachelor
2113 \def\cqu@thesistypenameCN{重庆大学本科学生毕业设计(论文)}
2114 \def\cqu@thesistypenameEN{Graduation Design(Thesis) of Chongqing University}
2115 \def\cqu@studentCN{学生}
2116 \def\cqu@studentEN{Undergraduate}
2117 \def\cqu@studentnumCN{学号}
2118 \def\cqu@supervisorCN{指导教师}
2119 \def\cqu@supervisorEN{Supervised by{ }}
2120 \def\cqu@assistsupervisorCN{助理指导教师}
2121 \def\cqu@extrasupervisorCN{校外指导教师}
2122 \def\cqu@assistsupervisorEN{Assistant Supervisor}
2123 \def\cqu@majorCN{专业}
2124 \def\cqu@majorEN{Major}
2125 \def\cqu@universitynameCN{重庆大学}
2126 \def\cqu@universitynameEN{Chongqing University}
2127 \else
2128 \ifcqu@master
2129 \def\cqu@thesistypenameCN{重庆大学硕士学位论文}
2130 \def\cqu@thesistypenameEN{A Thesis Submitted to Chongqing University\\%
2131 in Partial Fulfillment of the Requirement for%
2132 \ifcqu@academic{ }the\fi\\\cqu@edgree}
2133 \def\cqu@studentCN{学生姓名}
2134 \def\cqu@supervisorCN{指导教师}
2135 \def\cqu@supervisorEN{Supervised by{ }}
2136 \def\cqu@psupervisorCN{兼职导师}
2137 \def\cqu@psupervisorEN{Pluralistic~Supervisor}
2138 \def\cqu@majorCN{专业}
2139 \def\cqu@majorEN{Specialty}
2140 \ifcqu@academic
2141 \def\cqu@mastertype{(学术学位)}
2142 \def\cqu@majorclassCN{学科门类}
2143 \else
2144 \def\cqu@mastertype{(专业学位)}
2145 \def\cqu@majorclassCN{学位类型}
2146 \fi
2147 \def\cqu@universitynameCN{重庆大学}
2148 \def\cqu@universitynameEN{Chongqing University, Chongqing, China}
2149 \else
2150 \ifcqu@doctor
2151 \def\cqu@thesistypenameCN{重庆大学博士学位论文}
2152 \def\cqu@thesistypenameEN{A Thesis Submitted to Chongqing University\\%
2153 in Partial Fulfillment of the Requirement for the\\\cqu@edgree}
2154 \def\cqu@studentCN{学生姓名}
2155 \def\cqu@studentEN{Ph.D. Candidate}
2156 \def\cqu@supervisorCN{指导教师}
2157 \def\cqu@supervisorEN{Supervised by{ }}
2158 \def\cqu@majorCN{专业}
2159 \def\cqu@majorclassCN{学科门类}
2160 \def\cqu@majorEN{Specialty}
2161 \def\cqu@universitynameCN{重庆大学}
2162 \def\cqu@universitynameEN{Chongqing University}
2163 \else
2164 \ClassWarning{cquthesis}%
2165 {Specified thesis type is obligatory: \MessageBreak
2166 type=[bachelor|master|doctor](How did you bypass the type check?)}{}
2167 \fi
2168 \fi
2169 \fi
2170 \def\cqu@innotitle{独创性声明}
2171 \def\cqu@innobody{%
2172 本人声明所呈交的学位论文是本人在导师指导下进行的研究工作及取得的研究成果。据我所知,除了文中特别标注和致谢的地方外,论文中不包含其他人已经发表或撰写中的研究成果,也不包含为获得重庆大学或其他教育机构的学位或证书而使用过的材料。与我一同工作的同志对本文所做的任何贡献均已在论文中做了明确的说明并表示谢意。}
2173 \def\cqu@innosignature{学位论文作者签名:}
2174 \def\cqu@authtitle{学位论文版权使用授权书}
2175 \def\cqu@authcheckpart{%
2176 保\hskip\ccwd{}密(\hskip2\ccwd),在\rule{3\ccwd}{0.15mm}年解密后适用本授权书。\\
2177 不保密(\hskip2\ccwd)。}
2178 \def\cqu@authbody{
2179 本学位论文作者完全了解重庆大学有关保留、使用学位论文的规定,有权保留并向国家有关部门或机构送交论文的复印件和磁盘,允许论文被查阅和借阅。本人授权重庆大学可以把学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存、汇编学位论文。
2180 \\[\baselineskip]
2181 \indent\parbox{7\ccwd}{本学位论文属于}\hskip\ccwd\parbox{.6\textwidth}{\cqu@authcheckpart}
2182 \\[\baselineskip]
2183 \indent(请只在上述一个括号内打“\ding{51}”)}
2184 \def\cqu@authsignaturestu{学位论文作者签名:}
2185 \def\cqu@authsignaturesup{导师签名:}
2186 \def\cqu@signdate{签字日期:\hskip3\ccwd{}年\hskip2\ccwd{}月\hskip2\ccwd{}日}
2187 %</cfg>
2188 % \end{macrocode}
2189 % \subsection{主要符号对照表}
2190 % \begin{environment}{denotation}
2191 % 定义主要符号对照表
2192 % \begin{macrocode}
2193 %<*cls>
2194 \newlist{cqu@denotation}{description}{1}
2195 \setlist[cqu@denotation]{%
2196 nosep,
2197 font = \normalfont,
2198 align = left,
2199 leftmargin = !,
2200 labelindent = 0mm,
2201 labelwidth = 25mm,
2202 labelsep* = 5mm,
2203 itemindent = 0mm,
2204 }%\setlist
2205 \NewDocumentEnvironment{denotation}{O{20mm} O{30mm}}{%
2206 \chapter*{\cqu@denotation@name}
2207 \chaptermark{\cqu@denotation@name}\cqu@fixhead
2208 \zihao{-4}\begin{cqu@denotation}[labelindent = #1,labelwidth=#2,]
2209 }{
2210 \end{cqu@denotation}}%\denotation
2211 % \end{macrocode}
2212 % \end{environment}
2213 %
2214 % \subsection{目录}
2215 % \subsubsection{定制目录}
2216 % 目录深度和计数器深度,减小章节之间的垂直间隔:
2217 % \begin{macrocode}
2218 \setcounter{tocdepth}{2}
2219 \setcounter{secnumdepth}{3}
2220 \setlength{\cftbeforechapskip}{1mm}
2221 % \end{macrocode}
2222 % 调整subsection的目录缩进
2223 % \begin{macrocode}
2224 \ifcqu@liberalformat
2225 \cftsetindents{chapter}{0em}{1.5em}
2226 \cftsetindents{section}{1.9em}{0.9em}
2227 \cftsetindents{subsection}{4.0em}{1.5em}
2228 \else
2229 \cftsetindents{chapter}{0em}{1.5em}
2230 \cftsetindents{section}{1.5em}{2.2em}
2231 \cftsetindents{subsection}{3.7em}{2.9em}
2232 \fi
2233 % \end{macrocode}
2234 % 目录中的不同级别采用不同的字号和字体,这是按照学校word样例的实现,但是蹊跷的是,样例里的这些做法在官方文件里却没有体现,所以这里列为可选项,适用于三级标题很多的情况:
2235 % \begin{macrocode}
2236 \ifcqu@seriftoc
2237 \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
2238 \renewcommand{\cftchapfont}{\zihao{4}\sffamily\heiti}
2239 \renewcommand{\cftsecfont}{\zihao{5}\sffamily\heiti}
2240 \renewcommand{\cftsubsecfont}{\zihao{5}}
2241 \fi
2242 % \end{macrocode}
2243 % \subsubsection{公式索引}
2244 % \begin{macro}{\listofequationsEN}
2245 % 支持生成双语对照索引,分三个情况:
2246 % \begin{macrocode}
2247 \newlistof[chapter]{equations}{equ}{\listofequationsname}
2248 \newlistof[chapter]{equationsEN}{equEN}{\listofequationsnameEN}
2249 \DeclareDocumentCommand{\listeq}{ m o }{%
2250 \addcontentsline{equ}{equations}{\protect\numberline{\theequation}#1}\par
2251 \IfNoValueTF{#2}{%
2252 \relax
2253 }{%
2254 \if@bicombined
2255 \addcontentsline{equ}{equations}{\protect\numberline{\theequation}#2}\par
2256 \else
2257 \if@biapart
2258 \addcontentsline{equEN}{equationsEN}{\protect\numberline{\theequation}#2}\par
2259 \fi
2260 \fi
2261 }
2262 }%listeq
2263 \setlength{\cftequationsnumwidth}{2.5em}
2264 \setlength{\cftequationsENnumwidth}{2.5em}
2265 \let\eqlist\listeq
2266 % \end{macrocode}
2267 % \end{macro}
2268 %
2269 % 正确输出页眉页脚
2270 % \begin{macrocode}
2271 \tocloftpagestyle{style@normal}
2272 %</cls>
2273 % \end{macrocode}
2274 %
2275 % 决定论文页眉名称 这个变量不能含有格式
2276 % \begin{macrocode}
2277 %<cfg>\let\cqu@thesisname\cqu@thesistypenameCN
2278 % \end{macrocode}
2279 %
2280 % 目录和索引标题居中,包含\cs{fixhead}
2281 % \changes{v0.9.0}{2016/05/16}{把目录加到了PDF书签中。}
2282 % \changes{v1.12}{2016/07/06}{现在,目录、图录、表录、公式表的英文字体也采用了无衬线字。}
2283 % \changes{v1.20}{2017/05/30}{现在,目录中的章节层级也有了尾随圆点,并且,圆点的间距更近了。}
2284 % \begin{macrocode}
2285 %<*cls>
2286 \renewcommand{\cfttoctitlefont}{%
2287 \phantomsection\pdfbookmark[0]{\cqu@tocnameinbkmark}{toc}\cqu@fixhead\hfill\bfseries\sffamily\heiti\zihao{3}}
2288 \renewcommand{\cftloftitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
2289 \renewcommand{\cftlottitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
2290 \renewcommand{\cftequtitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
2291 \renewcommand{\cftequENtitlefont}{\cqu@fixhead\hfill\sffamily\heiti\zihao{3}}
2292 \renewcommand{\cftaftertoctitle}{\hfill}
2293 \renewcommand{\cftafterloftitle}{\hfill}
2294 \renewcommand{\cftafterlottitle}{\hfill}
2295 \renewcommand{\cftafterequtitle}{\hfill}
2296 \renewcommand{\cftafterequENtitle}{\hfill}
2297 \renewcommand{\cftdot}{…}
2298 \renewcommand{\cftdotsep}{0}
2299 \renewcommand{\cftchapdotsep}{\cftdotsep}
2300 \renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}
2301 \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
2302 % \end{macrocode}
2303 %
2304 % 重写使用tocloft宏包情况下的目录和索引生成,每次生成新开一页
2305 % \begin{macrocode}
2306 % \changes{v1.20}{2017/05/30}{除非openany选项打开,否则目录和索引现在会在双页模式进行右开。}
2307 \ifcqu@continuoustoc\relax\else
2308 \renewcommand{\@cfttocstart}{\cleardoublepage}
2309 \renewcommand{\@cfttocfinish}{\cleardoublepage}
2310 \fi
2311 % \end{macrocode}
2312 %
2313 % \begin{macro}{\chapterstar}
2314 % 定义自己的章节命令\cs{chapterstar},不编号,有目录有页眉(这个命令暂时没用上,还待观察)
2315 % \begin{macrocode}
2316 \newcommand{\chapterstar}[1]{%
2317 \chapter*{#1}%
2318 \phantomsection
2319 \@mkboth{#1}{}
2320 \addcontentsline{toc}{chapter}{#1}}
2321 % \end{macrocode}
2322 % \end{macro}
2323 %
2324 % \subsection{参考文献}
2325 % \changes{v0.9.7}{2016/06/09}{参考文献现在能正确地显示为五号字了。}
2326 % \begin{macro}{\inlinecite}
2327 % \begin{macro}{\onlinecite}
2328 % 定义\cs{inlinecite}和\cs{onlinecite}
2329 % \begin{macrocode}
2330 \bibpunct{[}{]}{,}{s}{}{,}
2331 \renewcommand\NAT@citesuper[3]{\ifNAT@swa%
2332 \unskip\kern\p@\textsuperscript{\NAT@@open #1\NAT@@close}%
2333 \if*#3*\else\ (#3)\fi\else #1\fi\endgroup}
2334 \DeclareRobustCommand\inlinecite{\@inlinecite}
2335 \def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup}
2336 \let\onlinecite\inlinecite
2337 % \end{macrocode}
2338 % \end{macro}
2339 % \end{macro}
2340 %
2341 % 将参考文献加入目录和pdf书签中
2342 % \begin{macrocode}
2343 \pretocmd{\bibliography}{%
2344 \clearpage\phantomsection\addcontentsline{toc}{chapter}{\cqu@bib@name}}{}{}
2345 % \end{macrocode}
2346 %
2347 % 参考文献使用五号字,同时优化参考文献占用的空间
2348 % \begin{macrocode}
2349 \AtBeginDocument{%
2350 \pretocmd{\bibliography}{\begingroup\zihao{5}}{}{}
2351 \apptocmd{\bibliography}{\endgroup}{}{}
2352 }%AtBeginDocument
2353 \renewcommand\@biblabel[1]{\zihao{5}[#1]}
2354 \renewenvironment{thebibliography}[1]
2355 {\chapter*{\cqu@bib@name
2356 \@mkboth{\cqu@bib@name}{}}%
2357 \list{\@biblabel{\@arabic\c@enumiv}}%
2358 {\settowidth\labelwidth{\@biblabel{#1}}%
2359 \leftmargin\labelwidth
2360 \advance\leftmargin\labelsep
2361 \setlength{\parsep}{1mm}
2362 \setlength{\labelsep}{0.5em}
2363 \setlength{\itemsep}{0.05pc}
2364 \setlength{\listparindent}{0in}
2365 \setlength{\itemindent}{0in}
2366 \setlength{\rightmargin}{0in}
2367 \@openbib@code
2368 \usecounter{enumiv}%
2369 \let\p@enumiv\@empty
2370 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
2371 \sloppy
2372 \clubpenalty4000
2373 \@clubpenalty\clubpenalty
2374 \widowpenalty4000%
2375 \sfcode`\.\@m
2376 }{%
2377 \def\@noitemerr
2378 {\@latex@warning{Empty `thebibliography' environment}}%
2379 \endlist \vskip.2in}
2380 % \end{macrocode}
2381 %
2382 %\subsection{载入配置文件}
2383 % 配置文件用于降低主文件的压力:
2384 % \begin{macrocode}
2385 \AtEndOfClass{\input{cquthesis.cfg}}
2386 %</cls>
2387 % \end{macrocode}
2388 %
2389 % \iffalse
2390 % \begin{macrocode}
2391 %<*dtx-style>
2392 \ProvidesPackage{dtx-style}
2393 \RequirePackage[bottom,perpage,hang,]{footmisc}
2394 \RequirePackage{hypdoc}
2395 \RequirePackage[UTF8,scheme=chinese]{ctex}
2396 \RequirePackage[
2397 top=2.5cm, bottom=2.5cm,
2398 left=4cm, right=2cm,
2399 headsep=3mm]{geometry}
2400 \RequirePackage{array,longtable,booktabs}
2401 \RequirePackage{listings}
2402 \RequirePackage{fancyhdr}
2403 \RequirePackage{xcolor}
2404 \RequirePackage{enumitem}
2405 \RequirePackage{etoolbox}
2406 \RequirePackage{metalogo}
2407 \RequirePackage{graphicx}
2408 \RequirePackage{xspace}
2409 \RequirePackage{pifont}
2410
2411 \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
2412 \let\cqu@footnotesize\footnotesize
2413 \renewcommand{\footnotesize}{\cqu@footnotesize\zihao{-5}}
2414 \footnotemargin1.5em\relax
2415
2416 \let\cqu@makefnmark\@makefnmark
2417 \def\cqu@@makefnmark{\mbox{{\normalfont\@thefnmark}}}
2418 \pretocmd{\@makefntext}{\let\@makefnmark\cqu@@makefnmark}{}{}
2419 \apptocmd{\@makefntext}{\let\@makefnmark\cqu@makefnmark}{}{}
2420
2421 \colorlet{cqu@macro}{blue!60!black}
2422 \colorlet{cqu@env}{blue!70!black}
2423 \colorlet{cqu@option}{purple}
2424 \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{cqu@macro}}{}{}
2425 \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{cqu@macro}}{}{}
2426 \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{cqu@env}}{}{}
2427 \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{cqu@env}}{}{}
2428
2429 \appto{\TeX}{\xspace}
2430 \appto{\LaTeX}{\xspace}
2431 \appto{\XeTeX}{\xspace}
2432
2433 \def\DescribeOption{%
2434 \leavevmode\@bsphack\begingroup\MakePrivateLetters%
2435 \Describe@Option}
2436 \def\Describe@Option#1{\endgroup
2437 \marginpar{\raggedleft\PrintDescribeOption{#1}}%
2438 \cqu@special@index{option}{#1}\@esphack\ignorespaces}
2439 \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{cqu@option} #1\ }
2440 \def\cqu@special@index#1#2{\@bsphack
2441 \begingroup
2442 \HD@target
2443 \let\HDorg@encapchar\encapchar
2444 \edef\encapchar usage{%
2445 \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
2446 }%
2447 \index{#2\actualchar{\string\ttfamily\space#2}
2448 (#1)\encapchar usage}%
2449 \index{#1:\levelchar#2\actualchar
2450 {\string\ttfamily\space#2}\encapchar usage}%
2451 \endgroup
2452 \@esphack}
2453
2454 \lstdefinestyle{lstStyleBase}{%
2455 basicstyle=\small\ttfamily,
2456 aboveskip=\medskipamount,
2457 belowskip=\medskipamount,
2458 lineskip=0pt,
2459 boxpos=c,
2460 showlines=false,
2461 extendedchars=true,
2462 upquote=true,
2463 tabsize=2,
2464 showtabs=false,
2465 showspaces=false,
2466 showstringspaces=false,
2467 numbers=none,
2468 linewidth=\linewidth,
2469 xleftmargin=4pt,
2470 xrightmargin=0pt,
2471 resetmargins=false,
2472 breaklines=true,
2473 breakatwhitespace=false,
2474 breakindent=0pt,
2475 breakautoindent=true,
2476 columns=flexible,
2477 keepspaces=true,
2478 gobble=2,
2479 framesep=3pt,
2480 rulesep=1pt,
2481 framerule=1pt,
2482 backgroundcolor=\color{gray!5},
2483 stringstyle=\color{green!40!black!100},
2484 keywordstyle=\bfseries\color{blue!50!black},
2485 commentstyle=\slshape\color{black!60}}
2486
2487 \lstdefinestyle{lstStyleShell}{%
2488 style=lstStyleBase,
2489 frame=l,
2490 rulecolor=\color{blue},
2491 language=bash}
2492
2493 \lstdefinestyle{lstStyleLaTeX}{%
2494 style=lstStyleBase,
2495 frame=l,
2496 rulecolor=\color{cyan},
2497 language=[LaTeX]TeX}
2498
2499 \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
2500 \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
2501
2502 \setlist{nosep}
2503
2504 \DeclareDocumentCommand{\option}{m}{\textsf{#1}\xspace}
2505 \DeclareDocumentCommand{\env}{m}{\texttt{#1}\xspace}
2506 \DeclareDocumentCommand{\pkg}{s m}{%
2507 \texttt{#2}\xspace\IfBooleanF#1{\cqu@special@index{package}{#2}}}
2508 \DeclareDocumentCommand{\file}{s m}{%
2509 \texttt{#2}\xspace\IfBooleanF#1{\cqu@special@index{file}{#2}}}
2510 \newcommand{\myentry}[1]{%
2511 \marginpar{\raggedleft\color{purple}\bfseries\strut #1}}
2512 \newcommand{\note}[1]{{%
2513 \color{magenta}{\noindent\bfseries 说明:}\emph{#1}}}
2514
2515 \def\cquthesis{\textsc{Cqu}\-\textsc{Thesis}}
2516 %</dtx-style>
2517 % \end{macrocode}
2518 % \fi
2519 %
2520 % \Finale
2521 \endinput