From 4d5ecf8fcf4e6667025feb557ddbb30c9f671c7a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 11 Jan 2016 22:12:17 +0000 Subject: thuthesis (11jan16) git-svn-id: svn://tug.org/texlive/trunk@39351 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/thuthesis/thuthesis.dtx | 1190 +++++++++++--------- .../source/latex/thuthesis/thuthesis.ins | 4 +- 2 files changed, 656 insertions(+), 538 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 8026578ca4a..36d8e1fdaf3 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-2015 by Ruini Xue +% Copyright (C) 2005-2016 by Ruini Xue % % This file may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3a @@ -14,16 +14,17 @@ % % \fi % -% \CheckSum{0} -% % \iffalse %<*driver> -\ProvidesFile{thuthesis.dtx}[2015/12/27 5.1.0 Tsinghua University Thesis Template] +\def\thudate{\the\year/\the\month/\the\day} +\def\thuversion{5.2.0} +\ProvidesFile{thuthesis.dtx}[{\thudate} {\thuversion} Tsinghua University Thesis Template] \documentclass{ltxdoc} - \usepackage{dtx-style} -\AtBeginDocument{\RecordChanges\CodelineIndex\EnableCrossrefs} +\EnableCrossrefs +\CodelineIndex +\RecordChanges \begin{document} \DocInput{\jobname.dtx} @@ -31,28 +32,67 @@ % % \fi % +% \CheckSum{0} +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \DoNotIndex{\newenvironment,\@bsphack,\@empty,\@esphack,\sfcode} +% \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter} +% \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection} +% \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter} +% \DoNotIndex{\RequirePackage,\setcounter,\setlength,\string,\strut} +% \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage} +% \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\} +% \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} +% \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand} +% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect} +% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize} +% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny} +% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty} +% \DoNotIndex{\textbf,\textit,\textsf,\textsc} +% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad} +% \DoNotIndex{\centering,\raggedright,\ref} +% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize} +% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne} +% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass} +% \DoNotIndex{\AtBeginDocument,\AtEndDocument} +% % \GetFileInfo{\jobname.dtx} % -% \changes{v1.0-}{2005/07/06}{Please refer to ``Bao--Pan'' version.} +% \changes{v1.0}{2005/07/06}{Please refer to ``Bao--Pan'' version.} % \changes{v1.1}{2005/11/03}{Initial version, migrate from the old ``Bao--Pan'' % version. Make the template a class instead of package.} -% \changes{v1.2}{2005/11/04}{Remove \pkg{fancyref}; Remove \pkg{ucite} and implement -% \cs{onlinecite}; use package \pkg{arial} or \pkg{helvet} selectively.} -% \changes{v1.3}{2005/11/14}{Replace \pkg{subfigure} with \pkg{subfig}, replace \pkg{caption2} -% with \pkg{caption}, add details about using figure are in the example.} +% \changes{v1.2}{2005/11/04}{Remove \pkg*{fancyref}; Remove \pkg*{ucite} and implement +% \cs{onlinecite}; use package \pkg*{arial} or \pkg*{helvet} selectively.} +% \changes{v1.3}{2005/11/14}{Replace \pkg*{subfigure} with \pkg*{subfig}, replace \pkg*{caption2} +% with \pkg*{caption}, add details about using figure are in the example.} % \changes{v1.4rc1}{2005/11/20}{I do not know why \cs{thu@authorizationaddon} does not work % now for v1.3, while it's fine in v1.2. Temporarily, I remove the directive -% :(. There might be better solution. Other changes: add \textsf{config} option to -% subfig to be compatible with subfigure. add \pkg{courier} package for tt font.} +% :(. There might be better solution. Other changes: add \option{config} option to +% subfig to be compatible with subfigure. add \pkg*{courier} package for tt font.} % \changes{v1.4}{2005/12/05}{Fix the problem of \textbf{chinese}, which is % because both CJK and everysel redefine the \cs{selectfont}. So, a not so good -% workaround is merge them up. Add \file{shuji} example. Add \cs{pozhehao} command.} +% workaround is merge them up. Add \file*{shuji.tex} example. Add \cs{pozhehao} command.} % \changes{v2.1}{2006/02/27}{Add support to bachelor thesis.} -% \changes{v2.1}{2006/03/01}{Remove \pkg{fancyhdr} and \pkg{geometry}.} +% \changes{v2.1}{2006/03/01}{Remove \pkg*{fancyhdr} and \pkg*{geometry}.} % \changes{v2.1}{2006/03/01}{Redefine footnote marks.} -% \changes{v2.1}{2006/03/01}{Replace \file{thubib.bst} with \file{chinesebst.bst}.} -% \changes{v2.1}{2006/03/02}{Merge the modification of \pkg{ntheorem}.} -% \changes{v2.1}{2006/03/02}{Remove \pkg{footmisc} and refine the document.} +% \changes{v2.1}{2006/03/01}{Replace \file*{thubib.bst} with \file*{chinesebst.bst}.} +% \changes{v2.1}{2006/03/02}{Merge the modification of \pkg*{ntheorem}.} +% \changes{v2.1}{2006/03/02}{Remove \pkg*{footmisc} and refine the document.} % \changes{v2.1}{2006/03/03}{Work very hard on the document.} % \changes{v2.1}{2006/03/03}{Add \cs{checklab} code to reduce ``unresolved labels'' warning} % \changes{v2.2}{2006/03/26}{Adjust margins. How bad it is to simulate MS WORD!.} @@ -74,7 +114,7 @@ % \changes{v2.4}{2006/04/14}{自动隐藏密级为内部时后面的五角星。} % \changes{v2.4}{2006/04/14}{增加“注释 (Remark)”环境。} % \changes{v2.4}{2006/04/14}{压缩 item 之间的距离。} -% \changes{v2.4}{2006/04/14}{thubib.bst 文献标题取消自动小写。} +% \changes{v2.4}{2006/04/14}{\file*{thubib.bst} 文献标题取消自动小写。} % \changes{v2.4}{2006/04/14}{中文参考文献取消 In: Proceedings。} % \changes{v2.4}{2006/04/14}{英文文参考文献调整 In: editor, Proceedings。} % \changes{v2.4}{2006/04/14}{参考文献为学位论文时,加方括号,作者后面为实心点。} @@ -90,41 +130,25 @@ % \changes{v2.5}{2006/05/19}{重新整理代码,使其布局更易读。} % \changes{v2.5.1}{2006/05/24}{根据教务处的新要求调整附录部分。} % \changes{v2.5.1}{2006/05/25}{参考文献中杂志文章如果没有卷号,那么页码直接跟在 -% 年份后面,并用句点分割。在 \file{thubib.bst} 中增加 output.year 函数。} -% \changes{v2.6.1}{2006/06/16}{取消 \file{thubib.bst} 中 inbook 类 volume 后的页 +% 年份后面,并用句点分割。在 \file*{thubib.bst} 中增加 output.year 函数。} +% \changes{v2.6.1}{2006/06/16}{取消 \file*{thubib.bst} 中 inbook 类 volume 后的页 % 码。} % \changes{v3.0}{2007/05/12}{没有了综合论文训练页面,很多本科论文专用命令就消失了。} % \changes{v4.4}{2008/05/12}{修复网址断字。} -% \changes{v4.5}{2008/01/03}{加入 XeTeX 支持,需要 \pkg{xeCJK}。} +% \changes{v4.5}{2008/01/03}{加入 XeTeX 支持,需要 \pkg*{xeCJK}。} % \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.7}{2012/06/12}{去掉 \pkg*{hypernat} 依赖,\pkg*{hyperref} 和 \pkg*{natbib} 可以很好配合了。} % \changes{v4.8}{2013/03/04}{dvips method is deprecated. We ask their users to load it manually.} % \changes{v4.8}{2014/11/25}{好几年累积的一些更新,最重要的是切换到 \CTeX。} % -% \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\} -% \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi} -% \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand} -% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect} -% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize} -% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny} -% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty} -% \DoNotIndex{\textbf,\textit,\textsf,\textsc} -% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad} -% \DoNotIndex{\centering,\raggedright,\ref,\} -% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize} -% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne} -% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass} -% \DoNotIndex{\AtBeginDocument,\AtEndDocument} -% -% \IndexPrologue{\section*{索引}% -% \addcontentsline{toc}{section}{索引}} -% \GlossaryPrologue{\section*{修改记录}% -% \addcontentsline{toc}{section}{修改记录}} -% +% \def\indexname{索引} +% \def\glossaryname{修改记录} +% \IndexPrologue{\section{\indexname}} +% \GlossaryPrologue{\section{\glossaryname}} % -% \title{\bfseries\thuthesis:清华大学学位论文模板\thanks{\textbf{T}sing\textbf{h}ua \textbf{U}niversity \LaTeX{} \textbf{Thesis} Template.}} +% \title{\bfseries\color{violet}\thuthesis:清华大学学位论文模板\thanks{\textbf{T}sing\textbf{h}ua \textbf{U}niversity \LaTeX{} \textbf{Thesis} Template.}} % \author{{\fangsong 薛瑞尼\thanks{LittleLeo@newsmth}}\\[5pt] \texttt{xueruini@gmail.com}} % \date{v\fileversion\ (\filedate)} % \maketitle\thispagestyle{empty} @@ -201,11 +225,11 @@ % % \begin{center} % \begin{longtable}{l|p{8cm}} -% \hline -% {\heiti 文件(夹)} & {\heiti 功能描述}\\\hline\hline +% \toprule +% {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule % \endfirsthead % \hline -% {\heiti 文件(夹)} & {\heiti 功能描述}\\\hline\hline +% {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule % \endhead % \endfoot % \endlastfoot @@ -214,27 +238,28 @@ % thuthesis.cls & 模板类文件\\ % thuthesis.cfg & 模板配置文件\\ % ctex-fontset-thuthesis.def & 中文字体配置文件\\ -% thuthesis.bst & 参考文献样式文件\\\hline +% thuthesis.bst & 参考文献样式文件\\\midrule % main.tex & 示例文档主文件\\ % shuji.tex & 书脊示例文档\\ % ref/ & 示例文档参考文献目录\\ % data/ & 示例文档章节具体内容\\ % figures/ & 示例文档图片路径\\ -% thuthesis.sty & 为示例文档加载其它宏包\\\hline -% Makefile & self-explanation\\ +% thuthesis.sty & 为示例文档加载其它宏包\\\midrule +% Makefile & Makefile\\ % latexmkrc & latexmk 配置文件 \\ % zhfonts.py & 生成中文字体配置文件\\ % README.md & Readme\\ -% \textbf{thuthesis.pdf} & 用户手册(本文档)\\\hline +% \textbf{thuthesis.pdf} & 用户手册(本文档)\\\bottomrule % \end{longtable} % \end{center} % +% \vskip-1cm % 几点说明: % \begin{itemize} % \item \file{thuthesis.cls} 和 \file{thuthesis.cfg} 可以由 \file{thuthesis.ins} % 和 \file{thuthesis.dtx} 生成,但为了降低新手用户的使用难度,故 % 将 \file{thuthesis.cls} 和 \file{thuthesis.cfg} 文件一起发布。 -% \item 使用前阅读文档:\file{thuthesis.pdf}. +% \item 使用前阅读文档:\file{thuthesis.pdf}。 % \end{itemize} % % \subsection{准备工作} @@ -253,10 +278,10 @@ % 模板解压缩后生成文件夹 \file{thuthesis-VERSION}\footnote{VERSION 为版本号。}, % 其中包括:模板源文件(\file{thuthesis.ins} 和 \file{thuthesis.dtx}),参考文献 % 样式 \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{main.tex},\file{shuji.tex},\file{thuthesis.sty}\footnote{可能用到的包 +% 以及一些命令定义都放在这里,以免 \file{thuthesis.cls} 过分臃 +% 肿。},\file{ctex-fontset-thuthesis.def}\footnote{Xe\LaTeX 中文字体配置文 +% 件。},\file{data/} 和 \file{figures/} 和 \file{ref/})。在使用之前需要先生成模 % 板文件和配置文件(具体命令细节请参考 \file{README.md} 和 \file{Makefile}): % % \begin{shell} @@ -275,8 +300,8 @@ % \subsubsection{xelatex} % \label{sec:xelatex} % 很多用户对 \LaTeX{} 命令执行的次数不太清楚,一个基本的原则是多次运行 \LaTeX{}命 -% 令直至不再出现警告。下面给出生成示例文档的详细过程(\# 开头的行为注释),首先来 -% 看推荐的 \texttt{xelatex} 方式: +% 令直至不再出现警告。下面给出生成示例文档的详细过程(\texttt{\#} 开头的行为注 +% 释),首先来看推荐的 \texttt{xelatex} 方式: % \begin{shell} % # 1. 发现里面的引用关系,文件后缀 .tex 可以省略 % $ xelatex main @@ -289,11 +314,11 @@ % $ 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} 节。 +% 制中文字体和标点压缩。模板里默认用的是中易的六款免费字体(宋,黑,楷,仿宋,隶 +% 书和幼圆),因学位论文需求不建议替换为其他字体。如果实在必要,可以通过定 +% 制\file{ctex-fontset-thuthesis.def} 文件中的字体自行替换。研究生一般用不到隶书 +% 和幼圆字体,如果系统上没有它们,可以直接将 \file{ctex-fontset-thuthesis.def} 文 +% 件以及论文中相应行删除。字体配置参考第~\ref{sec:font-config} 节。 % % \subsubsection{dvipdfmx} % \label{sec:dvipdfmx} @@ -328,10 +353,10 @@ % $ latexmk -xelatex main % \end{shell} % -% \subsubsection{自动化过程} -% \label{sec:automation} +% \subsubsection{make} +% \label{sec:make} % 上面的例子只是给出一般情况下的使用方法。虽然命令很简单,但是每次都输入的话还是 -% 非常罗嗦的,所以 \thuthesis{} 还提供了一个简单的 \file{Makefile}: +% 非常罗嗦的,所以 \thuthesis{} 提供了一个 \file{Makefile}: % % \begin{shell} % $ make clean @@ -358,7 +383,7 @@ % \end{shell} % % 生成新的类文件和配置文件即可。也可以直接拷 -% 贝 \file{thuthesis.cls},\file{thuthesis.cfg}和 \file{thuthesis.bst},免去上面命令 +% 贝 \file{thuthesis.cls},\file{thuthesis.cfg} 和 \file{thuthesis.bst},免去上面命令 % 的执行。 % % @@ -387,122 +412,68 @@ % 中章节的组织形式,来自于示例文档,具体内容可以参考模板附带 % 的 \file{main.tex} 和 \file{data/}。 % -% \begin{example} -% \documentclass[type=bachelor]{thuthesis} -% % \documentclass[% -% % type=[bachelor|master|doctor|postdoctor], % 必选项 -% % secret, % 可选项 -% % openany|openright, % 可选项 -% % arialtoc,arialtitle % 可选项 -% % ]{thuthesis} -% -% % 所有其它可能用到的包都统一放到这里了,可以根据自己的实际添加或者删除。 -% \usepackage{thuthesis} -% -% % 指定图片的搜索目录 -% \graphicspath{{figures/}} -% -% % 可以在这里修改配置文件中的定义,导言区可以使用中文。 -% % \def\myname{薛瑞尼} -% -% \begin{document} -% -% %%% 封面部分 -% \frontmatter -% \input{data/cover} -% % 如果使用授权说明扫描页,将可选参数中指定为扫描得到的 PDF 文件名,例如: -% % \makecover[scan-auth.pdf] -% \makecover -% -% % 目录 -% \tableofcontents -% -% % 符号对照表 -% \input{data/denotation} -% -% %%% 正文部分 -% \mainmatter -% \include{data/chap01} -% \include{data/chap02} -% -% %%% 其它部分 -% \backmatter -% % 插图索引 -% \listoffigures -% % 表格索引 -% \listoftables -% % 公式索引 -% \listofequations -% -% % 参考文献 -% % 注意:至少需要引用一篇参考文献,否则下面两行可能引起编译错误。 -% % 如果不需要参考文献,请将下面两行删除或注释掉。 -% \bibliographystyle{thuthesis} -% \bibliography{ref/refs} -% -% % 致谢 -% \include{data/ack} -% -% % 附录 -% \begin{appendix} -% \input{data/appendix01} -% \end{appendix} -% -% % 个人简历 -% \include{data/resume} -% -% \end{document} -% \end{example} +% \lstinputlisting[style=lstStyleLaTeX]{main.tex} % % \subsection{论文选项} % \label{sec:option} % 本模板提供了一些选项以方便使用: -% \begin{options} -% \changes{v5.0.0}{2015/12/13}{使用 \pkg{kvoptions} 简化选项 type。} -% \item[type] +% +% \changes{v5.0.0}{2015/12/13}{使用 \pkg*{kvoptions} 简化选项 type。} +% \DescribeOption{type} % 选择论文类型,当前支 % 持:\option{bachelor},\option{master},\option{doctor},\option{postdoctor}。 % 为必选项。 -% \begin{example} +% \begin{latex} +% % 博士论文 % \documentclass[type=doctor]{thuthesis} -% \end{example} -% -% \item[secret] -% 涉秘论文开关(默认:关闭)。配合另外两个命 -% 令 \cs{secretlevel} 和 \cs{secretyear} 分别用来指定保密级别和时间。二者默认分 -% 别为\textbf{秘密}和当前年份。可以通 -% 过:|\secretlevel{绝密}| 和 |\secretyear{1984}| 修改。 -% \begin{example} +% +% % 硕士论文 +% \documentclass[type=master]{thuthesis} +% \end{latex} +% +% \DescribeOption{secret} +% 涉秘论文开关(默认:关闭)。第 \ref{sec:setup-secret} 节两个配置(或命 +% 令)\cs{secretlevel}\marg{级别} 和 \cs{secretyear}\marg{年份} 分别用来指定保 +% 密级别和时间。若不设置,则二者取默认值,分别为“\textbf{秘密}”和当前年份。 +% \begin{latex} % \documentclass[secret]{thuthesis} % 打开保密 % \documentclass[secret=false]{thuthesis} % 关闭保密 -% \end{example} +% +% \thusetup{ +% secretlevel=公开, +% secretyear=2020 +% } +% % 或者 +% \secretlevel{保密} +% \secretyear{2020} +% \end{latex} % % \changes{v3.0}{2007/05/12}{不用专门为本科论文生成\textbf{提交}版本了。} % -% \item[openany, openright] -% 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{openright}, -% 也是 \thuthesis\ 的默认选项。在这种情况下,如果前一章的最后一页也是奇数,那么 -% 模板会自动生成一个纯粹的空白页,很多人不是很习惯这种方式,而且学校的格式似乎 -% 更倾向于页面连续,那就是通常所说的 \option{openany}。\footnote{目前所有论文 -% 都是 \option{openany}。}这两个选项不用设置,\thuthesis{} 会根据当前论文类 -% 型自动选择。 -% -% \item[arial] -% 使用真正的 \emph{Arial} 字体。此选项会装载 \pkg{Arial} 字体宏包,如果此宏包 -% 不存在,就装 -% 载 \pkg{Helvet}。\option{arialtoc} 和 \option{arialtitle} 不受 -% \option{arial} 选项的影响。因为一般的 \TeX{} 发行都没有 \emph{Arial} 字体,所以默 -% 认采用 \pkg{Helvet},二者效果非常相似。如果一定要用 \emph{Arial} 字体,请参 -% 看:\href{http://www.mail-archive.com/ctan-ann@dante.de/msg00627.html}{Arial -% 字体}。 -% -% \item[arialtoc] -% 目录项(章目录项除外)中的英文是否用 \emph{Arial} 字体。本选项 -% 和 \option{arialtitle} 都不用用户干预,模板根据当前论文类型自动设置。 -% -% \item[arialtitle] -% 章节标题中英文是否用 \emph{Arial} 字体(默认打开)。 -% \end{options} +% \DescribeOption{openany} +% \DescribeOption{openright} +% 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{openright},也 +% 是 \thuthesis\ 的默认选项。在这种情况下,如果前一章的最后一页也是奇数,那么模板 +% 会自动生成一个纯粹的空白页,很多人不是很习惯这种方式,而且学校的格式似乎更倾向 +% 于页面连续,那就是通常所说的 \option{openany}。\footnote{目前所有论文都 +% 是 \option{openany}。}这两个选项不用设置,\thuthesis{} 会根据当前论文类型自动选 +% 择。 +% +% \DescribeOption{arial} +% 使用真正的 \emph{Arial} 字体。此选项会装载 \pkg{Arial} 字体宏包,如果不存 +% 在,就装 +% 载 \pkg{Helvet}。\option{arialtoc} 和 \option{arialtitle} 不受 \option{arial} +% 选项的影响。因为一般的 \TeX{} 发行都没有 \emph{Arial} 字体,所以默认采 +% 用 \pkg{Helvet},二者效果非常相似。如果一定要用 \emph{Arial} 字体,请参 +% 看:\href{http://www.mail-archive.com/ctan-ann@dante.de/msg00627.html}{Arial字 +% 体}。 +% +% \DescribeOption{arialtoc} +% 目录项(章目录项除外)中的英文是否用 \emph{Arial} 字体。本选项 +% 和 \option{arialtitle} 都不用用户干预,模板根据当前论文类型自动设置。 +% +% \DescribeOption{arialtitle} +% 章节标题中英文是否用 \emph{Arial} 字体(默认打开)。 % % \subsection{中文字体} % \label{sec:chinese-fonts} @@ -519,7 +490,8 @@ % (自包含安装方法),请用户自行下载安装,此处不再赘述。本模板推荐使用第二种方法, % 只要把所需字体放入系统字体文件夹(也可以指定自定义文件夹)即可。用户可以使用 % \file{ctex-fontset-thuthesis.def} 文件配置所需字体。使用中易六种字体的配置如下: -% \begin{example} +% +% \begin{latex} % \ProvidesFile{ctex-fontset-thuthesis.def} % % \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} @@ -538,14 +510,15 @@ % \newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋 % \newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书 % \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆 -% \end{example} +% \end{latex} % -% 对 Windows XP 来说如下,|KaiTi| 需要替换为 |KaiTi_GB2312|,|FangSong| 需要替换 -% 为 |FangSong_GB2312|。 +% 对 Windows XP 来说如下,\texttt{KaiTi} 需要替换为 +% \texttt{KaiTi\_GB2312},\texttt{FangSong} 需要替换 +% 为 \texttt{FangSong\_GB2312}。 % -% 研究生一般用不到隶书和幼圆字体。如果系统中没有导致报错,可以将 -% \file{ctex-fontset-thuthesis.def} 文件中 \texttt{zhli} 和 \texttt{zhyou} 相应行删除,并将论文 \file{.tex} 文件 -% 中引用 \cs{lishu} 和 \cs{youyuan} 的文字删除。 +% 研究生一般用不到隶书和幼圆字体。如果系统中没有导致报错,可以 +% 将\file{ctex-fontset-thuthesis.def} 文件中 \texttt{zhli} 和 \texttt{zhyou} 相应 +% 行删除,并将论文中引用 \cs{lishu} 和 \cs{youyuan} 的文字删除。 % % 宏包中包含了 \file{zhfonts.py} 脚本,为 Linux/Mac 用户提供一种交互式的方式从系 % 统中文字体中选择合适的六种字体,最终生成对应 @@ -569,7 +542,7 @@ % \DescribeMacro{\youyuan} % 用来切换宋体、仿宋、黑体、楷体、隶书和幼圆字体。 % -% \begin{example} +% \begin{latex} % {\songti 乾:元,亨,利贞} % {\fangsong 初九,潜龙勿用} % {\heiti 九二,见龙在田,利见大人} @@ -578,28 +551,29 @@ % {\heiti 九五,飞龙在天,利见大人} % {\songti 上九,亢龙有悔} % {\youyuan 用九,见群龙无首,吉} -% \end{example} +% \end{latex} % % \myentry{字号} % \DescribeMacro{\chuhao} +% \DescribeMacro{\bahao} % 等命令定义一组字体大小,分别为: % % \begin{center} % \begin{tabular}{llllll} -% \hline +% \toprule % \cs{chuhao} & \cs{xiaochu} & \cs{yihao} & \cs{xiaoyi} & \cs{erhao} & \cs{xiaoer}\\ % \cs{sanhao} & \cs{xiaosan} & \cs{sihao} & \cs{banxiaosi} & \cs{xiaosi} & \cs{dawu}\\ -% \cs{wuhao} & \cs{xiaowu} & \cs{liuhao} & \cs{xiaoliu} & \cs{qihao} & \cs{bahao}\\\hline +% \cs{wuhao} & \cs{xiaowu} & \cs{liuhao} & \cs{xiaoliu} & \cs{qihao} & \cs{bahao}\\\bottomrule % \end{tabular} % \end{center} % % 使用方法为:\cs{command}\oarg{num},其中 command 为字号命令,num 为行距。比 -% 如 |\xiaosi[1.5]| 表示选择小四字体,行距 1.5 倍。写作指南要求表格中的字体 +% 如 \cs{xiaosi}[1.5] 表示选择小四字体,行距 1.5 倍。写作指南要求表格中的字体 % 是 \cs{dawu},模板已经设置好了。 % -% \begin{example} +% \begin{latex} % {\erhao 二号 \sanhao 三号 \sihao 四号 \qihao 七号} -% \end{example} +% \end{latex} % % 也可以使用 \CTeX\ 定义的 \cs{zihao}\marg{num} 来切换字号,具体用法参看其文 % 档。 @@ -608,12 +582,12 @@ % \label{sec:titlepage} % 封面信息提供两种配置方法:一是通过统一设置命 % 令 \cs{thusetup} 通过\emph{key=value} 形式完成;二是每个信息利用命令独立设置, -% 其中命令的名字跟 |key| 相同。两种方式可以交叉使用,并按顺序执行(即后来的设置会覆 +% 其中命令的名字跟 \emph{key} 相同。两种方式可以交叉使用,并按顺序执行(即后来的设置会覆 % 盖前面的)。以 \texttt{c} 开头的命令跟中文相关,\texttt{e} 开头则为对应的英文。 % % \DescribeMacro{\thusetup} % 用法与常见 \emph{key=value} 命令相同,如下: -% \begin{example} +% \begin{latex} % \thusetup{ % key1 = value1, % key2 = {a value, with comma}, @@ -623,7 +597,7 @@ % key3 = value3, % key1 = value11, % 覆盖 value1 % } -% \end{example} +% \end{latex} % % \note{\cs{thusetup} 使用 \pkg{kvoptions} 机制,所以配置项之间不能有空行,否则 % 会报错。} @@ -632,24 +606,26 @@ % 在示例文档的 \file{data/cover.tex} 中。 % % \subsubsection{密级} +% \label{sec:setup-secret} % \DescribeMacro{\secretlevel} % \DescribeMacro{\secretyear} % 定义秘密级别和年限,需要打开论文的 \option{secret} 选项。 -% \begin{example} +% \begin{latex} % \thusetup{ % secretyear=2020, -% secretlevel=内部, +% secretlevel={内部}, % } % % 以下命令方式与上面的等价: % \secretyear{2020} % \secretlevel{内部} -% \end{example} +% \end{latex} % % \subsubsection{博士后专用参数} -% \DescribeMacro{\catalognumber} -% \DescribeMacro{\udc} % \DescribeMacro{\id} -% \begin{example} +% \DescribeMacro{\udc} +% \DescribeMacro{\catalognumber} +% 只见过,没用过,不知道具体是什么意思。 +% \begin{latex} % \thusetup{ % catalognumber={分类号}, % udc={udc}, @@ -659,12 +635,13 @@ % \catalognumber{分类号} % \udc{udc} % \id{编号} -% \end{example} +% \end{latex} % % \subsubsection{论文标题} % \DescribeMacro{\ctitle} % \DescribeMacro{\etitle} -% \begin{example} +% 中英文标题。可以在标题内部使用换行|\\|。 +% \begin{latex} % \thusetup{ % ctitle={论文中文题目}, % etitle={Thesis English Title} @@ -672,12 +649,13 @@ % % 等价命令形式: % \ctitle{论文中文题目} % \etitle{Thesis English Title} -% \end{example} +% \end{latex} % % \subsubsection{作者姓名} % \DescribeMacro{\cauthor} % \DescribeMacro{\eauthor} -% \begin{example} +% 作者姓名。 +% \begin{latex} % \thusetup{ % cauthor={中文姓名}, % eauthor={Name in Pinyin} @@ -685,12 +663,34 @@ % % 等价: % \cauthor{中文姓名} % \eauthor{Name in PinYin} -% \end{example} +% \end{latex} % % \subsubsection{申请学位名称} +% \label{sec:degree} % \DescribeMacro{\cdegree} % \DescribeMacro{\edegree} -% \begin{example} +% 学位和专业的设置比想象的要复杂一些: +% +% \begin{center} +% \begin{longtable}{p{2cm}p{8cm}p{4cm}} +% \toprule +% 学位类型 & edegree & emajor \\\midrule +% 学术型硕士 +% & 必须为“Master of Art”或“Master of Science”(注意大 +% 小写),其中 “哲学、文学、历史学、法学、教育学、艺术学门类,公共 +% 管理学科填写“Master of Arts”,其它填写“Master of Science”。 +% & “获得一级学科授权的学科填写一级学科名称,其它填写二级学 +% 科名称”。\\\midrule +% 专业型硕士 +% & 专业学位英文名称全称 & % 工程硕士填写工程领域,其它专业学位不填写此项。\\\midrule +% 学术型博士 & Doctor of Philosophy(注意大小写) +% & 获得一级学科授权的学科填写一级学科名称,其它填写二级学科名称。\\\midrule +% 专业型博士 & 专业学位英文名称全称 & 不填写此项。\\\bottomrule +% \end{longtable} +% \end{center} +% +% \vskip-0.7cm +% \begin{latex} % \thusetup{ % cdegree={您要申请什么学位}, % edegree={degree in English} @@ -698,28 +698,27 @@ % % 等价: % \cdegree{您要申请什么学位} % \edegree{degree in English} -% \end{example} +% \end{latex} % % \subsubsection{院系名称} % \DescribeMacro{\cdepartment} % \DescribeMacro{\edepartment} -% \cs{cdepartment} 可以加一个可选参数,如:\cs{cdepartmentl}\oarg{精简}\marg{详 -% 细},主要针对本科生的“\textbf{综合论文训练}”部分,因为需要填写的空间有限,最好 -% 给出一个详细和精简院系名称,如“\textbf{计算机科学与技术}”和“\textbf{计算机}”。 -% \begin{example} +% 院系名称。 +% \begin{latex} % \thusetup{ -% cdepartment={[系名简称]{系名全称}}, -% edepartment={Deparment} +% cdepartment={系名全称}, +% edepartment={Deparment of CS} % } % % 等价: -% \cdepartment[系名简称]{系名全称} -% \edepartment{Department} -% \end{example} +% \cdepartment{系名全称} +% \edepartment{Department of CS} +% \end{latex} % % \subsubsection{专业名称} % \DescribeMacro{\cmajor} % \DescribeMacro{\emajor} -% \begin{example} +% 参见第 \ref{sec:degree} 节。 +% \begin{latex} % \thusetup{ % cmajor={专业名称}, % emajor={Major in English} @@ -727,11 +726,12 @@ % % 等价: % \cmajor{专业名称} % \emajor{Major in English} -% \end{example} +% \end{latex} % % \DescribeMacro{\cfirstdiscipline} % \DescribeMacro{\cseconddiscipline} -% \begin{example} +% 博士后专用。 +% \begin{latex} % \thusetup{ % cfirstdiscipline={博士后一级学科}, % cseconddiscipline={博士后二级学科} @@ -739,13 +739,14 @@ % % 等价: % \cfirstdiscipline{博士后一级学科} % \cseconddiscipline{博士后二级学科} -% \end{example} +% \end{latex} % % \subsubsection{导师} % \myentry{导师} % \DescribeMacro{\csupervisor} % \DescribeMacro{\esupervisor} -% \begin{example} +% 直接导师。 +% \begin{latex} % \thusetup{ % csupervisor={导师~教授}, % esupervisor={Supervisor} @@ -753,22 +754,27 @@ % % 等价: % \csupervisor{导师~教授} % \esupervisor{Supervisor} -% \end{example} +% \end{latex} % -% \myentry{副导师姓名} +% \myentry{副导师} % \DescribeMacro{\cassosupervisor} % \DescribeMacro{\eassosupervisor} % 本科生的辅导教师,硕士的副指导教师。 -% \begin{example} +% \begin{latex} +% \thusetup{ +% cassosupervisor={副导师~副教授}, +% eassosupervisor={2nd Boss} +% } +% % 等价: % \cassosupervisor{副导师~副教授} % \eassosupervisor{2nd Boss} -% \end{example} +% \end{latex} % % \myentry{联合导师} % \DescribeMacro{\ccosupervisor} % \DescribeMacro{\ecosupervisor} % 硕士生联合指导教师,博士生联合导师。 -% \begin{example} +% \begin{latex} % \thusetup{ % ccosupervisor={联合导师~教授}, % ecosupervisor={3rd Boss} @@ -776,14 +782,14 @@ % % 等价: % \ccosupervisor{联合导师~教授} % \ecosupervisor{3rd Boss} -% \end{example} +% \end{latex} % % \subsubsection{成文日期} % \DescribeMacro{\cdate} % \DescribeMacro{\edate} % \DescribeMacro{\postdoctordate} % 默认为当前时间,也可以自己指定。 -% \begin{example} +% \begin{latex} % \thusetup{ % cdate={中文日期}, % edate={English Date}, @@ -793,7 +799,7 @@ % \cdate{中文日期} % \edate{English Date} % \postdoctordate{2009年7月——2011年7月} % 博士后研究起止日期 -% \end{example} +% \end{latex} % % \subsubsection{摘要} % \myentry{摘要正文} @@ -801,7 +807,7 @@ % \DescribeEnv{eabstract} % \note{摘要正文只能用环境命令的形式,不支持 \cs{thusetup}。} % -% \begin{example} +% \begin{latex} % \begin{cabstract} % 摘要请写在这里... % \end{cabstract} @@ -809,14 +815,14 @@ % \begin{eabstract} % Here comes the abstract in English... % \end{eabstract} -% \end{example} +% \end{latex} % % \myentry{关键词} % \DescribeMacro{\ckeywords} % \DescribeMacro{\ekeywords} % 关键词用英文逗号分割写入相应的命令中,模板会解析各关键词并生成符合不同论文格式 % 要求的关键词格式。 -% \begin{example} +% \begin{latex} % \thusetup{ % ckeywords={关键词 1, 关键词 2}, % ekeywords={keyword 1, keyword 2} @@ -824,40 +830,40 @@ % % 等价: % \ckeywords{关键词 1, 关键词 2} % \ekeywords{keyword 1, keyword 2} -% \end{example} +% \end{latex} % % \myentry{生成封面} % \DescribeMacro{\makecover} % 生成封面,包括首页,授权,摘要等。用法:\cs{makecover}\oarg{file}。如果使用授权 % 说明扫描页,将可选参数中指定为扫描得到的 PDF 文件名,例如: -% \begin{example} +% \begin{latex} % % 直接生成封面 % \makecover % % % 将签字扫描后授权文件 scan-auth.pdf 替换原始页面 % \makecover[scan-auth.pdf] -% \end{example} +% \end{latex} % % \subsubsection{符号对照表} % \DescribeEnv{denotation} % 主要符号表环境。简单定义的一个 \texttt{list},跟 \texttt{description} 非常类似, % 使用方法参见示例文件。带一个可选参数,用来指定符号列的宽度(默认为 2.5cm)。 -% \begin{example} +% \begin{latex} % \begin{denotation} % \item[E] 能量 % \item[m] 质量 % \item[c] 光速 % \end{denotation} -% \end{example} +% \end{latex} % % 如果你觉得符号列的宽度不满意,那可以这样来调整: -% \begin{example} +% \begin{latex} % \begin{denotation}[1.5cm] % 设置为 1.5cm % \item[E] 能量 % \item[m] 质量 % \item[c] 光速 % \end{denotation} -% \end{example} +% \end{latex} % % \subsection{目录和索引表} % 目录、插图、表格和公式等索引命令分别如下,将其插入到期望的位置即可(带星号的命令表 @@ -865,19 +871,22 @@ % % \DescribeMacro{\tableofcontents} % \DescribeMacro{\listoffigures} +% \DescribeMacro{\listoffigures*} % \DescribeMacro{\listoftables} +% \DescribeMacro{\listoftables*} % \DescribeMacro{\listofequations} +% \DescribeMacro{\listofequations*} % \begin{center} % \begin{tabular}{ll} -% \hline -% {\heiti 用途} & {\heiti 命令} \\\hline\hline -% 目录 & \cs{tableofcontents} \\\hline +% \toprule +% {\heiti 用途} & {\heiti 命令} \\\midrule +% 目录 & \cs{tableofcontents} \\\midrule % 插图索引 & \cs{listoffigures} \\ -% & \cs{listoffigures*} \\\hline +% & \cs{listoffigures*} \\\midrule % 表格索引 & \cs{listoftables} \\ -% & \cs{listoftables*} \\\hline +% & \cs{listoftables*} \\\midrule % 公式索引 & \cs{listofequations} \\ -% & \cs{listofequations*}\\\hline +% & \cs{listofequations*}\\\bottomrule % \end{tabular} % \end{center} % @@ -904,12 +913,12 @@ % % 使用方法如下。假如有一个非 equation 数学环境 mymath,只要在其中写一 % 句 \cs{equcaption} 就可以将它加入公式列表。 -% \begin{example} +% \begin{latex} % \begin{mymath} % \label{eq:emc2}\equcaption{\ref{eq:emc2}} % E=mc^2 % \end{mymath} -% \end{example} +% \end{latex} % % 当然 mymath 正文中公式的编号需要自己来做。 % @@ -918,56 +927,119 @@ % 处不再罗嗦,实例请参看示例文档附录 A 的前两个公式。 % % \subsection{封底部分} -% \subsubsection{简历} -% \DescribeEnv{resume} -% 开启个人简历章节,包括个人简历,发表文章,研究成果列表等。每个子项目请 -% 用以下对应命令开启:\cs{xxxitem}\marg{subtitle}。 -% -% \DescribeMacro{\resumeitem} -% 个人简历,用法:\cs{resumeitem}\{个人简历\} -% -% \DescribeMacro{\researchitem} -% \DescribeEnv{publications} -% 发表学术论文,用法:\cs{researchitem}\{发表学术论文\}。随后用 -% \texttt{publicatoins} 环境进行罗列。 -% -% \DescribeEnv{achievements} -% 研究成果用 \cs{researchitem}\{研究成果\} 开启,随后用 \texttt{achievements} 环 -% 境罗列。 -% -% 具体用法请参看示例文档 \file{data/resume.tex}。 -% -% \subsubsection{附录} -% \DescribeEnv{appendix} -% 所有的附录都插到这里来。因为附录会更改默认的 chapter 属性,而后面的{\heiti 个人简 -% 历}又需要恢复,所以实现为环境可以保证全局的属性不受影响。 -% \begin{example} -% \begin{appendix} -% \input{data/appendix01} -% \input{data/appendix02} -% \end{appendix} -% \end{example} % % \subsubsection{致谢声明} % \DescribeEnv{ack} % 把致谢做成一个环境更好一些,直接往里面写感谢的话就可以啦!下面是数学系一位同 % 学致谢里的话,拿过来做个广告。希望每个人都能写这么一句 :) -% \begin{example} +% \begin{latex} % \begin{ack} % … % 还要特别感谢计算机系薛瑞尼同学在论文格式和 \LaTeX{} 编译等方面给我的很多帮助! % \end{ack} -% \end{example} +% \end{latex} % % 本科论文在此处还有一节“声明”,提交版本时需要替换为签字扫描文件,同样我们也提供: % 如果使用声明扫描页,将可选参数指定为扫描后的 PDF 文件名,例如: -% \begin{example} +% \begin{latex} % \begin{ack}[scan-statement.pdf] % 加了扫描文件后,这里面的文字就没用了。 % % 还要特别感谢计算机系薛瑞尼同学在论文格式和 \LaTeX{} 编译等方面给我的很多帮助! % \end{ack} -% \end{example} +% \end{latex} +% +% \subsubsection{附录} +% \DescribeEnv{appendix} +% 所有的附录都插到这里来。因为附录会更改默认的 chapter 属性,而后面的{\heiti 个人简 +% 历}又需要恢复,所以实现为环境可以保证全局的属性不受影响。 +% \begin{latex} +% \begin{appendix} +% \input{data/appendix01} +% \input{data/appendix02} +% \end{appendix} +% \end{latex} +% +% \DescribeMacro{\title} +% 附录里主要是本科的外文资料以及翻译,在这种情况下,\cs{chapter} 的标题是固定的 +% (即“外文资料的调研阅读报告或书面翻译”),所以用 \cs{title}\marg{标题} 开排版外 +% 文资料以及翻译的标题。这个命令只能在附录环境下使用。 +% +% \DescribeEnv{translationbib} +% 本环境用来描述外文资料中的参考文献,例子: +% \begin{latex} +% \begin{translationbib} +% \item Donald E. Knuth. The \TeX book. Addison-Wesley, 1984. ISBN: 0-201-13448-9 +% \item Paul W. Abrahams, Karl Berry and Kathryn A. Hargreaves. \TeX\ for the +% Impatient. Addison-Wesley, 1990. ISBN: 0-201-51375-7 +% \item David Salomon. The advanced \TeX book. New York : Springer, 1995. ISBN:0-387-94556-3 +% \end{translationbib} +% \end{latex} +% +% \subsubsection{简历} +% \DescribeEnv{resume} +% 开启个人简历章节,包括个人简历,发表文章,研究成果列表等。每个子项目请 +% 用以下对应命令开启:\cs{xxxitem}\marg{subtitle}。 +% +% \DescribeMacro{\resumeitem} +% 个人简历,用法:\cs{resumeitem}\{个人简历\}。简历内容部分没有格式要求,正常段 +% 落排版。 +% +% \DescribeMacro{\researchitem} +% 发表学术论文,用法:\cs{researchitem}\marg{类别},包括“学术论文”和“研究成果”两 +% 个类别。分别用 \env{publications} 和 \env{achievements} 罗列。 +% +% \DescribeEnv{publications} +% \DescribeMacro{\publicationskip} +% 用 \env{publications} 环境进行罗列发表的论文。按照学校要求,在学期间发表的学术 +% 论文分以下三部分按顺序分别列出,每部分之间空 1 行,序号可连续排列: +% \begin{enumerate} +% \item 已经刊载的学术论文(本人是第一作者,或者导师为第一作者本人是第二作者) +% \item 尚未刊载,但已经接到正式录用函的学术论文(本人为第一作者,或者导师为第一 +% 作者本人是第二作者)。 +% \item 其他学术论文。可列出除上述两种情况以外的其他学术论文,但必须是已经刊载或 +% 者收到正式录用函的论文。 +% \end{enumerate} +% +% \env{publications} 环境支持每一部分分别编写,逻辑上更清楚,为了在环境之间支持 +% 空行,需要利用 \cs{publicationskip} 控制。示例: +% \begin{latex} +% \researchitem{发表的学术论文} +% +% % 1. 已经刊载的学术论文 +% \begin{publications} +% \item Yang Y, Ren T L, Zhang L T, et al. Miniature microphone with silicon- +% based ferroelectric thin films. Integrated Ferroelectrics, 2003, +% 52:229-235. (SCI 收录, 检索号:758FZ.) +% \item 杨轶, 张宁欣, 任天令, 等. 硅基铁电微声学器件中薄膜残余应力的研究. 中国机 +% 械工程, 2005, 16(14):1289-1291. (EI 收录, 检索号:0534931 2907.) +% \item 杨轶, 张宁欣, 任天令, 等. 集成铁电器件中的关键工艺研究. 仪器仪表学报, +% 2003, 24(S4):192-193. (EI 源刊.) +% \end{publications} +% +% % 2. 尚未刊载,但已经接到正式录用函的学术论文 +% \begin{publications}[before=\publicationskip,after=\publicationskip] +% \item Yang Y, Ren T L, Zhu Y P, et al. PMUTs for handwriting recognition. In +% press. (已被 Integrated Ferroelectrics 录用. SCI 源刊.) +% \end{publications} +% +% % 3. 其他学术论文。 +% \begin{publications} +% \item Wu X M, Yang Y, Cai J, et al. Measurements of ferroelectric MEMS +% microphones. Integrated Ferroelectrics, 2005, 69:417-429. (SCI 收录, 检索号 +% :896KM) +% \item 贾泽, 杨轶, 陈兢, 等. 用于压电和电容微麦克风的体硅腐蚀相关研究. 压电与声 +% 光, 2006, 28(1):117-119. (EI 收录, 检索号:06129773469) +% \item 伍晓明, 杨轶, 张宁欣, 等. 基于MEMS技术的集成铁电硅微麦克风. 中国集成电路, +% 2003, 53:59-61. +% \end{publications} +%% \end{latex} +% +% \DescribeEnv{achievements} +% 研究成果用 \cs{researchitem}\{研究成果\} 开启,随后用 \env{achievements} 环 +% 境罗列。 +% +% 具体用法请参看示例文档 \file{data/resume.tex}。 % % \subsection{自定义} % \label{sec:othercmd} @@ -977,41 +1049,46 @@ % \thuthesis{} 定义了常用的数学环境: % % \begin{center} -% \begin{tabular}{*{7}{l}}\hline +% \begin{tabular}{*{7}{l}}\toprule % axiom & theorem & definition & proposition & lemma & conjecture &\\ -% 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\hline +% 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\midrule % proof & corollary & example & exercise & assumption & remark & problem \\ -% 证明 & 推论 & 例子& 练习 & 假设 & 注释 & 问题\\\hline +% 证明 & 推论 & 例子& 练习 & 假设 & 注释 & 问题\\\bottomrule % \end{tabular} % \end{center} % % 比如: -% \begin{example} +% \begin{latex} % \begin{definition} -% 道千乘之国,敬事而信,节用而爱人,使民以时。 +% 道千乘之国,敬事而信,节用而爱人,使民以时。 % \end{definition} -% \end{example} -% 产生(自动编号):\\[5pt] -% \fbox{{\heiti 定义~1.1~~~} {道千乘之国,敬事而信,节用而爱人,使民以时。}} +% \end{latex} +% 产生(自动编号): +% \medskip +% +% \noindent\framebox[\linewidth][l]{{\heiti 定义~1.1~~~} % {道千乘之国,敬事而信,节用而爱人,使民以时。}} % -% 列举出来的数学环境毕竟是有限的,如果想用{\heiti 胡说}这样的数学环境,那么很容易定义: -% \begin{example} +% \smallskip +% 列举出来的数学环境毕竟是有限的,如果想用\emph{胡说}这样的数学环境,那么可以定义: +% \begin{latex} % \newtheorem{nonsense}{胡说}[chapter] -% \end{example} +% \end{latex} % % 然后这样使用: -% \begin{example} +% \begin{latex} % \begin{nonsense} -% 契丹武士要来中原夺武林秘笈。—— 慕容博 +% 契丹武士要来中原夺武林秘笈。—— 慕容博 % \end{nonsense} -% \end{example} -% 产生(自动编号):\\[5pt] -% \fbox{{\heiti 胡说~1.1~~~} {契丹武士要来中原夺武林秘笈。—— 慕容博}} +% \end{latex} +% 产生(自动编号): % -% \changes{v5.0.0}{2015/11/23}{用 \cs{inlinecite} 替换 \cs{onlinecite}。为保证兼 -% 容性,\cs{onlinecite} 会保留。} +% \medskip +% \noindent\framebox[\linewidth][l]{{\heiti 胡说~1.1~~~} % {契丹武士要来中原夺武林秘笈。—— 慕容博}} % % \subsubsection{引用方式} +% +% \changes{v5.0.0}{2015/11/23}{用 \cs{inlinecite} 替换 \cs{onlinecite}。为保证兼 +% 容性,\cs{onlinecite} 会保留。} % \DescribeMacro{\inlinecite} % 学校要求的参考文献引用有两种模式:(1)上标模式。比如``同样的工作有很 % 多$^{[1,2]}$\ldots''。(2)正文模式。比如``文[3] 中详细说明了\ldots''。其中上标 @@ -1021,7 +1098,7 @@ % 关于参考文献模板推荐使用 \BibTeX{},关于中文参考文献需要额外增加一个 Entry: % lang,将其设置为 \texttt{zh}用来指示此参考文献为中文,以 % 便 \file{thuthesis.bst} 处理。如: -% \begin{example} +% \begin{latex} % @INPROCEEDINGS{cnproceed, % author = {王重阳 and 黄药师 and 欧阳峰 and 洪七公 and 段皇帝}, % title = {武林高手从入门到精通}, @@ -1041,7 +1118,7 @@ % YEAR = "1800", % LANG = "zh", % } -% \end{example} +% \end{latex} % % 注意如果不需要引用参考文献,请删除 \file{main.tex} 中 \cs{bibliography} 开头的两行, % 以避免可能的编译错误。 @@ -1060,7 +1137,7 @@ % 数为论文中文题目和中文作者。如果中文题目中没有英文字母,那么直接调用此命令即可。 % 否则,就要像例子里面那样做一些微调(参看模板自带的 \file{shuji.tex})。下面是一 % 个例子: -% \begin{example} +% \begin{latex} % \documentclass[type=master]{thuthesis} % % 此处 type 无所谓 % @@ -1076,11 +1153,9 @@ % \shuji[同时修改标题和作者的标题][尼瑞薛] % % % 如果标题中有英文,那可以参考如下方法进行微调: -% \shuji[清华大学~\hspace{0.2em}\raisebox{2pt}{\LaTeX}% -% \hspace{-0.25em} 论文模板 \hspace{0.1em}\raisebox{2pt}% -% {v\version}\hspace{-0.25em}样例] +% \shuji[清华大学 \raisebox{-5pt}{\LaTeX} 论文模板 \raisebox{-5pt}{v\version} 样例] % \end{document} -% \end{example} +% \end{latex} % % \subsection{其它} % 模板的配置文件 \file{thuthesis.cfg} 中定义了很多固定词汇,一般无须修改。如果有特殊需求, @@ -1091,8 +1166,7 @@ % 感谢这些年来一直陪伴 \thuthesis{} 成长的新老同学,大家的需求是模板前进的动力, % 大家的反馈是模板提高的机会。 % -% 本人已离开清华,热烈欢迎各位 -% 到\href{http://github.com/xueruini/thuthesis/}{\thuthesis\ Github 主页}贡献! +% 热烈欢迎各位到\href{http://github.com/xueruini/thuthesis/}{\thuthesis\ Github 主页}贡献! % % \StopEventually{\PrintChanges\PrintIndex} % \clearpage @@ -1104,7 +1178,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{thuthesis} %\ProvidesFile{thuthesis.cfg} -%[2015/12/27 5.1.0 Tsinghua University Thesis Template] +%[2016/1/11 5.2.0 Tsinghua University Thesis Template] % \end{macrocode} % % \subsection{定义选项} @@ -1123,7 +1197,7 @@ %<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{\textsc{ThuThesis}} -\def\version{5.1.0} +\def\version{5.2.0} \RequirePackage{kvoptions} \SetupKeyvalOptions{ @@ -1167,19 +1241,20 @@ % \begin{macrocode} \DeclareBoolOption{arialtoc} % \end{macrocode} +% % 章节标题中的英文是否用 arial % \begin{macrocode} \DeclareBoolOption{arialtitle} % \end{macrocode} % -% noraggedbottom 选项 +% \option{raggedbottom} 选项 % \changes{v4.8}{2013/03/05}{增加 noraggedbottom 选项。} -% \changes{v5.0.0}{2015/12/13}{norggedbottom 选项修改未 raggedbottom。} +% \changes{v5.0.0}{2015/12/13}{norggedbottom 选项修改为 raggedbottom。} % \begin{macrocode} \DeclareBoolOption{raggedbottom} % \end{macrocode} % -% 将选项传递给 ctexbook 类 +% 将选项传递给 \pkg{ctexbook}。 % \begin{macrocode} \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}} % \end{macrocode} @@ -1192,12 +1267,16 @@ % \changes{v5.0.0}{2015/03/12}{使用 XeTeX 引擎时,fontspec 宏包会被 xeCJK 自动 % 调用。传递给 fontspec 宏包 no-math 选项,避免部分数学符号字体自动调整为 CMR。 % 其他引擎下没有这个问题,这一行会被无视。} +% 打开默认选项。 % \begin{macrocode} \kvsetkeys{thu}{% raggedbottom, arial, arialtitle} - +% \end{macrocode} +% +% 解析用户传递过来的选项,并加载 \pkg{ctexbook}。 +% \begin{macrocode} \ProcessKeyvalOptions* \PassOptionsToPackage{no-math}{fontspec} \LoadClass[a4paper,openany,UTF8,zihao=-4,scheme=plain,fontset=none]{ctexbook} @@ -1233,7 +1312,7 @@ \RequirePackage{amsmath} % \end{macrocode} % -% 用很爽的 \pkg{txfonts} 替换 \pkg{mathptmx} 宏包,同时用它自带的 typewriter 字 +% 用 \pkg{txfonts} 替换 \pkg{mathptmx} 宏包,同时用它自带的 typewriter 字 % 体替换 courier。必须出现在 \AmSTeX{} 之后。 % \changes{v3.1}{2007/06/16}{replace mathptmx with txfonts.} % \begin{macrocode} @@ -1251,7 +1330,7 @@ \RequirePackage[labelformat=simple]{subcaption} % \end{macrocode} % -% pdfpages 宏包便于我们插入扫描后的授权页和声明页 PDF 文档。 +% \pkg{pdfpages} 宏包便于我们插入扫描后的授权页和声明页 PDF 文档。 % \begin{macrocode} \RequirePackage{pdfpages} \includepdfset{fitpaper=true} @@ -1260,9 +1339,9 @@ % \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{v2.6.2}{2006/06/18}{去掉 \pkg*{paralist} 的 \option{newitem} 和 +% \option{newenum} 选项,因为默认是打开的。} +% \changes{v2.6.4}{2006/10/23}{增加 \option{neverdecrease} 选项。} % \changes{v5.0.0}{2012/12/13}{删除 \pkg{paralist} 选项。} % \begin{macrocode} \RequirePackage[shortlabels]{enumitem} @@ -1294,7 +1373,7 @@ % \end{macrocode} % 默认采用中易的六款免费字体。缺少上述字体的用户可以通过 % \file{ctex-fontset-thuthesis.def} 文件自定义字体。 -% \changes{v4.8}{2013/05/28}{在 CJK 模式下用 \pkg{CJKspace} 保留中英文间空格。} +% \changes{v4.8}{2013/05/28}{在 CJK 模式下用 \pkg*{CJKspace} 保留中英文间空格。} % \changes{v5.0.0}{2015/04/17}{固定字体设置,同时改善与 ctex 兼容性。} % \begin{macrocode} \IfFileExists{ctex-fontset-thuthesis.def}% @@ -1307,8 +1386,8 @@ \else \RequirePackage{CJKspace} % \end{macrocode} -% arial 字体需要单独安装,如果不使用 arial 字体,可以用 helvet 字体 |\textsf| -% 模拟,二者基本没有差别。 +% arial 字体需要单独安装,如果不使用 arial 字体,可以用 helvet 字体 +% \cs{textsf} 模拟,二者基本没有差别。 % \begin{macrocode} \ifthu@arial \IfFileExists{arial.sty}% @@ -1324,7 +1403,7 @@ % \end{macrocode} % % 表格控制 -% \changes{v2.6}{2006/06/09}{增加 \pkg{longtable}。} +% \changes{v2.6}{2006/06/09}{增加 \pkg*{longtable}。} % \begin{macrocode} \RequirePackage{array} \RequirePackage{longtable} @@ -1379,7 +1458,7 @@ % \changes{v4.7}{2012/05/29}{修改本科生页脚间距与样例基本一致。} % \changes{v5.0.0}{2015/03/10}{不再将页面尺寸写入 dvi,因为已不支持 dvips, % 而该方案会使得在使用 tikzexternalize 时外部 PDF 图片 BBox 不对。} -% \changes{v5.0.0}{2015/12/14}{用 \pkg{geometry} 简化设置。} +% \changes{v5.0.0}{2015/12/14}{用 \pkg*{geometry} 简化设置。} % \begin{macrocode} \RequirePackage{geometry} \geometry{ @@ -1416,9 +1495,9 @@ % \label{sec:mainbody} % % \subsubsection{Three matters} +% \begin{macro}{\cleardoublepage} % 对于 \textsl{openright} 选项,必须保证章首页右开,且如果前章末页无内容须 % 清空其页眉页脚。 -% \begin{macro}{\cleardoublepage} % \begin{macrocode} %<*cls> \let\thu@cleardoublepage\cleardoublepage @@ -1428,15 +1507,15 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\frontmatter} +% \begin{macro}{\mainmatter} +% \begin{macro}{\backmatter} % 我们的单面和双面模式与常规的不太一样。 % \changes{v2.5.1}{2006/05/23}{本科正文之后页码即用罗马数字,研究生不变。} % \changes{v2.5.3}{2006/06/03}{第一章永远右开。} % \changes{v4.4}{2008/05/30}{本科正文后的页码延续前面的阿拉伯数字,不再用罗马数 % 字。} % \changes{v4.4}{2008/05/30}{本科取消了所有页眉。} -% \begin{macro}{\frontmatter} -% \begin{macro}{\mainmatter} -% \begin{macro}{\backmatter} % \begin{macrocode} \renewcommand\frontmatter{% \if@openright\cleardoublepage\else\clearpage\fi @@ -1459,13 +1538,10 @@ % % \subsubsection{字体} % \label{sec:font} -% -% 重定义字号命令 -% % WORD 中的字号对应该关系如下(1bp = 72.27/72 pt): % \begin{center} % \begin{tabular}{llll} -% \hline +% \toprule % 初号 & 42bp & 14.82mm & 42.1575pt \\ % 小初 & 36bp & 12.70mm & 36.135 pt \\ % 一号 & 26bp & 9.17mm & 26.0975pt \\ @@ -1481,7 +1557,7 @@ % 六号 & 7.5bp & 2.56mm & \\ % 小六 & 6.5bp & 2.29mm & \\ % 七号 & 5.5bp & 1.94mm & \\ -% 八号 & 5bp & 1.76mm & \\\hline +% 八号 & 5bp & 1.76mm & \\\bottomrule % \end{tabular} % \end{center} % @@ -1504,6 +1580,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\chuhao} +% 初号 % \begin{macrocode} \thu@def@fontsize{chuhao}{42bp} % \end{macrocode} @@ -1617,7 +1694,7 @@ % \changes{v2.5}{2006/05/13}{本科的奇偶页眉不同。} % \changes{v2.5}{2006/05/20}{增加 empty 页面样式。} % \changes{v4.7}{2012/05/29}{本科页码用小五号字。} -% \changes{v5.0.0}{2015/12/20}{利用 \pkg{fancyhdr} 设置页眉页脚。} +% \changes{v5.0.0}{2015/12/20}{利用 \pkg*{fancyhdr} 设置页眉页脚。} % \begin{macro}{\ps@thu@empty} % \begin{macro}{\ps@thu@plain} % \begin{macro}{\ps@thu@headings} @@ -1732,7 +1809,7 @@ % % 公式改成 (1-1) 的形式,本科还要在前面加上\textbf{公式}二字,我不知道他们是怎么想的,这 % 忒不好看了。 -% \changes{v2.5.1}{2006/05/24}{本科公式编号前添加\textbf{公式}二字。ft,这个需要修 \pkg{amsmath} 极其深入的一个命令。} +% \changes{v2.5.1}{2006/05/24}{本科公式编号前添加\textbf{公式}二字。ft,这个需要修 \pkg*{amsmath} 极其深入的一个命令。} % \changes{v2.5.1}{2006/05/24}{教务处居然要本科论文公式全文编号!} % \changes{v2.5.2}{2006/05/29}{上一个版本忘了把研究生的公式编号排除。} % \changes{v3.0}{2007/05/12}{本科公式又要取消全文统一编号了,这帮家伙,早就告诉 @@ -1743,11 +1820,11 @@ % 同时为了让 \pkg{amsmath} 的 \cs{tag*} 命令得到正确的格式,我们必须修改这些代 % 码。\cs{make@df@tag} 是定义 \cs{tag*} 和 \cs{tag} 内部命令的。 % \cs{make@df@tag@@} 处理 \cs{tag*},我们就改它! -% \begin{verbatim} +% \begin{latex} % \def\make@df@tag{\@ifstar\make@df@tag@@\make@df@tag@@@} % \def\make@df@tag@@#1{% % \gdef\df@tag{\maketag@@@{#1}\def\@currentlabel{#1}}} -% \end{verbatim} +% \end{latex} % \changes{v4.4}{2008/05/30}{变态的本科论文终于去掉了\textbf{公式}二字。} % \changes{v4.4.4}{2008/06/12}{修复了一个从 v4.3 升级到 v4.4 过程中的丢失公式索引的 bug,原修改代码保留备忘。} % \begin{macrocode} @@ -1766,8 +1843,6 @@ \def\tagform@#1{\maketag@@@{(\ignorespaces #1\unskip\@@italiccorr)\equcaption{#1}}} %\fi % \end{macrocode} -% ^^A 使公式编号随着每开始新的一节而重新开始。 -% ^^A \@addtoreset{eqation}{section} % % 解决证明环境中方块乱跑的问题。 % \begin{macrocode} @@ -1852,7 +1927,7 @@ % \changes{v2.4}{2006/04/14}{表格内容为 11 磅。} % \changes{v2.4}{2006/04/14}{图表标题左对齐,取消原先漂亮的 hang 模式。} % \changes{v2.5}{2006/05/13}{标题上下间距重调,以前没有考虑 \cs{intextsep} 的影响。} -% \changes{v2.5.1}{2006/05/23}{增加 \pkg{subfigure} 和 \pkg{subtable} 的 caption 配置。} +% \changes{v2.5.1}{2006/05/23}{增加 \pkg*{subfigure} 和 \pkg*{subtable} 的 caption 配置。} % \changes{v2.5.1}{2006/05/24}{重新定义表格默认字体。} % \changes{v2.5.3}{2006/06/07}{不管 caption 出现在什么位置,\cs{aboveskip} 总是出现在标题和浮动体之间的距离。} % \changes{v4.3}{2008/03/11}{子图引用时加括号。} @@ -1876,8 +1951,8 @@ % \renewcommand{\p@subfigure}{:} % \end{macrocode} % 我们采用 \pkg{longtable} 来处理跨页的表格。同样我们需要设置其默认字体为五号。 -% \changes{v2.5.3}{2006/06/08}{增加对 \pkg{longtable} 的处理。} -% \changes{v4.5.1}{2009/01/06}{太好了,不用处理 \pkg{longtable} 的 \cs{caption} +% \changes{v2.5.3}{2006/06/08}{增加对 \pkg*{longtable} 的处理。} +% \changes{v4.5.1}{2009/01/06}{太好了,不用处理 \pkg*{longtable} 的 \cs{caption} % 了。} % \begin{macrocode} \let\thu@LT@array\LT@array @@ -1885,7 +1960,7 @@ % \end{macrocode} % % \begin{macro}{\hlinewd} -% 简单的表格使用三线表推荐用 \cs{hlinewd}。如果表格比较复杂还是用 \pkg{booktabs} 的命 +% 简单的表格使用三线表推荐用 \cs{hlinewd}。如果表格比较复杂还是用 \pkg*{booktabs} 的命 % 令好一些。 % \begin{macrocode} \def\hlinewd#1{% @@ -1946,23 +2021,23 @@ % \pkg{fancyhdr} 定义页眉页脚很方便,但是有一个非常隐蔽的坑。通过 \pkg{fancyhdr} % 定义的样式在第一次被调用时会修改 \cs{chaptermark},这会导致页眉信息错误(多余 % 章号并且英文大写)。这是因为在原始的 \file{book.cls} 中定义如下(大意): -% \begin{verbatim} +% \begin{latex} % \newcommand\chaptername{Chapter} % \newcommand\@chapapp{\chaptername} % \def\chaptermark#1{ -% \markboth{\MakeUppercase{\@chapapp\ \thechapter}}{}} -% \end{verbatim} +% \markboth{\MakeUppercase{\@chapapp\ \thechapter}}{}} +% \end{latex} % 很显然这个 \cs{\@chapapp} 不适合中文,因此我们使用\cs{CTEXthechapter}( % 如,“第 x 章”),同时会将 \cs{MakeUppercase} 去掉。也就是说我们会做如下动作: -% \begin{verbatim} +% \begin{latex} % \renewcommand{\chaptermark}[1]{\@mkboth{\CTEXthechapter\hskip\ccwd#1}{}} -% \end{verbatim} +% \end{latex} % 但,\pkg{fancyhdr} 不知何故在 \cs{ps@fancy} 中对 \cs{chaptermark} 进行重定义 % (其实一模一样),而这个 \cs{ps@fancy} 会在 \cs{fancypagestyle} 中使用,如下: -% \begin{verbatim} +% \begin{latex} % \newcommand{\fancypagestyle}[2]{% % \@namedef{ps@#1}{\let\fancy@gbl\relax#2\relax\ps@fancy}} -% \end{verbatim} +% \end{latex} % 这样的话,\cs{ps@fancy} 会在 \pkg{fancyhdr} 定义的任何样式首次样被激活时调用,从 % 而覆盖我们的 \cs{chaptermark} 定义(后续样式再激活不会重复覆盖)。所以我们采用如下 % 方法解决: @@ -1979,9 +2054,9 @@ % 前空 24 磅,段后空 18 磅。本科要求:段前段后间距 30/20 pt,行距 20pt。但正文 % 章节 30pt 的话和样例效果不一致。 % -% \changes{v2.5}{2006/05/13}{取消 \pkg{titlesec} 宏包,用基本 \LaTeX{} 命令格式化标题。} +% \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{v3.1}{2006/06/16}{英文摘要标题要搞特殊化。} % \changes{v5.0.0}{2015/04/17}{修正章节间距问题(\#57)} % % \item[section] 一级节标题,例如:\fbox{2.1 实验装置与实验方法}。节标题序号与标 @@ -2058,41 +2133,32 @@ % \begin{macrocode} \newcounter{thu@bookmark} \NewDocumentCommand\thu@chapter{s o m o}{ - \IfBooleanF{#1} - {% + \IfBooleanF{#1}{% \ClassError{thuthesis}{You have to use the star form: \string\thu@chapter*}{} - } - - \IfValueTF{#2} - {% - \ifthenelse{\equal{#2}{}} - {% + }% + \if@openright\cleardoublepage\else\clearpage\fi\phantomsection% + \IfValueTF{#2}{% + \ifthenelse{\equal{#2}{}}{% \addtocounter{thu@bookmark}\@ne \pdfbookmark[0]{#3}{thuchapter.\thethu@bookmark} - } - {% + }{% \addcontentsline{toc}{chapter}{#3} } - } - {% + }{% \addcontentsline{toc}{chapter}{#3} - } - - \chapter*{#3}%\phantomsection - - \IfValueTF{#4} - {% + }% + \chapter*{#3}% + \IfValueTF{#4}{% \ifthenelse{\equal{#4}{}} {\@mkboth{}{}} {\@mkboth{#4}{#4}} - } - {% + }{% \@mkboth{#3}{#3} } } +% % \end{macrocode} % \end{macro} -% % % % \subsubsection{目录} @@ -2110,7 +2176,7 @@ % 每章标题行前空 6 磅,后空 0 磅。如果使用目录项中英文要使用 Arial,那么就加上 \cs{sffamily}。 % 章节名中英文用 Arial 字体,页码仍用 Times。 % \changes{v2.0}{2005/12/18}{附录的目录项需要调整一下。以及公式编号方式等等。} -% \changes{v2.5}{2006/05/13}{取消 \pkg{titletoc} 宏包,用 \cs{dottedtocline} 调整 +% \changes{v2.5}{2006/05/13}{取消 \pkg*{titletoc} 宏包,用 \cs{dottedtocline} 调整 % 目录。} % \changes{v2.5.1}{2006/05/23}{减小目录项中的导引小点跟页码之间的留白。} % \changes{v2.5.2}{2006/05/29}{用 \cs{thu@chapter*} 改写目录命令。} @@ -2196,19 +2262,17 @@ % \changes{v2.0}{2005/12/18}{增加了封面密级,增加博士封面支持} % \changes{v4.6}{2011/04/27}{增加博士后相关指令。} % -% \begin{macro}{\catalognumber} -% \begin{macro}{\udc} % \begin{macro}{\id} +% \begin{macro}{\udc} +% \begin{macro}{\catalognumber} % \begin{macro}{\secretlevel} % \begin{macro}{\secretyear} % \begin{macro}{\ctitle} % \begin{macro}{\cdegree} % \begin{macro}{\cdepartment} -% \begin{macro}{\caffil} % \begin{macro}{\cmajor} % \begin{macro}{\cfirstdiscipline} % \begin{macro}{\cseconddiscipline} -% \begin{macro}{\csubject} % \begin{macro}{\cauthor} % \begin{macro}{\csupervisor} % \begin{macro}{\cassosupervisor} @@ -2218,35 +2282,34 @@ % \begin{macro}{\etitle} % \begin{macro}{\edegree} % \begin{macro}{\edepartment} -% \begin{macro}{\eaffil} % \begin{macro}{\emajor} -% \begin{macro}{\esubject} % \begin{macro}{\eauthor} % \begin{macro}{\esupervisor} % \begin{macro}{\eassosupervisor} % \begin{macro}{\ecosupervisor} % \begin{macro}{\edate} +% 定义一批封面参数。 % \changes{v2.5}{2006/05/20}{院系和专业分别改名用 department 和 major,代替原来 % 的 affil 和 subject。} % \changes{v2.6.2}{2006/06/18}{改正 groupmembers 的拼写错误。} % \begin{macrocode} -\thu@def@term{catalognumber} -\thu@def@term{udc} \thu@def@term{id} +\thu@def@term{udc} +\thu@def@term{catalognumber} \thu@def@term{secretlevel} \thu@def@term{secretyear} \thu@def@term{ctitle} \thu@def@term{cdegree} -\newcommand\cdepartment[2][]{% todo: for definekeys - \def\thu@cdepartment@short{#1} - \def\thu@cdepartment{#2}} -\define@key{thu}{cdepartment}{% - \expandafter\cdepartment#1} -\def\caffil{\cdepartment} % for compatibility -\def\thu@cdepartment@short{} -\def\thu@cdepartment{} +\thu@def@term{cdepartment} +\def\caffil{% for compatibility + \ClassWarning{thuthesis} + {'\string\caffil' is deprecated, please use '\string\cdepartment' instead.}{}% + \cdepartment} \thu@def@term{cmajor} -\def\csubject{\cmajor} % for compatibility +\def\csubject{% for compatibility + \ClassWarning{thuthesis} + {'\string\csubject' is deprecated, please use '\string\cmajor' instead.}{}% + \cmajor} \thu@def@term{cfirstdiscipline} \thu@def@term{cseconddiscipline} \thu@def@term{cauthor} @@ -2258,9 +2321,15 @@ \thu@def@term{etitle} \thu@def@term{edegree} \thu@def@term{edepartment} -\def\eaffil{\edepartment} % for compability +\def\eaffil{% for compability + \ClassWarning{thuthesis} + {'\string\eaffil' is deprecated, please use '\string\edepartment' instead.}{}% + \edepartment} \thu@def@term{emajor} -\def\esubject{\emajor} %for compability +\def\esubject{%for compability + \ClassWarning{thuthesis} + {'\string\esubject' is deprecated, please use '\string\emajor' instead.}{}% + \emajor} \thu@def@term{eauthor} \thu@def@term{esupervisor} \thu@def@term{eassosupervisor} @@ -2293,21 +2362,20 @@ % \end{macro} % \end{macro} % \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % -% 封面、摘要、版权、致谢格式定义。 % \begin{environment}{cabstract} % \begin{environment}{eabstract} % 摘要最好以环境的形式出现(否则命令的形式会导致开始结束的括号距离太远,我不喜 -% 欢),这就必须让环境能够自己保存内容留待以后使用。ctt 上找到两种方法:1)使用 -% \pkg{amsmath} 中的 \cs{collect@body},但是此宏没有定义为 long,不能直接用。 -% 2)利用 \LaTeX{} 中环境和对应命令间的命名关系以及参数分隔符的特点非常巧妙地实 -% 现了这个功能,其不足是不能嵌套环境。由于摘要部分经常会用到诸如 itemize 类似 -% 的环境,所以我们不得不选择第一种复杂的方法。以下是修改 \pkg{amsmath} 代码部分: -% \changes{v3.1}{2006/06/17}{重新定义摘要成为环境,Great!} +% 欢),这就必须让环境能够自己保存内容留待以后使用。ctt 上找到两种方法: +% \begin{itemize} +% \item 使用 \pkg{amsmath} 中的 \cs{collect@body},但是此宏没有定义 +% 为 \texttt{long},不能直接用。 +% \item 利用 \LaTeX{} 中环境和对应命令间的命名关系以及参数分隔符的特点非常巧妙地 +% 实现了这个功能,其不足是不能嵌套环境。 +% \end{itemize} +% 由于摘要部分经常会用到诸如 \texttt{itemize} 类似的环境,所以我们不得不选择第一 +% 种复杂的方法。以下是修改 \pkg{amsmath} 代码部分: +% \changes{v3.1}{2006/06/17}{重新定义摘要成为环境。} % \begin{macrocode} \long\@xp\def\@xp\collect@@body\@xp#\@xp1\@xp\end\@xp#\@xp2\@xp{% \collect@@body{#1}\end{#2}} @@ -2330,7 +2398,6 @@ % \begin{macro}{\thu@parse@keywords} % 不同论文格式关键词之间的分割不太相同,我们用 \cs{ckeywords} 和 % \cs{ekeywords} 来收集关键词列表,然后用本命令来生成符合要求的格式。 -% \cs{expandafter} 都快把我整晕了。 % \begin{macrocode} \def\thu@parse@keywords#1{ \define@key{thu}{#1}{\csname #1\endcsname{##1}} @@ -2355,24 +2422,17 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\thusetup} % \changes{v5.1.0}{2015/12/26}{通过 \cs{thusetup} 统一设置封面信息。} % 由上可见,封面和封底有一大堆信息需要设置,为了简化操作界面,提供一 % 个 \cs{thusetup} 命令支持 key/value 的方式来设置。key 就是前面各个设置项的 % 名字。\note{只能设置普通项,不支持环境项, % 如 \texttt{cabstract} 和 \texttt{eabstract}。} 由于这些设置项被 \cs{makecover} % 调用,所以此命令需要在 \cs{makecover} 之前被调用。 -% \begin{macro}{thusetup} % \begin{macrocode} \def\thusetup{\kvsetkeys{thu}} % % \end{macrocode} -% \begin{example} -% \thusetup{ -% cauthor={薛瑞尼}, -% ckeywords={\TeX, \LaTeX, 论文}, -% % 其它 -% } -% \end{example} % \end{macro} % % \changes{v1.4rc1}{2005/12/14}{I have to put all chinese chars into cfg, @@ -2387,6 +2447,7 @@ % \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{;} @@ -2473,9 +2534,8 @@ % \end{macrocode} % % +% \myentry{封面第一页} % \begin{macro}{\thu@first@titlepage} -% 论文封面第一页! -% % 题名使用一号黑体字,一行写不下时可分两行写,并采用 1.25 倍行距。 % 申请学位的学科门类: 小二号宋体字。 % 中文封面页边距: @@ -2633,15 +2693,16 @@ {\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} % +% \myentry{英文封面} % \begin{macro}{\thu@doctor@engcover} -% 研究生论文英文封面部分。 % \changes{v4.2}{2008/01/23}{博士英文封面补充联合导师。} % \changes{v4.7}{2011/11/28}{硕士生新增英文封面。} +% 研究生论文使用。 % \begin{macrocode} -% %<*cfg> \def\thu@master@art{Master of Arts} \def\thu@master@sci{Master of Science} @@ -2713,11 +2774,13 @@ \end{center}} % \end{macrocode} % \end{macro} -% \changes{4.0}{2007/11/08}{研究生的授权部分调整了一下,不知道老师为什么总爱修改 -% 那些无关紧要的格式,郁闷。感谢 PMHT@newsmth 的认真比对。} -% \changes{4.4.2}{2008/06/07}{修改本科生的授权部分,按照 2008 年的新样例。} +% +% \myentry{授权页面} % \begin{macro}{\thu@authorization@mk} -% 封面中论文授权部分。 +% \changes{v4.0}{2007/11/08}{研究生的授权部分调整了一下,不知道老师为什么总爱修改 +% 那些无关紧要的格式,郁闷。感谢 PMHT@newsmth 的认真比对。} +% \changes{v4.4.2}{2008/06/07}{修改本科生的授权部分,按照 2008 年的新样例。} +% 支持扫描文件替换。 % \begin{macrocode} \newcommand{\thu@authorization@mk}{% \ifthu@bachelor\vspace*{0.2cm}\else\vspace*{0.42cm}\fi % shit code! @@ -2860,7 +2923,7 @@ % % 英文摘要部分的标题为 \textbf{Abstract},用 Arial 体三号字。研究生的英文摘要要求 % 非常怪异:虽然正文前的封面部分为右开,但是英文摘要要跟中文摘要连 -% 续。\changes{v.2.5.1}{2006/05/28}{研究生封面英文摘要连续。} +% 续。\changes{v2.5.1}{2006/05/28}{研究生封面英文摘要连续。} % \begin{macrocode} \thu@chapter*[]{\eabstractname} % no tocline % \end{macrocode} @@ -2923,6 +2986,7 @@ % \label{sec:ackanddeclare} % % \begin{environment}{ack} +% 支持扫描文件替换。 % \changes{v2.4}{2006/04/14}{调整\textbf{致谢}等中间的距离。} % \begin{macrocode} %<*cfg> @@ -2954,6 +3018,7 @@ \thu@chapter*{\thu@ackname} } % \end{macrocode} +% % 声明部分 % \changes{v3.0}{2007/05/12}{本科论文声明部分图片扫描取消。} % \changes{v5.0.0}{2015/06/05}{使用 pdfpages 宏包支持本硕博论文声明扫描版(\#36)。} @@ -2978,16 +3043,17 @@ % % \subsubsection{图表索引} % \label{sec:threeindex} +% \begin{macro}{\listoffigures} +% \begin{macro}{\listoffigures*} +% \begin{macro}{\listoftables} +% \begin{macro}{\listoftables*} +% 定义图表以及公式目录样式。 % \changes{v2.5}{2006/05/18}{增加插图、表格和公式索引。} % \changes{v2.5}{2006/05/19}{为了让索引中能出现\textbf{图 xxx},不得不修改 \LaTeX % 内部命令 \cs{@caption}。} % \changes{v2.6.4}{2006/10/23}{增加 \cs{listoffigures*},\cs{listoftables*}。} -% \changes{v4.5.1}{2009/01/06}{更优雅的插图/表格索引,避免跟 \pkg{caption} 包冲 +% \changes{v4.5.1}{2009/01/06}{更优雅的插图/表格索引,避免跟 \pkg*{caption} 包冲 % 突。\cs{thu@listof} 相应修改。} -% \begin{macro}{\listoffigures} -% \begin{macro}{\listoffigures*} -% \begin{macro}{\listoftables} -% \begin{macro}{\listoftables*} % \begin{macrocode} %<*cls> \def\thu@starttoc#1{% #1: float type, prepend type name in \listof*** entry. @@ -3010,7 +3076,7 @@ % \end{macro} % % \begin{macro}{\equcaption} -% \changes{v2.6.2}{2006/06/19}{此命令配合 \pkg{amsmath} 命令基本可以满足所有 +% \changes{v2.6.2}{2006/06/19}{此命令配合 \pkg*{amsmath} 命令基本可以满足所有 % 公式需要。} % 本命令只是为了生成公式列表,所以这个 caption 是假的。如果要编号最好用 % equation 环境,如果是其它编号环境,请手动添加添加 \cs{equcaption}。 @@ -3136,47 +3202,53 @@ % % \subsection{附录} % \label{sec:appendix} -% % \begin{environment}{appendix} +% 主要给本科做外文翻译用。 % \begin{macrocode} %<*cls> \let\thu@appendix\appendix \renewenvironment{appendix}{% - \thu@appendix - }{} + \let\title\thu@appendix@title + \thu@appendix}{% + \let\title\@gobble} +% \end{macrocode} +% \end{environment} +% +% \changes{v5.2.0}{2016/1/11}{增加 \cs{title} 排版翻译标题。} +% \begin{macro}{\title} +% 本科外文翻译文章的标题,用法:\cs{title}\marg{资料标题}。这个命令只能在附录环 +% 境下使用。 +% \begin{macrocode} +\let\title\@gobble +\newcommand{\thu@appendix@title}[1]{% + \begin{center} + \bfseries\xiaosi #1 + \end{center}} +% \end{macrocode} +% \end{macro} +% +% \changes{v5.2.0}{2016/1/11}{增加翻译文献环境 \env{translationbib}。} +% \begin{environment}{translationbib} +% 外文资料的参考文用宋体五号字,取固定行距17pt,段前后3pt。 +% \begin{macrocode} +\newlist{translationbib}{enumerate}{1} +\setlist[translationbib]{label=[\arabic*],align=left,nosep,itemsep=6bp, + leftmargin=10mm,labelsep=!,before=\vspace{0.5\baselineskip}\wuhao[1.3]} % % \end{macrocode} % \end{environment} % % \subsection{个人简历} -% \changes{v1.5}{2005/12/16}{增加个人简历章节的命令,去掉主文件中需要重新 -% 定义 \cs{cleardoublepage} 和自己写 \cs{markboth},\cs{addcontentsline} 的部分。} % -% 定义个人简历章节标题 % \begin{environment}{resume} -% 个人简历发表文章等。 +% \changes{v1.5}{2005/12/16}{增加个人简历章节的命令,去掉主文件中需要重新 +% 定义 \cs{cleardoublepage} 和自己写 \cs{markboth},\cs{addcontentsline} 的部分。} % \changes{v2.0}{2005/12/18}{最后决定将 resume 定义为环境。这样与前面的主要符号 % 表、致谢等对应。} +% \changes{v2.5.1}{2006/05/23}{ft,教务处和研究生院非要搞的不一样!} % \changes{v2.5.2}{2006/05/29}{研究生的个人介绍要右开。} % \changes{v4.6}{2011/05/02}{支持可选参数,自己定义简历章节标题。} -% \begin{macrocode} -%<*cls> -\newenvironment{resume}[1][\thu@resume@title]{% - \thu@chapter*{#1}}{} -% -% \end{macrocode} -% \end{environment} -% -% 利用 \pkg{enumitem} 宏包引入两个新列表环境 publications 和 achievements, -% 分别用于个人简历里面会出现的学术论文列表和研究成果列表。 -% publications 环境可以连续出现多次,模板会自动在之间加入空行。 -% \changes{v2.5.1}{2006/05/23}{ft,教务处和研究生院非要搞的不一样!} -% \changes{v5.0.0}{2015/04/18}{博士后就不提在学期间了,不合适(\#100)} -% \changes{v5.0.0}{2015/05/17}{让简历部分更符合格式指南和示例文件(\#122)} -% \begin{macro}{\resumeitem} -% \begin{macro}{\researchitem} -% \begin{environment}{publications} -% \begin{environment}{achievements} +% 个人简历发表文章等。 % \begin{macrocode} %<*cfg> \ifthu@bachelor @@ -3190,19 +3262,54 @@ \fi % %<*cls> -\newcommand{\resumeitem}[1]{\vspace{24bp}{\sihao\heiti\centerline{#1}}\par\vspace{6bp}} -\newcommand{\researchitem}[1]{\vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}} +\newenvironment{resume}[1][\thu@resume@title]{% + \thu@chapter*{#1}}{} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\resumeitem} +% 个人简历部分。每条信息一个段落,故不需要特别处理。 +% \begin{macrocode} +\newcommand{\resumeitem}[1]{% + \vspace{24bp}{\sihao\heiti\centerline{#1}}\par\vspace{6bp}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\researchitem} +% 研究成果用 \cs{researchitem}\marg{类别} 开启,包括“学术论文”和“研究成果”两个 +% 列表。 +% \begin{macrocode} +\newcommand{\researchitem}[1]{% + \vspace{32bp}{\sihao\heiti\centerline{#1}}\par\vspace{14bp}} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{publications} +% \begin{environment}{achievements} +% 二者分别通过两个环境 \env{publications} 和 \env{achievements} 罗 +% 列。 +% +% \changes{v5.0.0}{2015/04/18}{博士后就不提在学期间了,不合适(\#100)} +% \changes{v5.0.0}{2015/05/17}{让简历部分更符合格式指南和示例文件(\#122)} +% \begin{macrocode} \newlist{publications}{enumerate}{1} \setlist[publications]{label=[\arabic*],align=left,nosep,itemsep=8bp, -leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26],after*=\vspace{29bp},resume} + leftmargin=10mm,labelsep=!,before=\xiaosi[1.26],resume} \newlist{achievements}{enumerate}{1} \setlist[achievements]{label=[\arabic*],align=left,nosep,itemsep=8bp, -leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26]} -% + leftmargin=10mm,labelsep=!,before=\xiaosi[1.26]} % \end{macrocode} % \end{environment} % \end{environment} -% \end{macro} +% +% \changes{v5.2.0}{2016/1/11}{增加 \cs{publicationskip}。} +% \begin{macro}{\publicationskip} +% \env{publications} 环境可以连续出现多次,第二类论文列表前后要空一行,使 +% 用 \cs{publicationskip}。 +% \begin{macrocode} +\def\publicationskip{\bigskip\bigskip} +% +% \end{macrocode} % \end{macro} % % \subsection{书脊} @@ -3220,35 +3327,6 @@ leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26]} % \end{macrocode} % \end{macro} % -% \subsection{索引} -% -% 生成索引的一些命令,虽然我们暂时还用不到。 -% \begin{macrocode} -%<*cls> -\iffalse -\newcommand{\bs}{\symbol{'134}}%Print backslash -% \newcommand{\bs}{\ensuremath{\mathtt{\backslash}}}%Print backslash -% Index entry for a command (\cih for hidden command index -\newcommand{\cih}[1]{% - \index{commands!#1@\texttt{\bs#1}}% - \index{#1@\texttt{\hspace*{-1.2ex}\bs #1}}} -\newcommand{\ci}[1]{\cih{#1}\texttt{\bs#1}} -% Package -\newcommand{\pai}[1]{% - \index{packages!#1@\textsf{#1}}% - \index{#1@\textsf{#1}}% - \textsf{#1}} -% Index entry for an environment -\newcommand{\ei}[1]{% - \index{environments!\texttt{#1}}% - \index{#1@\texttt{#1}}% - \texttt{#1}} -% Indexentry for a word (Word inserted into the text) -\newcommand{\wi}[1]{\index{#1}#1} -\fi -% -% \end{macrocode} -% % \subsection{自定义命令和环境} % \label{sec:userdefine} % @@ -3256,9 +3334,9 @@ leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26]} % 为了兼容性保留之,推荐直接输入“——”。 % \changes{v2.1}{2006/01/12}{稍微加宽一点。同时把名字改为\textbf{破折号}:\cs{pozhehao}} % \begin{macrocode} -%<*cls> +%<*cfg> \newcommand{\pozhehao}{——} -% +% % \end{macrocode} % \end{macro} % @@ -3276,82 +3354,122 @@ leftmargin=10mm,labelsep=!,before*=\xiaosi[1.26]} % % \end{macrocode} % -% \Finale % % \iffalse % \begin{macrocode} %<*dtx-style> \ProvidesPackage{dtx-style} - +\RequirePackage{hypdoc} \RequirePackage[UTF8,scheme=chinese]{ctex} -\RequirePackage[top=2.5cm, bottom=2.5cm, headsep=5mm]{geometry} - +\RequirePackage[ + top=2.5cm, bottom=2.5cm, + left=4cm, right=2cm, + headsep=3mm]{geometry} \RequirePackage{calc} -\RequirePackage{array,longtable} -\RequirePackage{fancybox,fancyvrb} +\RequirePackage{array,longtable,booktabs} +\RequirePackage{listings} \RequirePackage{fancyhdr} \RequirePackage{xcolor} -\RequirePackage{url} -\RequirePackage{hyperref} \RequirePackage{enumitem} -\RequirePackage{ifxetex} +\RequirePackage{etoolbox} -\hypersetup{% - bookmarksnumbered=true, - bookmarksopen=true, - bookmarksopenlevel=1, - breaklinks=true, - colorlinks=true, - linkcolor=blue, - plainpages=false, - pdfborder=0 0 0} -\ifxetex - \hypersetup{% - CJKbookmarks=true} -\else - \hypersetup{% - unicode=true, - CJKbookmarks=false} -\fi +\colorlet{thu@macro}{blue!60!black} +\colorlet{thu@env}{blue!70!black} +\colorlet{thu@option}{purple} +\patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} +\patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{thu@macro}}{}{} +\patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} +\patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{thu@env}}{}{} -\setlist{nosep} -\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]{% - \ovalbox{\color{magenta}\bfseries\sffamily ##1}% - \SpecialOptionIndex{##1}}} - }{\endlist} +\def\DescribeOption{% + \leavevmode\@bsphack\begingroup\MakePrivateLetters% + \Describe@Option} +\def\Describe@Option#1{\endgroup + \marginpar{\raggedleft\PrintDescribeOption{#1}}% + \thu@special@index{option}{#1}\@esphack\ignorespaces} +\def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{thu@option} #1\ } +\def\thu@special@index#1#2{\@bsphack + \begingroup + \HD@target + \let\HDorg@encapchar\encapchar + \edef\encapchar usage{% + \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}% + }% + \index{#2\actualchar{\string\ttfamily\space#2} + (#1)\encapchar usage}% + \index{#1:\levelchar#2\actualchar + {\string\ttfamily\space#2}\encapchar usage}% + \endgroup + \@esphack} -\DefineVerbatimEnvironment{example}{Verbatim}% - {frame=single,framerule=0.3mm,rulecolor=\color{violet},% - fillcolor=\color{violet!5},framesep=1mm,baselinestretch=1.2,% - fontsize=\small,gobble=1} +\lstdefinestyle{lstStyleBase}{% + basicstyle=\small\ttfamily, + aboveskip=\medskipamount, + belowskip=\medskipamount, + lineskip=0pt, + boxpos=c, + showlines=false, + extendedchars=true, + upquote=true, + tabsize=2, + showtabs=false, + showspaces=false, + showstringspaces=false, + numbers=none, + linewidth=\linewidth, + xleftmargin=4pt, + xrightmargin=0pt, + resetmargins=false, + breaklines=true, + breakatwhitespace=false, + breakindent=0pt, + breakautoindent=true, + columns=flexible, + keepspaces=true, + gobble=2, + framesep=3pt, + rulesep=1pt, + framerule=1pt, + backgroundcolor=\color{gray!5}, + stringstyle=\color{green!40!black!100}, + keywordstyle=\bfseries\color{blue!50!black}, + commentstyle=\slshape\color{black!60}} -\DefineVerbatimEnvironment{shell}{Verbatim}% - {frame=single,framerule=0.3mm,rulecolor=\color{olive},% - fillcolor=\color{olive!5},framesep=1mm,fontsize=\small,gobble=1} +\lstdefinestyle{lstStyleShell}{% + style=lstStyleBase, + frame=l, + rulecolor=\color{purple}, + language=bash} -\newcommand{\myentry}[1]{\vskip5pt\par% - \noindent\llap{{\color{purple}\bfseries #1}}% - \marginpar{\strut}\hskip\parindent} +\lstdefinestyle{lstStyleLaTeX}{% + style=lstStyleBase, + frame=l, + rulecolor=\color{violet}, + language=[LaTeX]TeX} -\MakeShortVerb{\|} +\lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{} +\lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{} + +\setlist{nosep} + +\DeclareDocumentCommand{\option}{m}{\textsf{#1}} +\DeclareDocumentCommand{\env}{m}{\texttt{#1}} +\DeclareDocumentCommand{\pkg}{s m}{% + \texttt{#2}\IfBooleanF#1{\thu@special@index{package}{#2}}} +\DeclareDocumentCommand{\file}{s m}{% + \texttt{#2}\IfBooleanF#1{\thu@special@index{file}{#2}}} +\newcommand{\myentry}[1]{% + \marginpar{\raggedleft\color{purple}\bfseries\strut #1}} +\newcommand{\note}[1]{{% + \color{magenta}{\bfseries 说明:}\emph{#1}}} -\newcommand*\pkg[1]{\texttt{#1}} -\newcommand*\option[1]{\textsf{#1}} -\newcommand*\file[1]{\textsl{#1}} \def\thuthesis{\textsc{Thu}\-\textsc{Thesis}} -\newcommand{\note}[1]{\par% - {\color{magenta}{\bfseries 说明:}\emph{#1}}} % % \end{macrocode} % \fi % +% \Finale +% \endinput % \iffalse % Local Variables: diff --git a/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins b/Master/texmf-dist/source/latex/thuthesis/thuthesis.ins index 12ea8f1fd6d..d9eccdcc136 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-2015 by Ruini Xue +%% Copyright (C) 2005-2016 by Ruini Xue %% %% This file is part of the ThuThesis package project. %% --------------------------------------------------- @@ -68,7 +68,7 @@ This is the configuration file of the thuthesis package with LaTeX2e. \generate{\file{\jobname.cls}{\from{\jobname.dtx}{cls}} \usepreamble\cfgpreamble \file{\jobname.cfg}{\from{\jobname.dtx}{cfg}} - \nopreamble\nopostamble + \usepreamble\defaultpreamble\usepostamble\defaultpostamble \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}}} \ifToplevel{% -- cgit v1.2.3