% \iffalse meta-comment % % Copyright (C) 2005-2017 by Ruini Xue % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % 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.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % This work has the LPPL maintenance status `maintained'. % % \fi % % \iffalse %<*driver> \ProvidesFile{thuthesis.dtx}[2017/12/24 5.4.3 Tsinghua University Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{\jobname.dtx} \end{document} % % \fi % % \CheckSum{0} % % \CharacterTable % {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 % 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 % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % \DoNotIndex{\newenvironment,\@bsphack,\@empty,\@esphack,\sfcode} % \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter} % \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection} % \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter} % \DoNotIndex{\RequirePackage,\setcounter,\setlength,\string,\strut} % \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage} % \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\} % \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} % \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand} % \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect} % \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize} % \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny} % \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty} % \DoNotIndex{\textbf,\textit,\textsf,\textsc} % \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad} % \DoNotIndex{\centering,\raggedright,\ref} % \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize} % \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne} % \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass} % \DoNotIndex{\AtBeginDocument,\AtEndDocument} % % \GetFileInfo{\jobname.dtx} % % \changes{v1.0}{2005/07/06}{Please refer to ``Bao--Pan'' version.} % \changes{v1.1}{2005/11/03}{Initial version, migrate from the old ``Bao--Pan'' % version. Make the template a class instead of package.} % \changes{v1.2}{2005/11/04}{Remove \pkg{fancyref}; Remove \pkg{ucite} and implement % \cs{onlinecite}; use package \pkg{arial} or \pkg{helvet} selectively.} % \changes{v1.3}{2005/11/14}{Replace \pkg{subfigure} with \pkg{subfig}, replace \pkg{caption2} % with \pkg{caption}, add details about using figure are in the example.} % \changes{v1.4rc1}{2005/11/20}{I do not know why \cs{thu@authorizationaddon} does not work % now for v1.3, while it's fine in v1.2. Temporarily, I remove the directive % :(. There might be better solution. Other changes: add \option{config} option to % subfig to be compatible with subfigure. add \pkg{courier} package for tt font.} % \changes{v1.4}{2005/12/05}{Fix the problem of \textbf{chinese}, which is % because both CJK and everysel redefine the \cs{selectfont}. So, a not so good % workaround is to merge them up. Add \file{shuji.tex} example. Add \cs{pozhehao} command.} % \changes{v2.1}{2006/02/27}{Add support to bachelor thesis.} % \changes{v2.1}{2006/03/01}{Remove \pkg{fancyhdr} and \pkg{geometry}.} % \changes{v2.1}{2006/03/01}{Redefine footnote marks.} % \changes{v2.1}{2006/03/01}{Replace \file{thubib.bst} with \file{chinesebst.bst}.} % \changes{v2.1}{2006/03/02}{Merge the modification of \pkg{ntheorem}.} % \changes{v2.1}{2006/03/02}{Remove \pkg{footmisc} and refine the document.} % \changes{v2.1}{2006/03/03}{Work very hard on the document.} % \changes{v2.1}{2006/03/03}{Add \cs{checklab} code to reduce ``unresolved labels'' warning} % \changes{v2.2}{2006/03/26}{Adjust margins. How bad it is to simulate MS WORD!.} % \changes{v2.2}{2006/03/26}{Add bachelor training overview details supporting.} % \changes{v2.2}{2006/03/26}{CJK support in preamble.} % \changes{v2.2}{2006/03/26}{Adjust hyperref to avoid boxes around links.} % \changes{v2.3}{2006/04/07}{Fix a great bug: \cs{PassOptionsToClass} and \cs{LoadClass} % rather than \cs{PassOptionToPackage} and \cs{LoadPackage}.} % \changes{v2.3}{2006/04/07}{Reorganize the codes in cover, make the pagestyle more readable.} % \changes{v2.3}{2006/04/07}{Add gbk2uni into the document.} % \changes{v2.3}{2006/04/07}{Support \option{openright} and openany.} % \changes{v2.3}{2006/04/09}{Adjust \cs{hypersetup} to remove color and box.} % \changes{v2.3}{2006/04/09}{Adjust margins again.} % \changes{v2.3}{2006/04/09}{Adjust references formats.} % \changes{v2.3}{2006/04/09}{Redefine frontmatter and mainmatter to fit our case.} % \changes{v2.3}{2006/04/09}{Add assumption environment.} % \changes{v2.3}{2006/04/09}{Change the brace in the cover.} % \changes{v2.4}{2006/04/14}{Fill more pdf info. with \cs{hypersetup}.} % \changes{v2.4}{2006/04/14}{自动隐藏密级为内部时后面的五角星。} % \changes{v2.4}{2006/04/14}{增加“注释 (Remark)”环境。} % \changes{v2.4}{2006/04/14}{压缩 item 之间的距离。} % \changes{v2.4}{2006/04/14}{\file{thubib.bst} 文献标题取消自动小写。} % \changes{v2.4}{2006/04/14}{中文参考文献取消 In: Proceedings。} % \changes{v2.4}{2006/04/14}{英文文参考文献调整 In: editor, Proceedings。} % \changes{v2.4}{2006/04/14}{参考文献为学位论文时,加方括号,作者后面为实心点。} % \changes{v2.4}{2006/04/14}{中文参考文献作者超过三个加等。} % \changes{v2.4}{2006/04/14}{中文参考文献需要在 bib 中指定 |lang="chinese"|。} % \changes{v2.4}{2006/04/14}{学位论文不在需要 type 字段。} % \changes{v2.4}{2006/04/14}{为摘要等条目增加书签。} % \changes{v2.4}{2006/04/14}{章节的编号用黑体,也就是自动打开 \option{arialtitle} 选项。} % \changes{v2.4.1}{2006/04/17}{2.4 忘了把关键词的 tabular 改成 thu@tabular。} % \changes{v2.4.1}{2006/04/17}{参考文献最后一个作者前是逗号而不是 and。} % \changes{v2.4.2}{2006/04/18}{去掉参考文献第二个作者后面烦人的逗号。} % \changes{v2.5}{2006/05/19}{对本科论文进行大幅度的重写,因为教务处修改了格式要求。} % \changes{v2.5}{2006/05/19}{重新整理代码,使其布局更易读。} % \changes{v2.5.1}{2006/05/24}{如果选项设置了 dvips,但是用 PDF\LaTeX\ 编译,报错。} % \changes{v2.5.1}{2006/05/24}{根据教务处的新要求调整附录部分。} % \changes{v2.5.1}{2006/05/25}{参考文献中杂志文章如果没有卷号,那么页码直接跟在 % 年份后面,并用句点分割。在 \file{thubib.bst} 中增加 output.year 函数。} % \changes{v2.6}{2006/06/09}{增加 dvipdfm 选项。} % \changes{v2.6.1}{2006/06/16}{取消 \file{thubib.bst} 中 inbook 类 volume 后的页 % 码。} % \changes{v2.6.2}{2006/06/18}{改正 groupmembers 的拼写错误。} % \changes{v3.0}{2007/05/12}{不用专门为本科论文生成“\textbf{提交}”版本了。} % \changes{v3.0}{2007/05/12}{没有了综合论文训练页面,很多本科论文专用命令就消失了。} % \changes{v4.4}{2008/05/12}{修复网址断字。} % \changes{v4.5}{2008/01/03}{加入 \XeTeX\ 支持,需要 \pkg{xeCJK}。} % \changes{v4.5}{2008/01/04}{彻底转向 UTF-8,并支持 \XeLaTeX。} % \changes{v4.5}{2009/01/03}{增加 xetex, pdftex 选项。} % \changes{v4.6}{2011/04/27}{增加博士后文档部分。} % \changes{v4.6}{2011/10/22}{使用手册更新。} % \changes{v4.7}{2012/06/12}{去掉 \pkg{hypernat} 依赖,\pkg{hyperref} 和 \pkg{natbib} 可以很好配合了。} % \changes{v4.8}{2013/03/02}{no need to load \pkg{indentfirst} directly since we use \pkg{ctex}.} % \changes{v4.8}{2013/03/02}{内部调用 \pkg{ctex} 宏包,自动检测编译引擎。} % \changes{v4.8}{2013/03/04}{dvips method is deprecated. We ask their users to load it manually.} % \changes{v4.8}{2013/03/09}{reset baselinestretch after ctex's change.} % \changes{v4.8}{2014/11/25}{好几年累积的一些更新,最重要的是切换到 \CTeX。} % \changes{v5.4.2}{2017/12/16}{删除 \cs{pozhehao}。} % % \def\indexname{索引} % \def\glossaryname{修改记录} % \IndexPrologue{\section{\indexname}} % \GlossaryPrologue{\section{\glossaryname}} % % \title{\bfseries\color{violet}\thuthesis:清华大学学位论文模板} % \author{{\fangsong 薛瑞尼}\\[5pt]\texttt{xueruini@gmail.com}} % \date{v\fileversion\ (\filedate)} % \maketitle\thispagestyle{empty} % % % \begin{abstract}\noindent % 此宏包旨在建立一个简单易用的清华大学学位论文模板,包括本科综合论文训练、硕士 % 论文、博士论文以及博士后出站报告。 % \end{abstract} % % \vskip2cm % \def\abstractname{免责声明} % \begin{abstract} % \noindent % \begin{enumerate} % \item 本模板的发布遵守 \LaTeX\ Project Public License,使用前请认真阅读协议内 % 容。 % \item 本模板为作者根据清华大学教务处颁发的《综合论文训练写作指南》,清华大学研 % 究生院颁发的《研究生学位论文写作指南》,清华大学《编写“清华大学博士后研究报 % 告”参考意见》编写而成,旨在供清华大学毕业生撰写学位论文使用。 % \item 清华大学教务处和研究生院只提供毕业论文写作指南,不提供官方模板,也不会授 % 权第三方模板为官方模板,所以此模板仅为写作指南的参考实现,不保证格式审查老师 % 不提意见。任何由于使用本模板而引起的论文格式审查问题均与本模板作者无关。 % \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,请严格遵 % 守 \LaTeX\ Project Public License 协议。由于违犯协议而引起的任何纠纷争端均与 % 本模板作者无关。 % \end{enumerate} % \end{abstract} % % % \clearpage % \pagestyle{fancy} % \begin{multicols}{2}[ % \setlength{\columnseprule}{.4pt} % \setlength{\columnsep}{18pt}] % \tableofcontents % \end{multicols} % \clearpage % % \section{模板介绍} % \thuthesis\ (\textbf{T}sing\textbf{h}ua \textbf{U}niversity \LaTeX\ % \textbf{Thesis} Template) 是为了帮助清华大学毕业生撰写毕业论文而编写 % 的 \LaTeX\ 论文模板。 % % 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据 % 第~\ref{sec:howtoask} 节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代 % 码的贡献。 % % \note[注意:]{模板的作用在于减少论文写作过程中格式调整的时间。前提是遵守模板的 % 用法,否则即便用了 \thuthesis\ 也难以保证输出的论文符合学校规范。} % % % \section{安装} % \label{sec:installation} % % \thuthesis\ 已经包含在主要的 \TeX\ 发行版中,一般不需要安装,可以利用发行版自 % 带更新工具自动更新。阅读文档可以使用以下命令: % \begin{shell} % $ texdoc thuthesis % \end{shell} % % 如果要使用开发版,需自己下载,\thuthesis\ 相关链接: % \begin{itemize} % \item 主页:\href{https://github.com/xueruini/thuthesis}{GitHub} % \item 下载:\href{http://www.ctan.org/pkg/thuthesis}{CTAN} % \end{itemize} % % \subsection{模板的组成} % 下表列出了 \thuthesis\ 的主要文件及其功能介绍: % % \begin{longtable}{l|p{8cm}} % \toprule % {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule % \endfirsthead % \midrule % {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule % \endhead % \endfoot % \endlastfoot % thuthesis.ins & \textsc{DocStrip} 驱动文件(开发用) \\ % thuthesis.dtx & \textsc{DocStrip} 源文件(开发用)\\\midrule % thuthesis.cls & 模板类文件\\ % thuthesis.cfg & 模板配置文件\\ % thuthesis-numeric.bst & 参考文献样式文件\\ % thuthesis-author-year.bst & 参考文献样式文件\\\midrule % main.tex & 示例文档主文件\\ % shuji.tex & 书脊示例文档\\ % ref/ & 示例文档参考文献目录\\ % data/ & 示例文档章节具体内容\\ % figures/ & 示例文档图片路径\\ % thuthesis.sty & 为示例文档加载其它宏包\\\midrule % Makefile & Makefile\\ % latexmkrc & latexmk 配置文件 \\ % README.md & Readme\\ % \textbf{thuthesis.pdf} & 用户手册(本文档)\\\bottomrule % \end{longtable} % % 几点说明: % \begin{itemize} % \item \file{thuthesis.cls} 和 \file{thuthesis.cfg} 可由 \file{thuthesis.ins} % 和 \file{thuthesis.dtx} 生成,但为了降低新手用户的使用难度,故 % 将 \file{thuthesis.cls} 和 \file{thuthesis.cfg} 文件一起发布。 % \item 使用前阅读文档:\file{thuthesis.pdf}。 % \end{itemize} % % \subsection{生成模板} % \label{sec:generate-cls} % \note[提示:]{若使用 \TeX 发行版自带的 \thuthesis\ 或 Github 上发布的版本,可忽 % 略此节,直接阅读第~\ref{sec:generate-thesis} 节。若下载 CTAN 包或者 Github 开发 % 代码,请阅读本节了解生成模板文件的步骤。} % % 模板解压缩后生成文件夹 \file{thuthesis-vX.Y.Z}\footnote{\texttt{vX.Y.Z} 为版本 % 号。},其中包括:模板源文件(\file{thuthesis.ins} 和 \file{thuthesis.dtx}),参 % 考文献样式 \file{thuthesis-numeric.bst} 和 \file{thuthesis-author-year.bst},示例文档 % (\file{main.tex},\file{shuji.tex},\file{thuthesis.sty}\footnote{可能用到的包 % 以及一些命令定义都放在这里,以免 \file{thuthesis.cls} 过分臃 % 肿。},\file{data/} 和 \file{figures/} 和 \file{ref/})。在使用之前需要先生成模 % 板文件和配置文件(具体命令细节请参考 \file{README.md} 和 \file{Makefile}): % % \begin{shell} % $ cd thuthesis-vX.Y.Z % # 生成 thuthesis.cls 和 thuthesis.cfg % $ latex thuthesis.ins % % # 下面的命令用来生成用户手册,可以不执行 % $ xelatex thuthesis.dtx % $ makeindex -s gind.ist -o thuthesis.ind thuthesis.idx % $ makeindex -s gglo.ist -o thuthesis.gls thuthesis.glo % $ xelatex thuthesis.dtx % $ xelatex thuthesis.dtx % 生成说明文档 thuthesis.pdf % \end{shell} % % \subsection{生成论文} % \label{sec:generate-thesis} % 本节介绍几种常见的生成论文的方法。用户可根据自己的情况选择。 % % \subsubsection{\XeLaTeX} % \label{sec:xelatex} % 很多用户对 \LaTeX\ 命令执行的次数不太清楚。一个基本的原则是多次运行 \LaTeX\ 命 % 令直至不再出现警告。下面给出生成示例文档的详细过程(\texttt{\#} 开头的行为注 % 释),首先来看推荐的 \texttt{xelatex} 方式: % \begin{shell} % # 1. 发现里面的引用关系,文件后缀 .tex 可以省略 % $ xelatex main % % # 2. 编译参考文件源文件,生成 bbl 文件 % $ bibtex main % % # 3. 下面解决引用 % $ xelatex main % $ xelatex main # 此时生成完整的 pdf 文件 % \end{shell} % % \subsubsection{PDF\LaTeX} % \label{sec:pdflatex} % 如果使用 PDF\LaTeX,按照第~\ref{sec:xelatex} 节的顺序执行即可,只是将命令中 % \texttt{xelatex} 替换为 \texttt{pdflatex}。 % % 需要注意的是 PDF\LaTeX\ 不能处理常见的 EPS 图形,需要先用 \texttt{epstopdf} 将其转化 % 成 PDF。不过 PDF\LaTeX\ 增加了对 png,jpg 等格式的支持,比较方便。\TeX Live % 自从 2010 版本起自动调用 \texttt{epstopdf} 将 EPS 图形转化为 PDF。 % % \subsubsection{latexmk} % \label{sec:latexmk} % \texttt{latexmk} 命令支持全自动生成 \LaTeX\ 编写的文档,并且支持使用不同的工具 % 链来进行生成,它会自动运行多次工具直到交叉引用都被解决。下面给出了一个用 % \texttt{latexmk} 调用 \texttt{xelatex} 生成最终文档的示例: % \begin{shell} % # 一句话就够了! % $ latexmk -xelatex main % \end{shell} % % \subsubsection{make} % \label{sec:make} % \note[提示:]{若要使用 \texttt{make} 编译,需自行下载模板。因为 \TeX\ 发行版中 % 的 \file{Makefile} 不在当前目录。} % % 上面的方法虽然不复杂,但是每次都输入还是非常罗嗦,所以 \thuthesis\ 提供了一 % 个 \file{Makefile}: % % \begin{shell} % $ make clean % $ make cls # 生成 thuthesis.cls 和 thuthesis.cfg % $ make doc # 生成说明文档 thuthesis.pdf % $ make thesis # 生成示例文档 main.pdf % $ make shuji # 生成书脊 shuji.pdf % \end{shell} % % \thuthesis\ 的 \file{Makefile} 默认用 \texttt{latexmk} 调用\texttt{xelatex} 编 % 译,此外还支持直接用 \texttt{xelatex} 和\texttt{pdflatex} 编译。如有需要可修 % 改 \file{Makefile} 开头的参数或通过命令行传递参数(请参看 \file{README.md}), % 进一步还可以修改 \file{latexmkrc} 进行定制。 % % \subsection{升级} % \label{sec:updgrade} % \thuthesis\ 升级非常简单,可以通过 \TeX 发行版的包管理工具自动更新发行版,也可 % 以下载最新的开发版, % 将 \file{thuthesis.ins},\file{thuthesis.dtx},\file{thuthesis-author-year.bst} % 和 \file{thuthesis-numeric.bst} 拷贝至工作目录覆盖相应的文件,然后运行: % \begin{shell} % $ latex thuthesis.ins % \end{shell} % % 生成新的类文件和配置文件即可。也可以直接拷 % 贝 \file{thuthesis.cls},\file{thuthesis.cfg},\file{thuthesis-author-year.bst} % 和 \file{thuthesis-numeric.bst},免去上面命令的执行。 % % % \section{使用说明} % \label{sec:usage} % 本手册假定用户已经能处理一般的 \LaTeX\ 文档,并对 \BibTeX\ 有一定了解。如果 % 从来没有接触过 \TeX\ 和 \LaTeX,建议先学习相关的基础知识。 % % \subsection{关于提问} % \label{sec:howtoask} % 按照优先级推荐提问的位置如下: % % \begin{itemize} % \item \href{http://github.com/xueruini/thuthesis/issues}{Github Issues} % \item \href{http://www.newsmth.net/nForum/#!board/TeX}{Tex@newsmth} % \item \href{http://groups.google.com/group/thuthesis}{ThuThesis@Google Groups} % \end{itemize} % % \subsection{示例文件} % \label{sec:userguide} % 模板核心文件 % 有:\file{thuthesis.cls},\file{thuthesis.cfg},\file{thuthesis-numeric.bst} 和 % \file{thuthesis-author-year.bst},但是如果没有示例文档用户会发现很难下手。所以推 % 荐新用户从模板自带的示例文档入手,里面包括了论文写作用到的所有命令及其使用方法, % 只需要用自己的内容进行相应替换就可以。对于不清楚的命令可以查阅本手册。下面的例 % 子描述了模板中章节的组织形式,来自于示例文档,具体内容可以参考模板附带 % 的 \file{main.tex} 和 \file{data/}。 % % \lstinputlisting[style=lstStyleLaTeX]{main.tex} % % \subsection{论文选项} % \label{sec:option} % % \DescribeOption{degree} % 选择论文类型,当前支 % 持:\option{bachelor},\option{master},\option{doctor},\option{postdoctor}。 % 为必选项。 % \begin{latex} % % 博士论文 % \documentclass[degree=doctor]{thuthesis} % % % 硕士论文 % \documentclass[degree=master]{thuthesis} % \end{latex} % % \DescribeOption{secret} % 涉秘论文开关(默认:关闭)。第 \ref{sec:setup-secret} 节两个配置(或命 % 令)\cs{secretlevel}\marg{级别} 和 \cs{secretyear}\marg{年数} 分别用来指定保 % 密级别和时限。若不设置,则二者取默认值,分别为“\textbf{秘密}”和当前年份。 % \begin{latex} % \documentclass[secret]{thuthesis} % 打开保密 % \documentclass[secret=false]{thuthesis} % 关闭保密 % % \thusetup{ % secretlevel=公开, % secretyear=10 % } % % 或者 % \secretlevel{保密} % \secretyear{10} % \end{latex} % % \DescribeOption{pifootnote} % 是否使用 \pkg{pifont} 的带圈字符标记脚注编号。默认关闭,即使用\cs{textcircled} % 命令,效果不太好,但是符合学校样式要求。不管使用哪种方式,一页的脚注建议控制 % 在 9 个以内,否则大于 10的数字带圈的效果不太好。建议使用时打开此选项,脚注编号 % 很漂亮,如下: % \begin{latex} % \documentclass[pifootnote]{thuthesis} % \end{latex} % % \DescribeOption{openany} % \DescribeOption{openright} % 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{openright},也 % 是 \thuthesis\ 的默认选项。在这种情况下,如果前一章的最后一页也是奇数,那么模板 % 会自动生成一个纯粹的空白页,很多人不是很习惯这种方式,而且学校的格式似乎更倾向 % 于页面连续,那就是通常所说的 \option{openany}\footnote{目前所有论文都 % 是 \option{openany}。}。这两个选项不用设置,\thuthesis\ 会根据当前论文类型自动选 % 择。 % % \DescribeOption{arialtoc} % 目录项(章目录项除外)中的英文是否用 \emph{Arial} 字体。本选项 % 和 \option{arialtitle} 都不用用户干预,模板根据当前论文类型自动设置。 % % \DescribeOption{arialtitle} % 章节标题中英文是否用 \emph{Arial} 字体(默认打开)。 % % \subsection{引用方式} % \label{sec:citestyle} % 模板支持两种引用方式,分别为理工科常用的“数字式 [1]”和文科常用 % 的“作者-年份 (Zhang, 2008)”。使用者可通过 \cs{bibliographystyle} 来选择: % \begin{latex} % % 数字式 % \bibliographystyle{thuthesis-numeric} % % % 作者-年份 % \bibliographystyle{thuthesis-author-year} % \end{latex} % % \DescribeMacro{\inlinecite} % 学校要求的参考文献引用有两种模式:(1)上标模式。比如``同样的工作有很 % 多$^{[1,2]}$\ldots''。(2)正文模式。比如``文[3] 中详细说明了\ldots''。其中上标 % 模式使用远比正文模式频繁,所以为了符合使用习惯,上标模式仍然用常规 % 的 \cs{cite}\marg{key},而 \cs{inlinecite}\marg{key} 则用来生成正文模式。 % % 关于参考文献模板推荐使用 \BibTeX,关于中文参考文献需要额外增加一个 Entry: % \texttt{lang},将其设置为 \texttt{zh} 用来指示此参考文献为中文。如: % \begin{latex} % @INPROCEEDINGS{cnproceed, % author = {王重阳 and 黄药师 and 欧阳峰 and 洪七公 and 段皇帝}, % title = {武林高手从入门到精通}, % booktitle = {第~$N$~次华山论剑}, % year = 2006, % address = {西安, 中国}, % month = sep, % lang = "zh", % } % % @ARTICLE{cnarticle, % AUTHOR = "贾宝玉 and 林黛玉 and 薛宝钗 and 贾探春", % TITLE = "论刘姥姥食量大如牛之现实意义", % JOURNAL = "红楼梦杂谈", % PAGES = "260--266", % VOLUME = "224", % YEAR = "1800", % LANG = "zh", % } % \end{latex} % % 注意如果不需要引用参考文献,请删除 \file{main.tex} 中 \cs{bibliography} 开头的两行, % 以避免可能的编译错误。 % % \subsection{中文字体} % \label{sec:chinese-fonts} % % \subsubsection{字体配置} % \label{sec:font-config} % 正确配置中文字体是使用模板的第一步。模板调用 \CTeX\ 宏包,提供如下字体使用方式: % \begin{itemize} % \item 基于传统 \pkg{CJK} 包,使用 \LaTeX、PDF\LaTeX\ 编译。 % \item 基于 \pkg{xeCJK} 包,使用 \XeLaTeX\ 编译。(推荐方法) % \end{itemize} % % 模板默认使用 \CTeX\ 的字体配置。关于中文字体安装、配置的所有问题不在本模板讨论 % 范围。 % % \subsubsection{字体命令} % \label{sec:fontcmds} % \myentry{字体} % \DescribeMacro{\songti} % \DescribeMacro{\fangsong} % \DescribeMacro{\heiti} % \DescribeMacro{\kaishu} % 用来切换宋体、仿宋、黑体、楷体四种基本字体。 % % \begin{latex} % {\songti 乾:元,亨,利贞} % {\fangsong 初九,潜龙勿用} % {\heiti 九二,见龙在田,利见大人} % {\kaishu 九三,君子终日乾乾,夕惕若,厉,无咎} % \end{latex} % % \myentry{字号} % \DescribeMacro{\chuhao} % \DescribeMacro{\xiaochu} % \DescribeMacro{\yihao} % \DescribeMacro{\xiaoyi} % \DescribeMacro{\bahao} % 定义字体大小,分别为: % % \begin{center} % \begin{tabular}{llllll} % \toprule % \cs{chuhao} & \cs{xiaochu} & \cs{yihao} & \cs{xiaoyi} & \cs{erhao} & \cs{xiaoer}\\ % \cs{sanhao} & \cs{xiaosan} & \cs{sihao} & \cs{banxiaosi} & \cs{xiaosi} & \cs{dawu}\\ % \cs{wuhao} & \cs{xiaowu} & \cs{liuhao} & \cs{xiaoliu} & \cs{qihao} & \cs{bahao}\\\bottomrule % \end{tabular} % \end{center} % % 使用方法为:\cs{command}\oarg{num},其中 command 为字号命令,num 为行距。比 % 如 \cs{xiaosi}[1.5] 表示选择小四字体,行距 1.5 倍。写作指南要求表格中的字体 % 是 \cs{dawu},模板已经设置好了。 % % \begin{latex} % {\erhao 二号} % {\sanhao[1.5] 三号} % {\sihao 四号} % {\qihao[2] 七号} % \end{latex} % % 也可以使用 \CTeX\ 定义的 \cs{zihao}\marg{num} 来切换字号,具体用法参看其文 % 档。 % % \subsection{封面信息} % \label{sec:titlepage} % 封面信息提供两种配置方法:一是通过统一设置命 % 令 \cs{thusetup} 通过\emph{key=value} 形式完成;二是每个信息利用命令独立设置, % 其中命令的名字跟 \emph{key} 相同。两种方式可以交叉使用,并按顺序执行(即后来的设置会覆 % 盖前面的)。以 \texttt{c} 开头的命令跟中文相关,\texttt{e} 开头则为对应的英文。 % % \DescribeMacro{\thusetup} % \cs{thusetup} 用法与常见 \emph{key=value} 命令相同,如下: % \begin{latex} % \thusetup{ % key1 = value1, % key2 = {a value, with comma}, % } % % 可以多次调用 % \thusetup{ % key3 = value3, % key1 = value11, % 覆盖 value1 % } % \end{latex} % % \note[注意:]{\cs{thusetup} 使用 \pkg{kvoptions} 机制,所以配置项之间不能有空行,否则 % 会报错。} % % 大多数命令的使用方法都是: \cs{command}\marg{arg},例外者将具体指出。这些命令都 % 在示例文档的 \file{data/cover.tex} 中。 % % \subsubsection{密级} % \label{sec:setup-secret} % \DescribeMacro{\secretlevel} % \DescribeMacro{\secretyear} % 定义秘密级别和年限,需要打开论文的 \option{secret} 选项。 % \begin{latex} % \thusetup{ % secretyear=10, % secretlevel={内部}, % } % % 以下命令方式与上面的等价: % \secretyear{10} % \secretlevel{内部} % \end{latex} % % \subsubsection{博士后专用参数} % \DescribeMacro{\id} % \DescribeMacro{\udc} % \DescribeMacro{\catalognumber} % 只见过,没用过,不知道具体是什么意思。 % \begin{latex} % \thusetup{ % catalognumber={分类号}, % udc={udc}, % id={id} % } % % 等价: % \catalognumber{分类号} % \udc{udc} % \id{编号} % \end{latex} % % \subsubsection{论文标题} % \DescribeMacro{\ctitle} % \DescribeMacro{\etitle} % 中英文标题。可以在标题内部使用换行|\\|。 % \begin{latex} % \thusetup{ % ctitle={论文中文题目}, % etitle={Thesis English Title} % } % % 等价: % \ctitle{论文中文题目} % \etitle{Thesis English Title} % \end{latex} % % \subsubsection{作者姓名} % \DescribeMacro{\cauthor} % \DescribeMacro{\eauthor} % 作者姓名。 % \begin{latex} % \thusetup{ % cauthor={中文姓名}, % eauthor={Name in Pinyin} % } % % 等价: % \cauthor{中文姓名} % \eauthor{Name in PinYin} % \end{latex} % % \subsubsection{申请学位名称} % \label{sec:degree} % \DescribeMacro{\cdegree} % \DescribeMacro{\edegree} % 学位和专业的设置比想象的要复杂一些: % % \begin{longtable}{p{2cm}p{8cm}p{4cm}} % \toprule % 学位类型 & edegree & emajor \\\midrule % 学术型硕士 % & 必须为“Master of Art”或“Master of Science”(注意大 % 小写),其中 “哲学、文学、历史学、法学、教育学、艺术学门类,公共 % 管理学科填写“Master of Arts”,其它填写“Master of Science”。 % & “获得一级学科授权的学科填写一级学科名称,其它填写二级学 % 科名称”。\\\midrule % 专业型硕士 % & 专业学位英文名称全称 & % 工程硕士填写工程领域,其它专业学位不填写此项。\\\midrule % 学术型博士 & Doctor of Philosophy(注意大小写) % & 获得一级学科授权的学科填写一级学科名称,其它填写二级学科名称。\\\midrule % 专业型博士 & 专业学位英文名称全称 & 不填写此项。\\\bottomrule % \end{longtable} % % \begin{latex} % \thusetup{ % cdegree={您要申请什么学位}, % edegree={degree in English} % } % % 等价: % \cdegree{您要申请什么学位} % \edegree{degree in English} % \end{latex} % % \subsubsection{院系名称} % \DescribeMacro{\cdepartment} % \DescribeMacro{\edepartment} % 院系名称。 % \begin{latex} % \thusetup{ % cdepartment={系名全称}, % edepartment={Deparment of CS} % } % % 等价: % \cdepartment{系名全称} % \edepartment{Department of CS} % \end{latex} % % \subsubsection{专业名称} % \DescribeMacro{\cmajor} % \DescribeMacro{\emajor} % 参见第 \ref{sec:degree} 节。 % \begin{latex} % \thusetup{ % cmajor={专业名称}, % emajor={Major in English} % } % % 等价: % \cmajor{专业名称} % \emajor{Major in English} % \end{latex} % % \DescribeMacro{\cfirstdiscipline} % \DescribeMacro{\cseconddiscipline} % 博士后专用。 % \begin{latex} % \thusetup{ % cfirstdiscipline={博士后一级学科}, % cseconddiscipline={博士后二级学科} % } % % 等价: % \cfirstdiscipline{博士后一级学科} % \cseconddiscipline{博士后二级学科} % \end{latex} % % \subsubsection{导师} % \myentry{导师} % \DescribeMacro{\csupervisor} % \DescribeMacro{\esupervisor} % 直接导师。 % \begin{latex} % \thusetup{ % csupervisor={导师~教授}, % esupervisor={Supervisor} % } % % 等价: % \csupervisor{导师~教授} % \esupervisor{Supervisor} % \end{latex} % % \myentry{副导师} % \DescribeMacro{\cassosupervisor} % \DescribeMacro{\eassosupervisor} % 本科生的辅导教师,硕士的副指导教师。 % \begin{latex} % \thusetup{ % cassosupervisor={副导师~副教授}, % eassosupervisor={2nd Boss} % } % % 等价: % \cassosupervisor{副导师~副教授} % \eassosupervisor{2nd Boss} % \end{latex} % % \myentry{联合导师} % \DescribeMacro{\ccosupervisor} % \DescribeMacro{\ecosupervisor} % 硕士生联合指导教师,博士生联合导师。 % \begin{latex} % \thusetup{ % ccosupervisor={联合导师~教授}, % ecosupervisor={3rd Boss} % } % % 等价: % \ccosupervisor{联合导师~教授} % \ecosupervisor{3rd Boss} % \end{latex} % % \subsubsection{成文日期} % \DescribeMacro{\cdate} % \DescribeMacro{\edate} % \DescribeMacro{\postdoctordate} % 默认为当前时间,也可以自己指定。 % \begin{latex} % \thusetup{ % cdate={中文日期}, % edate={English Date}, % postdoctordate={2009年7月——2011年7月} % 博士后研究起止日期 % } % % 等价: % \cdate{中文日期} % \edate{English Date} % \postdoctordate{2009年7月——2011年7月} % 博士后研究起止日期 % \end{latex} % % \subsubsection{摘要} % \myentry{摘要正文} % \DescribeEnv{cabstract} % \DescribeEnv{eabstract} % \note[说明:]{摘要正文只能用环境命令的形式,不支持 \cs{thusetup}。} % % \begin{latex} % \begin{cabstract} % 摘要请写在这里... % \end{cabstract} % % \begin{eabstract} % Here comes the abstract in English... % \end{eabstract} % \end{latex} % % \myentry{关键词} % \DescribeMacro{\ckeywords} % \DescribeMacro{\ekeywords} % 关键词用英文逗号分割写入相应的命令中,模板会解析各关键词并生成符合不同论文格式 % 要求的关键词格式。 % \begin{latex} % \thusetup{ % ckeywords={关键词 1, 关键词 2}, % ekeywords={keyword 1, keyword 2} % } % % 等价: % \ckeywords{关键词 1, 关键词 2} % \ekeywords{keyword 1, keyword 2} % \end{latex} % % \myentry{生成封面} % \DescribeMacro{\makecover} % 生成封面,包括首页,授权,摘要等。用法:\cs{makecover}\oarg{file}。如果使用授权 % 说明扫描页,将可选参数中指定为扫描得到的 PDF 文件名,例如: % \begin{latex} % % 直接生成封面 % \makecover % % % 将签字扫描后授权文件 scan-auth.pdf 替换原始页面 % \makecover[scan-auth.pdf] % \end{latex} % % \subsubsection{符号对照表} % \DescribeEnv{denotation} % 主要符号表环境,跟 \env{description} 类似,使用方法参见示例文件。带一个可选参数, % 用来指定符号列的宽度(默认为 2.5cm)。 % \begin{latex} % \begin{denotation} % \item[E] 能量 % \item[m] 质量 % \item[c] 光速 % \end{denotation} % \end{latex} % % 如果默认符号列的宽度不满意,可以通过参数来调整: % \begin{latex} % \begin{denotation}[1.5cm] % 设置为 1.5cm % \item[E] 能量 % \item[m] 质量 % \item[c] 光速 % \end{denotation} % \end{latex} % % \subsection{目录和索引表} % 目录、插图、表格和公式等索引命令分别如下,将其插入到期望的位置即可(带星号的命令表 % 示对应的索引表不会出现在目录中): % % \DescribeMacro{\tableofcontents} % \DescribeMacro{\listoffigures} % \DescribeMacro{\listoffigures*} % \DescribeMacro{\listoftables} % \DescribeMacro{\listoftables*} % \DescribeMacro{\listofequations} % \DescribeMacro{\listofequations*} % \begin{longtable}{ll} % \toprule % {\heiti 用途} & {\heiti 命令} \\\midrule % 目录 & \cs{tableofcontents} \\\midrule % 插图索引 & \cs{listoffigures} \\ % & \cs{listoffigures*} \\\midrule % 表格索引 & \cs{listoftables} \\ % & \cs{listoftables*} \\\midrule % 公式索引 & \cs{listofequations} \\ % & \cs{listofequations*}\\\bottomrule % \end{longtable} % % \LaTeX\ 默认支持插图和表格索引,是通过 \cs{caption} 命令完成的,因此它们必须出 % 现在浮动环境中,否则不被计数。 % % 如果不想让某个表格或者图片出现在索引里面,那么请使用命令 \cs{caption*},这 % 个命令不会给表格编号,也就是出来的只有标题文字而没有``表~xx'',``图~xx'',否则 % 索引里面序号不连续就显得不伦不类,这也是 \LaTeX\ 里星号命令默认的规则。 % % 有这种需求的多是本科同学的英文资料翻译部分,如果你觉得附录中英文原文中的表格和 % 图片显示成``表''和``图''很不协调的话,一个很好的办法还是用 \cs{caption*},参数 % 随便自己写,具体用法请参看示例文档。 % % 如果的确想让其编号,但又不想出现在索引中的话,目前模板暂不支持。 % % 公式索引为本模板扩展,模板扩展了 \pkg{amsmath} 几个内部命令,使得公式编号样式和 % 自动索引功能非常方便。一般来说,你用到的所有数学环境编号都没问题了,这个可以参 % 看示例文档。如果你有个非常特殊的数学环境需要加入公式索引,那么请使 % 用 \cs{equcaption}\marg{编号}。此命令表示 equation caption,带一个参数,即显示 % 在索引中的编号。因为公式与图表不同,我们很少给一个公式附加一个标题,之所以起这 % 么个名字是因为图表就是通过 \cs{caption} 加入索引的,\cs{equcaption} 完全就是为 % 了生成公式列表,不产生什么标题。 % % 使用方法如下。假如有一个非 equation 数学环境 \texttt{mymath},只要在其中写一 % 句 \cs{equcaption} 就可以将它加入公式列表。 % \begin{latex} % \begin{mymath} % \label{eq:emc2}\equcaption{\ref{eq:emc2}} % E=mc^2 % \end{mymath} % \end{latex} % % \texttt{mymath} 中公式的编号需要自己来做。 % % 同图表一样,附录中的公式有时候也不希望它跟全文统一编号,而且不希望它出现在公式 % 索引中,目前的解决办法就是利用 \cs{tag*}\marg{公式编号} 来解决。用法很简单,此 % 处不再罗嗦,实例请参看示例文档附录 A 的前两个公式。 % % \subsection{封底部分} % % \subsubsection{致谢声明} % \DescribeEnv{acknowledgement} % 把致谢做成一个环境更好一些,直接往里面写感谢的话就可以啦。 % \begin{latex} % \begin{acknowledgement} % … % 还要特别感谢 \thuthesis\ 节省了论文排版时间! % \end{acknowledgement} % \end{latex} % % 本科论文在此处还有一节“声明”,提交版本时需要替换为签字扫描文件,同样我们也提供: % 如果使用声明扫描页,将可选参数指定为扫描后的 PDF 文件名,例如: % \begin{latex} % \begin{acknowledgement}[scan-statement.pdf] % 加了扫描文件后,这里面的文字就没用了。 % % 还要特别感谢计算机系薛瑞尼同学在论文格式和 \LaTeX\ 编译等方面给我的很多帮助! % \end{acknowledgement} % \end{latex} % % \subsubsection{附录} % \DescribeEnv{appendix} % 所有的附录都插到这里来。因为附录会更改默认的 chapter 属性,而后面的{\heiti 个人简 % 历}又需要恢复,所以实现为环境可以保证全局的属性不受影响。 % \begin{latex} % \begin{appendix} % \input{data/appendix01} % \input{data/appendix02} % \end{appendix} % \end{latex} % % \DescribeMacro{\title} % 附录里主要是本科的外文资料以及翻译,在这种情况下,\cs{chapter} 的标题是固定的 % (即“外文资料的调研阅读报告或书面翻译”),所以用 \cs{title}\marg{标题} 开排版外 % 文资料以及翻译的标题。这个命令只能在附录环境下使用。 % % \DescribeEnv{translationbib} % 本环境用来描述外文资料中的参考文献,例子: % \begin{latex} % \begin{translationbib} % \item Donald E. Knuth. The \TeX book. Addison-Wesley, 1984. ISBN: 0-201-13448-9 % \item Paul W. Abrahams, Karl Berry and Kathryn A. Hargreaves. \TeX\ for the % Impatient. Addison-Wesley, 1990. ISBN: 0-201-51375-7 % \item David Salomon. The advanced \TeX book. New York : Springer, 1995. ISBN:0-387-94556-3 % \end{translationbib} % \end{latex} % % \subsubsection{简历} % \DescribeEnv{resume} % 开启个人简历章节,包括个人简历,发表文章,研究成果列表等。每个子项目请 % 用以下对应命令开启:\cs{xxxitem}\marg{subtitle}。 % % \DescribeMacro{\resumeitem} % 个人简历,用法:\cs{resumeitem}\{个人简历\}。简历内容部分没有格式要求,正常段 % 落排版。 % % \DescribeMacro{\researchitem} % 发表学术论文,用法:\cs{researchitem}\marg{类别},包括“学术论文”和“研究成果”两 % 个类别。分别用 \env{publications} 和 \env{achievements} 罗列。 % % \DescribeEnv{publications} % \DescribeMacro{\publicationskip} % 用 \env{publications} 环境进行罗列发表的论文。按照学校要求,在学期间发表的学术 % 论文分以下三部分按顺序分别列出,每部分之间空 1 行,序号可连续排列: % \begin{enumerate} % \item 已经刊载的学术论文(本人是第一作者,或者导师为第一作者本人是第二作者) % \item 尚未刊载,但已经接到正式录用函的学术论文(本人为第一作者,或者导师为第一 % 作者本人是第二作者)。 % \item 其他学术论文。可列出除上述两种情况以外的其他学术论文,但必须是已经刊载或 % 者收到正式录用函的论文。 % \end{enumerate} % % \env{publications} 环境支持每一部分分别编写,逻辑上更清楚,为了在环境之间支持 % 空行,需要利用 \cs{publicationskip} 控制。示例: % \begin{latex} % \researchitem{发表的学术论文} % % % 1. 已经刊载的学术论文 % \begin{publications} % \item Yang Y, Ren T L, Zhang L T, et al. Miniature microphone with silicon- % based ferroelectric thin films. Integrated Ferroelectrics, 2003, % 52:229-235. (SCI 收录, 检索号:758FZ.) % \item 杨轶, 张宁欣, 任天令, 等. 硅基铁电微声学器件中薄膜残余应力的研究. 中国机 % 械工程, 2005, 16(14):1289-1291. (EI 收录, 检索号:0534931 2907.) % \item 杨轶, 张宁欣, 任天令, 等. 集成铁电器件中的关键工艺研究. 仪器仪表学报, % 2003, 24(S4):192-193. (EI 源刊.) % \end{publications} % % % 2. 尚未刊载,但已经接到正式录用函的学术论文 % \begin{publications}[before=\publicationskip,after=\publicationskip] % \item Yang Y, Ren T L, Zhu Y P, et al. PMUTs for handwriting recognition. In % press. (已被 Integrated Ferroelectrics 录用. SCI 源刊.) % \end{publications} % % % 3. 其他学术论文。 % \begin{publications} % \item Wu X M, Yang Y, Cai J, et al. Measurements of ferroelectric MEMS % microphones. Integrated Ferroelectrics, 2005, 69:417-429. (SCI 收录, 检索号 % :896KM) % \item 贾泽, 杨轶, 陈兢, 等. 用于压电和电容微麦克风的体硅腐蚀相关研究. 压电与声 % 光, 2006, 28(1):117-119. (EI 收录, 检索号:06129773469) % \item 伍晓明, 杨轶, 张宁欣, 等. 基于MEMS技术的集成铁电硅微麦克风. 中国集成电路, % 2003, 53:59-61. % \end{publications} % \end{latex} % % \DescribeEnv{achievements} % 研究成果用 \cs{researchitem}\{研究成果\} 开启,随后用 \env{achievements} 环 % 境罗列。 % % 具体用法请参看示例文档 \file{data/resume.tex}。 % % \subsection{书脊} % \DescribeMacro{\shuji} % 生成装订的书脊,为竖排格式,命令格式:\cs{shuji}\oarg{标题}\oarg{作者}。默认参 % 数为论文中文题目和中文作者。如果中文题目中没有英文字母,那么直接调用此命令即可。 % 否则,就要像例子里面那样做一些微调(参看模板自带的 \file{shuji.tex})。下面是一 % 个例子: % \begin{latex} % \documentclass[degree=master]{thuthesis} % % \begin{document} % \thuset{ % ctitle={论文中文题目}, % cauthor={中文姓名}} % % \shuji % 使用默认标题和默认作者 % % \shuji[使用默认作者的标题] % % \shuji[同时修改标题和作者的标题][尼瑞薛] % % % 如果标题中有英文,那可以参考如下方法进行微调: % \shuji[清华大学 \raisebox{-5pt}{\LaTeX} 论文模板 \raisebox{-5pt}{v\version} 样例] % \end{document} % \end{latex} % % \subsection{自定义} % \label{sec:othercmd} % % \subsubsection{数学环境} % \label{sec:math} % \thuthesis\ 定义了常用的数学环境: % % \begin{center} % \begin{tabular}{*{7}{l}}\toprule % axiom & theorem & definition & proposition & lemma & conjecture &\\ % 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\midrule % proof & corollary & example & exercise & assumption & remark & problem \\ % 证明 & 推论 & 例子& 练习 & 假设 & 注释 & 问题\\\bottomrule % \end{tabular} % \end{center} % % 比如: % \begin{latex} % \begin{definition} % 道千乘之国,敬事而信,节用而爱人,使民以时。 % \end{definition} % \end{latex} % 产生(自动编号): % \medskip % % \noindent\framebox[\linewidth][l]{{\heiti 定义~1.1~~~} % {道千乘之国,敬事而信,节用而爱人,使民以时。}} % % \smallskip % 列举出来的数学环境毕竟是有限的,如果想用\emph{胡说}这样的数学环境,那么可以定义: % \begin{latex} % \newtheorem{nonsense}{胡说}[chapter] % \end{latex} % % 然后这样使用: % \begin{latex} % \begin{nonsense} % 契丹武士要来中原夺武林秘笈。—— 慕容博 % \end{nonsense} % \end{latex} % 产生(自动编号): % % \medskip % \noindent\framebox[\linewidth][l]{{\heiti 胡说~1.1~~~} % {契丹武士要来中原夺武林秘笈。—— 慕容博}} % % \subsubsection{列表环境} % \DescribeEnv{itemize} % \DescribeEnv{enumerate} % \DescribeEnv{description} % 为了适合中文习惯,模板将这三个常用的列表环境用 \pkg{enumitem} 进行了纵向间距压 % 缩。一方面清除了多余空间,另一方面用户可以自己指定列表环境的样式(如标签符号, % 缩进等)。细节请参看 \pkg{enumitem} 文档,此处不再赘述。 % % \subsection{其它} % 模板的配置文件 \file{thuthesis.cfg} 中定义了很多固定词汇,一般无须修改。如果有特殊需求, % 推荐在导言区使用 \cs{renewcommand}。 % % \section{致谢} % \label{sec:thanks} % 感谢这些年来一直陪伴 \thuthesis\ 成长的新老同学! % % 欢迎各位到 \href{http://github.com/xueruini/thuthesis/}{\thuthesis\ Github 主页}贡献! % % \StopEventually{\PrintChanges\PrintIndex} % \clearpage % % \section{实现细节} % % \subsection{基本信息} % \begin{macrocode} %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{thuthesis} %\ProvidesFile{thuthesis.cfg} %[2017/12/24 5.4.3 Tsinghua University Thesis Template] % \end{macrocode} % % \subsection{定义选项} % \label{sec:defoption} % 定义论文类型以及是否涉密 % \changes{v2.4}{2006/04/14}{添加模板名称命令。} % \changes{v2.5}{2006/05/19}{增加本科论文的提交选项 submit。} % \changes{v2.5.1}{2006/05/24}{如果没有设置格式选项,报错。} % \changes{v2.5.1}{2006/05/26}{submit 只能由本科用。} % \changes{v2.5.3}{2006/06/03}{submit 选项的一个笔误。} % \changes{v3.0}{2007/05/12}{删除 submit 选项。} % \changes{v4.6}{2011/04/26}{增加 postdoctor 选项。} % \changes{v4.8}{2014/11/25}{v4.7曾经想发布,但是一直没有做,于是就被跳过了,算是造一个段子吧。} % \changes{v4.8.1}{2014/12/09}{按照 CTAN 的要求整理一下文件。} % \begin{macrocode} %<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{\textsc{ThuThesis}} \def\version{5.4.3} \RequirePackage{kvoptions} \SetupKeyvalOptions{ family=thu, prefix=thu@, setkeys=\kvsetkeys} % \end{macrocode} % % 用 \pkg{kvoptions} 的 \texttt{key=value} 方式来设置论文类型。 % \changes{v5.0.0}{2015/12/13}{使用 \pkg{kvoptions} 简化选项 type。} % \changes{v5.4.2}{2017/12/18}{使用 degree 取代 type 选项。} % \begin{macrocode} \newif\ifthu@bachelor \newif\ifthu@master \newif\ifthu@doctor \newif\ifthu@postdoctor \define@key{thu}{degree}{% \thu@bachelorfalse \thu@masterfalse \thu@doctorfalse \thu@postdoctorfalse \expandafter\csname thu@#1true\endcsname} \define@key{thu}{type}{% \ClassError{thuthesis}{'type' is deprecated, \MessageBreak please use 'degree=#1' instead}{}} \def\thu@deprecated@degree@option{% \ClassError{thuthesis}{Option '\CurrentOption' is deprecated, \MessageBreak please use 'degree=\CurrentOption' instead}{}} \DeclareVoidOption{bachelor}{\thu@deprecated@degree@option} \DeclareVoidOption{master}{\thu@deprecated@degree@option} \DeclareVoidOption{doctor}{\thu@deprecated@degree@option} \DeclareVoidOption{postdoctor}{\thu@deprecated@degree@option} % \end{macrocode} % % 论文是否保密。 % \begin{macrocode} \DeclareBoolOption{secret} % \end{macrocode} % % 目录中英文是否用 Arial 字体(默认关闭)。 % \begin{macrocode} \DeclareBoolOption{arialtoc} % \end{macrocode} % % 章节标题中的英文是否用 Arial 字体(默认打开)。 % \begin{macrocode} \DeclareBoolOption{arialtitle} % \end{macrocode} % % 在 Windows Vista 或之后系统下时,默认使用微软雅黑,这可能会导致审查不合格。 % 下面设置默认不使用微软雅黑,同时保持跨平台兼容性。 % \begin{macrocode} \IfFileExists{/dev/null}{}{\PassOptionsToClass{fontset=windowsold}{ctexbook}} % \end{macrocode} % % \option{raggedbottom} 选项(默认打开) % \changes{v4.8}{2013/03/05}{增加 noraggedbottom 选项。} % \changes{v5.0.0}{2015/12/13}{norggedbottom 选项修改为 raggedbottom。} % \begin{macrocode} \DeclareBoolOption{raggedbottom} % \end{macrocode} % % 在脚注标记中使用 \pkg{pifont} 的带圈数字(默认关闭) % \begin{macrocode} \DeclareBoolOption{pifootnote} % \end{macrocode} % % 将选项传递给 \pkg{ctexbook}。 % \begin{macrocode} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} % \end{macrocode} % % \changes{v2.5.1}{2006/05/24}{研究生院目录要 times,而教务处要 arial。} % \changes{v2.5.1}{2006/05/26}{本科 openright,研究生 openany。} % \changes{v3.1}{2007/10/09}{本科的目录又不要 arial 字体了。} % \changes{v4.8}{2013/05/29}{添加 nocap 选项,恢复默认标题样式,模板会进一步定制。} % 打开默认选项。 % \begin{macrocode} \kvsetkeys{thu}{% raggedbottom, arialtitle} % \end{macrocode} % % 解析用户传递过来的选项,并加载 \pkg{ctexbook}。 % \begin{macrocode} \ProcessKeyvalOptions* \ifthu@bachelor\relax\else \ifthu@master\relax\else \ifthu@doctor\relax\else \ifthu@postdoctor\relax\else \ClassError{thuthesis}% {Please specify thesis degree in option: \MessageBreak degree=[bachelor | master | doctor | postdoctor]}{} \fi \fi \fi \fi % \end{macrocode} % % 使用 \XeTeX\ 引擎时,\pkg{fontspec} 宏包会被 \pkg{xeCJK} 自动调用。传递 % 给 \pkg{fontspec} 宏包 \option{no-math} 选项,避免部分数学符号字体自动调整 % 为 CMR。其他引擎下没有这个问题,这一行会被无视。 % \begin{macrocode} \PassOptionsToPackage{no-math}{fontspec} % \end{macrocode} % % \changes{v5.3.1}{2016/03/20}{使用 \CTeX\ 默认中文字体配置,支持不同引擎。} % 使用 \pkg{ctexbook} 类,优于调用 \pkg{ctex} 宏包。 % \begin{macrocode} \LoadClass[a4paper,openany,UTF8,zihao=-4,scheme=plain]{ctexbook} % \end{macrocode} % % % \subsection{装载宏包} % \label{sec:loadpackage} % % 引用的宏包和相应的定义。 % \begin{macrocode} \RequirePackage{etoolbox} \RequirePackage{ifxetex} \RequirePackage{xparse} % \end{macrocode} % % \AmSTeX\ 宏包,用来排出更加漂亮的公式。 % \changes{v4.8}{2013/03/02}{no need to load amssymb since we use txfonts.} % \begin{macrocode} \RequirePackage{amsmath} % \end{macrocode} % % \pkg{newtx} 设置 Times New Roman,Helvetica。 % \changes{v3.1}{2007/06/16}{replace \pkg{mathptmx} with \pkg{txfonts}.} % \changes{v5.2.1}{2016/01/14}{使用 \pkg{newtx} 替换 \pkg{txfonts}。} % \changes{v5.2.2}{2016/02/01}{不希望 \pkg{newtx} 修改 \cs{@makefnmark}。 } % \begin{macrocode} \RequirePackage[defaultsups]{newtxtext} \RequirePackage{newtxmath} % \end{macrocode} % % \pkg{newtx} 的 Mono 字体虽然很好看,但在论文中不常见。学校虽未要求 Mono 字体, % 还是选择常见的 Courier 字体。由于比较新的实现 \TeX\ Gyre Cursor 会修 % 改\cs{bfdefault},导致中文加粗出问题,所以选用标准 \pkg{courier}。 % \changes{v5.3.2}{2016/5/24}{替换 \pkg{tgcursor} 为 \pkg{courier}。} % \begin{macrocode} \RequirePackage{courier} % \end{macrocode} % % 图形支持宏包。 % \begin{macrocode} \RequirePackage{graphicx} % \end{macrocode} % % 并排图形。\pkg{subfigure}、\pkg{subfig} 已经不再推荐,用新的 \pkg{subcaption}。 % 浮动图形和表格标题样式。\pkg{caption2} 已经不推荐使用,采用新的 \pkg{caption}。 % \begin{macrocode} \RequirePackage[labelformat=simple]{subcaption} % \end{macrocode} % % \pkg{pdfpages} 宏包便于我们插入扫描后的授权页和声明页 PDF 文档。 % \begin{macrocode} \RequirePackage{pdfpages} \includepdfset{fitpaper=true} % \end{macrocode} % % 更好的列表环境。 % \changes{v2.6.2}{2006/06/18}{去掉 \pkg{paralist} 的 \option{newitem} 和 % \option{newenum} 选项,因为默认是打开的。} % \changes{v2.6.4}{2006/10/23}{增加 \option{neverdecrease} 选项。} % \changes{v5.0.0}{2012/12/13}{删除 \pkg{paralist} 选项。} % \changes{v5.2.2}{2016/01/31}{利用 \pkg{environ} 的 \cs{Collect@Body}。} % \begin{macrocode} \RequirePackage[shortlabels]{enumitem} \RequirePackage{environ} % \end{macrocode} % % 禁止 \LaTeX 自动调整多余的页面底部空白,并保持脚注仍然在底部。 % 脚注按页编号。 % \begin{macrocode} \ifthu@raggedbottom \RequirePackage[bottom,perpage,hang]{footmisc} \raggedbottom \else \RequirePackage[perpage,hang]{footmisc} \fi % \end{macrocode} % % \begin{macrocode} \ifthu@pifootnote \RequirePackage{pifont} \fi % \end{macrocode} % 利用 \pkg{CJKfntef} 实现汉字的下划线和盒子内两段对齐,并可以避免 % \cs{makebox}\oarg{width}\oarg{s} 可能产生的 underful boxes。 % \begin{macrocode} \RequirePackage{CJKfntef} % \end{macrocode} % % \changes{v4.8}{2013/05/28}{在 CJK 模式下用 \pkg{CJKspace} 保留中英文间空格。} % \changes{v5.0.0}{2015/04/17}{固定字体设置,同时改善与 \pkg{ctex} 兼容性。} % \changes{v5.2.1}{2016/01/14}{使用 \pkg{newtx} 字体。} % \changes{v5.3.1}{2016/03/20}{\pkg{ctex} 默认加载 \pkg{CJKspace}。} % \changes{v5.3.1}{2016/03/20}{几乎没人主动安装 Arial 字体。} % % 定理类环境宏包,其中 \pkg{amsmath} 选项用来兼容 \AmSTeX\ 的宏包 % \begin{macrocode} \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem} % \end{macrocode} % % 表格控制 % \changes{v2.6}{2006/06/09}{增加 \pkg{longtable}。} % \begin{macrocode} \RequirePackage{array} \RequirePackage{longtable} % \end{macrocode} % % 使用三线表:\cs{toprule},\cs{midrule},\cs{bottomrule}。 % \begin{macrocode} \RequirePackage{booktabs} % \end{macrocode} % % 参考文献引用宏包。 % \begin{macrocode} \RequirePackage[sort&compress]{natbib} % \end{macrocode} % % 删除默认模板(\file{book.cls})在章之间引入的垂直间隔。要放在 \pkg{hyperref} % 之前。 % \begin{macrocode} % \end{macrocode} % 生成有书签的 pdf 及其开关,请结合 gbk2uni 避免书签乱码。 % \changes{v2.6}{2006/06/09}{去除 hyperref 选项,等待全局传递。} % \changes{v5.2.2}{2016/01/25}{目录中标题和页码都是链接。} % \begin{macrocode} \RequirePackage{hyperref} \ifxetex \hypersetup{% CJKbookmarks=true} \else \hypersetup{% unicode=true, CJKbookmarks=false} \fi \hypersetup{% linktoc=all, bookmarksnumbered=true, bookmarksopen=true, bookmarksopenlevel=1, breaklinks=true, colorlinks=false, plainpages=false, pdfborder=0 0 0} % \end{macrocode} % % dvips 模式下网址断字有问题,请手工加载 \pkg{breakurl} 宏包解决之。 % % 设置 url 样式,与上下文一致 % \begin{macrocode} \urlstyle{same} % \end{macrocode} % % % \subsection{页面设置} % \label{sec:layout} % 本来这部分应该是最容易设置的,但根据格式规定出来的结果跟学校的 WORD 样例相差很 % 大,所以只能微调。 % \changes{v2.4}{2006/04/14}{把页面尺寸写入 dvi,避免有的用户通 % 过 dvips 不指定页面类型而得到古怪的结果。} % \changes{v4.5.2}{2010/09/19}{研究生页面边距由 3.2cm 改为 3cm。} % \changes{v4.7}{2012/05/29}{修改本科生页脚间距与样例基本一致。} % \changes{v5.0.0}{2015/03/10}{不再将页面尺寸写入 dvi,因为已不支持 dvips, % 而该方案会使得在使用 tikzexternalize 时外部 PDF 图片 BBox 不对。} % \changes{v5.0.0}{2015/12/14}{用 \pkg{geometry} 简化设置。} % \begin{macrocode} \RequirePackage{geometry} \geometry{ a4paper, % 210 * 297mm hcentering, ignoreall, nomarginpar} \ifthu@bachelor \geometry{ left=32mm, headheight=5mm, headsep=5mm, textheight=227mm, bottom=32mm, footskip=12mm} \else \geometry{ left=30mm, headheight=5mm, headsep=5mm, textheight=237mm, bottom=29mm, footskip=6mm} \fi % \end{macrocode} % % 利用 \pkg{fancyhdr} 设置页眉页脚。 % \begin{macrocode} \RequirePackage{fancyhdr} % % \end{macrocode} % % \subsection{主文档格式} % \label{sec:mainbody} % % \subsubsection{Three matters} % \begin{macro}{\cleardoublepage} % 对于 \textsl{openright} 选项,必须保证章首页右开,且如果前章末页无内容须 % 清空其页眉页脚。 % \begin{macrocode} %<*cls> \let\thu@cleardoublepage\cleardoublepage \newcommand{\thu@clearemptydoublepage}{% \clearpage{\pagestyle{thu@empty}\thu@cleardoublepage}} \let\cleardoublepage\thu@clearemptydoublepage % \end{macrocode} % \end{macro} % % \begin{macro}{\frontmatter} % \begin{macro}{\mainmatter} % \begin{macro}{\backmatter} % 我们的单面和双面模式与常规的不太一样。 % \changes{v2.5.1}{2006/05/23}{本科正文之后页码即用罗马数字,研究生不变。} % \changes{v2.5.3}{2006/06/03}{第一章永远右开。} % \changes{v4.4}{2008/05/30}{本科正文后的页码延续前面的阿拉伯数字,不再用罗马数 % 字。} % \changes{v4.4}{2008/05/30}{本科取消了所有页眉。} % \begin{macrocode} \renewcommand\frontmatter{% \if@openright\cleardoublepage\else\clearpage\fi \@mainmatterfalse \pagenumbering{Roman} \pagestyle{thu@empty}} \renewcommand\mainmatter{% \if@openright\cleardoublepage\else\clearpage\fi \@mainmattertrue \pagenumbering{arabic} \ifthu@bachelor\pagestyle{thu@plain}\else\pagestyle{thu@headings}\fi} \renewcommand\backmatter{% \if@openright\cleardoublepage\else\clearpage\fi \@mainmattertrue} % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \subsubsection{字体} % \label{sec:font} % \begin{macro}{\normalsize} % 正文小四号 (12bp) 字,行距为固定值 20 bp。 % \begin{macrocode} %<*cls> \renewcommand\normalsize{% \@setfontsize\normalsize{12bp}{20bp}% \abovedisplayskip=20bp \@plus 2bp \@minus 2bp \abovedisplayshortskip=20bp \@plus 2bp \@minus 2bp \belowdisplayskip=\abovedisplayskip \belowdisplayshortskip=\abovedisplayshortskip} % \end{macrocode} % \end{macro} % % WORD 中的字号对应该关系如下(1bp = 72.27/72 pt): % \begin{center} % \begin{tabular}{llll} % \toprule % 初号 & 42bp & 14.82mm & 42.1575pt \\ % 小初 & 36bp & 12.70mm & 36.135 pt \\ % 一号 & 26bp & 9.17mm & 26.0975pt \\ % 小一 & 24bp & 8.47mm & 24.09pt \\ % 二号 & 22bp & 7.76mm & 22.0825pt \\ % 小二 & 18bp & 6.35mm & 18.0675pt \\ % 三号 & 16bp & 5.64mm & 16.06pt \\ % 小三 & 15bp & 5.29mm & 15.05625pt \\ % 四号 & 14bp & 4.94mm & 14.0525pt \\ % 小四 & 12bp & 4.23mm & 12.045pt \\ % 五号 & 10.5bp & 3.70mm & 10.59375pt \\ % 小五 & 9bp & 3.18mm & 9.03375pt \\ % 六号 & 7.5bp & 2.56mm & \\ % 小六 & 6.5bp & 2.29mm & \\ % 七号 & 5.5bp & 1.94mm & \\ % 八号 & 5bp & 1.76mm & \\\bottomrule % \end{tabular} % \end{center} % % \begin{macro}{\thu@def@fontsize} % \changes{v2.6.2}{2006/06/18}{引入此命令重新定义字号。} % 根据习惯定义字号。用法: % % \cs{thu@def@fontsize}\marg{字号名称}\marg{磅数} % % 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。 % \changes{v5.2.3}{2016/02/13}{改写字体定义命令。} % \begin{macrocode} \def\thu@def@fontsize#1#2{% \expandafter\newcommand\csname #1\endcsname[1][1.3]{% \fontsize{#2}{##1\dimexpr #2}\selectfont}} % \end{macrocode} % \end{macro} % % \begin{macro}{\chuhao} % \begin{macro}{\xiaochu} % \begin{macro}{\yihao} % \begin{macro}{\xiaoyi} % \begin{macro}{\erhao} % \begin{macro}{\xiaoer} % \begin{macro}{\sanhao} % \begin{macro}{\xiaosan} % \begin{macro}{\sihao} % \begin{macro}{\banxiaosi} % \begin{macro}{\xiaosi} % \begin{macro}{\dawu} % \begin{macro}{\wuhao} % \begin{macro}{\xiaowu} % \begin{macro}{\liuhao} % \begin{macro}{\xiaoliu} % \begin{macro}{\qihao} % \begin{macro}{\bahao} % 一组字号定义。TODO:用 \cs{zihao} 替代。 % \begin{macrocode} \thu@def@fontsize{chuhao}{42bp} \thu@def@fontsize{xiaochu}{36bp} \thu@def@fontsize{yihao}{26bp} \thu@def@fontsize{xiaoyi}{24bp} \thu@def@fontsize{erhao}{22bp} \thu@def@fontsize{xiaoer}{18bp} \thu@def@fontsize{sanhao}{16bp} \thu@def@fontsize{xiaosan}{15bp} \thu@def@fontsize{sihao}{14bp} \thu@def@fontsize{banxiaosi}{13bp} \thu@def@fontsize{xiaosi}{12bp} \thu@def@fontsize{dawu}{11bp} \thu@def@fontsize{wuhao}{10.5bp} \thu@def@fontsize{xiaowu}{9bp} \thu@def@fontsize{liuhao}{7.5bp} \thu@def@fontsize{xiaoliu}{6.5bp} \thu@def@fontsize{qihao}{5.5bp} \thu@def@fontsize{bahao}{5bp} % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % % \subsubsection{页眉页脚} % \label{sec:headerfooter} % % 定义页眉和页脚。 % \begin{macro}{\ps@thu@empty} % \begin{macro}{\ps@thu@plain} % \begin{macro}{\ps@thu@headings} % \changes{v2.0}{2005/12/18}{以前的太乱了,重新整理过清晰多了。} % \changes{v2.1}{2006/03/01}{彻底放弃 fancyhdr,定义自己的样式。} % \changes{v2.5}{2006/05/13}{本科的奇偶页眉不同。} % \changes{v2.5}{2006/05/20}{增加 empty 页面样式。} % \changes{v4.7}{2012/05/29}{本科页码用小五号字。} % \changes{v5.0.0}{2015/12/20}{利用 \pkg{fancyhdr} 设置页眉页脚。} % 定义三种页眉页脚格式: % \begin{itemize} % \item \texttt{thu@empty}:页眉页脚都没有 % \item \texttt{thu@plain}:只显示页脚的页码。\cs{chapter} 自动调用 % \cs{thispagestyle\{thu@plain\}}。 % \item \texttt{thu@headings}:页眉页脚同时显示 % \end{itemize} % \begin{macrocode} %<*cls> \fancypagestyle{thu@empty}{% \fancyhf{} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}} \fancypagestyle{thu@plain}{% \fancyhead{} \fancyfoot[C]{\xiaowu\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}} \fancypagestyle{thu@headings}{% \fancyhead{} \fancyhead[C]{\wuhao\normalfont\leftmark} \fancyfoot{} \fancyfoot[C]{\wuhao\thepage} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0pt}} % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % \subsubsection{段落} % \label{sec:paragraph} % % 全文首行缩进 2 字符,标点符号用全角 % \begin{macrocode} %<*cls> \ctexset{% punct=quanjiao, space=auto, autoindent=true} % \end{macrocode} % % 利用 \pkg{enumitem} 命令调整默认列表环境间的距离,以符合中文习惯。 % \changes{v2.5.2}{2006/06/01}{更改默认列表距离。} % \begin{macrocode} \setlist{nosep} % % \end{macrocode} % % % \subsubsection{脚注} % \label{sec:footnote} % 脚注符合中文习惯,数字带圈。 % \changes{v2.1}{2006/03/01}{让脚注它悬挂起来,而且中文中用上标,脚注中用正体。} % \changes{v2.5}{2006/05/13}{修正 minipage 中的脚注。} % \begin{macro}{\thu@textcircled} % \changes{v2.5.1}{2006/05/21}{脚注编号使用 \cs{textcircled} 命令,每页允许至多 99 个。} % \changes{v5.2.2}{2016/02/01}{脚注编号每页允许至多 9 个。} % 生成带圈的脚注数字,最多处理到 10。 % \begin{macrocode} %<*cls> \def\thu@textcircled#1{% \ifnum\value{#1} >9 \ClassError{thuthesis}% {Too many footnotes in this page.}{Keep footnote less than 10.} \fi \ifthu@pifootnote% \ding{\the\numexpr\value{#1}+171\relax}% \else% \textcircled{\xiaoliu\arabic{#1}}% \fi} \renewcommand{\thefootnote}{\thu@textcircled{footnote}} \renewcommand{\thempfootnote}{\thu@textcircled{mpfootnote}} % \end{macrocode} % \end{macro} % % 定义脚注分割线,字号(宋体小五),以及悬挂缩进(1.5字符)。 % \begin{macrocode} \def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@} \let\thu@footnotesize\footnotesize \renewcommand\footnotesize{\thu@footnotesize\xiaowu[1.5]} \footnotemargin1.5em\relax % \end{macrocode} % % \cs{@makefnmark} 默认是上标样式,而在脚注部分要求为正文大小。利用\cs{patchcmd} % 动态调整 \cs{@makefnmark} 的定义。 % \changes{v2.6}{2006/06/09}{脚注改成 1.5 倍行距,漂亮。} % \changes{v5.2.2}{2016/02/01}{基于 \pkg{footmisc} 来设置不同位置 footnote % marker 样式。} % \begin{macrocode} \let\thu@makefnmark\@makefnmark \def\thu@@makefnmark{\hbox{{\normalfont\@thefnmark}}} \pretocmd{\@makefntext}{\let\@makefnmark\thu@@makefnmark}{}{} \apptocmd{\@makefntext}{\let\@makefnmark\thu@makefnmark}{}{} % % \end{macrocode} % % % \subsubsection{数学相关} % \label{sec:equation} % 允许太长的公式断行、分页等。 % \begin{macrocode} %<*cls> \allowdisplaybreaks[4] \renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation} % \end{macrocode} % % 公式距前后文的距离由 4 个参数控制,参见 \cs{normalsize} 的定义。 % % \changes{v2.5.1}{2006/05/24}{本科公式编号前添加\textbf{公式}二字。需要修 \pkg{amsmath} 极其深的一个命令。} % \changes{v2.5.1}{2006/05/24}{教务处居然要本科论文公式全文编号!} % \changes{v2.5.2}{2006/05/29}{上一个版本忘了把研究生的公式编号排除。} % \changes{v3.0}{2007/05/12}{本科公式又要取消全文统一编号了。} % 本科的公式编号要求很诡异,不得不修改 \pkg{amsmath} 中很深的一个命令 \cs{tagform@}。 % \changes{v2.6.2}{2006/06/19}{根据不同论文格式显示不同公式编号,并自动加入索引。} % \changes{v4.2}{2008/01/23}{\cs{eqref} 加括号。} % 同时为了让 \pkg{amsmath} 的 \cs{tag*} 命令得到正确的格式,我们必须修改这些代 % 码。\cs{make@df@tag} 是定义 \cs{tag*} 和 \cs{tag} 内部命令的。 % \cs{make@df@tag@@} 处理 \cs{tag*},我们就改它! % \begin{latex} % \def\make@df@tag{\@ifstar\make@df@tag@@\make@df@tag@@@} % \def\make@df@tag@@#1{% % \gdef\df@tag{\maketag@@@{#1}\def\@currentlabel{#1}}} % \end{latex} % \changes{v4.4}{2008/05/30}{本科论文终于去掉了\textbf{公式}二字。} % \changes{v4.4.4}{2008/06/12}{修复了一个从 v4.3 升级到 v4.4 过程中的丢失公式索引的 bug,原修改代码保留备忘。} % \changes{v5.2.3}{2016/02/13}{安全注释本科公式部分。} % \begin{macrocode} \def\make@df@tag{\@ifstar\thu@make@df@tag@@\make@df@tag@@@} \def\thu@make@df@tag@@#1{\gdef\df@tag{\thu@maketag{#1}\def\@currentlabel{#1}}} \iffalse \ifthu@bachelor \def\thu@maketag#1{\maketag@@@{% (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)}} \def\tagform@#1{\maketag@@@{% (\ignorespaces\text{\equationname\hskip0.5em}#1\unskip\@@italiccorr)\equcaption{#1}}} \fi \fi \def\thu@maketag#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)}} \def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} % \end{macrocode} % 修改 \cs{tagform} 会影响 \cs{eqref}。 % \begin{macrocode} \renewcommand{\eqref}[1]{\textup{(\ref{#1})}} % % \end{macrocode} % % 定理标题使用黑体,正文使用宋体,冒号隔开。 % \changes{v2.6.2}{2006/06/17}{增加问题和猜想两个数学环境。} % \changes{v4.2}{2008/03/07}{调整证明环境的编号和结尾的方块。} % \changes{v5.0.0}{2015/04/18}{修正定理字样为黑体 (\#104)。} % \changes{v5.3.2}{2017/05/01}{定理环境格式设置(环境标题和环境正文字体设置)统一放置到 .cfg 文件中。} % \begin{macrocode} %<*cfg> \theorembodyfont{\normalfont} \theoremheaderfont{\normalfont\heiti} \theoremsymbol{\ensuremath{\square}} \newtheorem*{proof}{证明} \theoremstyle{plain} \theoremsymbol{} \theoremseparator{:} \newtheorem{assumption}{假设}[chapter] \newtheorem{definition}{定义}[chapter] \newtheorem{proposition}{命题}[chapter] \newtheorem{lemma}{引理}[chapter] \newtheorem{theorem}{定理}[chapter] \newtheorem{axiom}{公理}[chapter] \newtheorem{corollary}{推论}[chapter] \newtheorem{exercise}{练习}[chapter] \newtheorem{example}{例}[chapter] \newtheorem{remark}{注释}[chapter] \newtheorem{problem}{问题}[chapter] \newtheorem{conjecture}{猜想}[chapter] % % \end{macrocode} % % \subsubsection{浮动对象以及表格} % \label{sec:float} % 设置浮动对象和文字之间的距离 % \changes{v2.6}{2006/06/09}{增加 \cs{floatsep},\cs{@fptop},\cs{@fpsep} 和 \cs{@fpbot}。} % \begin{macrocode} %<*cls> \setlength{\floatsep}{20bp \@plus4pt \@minus1pt} \setlength{\intextsep}{20bp \@plus4pt \@minus2pt} \setlength{\textfloatsep}{20bp \@plus4pt \@minus2pt} \setlength{\@fptop}{0bp \@plus1.0fil} \setlength{\@fpsep}{12bp \@plus2.0fil} \setlength{\@fpbot}{0bp \@plus1.0fil} % \end{macrocode} % % 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面, % 也可以防止在很大空白的浮动页上放置很小的图形。 % \begin{macrocode} \renewcommand{\textfraction}{0.15} \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.65} \renewcommand{\floatpagefraction}{0.60} % \end{macrocode} % % 定制浮动图形和表格标题样式 % \begin{itemize} % \item 图表标题字体为 11pt, 这里写作大五号 % \item 去掉图表号后面的冒号。图序与图名文字之间空一个汉字符宽度。 % \item 图:caption 在下,段前空 6 磅,段后空 12 磅 % \item 表:caption 在上,段前空 12 磅,段后空 6 磅 % \end{itemize} % \changes{v2.4}{2006/04/14}{表格内容为 11 磅。} % \changes{v2.4}{2006/04/14}{图表标题左对齐,取消原先漂亮的 hang 模式。} % \changes{v2.5}{2006/05/13}{标题上下间距重调,以前没有考虑 \cs{intextsep} 的影响。} % \changes{v2.5.1}{2006/05/23}{增加 \pkg{subfigure} 和 \pkg{subtable} 的 caption 配置。} % \changes{v2.5.1}{2006/05/24}{重新定义表格默认字体。} % \changes{v2.5.3}{2006/06/07}{不管 caption 出现在什么位置,\cs{aboveskip} 总是出现在标题和浮动体之间的距离。} % \changes{v4.3}{2008/03/11}{子图引用时加括号。} % \changes{v5.0.0}{2015/06/27}{本科附录图表编号用-不用.(如图A-1,表A-2)。} % \begin{macrocode} \ifthu@bachelor \g@addto@macro\appendix{\renewcommand*{\thefigure}{\thechapter-\arabic{figure}}} \g@addto@macro\appendix{\renewcommand*{\thetable}{\thechapter-\arabic{table}}} \fi \let\old@tabular\@tabular \def\thu@tabular{\dawu[1.5]\old@tabular} \DeclareCaptionLabelFormat{thu}{{\dawu[1.5]\normalfont #1~#2}} \DeclareCaptionLabelSeparator{thu}{\hspace{1em}} \DeclareCaptionFont{thu}{\dawu[1.5]} \captionsetup{labelformat=thu,labelsep=thu,font=thu} \captionsetup[table]{position=top,belowskip={12bp-\intextsep},aboveskip=6bp} \captionsetup[figure]{position=bottom,belowskip={12bp-\intextsep},aboveskip=6bp} \captionsetup[sub]{font=thu,skip=6bp} \renewcommand{\thesubfigure}{(\alph{subfigure})} \renewcommand{\thesubtable}{(\alph{subtable})} % \renewcommand{\p@subfigure}{:} % \end{macrocode} % 我们采用 \pkg{longtable} 来处理跨页的表格。同样我们需要设置其默认字体为五号。 % \changes{v2.5.3}{2006/06/08}{增加对 \pkg{longtable} 的处理。} % \changes{v4.5.1}{2009/01/06}{太好了,不用处理 \pkg{longtable} 的 \cs{caption} % 了。} % \begin{macrocode} \let\thu@LT@array\LT@array \def\LT@array{\dawu[1.5]\thu@LT@array} % set default font size % \end{macrocode} % % \begin{macro}{\hlinewd} % 简单的表格使用三线表推荐用 \cs{hlinewd}。如果表格比较复杂还是用 \pkg{booktabs} 的命 % 令好一些。 % \begin{macrocode} \def\hlinewd#1{% \noalign{\ifnum0=`}\fi\hrule \@height #1 \futurelet \reserved@a\@xhline} % % \end{macrocode} % \end{macro} % % % \subsubsection{章节标题} % \label{sec:theor} % \changes{v2.5}{2006/05/19}{增加索引名称定义。} % \begin{macrocode} %<*cfg> \ctexset{% chapter/name={第,章}, appendixname=附录, contentsname={目\hspace{\ccwd}录}, listfigurename=插图索引, listtablename=表格索引, figurename=图, tablename=表, bibname=参考文献, indexname=索引, } \newcommand\listequationname{公式索引} \newcommand\equationname{公式} \ifthu@bachelor \newcommand{\cabstractname}{中文摘要} \newcommand{\eabstractname}{ABSTRACT} \else \newcommand{\cabstractname}{摘\hspace{\ccwd}要} \newcommand{\eabstractname}{Abstract} \fi \let\CJK@todaysave=\today \def\CJK@todaysmall@short{\the\year 年 \the\month 月} \def\CJK@todaysmall{\the\year 年 \the\month 月 \the\day 日} \def\CJK@todaybig@short{\zhdigits{\the\year}年\zhnumber{\the\month}月} \def\CJK@todaybig{\zhdigits{\the\year}年\zhnumber{\the\month}月\zhnumber{\the\day}日} \def\CJK@today{\CJK@todaysmall} \renewcommand\today{\CJK@today} \newcommand\CJKtoday[1][1]{% \ifcase#1\def\CJK@today{\CJK@todaysave} \or\def\CJK@today{\CJK@todaysmall} \or\def\CJK@today{\CJK@todaybig} \fi} % % \end{macrocode} % % 如果章节题目中的英文要使用 arial,那么就加上 \cs{sffamily} % \begin{macrocode} %<*cls> \def\thu@title@font{% \ifthu@arialtitle\sffamily\else\heiti\fi} % \end{macrocode} % % \pkg{fancyhdr} 定义页眉页脚很方便,但是有一个非常隐蔽的坑。通过 \pkg{fancyhdr} % 定义的样式在第一次被调用时会修改 \cs{chaptermark},这会导致页眉信息错误(多余 % 章号并且英文大写)。这是因为在原始的 \file{book.cls} 中定义如下(大意): % \begin{latex} % \newcommand\chaptername{Chapter} % \newcommand\@chapapp{\chaptername} % \def\chaptermark#1{ % \markboth{\MakeUppercase{\@chapapp\ \thechapter}}{}} % \end{latex} % 很显然这个 \cs{\@chapapp} 不适合中文,因此我们使用\cs{CTEXthechapter}( % 如,“第 x 章”),同时会将 \cs{MakeUppercase} 去掉。也就是说我们会做如下动作: % \begin{latex} % \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}} % \end{latex} % 但,\pkg{fancyhdr} 不知何故在 \cs{ps@fancy} 中对 \cs{chaptermark} 进行重定义 % (其实一模一样),而这个 \cs{ps@fancy} 会在 \cs{fancypagestyle} 中使用,如下: % \begin{latex} % \newcommand{\fancypagestyle}[2]{% % \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}} % \end{latex} % 这样的话,\cs{ps@fancy} 会在 \pkg{fancyhdr} 定义的任何样式首次样被激活时调用,从 % 而覆盖我们的 \cs{chaptermark} 定义(后续样式再激活不会重复覆盖)。所以我们采用如下 % 方法解决: % \begin{macrocode} \AtBeginDocument{% \pagestyle{thu@empty} \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}} % \end{macrocode} % % 各级标题格式设置。 % \changes{v5.0.0}{2012/12/23}{用 \cs{ctexset} 来设置,替换复杂的 \cs{@startsection}。} % \begin{description} % \item[chapter] 章序号与章名之间空一个汉字符 黑体三号字,居中书写,单倍行距,段 % 前空 24 磅,段后空 18 磅。本科要求:段前段后间距 30/20 pt,行距 20pt。但正文 % 章节 30pt 的话和样例效果不一致。 % % \changes{v2.5}{2006/05/13}{取消 \pkg{titlesec} 宏包,用基本 \LaTeX\ 命令格式化标题。} % \changes{v2.5.1}{2006/05/23}{让 \cs{chapter*} 自动 \cs{markboth}。} % \changes{v3.1}{2006/06/16}{英文摘要标题要搞特殊化。} % \changes{v5.0.0}{2015/04/17}{修正章节间距问题(\#57)} % % \item[section] 一级节标题,例如:\fbox{2.1 实验装置与实验方法}。节标题序号与标 % 题名之间空一个汉字符(下同)。采用黑体四号(14pt)字居左书写,行距为固定 % 值 20 磅,段前空 24 磅,段后空 6 磅。本科:25/12 pt,行距 18pt。 % % \changes{v4.4}{2008/06/04}{调整段前距为 -20bp 而不是原来的 -24bp。} % % \item[subsection] 二级节标题,例如:\fbox{2.1.1 实验装置}。采用黑体 13pt 字居左 % 书写,行距为固定值 20 磅,段前空 12 磅,段后空 6 磅。本科:中文黑体 12pt 字, % 英文 13pt 字,段间距 12/6 pt,行距 15pt。 % % \changes{v4.4}{2008/06/04}{修改本科生模板的二级节标题为小四而不是半小四。} % \changes{v4.4}{2008/06/04}{调整段前距为 -12bp 而不是原来的 -16bp。} % % \item[subsubsection] 三级节标题,例如:\fbox{2.1.2.1 归纳法}。采用黑体小四号 % (12pt)字居左书写,行距为固定值 20 磅,段前空 12 磅,段后空 6 磅。 % % \changes{v4.4}{2008/06/04}{调整段前距为 -12bp 而不是原来的 -16bp。} % \end{description} % \begin{macrocode} \newcommand\thu@chapter@titleformat[1]{% \ifthu@bachelor #1\else% \ifthenelse% {\equal{#1}{\eabstractname}}% {\bfseries #1}% {#1}% \fi} \ctexset{% chapter={ afterindent=true, pagestyle={\ifthu@bachelor thu@plain\else thu@headings\fi}, beforeskip={\ifthu@bachelor 15bp\else 9bp\fi}, aftername=\hskip\ccwd, afterskip={\ifthu@bachelor 20bp\else 24bp\fi}, format={\centering\thu@title@font\ifthu@bachelor\xiaosan[1.333]\else\sanhao[1]\fi}, nameformat=\relax, numberformat=\relax, titleformat=\thu@chapter@titleformat, lofskip=0pt, lotskip=0pt, }, section={ afterindent=true, beforeskip={\ifthu@bachelor 25bp\else 24bp\fi\@plus 1ex \@minus .2ex}, afterskip={\ifthu@bachelor 12bp\else 6bp\fi \@plus .2ex}, format={\thu@title@font\ifthu@bachelor\sihao[1.286]\else\sihao[1.429]\fi}, }, subsection={ afterindent=true, beforeskip={\ifthu@bachelor 12bp\else 16bp\fi\@plus 1ex \@minus .2ex}, afterskip={6bp \@plus .2ex}, format={\thu@title@font\ifthu@bachelor\xiaosi[1.25]\else\banxiaosi[1.538]\fi}, numberformat={\thu@title@font\ifthu@bachelor\banxiaosi[1.154]\else\banxiaosi[1.538]\fi}, }, subsubsection={ afterindent=true, beforeskip={\ifthu@bachelor 12bp\else 16bp\fi\@plus 1ex \@minus .2ex}, afterskip={6bp \@plus .2ex}, format={\thu@title@font\ifthu@bachelor\xiaosi[1.25]\else\xiaosi[1.667]\fi}, }, paragraph/afterindent=true, subparagraph/afterindent=true} % \end{macrocode} % % \begin{macro}{\thu@chapter*} % \changes{v2.5.2}{2006/05/29}{定义自己的 \cs{thu@chapter*}。} % 默认的 \cs{chapter*} 很难同时满足研究生院和本科生的论文要求。本科论文要求所有的 % 章都出现在目录里,比如摘要、Abstract、主要符号表等,所以可以简单的扩展默 % 认\cs{chapter*} 实现这个目的。但是研究生又不要这些出现在目录中,而且致谢和声明 % 部分的章名、页眉和目录都不同,所以定义一个灵活的 \cs{thu@chapter*} 专门处理这些 % 要求。 % % \cs{thu@chapter*}\oarg{tocline}\marg{title}\oarg{header}: tocline 是出现在目录 % 中的条目,如果为空则此 chapter 不出现在目录中,如果省略表示目录出现 title; % title 是章标题;header 是页眉出现的标题,如果忽略则取 title。通过这个宏我才真 % 正体会到 \TeX\ macro 的力量! % \begin{macrocode} \newcounter{thu@bookmark} \NewDocumentCommand\thu@chapter{s o m o}{ \IfBooleanF{#1}{% \ClassError{thuthesis}{You have to use the star form: \string\thu@chapter*}{} }% \if@openright\cleardoublepage\else\clearpage\fi\phantomsection% \IfValueTF{#2}{% \ifthenelse{\equal{#2}{}}{% \addtocounter{thu@bookmark}\@ne \pdfbookmark[0]{#3}{thuchapter.\thethu@bookmark} }{% \addcontentsline{toc}{chapter}{#3} } }{% \addcontentsline{toc}{chapter}{#3} }% \ifthu@bachelor \ctexset{chapter/beforeskip=25bp} \fi \chapter*{#3}% \ifthu@bachelor \ctexset{chapter/beforeskip=15bp} \fi \IfValueTF{#4}{% \ifthenelse{\equal{#4}{}} {\@mkboth{}{}} {\@mkboth{#4}{#4}} }{% \@mkboth{#3}{#3} } } % % \end{macrocode} % \end{macro} % % % \subsubsection{目录} % \label{sec:toc} % 最多 4 层,即: x.x.x.x,对应的命令和层序号分别是: % \cs{chapter}(0), \cs{section}(1), \cs{subsection}(2), \cs{subsubsection}(3)。 % \changes{v3.1}{2007/10/09}{博士论文目录只出现到第 3 级标题即可。} % \changes{v5.0.0}{2015/05/21}{硕士博士论文目录只出现到第 3 级标题即可。其他未明确要求。} % \begin{macrocode} %<*cls> \setcounter{secnumdepth}{3} \setcounter{tocdepth}{2} % \end{macrocode} % % 每章标题行前空 6 磅,后空 0 磅。如果使用目录项中英文要使用 Arial,那么就加上 \cs{sffamily}。 % 章节名中英文用 Arial 字体,页码仍用 Times。 % \begin{macro}{\tableofcontents} % \changes{v2.0}{2005/12/18}{附录的目录项需要调整一下。以及公式编号方式等等。} % \changes{v2.5}{2006/05/13}{取消 \pkg{titletoc} 宏包,用 \cs{dottedtocline} 调整 % 目录。} % \changes{v2.5.1}{2006/05/23}{减小目录项中的导引小点跟页码之间的留白。} % \changes{v2.5.2}{2006/05/29}{用 \cs{thu@chapter*} 改写目录命令。} % \changes{v3.0}{2007/05/12}{缩小目录中标题与页码之间\textbf{点}之间的距离。} % \changes{v4.0}{2007/11/08}{本科研究生目录字号行距都不同。} % \changes{v4.4}{2008/06/04}{本科生目录字号改回\cs{xiaosi}\oarg{1.8}。} % \changes{v4.4}{2008/06/04}{本科生目录缩进要求不同。} % \changes{v4.4}{2008/06/18}{本科章目录项一直用黑体 (Arial)。} % 目录生成命令。 % \begin{macrocode} \renewcommand\tableofcontents{% \thu@chapter*[]{\contentsname} \ifthu@bachelor\xiaosi[1.667]\else\xiaosi[1.65]\fi\@starttoc{toc}\normalsize} % \end{macrocode} % 调整目录样式,允许指定目录字体。 % \changes{v5.2.2}{2016/01/23}{用 \cs{patchcmd} 修改 \cs{@dottedtocline}。} % \begin{macrocode} \ifthu@arialtoc \def\thu@toc@font{\sffamily} \fi \def\@pnumwidth{2em} \def\@tocrmarg{\@pnumwidth} \def\@dotsep{1} \patchcmd{\@dottedtocline}{#4}{\csname thu@toc@font\endcsname #4}{}{} \patchcmd{\@dottedtocline}{\hb@xt@\@pnumwidth}{\hbox}{}{} \renewcommand*\l@chapter[2]{% \ifnum \c@tocdepth >\m@ne \addpenalty{-\@highpenalty}% \ifthu@bachelor \vskip 6bp \else \vskip 4bp \fi \@plus\p@ \setlength\@tempdima{4em}% \begingroup \parindent \z@ \rightskip \@pnumwidth \parfillskip -\@pnumwidth \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip % numberline is called here, and it uses \@tempdima {\ifthu@bachelor\sffamily\else\csname thu@toc@font\endcsname\fi\heiti #1} \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill \nobreak{\normalfont\normalcolor #2}\par \penalty\@highpenalty \endgroup \fi} % \end{macrocode} % % 研究生学位论文写作指南中规定:目录中的章标题行居左书写,一级节标题行缩进 1 个 % 汉字符,二级节标题行缩进 2 个汉字符(但示例文件中为 1.5 个汉字符)。本科生指 % 南中未作明确规定,示例文件中对于一级和二级节标题分别缩进 1 和 1.5 个汉字符。 % \changes{v5.0.0}{2015/04/28}{修正学位论文中目录里节前缩进(\#103)} % \begin{macrocode} \renewcommand*\l@section{% \@dottedtocline{1}{\ccwd}{2.1em}} \renewcommand*\l@subsection{% \@dottedtocline{2}{\ifthu@bachelor 1.5\ccwd\else 2\ccwd\fi}{3em}} \renewcommand*\l@subsubsection{% \@dottedtocline{3}{\ifthu@bachelor 2.4em\else 3.5em\fi}{3.8em}} % % \end{macrocode} % \end{macro} % % % \subsubsection{封面和封底} % \label{sec:cover} % \begin{macro}{\thu@def@term} % 方便的定义封面的一些替换命令。 % \changes{v2.6.2}{2006/06/18}{引入 \cs{thu@def@term} 定义封面命令。} % \changes{v3.1}{2006/06/16}{重新定义摘要为环境,long 选项不需要了。} % \begin{macrocode} %<*cls> \def\thu@def@term#1{% \define@key{thu}{#1}{\csname #1\endcsname{##1}} \expandafter\gdef\csname #1\endcsname##1{% \expandafter\gdef\csname thu@#1\endcsname{##1}} \csname #1\endcsname{}} % \end{macrocode} % \end{macro} % % \changes{v2.0}{2005/12/18}{增加了封面密级,增加博士封面支持} % \changes{v4.6}{2011/04/27}{增加博士后相关指令。} % % \begin{macro}{\secretlevel} % \begin{macro}{\secretyear} % 定义密级参数。 % \begin{macrocode} \thu@def@term{secretlevel} \thu@def@term{secretyear} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\ctitle} % \begin{macro}{\etitle} % 论文中英文题目。 % \begin{macrocode} \thu@def@term{ctitle} \thu@def@term{etitle} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\cauthor} % \begin{macro}{\eauthor} % \begin{macro}{\csupervisor} % \begin{macro}{\cassosupervisor} % \begin{macro}{\ccosupervisor} % \begin{macro}{\esupervisor} % \begin{macro}{\eassosupervisor} % \begin{macro}{\ecosupervisor} % 作者、导师、副导师、联合指导老师。 % \begin{macrocode} \thu@def@term{cauthor} \thu@def@term{csupervisor} \thu@def@term{cassosupervisor} \thu@def@term{ccosupervisor} \thu@def@term{eauthor} \thu@def@term{esupervisor} \thu@def@term{eassosupervisor} \thu@def@term{ecosupervisor} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\cdegree} % \begin{macro}{\edegree} % 学位中英文。 % \begin{macrocode} \thu@def@term{cdegree} \thu@def@term{edegree} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\cdepartment} % \begin{macro}{\edepartment} % 院系中英文名称。 % \begin{macrocode} \thu@def@term{cdepartment} \def\caffil{% for compatibility \ClassWarning{thuthesis} {'\string\caffil' is deprecated, please use '\string\cdepartment' instead.}{}% \cdepartment} \thu@def@term{edepartment} \def\eaffil{% for compability \ClassWarning{thuthesis} {'\string\eaffil' is deprecated, please use '\string\edepartment' instead.}{}% \edepartment} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\cmajor} % \begin{macro}{\emajor} % 学位中英文名称。 % \changes{v2.5}{2006/05/20}{院系和专业分别改名用 department 和 major,代替原来 % 的 affil 和 subject。} % \begin{macrocode} \thu@def@term{cmajor} \def\csubject{% for compatibility \ClassWarning{thuthesis} {'\string\csubject' is deprecated, please use '\string\cmajor' instead.}{}% \cmajor} \thu@def@term{emajor} \def\esubject{%for compability \ClassWarning{thuthesis} {'\string\esubject' is deprecated, please use '\string\emajor' instead.}{}% \emajor} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\cdate} % \begin{macro}{\edate} % 论文成文日期。 % \begin{macrocode} \thu@def@term{cdate} \thu@def@term{edate} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\id} % \begin{macro}{\udc} % \begin{macro}{\catalognumber} % \begin{macro}{\cfirstdiscipline} % \begin{macro}{\cseconddiscipline} % \begin{macro}{\postdoctordate} % 博士后专用封面参数。 % \begin{macrocode} \thu@def@term{id} \thu@def@term{udc} \thu@def@term{catalognumber} \thu@def@term{cfirstdiscipline} \thu@def@term{cseconddiscipline} \thu@def@term{postdoctordate} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{environment}{cabstract} % \begin{environment}{eabstract} % 摘要最好以环境的形式出现(否则命令的形式会导致开始结束的括号距离太远,我不喜 % 欢),这就必须让环境能够自己保存内容留待以后使用。使用 \pkg{environ} 的 % \cs{Collect@Body} 来实现。 % \changes{v3.1}{2006/06/17}{重新定义摘要成为环境。} % \changes{v5.2.2}{2016/01/31}{用 \pkg{environ} 封装的 \cs{Collect@Body}。} % \begin{macrocode} \newcommand{\thu@@cabstract}[1]{\long\gdef\thu@cabstract{#1}} \newenvironment{cabstract}{\Collect@Body\thu@@cabstract}{} \newcommand{\thu@@eabstract}[1]{\long\gdef\thu@eabstract{#1}} \newenvironment{eabstract}{\Collect@Body\thu@@eabstract}{} % \end{macrocode} % \end{environment} % \end{environment} % % \begin{macro}{\thu@parse@keywords} % 不同论文格式关键词之间的分割不太相同,我们用 \cs{ckeywords} 和 % \cs{ekeywords} 来收集关键词列表,然后用本命令来生成符合要求的格式。 % \begin{macrocode} \def\thu@parse@keywords#1{ \define@key{thu}{#1}{\csname #1\endcsname{##1}} \expandafter\gdef\csname thu@#1\endcsname{} \expandafter\gdef\csname #1\endcsname##1{ \@for\reserved@a:=##1\do{ \expandafter\ifx\csname thu@#1\endcsname\@empty\else \expandafter\g@addto@macro\csname thu@#1\endcsname{% \ignorespaces\csname thu@#1@separator\endcsname} \fi \expandafter\expandafter\expandafter\g@addto@macro% \expandafter\csname thu@#1\expandafter\endcsname\expandafter{\reserved@a}}}} % \end{macrocode} % \end{macro} % \begin{macro}{\ckeywords} % \begin{macro}{\ekeywords} % 利用 \cs{thu@parse@keywords} 来定义,内部通过 \cs{thu@ckeywords} 和 % \cs{thu@ekeywords} 来引用。 % \changes{v3.1}{2007/06/16}{增强的关键词命令。} % \begin{macrocode} \thu@parse@keywords{ckeywords} \thu@parse@keywords{ekeywords} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\thusetup} % \changes{v5.1.0}{2015/12/26}{通过 \cs{thusetup} 统一设置封面信息。} % 由上可见,封面和封底有一大堆信息需要设置,为了简化操作界面,提供一 % 个 \cs{thusetup} 命令支持 key/value 的方式来设置。key 就是前面各个设置项的 % 名字。\note[说明:]{只能设置普通项,不支持环境项, % 如 \texttt{cabstract} 和 \texttt{eabstract}。} 由于这些设置项被 \cs{makecover} % 调用,所以此命令需要在 \cs{makecover} 之前被调用。 % \begin{macrocode} \def\thusetup{\kvsetkeys{thu}} % % \end{macrocode} % \end{macro} % % \changes{v1.4rc1}{2005/12/14}{I have to put all chinese chars into cfg, % otherwise they would not appear.} % \changes{v2.5.1}{2006/05/25}{硕士封面的冒号前居然有点小距离!} % \changes{v3.1}{2007/10/09}{去掉配置文件中的 \cs{hfill}。} % \changes{v3.1}{2007/10/09}{\textbf{内部}密级前面要五角星了。} % \changes{v4.0}{2007/11/08}{\textbf{内部}密级前面终究还是不要五角星了。} % \changes{v4.4.2}{2008/06/05}{本科生格式终于也开始用空格作为关键字分隔符了。} % \changes{v4.4.2}{2008/06/07}{本科生签名之间距离改为 \cs{hskip1em}。} % \changes{v4.5.2}{2010/05/29}{本科论文日期具体到日。} % \changes{v4.6}{2011/04/26}{增加博士后相关配置。} % \changes{v4.7}{2012/05/27}{修正本科生作者信息名称。} % \changes{v4.7}{2012/05/27}{本科生关键字也用分号分割了。} % \changes{v5.3.0}{2016/03/11}{更新到研究生院 2016.3 指南。} % 定义封面用到的各种文字。 % \begin{macrocode} %<*cfg> \def\thu@ckeywords@separator{;} \def\thu@ekeywords@separator{;} \def\thu@catalog@number@title{分类号} \def\thu@id@title{编号} \def\thu@title@sep{:} \ifthu@postdoctor \def\thu@secretlevel{密级} \else \def\thu@secretlevel{秘密} \fi \def\thu@secretyear{\the\year} \def\thu@schoolname{清华大学} \def\thu@postdoctor@report@title{博士后研究报告} \def\thu@bachelor@subtitle{综合论文训练} \def\thu@bachelor@title@pre{题目} \def\thu@postdoctor@date@title{研究起止日期} \ifthu@postdoctor \def\thu@author@title{博士后姓名} \else \ifthu@bachelor \def\thu@author@title{姓名} \else \def\thu@author@title{研究生} \fi \fi \def\thu@postdoctor@first@discipline@title{流动站(一级学科)名称} \def\thu@postdoctor@second@discipline@title{专\hspace{1em}业(二级学科)名称} \def\thu@secret@content{% \unskip\ifthu@master$\bigstar$ \fi% \ifthu@doctor$\bigstar$ \fi% \thu@secretyear 年} \def\thu@apply{(申请清华大学\thu@cdegree 学位论文)} \ifthu@bachelor \def\thu@department@title{系别} \def\thu@major@title{专业} \else \def\thu@department@title{培养单位} \def\thu@major@title{学科} \fi \ifthu@postdoctor \def\thu@supervisor@title{合作导师} \else \def\thu@supervisor@title{指导教师} \fi \ifthu@bachelor \def\thu@assosuper@title{辅导教师} \else \def\thu@assosuper@title{副指导教师} \fi \def\thu@cosuper@title{% \ifthu@doctor 联合导师\else \ifthu@master 联合指导教师\fi\fi} \cdate{\ifthu@bachelor\CJK@todaysmall\else\CJK@todaybig@short\fi} \edate{\ifcase \month \or January\or February\or March\or April\or May% \or June\or July \or August\or September\or October\or November \or December\fi\unskip,\ \ \the\year} \newcommand{\thu@authtitle}{关于学位论文使用授权的说明} \newcommand{\thu@authorization}{% \ifthu@bachelor 本人完全了解清华大学有关保留、使用学位论文的规定,即:学校有权保留学位 论文的复印件,允许该论文被查阅和借阅;学校可以公布该论文的全部或部分内 容,可以采用影印、缩印或其他复制手段保存该论文。 \else 本人完全了解清华大学有关保留、使用学位论文的规定,即: 清华大学拥有在著作权法规定范围内学位论文的使用权,其中包括:(1)已获学位的研究生 必须按学校规定提交学位论文,学校可以采用影印、缩印或其他复制手段保存研究生上交的 学位论文;(2)为教学和科研目的,学校可以将公开的学位论文作为资料在图书馆、资料 室等场所供校内师生阅读,或在校园网上供校内师生浏览部分内容\ifthu@master 。\else ; (3)根据《中华人民共和国学位条例暂行实施办法》,向国家图书馆报送可以公开的学位 论文。\fi 本人保证遵守上述规定。 \fi} \newcommand{\thu@authorizationaddon}{% \ifthu@bachelor(涉密的学位论文在解密后应遵守此规定)\else (保密的论文在解密后应遵守此规定)\fi} \newcommand{\thu@authorsig}{\ifthu@bachelor 签\hskip1em名:\else 作者签名:\fi} \newcommand{\thu@teachersig}{导师签名:} \newcommand{\thu@frontdate}{% 日\ifthu@bachelor\hspace{1em}\else\hspace{2em}\fi 期:} \newcommand{\thu@ckeywords@title}{关键词:} % % \end{macrocode} % % % \myentry{封面第一页} % \begin{macro}{\thu@first@titlepage} % 题名使用一号黑体字,一行写不下时可分两行写,并采用 1.25 倍行距。 % 申请学位的学科门类: 小二号宋体字。 % 中文封面页边距: % 上- 6.0 厘米,下- 5.5 厘米,左- 4.0 厘米,右- 4.0 厘米,装订线 0 厘米; % \changes{v2.5.1}{2006/05/21}{本科封面标题调整微小的空隙。} % \changes{v2.5.1}{2006/05/21}{本科封面标题第二行的横线上移一点。} % \changes{v2.5.2}{2006/05/29}{研究生论文标题中英文用 arial 字体。} % \changes{v2.6}{2006/06/09}{本科生题目加长,最多 24 个字。} % \changes{v4.6}{2011/04/26}{增加博士后封面。} % \changes{v4.7}{2011/11/28}{硕士中文封面不再需要英文标题。} % \changes{v4.7}{2012/05/30}{本科生题目下划线长度自动适应字数。} % \changes{v5.1.0}{2015/12/27}{利用 \env{CJKfilltwosides} 优化封面排版。} % % \begin{macrocode} %<*cls> \newcommand\thu@underline[2][6em]{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt} \newlength{\thu@title@width} \ifxetex % todo: ugly codes \newcommand{\thu@put@title}[2][\thu@title@width]{% \begin{CJKfilltwosides}[b]{#1}#2\end{CJKfilltwosides}} \else \newcommand{\thu@put@title}[2][\thu@title@width]{% \begin{CJKfilltwosides}{#1}#2\end{CJKfilltwosides}} \fi \def\thu@first@titlepage{% \ifthu@postdoctor\thu@first@titlepage@postdoctor\else\thu@first@titlepage@other\fi} \newcommand{\thu@first@titlepage@postdoctor}{ \begin{center} \setlength{\thu@title@width}{3em} \vspace*{0.7cm} \begingroup\wuhao[1.5]% \thu@put@title{\thu@catalog@number@title}\thu@underline\thu@catalognumber\hfill% \thu@put@title{\thu@secretlevel}% \expandafter\thu@underline\ifthu@secret\thu@secret@content\else\relax\fi\par \thu@put@title{U D C}\thu@underline\thu@udc\hfill% \thu@put@title{\thu@id@title}\thu@underline\thu@id\par\vskip3cm\endgroup \begingroup\heiti {\xiaochu\ziju{1}\thu@schoolname}\par\vskip2cm {\xiaoyi\ziju{1}\thu@postdoctor@report@title}\par\vskip3cm {\sanhao[1.5]\thu@ctitle}\par\vskip2cm {\xiaoer\thu@cauthor} \endgroup \par\vskip3cm {\xiaosan[1.5]\ziju{1}\thu@schoolname\par\vskip0.5em\CJK@todaysmall@short} \end{center} \cleardoublepage \begin{center} \vspace*{2cm} {\sihao\heiti\thu@ctitle\par\thu@etitle}\par \parbox[t][7cm][b]{\textwidth-6cm}{\sihao[1.5]% \setlength{\thu@title@width}{11em} \setlength{\extrarowheight}{6pt} \ifxetex % todo: ugly codes \begin{tabular}{p{\thu@title@width}@{}l@{\extracolsep{8pt}}l} \else \begin{tabular}{p{\thu@title@width}l@{}l} \fi \thu@put@title{\thu@author@title} & \thu@title@sep & \thu@cauthor \\ \thu@put@title{\thu@postdoctor@first@discipline@title} & \thu@title@sep & \thu@cfirstdiscipline\\ \thu@put@title{\thu@postdoctor@second@discipline@title} & \thu@title@sep & \thu@cseconddiscipline\\ \thu@put@title{\thu@supervisor@title} & \thu@title@sep & \thu@csupervisor\\ \end{tabular}} \vskip2cm {\sihao\thu@postdoctor@date@title\hskip1em\underline\thu@postdoctordate} \end{center}} \newcommand{\thu@first@titlepage@other}{ \begin{center} \vspace*{-1.6cm} \parbox[b][2.4cm][t]{\textwidth}{% \ifthu@secret{\heiti\sanhao\thu@secretlevel\thu@secret@content}\else\rule{1cm}{0cm}\fi} \ifthu@bachelor \vskip0.65cm {\yihao\lishu\ziju{0.5}\thu@schoolname} \par\vskip1.5cm {\xiaochu\heiti\ziju{0.5}\textbf\thu@bachelor@subtitle} \vskip2.2cm\hskip0.8cm \noindent\heiti\xiaoer\thu@bachelor@title@pre\thu@title@sep \parbox[t]{12cm}{% \ignorespaces\yihao[1.51]% \renewcommand{\CJKunderlinebasesep}{0.25cm}% \renewcommand{\ULthickness}{1.3pt}% \ifxetex \xeCJKsetup{underline/format=\color{black}}% \else \def\CJKunderlinecolor{\color{black}}% \fi \CJKunderline*{\thu@ctitle}}% \vskip1.3cm \else \vskip0.8cm \parbox[t][9cm][t]{\paperwidth-8cm}{ \renewcommand{\baselinestretch}{1.3} \begin{center} \yihao[1.2]{\sffamily\thu@ctitle}\par% \par\vskip 18bp% \xiaoer[1]\textrm{\thu@apply}% \end{center}} \fi % \end{macrocode} % % 作者及导师信息部分使用三号仿宋字 % \changes{v2.0}{2005/12/20}{封面的培养单位,学科等内容字距自动调整。} % \changes{v2.1}{2006/02/29}{增加本科部分。} % \changes{v2.6.2}{2006/06/17}{如果本科生没有辅导教师则不显示。} % \changes{v3.1}{2007/10/09}{重新放置封面表格的提示元素。} % \changes{v4.4.3}{2008/06/09}{修改本科生论文封面格式以符合新样例。} % \changes{v5.1.0}{2015/12/27}{修改联合指导教师显示问题。} % \begin{macrocode} \ifthu@bachelor \vskip0.75cm \ifx\thu@cassosupervisor\@empty% \def\thu@tempa{7.15cm} \else% \def\thu@tempa{8.15cm} \fi% \parbox[t][\thu@tempa][t]{\textwidth}{% {\fangsong\sanhao[1.95]% \hspace*{1.9cm} \setlength{\thu@title@width}{4em} \setlength{\extrarowheight}{6pt} \ifxetex % todo: ugly codes \begin{tabular}{p{\thu@title@width}@{}l@{\extracolsep{8pt}}l} \else \begin{tabular}{p{\thu@title@width}l@{}l} \fi \thu@put@title{\thu@department@title} & \thu@title@sep & \thu@cdepartment\\ \thu@put@title{\thu@major@title} & \thu@title@sep & \thu@cmajor\\ \thu@put@title{\thu@author@title} & \thu@title@sep & \thu@cauthor \\ \thu@put@title{\thu@supervisor@title} & \thu@title@sep & \thu@csupervisor\\ \ifx\thu@cassosupervisor\@empty\else% \thu@put@title{\thu@assosuper@title} & \thu@title@sep & \thu@cassosupervisor\\ \fi \end{tabular} }} \else \vskip 5bp \parbox[t][7.8cm][t]{\textwidth}{{\sanhao[1.5] \begin{center}\fangsong \setlength{\thu@title@width}{5em} \setlength{\extrarowheight}{4pt} \ifxetex % todo: ugly codes \begin{tabular}{p{\thu@title@width}@{}c@{\extracolsep{8pt}}l} \else \begin{tabular}{p{\thu@title@width}c@{\extracolsep{4pt}}l} \fi \thu@put@title{\thu@department@title} & \thu@title@sep & {\ziju{0.1875}\thu@cdepartment}\\ \thu@put@title{\thu@major@title} & \thu@title@sep & {\ziju{0.1875}\thu@cmajor}\\ \thu@put@title{\thu@author@title} & \thu@title@sep & {\ziju{0.6875}\thu@cauthor}\\ \thu@put@title{\thu@supervisor@title} & \thu@title@sep & {\ziju{0.6875}\thu@csupervisor}\\ \ifx\thu@cassosupervisor\@empty\else \thu@put@title{\thu@assosuper@title} & \thu@title@sep & {\ziju{0.6875}\thu@cassosupervisor}\\ \fi \ifx\thu@ccosupervisor\@empty\else \hfill\makebox[0pt][r]{\thu@cosuper@title} & \thu@title@sep & {\ziju{0.6875}\thu@ccosupervisor}\\ \fi \end{tabular} \end{center}}} \fi % \end{macrocode} % % 论文成文打印的日期,用三号宋体汉字,不用阿拉伯数字 % 本科:论文成文打印的日期用阿拉伯数字,采用小四号宋体 % \changes{v4.4.3}{2008/06/09}{修改本科生论文封面日期格式以符合新样例。} % \begin{macrocode} \begin{center} {\ifthu@bachelor\vskip-1.0cm\xiaosi\else% \vskip-0.5cm\sanhao\fi% \songti\thu@cdate} \end{center} \end{center}} % end of titlepage % % \end{macrocode} % \end{macro} % % \myentry{英文封面} % \begin{macro}{\thu@doctor@engcover} % \changes{v4.2}{2008/01/23}{博士英文封面补充联合导师。} % \changes{v4.7}{2011/11/28}{硕士生新增英文封面。} % 研究生论文使用。 % \begin{macrocode} %<*cfg> \def\thu@master@art{Master of Arts} \def\thu@master@sci{Master of Science} \def\thu@doctor@phi{Doctor of Philosophy} % %<*cls> \newcommand{\thu@engcover}{% \newif\ifthu@professional\thu@professionalfalse \ifthu@master \ifthenelse{\equal{\thu@edegree}{\thu@master@art}} {\relax} {\ifthenelse{\equal{\thu@edegree}{\thu@master@sci}} {\relax} {\thu@professionaltrue}} \fi \ifthu@doctor \ifthenelse{\equal{\thu@edegree}{\thu@doctor@phi}} {\relax} {\thu@professionaltrue} \fi \begin{center} \vspace*{-5pt} \parbox[t][5.2cm][t]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.5} \begin{center} \erhao[1.1]\bfseries\sffamily\thu@etitle% \end{center}} \parbox[t][][t]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.3} \begin{center} \sanhao% \ifthu@master Thesis \else Dissertation \fi Submitted to\\ {\bfseries Tsinghua University}\\ in partial fulfillment of the requirement\\ for the \ifthu@professional professional \fi degree of\\ {\bfseries\sffamily\thu@edegree}% \ifthu@professional\relax\else \\in\\[3bp] {\bfseries\sffamily\thu@emajor}% \fi \end{center}} \parbox[t][][b]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.3} \begin{center} \sanhao\sffamily by\\[3bp] \bfseries\thu@eauthor% \ifthu@professional \ifx\thu@emajor\empty\relax\else \\(~\thu@emajor~)% \fi\fi \end{center}} \par\vspace{0.9cm} \parbox[t][2.1cm][t]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.2} \xiaosan\centering \begin{tabular}{rl} \ifthu@master Thesis \else Dissertation \fi Supervisor : & \thu@esupervisor\\ \ifx\thu@eassosupervisor\@empty \else Associate Supervisor : & \thu@eassosupervisor\\\fi \ifx\thu@ecosupervisor\@empty \else Cooperate Supervisor : & \thu@ecosupervisor\\\fi \end{tabular}} \parbox[t][2cm][b]{\paperwidth-7.2cm}{ \begin{center} \sanhao\bfseries\sffamily\thu@edate \end{center}} \end{center}} % \end{macrocode} % \end{macro} % % \myentry{授权页面} % \begin{macro}{\thu@authorization@mk} % \changes{v4.0}{2007/11/08}{研究生的授权部分调整了一下,不知道老师为什么总爱修改 % 那些无关紧要的格式,郁闷。感谢 PMHT@newsmth 的认真比对。} % \changes{v4.4.2}{2008/06/07}{修改本科生的授权部分,按照 2008 年的新样例。} % 支持扫描文件替换。 % \begin{macrocode} \newcommand{\thu@authorization@mk}{% \ifthu@bachelor\vspace*{0.2cm}\else\vspace*{0.42cm}\fi % shit code! \begin{center}\erhao\heiti\thu@authtitle\end{center} \ifthu@bachelor\vskip5pt\else\vskip40pt\sihao[2.03]\fi\par \thu@authorization\par \textbf{\thu@authorizationaddon}\par \ifthu@bachelor\vskip0.7cm\else\vskip1.0cm\fi \ifthu@bachelor \indent\mbox{\thu@authorsig\thu@underline\relax% \thu@teachersig\thu@underline\relax\thu@frontdate\thu@underline\relax} \else \begingroup \parindent0pt\xiaosi \hspace*{1.5cm}\thu@authorsig\thu@underline[7em]\relax\hfill% \thu@teachersig\thu@underline[7em]\relax\hspace*{1cm}\\[3pt] \hspace*{1.5cm}\thu@frontdate\thu@underline[7em]\relax\hfill% \thu@frontdate\thu@underline[7em]\relax\hspace*{1cm} \endgroup \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\makecover} % 生成封面总命令。 % \changes{v2.1}{2006/02/29}{分成几个小模块来搞,不然这个 macro 太大了,看不过来。} % \begin{macrocode} \def\makecover{% \thu@setup@pdfinfo\thu@makecover} \def\thu@setup@pdfinfo{% \hypersetup{% pdftitle={\thu@ctitle}, pdfauthor={\thu@cauthor}, pdfsubject={\thu@cdegree}, pdfkeywords={\thu@ckeywords}, pdfcreator={\thuthesis-v\version}}} \NewDocumentCommand{\thu@makecover}{o}{ \phantomsection \pdfbookmark[-1]{\thu@ctitle}{ctitle} \normalsize% \begin{titlepage} % \end{macrocode} % % 论文封面第一页! % \begin{macrocode} \thu@first@titlepage % \end{macrocode} % % \changes{v2.5}{2006/05/19}{本科论文评语位置调整。} % \changes{v3.0}{2007/05/12}{本科论文评语取消。} % \changes{v4.7}{2011/11/28}{硕士论文也需要英文封面。} % % 研究生论文需要增加英文封面 % \begin{macrocode} \ifthu@bachelor\relax\else \ifthu@postdoctor\relax\else \cleardoublepage\thu@engcover \fi\fi % \end{macrocode} % % 授权说明 % \changes{v3.0}{2007/05/12}{本科论文授权图片扫描取消。} % \changes{v4.5.2}{2010/05/29}{本科封面和授权说明之间不要空白页。} % \changes{v4.6}{2011/05/29}{博士后报告无授权说明。} % \changes{v5.0.0}{2015/06/05}{使用 \pkg{pdfpages} 宏包支持本硕博论文授权说明扫描版(\#36)。} % \begin{macrocode} \ifthu@postdoctor\relax\else% \ifthu@bachelor\clearpage\else\cleardoublepage\fi% \IfNoValueTF{#1}{% \ifthu@bachelor\thu@authorization@mk\else% \begin{list}{}{% \topsep\z@% \listparindent\parindent% \parsep\parskip% \setlength{\leftmargin}{0.9mm}% \setlength{\rightmargin}{0.9mm}}% \item[]\thu@authorization@mk% \end{list}% \fi% }{% \includepdf{#1}% }% \fi \end{titlepage} % \end{macrocode} % % \changes{v2.5}{2006/05/16}{综合论文训练在授权说明之后。} % \changes{v3.0}{2007/05/12}{本科综合论文训练在电子版中取消。} % % 中英文摘要 % \begin{macrocode} \normalsize \thu@makeabstract \let\@tabular\thu@tabular} % % \end{macrocode} % \end{macro} % % \subsubsection{摘要} % \label{sec:abstractformat} % % \begin{macro}{\thu@put@keywords} % 排版关键字。 % \begin{macrocode} %<*cls> \newbox\thu@kw \newcommand\thu@put@keywords[2]{% \begingroup \setbox\thu@kw=\hbox{#1} \ifthu@bachelor\indent\else\noindent\hangindent\wd\thu@kw\hangafter1\fi% \box\thu@kw#2\par \endgroup} % \end{macrocode} % \end{macro} % % \begin{macro}{\thu@makeabstract} % 中文摘要部分的标题为\textbf{摘要},用黑体三号字。 % \changes{v2.5.1}{2006/05/24}{教务处又不要正文前的页眉了。} % \changes{v2.5.1}{2006/05/24}{不管是哪种论文格式,摘要都要右开。} % \changes{v2.5.2}{2006/05/29}{在研究生论文中,摘要不出现在目录中,但是要在书签中出现。} % \changes{v2.5.3}{2006/06/03}{\cs{pagenumber} 会自动设置页码为 1。} % \changes{v2.6.3}{2006/06/30}{为本科正确设置目录及以后的页码。} % \changes{v4.5.2}{2010/05/29}{本科论文摘要亦无需右开。} % \begin{macrocode} \newcommand{\thu@makeabstract}{% \ifthu@bachelor\clearpage\else\cleardoublepage\fi \thu@chapter*[]{\cabstractname} % no tocline \ifthu@bachelor \pagestyle{thu@plain} \else \pagestyle{thu@headings} \fi \pagenumbering{Roman} % \end{macrocode} % % 摘要内容用小四号字书写,两端对齐,汉字用宋体,外文字用 Times New Roman 体, % 标点符号一律用中文输入状态下的标点符号。 % \changes{v3.1}{2007/06/16}{研究生关键词不再沉底。} % \begin{macrocode} \thu@cabstract % \end{macrocode} % 每个关键词之间空两个汉字符宽度, 且为悬挂缩进。 % \changes{v2.6.2}{2006/06/17}{取消最后一列的空白。} % \changes{v2.6.2}{2006/06/20}{取消 tabular 环境,用 \cs{hangindent} 实现关键词 % 悬挂缩进,英文摘要同。} % \changes{v4.4.2}{2008/06/05}{本科生格式中文关键词采用首行缩进且无悬挂缩进。} % \begin{macrocode} \vskip12bp \thu@put@keywords{\textbf\thu@ckeywords@title}{\thu@ckeywords} % \end{macrocode} % % 英文摘要部分的标题为 \textbf{Abstract},用 Arial 体三号字。研究生的英文摘要要求 % 非常怪异:虽然正文前的封面部分为右开,但是英文摘要要跟中文摘要连 % 续。\changes{v2.5.1}{2006/05/28}{研究生封面英文摘要连续。} % \begin{macrocode} \thu@chapter*[]{\eabstractname} % no tocline % \end{macrocode} % % 摘要内容用小四号 Times New Roman。 % \begin{macrocode} \thu@eabstract % \end{macrocode} % % 每个关键词之间空四个英文字符宽度。 % \changes{v2.4}{2006/04/14}{It is \textbf{Key words}, but not \textbf{Key % Words}.} % \changes{v2.6.2}{2006/06/17}{取消最后一列的空白。} % \changes{v2.6.4}{2006/10/23}{\textbf{Keywords} but not \textbf{Key words}.} % \changes{v3.0}{2007/05/13}{\textbf{Key words} but not % \textbf{Keywords}. What are you doing?} % \changes{v4.4.2}{2008/06/05}{Bachelor English abstract format requires % indent and no hang-indent.} % \changes{v4.7}{2012/06/02}{Bachelor sample uses Keywords w/o space \texttt{-\_-}} % \begin{macrocode} \vskip12bp \thu@put@keywords{% \textbf{\ifthu@bachelor Keywords:\else Key words:\fi\enskip}}{\thu@ekeywords}} % % \end{macrocode} % \end{macro} % % \subsubsection{主要符号表} % \label{sec:denotationfmt} % \begin{environment}{denotation} % 主要符号对照表。 % \changes{v2.0e}{2005/12/18}{主要符号表定义为一个 list,用起来方便。} % \changes{v2.4}{2006/04/14}{为主要符号表环境增加一个可选参数,调节符号列的宽度。} % \changes{v5.2.1}{2016/01/11}{利用 \pkg{enumitem} 改造环境定义,更直观。} % \begin{macrocode} %<*cfg> \newcommand{\thu@denotation@name}{主要符号对照表} % %<*cls> \newenvironment{denotation}[1][2.5cm]{% \thu@chapter*[]{\thu@denotation@name} % no tocline \vskip-30bp\xiaosi[1.6]\begin{thu@denotation}[labelwidth=#1] }{% \end{thu@denotation} } \newlist{thu@denotation}{description}{1} \setlist[thu@denotation]{% nosep, font=\normalfont, align=left, leftmargin=!, % sum of the following 3 lengths labelindent=0pt, labelwidth=2.5cm, labelsep*=0.5cm, itemindent=0pt, } % % \end{macrocode} % \end{environment} % % % \subsubsection{致谢以及声明} % \label{sec:ackanddeclare} % % \begin{environment}{acknowledgement} % 支持扫描文件替换。 % \changes{v2.4}{2006/04/14}{调整\textbf{致谢}等中间的距离。} % \begin{macrocode} %<*cfg> \newcommand{\thu@ackname}{致\hspace{1em}谢} \newcommand{\thu@declarename}{声\hspace{1em}明} \newcommand{\thu@declaretext}{本人郑重声明:所呈交的学位论文,是本人在导师指导下 ,独立进行研究工作所取得的成果。尽我所知,除文中已经注明引用的内容外,本学位论 文的研究成果不包含任何他人享有著作权的内容。对本论文所涉及的研究工作做出贡献的 其他个人和集体,均已在文中以明确方式标明。} \newcommand{\thu@signature}{签\hspace{1em}名:} \newcommand{\thu@backdate}{日\hspace{1em}期:} % % \end{macrocode} % % \changes{v2.0}{2005/12/19}{将致谢定义为一个环境更合适,里面也不用像以前段首需 % 要自己缩进。} % \changes{v1.5}{2005/12/16}{在那些不显示编号的章节前面先执行一次 % \cs{cleardoublepage},使新开章节的页码到达正确的状态。否则会因为 \cs{addcontentsline} % 在 chapter 之前而导致目录页码错误。} % 定义致谢与声明环境。 % \changes{v2.5}{2006/05/16}{本科论文要求致谢声明分页,但是研究生的不分。} % \changes{v2.5.2}{2006/05/29}{研究生致谢右开。} % \changes{v2.5.2}{2006/05/30}{研究生致谢题目是致谢,目录是致谢与声明。} % \changes{v2.6.3}{2006/07/01}{重画双虚线,自适应页面宽度。} % \changes{v4.5.2}{2010/09/19}{研究生论文的致谢和声明终于分开了。} % \changes{v5.2.1}{2016/01/11}{用 \env{acknowledgement} 替换 \env{ack}。} % \begin{macrocode} %<*cls> \NewDocumentEnvironment{acknowledgement}{o}{% \thu@chapter*{\thu@ackname} } % \end{macrocode} % % 声明部分 % \changes{v3.0}{2007/05/12}{本科论文声明部分图片扫描取消。} % \changes{v5.0.0}{2015/06/05}{使用 pdfpages 宏包支持本硕博论文声明扫描版(\#36)。} % \begin{macrocode} { \ifthu@postdoctor\relax\else% \IfNoValueTF{#1}{% \thu@chapter*{\thu@declarename} \par{\xiaosi\parindent2em\thu@declaretext}\vskip2cm {\xiaosi\hfill\thu@signature\thu@underline[2.5cm]\relax% \thu@backdate\thu@underline[2.5cm]\relax}% }{% \includepdf[pagecommand={\thispagestyle{thu@empty}% \phantomsection\addcontentsline{toc}{chapter}{\thu@declarename}% }]{#1}% }% \fi } % \end{macrocode} % \end{environment} % \begin{environment}{ack} % 兼容旧版本保留 \env{ack}。 % \begin{macrocode} \let\ack\acknowledgement \let\endack\endacknowledgement % % \end{macrocode} % \end{environment} % % \subsubsection{图表索引} % \label{sec:threeindex} % \begin{macro}{\listoffigures} % \begin{macro}{\listoffigures*} % \begin{macro}{\listoftables} % \begin{macro}{\listoftables*} % 定义图表以及公式目录样式。 % \changes{v2.5}{2006/05/18}{增加插图、表格和公式索引。} % \changes{v2.5}{2006/05/19}{为了让索引中能出现\textbf{图 xxx},不得不修改 \LaTeX % 内部命令 \cs{@caption}。} % \changes{v2.6.4}{2006/10/23}{增加 \cs{listoffigures*},\cs{listoftables*}。} % \changes{v4.5.1}{2009/01/06}{更优雅的插图/表格索引,避免跟 \pkg{caption} 包冲 % 突。\cs{thu@listof} 相应修改。} % \begin{macrocode} %<*cls> \def\thu@starttoc#1{% #1: float type, prepend type name in \listof*** entry. \let\oldnumberline\numberline \def\numberline##1{\oldnumberline{\csname #1name\endcsname\hskip.4em ##1}} \@starttoc{\csname ext@#1\endcsname} \let\numberline\oldnumberline} \def\thu@listof#1{% #1: float type \@ifstar {\thu@chapter*[]{\csname list#1name\endcsname}\thu@starttoc{#1}} {\thu@chapter*{\csname list#1name\endcsname}\thu@starttoc{#1}}} \renewcommand\listoffigures{\thu@listof{figure}} \renewcommand*\l@figure{\ifthu@bachelor\relax\else\addvspace{6bp}\fi\@dottedtocline{1}{0em}{4em}} \renewcommand\listoftables{\thu@listof{table}} \let\l@table\l@figure % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\equcaption} % \changes{v2.6.2}{2006/06/19}{此命令配合 \pkg{amsmath} 命令基本可以满足所有 % 公式需要。} % 本命令只是为了生成公式列表,所以这个 caption 是假的。如果要编号最好用 % equation 环境,如果是其它编号环境,请手动添加添加 \cs{equcaption}。 % 用法如下: % % \cs{equcaption}\marg{counter} % % \marg{counter} 指定出现在索引中的编号,一般取 \cs{theequation},如果你是用 % \pkg{amsmath} 的 \cs{tag},那么默认是 \cs{tag} 的参数;除此之外可能需要你 % 手工指定。 % % \changes{v2.5}{2006/05/19}{将公式编号写入临时文件以便生成公式列表。} % \changes{v2.5.3}{2006/06/03}{取消 \cs{equcaption} 的参数} % \begin{macrocode} \def\ext@equation{loe} \def\equcaption#1{% \addcontentsline{\ext@equation}{equation}% {\protect\numberline{#1}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\listofequations} % \begin{macro}{\listofequations*} % \LaTeX\ 默认没有公式索引,此处定义自己的 \cs{listofequations}。 % \changes{v2.5}{2006/05/19}{增加公式索引命令。} % \changes{v2.5.1}{2006/05/26}{公式索引项 numwidth 增加。} % \changes{v2.6.4}{2006/10/23}{增加 \cs{listofequations*}。} % \begin{macrocode} \newcommand\listofequations{\thu@listof{equation}} \let\l@equation\l@figure % % \end{macrocode} % \end{macro} % \end{macro} % % % \subsection{参考文献} % \label{sec:ref} % % \begin{macro}{\inlinecite} % 依赖于 \pkg{natbib} 宏包,修改其中的命令。 旧命令 \cs{onlinecite} 依然可用。 % \changes{v5.0.0}{2015/11/23}{用 \cs{inlinecite} 替换 \cs{onlinecite}。为保证兼 % 容性,\cs{onlinecite} 会保留。} % \changes{v5.4.0}{2017/12/3}{\cs{bibliographystyle}\marg{newbib} will cause \cs{bibstyle@newbib} to % be called on THE NEXT LATEX RUN (via the aux file).} % \begin{macrocode} %<*cls> \newcommand\bibstyle@inline{\bibpunct{[}{]}{,}{n}{,}{,}} \DeclareRobustCommand\inlinecite{\@inlinecite} \def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup} \let\onlinecite\inlinecite % % \end{macrocode} % \end{macro} % % 参考文献的正文部分用五号字。 % 行距采用固定值 16 磅,段前空 3 磅,段后空 0 磅。 % 本科生要求固定行距 17pt,段前后间距 3pt。 % % \begin{macro}{\thumasterbib} % \begin{macro}{\thuphdbib} % 本科生和研究生模板要求外文硕士论文参考文献显示``[Master Thesis]'',而博士模板 % 则于 2007 年冬要求显示为``[M]''。对应的外文博士论文参考文献分别显示为``[Phd % Thesis]''和``[D]''。 % 研究生写作指南(201109)要求: % 中文硕士学位论文标注``[硕士学位论文]'', % 中文博士学位论文标注``[博士学位论文]'',外文学位论文标注``[D]''。 % 本科生写作指南未指定,参考文献著录格式文档中对中外文学位论文都标注``[D]''。 % \changes{v4.7}{2012/05/29}{修改两个宏使其对应不同的中文论文需求。} % \begin{macrocode} %<*cfg> \def\thumasterbib{\ifthu@bachelor D\else 硕士学位论文\fi} \def\thuphdbib{\ifthu@bachelor D\else 博士学位论文\fi} % % \end{macrocode} % \end{macro} % \end{macro} % % 复用 \pkg{natbib} 的 \texttt{thebibliography} 环境,调整距离。 % \changes{v2.4}{2006/04/15}{参考文献间距调小一点,label 长度增加一点,以便让超过 % 100 的参考文献更好地对齐。} % \changes{v2.5}{2006/05/13}{参考文献序号靠左,而不是靠右。} % \changes{v2.6.4}{2006/10/23}{调整参考文献标签宽度,使得条目增多时仍能对齐。} % \changes{v5.4.0}{2017/12/03}{基于 \pkg{natbib} 的环境调整距离兼容性更好。} % \begin{macrocode} %<*cls> \renewcommand\bibsection{\thu@chapter*{\bibname}} \renewcommand\bibfont{\ifthu@bachelor\wuhao[1.619]\else\wuhao[1.5]\fi} \setlength\bibhang{2\ccwd} \addtolength{\bibsep}{-0.7em} \setlength{\labelsep}{0.4em} % \end{macrocode} % % 两种引用样式: % \changes{v5.4.1}{2017/12/04}{bst 在 ctan 上不分路径,故加前缀。} % \begin{macrocode} \expandafter\newcommand\csname bibstyle@thuthesis-numeric\endcsname{% \bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \expandafter\newcommand\csname bibstyle@thuthesis-author-year\endcsname{% \bibpunct{(}{)}{;}{a}{,}{,}} % \end{macrocode} % % 下面修改 \pkg{natbib} 的引用格式,主要是将页码写在上标位置。 % numeric 模式的 \cs{citet} 的页码: % \begin{macrocode} \patchcmd\NAT@citexnum{% \@ifnum{\NAT@ctype=\z@}{% \if*#2*\else\NAT@cmt#2\fi }{}% \NAT@mbox{\NAT@@close}% }{% \NAT@mbox{\NAT@@close}% \@ifnum{\NAT@ctype=\z@}{% \if*#2*\else\textsuperscript{#2}\fi }{}% }{}{} % \end{macrocode} % % Numeric 模式的 \cs{citep} 的页码: % \begin{macrocode} \renewcommand\NAT@citesuper[3]{\ifNAT@swa \if*#2*\else#2\NAT@spacechar\fi \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close\if*#3*\else#3\fi}% \else #1\fi\endgroup} % \end{macrocode} % % Author-year 模式的 \cs{citet} 的页码: % \begin{macrocode} \patchcmd{\NAT@citex}{% \if*#2*\else\NAT@cmt#2\fi \if\relax\NAT@date\relax\else\NAT@@close\fi }{% \if\relax\NAT@date\relax\else\NAT@@close\fi \if*#2*\else\textsuperscript{#2}\fi }{}{} % \end{macrocode} % % Author-year 模式的 \cs{citep} 的页码: % \begin{macrocode} \renewcommand\NAT@cite% [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi #1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup} % % \end{macrocode} % % \subsection{附录} % \label{sec:appendix} % \begin{environment}{appendix} % 主要给本科做外文翻译用。 % \begin{macrocode} %<*cls> \let\thu@appendix\appendix \renewenvironment{appendix}{% \let\title\thu@appendix@title \thu@appendix}{% \let\title\@gobble} % \end{macrocode} % \end{environment} % % \begin{macro}{\title} % \changes{v5.2.0}{2016/01/11}{增加 \cs{title} 排版翻译标题。} % 本科外文翻译文章的标题,用法:\cs{title}\marg{资料标题}。这个命令只能在附录环 % 境下使用。 % \begin{macrocode} \let\title\@gobble \newcommand{\thu@appendix@title}[1]{% \begin{center} \xiaosi[1.667] #1 \end{center}} % \end{macrocode} % \end{macro} % % \begin{environment}{translationbib} % \changes{v5.2.0}{2016/01/11}{增加翻译文献环境 \env{translationbib}。} % 外文资料的参考文用宋体五号字,取固定行距17pt,段前后3pt。 % \begin{macrocode} \newlist{translationbib}{enumerate}{1} \setlist[translationbib]{label=[\arabic*],align=left,nosep,itemsep=6bp, leftmargin=10mm,labelsep=!,before=\vspace{0.5\baselineskip}\wuhao[1.3]} % % \end{macrocode} % \end{environment} % % \subsection{个人简历} % % \begin{environment}{resume} % \changes{v1.5}{2005/12/16}{增加个人简历章节的命令,去掉主文件中需要重新 % 定义 \cs{cleardoublepage} 和自己写 \cs{markboth},\cs{addcontentsline} 的部分。} % \changes{v2.0}{2005/12/18}{最后决定将 resume 定义为环境。这样与前面的主要符号 % 表、致谢等对应。} % \changes{v2.5.1}{2006/05/23}{教务处和研究生院非要搞的不一样!} % \changes{v2.5.2}{2006/05/29}{研究生的个人介绍要右开。} % \changes{v4.6}{2011/05/02}{支持可选参数,自己定义简历章节标题。} % 个人简历发表文章等。 % \begin{macrocode} %<*cfg> \ifthu@bachelor \newcommand{\thu@resume@title}{在学期间参加课题的研究成果} \else \ifthu@postdoctor \newcommand{\thu@resume@title}{个人简历、发表的学术论文与科研成果} \else \newcommand{\thu@resume@title}{个人简历、在学期间发表的学术论文与研究成果} \fi \fi % %<*cls> \newenvironment{resume}[1][\thu@resume@title]{% \thu@chapter*{#1}}{} % \end{macrocode} % \end{environment} % % \begin{macro}{\resumeitem} % 个人简历部分。每条信息一个段落,故不需要特别处理。 % \begin{macrocode} \newcommand{\resumeitem}[1]{% \vspace{24bp}{\sihao\heiti\centerline{#1}}\par\vspace{6bp}} % \end{macrocode} % \end{macro} % % \begin{macro}{\researchitem} % 研究成果用 \cs{researchitem}\marg{类别} 开启,包括“学术论文”和“研究成果”两个 % 列表。 % \begin{macrocode} \newcommand{\researchitem}[1]{% \vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}} % \end{macrocode} % \end{macro} % % \begin{environment}{publications} % \begin{environment}{achievements} % 二者分别通过两个环境 \env{publications} 和 \env{achievements} 罗 % 列。 % % \changes{v5.0.0}{2015/04/18}{博士后就不提在学期间了,不合适(\#100)} % \changes{v5.0.0}{2015/05/17}{让简历部分更符合格式指南和示例文件(\#122)} % \begin{macrocode} \newlist{publications}{enumerate}{1} \setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=8bp, leftmargin=10mm,labelsep=!,before=\xiaosi[1.26],resume} \newlist{achievements}{enumerate}{1} \setlist[achievements]{label=[\arabic*],align=left,nosep,itemsep=8bp, leftmargin=10mm,labelsep=!,before=\xiaosi[1.26]} % \end{macrocode} % \end{environment} % \end{environment} % % \begin{macro}{\publicationskip} % \changes{v5.2.0}{2016/01/11}{增加 \cs{publicationskip}。} % \env{publications} 环境可以连续出现多次,第二类论文列表前后要空一行,使 % 用 \cs{publicationskip}。 % \begin{macrocode} \def\publicationskip{\bigskip\bigskip} % % \end{macrocode} % \end{macro} % % \subsection{书脊} % \label{sec:shuji} % \begin{macro}{\shuji} % 单独使用书脊命令会在新的一页产生竖排书脊。 % \changes{v4.5}{2009/01/04}{简化代码,同时支持 \XeLaTeX。} % \changes{v5.0.0}{2015/12/21}{扩展 \cs{shuji}\oarg{标题}\oarg{作者}。} % \begin{macrocode} %<*cls> \NewDocumentCommand{\shuji}{O{\thu@ctitle} O{\thu@cauthor}}{% \newpage\thispagestyle{empty}% \fangsong\ifxetex\addCJKfontfeatures*{RawFeature={vertical:}}\fi \xiaosan\ziju{0.4}% \noindent\hfill\rotatebox[origin=lt]{-90}{\makebox[\textheight]{#1\hfill#2}}} % % \end{macrocode} % \end{macro} % % % \subsection{其它} % \label{sec:other} % % 在模板文档结束时即装入配置文件,这样用户就能在导言区进行相应的修改。 % \changes{v2.5}{2006/05/13}{不用 \cs{CJKcaption},在导言区直接引入配置文件。} % \begin{macrocode} %<*cls> \AtEndOfClass{\input{thuthesis.cfg}} \AtEndOfClass{\sloppy} % % \end{macrocode} % % % \iffalse % \begin{macrocode} %<*dtx-style> \ProvidesPackage{dtx-style} \RequirePackage{hypdoc} \RequirePackage[UTF8,scheme=chinese]{ctex} \RequirePackage{newpxtext} \RequirePackage{newpxmath} \RequirePackage[ top=2.5cm, bottom=2.5cm, left=4cm, right=2cm, headsep=3mm]{geometry} \RequirePackage{array,longtable,booktabs} \RequirePackage{listings} \RequirePackage{fancyhdr} \RequirePackage{xcolor} \RequirePackage{enumitem} \RequirePackage{etoolbox} \RequirePackage{metalogo} \colorlet{thu@macro}{blue!60!black} \colorlet{thu@env}{blue!70!black} \colorlet{thu@option}{purple} \patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} \patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} \patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} \patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} \def\DescribeOption{% \leavevmode\@bsphack\begingroup\MakePrivateLetters% \Describe@Option} \def\Describe@Option#1{\endgroup \marginpar{\raggedleft\PrintDescribeOption{#1}}% \thu@special@index{option}{#1}\@esphack\ignorespaces} \def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{thu@option} #1\ } \def\thu@special@index#1#2{\@bsphack \begingroup \HD@target \let\HDorg@encapchar\encapchar \edef\encapchar usage{% \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% }% \index{#2\actualchar{\string\ttfamily\space#2} (#1)\encapchar usage}% \index{#1:\levelchar#2\actualchar {\string\ttfamily\space#2}\encapchar usage}% \endgroup \@esphack} \lstdefinestyle{lstStyleBase}{% basicstyle=\small\ttfamily, aboveskip=\medskipamount, belowskip=\medskipamount, lineskip=0pt, boxpos=c, showlines=false, extendedchars=true, upquote=true, tabsize=2, showtabs=false, showspaces=false, showstringspaces=false, numbers=none, linewidth=\linewidth, xleftmargin=4pt, xrightmargin=0pt, resetmargins=false, breaklines=true, breakatwhitespace=false, breakindent=0pt, breakautoindent=true, columns=flexible, keepspaces=true, gobble=2, framesep=3pt, rulesep=1pt, framerule=1pt, backgroundcolor=\color{gray!5}, stringstyle=\color{green!40!black!100}, keywordstyle=\bfseries\color{blue!50!black}, commentstyle=\slshape\color{black!60}} \lstdefinestyle{lstStyleShell}{% style=lstStyleBase, frame=l, rulecolor=\color{purple}, language=bash} \lstdefinestyle{lstStyleLaTeX}{% style=lstStyleBase, frame=l, rulecolor=\color{violet}, language=[LaTeX]TeX} \lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} \lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} \setlist{nosep} \DeclareDocumentCommand{\option}{m}{\textsf{#1}} \DeclareDocumentCommand{\env}{m}{\texttt{#1}} \DeclareDocumentCommand{\pkg}{s m}{% \texttt{#2}\IfBooleanF#1{\thu@special@index{package}{#2}}} \DeclareDocumentCommand{\file}{s m}{% \texttt{#2}\IfBooleanF#1{\thu@special@index{file}{#2}}} \newcommand{\myentry}[1]{% \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} \newcommand{\note}[2][Note]{{% \color{magenta}{\bfseries #1}\emph{#2}}} \def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} % % \end{macrocode} % \fi % % \Finale % \endinput % \iffalse % Local Variables: % mode: doctex % TeX-master: t % End: % \fi