From 92dfd63f1480de91bdf82d2ae9fd7a76110f39d7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 27 Nov 2014 23:12:33 +0000 Subject: thuthesis (27nov14) git-svn-id: svn://tug.org/texlive/trunk@35672 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/thuthesis/thuthesis.dtx | 1086 +++++++++----------- .../source/latex/thuthesis/thuthesis.ins | 3 +- 2 files changed, 462 insertions(+), 627 deletions(-) (limited to 'Master/texmf-dist/source/latex/thuthesis') diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx index f9ff1d2fe72..c87d26e2928 100644 --- a/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx +++ b/Master/texmf-dist/source/latex/thuthesis/thuthesis.dtx @@ -1,13 +1,6 @@ -% \iffalse -% Local Variables: -% mode: doctex -% TeX-master: t -% End: -% \fi -% % \iffalse meta-comment % -% Copyright (C) 2005-2011 by Ruini Xue +% Copyright (C) 2005-2014 by Ruini Xue % % This file may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3a @@ -23,7 +16,7 @@ % % \fi % -% \CheckSum{2639} +% \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 @@ -42,7 +35,7 @@ % % \iffalse %<*driver> -\ProvidesFile{thuthesis.dtx}[2011/10/22 4.6 Tsinghua University Thesis Template] +\ProvidesFile{thuthesis.dtx}[2014/11/27 4.8 Tsinghua University Thesis Template] \documentclass[10pt]{ltxdoc} \usepackage{dtx-style} \EnableCrossrefs @@ -50,56 +43,44 @@ \RecordChanges %\OnlyDescription \begin{document} -\begin{CJK*}{UTF8}{song} \DocInput{\jobname.dtx} -\end{CJK*} \end{document} % % \fi % % \GetFileInfo{\jobname.dtx} -% \MakeShortVerb{\|} -% -% \def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} -% \def\pkg#1{\texttt{#1}} % % \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 \textbf{fancyref}; Remove \textbf{ucite} and implemente -% \textbf{onlinecite}; use package arial or helvet selectively.} -% -% \changes{v1.3}{2005/11/14}{replace subfigure with subfig, replace caption2 -% with caption, add details about using figure in the example.} -% -% \changes{v1.4rc1}{2005/11/20}{I do not why \textbf{thu@authorizationaddon} does not work +% \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 nicer solution. Other changes: add \textsf{config} option to -% subfig to be compatible with subfigure. add \textbf{courier} package for tt font.} -% -% \changes{v1.4}{2005/12/05}{Fix the problem of \textbf{chinese}, that is -% because both CJK and everysel redefined the \textbf{selectfont}. So, a not so good -% workaround is merge them up. Add \textbf{shuji} example. Add \textbf{pozhehao} command.} -% +% :(. There might be better solution. Other changes: add \textsf{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 merge them up. Add \file{shuji} 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 thubib.bst with chinesebst.bst.} +% \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 |checklab| code to reduce ``unresolved labels'' warning} +% \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: \cmd{PassOptionsToClass} and \cs{LoadClass} +% \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 openright and openany.} +% \changes{v2.3}{2006/04/07}{Support \option{openright} and openany.} % \changes{v2.3}{2006/04/09}{Adjust hypersetup to remove color and box.} % \changes{v2.3}{2006/04/09}{Adjust margins again.} % \changes{v2.3}{2006/04/09}{Adjust references formats.} @@ -108,7 +89,7 @@ % \changes{v2.3}{2006/04/09}{Change the brace in the cover.} % \changes{v2.4}{2006/04/14}{Fill more pdf info. with hypersetup.} % \changes{v2.4}{2006/04/14}{自动隐藏密级为内部时后面的五角星。} -% \changes{v2.4}{2006/04/14}{增加``注释(Remark)''环境。} +% \changes{v2.4}{2006/04/14}{增加“注释 (Remark)”环境。} % \changes{v2.4}{2006/04/14}{压缩 item 之间的距离。} % \changes{v2.4}{2006/04/14}{thubib.bst 文献标题取消自动小写。} % \changes{v2.4}{2006/04/14}{中文参考文献取消 In: Proceedings。} @@ -118,7 +99,7 @@ % \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}{章节的编号用黑体,也就是自动打开 arialtitle 选项。} +% \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}{去掉参考文献第二个作者后面烦人的逗号。} @@ -126,11 +107,13 @@ % \changes{v2.5}{2006/05/19}{重新整理代码,使其布局更易读。} % \changes{v2.5.1}{2006/05/24}{根据教务处的新要求调整附录部分。} % \changes{v2.5.1}{2006/05/25}{参考文献中杂志文章如果没有卷号,那么页码直接跟在 -% 年份后面,并用句点分割。在 thubib.bst 中增加 output.year 函数。} -% \changes{v2.6.1}{2006/06/16}{取消 thubib.bst 中 inbook 类 volume 后的页码。} +% 年份后面,并用句点分割。在 \file{thubib.bst} 中增加 output.year 函数。} +% \changes{v2.6.1}{2006/06/16}{取消 \file{thubib.bst} 中 inbook 类 volume 后的页码。} % \changes{v4.5}{2008/01/04}{彻底转向 UTF-8,并支持 xelatex。} % \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}{2014/11/25}{好几年累积的一些更新,最重要的是切换到 \pkg{ctex}。} % % \DoNotIndex{\begin,\end,\begingroup,\endgroup} % \DoNotIndex{\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} @@ -156,7 +139,8 @@ % % % \title{\thuthesis:清华大学学位论文模板\thanks{Tsinghua University \LaTeX{} Thesis Template.}} -% \author{{\fs 薛瑞尼\thanks{LittleLeo@newsmth}}\\[5pt]{\fs 清华大学计算机系高性能所}\\[5pt] \texttt{xueruini@gmail.com}} +% \author{{\fangsong 薛瑞尼\thanks{LittleLeo@newsmth}}\\[5pt]{\fangsong 清华大学 +% 计算机系高性能所\thanks{目前于电子科技大学工作。}}\\[5pt] \texttt{xueruini@gmail.com}} % \date{v\fileversion\ (\filedate)} % \maketitle\thispagestyle{empty} % @@ -171,10 +155,11 @@ % \begin{abstract} % \noindent % \begin{enumerate} -% \item 本模板的发布遵守 \LaTeX{} Project Public License,使用前请认真阅读协议内容。 +% \item 本模板的发布遵守 \LaTeX{} Project Public License,使用前请认真阅读协议内 +% 容。 % \item 本模板为作者根据清华大学教务处颁发的《综合论文训练写作指南》,清华大学研 -% 究生院颁发的《研究生学位论文写作指南》,清华大学《编写“清华大学博士后研究报告”参考意见》 -% 编写而成,旨在供清华大学毕业生撰写学位论文使用。 +% 究生院颁发的《研究生学位论文写作指南》,清华大学《编写“清华大学博士后研究报 +% 告”参考意见》编写而成,旨在供清华大学毕业生撰写学位论文使用。 % \item 清华大学教务处和研究生院只提供毕业论文写作指南,不提供官方模板,也不会授 % 权第三方模板为官方模板,所以此模板仅为写作指南的参考实现,不保证格式审查老师 % 不提意见。任何由于使用本模板而引起的论文格式审查问题均与本模板作者无关。 @@ -200,12 +185,12 @@ % \thuthesis\ (\textbf{T}sing\textbf{hu}a \textbf{Thesis}) 是为了帮助清华大学毕业 % 生撰写毕业论文而编写的 \LaTeX{} 论文模板。 % -% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者给邮件 -% 列表(见后)写信,欢迎感兴趣的同学出力完善此使用手册。由于个人水平有限,虽然现 -% 在的这个版本基本上满足了学校的要求,但难免还存在不足之处,欢迎大家积极反馈。 +% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据 +% 第~\ref{sec:howtoask}节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎对代 +% 码的贡献。 % -% {\color{blue}\fs 模板的作用在于减轻论文写作过程中格式调整的时间,其前提就是遵 -% 守模板的用法,否则即使使用了 \thuthesis{} 也难以保证输出的论文符合学校规范。} +% {\color{blue}\fangsong 模板的作用在于减少论文写作过程中格式调整的时间,前提是遵 +% 守模板的用法,否则即便用了 \thuthesis{} 也难以保证输出的论文符合学校规范。} % % % \section{安装} @@ -214,30 +199,22 @@ % \subsection{下载} % \thuthesis{} 相关链接: % \begin{itemize} -% \item 主页: -% \href{https://github.com/xueruini/thuthesis}{GitHub}\footnote{已经从 -% \url{http://thuthesis.sourceforge.net}迁移至此。} -% \item 下载:\href{http://code.google.com/p/thuthesis/}{Google Code} -% \item 同时本模板也提交至 -% \href{http://www.ctan.org/macros/latex/contrib/thuthesis}{CTAN} +% \item 主页:\href{https://github.com/xueruini/thuthesis}{GitHub} +% \item 下载:\href{http://www.ctan.org/pkg/thuthesis}{CTAN} % \end{itemize} % 除此之外,不再维护任何镜像。 % -% \thuthesis{} 的开发版本同样可以在 GitHub 上获得: -% \begin{shell} -% $ git clone git://github.com/xueruini/thuthesis.git -% \end{shell} % % \subsection{模板的组成部分} % 下表列出了 \thuthesis{} 的主要文件及其功能介绍: % % \begin{center} -% \begin{longtable}{l|p{10cm}} +% \begin{longtable}{l|p{8cm}} % \hline -% {\hei 文件(夹)} & {\hei 功能描述}\\\hline\hline +% {\heiti 文件(夹)} & {\heiti 功能描述}\\\hline\hline % \endfirsthead % \hline -% {\hei 文件(夹)} & {\hei 功能描述}\\\hline\hline +% {\heiti 文件(夹)} & {\heiti 功能描述}\\\hline\hline % \endhead % \endfoot % \endlastfoot @@ -245,6 +222,7 @@ % thuthesis.dtx & 模板文档代码的混合文件\\ % thuthesis.cls & 模板类文件\\ % thuthesis.cfg & 模板配置文件\\ +% fontname.def & 中文字体配置文件\\ % thubib.bst & 参考文献样式文件\\\hline % main.tex & 示例文档主文件\\ % shuji.tex & 书脊示例文档\\ @@ -252,40 +230,36 @@ % data/ & 示例文档章节具体内容\\ % figures/ & 示例文档图片路径\\ % thutils.sty & 为示例文档加载其它宏包\\\hline -% Makefile & self-explanation \\ -% msmake.cmd & Windows 批处理工具\\\hline -% Readme & self-explanation\\ +% Makefile & self-explanation\\ +% zhfonts.py & 生成中文字体配置文件\\ +% README.md & self-explanation\\ % \textbf{thuthesis.pdf} & 用户手册(本文档)\\\hline % \end{longtable} % \end{center} -% -% 需要说明几点: +% 几点说明: % \begin{itemize} -% \item \emph{thuthesis.cls} 和 \emph{thuthesis.cfg} 可以 -% 由 \emph{thuthesis.ins} 和 \emph{thuthesis.dtx} 生成,但为了降低新 -% 手用户的使用难度,故将 cls和 cfg 一起发布。 -% \item 使用前认真阅读文档:\emph{thuthesis.pdf}. +% \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:prepare} -% 本模板用到以下宏包: +% 本模板用到的主要宏包包括: % % \begin{center} % \begin{minipage}{1.0\linewidth}\centering % \begin{tabular}{*{6}{l}}\hline -% ifxetex & xunicode & xltxtra & CJK\footnote{版本要求:$\geq$ v4.8.1} & xeCJK & \pkg{CJKpunct} \\ -% array & booktabs & longtable & amsmath & amssymb & ntheorem \\ -% indentfirst & paralist & txfonts & natbib & hyperref & hypernat \\ -% graphicx & \pkg{subfig}\footnote{版本要求:$\geq$2005/06/28 ver: 1.3} & -% \pkg{caption}\footnote{版本要求:$\geq$2006/03/21 v3.0j} & -% \pkg{thubib.bst} & &\\\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 live。 +% 这些包在常见的 \TeX{} 系统中都有,如果没有请到 \url{www.ctan.org} 下载。 % % % \subsection{开始安装} @@ -293,15 +267,17 @@ % % \subsubsection{生成模板} % \label{sec:generate-cls} -% {\hei 说明:默认的发行包中已经包含了所有文件,可以直接使用。如果对如何由 dtx 生 -% 成模板文件以及模板文档不感兴趣,请跳过本小节。} -% -% 模板解压缩后生成文件夹 thuthesis-VERSION\footnote{VERSION 为版本号。},其中包括: -% 模板源文件(thuthesis.ins 和 thuthesis.dtx),参考文献样式 thubib.bst,示例文档 -% (main.tex,shuji.tex,thutils.sty\footnote{我把可能用到但不一定用到的包以及一 -% 些命令定义都放在这里面,以免 thuthesis.cls 过分臃 -% 肿。},data/ 和 figures/ 和 ref/)。在使用之前需要先生成模板文件和配置文件 -% (具体命令细节请参考 |Readme| 和 |Makefile|): +% {\heiti 说明:默认的发行包中已经包含了所有文件,可以直接使用。如果对如何生成模 +% 板文件以及模板文档不感兴趣,请跳过本小节。} +% +% 模板解压缩后生成文件夹 \file{thuthesis-VERSION}\footnote{VERSION 为版本号。}, +% 其中包括:模板源文件(\file{thuthesis.ins} 和 \file{thuthesis.dtx}),参考文献 +% 样式 \file{thubib.bst},示例文档 +% (\file{main.tex},\file{shuji.tex},\file{fontname.def}\footnote{Xe\LaTeX 中文 +% 字体配置文件},\file{thutils.sty}\footnote{可能用到的包以及一些命令定义都放在这 +% 里,以免 \file{thuthesis.cls} 过分臃 +% 肿。},\file{data/} 和 \file{figures/} 和 \file{ref/})。在使用之前需要先生成模 +% 板文件和配置文件(具体命令细节请参考 \file{README.md} 和 \file{Makefile}): % % \begin{shell} % $ cd thuthesis-VERSION @@ -309,19 +285,19 @@ % $ latex thuthesis.ins % % # 下面的命令用来生成用户手册,可以不执行 -% $ latex thuthesis.dtx +% $ xelatex thuthesis.dtx % $ makeindex -s gind.ist -o thuthesis.ind thuthesis.idx % $ makeindex -s gglo.ist -o thuthesis.gls thuthesis.glo -% $ latex thuthesis.dtx -% $ latex thuthesis.dtx % 生成说明文档 thuthesis.dvi +% $ xelatex thuthesis.dtx +% $ xelatex thuthesis.dtx % 生成说明文档 thuthesis.pdf % \end{shell} % % % \subsubsection{dvi$\rightarrow$ps$\rightarrow$pdf} % \label{sec:dvipspdf} -% 很多用户对 \LaTeX{} 命令执行的次数不太清楚,一个基本的原则是多次运行 \LaTeX{} -% 命令直至不再出现警告。下面给出生成示例文档的详细过程(\# 开头的行为注释),首先 -% 来看经典的 \texttt{dvi$\rightarrow$ps$\rightarrow$pdf} 方式: +% 很多用户对 \LaTeX{} 命令执行的次数不太清楚,一个基本的原则是多次运行 \LaTeX{}命 +% 令直至不再出现警告。下面给出生成示例文档的详细过程(\# 开头的行为注释),首先来 +% 看经典的 \texttt{dvi$\rightarrow$ps$\rightarrow$pdf} 方式: % \begin{shell} % # 1. 发现里面的引用关系,文件后缀 .tex 可以省略 % $ latex main @@ -348,7 +324,8 @@ % % \subsubsection{dvipdfm(x)} % \label{sec:dvipdfmx} -% 如果使用 dvipdfm(x),那么在生成完整的 dvi 文件之后(参见上面的例子),可以直接得到 pdf: +% 如果使用 \texttt{dvipdfm(x)},那么在生成完整的 dvi 文件之后(参见上面的例子), +% 可以直接得到 pdf: % \begin{shell}% % $ dvipdfm main.dvi % # 或者 @@ -365,20 +342,20 @@ % % \subsubsection{xelatex} % \label{sec:xelatex} -% XeTeX 最大的优势就是不再需要繁琐的字体配置。\thuthesis{} 通过 \pkg{xeCJK} 来控 -% 制中文字体和标点压缩。模板里默认用的是 Adobe 的四款免费字体(宋,黑,楷,仿宋), -% 用户可以根据自己的实际情况方便的替换。另外,本科论文封面要用到隶书,请用户自行 -% 修改。 +% Xe\TeX 最大的优势就是不再需要繁琐的字体配置。\thuthesis{} 通过 \pkg{xeCJK} 来控 +% 制中文字体和标点压缩。模板里默认用的是中易的四款免费字体(宋,黑,楷,仿宋), +% 用户可以根据自己的实际情况自行替换。另外,本科论文封面要用到隶书,请用户自行修 +% 改。字体配置参考第~\ref{sec:font-config} 节。 % % Xe\LaTeX\ 的使用步骤同 PDF\LaTeX。 % % % \subsubsection{自动化过程} % \label{sec:automation} -% 上面的例子只是给出一般情况下的使用方法,可以发现虽然命令很简单,但是每次都输入 -% 的话还是非常罗嗦的,所以 \thuthesis{} 还提供了一些自动处理的文件。 +% 上面的例子只是给出一般情况下的使用方法。虽然命令很简单,但是每次都输入的话还是 +% 非常罗嗦的,所以 \thuthesis{} 还提供了一些自动处理的文件。 % -% 我们提供了一个简单的 \texttt{Makefile}: +% 我们提供了一个简单的 \file{Makefile}: % \begin{shell} % $ make clean % $ make cls # 生成 thuthesis.cls 和 thuthesis.cfg @@ -387,45 +364,38 @@ % $ make shuji # 生成书脊 shuji.pdf % \end{shell} % -% 如果使用 Windows 平台,可以试一试 Truel 编写的批处理脚 -% 本 \texttt{msmake.cmd}\footnote{尚不完善,亟需改进。}: -% \begin{shell} -% your_path $ msmake setup # 生成宏包文件和说明文档 -% your_path $ msmake all # 生成示例文档和书脊 -% your_path $ msmake main # 生成示例文档 -% your_path $ msmake shuji # 生成书脊 -% your_path $ msmake clean # 清除临时文件 -% \end{shell} -% -% \texttt{Makefile} 和 \texttt{msmake.cmd} 默认采用 \LaTeX\ 编译,可以根据自己的 -% 需要修改命令。 +% \file{Makefile} 默认采用 Xe\LaTeX\ 编译,可以根据自己的需要修 +% 改 \file{Makefile} 开头的参数设置或通过命令行传递参数(请参看 \file{README.md})。 % % % \subsection{升级} % \label{sec:updgrade} -% \thuthesis{} 升级非常简单,下载最新的版本, -% 将 thuthesis.ins,thuthesis.dtx 和thubib.bst 拷贝至工作目录覆盖相应的文件,然后 -% 运行: +% \thuthesis{} 升级非常简单,可以通过 TeX 发行版的包管理工具自动更新发行版,也可 +% 以下载最新的开发版, +% 将 \file{thuthesis.ins},\file{thuthesis.dtx} 和 \file{thubib.bst} 拷贝至工作目 +% 录覆盖相应的文件,然后运行: % \begin{shell} % $ latex thuthesis.ins % \end{shell} % -% 生成新的类文件和配置文件即可。当然也可以直接拷贝 thuthesis.cls, thuthesis.cfg -% 和 thubib.bst,免去上面命令的执行。只要明白它的工作原理,这个不难操作。 +% 生成新的类文件和配置文件即可。也可以直接拷 +% 贝 \file{thuthesis.cls},\file{thuthesis.cfg}和 \file{thubib.bst},免去上面命令 +% 的执行。 % % % \section{使用说明} % \label{sec:usage} -% 本手册假定用户已经能处理一般的 \LaTeX{} 文档,并对 \BibTeX{} 有一定了解。如果你 +% 本手册假定用户已经能处理一般的 \LaTeX{} 文档,并对 \BibTeX{} 有一定了解。如果 % 从来没有接触过 \TeX 和 \LaTeX,建议先学习相关的基础知识。磨刀不误砍柴工! % % \subsection{关于提问} % \label{sec:howtoask} -% \begin{itemize}\addtolength{\itemsep}{-5pt} -% \item \url{http://groups.google.com/group/thuthesis} -% 或直接给\href{mailto:thuthesis@googlegroups.com}{邮件列表}写信。 -% \item Google Groups mirror: \url{http://thuthesis.1048723.n5.nabble.com/} -% \item \href{http://www.newsmth.net/bbsdoc.php?board=TeX}{\TeX@newsmth} +% 按照优先级推荐提问的位置如下: +% +% \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{\thuthesis{} 使用向导} @@ -435,21 +405,27 @@ % % \subsection{\thuthesis{} 示例文件} % \label{sec:userguide1} -% 模板核心文件只有三个:thuthesis.cls,thuthesis.cfg 和 thubib.bst,但是如果没有 -% 示例文档用户会发现很难下手。所以推荐新用户从模板自带的示例文档入手,里面包括了 -% 论文写作用到的所有命令及其使用方法,只需要用自己的内容进行相应替换就可以。对于 -% 不清楚的命令可以查阅本手册。下面的例子描述了模板中章节的组织形式,来自于示例文 -% 档,具体内容可以参考模板附带的 main.tex 和 data/。 +% 模板核心文件有四 +% 个:\file{thuthesis.cls},\file{thuthesis.cfg},\file{fontname.def} 和 +% \file{thubib.bst},但是如果没有示例文档用户会发现很难下手。所以推荐新用户从模板 +% 自带的示例文档入手,里面包括了论文写作用到的所有命令及其使用方法,只需要用自己 +% 的内容进行相应替换就可以。对于不清楚的命令可以查阅本手册。下面的例子描述了模板 +% 中章节的组织形式,来自于示例文档,具体内容可以参考模板附带 +% 的 \file{main.tex} 和 \file{data/}。 % % \begin{example} -% \documentclass[bachelor]{thuthesis} +% \documentclass[bachelor,nofonts]{thuthesis} +% %\documentclass[master,adobefonts]{thuthesis} +% %\documentclass[doctor]{thuthesis} % %\documentclass[% -% % bachelor|master|doctor|postdoc, % 必选选项 -% % xetex|pdftex|dvips|dvipdfm, % 可选选项 +% % bachelor|master|doctor|postdoctor, % 必选选项 +% % winfonts|nofonts|adobefonts, % 本科生、Linux 用户使用 XeLaTeX 时必选 % % secret, % 可选选项 % % openany|openright, % 可选选项 % % arialtoc,arialtitle % 可选选项 % % ]{thuthesis} +% % 当使用 xelatex 编译时,本科生、Linux 用户需要加上 nofonts 选项; +% % 当使用 pdflatex 编译时,adobefonts 选项等效于 winfonts 选项(缺省选项)。 % % % 所有其它可能用到的包都统一放到这里了,可以根据自己的实际添加或者删除。 % \usepackage{thutils} @@ -539,9 +515,9 @@ % \end{example} % % \item[secret] -% 涉秘论文开关。配合另外两个命令 |\secretlevel| 和 |\secretyear| 分别用来指定保 -% 密级别和时间。二者默认分别为\textbf{秘密}和当前年份。可以通过: -% \cs{secretlevel}|{|绝密|}| 和 \cs{secretyear}|{|10|}| 年独立修改。 +% 涉秘论文开关。配合另外两个命令 \cs{secretlevel} 和 \cs{secretyear} 分别用来指 +% 定保密级别和时间。二者默认分别为\textbf{秘密}和当前年份。可以通 +% 过:|\secretlevel{绝密}| 和 |\secretyear}{1984}| 修改。 % \begin{example} % \documentclass[bachelor, secret]{thuthesis} % \end{example} @@ -549,90 +525,86 @@ % \changes{v3.0}{2007/05/12}{不用专门为本科论文生成\textbf{提交}版本了。} % % \item[openany, openright] -% 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \texttt{openright}, -% 也是 \thuthesis 的默认选项。在这种情况下,如果前一章的最后一页也是奇数,那么 +% 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{openright}, +% 也是 \thuthesis\ 的默认选项。在这种情况下,如果前一章的最后一页也是奇数,那么 % 模板会自动生成一个纯粹的空白页,很多人不是很习惯这种方式,而且学校的格式似乎 -% 更倾向于页面连续,那就是通常所说的 \texttt{openany}。{\fs 目前所有论文都是 -% openany。}这两个选项不用专门设置,\thuthesis{} 会根据当前论文类型自动选 -% 择。 -% -% \item[dvips,dvipdfm,pdftex,xetex] -% 这些选项主要是配合 \pkg{hyperref} 能正确生成书签和链接,以及所有其它对底层驱动有依 -% 赖的包。一般来说,这些选项可以忽略,不过一旦指定了,就要保证使用对应的命令编 -% 译,否则模板会报错。 +% 更倾向于页面连续,那就是通常所说的 \option{openany}。{\fangsong 目前所有论文 +% 都是 \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] -% 使用真正的 arial 字体。此选项会装载 arial 字体宏包,如果此宏包不存在,就装 -% 载Helvet。arialtoc 和 arialtitle 不受 arial 的影响。因为一般的 \TeX{} 发行都 -% 没有 arial 字体,所以默认采用 Helvet,因为二者效果非常相似。如果你执着的要 -% 用arial 字体,请参看:\href{http://www.mail-archive.com/ctan-ann@dante.de/msg00627.html}{Arial -% 字体}。 +% 使用真正的 \option{arial} 字体。此选项会装载 \pkg{arial} 字体宏包,如果此宏包 +% 不存在,就装 +% 载 \pkg{Helvet}。\option{arialtoc} 和 \option{arialtitle} 不受 +% \texttt{arial} 的影响。因为一般的 \TeX{} 发行都没有 \pkg{arial} 字体,所以默 +% 认采用 \pkg{Helvet},二者效果非常相似。如果一定要用 \pkg{arial} 字体,请参 +% 看:\href{http://www.mail-archive.com/ctan-ann@dante.de/msg00627.html}{Arial +% 字体}。 % % \item[arialtoc] -% 目录项(章目录项除外)中的英文是否用 arial 字体。本选项和下一个 \textsl{arialtitle} 都不用用户 -% 操心,模板都自动设置好了。 +% 目录项(章目录项除外)中的英文是否用 \option{arial} 字体。本选项 +% 和 \option{arialtitle} 都不用用户干预,模板根据当前论文类型自动设置。 % % \item[arialtitle] -% 章节标题中英文是否用 arial 字体(默认打开)。 +% 章节标题中英文是否用 \option{arial} 字体(默认打开)。 % \end{description} % % \subsection{字体配置} % \label{sec:font-config} -% 正确配置中文字体是使用模板的第一步。模板有两种字体使用方式: +% 正确配置中文字体是使用模板的第一步。模板调用 \pkg{ctex} 宏包,提供如下字体使用方式: % \begin{itemize} -% \item 基于传统 CJK 包,使用 latex、pdflatex 编译; -% \item 基于 xeCJK 包,使用 xelatex 编译。 +% \item 基于传统 \pkg{CJK} 包,使用 latex、pdflatex 编译; +% \item 基于 \pkg{xeCJK} 包,使用 xelatex 编译。 % \end{itemize} % -% 第一种方式的字体配置比较繁琐,建议使用 donated 制作的中文字体包(自 -% 包含安装方法),请用户自行下载安装,此处不再赘述。本模板推荐使用第二 -% 种方法,只要把所需字体放入系统字体文件夹(也可以指定自定义文件夹)即 -% 可。模板默认采用 Adobe 的四款免费字体,配置如下: +% 第一种方式的字体配置比较繁琐,建议使用 \emph{donated@newsmth} 制作的中文字体包 +% (自包含安装方法),请用户自行下载安装,此处不再赘述。本模板推荐使用第二种方法, +% 只要把所需字体放入系统字体文件夹(也可以指定自定义文件夹)即可。用户可以使 +% 用 \option{winfonts},\option{adobefonts},\option{nofonts} 选项来选择可用的中 +% 文字库,缺省为 \option{winfonts} 有效,使用中易字体。当使用 xelatex 编译 +% 时,\option{winfonts} 只有中易的四款字体(宋体、黑体、楷书和仿宋)可用,而本科 +% 生需要用到幼圆,另外 Linux 系统缺少上述字体,这些用户可以通过指 +% 定 \option{nofonts} 选项,利用 \file{fontname.def} 文件配置所需字体。使用中易 +% 六种字体的配置如下: % \begin{example} -% \setCJKmainfont[BoldFont={Adobe Heiti Std}, ItalicFont={Adobe Kaiti Std}]{Adobe Song Std} -% \setCJKsansfont{Adobe Heiti Std} -% \setCJKmonofont{Adobe Kaiti Std} -% \setCJKfamilyfont{song}{Adobe Song Std} -% \setCJKfamilyfont{hei}{Adobe Heiti Std} -% \setCJKfamilyfont{fs}{Adobe Fangsong Std} -% \setCJKfamilyfont{kai}{Adobe Kaiti Std} -% \setCJKfamilyfont{li}{Adobe Kaiti Std} % todo: 用隶书字体代替 -% \setCJKfamilyfont{you}{Adobe Kaiti Std} % todo: 用幼圆字体代替 -% \end{example} -% -% 一般系统中默认并不存在这四种字体,所以要根据自己的实际情况来修改上述 -% 定义。对 Windows XP 来说如下: -% \begin{example} -% \setCJKmainfont[BoldFont={SimHei}, ItalicFont={KaiTi}]{SimSun} +% \ProvidesFile{fontname.def} +% \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} % \setCJKsansfont{SimHei} -% \setCJKmonofont{KaiTi_GB2312} -% \setCJKfamilyfont{song}{SimSun} -% \setCJKfamilyfont{hei}{SimHei} -% \setCJKfamilyfont{fs}{FangSong_GB2312} -% \setCJKfamilyfont{kai}{KaiTi_GB2312} -% \setCJKfamilyfont{li}{LiSu} -% \setCJKfamilyfont{you}{YouYuan} +% \setCJKmonofont{FangSong} +% \setCJKfamilyfont{zhsong}{SimSun} +% \setCJKfamilyfont{zhhei}{SimHei} +% \setCJKfamilyfont{zhkai}{KaiTi} +% \setCJKfamilyfont{zhfs}{FangSong} +% \setCJKfamilyfont{zhli}{LiSu} +% \setCJKfamilyfont{zhyou}{YouYuan} +% \newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体 +% \newcommand*{\heiti}{\CJKfamily{zhhei}} % 黑体 +% \newcommand*{\kaishu}{\CJKfamily{zhkai}} % 楷书 +% \newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋 +% \newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书 +% \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆 % \end{example} % -% Vista 和 Win 7 中文字体名字略有不同: -% \begin{example} -% \setCJKmainfont[BoldFont={SimHei}, ItalicFont={KaiTi}]{SimSun} -% \setCJKsansfont{SimHei} -% \setCJKmonofont{KaiTi} -% \setCJKfamilyfont{song}{SimSun} -% \setCJKfamilyfont{hei}{SimHei} -% \setCJKfamilyfont{fs}{FangSong} -% \setCJKfamilyfont{kai}{KaiTi} -% \setCJKfamilyfont{li}{LiSu} -% \setCJKfamilyfont{you}{YouYuan} -% \end{example} +% 对 Windows XP 来说如下,|KaiTi| 需要替换为 |KaiTi_GB2312|,|FangSong| 需要替换 +% 为 |FangSong_GB2312|。 +% +% 宏包中包含了 \file{zhfonts.py} 脚本,为 Linux/Mac 用户提供一种交互式的方式从系 +% 统中文字体中选择合适的六种字体,最终生成对应的 \file{fontname.def}文件。要使用 +% 它,只需在命令行输入该脚本的完整路径即可。 % -% 总而言之,用户可以通过命令: +% 另外,用户也可以通过命令 % \begin{shell} -% $ fs-list +% $ fs-list :lang=zh > zhfonts.txt % \end{shell} -% -% 来查看系统中现有的字体,并相应替换上述配置。 +% 得到系统中现有的中文字体列表,并相应替换上述配置。 % % \subsection{命令} % \label{sec:command} @@ -645,31 +617,23 @@ % \label{sec:basiccom} % % \myentry{字体} -% \DescribeMacro{\song} -% \DescribeMacro{\fs} -% \DescribeMacro{\hei} -% \DescribeMacro{\kai} -% \DescribeMacro{\li} -% \DescribeMacro{\you} -% 等分别用来切换宋体、仿宋、黑体、楷体、隶书和幼圆字体。为了兼容不同用户的习惯,模 -% 板还定义了另外一些字体切换命令,对应关系如下: -% -% \begin{center} -% \begin{tabular}{llllll}\hline -% \cs{song} &\cs{fs}&\cs{hei}&\cs{kai}&\cs{li}&\cs{you}\\\hline -% \cs{songti}&\cs{fangsong}&\cs{heiti}&\cs{kaishu}&\cs{lishu}&\cs{youyuan}\\\hline -% \end{tabular} -% \end{center} +% \DescribeMacro{\songti} +% \DescribeMacro{\fangsong} +% \DescribeMacro{\heiti} +% \DescribeMacro{\kaishu} +% \DescribeMacro{\lishu} +% \DescribeMacro{\youyuan} +% 等分别用来切换宋体、仿宋、黑体、楷体、隶书和幼圆字体。 % % \begin{example} -% {\song 乾:元,亨,利贞} -% {\fs 初九,潜龙勿用} -% {\hei 九二,见龙在田,利见大人} -% {\kai 九三,君子终日乾乾,夕惕若,厉,无咎} -% {\li 九四,或跃在渊,无咎} -% {\hei 九五,飞龙在天,利见大人} -% {\song 上九,亢龙有悔} -% {\you 用九,见群龙无首,吉} +% {\songti 乾:元,亨,利贞} +% {\fangsong 初九,潜龙勿用} +% {\heiti 九二,见龙在田,利见大人} +% {\kaishu 九三,君子终日乾乾,夕惕若,厉,无咎} +% {\lishu 九四,或跃在渊,无咎} +% {\heiti 九五,飞龙在天,利见大人} +% {\songti 上九,亢龙有悔} +% {\youyuan 用九,见群龙无首,吉} % \end{example} % % \myentry{字号} @@ -694,10 +658,6 @@ % {\erhao 二号 \sanhao 三号 \sihao 四号 \qihao 七号} % \end{example} % -% \myentry{字距} -% \DescribeMacro{\ziju} -% 更改汉字之间默认的距离,使用格式为 |\ziju{4bp}|,其中的距离只要是合格的 \TeX{} 距离即可。 -% % \myentry{密级} % \DescribeMacro{\secretlevel} % \DescribeMacro{\secretyear} @@ -715,7 +675,7 @@ % 模式使用远比正文模式频繁,所以为了符合使用习惯,上标模式仍然用常规 % 的 |\cite{key}|,而 |\onlinecite{key}| 则用来生成正文模式。 % -% 关于参考文献模板推荐使用 BIB\TeX,关于中文参考文献需要额外增加一个 Entry: lang,将其设置为 \texttt{zh} +% 关于参考文献模板推荐使用 \BibTeX{},关于中文参考文献需要额外增加一个 Entry: lang,将其设置为 \texttt{zh} % 用来指示此参考文献为中文,以便 thubib.bst 处理。如: % \begin{example} % @INPROCEEDINGS{cnproceed, @@ -743,13 +703,13 @@ % \DescribeMacro{\shuji} % 生成装订的书脊,为竖排格式,默认参数为论文中文题目。如果中文题目中没有英文字母, % 那么直接调用此命令即可。否则,就要像例子里面那样做一些微调(参看模板自带 -% 的 shuji.tex)。下面是一个列子: +% 的 \file{shuji.tex})。下面是一个列子: % \begin{example} % \documentclass[bachelor]{thuthesis} % \begin{document} % \ctitle{论文中文题目} % \cauthor{中文姓名} -% % |\shuji| 命令需要上面两个变量 +% % \shuji 命令需要上面两个变量 % \shuji % % % 如果你的中文标题中有英文,那可以指定: @@ -762,19 +722,19 @@ % \myentry{破折号} % \DescribeMacro{\pozhehao} % 中文破折号在 CJK-\LaTeX\ 里没有很好的处理,我们平时输入的都是两个小短线,比如这 -% 样,{\hei 中国——中华人民共和国}。这不符合中文习惯。所以这里定义了一个命令生成更 -% 好看的破折号,不过这似乎不是一个好的解决办法。有同学说不能用在 |\section| 等命 +% 样,{\heiti 中国——中华人民共和国}。这不符合中文习惯。所以这里定义了一个命令生成更 +% 好看的破折号,不过这似乎不是一个好的解决办法。有同学说不能用在 \cs{section} 等命 % 令中使用,简单的办法是可以提供一个不带破折号的段标题:\cs{section}\oarg{没有破 % 折号精简标题}\marg{带破折号的标题}。 % % % \subsubsection{封面命令} % \label{sec:titlepage} -% 下面是内容替换命令,其中以 |c| 开头的命令跟中文相关,|e| 开头则为对应的英文。 -% 这部分的命令数目比较多,但实际上都相当简单,套用即可。 +% 下面是内容替换命令,其中以 |c| 开头的命令跟中文相关,|e| 开头则为对应的英文。这 +% 部分的命令数目虽然比较多,实际上都相当简单,套用即可。 % % 大多数命令的使用方法都是: \cs{command}\marg{arg},例外者将具体指出。这些命令都 -% 在示例文档的 data/cover.tex 中。 +% 在示例文档的 \file{data/cover.tex} 中。 % % \myentry{论文标题} % \DescribeMacro{\ctitle} @@ -882,7 +842,7 @@ % 摘要请写在这里... % \end{cabstract} % \begin{eabstract} -% here comes English abstract... +% Here comes English abstract... % \end{eabstract} % \end{example} % @@ -893,7 +853,7 @@ % 要求的关键词格式。 % \begin{example} % \ckeywords{关键词 1, 关键词 2} -% \ekeywords{keyword 1, key word 2} +% \ekeywords{keyword 1, keyword 2} % \end{example} % % \subsubsection{其它部分} @@ -902,8 +862,8 @@ % % \myentry{符号对照表} % \DescribeEnv{denotation} -% 主要符号表环境。简单定义的一个 list,跟 description 非常类似,使用方法参见示例 -% 文件。带一个可选参数,用来指定符号列的宽度(默认为 2.5cm)。 +% 主要符号表环境。简单定义的一个 \texttt{list},跟 \texttt{description} 非常类似, +% 使用方法参见示例文件。带一个可选参数,用来指定符号列的宽度(默认为 2.5cm)。 % \begin{example} % \begin{denotation} % \item[E] 能量 @@ -928,7 +888,7 @@ % \begin{center} % \begin{tabular}{ll} % \hline -% {\hei 命令} & {\hei 说明} \\\hline +% {\heiti 命令} & {\heiti 说明} \\\hline % \cs{listoffigures} & 插图索引\\ % \cs{listoffigures*} & \\\hline % \cs{listoftables} & 表格索引\\ @@ -983,7 +943,7 @@ % % \myentry{附录} % \DescribeEnv{appendix} -% 所有的附录都插到这里来。因为附录会更改默认的 chapter 属性,而后面的{\hei 个人简 +% 所有的附录都插到这里来。因为附录会更改默认的 chapter 属性,而后面的{\heiti 个人简 % 历}又需要恢复,所以实现为环境可以保证全局的属性不受影响。 % \begin{example} % \begin{appendix} @@ -995,7 +955,7 @@ % \myentry{致谢声明} % \DescribeEnv{ack} % 把致谢做成一个环境更好一些,直接往里面写感谢的话就可以啦!下面是数学系一位同 -% 学致谢里的话,拿过来做个广告,多希望每个人都能写这么一句啊! +% 学致谢里的话,拿过来做个广告。希望每个人都能写这么一句 :) % \begin{example} % \begin{ack} % …… @@ -1033,9 +993,9 @@ % \end{definition} % \end{example} % 产生(自动编号):\\[5pt] -% \fbox{{\hei 定义~1.1~~~} {道千乘之国,敬事而信,节用而爱人,使民以时。}} +% \fbox{{\heiti 定义~1.1~~~} {道千乘之国,敬事而信,节用而爱人,使民以时。}} % -% 列举出来的数学环境毕竟是有限的,如果想用{\hei 胡说}这样的数学环境,那么很容易定义: +% 列举出来的数学环境毕竟是有限的,如果想用{\heiti 胡说}这样的数学环境,那么很容易定义: % \begin{example} % \newtheorem{nonsense}{胡说}[chapter] % \end{example} @@ -1047,25 +1007,22 @@ % \end{nonsense} % \end{example} % 产生(自动编号):\\[5pt] -% \fbox{{\hei 胡说~1.1~~~} {契丹武士要来中原夺武林秘笈。\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex 慕容博}} +% \fbox{{\heiti 胡说~1.1~~~} {契丹武士要来中原夺武林秘笈。\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex 慕容博}} % % \subsection{自定义以及其它} % \label{sec:othercmd} -% 模板的配置文件 thuthesis.cfg 中定义了很多固定词汇,一般无须修改。如果有特殊需求, +% 模板的配置文件 \file{thuthesis.cfg} 中定义了很多固定词汇,一般无须修改。如果有特殊需求, % 推荐在导言区使用 \cs{renewcommand}。当然,导言区里可以直接使用中文。 % % % \section{致谢} % \label{sec:thanks} -% 感谢这些年来一直陪伴 \thuthesis{} 成长的新老同学,大家的需求是模板前 -% 进的动力,大家的反馈是模板提高的机会。 +% 感谢这些年来一直陪伴 \thuthesis{} 成长的新老同学,大家的需求是模板前进的动力, +% 大家的反馈是模板提高的机会。 % -% 此版本加入了博士后出站报告的支持,本意为制作一个支持清华所有学位报告 -% 的模板,孰料学校于近期对硕士、博士论文规范又有调整,未能及时更新,见 -% 谅! -% -% 本人已于近期离开清华,虽不忍模板存此瑕疵,然精力有限,必不能如往日及 -% 时升级,还望新的同学能参与或者接手,继续为大家服务。 +% 本人已离开清华,不能如往日及时升级,热烈欢迎各位 +% 到\href{http://github.com/xueruini/thuthesis/}{Github 主页}贡献,继续为大家服 +% 务。 % % \StopEventually{\PrintChanges\PrintIndex} % \clearpage @@ -1077,22 +1034,11 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{thuthesis} %\ProvidesFile{thuthesis.cfg} -%[2011/05/02 4.6 Tsinghua University Thesis Template] +%[2014/11/27 4.8 Tsinghua University Thesis Template] % \end{macrocode} % % \subsection{定义选项} % \label{sec:defoption} -% TODO: 所有的选项用 \pkg{xkeyval} 来重构,现在的太罗唆了。 -% -% 定义文档所使用编码 -% \begin{macrocode} -%<*cls> -\newif\ifthu@UTF -\newif\ifthu@GBK -\DeclareOption{utf}{\thu@UTFtrue\thu@GBKfalse} -\DeclareOption{gbk}{\thu@GBKtrue\thu@UTFfalse} -% \end{macrocode} -% % 定义论文类型以及是否涉密 % \changes{v2.4}{2006/04/14}{添加模板名称命令。} % \changes{v2.5}{2006/05/19}{增加本科论文的提交选项 submit。} @@ -1101,10 +1047,12 @@ % \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曾经想发布,但是一直没有做,于是就被跳过了,算是造一个段子吧。} % \begin{macrocode} +%<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{\textsc{ThuThesis}} -\def\version{4.6} +\def\version{4.8} \newif\ifthu@bachelor\thu@bachelorfalse \newif\ifthu@master\thu@masterfalse \newif\ifthu@doctor\thu@doctorfalse @@ -1117,20 +1065,10 @@ \DeclareOption{secret}{\thu@secrettrue} % \end{macrocode} % -% 使用 dvips,dvipdfm, pdflatex 还是 xelatex % \changes{v2.5.1}{2006/05/24}{如果选项设置了 dvips,但是用 pdflatex 编译,报错。} % \changes{v2.6}{2006/06/09}{增加 dvipdfm 选项。} % \changes{v4.5}{2009/01/03}{增加 xetex, pdftex 选项。} -% \begin{macrocode} -\newif\ifthu@dvips -\newif\ifthu@dvipdfm -\newif\ifthu@xetex -\newif\ifthu@pdftex -\DeclareOption{dvips}{\thu@dvipstrue} -\DeclareOption{dvipdfm}{\thu@dvipdfmtrue} -\DeclareOption{pdftex}{\thu@pdftextrue} -\DeclareOption{xetex}{\thu@xetextrue} -% \end{macrocode} +% \changes{v4.8}{2013/03/02}{内部调用 ctex 宏包,自动检测编译引擎。} % % 如果需要使用 arial 字体,请打开 [arial] 选项 % \begin{macrocode} @@ -1149,9 +1087,16 @@ \DeclareOption{arialtitle}{\thu@arialtitletrue} % \end{macrocode} % -% 将选项传递给 book 类 +% noraggedbottom 选项 +% \changes{v4.8}{2013/03/05}{增加 noraggedbottom 选项。} +% \begin{macrocode} +\newif\ifthu@raggedbottom\thu@raggedbottomtrue +\DeclareOption{noraggedbottom}{\thu@raggedbottomfalse} +% \end{macrocode} +% +% 将选项传递给 ctexbook 类 % \begin{macrocode} -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ctexbook}} % \end{macrocode} % % \cs{ExecuteOptions} 的参数之间用逗号分割,不能有空格。开始不知道,折腾了老半 @@ -1159,10 +1104,12 @@ % \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[12pt,a4paper,openany]{book} +\LoadClass[cs4size,a4paper,openany,nocap,UTF8]{ctexbook} % \end{macrocode} % % 用户至少要提供一个选项:指定论文类型。 @@ -1179,38 +1126,19 @@ \fi % \end{macrocode} % -% 检查用户指定的选项和实际编译命令是否冲突。 -% \begin{macrocode} -\RequirePackage{ifpdf,ifxetex} -\ifthu@xetex\RequireXeTeX\fi -\def\RequirePDFTeX{% - \ifpdf\else - \ClassError{thuthesis}% - {pdflatex is required to compile this document!}{} - \fi} -\ifthu@pdftex\RequirePDFTeX\fi -\def\thu@checkoption#1#2{% - \@for\reserved@a:=#2\do{% - \csname ifthu@\reserved@a\endcsname - \ClassError{thuthesis}% - {Please remove `\reserved@a' option when you run #1.}{} - \fi}} -\ifpdf\thu@checkoption{pdflatex}{dvips,dvipdfm,xetex}\thu@pdftextrue\fi % force the option to be true -\ifxetex\thu@checkoption{xelatex}{dvips,dvipdfm,pdftex}\thu@xetextrue\fi -% \end{macrocode} -% -% % \subsection{装载宏包} % \label{sec:loadpackage} % % 引用的宏包和相应的定义。 % \begin{macrocode} +\RequirePackage{ifxetex} \RequirePackage{ifthen,calc} % \end{macrocode} % % \AmSTeX{} 宏包,用来排出更加漂亮的公式。 +% \changes{v4.8}{2013/03/02}{no need to load amssymb since we use txfonts.} % \begin{macrocode} -\RequirePackage{amsmath,amssymb} +\RequirePackage{amsmath} % \end{macrocode} % % 用很爽的 \pkg{txfonts} 替换 \pkg{mathptmx} 宏包,同时用它自带的 typewriter 字 @@ -1225,18 +1153,13 @@ \RequirePackage{graphicx} % \end{macrocode} % -% 并排图形。\pkg{subfigure} 已经不再推荐,用新的 \pkg{subfig}。加入 |config| 选项 -% 以便兼容 \pkg{subfigure} 的命令。浮动图形和表格标题样式。\pkg{caption2} 已经不 -% 推荐使用,采用新的 \pkg{caption}。它会自动被 \pkg{subfig} 装载进来。所以可以在 -% 后面看到 \cs{captionsetup} 的命令。 +% 并排图形。\pkg{subfigure}、\pkg{subfig} 已经不再推荐,用新的 \pkg{subcaption}。 +% 浮动图形和表格标题样式。\pkg{caption2} 已经不推荐使用,采用新的 \pkg{caption}。 % \begin{macrocode} -\RequirePackage[config]{subfig} +\RequirePackage[labelformat=simple]{subcaption} % \end{macrocode} % -% 首行缩进宏包 -% \begin{macrocode} -\RequirePackage{indentfirst} -% \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 选项,因为默 @@ -1246,46 +1169,41 @@ \RequirePackage[neverdecrease]{paralist} % \end{macrocode} % -% 中文支持宏包。XeTeX 模式下直接调用 \pkg{xeCJK},一切问题都搞定了。 +% raggedbottom,禁止Latex自动调整多余的页面底部空白,并保持脚注仍然在底部。 +% \begin{macrocode} +\ifthu@raggedbottom + \RequirePackage[bottom]{footmisc} + \raggedbottom +\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@xetex - \RequirePackage{mathptmx} % fontspec conflicts with txfonts now, so we have to load other times-math fonts. - \RequirePackage{xltxtra} - \RequirePackage[CJKnumber,BoldFont,ItalicFont,normalindentfirst]{xeCJK} +\ifthu@bachelor + \RequirePackage{CJKfntef} +\fi +\renewcommand{\baselinestretch}{1.0} +\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} -% 默认采用 Adobe 的四款 (宋,黑,楷,仿宋) 免费字体。这样的话,缺少隶书和幼圆。本 -% 科的封面大字会受影响。请手动替换。 -% \begin{macrocode} - \setCJKmainfont[BoldFont={Adobe Heiti Std}, ItalicFont={Adobe Kaiti Std}]{Adobe Song Std} - \setCJKsansfont{Adobe Heiti Std} - \setCJKmonofont{Adobe Kaiti Std} - \setCJKfamilyfont{song}{Adobe Song Std} - \setCJKfamilyfont{hei}{Adobe Heiti Std} - \setCJKfamilyfont{fs}{Adobe Fangsong Std} - \setCJKfamilyfont{kai}{Adobe Kaiti Std} - \setCJKfamilyfont{li}{Adobe Kaiti Std} % todo: 用隶书字体代替 - \setCJKfamilyfont{you}{Adobe Kaiti Std} % todo: 用幼圆字体代替 +% 默认采用中易的四款 (宋,黑,楷,仿宋) 免费字体。本科生还需要隶书,需要手工 +% 修改 fontname.def 文件。缺少中文字体的 Linux 用户可以通过 fontname.def 文件定义字体。 +% \begin{macrocode} + \ifCTEX@nofonts + \input{fontname.def} + \fi \setmainfont{Times New Roman} \setsansfont{Arial} \setmonofont{Courier New} -% \end{macrocode} -% 对于 \LaTeX\ 和 PDF\LaTeX,调用 \pkg{CJK} 以及相关的包。注意:\pkg{CJKpunct} 必 -% 须放在 \pkg{CJKspace} 之前。 -% \begin{macrocode} \else - \RequirePackage{CJKutf8} - \RequirePackage{CJKnumb} - \ifthu@GBK % CJKpunct 在 UTF 下工作的不好。 - \IfFileExists{CJKpunct.sty}% - {\RequirePackage{CJKpunct}}% - {\ClassWarning{thuthesis}{no CJKpunct.sty availiable!}} - \fi \RequirePackage{CJKspace} % \end{macrocode} % arial 字体需要单独安装,如果不使用 arial 字体,可以用 helvet 字体 |\textsf| @@ -1299,15 +1217,6 @@ \fi % \end{macrocode} % -% 可拷贝的 PDF (\pkg{ccmap} 结合 \texttt{pdflatex} 和 \texttt{dvipdfmx} 使用) -% \begin{macrocode} -\ifthu@dvips\else - \ifthu@xetex\else - \RequirePackage{ccmap} - \fi -\fi -% \end{macrocode} -% % 定理类环境宏包,其中 \pkg{amsmath} 选项用来兼容 \AmSTeX{} 的宏包 % \begin{macrocode} \RequirePackage[amsmath,thmmarks,hyperref]{ntheorem} @@ -1353,23 +1262,13 @@ pdfborder=0 0 0} % \end{macrocode} % -% dvips 模式下网址断字有问题,加入这个包解决之。 +% dvips 模式下网址断字有问题,请手工加载 breakurl 这个宏包解决之。 % \changes{v4.4}{2008/05/12}{修复网址断字。} -% \begin{macrocode} -\ifthu@dvips - \RequirePackage{breakurl} -\fi -% \end{macrocode} +% \changes{v4.8}{2013/03/04}{dvips method is deprecated. We ask their users to load it manually.} % % 设置 url 样式,与上下文一致 % \begin{macrocode} \urlstyle{same} -% \end{macrocode} -% -% \pkg{hypernat} 让 \pkg{hyperref} 和 \pkg{natbib} 协调的工作。应该 -% 在 \pkg{natbib} 和 \pkg{hyperref} 之后加载,参看其文档。 -% \begin{macrocode} -\RequirePackage{hypernat} % % \end{macrocode} % @@ -1407,47 +1306,6 @@ % \subsubsection{字体} % \label{sec:font} % -% \begin{macro}{\song} -% \begin{macro}{\songti} -% \begin{macro}{\fs} -% \begin{macro}{\fangsong} -% \begin{macro}{\kai} -% \begin{macro}{\kaishu} -% \begin{macro}{\hei} -% \begin{macro}{\heiti} -% \begin{macro}{\li} -% \begin{macro}{\lishu} -% \begin{macro}{\you} -% \begin{macro}{\youyuan} -% 重定义字体命令 -% \begin{macrocode} -%<*cls> -\newcommand{\song}{\CJKfamily{song}} % 宋体 -\def\songti{\song} -\newcommand{\fs}{\CJKfamily{fs}} % 仿宋体 -\def\fangsong{\fs} -\newcommand{\kai}{\CJKfamily{kai}} % 楷体 -\def\kaishu{\kai} -\newcommand{\hei}{\CJKfamily{hei}} % 黑体 -\def\heiti{\hei} -\newcommand{\li}{\CJKfamily{li}} % 隶书 -\def\lishu{\li} -\newcommand{\you}{\CJKfamily{you}} % 幼圆 -\def\youyuan{\you} -% \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} -% % 重定义字号命令 % % Ref 1: @@ -1499,6 +1357,7 @@ % % 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。 % \begin{macrocode} +%<*cls> \newlength\thu@linespace \newcommand{\thu@choosefont}[2]{% \setlength{\thu@linespace}{#2*\real{#1}}% @@ -1584,6 +1443,7 @@ % \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}} @@ -1598,15 +1458,15 @@ \addtolength{\textwidth}{-6.4cm} \setlength{\topmargin}{2.8cm-1in} \setlength{\oddsidemargin}{3.2cm-1in} - \setlength{\footskip}{1.3cm} + \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}{1.5cm} - \setlength{\headsep}{0.5cm} + \setlength{\footskip}{0.6cm} + \setlength{\headsep}{0.2cm} \addtolength{\textheight}{-6cm} \fi \setlength{\evensidemargin}{\oddsidemargin} @@ -1633,6 +1493,7 @@ % \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}{本科页码用小五号字。} % \begin{macro}{\ps@thu@empty} % \begin{macro}{\ps@thu@plain} % \begin{macro}{\ps@thu@headings} @@ -1651,14 +1512,14 @@ \def\ps@thu@plain{% \let\@oddhead\@empty% \let\@evenhead\@empty% - \def\@oddfoot{\hfil\wuhao\thepage\hfil}% + \def\@oddfoot{\hfil\xiaowu\thepage\hfil}% \let\@evenfoot=\@oddfoot} \def\ps@thu@headings{% \def\@oddhead{\vbox to\headheight{% - \hb@xt@\textwidth{\hfill\wuhao\song\leftmark\ifthu@bachelor\relax\else\hfill\fi}% + \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\song% + \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}}} @@ -1678,27 +1539,10 @@ % % \subsubsection{段落} % \label{sec:paragraph} -% 用于中文段落缩进和正文版式 -% \begin{macrocode} -%<*cls> -\newlength\CJK@twochars -\ifxetex - \def\CJK@spaceChar{\Unicode{48}{7}} -\else - \ifthu@UTF - \def\CJK@spaceChar{\CJKchar{"080}{"080}} - \fi - \ifthu@GBK - \def\CJK@spaceChar{\CJKchar{"0A1}{"0A1}} - \fi -\fi -\def\CJKindent{% - \settowidth\CJK@twochars{\CJK@spaceChar\CJK@spaceChar}% - \parindent\CJK@twochars} -% \end{macrocode} % % 段落之间的竖直距离 % \begin{macrocode} +%<*cls> \setlength{\parskip}{0pt \@plus2pt \@minus0pt} % \end{macrocode} % @@ -1769,9 +1613,10 @@ \def\@makefnmark{\textsuperscript{\hbox{\normalfont\@thefnmark}}} \long\def\@makefntext#1{ \bgroup - \setbox\@tempboxa\hbox{% + \newbox\thu@tempboxa + \setbox\thu@tempboxa\hbox{% \hb@xt@ 2em{\@thefnmark\hss}} - \leftmargin\wd\@tempboxa + \leftmargin\wd\thu@tempboxa \rightmargin\z@ \linewidth \columnwidth \advance \linewidth -\leftmargin @@ -1779,7 +1624,7 @@ \footnotesize \@setpar{{\@@par}}% \leavevmode - \llap{\box\@tempboxa}% + \llap{\box\thu@tempboxa}% #1 \par\egroup} % @@ -1859,8 +1704,8 @@ % \changes{v2.6.2}{2006/06/17}{增加问题和猜想两个数学环境。} % \changes{v4.2}{2008/03/07}{调整证明环境的编号和结尾的方块。} % \begin{macrocode} -\theorembodyfont{\song\rmfamily} -\theoremheaderfont{\hei\rmfamily} +\theorembodyfont{\songti\rmfamily} +\theoremheaderfont{\heiti\rmfamily} % %<*cfg> % \theoremsymbol{\ensuremath{\blacksquare}} @@ -1925,13 +1770,13 @@ % \begin{macrocode} \let\old@tabular\@tabular \def\thu@tabular{\dawu[1.5]\old@tabular} -\DeclareCaptionLabelFormat{thu}{{\dawu[1.5]\song #1~\rmfamily #2}} +\DeclareCaptionLabelFormat{thu}{{\dawu[1.5]\songti #1~\rmfamily #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[subfloat]{labelformat=simple,font=thu,captionskip=6bp,nearskip=6bp,farskip=0bp,topadjust=0bp} +\captionsetup[sub]{font=thu,skip=6bp} \renewcommand{\thesubfigure}{(\alph{subfigure})} \renewcommand{\thesubtable}{(\alph{subtable})} % \renewcommand{\p@subfigure}{:} @@ -1973,11 +1818,11 @@ \renewcommand\tablename{表} \newcommand\CJKprepartname{第} \newcommand\CJKpartname{部分} -\newcommand\CJKthepart{\CJKnumber{\@arabic\c@part}} +\CTEXnumber{\thu@thepart}{\@arabic\c@part} +\newcommand\CJKthepart{\thu@thepart} \newcommand\CJKprechaptername{第} \newcommand\CJKchaptername{章} \newcommand\CJKthechapter{\@arabic\c@chapter} -%\newcommand\CJKthechapter{\CJKnumber{\@arabic\c@chapter}} \renewcommand\chaptername{\CJKprechaptername~\CJKthechapter~\CJKchaptername} \renewcommand\appendixname{附录} \ifthu@bachelor @@ -1990,8 +1835,11 @@ \let\CJK@todaysave=\today \def\CJK@todaysmall@short{\the\year 年 \the\month 月} \def\CJK@todaysmall{\CJK@todaysmall@short \the\day 日} -\def\CJK@todaybig@short{\CJKdigits{\the\year} 年 \CJKnumber{\the\month} 月} -\def\CJK@todaybig{\CJK@todaybig@short \CJKnumber{\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@today{\CJK@todaysmall} \renewcommand\today{\CJK@today} \newcommand\CJKtoday[1][1]{% @@ -2016,6 +1864,8 @@ % \begin{macro}{\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}{英文摘要标题要搞特殊化,ft!} @@ -2041,21 +1891,21 @@ \chaptermark{#1}% \@makechapterhead{#2}} \def\@makechapterhead#1{% - \vspace*{20bp}% + \ifthu@bachelor\vspace*{24bp}\else\vspace*{20bp}\fi% {\parindent \z@ \centering - \hei\csname thu@title@font\endcsname\ifthu@bachelor\xiaosan\else\sanhao[1]\fi + \csname thu@title@font\endcsname\heiti\ifthu@bachelor\xiaosan\else\sanhao[1]\fi \ifnum \c@secnumdepth >\m@ne \@chapapp\hskip1em \fi #1\par\nobreak - \vskip 24bp}} + \ifthu@bachelor\vskip 20bp\else\vskip 24bp\fi}} \def\@schapter#1{% \@makeschapterhead{#1} \@afterheading} \def\@makeschapterhead#1{% - \vspace*{20bp}% + \ifthu@bachelor\vspace*{30bp}\else\vspace*{20bp}\fi% {\parindent \z@ \centering - \hei\csname thu@title@font\endcsname\sanhao[1] + \csname thu@title@font\endcsname\heiti\sanhao[1] \ifthu@bachelor\xiaosan\else \def\@tempa{#1} \def\@tempb{\eabstractname} @@ -2063,7 +1913,7 @@ \fi \interlinepenalty\@M #1\par\nobreak - \vskip 24bp}} + \ifthu@bachelor\vskip 20bp\else\vskip 24bp\fi}} % \end{macrocode} % \end{macro} % @@ -2113,13 +1963,15 @@ % 一级节标题,例如: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 -20bp\else -24bp\fi\@plus -1ex \@minus -.2ex}% - {6bp \@plus .2ex}% - {\hei\csname thu@title@font\endcsname\sihao[1.429]}} + {\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} % @@ -2132,7 +1984,7 @@ \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}% {6bp \@plus .2ex}% - {\hei\csname thu@title@font\endcsname\ifthu@bachelor\xiaosi[1.667]\else\banxiaosi[1.538]\fi}} + {\csname thu@title@font\endcsname\heiti\ifthu@bachelor\xiaosi[1.667]\else\banxiaosi[1.538]\fi}} % \end{macrocode} % \end{macro} % @@ -2144,7 +1996,7 @@ \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {\ifthu@bachelor -12bp\else -16bp\fi\@plus -1ex \@minus -.2ex}% {6bp \@plus .2ex}% - {\hei\csname thu@title@font\endcsname\xiaosi[1.667]}} + {\csname thu@title@font\endcsname\heiti\xiaosi[1.667]}} % % \end{macrocode} % \end{macro} @@ -2182,7 +2034,7 @@ % \begin{macrocode} \renewcommand\tableofcontents{% \thu@chapter*[]{\contentsname} - \ifthu@bachelor\xiaosi[1.8]\else\xiaosi[1.5]\fi\@starttoc{toc}\normalsize} + \ifthu@bachelor\xiaosi[1.8]\else\xiaosi[1.65]\fi\@starttoc{toc}\normalsize} \ifthu@arialtoc \def\thu@toc@font{\sffamily} \fi @@ -2214,7 +2066,7 @@ \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip - {\hei\ifthu@bachelor\sffamily\else\csname thu@toc@font\endcsname\fi #1} % numberline is called here, and it uses \@tempdima + {\ifthu@bachelor\sffamily\else\csname thu@toc@font\endcsname\fi\heiti #1} % numberline is called here, and it uses \@tempdima \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill \nobreak{\normalfont\normalcolor #2}\par \penalty\@highpenalty @@ -2411,18 +2263,12 @@ % \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}{本科生关键字也用分号分割了。} % \begin{macrocode} %<*cfg> -\def\thu@ckeywords@separator{ - \ifthu@bachelor\hspace{1em} - \else - \ifthu@master\hspace{2em}\else;\fi - \fi} -\def\thu@ekeywords@separator{ - \ifthu@bachelor\hspace{1em} - \else - \ifthu@master\hspace{2em}\else;\fi - \fi} +\def\thu@ckeywords@separator{;} +\def\thu@ekeywords@separator{;} \def\thu@catalog@number@title{分类号} \def\thu@id@title{编号} \def\thu@title@sep{:} @@ -2436,8 +2282,6 @@ \def\thu@postdoctor@report@title{博士后研究报告} \def\thu@bachelor@subtitle{综合论文训练} \def\thu@bachelor@title@pre{题目} -\def\thu@department@title{系别} -\def\thu@major@title{专业} \def\thu@postdoctor@date@title{研究起止日期} \ifthu@postdoctor \def\thu@author@title{博士后姓名} @@ -2455,8 +2299,13 @@ \ifx\thu@secretlevel\thu@secretlevel@inner\relax\else ★\fi% \hspace{2em}\thu@secretyear\hspace{1em}年} \def\thu@apply{(申请清华大学\thu@cdegree 学位论文)} -\def\thu@department@title{培养单位} -\def\thu@major@title{学科} +\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 @@ -2495,7 +2344,8 @@ \ifthu@bachelor(涉密的学位论文在解密后应遵守此规定)\else (保密的论文在解密后应遵守此规定)\fi} \newcommand{\thu@authorsig}{\ifthu@bachelor 签\hskip1em名:\else 作者签名:\fi} \newcommand{\thu@teachersig}{导师签名:} -\newcommand{\thu@frontdate}{日\hspace{2em}期:} +\newcommand{\thu@frontdate}{% + 日\ifthu@bachelor\hspace{1em}\else\hspace{2em}\fi 期:} \newcommand{\thu@ckeywords@title}{关键词:} % % \end{macrocode} @@ -2513,6 +2363,8 @@ % \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}{本科生题目下划线长度自动适应字数。} % % \begin{macrocode} %<*cls> @@ -2530,19 +2382,19 @@ \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\hei - {\xiaochu\ziju{1em}\thu@schoolname}\par\vskip2cm - {\xiaoyi\ziju{1em}\thu@postdoctor@report@title}\par\vskip3cm + \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{1em}\thu@schoolname\par\vskip0.5em\CJK@todaysmall@short} + {\xiaosan[1.5]\ziju{1}\thu@schoolname\par\vskip0.5em\CJK@todaysmall@short} \end{center} \cleardoublepage \begin{center} \vspace*{2cm} - {\sihao\hei\thu@ctitle\par\thu@etitle}\par + {\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} @@ -2559,41 +2411,34 @@ \vskip2cm {\sihao\thu@postdoctor@date@title\hskip1em\underline\thu@postdoctordate} \end{center}} +\newcommand*{\getcmlength}[1]{\strip@pt\dimexpr0.035146\dimexpr#1\relax\relax} \newcommand{\thu@first@titlepage@other}{ \begin{center} \vspace*{-1.3cm} \parbox[b][2.4cm][t]{\textwidth}{% \ifthu@secret\hfill{\sihao\thu@secretlevel\thu@secret@content}\else\rule{1cm}{0cm}\fi} \ifthu@bachelor - \vskip0.2cm - {\ziju{10bp}\yihao\li\thu@schoolname} - \par\vskip1.2cm - {\ziju{18bp}\xiaochu\hei\thu@bachelor@subtitle} - \vskip2.5cm - \noindent\hei\xiaoer\thu@bachelor@title@pre\thu@title@sep + \vskip0.45cm + {\yihao\lishu\ziju{0.3846}\thu@schoolname} + \par\vskip1.5cm + {\xiaochu\heiti\ziju{0.5}\thu@bachelor@subtitle} + \vskip2.2cm + \noindent\heiti\xiaoer\thu@bachelor@title@pre\thu@title@sep \parbox[t]{12cm}{% - \setbox0=\hbox{{\yihao[1.55]\thu@ctitle}} - \begin{picture}(0,0)(0,0) - \setlength\unitlength{1cm} - \linethickness{1.3pt} - \put(0,-0.25){\line(1,0){12}} - \ifdim\wd0>12cm - \put(0,-1.68){\line(1,0){12}} - \fi - \end{picture}% - \ignorespaces\yihao[1.55]\thu@ctitle} %TODO: CJKulem.sty - \vskip1.55cm + \ignorespaces\yihao[1.55]% + \renewcommand{\CJKunderlinebasesep}{0.25cm}% + \renewcommand{\ULthickness}{1.3pt}% + \def\CJKunderlinecolor{}% + \CJKunderline*{\thu@ctitle}} + \vskip1.3cm \else + \vskip0.8cm \parbox[t][9cm][t]{\paperwidth-8cm}{ - \renewcommand{\baselinestretch}{1.5} + \renewcommand{\baselinestretch}{1.3} \begin{center} - \yihao[1.2]{\hei\sffamily\thu@ctitle}\par - \ifthu@master - \erhao[1.1] \textbf{\sffamily\thu@etitle}\par\vskip 5bp - \else % for doctor - \par\vskip 20bp - \fi - \xiaoer[1] \textrm{{\ziju{2bp}\thu@apply}} + \yihao[1.2]{\sffamily\heiti\thu@ctitle}\par + \par\vskip 18bp + \xiaoer[1] \textrm{\thu@apply} \end{center}} \fi % \end{macrocode} @@ -2608,7 +2453,7 @@ \ifthu@bachelor \vskip1cm \parbox[t][7.0cm][t]{\textwidth}{{\sanhao[1.8] - \hspace*{1.65cm}\fs + \hspace*{1.65cm}\fangsong \setlength{\thu@title@width}{4em} \setlength{\extrarowheight}{6pt} \ifxetex % todo: ugly codes @@ -2626,24 +2471,25 @@ \end{tabular} }} \else + \vskip 5bp \parbox[t][7.8cm][t]{\textwidth}{{\sanhao[1.5] - \begin{center}\fs - \setlength{\thu@title@width}{6em} + \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{3bp}\thu@cdepartment}\\ - \thu@put@title{\thu@major@title} & \thu@title@sep & {\ziju{3bp}\thu@cmajor}\\ - \thu@put@title{\thu@author@title} & \thu@title@sep & {\ziju{11bp}\thu@cauthor}\\ - \thu@put@title{\thu@supervisor@title} & \thu@title@sep & {\ziju{11bp}\thu@csupervisor}\\ + \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{11bp}\thu@cassosupervisor}\\ + \thu@put@title{\thu@assosuper@title} & \thu@title@sep & {\ziju{0.6875}\thu@cassosupervisor}\\ \fi \ifx\thu@ccosupervisor\@empty\else - \thu@put@title{\thu@cosuper@title} & \thu@title@sep & {\ziju{11bp}\thu@ccosupervisor}\\ + \thu@put@title{\thu@cosuper@title} & \thu@title@sep & {\ziju{0.6875}\thu@ccosupervisor}\\ \fi \end{tabular} \end{center}}} @@ -2651,20 +2497,34 @@ % \end{macrocode} % % 论文成文打印的日期,用三号宋体汉字,不用阿拉伯数字 +% 本科:论文成文打印的日期用阿拉伯数字,采用小四号宋体 % \changes{v4.4.3}{2008/06/09}{修改本科生论文封面日期格式以符合新样例。} % \begin{macrocode} \begin{center} - {\ifthu@bachelor\hskip-0.9cm\xiaosi\else\sanhao\fi \song \thu@cdate} + {\ifthu@bachelor\vskip-1.0cm\hskip-1.2cm\xiaosi\else\vskip-0.5cm\sanhao\fi \songti \thu@cdate} \end{center} \end{center}} % end of titlepage % \end{macrocode} % \end{macro} % % \begin{macro}{\thu@doctor@engcover} -% 博士论文英文封面部分。 +% 研究生论文英文封面部分。 % \changes{v4.2}{2008/01/23}{博士英文封面补充联合导师。} -% \begin{macrocode} -\newcommand{\thu@doctor@engcover}{% +% \changes{v4.7}{2011/11/28}{硕士生新增英文封面。} +% \begin{macrocode} +\newcommand{\thu@engcover}{% + \def\thu@master@art{Master of Arts} + \def\thu@master@sci{Master of Science} + \def\thu@doctor@phi{Doctor of Philosophy} + \newif\ifthu@professional + \thu@professionalfalse + \ifthu@master + \ifx\thu@edegree\thu@master@art\relax\else + \ifx\thu@edegree\thu@master@sci\relax\else + \thu@professionaltrue\fi\fi\fi + \ifthu@doctor + \ifx\thu@edegree\thu@doctor@phi\relax\else + \thu@professionaltrue\fi\fi \begin{center} \vspace*{0.2cm} \parbox[t][5.2cm][t]{\paperwidth-7.2cm}{ @@ -2672,26 +2532,38 @@ \begin{center} \erhao[1.1]\bfseries\sffamily\thu@etitle \end{center}} - \parbox[t][5.8cm][t]{\paperwidth-7.2cm}{ + \parbox[t][][t]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.3} \begin{center} - \sanhao Dissertation Submitted to\\ + \sanhao + \ifthu@master Thesis \else Dissertation \fi + Submitted to\\ {\bfseries Tsinghua University}\\ in partial fulfillment of the requirement\\ - for the degree of\\ + 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][3.6cm][b]{\paperwidth-7.2cm}{ + \parbox[t][][b]{\paperwidth-7.2cm}{ \renewcommand{\baselinestretch}{1.3} \begin{center} \sanhao\sffamily by\\[3bp] - \bfseries\thu@eauthor\\(~\thu@emajor~) + \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} - Dissertation Supervisor : & \thu@esupervisor\\ + \ifthu@master Thesis \else Dissertation \fi + Supervisor : & \thu@esupervisor\\ \ifx\thu@eassosupervisor\@empty \else Associate Supervisor : & \thu@eassosupervisor\\\fi \ifx\thu@ecosupervisor\@empty @@ -2711,15 +2583,15 @@ % 封面中论文授权部分。 % \begin{macrocode} \newcommand{\thu@authorization@mk}{% - \ifthu@bachelor\vspace*{-0.6cm}\else\vspace*{-0.1cm}\fi % shit code! - \begin{center}\erhao\hei\thu@authtitle\end{center} - \ifthu@bachelor\vskip\baselineskip\else\vskip18pt\sihao[2.03]\fi\par + \ifthu@bachelor\vspace*{0.5cm}\else\vspace*{0.72cm}\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\vskip1.0cm\else\vskip1.9cm\fi + \ifthu@bachelor\vskip0.7cm\else\vskip1.0cm\fi \ifthu@bachelor - \ifthu@bachelor\indent\else\noindent\fi\thu@authorsig\thu@underline\relax% - \thu@teachersig\thu@underline\relax\thu@frontdate\thu@underline\relax + \indent\mbox{\thu@authorsig\thu@underline\relax% + \thu@teachersig\thu@underline\relax\thu@frontdate\thu@underline\relax} \else \begingroup \parindent0pt\xiaosi @@ -2750,12 +2622,14 @@ % % \changes{v2.5}{2006/05/19}{本科论文评语位置调整。} % \changes{v3.0}{2007/05/12}{本科论文评语取消。} +% \changes{v4.7}{2011/11/28}{硕士论文也需要英文封面。} % -% 博士论文需要增加英文封面 +% 研究生论文需要增加英文封面 % \begin{macrocode} - \ifthu@doctor - \cleardoublepage\thu@doctor@engcover - \fi + \ifthu@bachelor\relax\else + \ifthu@postdoctor\relax\else + \cleardoublepage\thu@engcover + \fi\fi % \end{macrocode} % % 授权说明 @@ -2765,7 +2639,16 @@ % \begin{macrocode} \ifthu@postdoctor\relax\else% \ifthu@bachelor\clearpage\else\cleardoublepage\fi% - \thu@authorization@mk\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% + \fi \end{titlepage} % \end{macrocode} % @@ -2818,7 +2701,7 @@ % \changes{v4.4.2}{2008/06/05}{本科生格式中文关键词采用首行缩进且无悬挂缩进。} % \begin{macrocode} \vskip12bp - \setbox0=\hbox{{\hei\thu@ckeywords@title}} + \setbox0=\hbox{{\heiti\thu@ckeywords@title}} \ifthu@bachelor\indent\else\noindent\hangindent\wd0\hangafter1\fi \box0\thu@ckeywords % \end{macrocode} @@ -2844,9 +2727,10 @@ % \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 - \setbox0=\hbox{\textbf{Key words:\enskip}} + \setbox0=\hbox{\textbf{\ifthu@bachelor Keywords:\else Key words:\fi\enskip}} \ifthu@bachelor\indent\else\noindent\hangindent\wd0\hangafter1\fi \box0\thu@ekeywords} % @@ -3022,9 +2906,12 @@ % % 参考文献的正文部分用五号字。 % 行距采用固定值 16 磅,段前空 3 磅,段后空 0 磅。 +% 本科生要求固定行距 17pt,段前后间距 3pt。 % % \begin{macro}{\thudot} -% 研究生参考文献条目最后加点,而本科有不要。只好定义一个东西来拙劣地处理了, +% 研究生参考文献条目最后可加点,图书文献一般不加。 +% 本科生未作说明。 +% 只好定义一个东西来拙劣地处理了, % 本来这个命令通过 \texttt{@preamble} 命令放到 bib 文件中是最省事的,但是那 % 样的话很多人肯定不知道该怎么做了。 % \changes{v3.1}{2007/06/19}{引入 cs{thudot} 来自动完成参考文献最后的点。} @@ -3036,10 +2923,15 @@ % \begin{macro}{thuphdbib} % 本科生和研究生模板要求外文硕士论文参考文献显示``[Master Thesis]'',而博士模板 % 则于 2007 年冬要求显示为``[M]''。对应的外文博士论文参考文献分别显示为``[Phd -% Thesis]''和``[D]''。所以不得不出此下策。 +% Thesis]''和``[D]''。 +% 研究生写作指南(201109)要求: +% 中文硕士学位论文标注``[硕士学位论文]'', +% 中文博士学位论文标注``[博士学位论文]'',外文学位论文标注``[D]''。 +% 本科生写作指南未指定,参考文献著录格式文档中对中外文学位论文都标注``[D]''。 +% \changes{v4.7}{2012/05/29}{修改两个宏使其对应不同的中文论文需求。} % \begin{macrocode} -\def\thumasterbib{\ifthu@doctor [M]\else [Master Thesis]\fi} -\def\thuphdbib{\ifthu@doctor [D]\else [Doctor Thesis]\fi} +\def\thumasterbib{\ifthu@bachelor [D]\else [硕士学位论文]\fi} +\def\thuphdbib{\ifthu@bachelor [D]\else [博士学位论文]\fi} % \end{macrocode} % \end{macro} % \end{macro} @@ -3124,7 +3016,7 @@ \fi % %<*cls> -\newcommand{\resumeitem}[1]{\vspace{2.5em}{\sihao\hei\centerline{#1}}\par} +\newcommand{\resumeitem}[1]{\vspace{24pt}{\sihao\heiti\centerline{#1}}\par\vspace{6pt}} % % \end{macrocode} % \end{macro} @@ -3137,7 +3029,7 @@ % \begin{macrocode} %<*cls> \newcommand{\shuji}[1][\thu@ctitle]{ - \newpage\thispagestyle{empty}\ziju{0.4em}\fs\xiaosan + \newpage\thispagestyle{empty}\fangsong\xiaosan\ziju{0.4} \hfill\rotatebox{-90}{\hb@xt@ \textheight{#1\hfill\thu@cauthor}}} % % \end{macrocode} @@ -3175,20 +3067,12 @@ % \subsubsection{自定义命令和环境} % \label{sec:userdefine} % -% \begin{macro}{\ziju} -% 改变字距。参数为距离 -% \changes{v2.0}{2005/12/20}{字距改变,重定义 \cs{CJKglue} 即可。} -% \begin{macrocode} -%<*cls> -\newcommand*{\ziju}[1]{\renewcommand{\CJKglue}{\hskip #1}} -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\pozhehao} % 定义破折号。两个字宽,ex 差不多是当前字体的一半高度,所以通过 \cs{rule} 可以简单 % 的完成破折号绘制。 % \changes{v2.1}{2006/01/12}{稍微加宽一点。同时把名字改为\textbf{破折号}:\cs{pozhehao}} % \begin{macrocode} +%<*cls> \newcommand{\pozhehao}{\kern0.3ex\rule[0.8ex]{2em}{0.1ex}\kern0.3ex} % % \end{macrocode} @@ -3197,58 +3081,14 @@ % % \subsubsection{其它} % \label{sec:other} -% \begin{macro}{\thu@active@cjk} -% 在导言区支持中文。 -% \begin{macrocode} -%<*cls> -\def\thu@active@cjk{ - % Activate all >128 characters. - \count@=128 - \@whilenum\count@<254 \do{% - \advance\count@ by 1 - \lccode`\~=\count@ - \catcode\count@=\active - \lowercase{\def~{\kern1ex}}}} -% \end{macrocode} -% \end{macro} % % 在模板文档结束时即装入配置文件,这样用户就能在导言区进行相应的修改,否则 % 必须在 document 开始后才能,感觉不好。 % \changes{v2.5}{2006/05/13}{不用 \cs{CJKcaption},在导言区直接引入配置文件。} % \begin{macrocode} -\AtEndOfClass{\ifxetex\else\thu@active@cjk\fi\input{thuthesis.cfg}} -% \end{macrocode} -% -% \begin{macro}{\thu@fixselectfont} -% \pkg{caption} 宏包会调用 \pkg{ragged2e},\pkg{ragged2e} 又调用 \pkg{everysel}。而 \pkg{everysel} 宏包和 \pkg{CJK} -% 宏包都要修改 \cs{selectfont},一个是给 \cs{selectfont} 加 hook,一个是让 -% \cs{selectfont} 支持 \cs{CJKbold}。幸好两者本质上并不冲突,把他们源文件中对 -% \cs{selectfont} 重定义的部分合并一下就可以了。 -% \changes{4.3}{2008/03/09}{\pkg{caption} 调整了对 \pkg{ragged2e} 包的调用,所以 -% 我们这里要判断 \pkg{everysel} 是不是装载了。} -% \begin{macrocode} -\def\thu@fixselectfont{% - \ifx\@EverySelectfont@EveryHook\@undefined\else% everysel package is loaded - \DeclareRobustCommand{\selectfont}{% - \ifx\f@linespread\baselinestretch \else - \set@fontsize\baselinestretch\f@size\f@baselineskip \fi - \xdef\font@name{% - \csname\curr@fontshape/\f@size\endcsname}% - \pickup@font - \font@name - % CJK addition: - \CJK@bold@false - \csname \curr@fontshape\endcsname - % everysel addition: - \@EverySelectfont@EveryHook - \@EverySelectfont@AtNextHook - \gdef\@EverySelectfont@AtNextHook{}% - % end additions - \size@update - \enc@update} - \fi} +%<*cls> +\AtEndOfClass{\input{thuthesis.cfg}} % \end{macrocode} -% \end{macro} % % \begin{macro}{\thu@setup@pdfinfo} % 设置一些 pdf 文档信息,依赖于 \pkg{hyperref} 宏包。 @@ -3264,25 +3104,8 @@ % \end{macrocode} % \end{macro} % -% 把 CJK 环境放到合适的位置,以免导致其它宏包的命令位于 CJK 环境中而出现问题(比 -% 如 natbib 的``Multiple-defined labels'',同时自动开 -% 启 CJK。\changes{v2.6.2}{2006/06/18}{合理放置 CJK,避免 natbib 的警告。} -% \changes{v4.5}{2009/01/03}{XeTeX 模式下不需要。} +% 应用对列表环境的修改。 % \begin{macrocode} -\ifxetex - \AtBeginDocument{\CJKindent} -\else - \def\thu@beginCJK{% - \thu@fixselectfont% - \begin{CJK*}{UTF8}{song}\CJKindent} - \def\thu@endCJK{\clearpage\end{CJK*}} - \let\thu@begindocumenthook\@begindocumenthook - \let\thu@enddocumenthook\@enddocumenthook - \def\AtBeginDocument{\g@addto@macro\thu@begindocumenthook} - \def\AtEndDocument{\g@addto@macro\thu@enddocumenthook} - \def\@begindocumenthook{\thu@begindocumenthook\thu@beginCJK} - \def\@enddocumenthook{\thu@endCJK\thu@enddocumenthook} -\fi \AtEndOfClass{\sloppy\thu@item@space} % % \end{macrocode} @@ -3298,22 +3121,25 @@ \RequirePackage{array,longtable} \RequirePackage{fancybox,fancyvrb} \RequirePackage{xcolor} +\RequirePackage{ifxetex} -\RequirePackage{txfonts} -\RequirePackage{CJKutf8} -\newif\ifdtx@UTF\dtx@UTFtrue % todo: review this piece of code, why it needs an - % \iffalse in the comment? where is the real mis-match? -\ifdtx@UTF\else - \IfFileExists{CJKpunct.sty}% - {\RequirePackage{CJKpunct}}% - {\ClassWarning{thuthesis}{no CJKpunct.sty availiable!}} +\ifxetex + \RequirePackage[nofonts,UTF8,hyperref]{ctex} + \input{fontname.def} +\else + \RequirePackage[winfonts,UTF8,hyperref]{ctex} + \RequirePackage{txfonts} \fi -\RequirePackage{CJKspace} - \RequirePackage{hyperref} +\ifxetex + \hypersetup{% + CJKbookmarks=true} +\else + \hypersetup{% + unicode=true, + CJKbookmarks=false} +\fi \hypersetup{% - unicode=true, - CJKbookmarks=false, bookmarksnumbered=true, bookmarksopen=true, bookmarksopenlevel=1, @@ -3335,9 +3161,6 @@ \addtolength{\headsep}{0.3cm} \addtolength{\textheight}{2.3cm} -\newcommand\hei{\CJKfamily{hei}} -\newcommand\fs{\CJKfamily{fs}} - \renewcommand{\baselinestretch}{1.3} \setlength{\shadowsize}{3pt} \def\DescribeOption#1{\SpecialOptionIndex{#1}} @@ -3348,7 +3171,7 @@ \setlength\leftmargin{\labelwidth+\labelsep}% \addtolength{\itemsep}{3pt}% \renewcommand\makelabel[1]{% - \shadowbox{\color{blue!90}\texttt##1}\DescribeOption{##1}}} + \shadowbox{\color{blue!90}\sffamily ##1}\DescribeOption{##1}}} }{\endlist} \DefineVerbatimEnvironment{example}{Verbatim}% {frame=single,framerule=0.3mm,rulecolor=\color{red!75!green!50!blue},% @@ -3357,7 +3180,7 @@ \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}\fs #1}}\marginpar{\strut}\hskip\parindent} +\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}} @@ -3389,16 +3212,16 @@ \renewcommand\section{\@startsection{section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% - {\normalfont\Large\bfseries\hei}} + {\normalfont\Large\bfseries}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% - {\normalfont\large\bfseries\hei}} + {\normalfont\large\bfseries}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% - {\normalfont\normalsize\bfseries\hei}} + {\normalfont\normalsize\bfseries}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% @@ -3408,8 +3231,19 @@ {-1em}% {\normalfont\normalsize\bfseries}} \pagestyle{empty} +\MakeShortVerb{\|} +\def\pkg#1{\texttt{#1}} +\def\option#1{\textsf{#1}} +\def\file#1{\textsl{#1}} +\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} % % \end{macrocode} % \fi % \endinput +% \iffalse +% Local Variables: +% mode: doctex +% TeX-master: t +% End: +% \fi diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins b/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins index 7406ab69929..991cc29ccf7 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-2011 by Ruini Xue +%% Copyright (C) 2005-2014 by Ruini Xue %% %% This file is part of the ThuThesis package project. %% --------------------------------------------------- @@ -83,6 +83,7 @@ This is the configuration file of the thuthesis package with LaTeX2e. \Msg{*} \Msg{* \space\space thuthesis.cls} \Msg{* \space\space thuthesis.cfg} +\Msg{* \space\space fontname.def} \Msg{*} \Msg{* To produce the documentation run the files ending with} \Msg{* `.dtx' through LaTeX.} -- cgit v1.2.3