| 1 |
% Documentation for pkuthss. |
| 2 |
% |
| 3 |
% Copyright (c) 2008-2009 solvethis |
| 4 |
% Copyright (c) 2010-2019,2021-2022,2024 Casper Ti. Vector |
| 5 |
% |
| 6 |
% This work may be distributed and/or modified under the conditions of the |
| 7 |
% LaTeX Project Public License, either version 1.3 of this license or (at |
| 8 |
% your option) any later version. |
| 9 |
% The latest version of this license is in |
| 10 |
% https://www.latex-project.org/lppl.txt |
| 11 |
% and version 1.3 or later is part of all distributions of LaTeX version |
| 12 |
% 2005/12/01 or later. |
| 13 |
% |
| 14 |
% This work has the LPPL maintenance status `maintained'. |
| 15 |
% The current maintainer of this work is Casper Ti. Vector. |
| 16 |
% |
| 17 |
% This work consists of the following files: |
| 18 |
% pkuthss.tex |
| 19 |
% pkuthss.bib |
| 20 |
% chap/pkuthss-copy.tex |
| 21 |
% chap/pkuthss-abs.tex |
| 22 |
% chap/pkuthss-intro.tex |
| 23 |
% chap/pkuthss-chap1.tex |
| 24 |
% chap/pkuthss-chap2.tex |
| 25 |
% chap/pkuthss-chap3.tex |
| 26 |
% chap/pkuthss-concl.tex |
| 27 |
% chap/pkuthss-encl1.tex |
| 28 |
% chap/pkuthss-ack.tex |
| 29 |
|
| 30 |
\chapter{pkuthss 文档模版提供的功能} |
| 31 |
\section{pkuthss 文档类提供的选项}\label{sec:options} |
| 32 |
|
| 33 |
除非特别说明,否则这一节提到的选项中都是不带“\verb|no|”的版本被启用。 |
| 34 |
|
| 35 |
\begin{itemize} |
| 36 |
\item \textbf{\texttt{[no]uppermark}}: |
| 37 |
是否在页眉中将章节名中的小写字母转换为大写字母。 |
| 38 |
就目前而言,这样的转换存在着一些较为严重的缺陷\footnote{% |
| 39 |
准确地说是 \texttt{\string\MakeUppercase} 宏的问题: |
| 40 |
其在某些地方的转换不够健壮, |
| 41 |
例如 \texttt{\string\cite\string{ctex\string}} |
| 42 |
会被转换成 \texttt{\string\cite\string{CTEX\string}}。% |
| 43 |
},因此不建议使用。 |
| 44 |
基于上述考虑,\myemph{% |
| 45 |
pkuthss 文档类默认启用 \texttt{nouppermark} 选项, |
| 46 |
即不在页眉中使用大写的章节名% |
| 47 |
}。 |
| 48 |
|
| 49 |
\item \textbf{\texttt{[no]pkufont}}: |
| 50 |
是否根据学校对论文格式的要求\cupercite{pku-thesisstyle}% |
| 51 |
将西文字体改为类似于 Times New Roman / Arial 的字体。 |
| 52 |
|
| 53 |
\item \textbf{\texttt{[no]pkufoot}}\footnote{% |
| 54 |
此选项等价于 1.6.4 及以前版本 pkuthss-extra 宏包的 |
| 55 |
\texttt{[no]footfmt} 选项; |
| 56 |
更改名称是为了使文档类选项名更加规则。% |
| 57 |
}: |
| 58 |
是否根据学校对论文格式的要求\cupercite{pku-thesisstyle}% |
| 59 |
修改和脚注相关的一些格式。 |
| 60 |
具体地说,启用 \verb|pkufoot| 选项后会进行以下几项设置: |
| 61 |
\begin{itemize} |
| 62 |
\item 脚注参用带圈的编号。 |
| 63 |
\item 页脚中脚注编号使用正文(而非上标)字体。 |
| 64 |
\item 页脚中脚注编号和脚注文本之间默认间隔一个空格。 |
| 65 |
\end{itemize} |
| 66 |
|
| 67 |
\item \textbf{\texttt{[no]pkuspace}}: |
| 68 |
是否根据学校对论文格式的要求\cupercite{pku-thesisstyle}% |
| 69 |
修改排版中的一些间距及相关设置。 |
| 70 |
具体地说,启用 \verb|pkuspace| 选项后会按 |
| 71 |
\parencite{pku-thesisstyle} 中的要求修改以下几项设置: |
| 72 |
\begin{itemize} |
| 73 |
\item 正文的行距。 |
| 74 |
\item 目录中条目的缩进方式。 |
| 75 |
\item 图表标题的字号,以及标题中编号和标题文字之间的间隔方式 |
| 76 |
(例如图 \ref{fig:example} 所示)。 |
| 77 |
\end{itemize} |
| 78 |
|
| 79 |
\begin{figure}[htbp!] |
| 80 |
\centering |
| 81 |
\includegraphics[width = 0.5\textwidth]{pkuword} |
| 82 |
\caption{示例插图}\label{fig:example} |
| 83 |
\end{figure} |
| 84 |
|
| 85 |
\item \textbf{\texttt{[no]spacing}}\footnote{% |
| 86 |
因为代码重构的缘故, |
| 87 |
此选项同时提供 1.5.5 及以前版本 pkuthss-extra 宏包 |
| 88 |
中 \texttt{[no]tightlist} 选项所提供的功能。% |
| 89 |
}: |
| 90 |
是否采用一些常用的调整间距的额外版式设定。 |
| 91 |
具体地说,启用 \verb|spacing| 选项后会进行以下几项设置: |
| 92 |
\begin{itemize} |
| 93 |
\item 调用 setspace 宏包以使某些细节处的空间安排更美观。 |
| 94 |
\item 采用比 \hologo{LaTeX} 默认设定更加紧密的枚举环境% |
| 95 |
\footnote{% |
| 96 |
在枚举环境(itemize、enumerate 和 description)中, |
| 97 |
每个条目的内容较少时,条目往往显得稀疏; |
| 98 |
在参考文献列表中也有类似的现象。 |
| 99 |
启用 \texttt{spacing} 选项后, |
| 100 |
将去掉这些环境中额外增加的(垂直)间隔。% |
| 101 |
}。 |
| 102 |
\item 调整枚举环境的缩进,以适应中文排版中的习惯。 |
| 103 |
\end{itemize} |
| 104 |
|
| 105 |
\item \textbf{\texttt{[no]spechap}}\footnote{% |
| 106 |
“spechap”是“\textbf{spec}ial \textbf{chap}ter”的缩写。% |
| 107 |
}: |
| 108 |
是否启用第 \ref{ssec:misc} 小节中介绍的 \verb|\specialchap| 命令。 |
| 109 |
|
| 110 |
\item \textbf{\texttt{[no]pdftoc}}\footnote{% |
| 111 |
此选项部分等价于 1.4 alpha2 及以前版本 pkuthss-extra 宏包 |
| 112 |
的 \texttt{[no]tocbibind} 选项。 |
| 113 |
因为 tocbibind 宏包和 biblatex 宏包冲突,% |
| 114 |
pkuthss 文档类不再调用 tocbibind 宏包。% |
| 115 |
}: |
| 116 |
启用 \verb|pdftoc| 选项后, |
| 117 |
用 \verb|\tableofcontents| 命令生成目录时会自动添加“目录”的 pdf 书签。 |
| 118 |
|
| 119 |
\item \textbf{\texttt{[no]pdfprop}}: |
| 120 |
是否自动根据设定的论文文档信息(如作者、标题等) |
| 121 |
设置生成的 pdf 文档的相应属性。\myemph{% |
| 122 |
注意:该选项实际上是在 \texttt{\string\maketitle} 时生效的, |
| 123 |
这是因为考虑到 |
| 124 |
通常用户在调用 \texttt{\string\maketitle} 前 |
| 125 |
已经设置好所有的文档信息。 |
| 126 |
若用户不调用 \texttt{\string\maketitle}, |
| 127 |
则须在设定完文档信息之后自行调用 |
| 128 |
第 \ref{ssec:misc} 小节中介绍的 |
| 129 |
\texttt{\string\setpdfproperties} 命令以完成 |
| 130 |
pdf 文档属性的设定。% |
| 131 |
} |
| 132 |
|
| 133 |
\item \textbf{其余文档类选项}:% |
| 134 |
pkuthss 文档类以 ctexbook 文档类为基础, |
| 135 |
其接受的其余所有文档类选项均被传递给 ctexbook。 |
| 136 |
其中可能最常用的选项是 \verb|GBK| 和 \verb|UTF8|: |
| 137 |
它们选择源代码使用的字符编码,默认使用 \verb|GBK|。 |
| 138 |
\end{itemize} |
| 139 |
|
| 140 |
例如,如果须要使用 UTF-8 编码撰写论文, |
| 141 |
则应在载入 pkuthss 文档类时加上 \verb|UTF8| 选项: |
| 142 |
\begin{Verbatim} |
| 143 |
\documentclass[UTF8, ...]{pkuthss} % “...”代表其它的选项。 |
| 144 |
\end{Verbatim} |
| 145 |
|
| 146 |
又例如,文档默认情况下是双面模式,每章都从右页(奇数页)开始。 |
| 147 |
如果希望改成一章可以从任意页开始,可以这样设置: |
| 148 |
\begin{Verbatim} |
| 149 |
\documentclass[openany, ...]{pkuthss} % 每章从任意页开始。 |
| 150 |
\end{Verbatim} |
| 151 |
|
| 152 |
\section{pkuthss 文档类提供的命令和环境} |
| 153 |
\subsection{设定文档信息的命令}\label{ssec:set-cmd} |
| 154 |
|
| 155 |
这一类命令的语法为 |
| 156 |
\begin{Verbatim} |
| 157 |
\commandname{具体信息} % commandname 为具体命令的名称。 |
| 158 |
\end{Verbatim} |
| 159 |
|
| 160 |
这些命令总结如下: |
| 161 |
\begin{itemize} |
| 162 |
\item \texttt{\bfseries\string\ctitle}:设定论文中文标题\footnote{% |
| 163 |
因为 pkuthss 内部实现机制的缘故,\myemph{双盲版论文的(中文和西文) |
| 164 |
标题如须强制换行,必须使用 pkuthss 提供的 \texttt{\string\thssnl} |
| 165 |
命令而非 \texttt{\string\\}},否则会出错。% |
| 166 |
}; |
| 167 |
\item \texttt{\bfseries\string\etitle}:设定论文西文标题; |
| 168 |
\item \texttt{\bfseries\string\cauthor}:设定作者的中文名; |
| 169 |
\item \texttt{\bfseries\string\eauthor}:设定作者的西文名; |
| 170 |
\item \texttt{\bfseries\string\date}:设定日期; |
| 171 |
\item \texttt{\bfseries\string\studentid}:设定作者的学号; |
| 172 |
\item \texttt{\bfseries\string\school}:设定作者的学院名; |
| 173 |
\item \texttt{\bfseries\string\cmajor}:设定作者专业(二级学科)的中文名; |
| 174 |
\item \texttt{\bfseries\string\emajor}:设定作者专业(二级学科)的西文名; |
| 175 |
\item \texttt{\bfseries\string\direction}:设定作者的研究方向; |
| 176 |
\item \texttt{\bfseries\string\cmentor}:设定导师的中文名; |
| 177 |
\item \texttt{\bfseries\string\ementor}:设定导师的西文名; |
| 178 |
\item \texttt{\bfseries\string\ckeywords}:设定中文关键词; |
| 179 |
\item \texttt{\bfseries\string\ekeywords}:设定西文关键词; |
| 180 |
\item \texttt{\bfseries\string\degreetype}: |
| 181 |
设定学位类型(1 为学术学位,2 为专业学位,设为 0 则不显示学位类型); |
| 182 |
\item \texttt{\bfseries\string\blindid}:设定论文编号(双盲评审用); |
| 183 |
\item \texttt{\bfseries\string\discipline}:设定一级学科(双盲评审用)。 |
| 184 |
\end{itemize} |
| 185 |
排版双盲版论文时除了要去掉致谢等章节、隐去论文中其它可能泄露个人信息的部分外, |
| 186 |
还应注意在排版封面时须使用 \verb|\makeblind| 而非 \verb|\maketitle| 命令。 |
| 187 |
|
| 188 |
例如,如果要设定专业为“化学”(“Chemistry”),则可以使用以下命令: |
| 189 |
\begin{Verbatim} |
| 190 |
\cmajor{化学} |
| 191 |
\emajor{Chemistry} |
| 192 |
\end{Verbatim} |
| 193 |
|
| 194 |
\subsection{自身存储文档信息的命令} |
| 195 |
|
| 196 |
这一类命令的语法为 |
| 197 |
\begin{Verbatim} |
| 198 |
% commandname 为具体的命令名。 |
| 199 |
\renewcommand{\commandname}{具体信息} |
| 200 |
\end{Verbatim} |
| 201 |
|
| 202 |
这些命令总结如下: |
| 203 |
\begin{itemize} |
| 204 |
\item \texttt{\bfseries\string\cuniversity}:大学的中文名。 |
| 205 |
\item \texttt{\bfseries\string\euniversity}:大学的西文名。 |
| 206 |
\item \texttt{\bfseries\string\cthesisname}:论文类别的中文名。 |
| 207 |
\item \texttt{\bfseries\string\ethesisname}:论文类别的西文名。 |
| 208 |
\item \texttt{\bfseries\string\thesiscover}:封面显示的论文类别\footnote{% |
| 209 |
出于兼容性的考虑,如果 \texttt{\string\thesiscover} 为空, |
| 210 |
那么封面将显示 \texttt{\string\cthesisname}。% |
| 211 |
}。 |
| 212 |
\item \texttt{\bfseries\string\mentorlines}:封面“导师”部分的行数。 |
| 213 |
\item \texttt{\bfseries\string\cabstractname}:摘要的中文标题。 |
| 214 |
\item \texttt{\bfseries\string\eabstractname}:摘要的西文标题。 |
| 215 |
\end{itemize} |
| 216 |
|
| 217 |
例如,如果要设定论文的类别为“博士学位论文”(“Doctor Thesis”), |
| 218 |
但封面要显示“博士研究生学位论文”,则可以使用以下命令: |
| 219 |
\begin{Verbatim} |
| 220 |
\renewcommand{\cthesisname}{博士学位论文} |
| 221 |
\renewcommand{\ethesisname}{Doctor Thesis} |
| 222 |
\renewcommand{\thesiscover}{博士研究生学位论文} |
| 223 |
\end{Verbatim} |
| 224 |
|
| 225 |
\subsection{以“key = value”格式设置文档信息} |
| 226 |
|
| 227 |
用户可以通过 \verb|\pkuthssinfo| 命令集中设定文档信息,其语法为: |
| 228 |
\begin{Verbatim} |
| 229 |
% key1、key2、value1、value2 等为具体文档信息的项目名和内容。 |
| 230 |
\pkuthssinfo{key1 = value1, key2 = value2, ...} |
| 231 |
\end{Verbatim} |
| 232 |
其中文档信息的项目名为前面提到的设定文档信息的命令名 |
| 233 |
或自身存储文档信息的命令名(不带反斜杠)。 |
| 234 |
|
| 235 |
当文档信息的内容包含了逗号等有干扰的字符时, |
| 236 |
可以用大括号将这一项文档信息的全部内容括起来。\myemph{% |
| 237 |
我们建议用户总用大括号将文档信息的内容括起来, |
| 238 |
以避免很多不必要的麻烦。% |
| 239 |
} |
| 240 |
|
| 241 |
例如,前面提到的文档信息的设置可以集中地写成: |
| 242 |
\begin{Verbatim} |
| 243 |
\pkuthssinfo{ |
| 244 |
..., % “...”代表其它的设定。 |
| 245 |
cthesisname = {本科生毕业论文}, |
| 246 |
ethesisname = {Undergraduate Thesis}, |
| 247 |
cmajor = {化学}, emajor = {Chemistry} |
| 248 |
} |
| 249 |
\end{Verbatim} |
| 250 |
|
| 251 |
\subsection{其它命令和环境}\label{ssec:misc} |
| 252 |
|
| 253 |
\texttt{\bfseries cabstract} 和 \texttt{\bfseries eabstract} 环境用于编写 |
| 254 |
中西文摘要;\texttt{\bfseries beabstract} 环境用于编写双盲评审版的西文摘要。 |
| 255 |
用户只须要写摘要的正文;标题、作者、导师、专业等部分会自动生成。 |
| 256 |
|
| 257 |
\texttt{\bfseries\string\specialchap} 命令 |
| 258 |
用于开始不进行标号但计入目录的一章, |
| 259 |
并合理安排其页眉。\myemph{% |
| 260 |
注意:须要启用 \texttt{spechap} 选项才能使用此命令。 |
| 261 |
另外,在此章内的节或小节等命令应使用带星号的版本, |
| 262 |
例如 \texttt{\string\section\string*} 等, |
| 263 |
以免造成章节编号混乱。% |
| 264 |
}% |
| 265 |
例如,本文档中的“序言”一章就是用 \verb|\specialchap{序言}| |
| 266 |
这条命令开始的。% |
| 267 |
|
| 268 |
\texttt{\bfseries\string\setpdfproperties} 命令 |
| 269 |
用于根据用户设定的文档信息自动设定生成的 pdf 文档的属性。 |
| 270 |
此命令会在用户调用 \verb|\maketitle| 命令时被自动调用, |
| 271 |
因此通常不需要用户自己使用; |
| 272 |
但用户有时可能不须要输出封面,从而不会调用 \verb|\maketitle| 命令, |
| 273 |
此时就须要在设定完文档信息之后调用 \verb|\setpdfproperties|。% |
| 274 |
\myemph{注意:须要启用 \texttt{pdfprop} 选项才能使用此命令。} |
| 275 |
|
| 276 |
\texttt{\bfseries\string\thssnl} 命令用于在双盲版论文的(中文和西文)标题中 |
| 277 |
强制换行,见第 \ref{ssec:set-cmd} 小节中关于 \verb|\ctitle| 说明的脚注。 |
| 278 |
|
| 279 |
\section{从其它文档类和宏包继承的功能}\label{sec:thirdparty} |
| 280 |
|
| 281 |
pkuthss 文档类建立在 ctexbook\cupercite{ctex} 文档类之上, |
| 282 |
并调用了 geometry\cupercite{geometry}、fancyhdr\cupercite{fancyhdr}、% |
| 283 |
hyperref\cupercite{hyperref}、graphicx\cupercite{graphicx} |
| 284 |
和 ulem\cupercite{ulem} 等几个宏包。 |
| 285 |
因此,ctexbook 文档类和这些宏包所提供的功能均可以使用。 |
| 286 |
|
| 287 |
例如,用户如果想将目录的标题改为“目{\quad\quad}录”, |
| 288 |
则可以使用 ctexbook 文档类提供的 \verb|\ctexset| 命令: |
| 289 |
\begin{Verbatim} |
| 290 |
\ctexset[contentsname = {目{\quad\quad}录}] |
| 291 |
\end{Verbatim} |
| 292 |
|
| 293 |
在默认的配置下,% |
| 294 |
pkuthss 文档模版使用作者编写的 biblatex\cupercite{biblatex} 样式% |
| 295 |
\cupercite{biblatex-caspervector}进行参考文献和引用的排版, |
| 296 |
用户可以使用它以及 biblatex 本身所提供的功能。 |
| 297 |
例如,用户可以分别使用 \verb|\cite|、\verb|\parencite| 和 \verb|\supercite| |
| 298 |
生成未格式化的、带方括号的和上标且带方括号的引用标记: |
| 299 |
\begin{Verbatim} |
| 300 |
\cite{ctex},\parencite{ctex},\supercite{ctex} |
| 301 |
\end{Verbatim} |
| 302 |
在本文中将产生“\cite{ctex},\parencite{ctex},\supercite{ctex}”。 |
| 303 |
|
| 304 |
就目前而言,在 biblatex 中,通过更复杂的设置, |
| 305 |
还可以满足例如被引用的文献按照引用顺序排序, |
| 306 |
而未引用的文献按照西文文献在前、中文文献在后排序这样的需求, |
| 307 |
详见 biblatex-caspervector 的文档\cupercite{biblatex-caspervector}。 |
| 308 |
|
| 309 |
除此之外,pkuthss 文档类还可能调用以下这些宏包: |
| 310 |
\begin{itemize} |
| 311 |
\item 启用 \verb|pkufont| 选项时会调用 unicode-math |
| 312 |
\cupercite{unicode-math} 宏包(\hologo{XeLaTeX} 编译)或 |
| 313 |
mathptmx/helvet\cupercite{psnfss} 和 textcomp 宏包(非 |
| 314 |
\hologo{XeLaTeX} 编译),此外在非 \hologo{XeLaTeX} 编译或不启用 |
| 315 |
\verb|pkufont| 选项时均会调用 amssymb\cupercite{amssymb} 宏包。 |
| 316 |
\item 启用 \verb|pkufoot| 选项时会调用 |
| 317 |
tikz\cupercite{tikz} 和 scrextend\cupercite{scrextend} 宏包。 |
| 318 |
\item 启用 \verb|pkuspace| 选项时会调用 |
| 319 |
tocloft\cupercite{tocloft}、caption\cupercite{caption} 和 |
| 320 |
subcaption\cupercite{subcaption} 宏包。 |
| 321 |
\item 启用 \verb|spacing| 选项时会调用 setspace 和 |
| 322 |
enumitem\cupercite{enumitem} 宏包。 |
| 323 |
\end{itemize} |
| 324 |
因此在启用相应选项时,用户可以使用对应宏包所提供的功能。 |
| 325 |
|
| 326 |
\section{高级设置}\label{sec:advanced} |
| 327 |
|
| 328 |
pkuthss 文档模版的实现是简洁、清晰、灵活的。 |
| 329 |
当一些细节的自定义无法通过模版提供的外部接口实现时, |
| 330 |
我们鼓励用户(在适当理解相关部分代码的前提下) |
| 331 |
通过修改 pkuthss 文档类的源文件进行自定义。 |
| 332 |
在目前常用的 \hologo{TeX} 系统中, |
| 333 |
假设 pkuthss 的说明文档所在目录具有下述形式的路径: |
| 334 |
\begin{Verbatim} |
| 335 |
# 说明文档所在目录($TEXMFDIST 的形式见下面几行): |
| 336 |
$TEXMFDIST/doc/latex/pkuthss/ |
| 337 |
# 若用户使用 Windows 下的 TeX Live 系统,则 $TEXMFDIST 一般类似于: |
| 338 |
C:\texlive\2015\texmf-dist |
| 339 |
# 若用户使用类 Unix 下的 TeX Live 系统,则 $TEXMFDIST 一般类似于: |
| 340 |
/usr/local/texlive/2015/texmf-dist |
| 341 |
\end{Verbatim} |
| 342 |
则其源文件所在目录应该位于以下目录: |
| 343 |
\begin{Verbatim} |
| 344 |
$TEXMFDIST/tex/latex/pkuthss/ |
| 345 |
\end{Verbatim} |
| 346 |
|
| 347 |
如果的确须要修改 pkuthss 文档类的源文件,\myemph{% |
| 348 |
建议用户将 \texttt{pkuthss.cls} 或其它须要修改的文件 |
| 349 |
复制到被编译的主文件所在的目录, |
| 350 |
然后对此副本进行修改% |
| 351 |
}\footnote{% |
| 352 |
能这样做的原因是目前常用的 \hologo{TeX} 系统在读取编译用到的文件时, |
| 353 |
会优先考虑工作目录(即主文件所在目录)中的文件。% |
| 354 |
}。这样做的目的主要是使用户不必在每次调整文档类文件时都去上述路径修改; |
| 355 |
同时这样也可以在(万一须要)更新 \hologo{TeX} 系统时, |
| 356 |
防止用户修改过的文档类文件在更新中被自动覆盖掉。 |
| 357 |
|
| 358 |
一个常见的需求是封面中部分内容(特别是论文的标题、专业和研究方向)太长, |
| 359 |
超出了在预设的空间。 |
| 360 |
此时,用户可以修改 \verb|pkuthss.cls| 里 \verb|\maketitle| 定义中 |
| 361 |
\verb|\thss@int@fillinblank| 宏的参数来改变带下划线的空白的行数和行宽, |
| 362 |
具体方法可以参考该文件中和 \verb|\mentorlines| 相关的代码。 |
| 363 |
|
| 364 |
% vim:ts=4:sw=4 |