summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-12-24 23:08:08 +0000
committerKarl Berry <karl@freefriends.org>2015-12-24 23:08:08 +0000
commit21c374dac3e9da7af20b033b1356184556c0cb89 (patch)
tree006bb1542cfc82912d2d05613def55bec556145a /Master/texmf-dist/source/latex
parentb0887a408058ad36d79cda138316ce8840398c8f (diff)
thuthesis (24dec15)
git-svn-id: svn://tug.org/texlive/trunk@39192 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx1488
-rw-r--r--Master/texmf-dist/source/latex/thuthesis/thuthesis.ins47
2 files changed, 764 insertions, 771 deletions
diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
index 7d197c9cec4..10be7444974 100644
--- a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
+++ b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2005-2014 by Ruini Xue <xueruini@gmail.com>
+% Copyright (C) 2005-2015 by Ruini Xue <xueruini@gmail.com>
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3a
@@ -12,36 +12,19 @@
% and version 1.3a or later is part of all distributions of LaTeX
% version 2004/10/01 or later.
%
-% $Id$
-%
% \fi
%
-% \CheckSum{2499}
-% \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 \~}
+% \CheckSum{0}
%
% \iffalse
%<*driver>
-\ProvidesFile{thuthesis.dtx}[2014/12/09 4.8.1 Tsinghua University Thesis Template]
-\documentclass[10pt]{ltxdoc}
+\ProvidesFile{thuthesis.dtx}[2015/12/24 5.0 Tsinghua University Thesis Template]
+\documentclass{ltxdoc}
+
\usepackage{dtx-style}
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-%\OnlyDescription
+
+\AtBeginDocument{\RecordChanges\CodelineIndex\EnableCrossrefs}
+
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -115,30 +98,30 @@
% \changes{v4.7}{2012/06/12}{去掉 \pkg{hypernat} 依赖,\pkg{hyperref} 和 \pkg{natbib} 可以很好配合了。}
% \changes{v4.8}{2014/11/25}{好几年累积的一些更新,最重要的是切换到 \pkg{ctex}。}
%
-% \DoNotIndex{\begin,\end,\begingroup,\endgroup}
-% \DoNotIndex{\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
-% \DoNotIndex{\let,\def,\xdef,\newcommand,\renewcommand}
+% \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,\interlinepenalty}
+% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty}
+% \DoNotIndex{\textbf,\textit,\textsf,\textsc}
% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad}
-% \DoNotIndex{\centering,\raggedright}
+% \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}
%
% \IndexPrologue{\section*{索引}%
-% \addcontentsline{toc}{section}{索~~~~引}}
+% \addcontentsline{toc}{section}{索引}}
% \GlossaryPrologue{\section*{修改记录}%
% \addcontentsline{toc}{section}{修改记录}}
%
% \renewcommand{\abstractname}{摘~~要}
% \renewcommand{\contentsname}{目~~录}
%
-%
-% \title{\thuthesis:清华大学学位论文模板\thanks{Tsinghua University \LaTeX{} Thesis Template.}}
+% \title{\bfseries\thuthesis:清华大学学位论文模板\thanks{Tsinghua University \LaTeX{} Thesis Template.}}
% \author{{\fangsong 薛瑞尼\thanks{LittleLeo@newsmth}}\\[5pt]{\fangsong 清华大学
% 计算机系高性能所\thanks{目前于电子科技大学工作。}}\\[5pt] \texttt{xueruini@gmail.com}}
% \date{v\fileversion\ (\filedate)}
@@ -171,26 +154,24 @@
%
%
% \clearpage
+% \pagestyle{fancy}
% \begin{multicols}{2}[
-% \section*{\contentsname}
% \setlength{\columnseprule}{.4pt}
% \setlength{\columnsep}{18pt}]
% \tableofcontents
% \end{multicols}
-%
% \clearpage
-% \pagenumbering{arabic}
-% \pagestyle{headings}
+%
% \section{模板介绍}
% \thuthesis\ (\textbf{T}sing\textbf{hu}a \textbf{Thesis}) 是为了帮助清华大学毕业
% 生撰写毕业论文而编写的 \LaTeX{} 论文模板。
%
% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据
-% 第~\ref{sec:howtoask}节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代
+% 第~\ref{sec:howtoask} 节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代
% 码的贡献。
%
-% {\color{blue}\fangsong 模板的作用在于减少论文写作过程中格式调整的时间,前提是遵
-% 守模板的用法,否则即便用了 \thuthesis{} 也难以保证输出的论文符合学校规范。}
+% \note{模板的作用在于减少论文写作过程中格式调整的时间,前提是遵守模板的用法,否
+% 则即便用了 \thuthesis{} 也难以保证输出的论文符合学校规范。}
%
%
% \section{安装}
@@ -222,15 +203,16 @@
% thuthesis.dtx & 模板文档代码的混合文件\\
% thuthesis.cls & 模板类文件\\
% thuthesis.cfg & 模板配置文件\\
-% thufonts.def & 中文字体配置文件\\
-% thubib.bst & 参考文献样式文件\\\hline
+% ctex-fontset-thuthesis.def & 中文字体配置文件\\
+% thuthesis.bst & 参考文献样式文件\\\hline
% main.tex & 示例文档主文件\\
% shuji.tex & 书脊示例文档\\
% ref/ & 示例文档参考文献目录\\
% data/ & 示例文档章节具体内容\\
% figures/ & 示例文档图片路径\\
-% thutils.sty & 为示例文档加载其它宏包\\\hline
+% thuthesis.sty & 为示例文档加载其它宏包\\\hline
% Makefile & self-explanation\\
+% latexmkrc & latexmk 配置文件 \\
% zhfonts.py & 生成中文字体配置文件\\
% README.md & self-explanation\\
% \textbf{thuthesis.pdf} & 用户手册(本文档)\\\hline
@@ -243,38 +225,25 @@
% 将 \file{thuthesis.cls} 和 \file{thuthesis.cfg} 文件一起发布。
% \item 使用前阅读文档:\file{thuthesis.pdf}.
% \end{itemize}
-%
+%
% \subsection{准备工作}
% \label{sec:prepare}
-% 本模板用到的主要宏包包括:
-%
-% \begin{center}
-% \begin{minipage}{1.0\linewidth}\centering
-% \begin{tabular}{*{6}{l}}\hline
-% \pkg{ifxetex} & \pkg{xunicode} & \pkg{CJK} & \pkg{xeCJK} & \pkg{CJKpunct} & \pkg{ctex} \\
-% \pkg{array} & \pkg{booktabs} & \pkg{longtable} & \pkg{amsmath} & \pkg{amssymb} & \pkg{ntheorem} \\
-% \pkg{indentfirst} & \pkg{paralist} & \pkg{txfonts} & \pkg{natbib} & \pkg{hyperref} & \pkg{graphicx} \\
-% \pkg{subcaption} & \pkg{caption} & \pkg{thubib.bst} & & & \\\hline
-% \end{tabular}
-% \end{minipage}
-% \end{center}
-%
-% 这些包在常见的 \TeX{} 系统中都有,如果没有请到 \url{www.ctan.org} 下载。
-%
+% 本模板用到的宏包比较多,这些包在常见的 \TeX{} 系统中都有,如果没有安装请优先使用发
+% 行版自带的升级工具下载。现在的发行版都可以自动解决依赖,很少需要手动。
%
% \subsection{开始安装}
% \label{sec:install}
%
% \subsubsection{生成模板}
% \label{sec:generate-cls}
-% {\heiti 说明:默认的发行包中已经包含了所有文件,可以直接使用。如果对如何生成模
-% 板文件以及模板文档不感兴趣,请跳过本小节。}
+% \note{默认的发行包中已经包含了所有文件,可以直接使用。如果对如何生成模板文件以
+% 及模板文档不感兴趣,请跳过本小节。}
%
% 模板解压缩后生成文件夹 \file{thuthesis-VERSION}\footnote{VERSION 为版本号。},
% 其中包括:模板源文件(\file{thuthesis.ins} 和 \file{thuthesis.dtx}),参考文献
-% 样式 \file{thubib.bst},示例文档
-% (\file{main.tex},\file{shuji.tex},\file{thufonts.def}\footnote{Xe\LaTeX 中文
-% 字体配置文件},\file{thutils.sty}\footnote{可能用到的包以及一些命令定义都放在这
+% 样式 \file{thuthesis.bst},示例文档
+% (\file{main.tex},\file{shuji.tex},\file{ctex-fontset-thuthesis.def}\footnote{Xe\LaTeX 中文
+% 字体配置文件},\file{thuthesis.sty}\footnote{可能用到的包以及一些命令定义都放在这
% 里,以免 \file{thuthesis.cls} 过分臃
% 肿。},\file{data/} 和 \file{figures/} 和 \file{ref/})。在使用之前需要先生成模
% 板文件和配置文件(具体命令细节请参考 \file{README.md} 和 \file{Makefile}):
@@ -292,70 +261,67 @@
% $ xelatex thuthesis.dtx % 生成说明文档 thuthesis.pdf
% \end{shell}
%
-%
-% \subsubsection{dvi$\rightarrow$ps$\rightarrow$pdf}
-% \label{sec:dvipspdf}
+% \subsubsection{xelatex}
+% \label{sec:xelatex}
% 很多用户对 \LaTeX{} 命令执行的次数不太清楚,一个基本的原则是多次运行 \LaTeX{}命
% 令直至不再出现警告。下面给出生成示例文档的详细过程(\# 开头的行为注释),首先来
-% 看经典的 \texttt{dvi$\rightarrow$ps$\rightarrow$pdf} 方式:
+% 看比较推荐的 \texttt{xelatex} 方式:
% \begin{shell}
% # 1. 发现里面的引用关系,文件后缀 .tex 可以省略
-% $ latex main
+% $ xelatex main
%
% # 2. 编译参考文件源文件,生成 bbl 文件
% $ bibtex main
%
% # 3. 下面解决引用
-% $ latex main
-% # 如果是 GBK 编码,此处运行:
-% # $ gbk2uni main # 防止书签乱码
-% $ latex main # 此时生成完整的 dvi 文件
-%
-% # 4. 生成 ps
-% $ dvips main.dvi
-%
-% # 5. 生成 pdf
-% $ ps2pdf main.ps
+% $ xelatex main
+% $ xelatex main # 此时生成完整的 pdf 文件
% \end{shell}
+% Xe\TeX 最大的优势就是不再需要繁琐的字体配置。\thuthesis{} 通过 \pkg{xeCJK} 来控
+% 制中文字体和标点压缩。模板里默认用的是中易的六款免费字体(宋,黑,楷,仿宋,隶书
+% 和幼圆),因学位论文需求不建议替换为其他字体。如果实在必要,可以通过定制
+% \file{ctex-fontset-thuthesis.def} 文件中的字体自行替换。研究生一般用不到隶书和幼圆字体,如果
+% 系统上没有它们,可以直接将 \file{ctex-fontset-thuthesis.def} 文件以及论文的 \file{.tex} 文件中
+% 相应行删除。字体配置参考第~\ref{sec:font-config} 节。
%
-% 模板已经把纸型信息写入目标文件,这样执行 \texttt{dvips} 时就可以避免由于遗忘
-% \texttt{-ta4} 参数而导致输出不合格的文件(因为 \texttt{dvips} 默认使用
-% letter 纸型)。
-%
-% \subsubsection{dvipdfm(x)}
+% \subsubsection{dvipdfmx}
% \label{sec:dvipdfmx}
-% 如果使用 \texttt{dvipdfm(x)},那么在生成完整的 dvi 文件之后(参见上面的例子),
-% 可以直接得到 pdf:
+% 如果使用 \texttt{dvipdfmx},那么需要先生成完整的 dvi 文件:
% \begin{shell}%
-% $ dvipdfm main.dvi
-% # 或者
-% $ dvipdfmx main.dvi
+% $ latex main
+% $ bibtex main
+% $ latex main
+% $ latex main
+% \end{shell}
+% 在生成完整的 dvi 文件之后,可以用 dvipdfmx 直接得到 pdf 文件:
+% \begin{shell}%
+% $ dvipdfmx main
% \end{shell}
%
% \subsubsection{pdflatex}
% \label{sec:pdflatex}
-% 如果使用 PDF\LaTeX,按照第~\ref{sec:dvipspdf} 节的顺序执行到第 3 步即可,不再经
-% 过中间转换。
+% 如果使用 PDF\LaTeX,按照第~\ref{sec:xelatex} 节的顺序执行即可,只是将命令中
+% xelatex 替换为 pdflatex。
%
% 需要注意的是 PDF\LaTeX\ 不能处理常见的 EPS 图形,需要先用 epstopdf 将其转化
% 成 PDF。不过 PDF\LaTeX\ 增加了对 png,jpg 等标量图形的支持,比较方便。
+% TeX Live 自从 2010 版本起自动调用 epstopdf 将 EPS 图形转化为 PDF。
%
-% \subsubsection{xelatex}
-% \label{sec:xelatex}
-% Xe\TeX 最大的优势就是不再需要繁琐的字体配置。\thuthesis{} 通过 \pkg{xeCJK} 来控
-% 制中文字体和标点压缩。模板里默认用的是中易的四款免费字体(宋,黑,楷,仿宋),
-% 用户可以根据自己的实际情况自行替换。另外,本科论文封面要用到隶书,请用户自行修
-% 改。字体配置参考第~\ref{sec:font-config} 节。
-%
-% Xe\LaTeX\ 的使用步骤同 PDF\LaTeX。
-%
+% \subsubsection{latexmk}
+% \label{sec:latexmk}
+% \texttt{latexmk} 命令支持全自动生成 \LaTeX{} 编写的文档,并且支持使用不同的工具
+% 链来进行生成,它会自动运行多次工具直到交叉引用都被解决。下面给出了一个用
+% \texttt{latexmk} 调用 \texttt{xelatex} 生成最终文档的示例:
+% \begin{shell}
+% # 一句话就够了!
+% $ latexmk -xelatex main
+% \end{shell}
%
% \subsubsection{自动化过程}
% \label{sec:automation}
% 上面的例子只是给出一般情况下的使用方法。虽然命令很简单,但是每次都输入的话还是
-% 非常罗嗦的,所以 \thuthesis{} 还提供了一些自动处理的文件。
+% 非常罗嗦的,所以 \thuthesis{} 还提供了一个简单的 \file{Makefile}:
%
-% 我们提供了一个简单的 \file{Makefile}:
% \begin{shell}
% $ make clean
% $ make cls # 生成 thuthesis.cls 和 thuthesis.cfg
@@ -364,22 +330,24 @@
% $ make shuji # 生成书脊 shuji.pdf
% \end{shell}
%
-% \file{Makefile} 默认采用 Xe\LaTeX\ 编译,可以根据自己的需要修
-% 改 \file{Makefile} 开头的参数设置或通过命令行传递参数(请参看 \file{README.md})。
-%
+% \thuthesis{} 的 Makefile 默认用 \texttt{latexmk} 调用
+% \texttt{xelatex} 编译,此外还支持采用 \texttt{xelatex}、\texttt{pdflatex} 和
+% \texttt{dvipdfmx} 方式编译,如有需要可以修
+% 改 \file{Makefile} 开头的参数设置或通过命令行传递参数(请参看 \file{README.md}),
+% 进一步还可以修改 \file{latexmkrc} 进行定制。
%
% \subsection{升级}
% \label{sec:updgrade}
% \thuthesis{} 升级非常简单,可以通过 TeX 发行版的包管理工具自动更新发行版,也可
% 以下载最新的开发版,
-% 将 \file{thuthesis.ins},\file{thuthesis.dtx} 和 \file{thubib.bst} 拷贝至工作目
+% 将 \file{thuthesis.ins},\file{thuthesis.dtx} 和 \file{thuthesis.bst} 拷贝至工作目
% 录覆盖相应的文件,然后运行:
% \begin{shell}
% $ latex thuthesis.ins
% \end{shell}
%
% 生成新的类文件和配置文件即可。也可以直接拷
-% 贝 \file{thuthesis.cls},\file{thuthesis.cfg}和 \file{thubib.bst},免去上面命令
+% 贝 \file{thuthesis.cls},\file{thuthesis.cfg}和 \file{thuthesis.bst},免去上面命令
% 的执行。
%
%
@@ -406,29 +374,24 @@
% \subsection{\thuthesis{} 示例文件}
% \label{sec:userguide1}
% 模板核心文件有四
-% 个:\file{thuthesis.cls},\file{thuthesis.cfg},\file{thufonts.def} 和
-% \file{thubib.bst},但是如果没有示例文档用户会发现很难下手。所以推荐新用户从模板
+% 个:\file{thuthesis.cls},\file{thuthesis.cfg},\file{ctex-fontset-thuthesis.def} 和
+% \file{thuthesis.bst},但是如果没有示例文档用户会发现很难下手。所以推荐新用户从模板
% 自带的示例文档入手,里面包括了论文写作用到的所有命令及其使用方法,只需要用自己
% 的内容进行相应替换就可以。对于不清楚的命令可以查阅本手册。下面的例子描述了模板
% 中章节的组织形式,来自于示例文档,具体内容可以参考模板附带
% 的 \file{main.tex} 和 \file{data/}。
%
% \begin{example}
-% \documentclass[bachelor,nofonts]{thuthesis}
-% %\documentclass[master,adobefonts]{thuthesis}
-% %\documentclass[doctor]{thuthesis}
-% %\documentclass[%
-% % bachelor|master|doctor|postdoctor, % 必选选项
-% % winfonts|nofonts|adobefonts, % 本科生、Linux 用户使用 XeLaTeX 时必选
-% % secret, % 可选选项
-% % openany|openright, % 可选选项
-% % arialtoc,arialtitle % 可选选项
-% % ]{thuthesis}
-% % 当使用 xelatex 编译时,本科生、Linux 用户需要加上 nofonts 选项;
-% % 当使用 pdflatex 编译时,adobefonts 选项等效于 winfonts 选项(缺省选项)。
+% \documentclass[type=bachelor]{thuthesis}
+% % \documentclass[%
+% % type=[bachelor|master|doctor|postdoctor], % 必选项
+% % secret, % 可选项
+% % openany|openright, % 可选项
+% % arialtoc,arialtitle % 可选项
+% % ]{thuthesis}
%
% % 所有其它可能用到的包都统一放到这里了,可以根据自己的实际添加或者删除。
-% \usepackage{thutils}
+% \usepackage{thuthesis}
%
% % 可以在这里修改配置文件中的定义,导言区可以使用中文。
% % \def\myname{薛瑞尼}
@@ -442,6 +405,8 @@
% %%% 封面部分
% \frontmatter
% \input{data/cover}
+% % 如果使用授权说明扫描页,将可选参数中指定为扫描得到的 PDF 文件名,例如:
+% % \makecover[scan-auth.pdf]
% \makecover
%
% % 目录
@@ -468,7 +433,9 @@
%
%
% % 参考文献
-% \bibliographystyle{thubib}
+% % 注意至少需要引用一篇参考文献,否则下面两行可能引起编译错误。
+% % 如果不需要参考文献,请将下面两行删除或注释掉。
+% \bibliographystyle{thuthesis}
% \bibliography{ref/refs}
%
%
@@ -489,37 +456,22 @@
% \subsection{选项}
% \label{sec:option}
% 本模板提供了一些选项以方便使用:
-% \begin{description}
-% \item[bachelor]
-% 如果写本科论文将此选项打开。
+% \begin{options}
+% \changes{v4.8.2}{2015/12/13}{使用 \pkg{kvoptions} 简化选项 type。}
+% \item[type]
+% 选择论文类型,当前支持:bachelor,master,doctor,postdoctor。默认为:bachelor。
% \begin{example}
-% \documentclass[bachelor]{thuthesis}
-% \end{example}
-%
-% \item[master]
-% 如果写硕士论文将此选项打开。
-% \begin{example}
-% \documentclass[master]{thuthesis}
-% \end{example}
-%
-% \item[doctor]
-% 如果写博士论文将此选项打开。
-% \begin{example}
-% \documentclass[doctor]{thuthesis}
-% \end{example}
-%
-% \item[postdoctor]
-% 如果写博士博士后出站报告将此选项打开。
-% \begin{example}
-% \documentclass[postdoctor]{thuthesis}
+% \documentclass[type=doctor]{thuthesis}
% \end{example}
%
% \item[secret]
-% 涉秘论文开关。配合另外两个命令 \cs{secretlevel} 和 \cs{secretyear} 分别用来指
-% 定保密级别和时间。二者默认分别为\textbf{秘密}和当前年份。可以通
-% 过:|\secretlevel{绝密}| 和 |\secretyear}{1984}| 修改。
+% 涉秘论文开关(默认:关闭)。配合另外两个命
+% 令 \cs{secretlevel} 和 \cs{secretyear} 分别用来指定保密级别和时间。二者默认分
+% 别为\textbf{秘密}和当前年份。可以通
+% 过:|\secretlevel{绝密}| 和 |\secretyear{1984}| 修改。
% \begin{example}
-% \documentclass[bachelor, secret]{thuthesis}
+% \documentclass[secret]{thuthesis} % 打开保密
+% \documentclass[secret=false]{thuthesis} % 关闭保密
% \end{example}
%
% \changes{v3.0}{2007/05/12}{不用专门为本科论文生成\textbf{提交}版本了。}
@@ -532,14 +484,6 @@
% 都是 \option{openany}。}这两个选项不用专门设置,\thuthesis{} 会根据当前论文类
% 型自动选择。
%
-% \item[winfonts, adobefonts, nofonts]
-% 这些选项用来指导 \pkg{ctex} 宏包/文档类设置选用的中文字体。
-% \begin{itemize}
-% \item \option{winfonts} 指定使用中易的六款字体(Xe\TeX 下为四种)。
-% \item \option{adobefonts} 指定使用 Adobe 的四款免费中文字体。
-% \item \option{nofonts} 不提供可用的中文字体,由用户自行设定。
-% \end{itemize}
-%
% \item[arial]
% 使用真正的 \option{arial} 字体。此选项会装载 \pkg{arial} 字体宏包,如果此宏包
% 不存在,就装
@@ -555,7 +499,7 @@
%
% \item[arialtitle]
% 章节标题中英文是否用 \option{arial} 字体(默认打开)。
-% \end{description}
+% \end{options}
%
% \subsection{字体配置}
% \label{sec:font-config}
@@ -567,15 +511,10 @@
%
% 第一种方式的字体配置比较繁琐,建议使用 \emph{donated@newsmth} 制作的中文字体包
% (自包含安装方法),请用户自行下载安装,此处不再赘述。本模板推荐使用第二种方法,
-% 只要把所需字体放入系统字体文件夹(也可以指定自定义文件夹)即可。用户可以使
-% 用 \option{winfonts},\option{adobefonts},\option{nofonts} 选项来选择可用的中
-% 文字库,缺省为 \option{winfonts} 有效,使用中易字体。当使用 xelatex 编译
-% 时,\option{winfonts} 只有中易的四款字体(宋体、黑体、楷书和仿宋)可用,而本科
-% 生需要用到幼圆,另外 Linux 系统缺少上述字体,这些用户可以通过指
-% 定 \option{nofonts} 选项,利用 \file{thufonts.def} 文件配置所需字体。使用中易
-% 六种字体的配置如下:
+% 只要把所需字体放入系统字体文件夹(也可以指定自定义文件夹)即可。用户可以使用
+% \file{ctex-fontset-thuthesis.def} 文件配置所需字体。使用中易六种字体的配置如下:
% \begin{example}
-% \ProvidesFile{thufonts.def}
+% \ProvidesFile{ctex-fontset-thuthesis.def}
% \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun}
% \setCJKsansfont{SimHei}
% \setCJKmonofont{FangSong}
@@ -596,13 +535,17 @@
% 对 Windows XP 来说如下,|KaiTi| 需要替换为 |KaiTi_GB2312|,|FangSong| 需要替换
% 为 |FangSong_GB2312|。
%
+% 研究生一般用不到隶书和幼圆字体。如果系统中没有导致报错,可以将
+% \file{ctex-fontset-thuthesis.def} 文件中 zhli 和 zhyou 相应行删除,并将论文 \file{.tex} 文件
+% 中引用 |\lishu| 和 |\youyuan| 的文字删除。
+%
% 宏包中包含了 \file{zhfonts.py} 脚本,为 Linux/Mac 用户提供一种交互式的方式从系
-% 统中文字体中选择合适的六种字体,最终生成对应的 \file{thufonts.def}文件。要使用
+% 统中文字体中选择合适的六种字体,最终生成对应的 \file{ctex-fontset-thuthesis.def}文件。要使用
% 它,只需在命令行输入该脚本的完整路径即可。
%
% 另外,用户也可以通过命令
% \begin{shell}
-% $ fs-list :lang=zh > zhfonts.txt
+% $ fc-list :lang=zh file family style > zhfonts.txt
% \end{shell}
% 得到系统中现有的中文字体列表,并相应替换上述配置。
%
@@ -641,12 +584,11 @@
% 等命令定义一组字体大小,分别为:
%
% \begin{center}
-% \begin{tabular}{lllll}
+% \begin{tabular}{llllll}
% \hline
-% |\chuhao|&|\xiaochu|&|\yihao|&|\xiaoyi| &\\
-% |\erhao|&|\xiaoer|&|\sanhao|&|\xiaosan|&\\
-% |\sihao|& |\banxiaosi|&|\xiaosi|&|\dawu|&|\wuhao|\\
-% |\xiaowu|&|\liuhao|&|\xiaoliu|&|\qihao|& |\bahao|\\\hline
+% \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}\\\hline
% \end{tabular}
% \end{center}
%
@@ -668,15 +610,17 @@
% \end{example}
%
% \myentry{引用方式}
-% \DescribeMacro{\onlinecite}
-
+% \changes{v4.8.2}{2015/11/23}{用 \cs{inlinecite} 替换 \cs{onlinecite}。为保证兼
+% 容性,\cs{onlinecite} 会保留。}
+% \DescribeMacro{\inlinecite}
+%
% 学校要求的参考文献引用有两种模式:(1)上标模式。比如``同样的工作有很
% 多$^{[1,2]}$\ldots''。(2)正文模式。比如``文[3] 中详细说明了\ldots''。其中上标
% 模式使用远比正文模式频繁,所以为了符合使用习惯,上标模式仍然用常规
-% 的 |\cite{key}|,而 |\onlinecite{key}| 则用来生成正文模式。
+% 的 |\cite{key}|,而 |\inlinecite{key}| 则用来生成正文模式。
%
% 关于参考文献模板推荐使用 \BibTeX{},关于中文参考文献需要额外增加一个 Entry: lang,将其设置为 \texttt{zh}
-% 用来指示此参考文献为中文,以便 thubib.bst 处理。如:
+% 用来指示此参考文献为中文,以便 \file{thuthesis.bst} 处理。如:
% \begin{example}
% @INPROCEEDINGS{cnproceed,
% author = {王重阳 and 黄药师 and 欧阳峰 and 洪七公 and 段皇帝},
@@ -699,20 +643,29 @@
% }
% \end{example}
%
+% 注意如果不需要引用参考文献,请删除 \file{main.tex} 中 |\bibliography| 开头的两行,
+% 以避免可能的编译错误。
+%
% \myentry{书脊}
% \DescribeMacro{\shuji}
-% 生成装订的书脊,为竖排格式,默认参数为论文中文题目。如果中文题目中没有英文字母,
-% 那么直接调用此命令即可。否则,就要像例子里面那样做一些微调(参看模板自带
-% 的 \file{shuji.tex})。下面是一个列子:
+% 生成装订的书脊,为竖排格式,命令格式:\cs{shuji}\oarg{标题}\oarg{作者}。默认参
+% 数为论文中文题目和中文作者。如果中文题目中没有英文字母,那么直接调用此命令即可。
+% 否则,就要像例子里面那样做一些微调(参看模板自带的 \file{shuji.tex})。下面是一
+% 个例子:
% \begin{example}
-% \documentclass[bachelor]{thuthesis}
+% \documentclass{thuthesis}
+%
% \begin{document}
% \ctitle{论文中文题目}
% \cauthor{中文姓名}
-% % \shuji 命令需要上面两个变量
-% \shuji
%
-% % 如果你的中文标题中有英文,那可以指定:
+% \shuji % 使用默认标题和默认作者
+%
+% \shuji[使用默认作者的标题]
+%
+% \shuji[同时修改标题和作者的标题][尼瑞薛]
+%
+% % 如果标题中有英文,那可以参考如下方法进行微调:
% \shuji[清华大学~\hspace{0.2em}\raisebox{2pt}{\LaTeX}%
% \hspace{-0.25em} 论文模板 \hspace{0.1em}\raisebox{2pt}%
% {v\version}\hspace{-0.25em}样例]
@@ -824,7 +777,7 @@
% \postdoctordate{2009年7月——2011年7月} % 博士后研究起止日期
% \end{example}
%
-% \myentry{博士后封面其它参数}
+% \myentry{博士后专用参数}
% \DescribeMacro{\catalognumber}
% \DescribeMacro{\udc}
% \DescribeMacro{\id}
@@ -856,6 +809,19 @@
% \ekeywords{keyword 1, keyword 2}
% \end{example}
%
+% \myentry{生成封面}
+% \DescribeMacro{\makecover}
+% 生成封面,包括首页,授权,摘要等。用法:\cs{makecover}\oarg{file}。如果使用授权
+% 说明扫描页,将可选参数中指定为扫描得到的 PDF 文件名,例如:
+% \begin{example}
+% % 直接生成封面
+% \makecover
+%
+% % 将签字扫描后授权文件 scan-auth.pdf 替换原始页面
+% \makecover[scan-auth.pdf]
+% \end{example}
+%
+%
% \subsubsection{其它部分}
% \label{sec:otherparts}
% 论文其它主要部分命令:
@@ -936,10 +902,23 @@
% 处不再罗嗦,实例请参看示例文档附录 A 的前两个公式。
%
% \myentry{简历}
-% \DescribeEnv{resume}\DescribeMacro{\resumeitem}
-% 开启个人简历章节,包括发表文章列表等。其实就是一个 chapter。里面的每个子项目请用命令 |\resumeitem{sub title}|。
+% \DescribeEnv{resume}
+% 开启个人简历章节,包括个人简历,发表文章,研究成果列表等。每个子项目请
+% 用以下对应命令开启:\cs{xxxitem}\marg{subtitle}。
%
-% 这里就不再列举例子了,请参看示例文档的 data/resume.tex。
+% \DescribeMacro{\resumeitem}
+% 个人简历,用法:\cs{resumeitem}\{个人简历\}
+%
+% \DescribeMacro{\researchitem}
+% \DescribeEnv{publications}
+% 发表学术论文,用法:\cs{researchitem}\{发表学术论文\}。随后用
+% \texttt{publicatoins} 环境进行罗列。
+%
+% \DescribeEnv{achievements}
+% 研究成果用 \cs{researchitem}\{研究成果\} 开启,随后用 \texttt{achievements} 环
+% 境罗列。
+%
+% 具体用法请参看示例文档 \file{data/resume.tex}。
%
% \myentry{附录}
% \DescribeEnv{appendix}
@@ -958,7 +937,17 @@
% 学致谢里的话,拿过来做个广告。希望每个人都能写这么一句 :)
% \begin{example}
% \begin{ack}
-% ……
+% …
+% 还要特别感谢计算机系薛瑞尼同学在论文格式和 \LaTeX{} 编译等方面给我的很多帮助!
+% \end{ack}
+% \end{example}
+%
+% 本科论文在此处还有一节“声明”,提交版本时需要替换为签字扫描文件,同样我们也提供:
+% 如果使用声明扫描页,将可选参数指定为扫描后的 PDF 文件名,例如:
+% \begin{example}
+% \begin{ack}[scan-statement.pdf]
+% 加了扫描文件后,这里面的文字就没用了。
+%
% 还要特别感谢计算机系薛瑞尼同学在论文格式和 \LaTeX{} 编译等方面给我的很多帮助!
% \end{ack}
% \end{example}
@@ -967,9 +956,9 @@
% \DescribeEnv{itemize}
% \DescribeEnv{enumerate}
% \DescribeEnv{description}
-% 为了适合中文习惯,模板将这三个常用的列表环境用 \pkg{paralist} 对应的压缩环境替
-% 换。一方面满足了多余空间的清楚,另一方面可以自己指定标签的样式和符号。细节请参
-% 看 \pkg{paralist} 文档,此处不再赘述。
+% 为了适合中文习惯,模板将这三个常用的列表环境用 \pkg{enumitem} 进行了纵向间距压
+% 缩。一方面满足了多余空间的清楚,另一方面可以自己指定标签的样式和符号。细节请参
+% 看 \pkg{enumitem} 文档,此处不再赘述。
%
% \changes{v3.0}{2007/05/12}{没有了综合论文训练页面,很多本科论文专用命令就消失了。}
%
@@ -1019,11 +1008,11 @@
% \label{sec:thanks}
% 感谢这些年来一直陪伴 \thuthesis{} 成长的新老同学,大家的需求是模板前进的动力,
% 大家的反馈是模板提高的机会。
-%
+%
% 本人已离开清华,不能如往日及时升级,热烈欢迎各位
% 到\href{http://github.com/xueruini/thuthesis/}{Github 主页}贡献,继续为大家服
% 务。
-%
+%
% \StopEventually{\PrintChanges\PrintIndex}
% \clearpage
%
@@ -1034,7 +1023,7 @@
%<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<cls>\ProvidesClass{thuthesis}
%<cfg>\ProvidesFile{thuthesis.cfg}
-%<cls|cfg>[2014/12/09 4.8.1 Tsinghua University Thesis Template]
+%<cls|cfg>[2015/12/24 5.0 Tsinghua University Thesis Template]
% \end{macrocode}
%
% \subsection{定义选项}
@@ -1054,16 +1043,33 @@
\hyphenation{Thu-Thesis}
\def\thuthesis{\textsc{ThuThesis}}
\def\version{4.8.1}
-\newif\ifthu@bachelor\thu@bachelorfalse
-\newif\ifthu@master\thu@masterfalse
-\newif\ifthu@doctor\thu@doctorfalse
-\newif\ifthu@postdoctor\thu@postdoctorfalse
-\newif\ifthu@secret\thu@secretfalse
-\DeclareOption{bachelor}{\thu@bachelortrue}
-\DeclareOption{master}{\thu@mastertrue}
-\DeclareOption{doctor}{\thu@doctortrue}
-\DeclareOption{postdoctor}{\thu@postdoctortrue}
-\DeclareOption{secret}{\thu@secrettrue}
+
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+ family=thu,
+ prefix=thu@,
+ setkeys=\kvsetkeys}
+\newif\ifthu@bachelor
+\newif\ifthu@master
+\newif\ifthu@doctor
+\newif\ifthu@postdoctor
+\define@key{thu}{type}{%
+ \thu@bachelorfalse
+ \thu@masterfalse
+ \thu@doctorfalse
+ \thu@postdoctorfalse
+ \expandafter\csname thu@#1true\endcsname}
+
+\def\thu@deprecated@type@option{%
+ \setkeys{thu}{type=\CurrentOption} % for compatability.
+ \ClassError{thuthesis}{Option '\CurrentOption' is deprecated, \MessageBreak
+ please use 'type=\CurrentOption' instead}{}}
+\DeclareVoidOption{bachelor}{\thu@deprecated@type@option}
+\DeclareVoidOption{master}{\thu@deprecated@type@option}
+\DeclareVoidOption{doctor}{\thu@deprecated@type@option}
+\DeclareVoidOption{postdoctor}{\thu@deprecated@type@option}
+
+\DeclareBoolOption{secret}
% \end{macrocode}
%
% \changes{v2.5.1}{2006/05/24}{如果选项设置了 dvips,但是用 pdflatex 编译,报错。}
@@ -1073,54 +1079,59 @@
%
% 如果需要使用 arial 字体,请打开 [arial] 选项
% \begin{macrocode}
-\newif\ifthu@arial
-\DeclareOption{arial}{\thu@arialtrue}
+\DeclareBoolOption{arial}
% \end{macrocode}
%
% 目录中英文是否用 arial
% \begin{macrocode}
-\newif\ifthu@arialtoc
-\DeclareOption{arialtoc}{\thu@arialtoctrue}
+\DeclareBoolOption{arialtoc}
% \end{macrocode}
% 章节标题中的英文是否用 arial
% \begin{macrocode}
-\newif\ifthu@arialtitle
-\DeclareOption{arialtitle}{\thu@arialtitletrue}
+\DeclareBoolOption{arialtitle}
% \end{macrocode}
%
% noraggedbottom 选项
% \changes{v4.8}{2013/03/05}{增加 noraggedbottom 选项。}
+% \changes{v4.8.2}{2015/12/13}{norggedbottom 选项修改未 raggedbottom。}
% \begin{macrocode}
-\newif\ifthu@raggedbottom\thu@raggedbottomtrue
-\DeclareOption{noraggedbottom}{\thu@raggedbottomfalse}
+\DeclareBoolOption{raggedbottom}
% \end{macrocode}
%
% 将选项传递给 ctexbook 类
% \begin{macrocode}
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}}
+\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
% \end{macrocode}
%
-% \cs{ExecuteOptions} 的参数之间用逗号分割,不能有空格。开始不知道,折腾了老半
-% 天。
% \changes{v2.5.1}{2006/05/24}{ft,研究生院目录要 times,而教务处要 arial。}
% \changes{v2.5.1}{2006/05/26}{本科 openright,研究生 openany。}
% \changes{v3.1}{2007/10/09}{本科的目录又不要 arial 字体了。}
% \changes{v4.8}{2013/03/10}{使用 ctexbook 类,优于调用 ctex 宏包。}
% \changes{v4.8}{2013/05/29}{添加 nocap 选项,恢复默认标题样式,模板会进一步定制。}
-% \begin{macrocode}
-\ExecuteOptions{utf,arialtitle}
-\ProcessOptions\relax
-\LoadClass[cs4size,a4paper,openany,nocap,UTF8]{ctexbook}
+% \changes{v4.8.2}{2015/03/12}{使用 XeTeX 引擎时,fontspec 宏包会被 xeCJK 自动
+% 调用。传递给 fontspec 宏包 no-math 选项,避免部分数学符号字体自动调整为 CMR。
+% 其他引擎下没有这个问题,这一行会被无视。}
+% \begin{macrocode}
+\setkeys{thu}{%
+ type=bachelor,
+ raggedbottom,
+ arial,
+ arialtitle}
+
+\ProcessKeyvalOptions*
+\PassOptionsToPackage{no-math}{fontspec}
+\LoadClass[a4paper,openany,UTF8,zihao=-4,scheme=plain,fontset=none]{ctexbook}
% \end{macrocode}
%
-% 用户至少要提供一个选项:指定论文类型。
+% 用户至少要提供一个选项,指定论文类型。
% \begin{macrocode}
\ifthu@bachelor\relax\else
\ifthu@master\relax\else
\ifthu@doctor\relax\else
\ifthu@postdoctor\relax\else
\ClassError{thuthesis}%
- {You have to specify one of thesis options: bachelor, master or doctor.}{}
+ {Please specify thesis type in option: \MessageBreak
+ type=[bachelor | master | doctor | postdoctor]}{}
\fi
\fi
\fi
@@ -1133,7 +1144,7 @@
% 引用的宏包和相应的定义。
% \begin{macrocode}
\RequirePackage{ifxetex}
-\RequirePackage{ifthen,calc}
+\RequirePackage{xparse}
% \end{macrocode}
%
% \AmSTeX{} 宏包,用来排出更加漂亮的公式。
@@ -1160,47 +1171,54 @@
\RequirePackage[labelformat=simple]{subcaption}
% \end{macrocode}
%
+% pdfpages 宏包便于我们插入扫描后的授权页和声明页 PDF 文档。
+% \begin{macrocode}
+\RequirePackage{pdfpages}
+\includepdfset{fitpaper=true}
+% \end{macrocode}
+%
% \changes{v4.8}{2013/03/02}{no need to load indentfirst directly since we use ctex.}
%
% 更好的列表环境。
% \changes{v2.6.2}{2006/06/18}{去掉 \pkg{paralist} 的 newitem 和 newenum 选项,因为默
% 认是打开的。}
% \changes{v2.6.4}{2006/10/23}{增加 \texttt{neverdecrease} 选项。}
+% \changes{v4.8.2}{2012/12/13}{删除 \pkg{paralist} 选项。}
% \begin{macrocode}
-\RequirePackage[neverdecrease]{paralist}
+\RequirePackage[shortlabels]{enumitem}
% \end{macrocode}
%
-% raggedbottom,禁止Latex自动调整多余的页面底部空白,并保持脚注仍然在底部。
+% raggedbottom,禁止 \LaTeX 自动调整多余的页面底部空白,并保持脚注仍然在底部。
+% 脚注按页编号。
% \begin{macrocode}
\ifthu@raggedbottom
- \RequirePackage[bottom]{footmisc}
+ \RequirePackage[bottom,perpage]{footmisc}
\raggedbottom
+\else
+ \RequirePackage[perpage]{footmisc}
\fi
% \end{macrocode}
%
-% 中文支持,我们使用 ctex 宏包。
% \changes{v4.5}{2008/01/03}{加入 XeTeX 支持,需要 \pkg{xeCJK}。}
% \changes{v4.8}{2013/03/09}{reset baselinestretch after ctex's change.}
-% \changes{v4.8}{2013/05/28}{在 CJK 模式下用 \pkg{CJKspace} 保留中英文间空格。}
% \begin{macrocode}
\ifthu@bachelor
\RequirePackage{CJKfntef}
\fi
-\renewcommand{\baselinestretch}{1.0}
+\renewcommand{\baselinestretch}{1.0} % todo:?
\ifxetex
- \xeCJKsetup{AutoFakeBold=true,AutoFakeSlant=true}
- \punctstyle{quanjiao}
% todo: minor fix of CJKnumb
\def\CJK@null{\kern\CJKnullspace\Unicode{48}{7}\kern\CJKnullspace}
\defaultfontfeatures{Mapping=tex-text} % use TeX --
% \end{macrocode}
-% 默认采用中易的四款 (宋,黑,楷,仿宋) 免费字体。本科生还需要隶书,需要手工修
-% 改 \file{thufonts.def} 文件。缺少中文字体的 Linux 用户可以通
-% 过 \file{thufonts.def} 文件定义字体。
+% 默认采用中易的六款免费字体。缺少上述字体的用户可以通过
+% \file{ctex-fontset-thuthesis.def} 文件自定义字体。
+% \changes{v4.8}{2013/05/28}{在 CJK 模式下用 \pkg{CJKspace} 保留中英文间空格。}
+% \changes{v4.8.2}{2015/04/17}{固定字体设置,同时改善与 ctex 兼容性。}
% \begin{macrocode}
- \ifCTEX@nofonts
- \input{thufonts.def}
- \fi
+ \IfFileExists{ctex-fontset-thuthesis.def}%
+ {\ctexset{fontset=thuthesis}}%
+ {\ctexset{fontset=windows}}
\setmainfont{Times New Roman}
\setsansfont{Arial}
@@ -1260,7 +1278,6 @@
breaklinks=true,
colorlinks=false,
plainpages=false,
- pdfpagelabels,
pdfborder=0 0 0}
% \end{macrocode}
%
@@ -1271,23 +1288,76 @@
% 设置 url 样式,与上下文一致
% \begin{macrocode}
\urlstyle{same}
-%</cls>
% \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{v4.8.2}{2015/03/10}{不再将页面尺寸写入 dvi,因为已不支持 dvips,
+% 而该方案会使得在使用 tikzexternalize 时外部 PDF 图片 BBox 不对。}
+% \changes{v4.8.2}{2015/12/14}{用 \pkg{geometry} 简化设置。}
+% \begin{macrocode}
+\RequirePackage{geometry}
+\geometry{
+ a4paper, % 210 * 297mm
+ hcentering,
+ ignoreall,
+ nomarginpar}
+\ifthu@bachelor
+ \geometry{
+ left=32mm,
+ headsep=5mm,
+ textheight=220mm,
+ bottom=37mm,
+ footskip=17mm}
+\else
+ \geometry{
+ left=30mm,
+ headsep=5mm,
+ textheight=237mm,
+ bottom=29mm,
+ footskip=6mm}
+\fi
+% \end{macrocode}
+%
+% 利用 \pkg{fancyhdr} 设置页眉页脚。
+% \begin{macrocode}
+\RequirePackage{fancyhdr}
+%</cls>
+% \end{macrocode}
+%
% \subsection{主文档格式}
% \label{sec:mainbody}
%
% \subsubsection{Three matters}
+% 对于 \textsl{openright} 选项,必须保证章首页右开,且如果前章末页无内容须
+% 清空其页眉页脚。
+% \begin{macro}{\cleardoublepage}
+% \begin{macrocode}
+%<*cls>
+\let\thu@cleardoublepage\cleardoublepage
+\newcommand{\thu@clearemptydoublepage}{%
+ \clearpage{\pagestyle{empty}\thu@cleardoublepage}}
+\let\cleardoublepage\thu@clearemptydoublepage
+% \end{macrocode}
+% \end{macro}
+%
% 我们的单面和双面模式与常规的不太一样。
% \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}{本科取消了所有页眉,毫无疑问,在以后的修订中还会加
-% 上的,我们等着看。}
+% \changes{v4.4}{2008/05/30}{本科取消了所有页眉。}
+% \begin{macro}{\frontmatter}
+% \begin{macro}{\mainmatter}
+% \begin{macro}{\backmatter}
% \begin{macrocode}
-%<*cls>
\renewcommand\frontmatter{%
\if@openright\cleardoublepage\else\clearpage\fi
\@mainmatterfalse
@@ -1303,59 +1373,43 @@
\@mainmattertrue}
%</cls>
% \end{macrocode}
-%
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{字体}
% \label{sec:font}
%
% 重定义字号命令
%
-% Ref 1:
-% \begin{verbatim}
-% 参考科学出版社编写的《著译编辑手册》(1994年)
-% 七号 5.25pt 1.845mm
-% 六号 7.875pt 2.768mm
-% 小五 9pt 3.163mm
-% 五号 10.5pt 3.69mm
-% 小四 12pt 4.2175mm
-% 四号 13.75pt 4.83mm
-% 三号 15.75pt 5.53mm
-% 二号 21pt 7.38mm
-% 一号 27.5pt 9.48mm
-% 小初 36pt 12.65mm
-% 初号 42pt 14.76mm
-%
-% 这里的 pt 对应的是 1/72.27 inch,也就是 TeX 中的标准 pt
-% \end{verbatim}
-%
-% Ref 2:
-% WORD 中的字号对应该关系如下:
-% \begin{verbatim}
-% 初号 = 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
-%
-% 1bp = 72.27/72 pt
-% \end{verbatim}
+% WORD 中的字号对应该关系如下(1bp = 72.27/72 pt):
+% \begin{center}
+% \begin{tabular}{llll}
+% \hline
+% 初号 & 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 & \\\hline
+% \end{tabular}
+% \end{center}
%
-% \begin{macro}{\thu@define@fontsize}
+% \begin{macro}{\thu@def@fontsize}
% \changes{v2.6.2}{2006/06/18}{引入此命令重新定义字号。}
% 根据习惯定义字号。用法:
%
-% \cs{thu@define@fontsize}\marg{字号名称}\marg{磅数}
+% \cs{thu@def@fontsize}\marg{字号名称}\marg{磅数}
%
% 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。
% \begin{macrocode}
@@ -1364,138 +1418,126 @@
\newcommand{\thu@choosefont}[2]{%
\setlength{\thu@linespace}{#2*\real{#1}}%
\fontsize{#2}{\thu@linespace}\selectfont}
-\def\thu@define@fontsize#1#2{%
+\def\thu@def@fontsize#1#2{%
\expandafter\newcommand\csname #1\endcsname[1][\baselinestretch]{%
\thu@choosefont{##1}{#2}}}
% \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}
% \begin{macrocode}
-\thu@define@fontsize{chuhao}{42bp}
-\thu@define@fontsize{xiaochu}{36bp}
-\thu@define@fontsize{yihao}{26bp}
-\thu@define@fontsize{xiaoyi}{24bp}
-\thu@define@fontsize{erhao}{22bp}
-\thu@define@fontsize{xiaoer}{18bp}
-\thu@define@fontsize{sanhao}{16bp}
-\thu@define@fontsize{xiaosan}{15bp}
-\thu@define@fontsize{sihao}{14bp}
-\thu@define@fontsize{banxiaosi}{13bp}
-\thu@define@fontsize{xiaosi}{12bp}
-\thu@define@fontsize{dawu}{11bp}
-\thu@define@fontsize{wuhao}{10.5bp}
-\thu@define@fontsize{xiaowu}{9bp}
-\thu@define@fontsize{liuhao}{7.5bp}
-\thu@define@fontsize{xiaoliu}{6.5bp}
-\thu@define@fontsize{qihao}{5.5bp}
-\thu@define@fontsize{bahao}{5bp}
+\thu@def@fontsize{chuhao}{42bp}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaochu}
+% \begin{macrocode}
+\thu@def@fontsize{xiaochu}{36bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\yihao}
+% \begin{macrocode}
+\thu@def@fontsize{yihao}{26bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaoyi}
+% \begin{macrocode}
+\thu@def@fontsize{xiaoyi}{24bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\erhao}
+% \begin{macrocode}
+\thu@def@fontsize{erhao}{22bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaoer}
+% \begin{macrocode}
+\thu@def@fontsize{xiaoer}{18bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\sanhao}
+% \begin{macrocode}
+\thu@def@fontsize{sanhao}{16bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaosan}
+% \begin{macrocode}
+\thu@def@fontsize{xiaosan}{15bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\sihao}
+% \begin{macrocode}
+\thu@def@fontsize{sihao}{14bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\banxiaosi}
+% \begin{macrocode}
+\thu@def@fontsize{banxiaosi}{13bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaosi}
+% \begin{macrocode}
+\thu@def@fontsize{xiaosi}{12bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\dawu}
+% \begin{macrocode}
+\thu@def@fontsize{dawu}{11bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\wuhao}
+% \begin{macrocode}
+\thu@def@fontsize{wuhao}{10.5bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaowu}
+% \begin{macrocode}
+\thu@def@fontsize{xiaowu}{9bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\liuhao}
+% \begin{macrocode}
+\thu@def@fontsize{liuhao}{7.5bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\xiaoliu}
+% \begin{macrocode}
+\thu@def@fontsize{xiaoliu}{6.5bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\qihao}
+% \begin{macrocode}
+\thu@def@fontsize{qihao}{5.5bp}
+% \end{macrocode}
% \end{macro}
+% \begin{macro}{\bahao}
+% \begin{macrocode}
+\thu@def@fontsize{bahao}{5bp}
+% \end{macrocode}
% \end{macro}
%
-% 正文小四号 (12pt) 字,行距为固定值 20 磅。
+% \begin{macro}{\normalsize}
+% 正文小四号 (12bp) 字,行距为固定值 20 bp。
% \begin{macrocode}
\renewcommand\normalsize{%
\@setfontsize\normalsize{12bp}{20bp}
- \abovedisplayskip=10bp \@plus 2bp \@minus 2bp
- \abovedisplayshortskip=10bp \@plus 2bp \@minus 2bp
+ \abovedisplayskip=20bp \@plus 2bp \@minus 2bp
+ \abovedisplayshortskip=20bp \@plus 2bp \@minus 2bp
\belowdisplayskip=\abovedisplayskip
\belowdisplayshortskip=\abovedisplayshortskip}
%</cls>
% \end{macrocode}
+% \end{macro}
%
%
-% \subsubsection{页面设置}
-% \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}{修改本科生页脚间距与样例基本一致。}
-% \begin{macrocode}
-%<*cls>
-\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
-\AtBeginDvi{\special{!%
- \@percentchar\@percentchar BeginPaperSize: a4
- ^^Ja4^^J\@percentchar\@percentchar EndPaperSize}}
-\setlength{\textwidth}{\paperwidth}
-\setlength{\textheight}{\paperheight}
-\setlength\marginparwidth{0cm}
-\setlength\marginparsep{0cm}
-\ifthu@bachelor
- \addtolength{\textwidth}{-6.4cm}
- \setlength{\topmargin}{2.8cm-1in}
- \setlength{\oddsidemargin}{3.2cm-1in}
- \setlength{\footskip}{1.78cm}
- \setlength{\headsep}{0.6cm}
- \addtolength{\textheight}{-7.8cm}
-\else
- \addtolength{\textwidth}{-6cm}
- \setlength{\topmargin}{2.2cm-1in}
- \setlength{\oddsidemargin}{3cm-1in}
- \setlength{\footskip}{0.6cm}
- \setlength{\headsep}{0.2cm}
- \addtolength{\textheight}{-6cm}
-\fi
-\setlength{\evensidemargin}{\oddsidemargin}
-\setlength{\headheight}{20pt}
-\setlength{\topskip}{0pt}
-\setlength{\skip\footins}{15pt}
-%</cls>
-% \end{macrocode}
-%
% \subsubsection{页眉页脚}
% \label{sec:headerfooter}
-% 新的一章最好从奇数页开始 (openright),所以必须保证它前面那页如果没有内容也必须
-% 没有页眉页脚。(code stolen from \pkg{fancyhdr})
-% \begin{macrocode}
-%<*cls>
-\let\thu@cleardoublepage\cleardoublepage
-\newcommand{\thu@clearemptydoublepage}{%
- \clearpage{\pagestyle{empty}\thu@cleardoublepage}}
-\let\cleardoublepage\thu@clearemptydoublepage
-% \end{macrocode}
%
-% 定义页眉和页脚。chapter 自动调用 thispagestyle{thu@plain},所以要重新定义 thu@plain。
+% 定义页眉和页脚。chapter 自动调用 \cs{thispagestyle\{thu@plain\}},所以要重新定义 thu@plain。
% \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{v4.8.2}{2015/12/20}{利用 \pkg{fancyhdr} 设置页眉页脚。}
% \begin{macro}{\ps@thu@empty}
% \begin{macro}{\ps@thu@plain}
% \begin{macro}{\ps@thu@headings}
@@ -1506,89 +1548,52 @@
% \item \texttt{thu@headings}:页眉页脚同时显示
% \end{itemize}
% \begin{macrocode}
-\def\ps@thu@empty{%
- \let\@oddhead\@empty%
- \let\@evenhead\@empty%
- \let\@oddfoot\@empty%
- \let\@evenfoot\@empty}
-\def\ps@thu@plain{%
- \let\@oddhead\@empty%
- \let\@evenhead\@empty%
- \def\@oddfoot{\hfil\xiaowu\thepage\hfil}%
- \let\@evenfoot=\@oddfoot}
-\def\ps@thu@headings{%
- \def\@oddhead{\vbox to\headheight{%
- \hb@xt@\textwidth{\hfill\wuhao\songti\leftmark\ifthu@bachelor\relax\else\hfill\fi}%
- \vskip2pt\hbox{\vrule width\textwidth height0.4pt depth0pt}}}
- \def\@evenhead{\vbox to\headheight{%
- \hb@xt@\textwidth{\wuhao\songti%
- \ifthu@bachelor\thu@schoolname\thu@bachelor@subtitle%
- \else\hfill\leftmark\fi\hfill}%
- \vskip2pt\hbox{\vrule width\textwidth height0.4pt depth0pt}}}
- \def\@oddfoot{\hfil\wuhao\thepage\hfil}
- \let\@evenfoot=\@oddfoot}
+%<*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\songti\leftmark}
+ \fancyfoot{}
+ \fancyfoot[C]{\wuhao\thepage}
+ \renewcommand{\headrulewidth}{0.4pt}
+ \renewcommand{\footrulewidth}{0pt}}
+%</cls>
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
-% 其实可以直接写到 \cs{chapter} 的定义里面。
-% \begin{macrocode}
-\renewcommand{\chaptermark}[1]{\@mkboth{\@chapapp\ ~~#1}{}}
-%</cls>
-% \end{macrocode}
-%
%
% \subsubsection{段落}
% \label{sec:paragraph}
%
-% 段落之间的竖直距离
+% 全文首行缩进 2 字符,标点符号用全角
% \begin{macrocode}
%<*cls>
-\setlength{\parskip}{0pt \@plus2pt \@minus0pt}
+\ctexset{%
+ punct=quanjiao,
+ space=auto,
+ autoindent=true}
% \end{macrocode}
%
-% 调整默认列表环境间的距离,以符合中文习惯。
+% 利用 \pkg{enumitem} 命令调整默认列表环境间的距离,以符合中文习惯。
% \changes{v2.5.2}{2006/06/01}{更改默认列表距离。}
-% \begin{macro}{thu@item@space}
-% \begin{macrocode}
-\def\thu@item@space{%
- \let\itemize\compactitem
- \let\enditemize\endcompactitem
- \let\enumerate\compactenum
- \let\endenumerate\endcompactenum
- \let\description\compactdesc
- \let\enddescription\endcompactdesc}
+% \begin{macrocode}
+\setlist{nosep}
%</cls>
% \end{macrocode}
-% \end{macro}
%
%
% \subsubsection{脚注}
% \label{sec:footnote}
-% \begin{macro}{\MakePerPage}
-% 从 perpage.sty 中抽取的代码,使 footnote 按页编号。不再用臃肿的 footmisc。
-% \begin{macrocode}
-%<*cls>
-\newcommand*\MakePerPage[2][\@ne]{%
- \expandafter\def\csname c@pchk@#2\endcsname{\c@pchk@{#2}{#1}}%
- \newcounter{pcabs@#2}%
- \@addtoreset{pchk@#2}{#2}}
-\def\new@pagectr#1{\@newl@bel{pchk@#1}}
-\def\c@pchk@#1#2{\z@=\z@
- \begingroup
- \expandafter\let\expandafter\next\csname pchk@#1@\arabic{pcabs@#1}\endcsname
- \addtocounter{pcabs@#1}\@ne
- \expandafter\ifx\csname pchk@#1@\arabic{pcabs@#1}\endcsname\next
- \else \setcounter{#1}{#2}\fi
- \protected@edef\next{%
- \string\new@pagectr{#1}{\arabic{pcabs@#1}}{\noexpand\thepage}}%
- \protected@write\@auxout{}{\next}%
- \endgroup\global\z@}
-\MakePerPage{footnote}
-% \end{macrocode}
-% \end{macro}
-%
% 脚注字体:宋体小五,单倍行距。悬挂缩进 1.5 字符。标号在正文中是上标,在脚注中为
% 正体。默认情况下 \cs{@makefnmark} 显示为上标,同时为脚标和正文所用,所以如果要区
% 分,必须分别定义脚注的标号和正文的标号。
@@ -1599,6 +1604,7 @@
% \begin{macro}{\thu@textcircled}
% 生成带圈的脚注数字。最多处理到 99,当然这个很容易扩展了。
% \begin{macrocode}
+%<*cls>
\def\thu@textcircled#1{%
\ifnum \value{#1} <10 \textcircled{\xiaoliu\arabic{#1}}
\else\ifnum \value{#1} <100 \textcircled{\qihao\arabic{#1}}\fi
@@ -1705,9 +1711,10 @@
% 定理字样使用黑体,正文使用宋体,冒号隔开
% \changes{v2.6.2}{2006/06/17}{增加问题和猜想两个数学环境。}
% \changes{v4.2}{2008/03/07}{调整证明环境的编号和结尾的方块。}
+% \changes{v4.8.2}{2015/04/18}{修正定理字样为黑体 (\#104)。}
% \begin{macrocode}
-\theorembodyfont{\songti\rmfamily}
-\theoremheaderfont{\heiti\rmfamily}
+\theorembodyfont{\rmfamily\songti}
+\theoremheaderfont{\rmfamily\heiti}
%</cls>
%<*cfg>
% \theoremsymbol{\ensuremath{\blacksquare}}
@@ -1738,9 +1745,9 @@
% \changes{v2.6}{2006/06/09}{增加 \cs{floatsep},\cs{@fptop},\cs{@fpsep} 和 \cs{@fpbot}。}
% \begin{macrocode}
%<*cls>
-\setlength{\floatsep}{12bp \@plus4pt \@minus1pt}
-\setlength{\intextsep}{12bp \@plus4pt \@minus2pt}
-\setlength{\textfloatsep}{12bp \@plus4pt \@minus2pt}
+\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}
@@ -1769,7 +1776,12 @@
% \changes{v2.5.1}{2006/05/24}{重新定义表格默认字体。}
% \changes{v2.5.3}{2006/06/07}{不管 caption 出现在什么位置,\cs{aboveskip} 总是出现在标题和浮动体之间的距离。}
% \changes{v4.3}{2008/03/11}{子图引用时加括号。}
+% \changes{v4.8.2}{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]\songti #1~\rmfamily #2}}
@@ -1809,39 +1821,31 @@
% \changes{v2.5}{2006/05/19}{增加索引名称定义。}
% \begin{macrocode}
%<*cfg>
-\renewcommand\contentsname{目\hspace{1em}录}
-\renewcommand\listfigurename{插图索引}
-\renewcommand\listtablename{表格索引}
+\ctexset{%
+ chapter/name={第,章},
+ appendixname=附录,
+ contentsname={目\hspace{\ccwd}录},
+ listfigurename=插图索引,
+ listtablename=表格索引,
+ figurename=图,
+ tablename=表,
+ bibname=参考文献,
+ indexname=索引,
+}
\newcommand\listequationname{公式索引}
\newcommand\equationname{公式}
-\renewcommand\bibname{参考文献}
-\renewcommand\indexname{索引}
-\renewcommand\figurename{图}
-\renewcommand\tablename{表}
-\newcommand\CJKprepartname{第}
-\newcommand\CJKpartname{部分}
-\CTEXnumber{\thu@thepart}{\@arabic\c@part}
-\newcommand\CJKthepart{\thu@thepart}
-\newcommand\CJKprechaptername{第}
-\newcommand\CJKchaptername{章}
-\newcommand\CJKthechapter{\@arabic\c@chapter}
-\renewcommand\chaptername{\CJKprechaptername~\CJKthechapter~\CJKchaptername}
-\renewcommand\appendixname{附录}
\ifthu@bachelor
\newcommand{\cabstractname}{中文摘要}
\newcommand{\eabstractname}{ABSTRACT}
\else
- \newcommand{\cabstractname}{摘\hspace{1em}要}
+ \newcommand{\cabstractname}{摘\hspace{\ccwd}要}
\newcommand{\eabstractname}{Abstract}
\fi
\let\CJK@todaysave=\today
\def\CJK@todaysmall@short{\the\year 年 \the\month 月}
-\def\CJK@todaysmall{\CJK@todaysmall@short \the\day 日}
-\CTEXdigits{\thu@CJK@year}{\the\year}
-\CTEXnumber{\thu@CJK@month}{\the\month}
-\CTEXnumber{\thu@CJK@day}{\the\day}
-\def\CJK@todaybig@short{\thu@CJK@year{}年\thu@CJK@month{}月}
-\def\CJK@todaybig{\CJK@todaybig@short{}\thu@CJK@day{}日}
+\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]{%
@@ -1855,69 +1859,113 @@
%
% \subsubsection{章节标题}
% \label{sec:titleandtoc}
+%
% 如果章节题目中的英文要使用 arial,那么就加上 \cs{sffamily}
% \begin{macrocode}
%<*cls>
-\ifthu@arialtitle
- \def\thu@title@font{\sffamily}
-\fi
+\def\thu@title@font{%
+ \ifthu@arialtitle\sffamily\else\relax\fi}
+% \end{macrocode}
+%
+% \pkg{fancyhdr} 定义页眉页脚很方便,但是有一个非常隐蔽的坑。通过 \pkg{fancyhdr}
+% 定义的样式在第一次被调用时会修改 \cs{chaptermark},这会导致页眉信息错误(多余
+% 章号并且英文大写)。这是因为在原始的 \file{book.cls} 中定义如下(大意):
+% \begin{verbatim}
+% \newcommand\chaptername{Chapter}
+% \newcommand\@chapapp{\chaptername}
+% \def\chaptermark#1{
+% \markboth{\MakeUppercase{\@chapapp\ \thechapter}}{}}
+% \end{verbatim}
+% 很显然这个 \cs{\@chapapp} 不适合中文,因此我们使用\cs{CTEXthechapter}(
+% 如,“第 x 章”),同时会将 \cs{MakeUppercase} 去掉。也就是说我们会做如下动作:
+% \begin{verbatim}
+% \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}
+% \end{verbatim}
+% 但,\pkg{fancyhdr} 不知何故在 \cs{ps@fancy} 中对 \cs{chaptermark} 进行重定义
+% (其实一模一样),而这个 \cs{ps@fancy} 会在 \cs{fancypagestyle} 中使用,如下:
+% \begin{verbatim}
+% \newcommand{\fancypagestyle}[2]{%
+% \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}}
+% \end{verbatim}
+% 这样的话,\cs{ps@fancy} 会在 \pkg{fancyhdr} 定义的任何样式首次样被激活时调用,从
+% 而覆盖我们的 \cs{chaptermark} 定义(后续样式再激活不会重复覆盖)。所以我们采用如下
+% 方法解决:
+% \begin{macrocode}
+\AtBeginDocument{%
+ \pagestyle{thu@empty}
+ \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}}}
% \end{macrocode}
%
-% \begin{macro}{\chapter}
-% 章序号与章名之间空一个汉字符 黑体三号字,居中书写,单倍行距,段前空 24 磅,段
-% 后空 18 磅。
+% 各级标题格式设置。
+% \changes{v4.8.2}{2012/12/23}{用 \cs{ctexset} 来设置,替换复杂的 \cs{@startsection}。}
+% \begin{description}
+% \item[chapter] 章序号与章名之间空一个汉字符 黑体三号字,居中书写,单倍行距,段
+% 前空 24 磅,段后空 18 磅。本科要求:段前段后间距 30/20 pt,行距 20pt。但正文
+% 章节 30pt 的话和样例效果不一致。
%
-% 本科要求:段前段后间距 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}{英文摘要标题要搞特殊化,ft!}
+% \changes{v4.8.2}{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 (本科
+% 生是 14pt) 字居左书写,行距为固定值 20 磅,段前空 12 磅,段后空 6 磅。
+%
+% \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}
-\renewcommand\chapter{%
- \if@openright\cleardoublepage\else\clearpage\fi\phantomsection%
- \ifthu@bachelor\thispagestyle{thu@plain}%
- \else\thispagestyle{thu@headings}\fi%
- \global\@topnum\z@%
- \@afterindenttrue%
- \secdef\@chapter\@schapter}
-\def\@chapter[#1]#2{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \refstepcounter{chapter}%
- \addcontentsline{toc}{chapter}{\protect\numberline{\@chapapp}#1}%TODO: shit
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \else
- \addcontentsline{toc}{chapter}{#1}%
- \fi
- \chaptermark{#1}%
- \@makechapterhead{#2}}
-\def\@makechapterhead#1{%
- \ifthu@bachelor\vspace*{24bp}\else\vspace*{20bp}\fi%
- {\parindent \z@ \centering
- \csname thu@title@font\endcsname\heiti\ifthu@bachelor\xiaosan\else\sanhao[1]\fi
- \ifnum \c@secnumdepth >\m@ne
- \@chapapp\hskip1em
- \fi
- #1\par\nobreak
- \ifthu@bachelor\vskip 20bp\else\vskip 24bp\fi}}
-\def\@schapter#1{%
- \@makeschapterhead{#1}
- \@afterheading}
-\def\@makeschapterhead#1{%
- \ifthu@bachelor\vspace*{30bp}\else\vspace*{20bp}\fi%
- {\parindent \z@ \centering
- \csname thu@title@font\endcsname\heiti\sanhao[1]
- \ifthu@bachelor\xiaosan\else
- \def\@tempa{#1}
- \def\@tempb{\eabstractname}
- \ifx\@tempa\@tempb\bfseries\fi
- \fi
- \interlinepenalty\@M
- #1\par\nobreak
- \ifthu@bachelor\vskip 20bp\else\vskip 24bp\fi}}
+\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 13bp\else 9bp\fi},
+ aftername=\hskip\ccwd,
+ afterskip={\ifthu@bachelor 20bp\else 24bp\fi},
+ format={\centering\thu@title@font\heiti\ifthu@bachelor\xiaosan\else\sanhao[1]\fi},
+ nameformat=\relax,
+ numberformat=\relax,
+ titleformat=\thu@chapter@titleformat,
+ },
+ 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\heiti\sihao[1.429]},
+ },
+ subsection={
+ afterindent=true,
+ beforeskip={\ifthu@bachelor 12bp\else 16bp\fi\@plus 1ex \@minus .2ex},
+ afterskip={6bp \@plus .2ex},
+ format={\thu@title@font\heiti\ifthu@bachelor\xiaosi[1.667]\else\banxiaosi[1.538]\fi},
+ },
+ subsubsection={
+ afterindent=true,
+ beforeskip={\ifthu@bachelor 12bp\else 16bp\fi\@plus 1ex \@minus .2ex},
+ afterskip={6bp \@plus .2ex},
+ format={\csname thu@title@font\endcsname\heiti\xiaosi[1.667]},
+ },
+ paragraph/afterindent=true,
+ subparagraph/afterindent=true}
% \end{macrocode}
-% \end{macro}
%
% \begin{macro}{\thu@chapter*}
% \changes{v2.5.2}{2006/05/29}{定义自己的 \cs{thu@chapter*}。}
@@ -1933,75 +1981,42 @@
% 正体会到 \TeX{} macro 的力量!
% \begin{macrocode}
\newcounter{thu@bookmark}
-\def\thu@chapter*{%
- \@ifnextchar [ % ]
- {\thu@@chapter}
- {\thu@@chapter@}}
-\def\thu@@chapter@#1{\thu@@chapter[#1]{#1}}
-\def\thu@@chapter[#1]#2{%
- \@ifnextchar [ % ]
- {\thu@@@chapter[#1]{#2}}
- {\thu@@@chapter[#1]{#2}[]}}
-\def\thu@@@chapter[#1]#2[#3]{%
- \if@openright\cleardoublepage\else\clearpage\fi
- \phantomsection
- \def\@tmpa{#1}
- \def\@tmpb{#3}
- \ifx\@tmpa\@empty
- \addtocounter{thu@bookmark}\@ne
- \pdfbookmark[0]{#2}{thuchapter.\thethu@bookmark}
- \else
- \addcontentsline{toc}{chapter}{#1}
- \fi
- \chapter*{#2}
- \ifx\@tmpb\@empty
- \@mkboth{#2}{#2}
- \else
+\NewDocumentCommand\thu@chapter{s o m o}{
+ \IfBooleanF{#1}
+ {%
+ \ClassError{thuthesis}{You have to use the star form: \string\thu@chapter*}{}
+ }
+
+ \IfValueTF{#2}
+ {%
+ \ifthenelse{\equal{#2}{}}
+ {%
+ \addtocounter{thu@bookmark}\@ne
+ \pdfbookmark[0]{#3}{thuchapter.\thethu@bookmark}
+ }
+ {%
+ \addcontentsline{toc}{chapter}{#3}
+ }
+ }
+ {%
+ \addcontentsline{toc}{chapter}{#3}
+ }
+
+ \chapter*{#3}%\phantomsection
+
+ \IfValueTF{#4}
+ {%
+ \ifthenelse{\equal{#4}{}}
+ {\@mkboth{}{}}
+ {\@mkboth{#4}{#4}}
+ }
+ {%
\@mkboth{#3}{#3}
- \fi}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\section}
-% 一级节标题,例如:2.1 实验装置与实验方法
-% 节标题序号与标题名之间空一个汉字符(下同)。
-% 采用黑体四号(14pt)字居左书写,行距为固定值 20 磅,段前空 24 磅,段后空 6 磅。
-%
-% 本科:25/12 pt,行距 18pt
-% \changes{v4.4}{2008/06/04}{调整段前距为 -20bp 而不是原来的 -24bp。本科的混帐例
-% 子!}
-% \begin{macrocode}
-\renewcommand\section{\@startsection {section}{1}{\z@}%
- {\ifthu@bachelor -25bp\else -24bp\fi\@plus -1ex \@minus -.2ex}%
- {\ifthu@bachelor 12bp\else 6bp\fi \@plus .2ex}%
- {\csname thu@title@font\endcsname\heiti\sihao[1.429]}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\subsection}
-% 二级节标题,例如:2.1.1 实验装置
-% 采用黑体 13pt (本科生是 14pt) 字居左书写,行距为固定值 20 磅,段前空 12 磅,段后空 6 磅。
-% \changes{v4.4}{2008/06/04}{修改本科生模板的二级节标题为小四而不是半小四。}
-% \changes{v4.4}{2008/06/04}{调整段前距为 -12bp 而不是原来的 -16bp。}
-% \begin{macrocode}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
- {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}%
- {6bp \@plus .2ex}%
- {\csname thu@title@font\endcsname\heiti\ifthu@bachelor\xiaosi[1.667]\else\banxiaosi[1.538]\fi}}
+ }
+}
% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\subsubsection}
-% 三级节标题,例如:2.1.2.1 归纳法
-% 采用黑体小四号(12pt)字居左书写,行距为固定值 20 磅,段前空 12 磅,段后空 6 磅。
-% \changes{v4.4}{2008/06/04}{调整段前距为 -12bp 而不是原来的 -16bp。}
-% \begin{macrocode}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
- {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}%
- {6bp \@plus .2ex}%
- {\csname thu@title@font\endcsname\heiti\xiaosi[1.667]}}
%</cls>
-% \end{macrocode}
-% \end{macro}
%
%
% \subsubsection{目录格式}
@@ -2009,14 +2024,11 @@
% 最多涉及 4 层,即: x.x.x.x。\par
% chapter(0), section(1), subsection(2), subsubsection(3)
% \changes{v3.1}{2007/10/09}{博士论文目录只出现到第 3 级标题即可。}
+% \changes{v4.8.2}{2015/05/21}{硕士博士论文目录只出现到第 3 级标题即可。其他未明确要求。}
% \begin{macrocode}
%<*cls>
\setcounter{secnumdepth}{3}
-\ifthu@doctor
- \setcounter{tocdepth}{2}
-\else
- \setcounter{tocdepth}{3}
-\fi
+\setcounter{tocdepth}{2}
% \end{macrocode}
%
% 每章标题行前空 6 磅,后空 0 磅。如果使用目录项中英文要使用 Arial,那么就加上 \cs{sffamily}。
@@ -2074,8 +2086,15 @@
\penalty\@highpenalty
\endgroup
\fi}
-\renewcommand*\l@section{\@dottedtocline{1}{\ifthu@bachelor 1.0em\else 1.2em\fi}{2.1em}}
-\renewcommand*\l@subsection{\@dottedtocline{2}{\ifthu@bachelor 1.6em\else 2em\fi}{3em}}
+% \end{macrocode}
+%
+% 研究生学位论文写作指南中规定:目录中的章标题行居左书写,一级节标题行缩进 1 个
+% 汉字符,二级节标题行缩进 2 个汉字符(但示例文件中为 1.5 个汉字符)。本科生指
+% 南中未作明确规定,示例文件中对于一级和二级节标题分别缩进 1 和 1.5 个汉字符。
+% \changes{v4.8.2}{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}}
%</cls>
% \end{macrocode}
@@ -2084,13 +2103,13 @@
%
% \subsubsection{封面和封底}
% \label{sec:cover}
-% \begin{macro}{\thu@define@term}
+% \begin{macro}{\thu@def@term}
% 方便的定义封面的一些替换命令。
-% \changes{v2.6.2}{2006/06/18}{引入 \cs{thu@define@term} 定义封面命令。}
+% \changes{v2.6.2}{2006/06/18}{引入 \cs{thu@def@term} 定义封面命令。}
% \changes{v3.1}{2006/06/16}{重新定义摘要为环境,long 选项不需要了。}
% \begin{macrocode}
%<*cls>
-\def\thu@define@term#1{
+\def\thu@def@term#1{
\expandafter\gdef\csname #1\endcsname##1{%
\expandafter\gdef\csname thu@#1\endcsname{##1}}
\csname #1\endcsname{}}
@@ -2134,38 +2153,38 @@
% 的 affil 和 subject。}
% \changes{v2.6.2}{2006/06/18}{改正 groupmembers 的拼写错误。}
% \begin{macrocode}
-\thu@define@term{catalognumber}
-\thu@define@term{udc}
-\thu@define@term{id}
-\thu@define@term{secretlevel}
-\thu@define@term{secretyear}
-\thu@define@term{ctitle}
-\thu@define@term{cdegree}
+\thu@def@term{catalognumber}
+\thu@def@term{udc}
+\thu@def@term{id}
+\thu@def@term{secretlevel}
+\thu@def@term{secretyear}
+\thu@def@term{ctitle}
+\thu@def@term{cdegree}
\newcommand\cdepartment[2][]{\def\thu@cdepartment@short{#1}\def\thu@cdepartment{#2}}
\def\caffil{\cdepartment} % todo: for compatibility
\def\thu@cdepartment@short{}
\def\thu@cdepartment{}
-\thu@define@term{cmajor}
+\thu@def@term{cmajor}
\def\csubject{\cmajor} % todo: for compatibility
-\thu@define@term{cfirstdiscipline}
-\thu@define@term{cseconddiscipline}
-\thu@define@term{cauthor}
-\thu@define@term{csupervisor}
-\thu@define@term{cassosupervisor}
-\thu@define@term{ccosupervisor}
-\thu@define@term{cdate}
-\thu@define@term{postdoctordate}
-\thu@define@term{etitle}
-\thu@define@term{edegree}
-\thu@define@term{edepartment}
+\thu@def@term{cfirstdiscipline}
+\thu@def@term{cseconddiscipline}
+\thu@def@term{cauthor}
+\thu@def@term{csupervisor}
+\thu@def@term{cassosupervisor}
+\thu@def@term{ccosupervisor}
+\thu@def@term{cdate}
+\thu@def@term{postdoctordate}
+\thu@def@term{etitle}
+\thu@def@term{edegree}
+\thu@def@term{edepartment}
\def\eaffil{\edepartment} % todo: for compability
-\thu@define@term{emajor}
+\thu@def@term{emajor}
\def\esubject{\emajor} % todo: for compability
-\thu@define@term{eauthor}
-\thu@define@term{esupervisor}
-\thu@define@term{eassosupervisor}
-\thu@define@term{ecosupervisor}
-\thu@define@term{edate}
+\thu@def@term{eauthor}
+\thu@def@term{esupervisor}
+\thu@def@term{eassosupervisor}
+\thu@def@term{ecosupervisor}
+\thu@def@term{edate}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2206,7 +2225,7 @@
% \pkg{amsmath} 中的 \cs{collect@body},但是此宏没有定义为 long,不能直接用。
% 2)利用 \LaTeX{} 中环境和对应命令间的命名关系以及参数分隔符的特点非常巧妙地实
% 现了这个功能,其不足是不能嵌套环境。由于摘要部分经常会用到诸如 itemize 类似
-% 的环境,所以我们不得不选择第一种负责的方法。以下是修改 \pkg{amsmath} 代码部分:
+% 的环境,所以我们不得不选择第一种复杂的方法。以下是修改 \pkg{amsmath} 代码部分:
% \changes{v3.1}{2006/06/17}{重新定义摘要成为环境,Great!}
% \begin{macrocode}
\long\@xp\def\@xp\collect@@body\@xp#\@xp1\@xp\end\@xp#\@xp2\@xp{%
@@ -2378,7 +2397,7 @@
\newcommand{\thu@first@titlepage@postdoctor}{
\begin{center}
\setlength{\thu@title@width}{3em}
- \vspace*{1cm}
+ \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
@@ -2416,7 +2435,7 @@
\newcommand*{\getcmlength}[1]{\strip@pt\dimexpr0.035146\dimexpr#1\relax\relax}
\newcommand{\thu@first@titlepage@other}{
\begin{center}
- \vspace*{-1.3cm}
+ \vspace*{-1.6cm}
\parbox[b][2.4cm][t]{\textwidth}{%
\ifthu@secret\hfill{\sihao\thu@secretlevel\thu@secret@content}\else\rule{1cm}{0cm}\fi}
\ifthu@bachelor
@@ -2430,8 +2449,12 @@
\ignorespaces\yihao[1.55]%
\renewcommand{\CJKunderlinebasesep}{0.25cm}%
\renewcommand{\ULthickness}{1.3pt}%
- \def\CJKunderlinecolor{}%
- \CJKunderline*{\thu@ctitle}}
+ \ifxetex
+ \xeCJKsetup{underline/format=\color{black}}%
+ \else
+ \def\CJKunderlinecolor{\color{black}}%
+ \fi
+ \CJKunderline*{\thu@ctitle}}%
\vskip1.3cm
\else
\vskip0.8cm
@@ -2480,7 +2503,7 @@
\setlength{\extrarowheight}{4pt}
\ifxetex % todo: ugly codes
\begin{tabular}{p{\thu@title@width}@{}c@{\extracolsep{8pt}}l}
- \else
+ \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}\\
@@ -2528,7 +2551,7 @@
\ifx\thu@edegree\thu@doctor@phi\relax\else
\thu@professionaltrue\fi\fi
\begin{center}
- \vspace*{0.2cm}
+ \vspace*{-5pt}
\parbox[t][5.2cm][t]{\paperwidth-7.2cm}{
\renewcommand{\baselinestretch}{1.5}
\begin{center}
@@ -2585,7 +2608,7 @@
% 封面中论文授权部分。
% \begin{macrocode}
\newcommand{\thu@authorization@mk}{%
- \ifthu@bachelor\vspace*{0.5cm}\else\vspace*{0.72cm}\fi % shit code!
+ \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
@@ -2610,7 +2633,7 @@
% \begin{macro}{\makecover}
% \changes{v2.1}{2006/02/29}{分成几个小模块来搞,不然这个 macro 太大了,看不过来。}
% \begin{macrocode}
-\newcommand{\makecover}{
+\NewDocumentCommand{\makecover}{o}{
\phantomsection
\pdfbookmark[-1]{\thu@ctitle}{ctitle}
\normalsize%
@@ -2638,18 +2661,24 @@
% \changes{v3.0}{2007/05/12}{本科论文授权图片扫描取消。}
% \changes{v4.5.2}{2010/05/29}{本科封面和授权说明之间不要空白页。}
% \changes{v4.6}{2011/05/29}{博士后报告无授权说明。}
+% \changes{v4.8.2}{2015/06/05}{使用 pdfpages 宏包支持本硕博论文授权说明扫描版(\#36)。}
% \begin{macrocode}
\ifthu@postdoctor\relax\else%
\ifthu@bachelor\clearpage\else\cleardoublepage\fi%
- \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%
+ \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}
@@ -2800,19 +2829,26 @@
% \changes{v4.5.2}{2010/09/19}{研究生论文的致谢和声明终于分开了。}
% \begin{macrocode}
%<*cls>
-\newenvironment{ack}{%
+\NewDocumentEnvironment{ack}{o}{%
\thu@chapter*{\thu@ackname}
}
% \end{macrocode}
% 声明部分
% \changes{v3.0}{2007/05/12}{本科论文声明部分图片扫描取消。}
+% \changes{v4.8.2}{2015/06/05}{使用 pdfpages 宏包支持本硕博论文声明扫描版(\#36)。}
% \begin{macrocode}
{
\ifthu@postdoctor\relax\else%
- \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}%
+ \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
}
%</cls>
@@ -2843,7 +2879,7 @@
{\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{\@dottedtocline{1}{0em}{4em}}
+\renewcommand*\l@figure{\addvspace{6bp}\@dottedtocline{1}{0em}{4em}}
\renewcommand\listoftables{\thu@listof{table}}
\let\l@table\l@figure
% \end{macrocode}
@@ -2893,16 +2929,18 @@
% \subsubsection{参考文献}
% \label{sec:ref}
%
-% \begin{macro}{\onlinecite}
-% 正文引用模式。依赖于 \pkg{natbib} 宏包,修改其中的命令。
+% \begin{macro}{\inlinecite}
+% 正文引用模式。依赖于 \pkg{natbib} 宏包,修改其中的命令。旧命令 \cs{onlinecite}
+% 依然可用。
% \begin{macrocode}
%<*cls>
\bibpunct{[}{]}{,}{s}{}{,}
\renewcommand\NAT@citesuper[3]{\ifNAT@swa%
\unskip\kern\p@\textsuperscript{\NAT@@open #1\NAT@@close}%
\if*#3*\else\ (#3)\fi\else #1\fi\endgroup}
-\DeclareRobustCommand\onlinecite{\@onlinecite}
-\def\@onlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup}
+\DeclareRobustCommand\inlinecite{\@inlinecite}
+\def\@inlinecite#1{\begingroup\let\@cite\NAT@citenum\citep{#1}\endgroup}
+\let\onlinecite\inlinecite
% \end{macrocode}
% \end{macro}
%
@@ -2921,8 +2959,8 @@
\def\thudot{\ifthu@bachelor\else\unskip.\fi}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{thumasterbib}
-% \begin{macro}{thuphdbib}
+% \begin{macro}{\thumasterbib}
+% \begin{macro}{\thuphdbib}
% 本科生和研究生模板要求外文硕士论文参考文献显示``[Master Thesis]'',而博士模板
% 则于 2007 年冬要求显示为``[M]''。对应的外文博士论文参考文献分别显示为``[Phd
% Thesis]''和``[D]''。
@@ -2980,8 +3018,6 @@
\let\thu@appendix\appendix
\renewenvironment{appendix}{%
\thu@appendix
- \gdef\@chapapp{\appendixname~\thechapter}
- %\renewcommand\theequation{\ifnum \c@chapter>\z@ \thechapter-\fi\@arabic\c@equation}
}{}
%</cls>
% \end{macrocode}
@@ -3006,21 +3042,42 @@
% \end{macrocode}
% \end{environment}
%
-% \begin{macro}{\resumeitem}
-% 个人简历里面会出现的以发表文章,在投文章等。
+% 利用 \pkg{enumitem} 宏包引入两个新列表环境 publications 和 achievements,
+% 分别用于个人简历里面会出现的学术论文列表和研究成果列表。
+% publications 环境可以连续出现多次,模板会自动在之间加入空行。
% \changes{v2.5.1}{2006/05/23}{ft,教务处和研究生院非要搞的不一样!}
+% \changes{v4.8.2}{2015/04/18}{博士后就不提在学期间了,不合适(\#100)}
+% \changes{v4.8.2}{2015/05/17}{让简历部分更符合格式指南和示例文件(\#122)}
+% \begin{macro}{\resumeitem}
+% \begin{macro}{\researchitem}
+% \begin{environment}{publications}
+% \begin{environment}{achievements}
% \begin{macrocode}
%<*cfg>
\ifthu@bachelor
\newcommand{\thu@resume@title}{在学期间参加课题的研究成果}
\else
- \newcommand{\thu@resume@title}{个人简历、在学期间发表的学术论文与研究成果}
+ \ifthu@postdoctor
+ \newcommand{\thu@resume@title}{个人简历、发表的学术论文与科研成果}
+ \else
+ \newcommand{\thu@resume@title}{个人简历、在学期间发表的学术论文与研究成果}
+ \fi
\fi
%</cfg>
%<*cls>
-\newcommand{\resumeitem}[1]{\vspace{24pt}{\sihao\heiti\centerline{#1}}\par\vspace{6pt}}
+\newcommand{\resumeitem}[1]{\vspace{24bp}{\sihao\heiti\centerline{#1}}\par\vspace{6bp}}
+\newcommand{\researchitem}[1]{\vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}}
+\newlist{publications}{enumerate}{1}
+\setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=8bp,
+leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26],after*=\vspace{29bp},resume}
+\newlist{achievements}{enumerate}{1}
+\setlist[achievements]{label=[\arabic*],align=left,nosep,itemsep=8bp,
+leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26]}
%</cls>
% \end{macrocode}
+% \end{environment}
+% \end{environment}
+% \end{macro}
% \end{macro}
%
% \subsubsection{书脊}
@@ -3028,11 +3085,12 @@
% \begin{macro}{\shuji}
% 单独使用书脊命令会在新的一页产生竖排书脊。
% \changes{v4.5}{2009/01/04}{简化代码,同时支持 xelatex。}
+% \changes{v4.8.2}{2015/12/21}{扩展 \cs{shuji}\oarg{标题}\oarg{作者}。}
% \begin{macrocode}
%<*cls>
-\newcommand{\shuji}[1][\thu@ctitle]{
- \newpage\thispagestyle{empty}\fangsong\xiaosan\ziju{0.4}
- \hfill\rotatebox{-90}{\hb@xt@ \textheight{#1\hfill\thu@cauthor}}}
+\NewDocumentCommand{\shuji}{O{\thu@ctitle} O{\thu@cauthor}}{%
+ \newpage\thispagestyle{empty}\fangsong\xiaosan\ziju{0.4}%
+ \noindent\hfill\rotatebox[origin=lt]{-90}{\makebox[\textheight]{#1\hfill#2}}}
%</cls>
% \end{macrocode}
% \end{macro}
@@ -3108,7 +3166,7 @@
%
% 应用对列表环境的修改。
% \begin{macrocode}
-\AtEndOfClass{\sloppy\thu@item@space}
+\AtEndOfClass{\sloppy}
%</cls>
% \end{macrocode}
%
@@ -3119,125 +3177,63 @@
%<*dtx-style>
\ProvidesPackage{dtx-style}
+\RequirePackage[UTF8,scheme=chinese]{ctex}
+\RequirePackage[top=2.5cm, bottom=2.5cm]{geometry}
+
\RequirePackage{calc}
\RequirePackage{array,longtable}
\RequirePackage{fancybox,fancyvrb}
+\RequirePackage{fancyhdr}
\RequirePackage{xcolor}
+\RequirePackage{url}
\RequirePackage{ifxetex}
-\ifxetex
- \RequirePackage[nofonts,UTF8,hyperref]{ctex}
- \input{thufonts.def}
-\else
- \RequirePackage[winfonts,UTF8,hyperref]{ctex}
- \RequirePackage{txfonts}
-\fi
\RequirePackage{hyperref}
-\ifxetex
- \hypersetup{%
- CJKbookmarks=true}
-\else
- \hypersetup{%
- unicode=true,
- CJKbookmarks=false}
-\fi
\hypersetup{%
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksopenlevel=1,
breaklinks=true,
+ colorlinks=true,
linkcolor=blue,
plainpages=false,
- pdfpagelabels,
pdfborder=0 0 0}
-\RequirePackage{url}
-\RequirePackage{indentfirst}
-
-\setlength{\parskip}{4pt plus1pt minus0pt}
-\setlength{\topsep}{0pt}
-\setlength{\partopsep}{0pt}
-\setlength{\parindent}{20pt}
-\addtolength{\oddsidemargin}{-1cm}
-\advance\textwidth 1.5cm
-\addtolength{\topmargin}{-1cm}
-\addtolength{\headsep}{0.3cm}
-\addtolength{\textheight}{2.3cm}
+\ifxetex
+ \hypersetup{%
+ CJKbookmarks=true}
+\else
+ \hypersetup{%
+ unicode=true,
+ CJKbookmarks=false}
+\fi
-\renewcommand{\baselinestretch}{1.3}
-\setlength{\shadowsize}{3pt}
-\def\DescribeOption#1{\SpecialOptionIndex{#1}}
-\def\SpecialOptionIndex#1{\index{#1\actualchar\textbf{#1}}}
-\renewenvironment{description}
+\def\SpecialOptionIndex#1{\@bsphack%
+ \index{#1\actualchar{\protect\bfseries #1}}\@esphack}
+\newenvironment{options}
{\list{}{\setlength\labelwidth{2cm}%
\setlength\labelsep{3pt}%
\setlength\leftmargin{\labelwidth+\labelsep}%
\addtolength{\itemsep}{3pt}%
\renewcommand\makelabel[1]{%
- \shadowbox{\color{blue!90}\sffamily ##1}\DescribeOption{##1}}}
+ \ovalbox{\color{magenta}\bfseries\sffamily ##1}%
+ \SpecialOptionIndex{##1}}}
}{\endlist}
\DefineVerbatimEnvironment{example}{Verbatim}%
- {frame=single,framerule=0.3mm,rulecolor=\color{red!75!green!50!blue},%
- fillcolor=\color{red!75!green!50!blue!15},framesep=2mm,baselinestretch=1.2,%
+ {frame=single,framerule=0.3mm,rulecolor=\color{violet},%
+ fillcolor=\color{violet!5},framesep=1mm,baselinestretch=1.2,%
fontsize=\small,gobble=1}
\DefineVerbatimEnvironment{shell}{Verbatim}%
- {frame=single,framerule=0.3mm,rulecolor=\color{red!85!green!60},%
- fillcolor=\color{red!85!green!10},framesep=2mm,fontsize=\small,gobble=1}
-\long\def\myentry#1{\vskip5pt\par\noindent\llap{{\color{blue}\fangsong #1}}\marginpar{\strut}\hskip\parindent}
-\def\tableofcontents{\renewcommand{\baselinestretch}{1.0}\@starttoc{toc}}
-\def\DescribeMacro{\Describe@Macro}
-\def\Describe@Macro#1{\PrintDescribeMacro{#1}\SpecialUsageIndex{#1}}
-\def\PrintDescribeMacro#1{{\color{-red!75!green!50!blue!55}\MacroFont \string #1\hskip1em}}
-\def\ps@headings{%
- \let\@oddfoot\@empty
- \def\@oddhead{\vbox{%
- \hb@xt@ \textwidth{\llap{\fbox{\rightmark\rule[-2pt]{0pt}{13pt}}}\hfil\thepage}%
- \vskip-0.7pt%
- \hb@xt@ \textwidth{\hrulefill}}}
- \let\@evenfoot\@oddfoot
- \let\@evenhead\@oddhead
- \let\@mkboth\markboth
- \def\sectionmark##1{%
- \markright{\ifnum \c@secnumdepth >\m@ne
- \thesection\quad
- \fi
- ##1}}
- \def\subsectionmark##1{%
- \markright{\ifnum \c@secnumdepth >\m@ne
- \thesubsection\quad
- \fi
- ##1}}
- \def\subsubsectionmark##1{%
- \markright{\ifnum \c@secnumdepth >\m@ne
- \thesubsubsection\quad
- \fi
- ##1}}}
-\renewcommand\section{\@startsection{section}{1}{\z@}%
- {-3.5ex \@plus -1ex \@minus -.2ex}%
- {2.3ex \@plus.2ex}%
- {\normalfont\Large\bfseries}}
-
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\large\bfseries}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\normalsize\bfseries}}
-\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
- {3.25ex \@plus1ex \@minus.2ex}%
- {-1em}%
- {\normalfont\normalsize\bfseries}}
-\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
- {3.25ex \@plus1ex \@minus .2ex}%
- {-1em}%
- {\normalfont\normalsize\bfseries}}
-\pagestyle{empty}
+ {frame=single,framerule=0.3mm,rulecolor=\color{olive},%
+ fillcolor=\color{olive!5},framesep=1mm,fontsize=\small,gobble=1}
+\newcommand{\myentry}[1]{%
+ \vskip5pt\par\noindent\llap{{\color{purple}\bfseries #1}}\marginpar{\strut}\hskip\parindent}
\MakeShortVerb{\|}
\def\pkg#1{\texttt{#1}}
\def\option#1{\textsf{#1}}
\def\file#1{\textsl{#1}}
\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}}
+\newcommand{\note}[1]{\par%
+ {\color{magenta}\bfseries 说明:#1}}
%</dtx-style>
% \end{macrocode}
% \fi
diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins b/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins
index 88d5b105d37..12ea8f1fd6d 100644
--- a/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins
+++ b/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2005-2014 by Ruini Xue <xueruini@gmail.com>
+%% Copyright (C) 2005-2015 by Ruini Xue <xueruini@gmail.com>
%%
%% This file is part of the ThuThesis package project.
%% ---------------------------------------------------
@@ -8,13 +8,12 @@
%% conditions of the LaTeX Project Public License, either version 1.3a
%% 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.3a or later is part of all distributions of LaTeX
+%%
+%% and version 1.3a or later is part of all distributions of LaTeX
%% version 2004/10/01 or later.
%%
-%% $Id$
\input docstrip
@@ -38,7 +37,7 @@ The latest version of this license is in:
http://www.latex-project.org/lppl.txt
-and version 1.3a or later is part of all distributions of LaTeX
+and version 1.3a or later is part of all distributions of LaTeX
version 2004/10/01 or later.
To produce the documentation run the original source files ending with `.dtx'
@@ -59,10 +58,9 @@ The latest version of this license is in:
http://www.latex-project.org/lppl.txt
-and version 1.3a or later is part of all distributions of LaTeX
+and version 1.3a or later is part of all distributions of LaTeX
version 2004/10/01 or later.
-
This is the configuration file of the thuthesis package with LaTeX2e.
\endpreamble
@@ -73,22 +71,21 @@ This is the configuration file of the thuthesis package with LaTeX2e.
\nopreamble\nopostamble
\file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}}}
-\ifToplevel{
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the following}
-\Msg{* files into a directory searched by TeX:}
-\Msg{*}
-\Msg{* The recommended directory is TEXMF/tex/latex/thuthesis}
-\Msg{*}
-\Msg{* \space\space thuthesis.cls}
-\Msg{* \space\space thuthesis.cfg}
-\Msg{*}
-\Msg{* To produce the documentation run the files ending with}
-\Msg{* `.dtx' through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{***********************************************************}
-}
+\ifToplevel{%
+ \Msg{***********************************************************}
+ \Msg{*}
+ \Msg{* To finish the installation you have to move the following}
+ \Msg{* files into a directory searched by TeX:}
+ \Msg{*}
+ \Msg{* The recommended directory is TEXMF/tex/latex/thuthesis}
+ \Msg{*}
+ \Msg{* \space\space thuthesis.cls}
+ \Msg{* \space\space thuthesis.cfg}
+ \Msg{*}
+ \Msg{* To produce the documentation run the files ending with}
+ \Msg{* `.dtx' through LaTeX.}
+ \Msg{*}
+ \Msg{* Happy TeXing!}
+ \Msg{***********************************************************}}
\endbatchfile