2014-04-11 21:26:52 +08:00
|
|
|
|
% Documentation for pkuthss.
|
|
|
|
|
|
%
|
2011-06-26 02:08:21 +08:00
|
|
|
|
% Copyright (c) 2008-2009 solvethis
|
2019-11-15 21:47:34 +08:00
|
|
|
|
% Copyright (c) 2010-2019 Casper Ti. Vector
|
2014-04-11 21:26:52 +08:00
|
|
|
|
%
|
|
|
|
|
|
% This work may be distributed and/or modified under the conditions of the
|
|
|
|
|
|
% LaTeX Project Public License, either version 1.3 of this license or (at
|
|
|
|
|
|
% your option) any later version.
|
|
|
|
|
|
% The latest version of this license is in
|
2017-03-07 21:39:19 +08:00
|
|
|
|
% https://www.latex-project.org/lppl.txt
|
2014-04-11 21:26:52 +08:00
|
|
|
|
% and version 1.3 or later is part of all distributions of LaTeX version
|
|
|
|
|
|
% 2005/12/01 or later.
|
|
|
|
|
|
%
|
|
|
|
|
|
% This work has the LPPL maintenance status `maintained'.
|
|
|
|
|
|
% The current maintainer of this work is Casper Ti. Vector.
|
|
|
|
|
|
%
|
|
|
|
|
|
% This work consists of the following files:
|
|
|
|
|
|
% pkuthss.tex
|
2018-06-07 17:27:14 +08:00
|
|
|
|
% chap/pkuthss-copy.tex
|
|
|
|
|
|
% chap/pkuthss-abs.tex
|
|
|
|
|
|
% chap/pkuthss-intro.tex
|
2015-06-19 14:43:04 +08:00
|
|
|
|
% chap/pkuthss-chap1.tex
|
|
|
|
|
|
% chap/pkuthss-chap2.tex
|
|
|
|
|
|
% chap/pkuthss-chap3.tex
|
2018-06-07 17:27:14 +08:00
|
|
|
|
% chap/pkuthss-concl.tex
|
2015-06-19 14:43:04 +08:00
|
|
|
|
% chap/pkuthss-encl1.tex
|
2018-06-07 17:27:14 +08:00
|
|
|
|
% chap/pkuthss-ack.tex
|
2011-06-26 02:08:21 +08:00
|
|
|
|
|
2011-06-26 02:08:15 +08:00
|
|
|
|
\chapter{使用介绍}
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\section{系统要求}\label{sec:req}
|
|
|
|
|
|
|
|
|
|
|
|
正确编译需要以下几部分:
|
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
|
\item 一个基本的 \hologo{TeX} 发行版。
|
|
|
|
|
|
\item CJK 或 XeCJK(供 \hologo{XeLaTeX} 使用)宏包。
|
2019-08-01 23:45:25 +08:00
|
|
|
|
\item ctex\cupercite{ctex} 宏包(提供了 ctexbook 文档类)。
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\item 中文字体。
|
|
|
|
|
|
\item 如果要使用 biblatex 进行文献列表和引用的排版的话,
|
2019-08-01 23:45:25 +08:00
|
|
|
|
还需要 biblatex\cupercite{biblatex} 宏包;
|
2018-06-23 21:07:15 +08:00
|
|
|
|
\item 如果要对中文文献进行按汉语拼音的排序的话,
|
2019-08-01 23:45:25 +08:00
|
|
|
|
还需要 biber\cupercite{biber} 程序。
|
2015-12-16 20:12:37 +08:00
|
|
|
|
\item 如果使用默认的文献列表和引用样式的话,还需要作者编写的 biblatex 样式
|
2019-08-01 23:45:25 +08:00
|
|
|
|
(biblatex-caspervector\cupercite{biblatex-caspervector}),
|
2016-03-20 23:05:01 +08:00
|
|
|
|
此样式要求使用 biber 程序。
|
2019-11-15 21:47:34 +08:00
|
|
|
|
\item 如果须要使用 latexmk 来实现自动编译,还需要 latexmk 工具。
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\end{itemize}
|
|
|
|
|
|
|
|
|
|
|
|
\myemph{最新}的\myemph{完全版} \hologo{TeX} Live 系统(\myemph{%
|
2015-12-16 20:12:37 +08:00
|
|
|
|
注:某些 Linux 发行版软件仓库中的 \hologo{TeX} Live 有问题,
|
2015-12-16 18:54:17 +08:00
|
|
|
|
建议使用独立安装版的 \hologo{TeX} Live%
|
2017-03-07 21:39:19 +08:00
|
|
|
|
\unemph{\footnote{\url{https://www.tug.org/texlive/}.}}。%
|
2019-11-15 21:47:34 +08:00
|
|
|
|
})都已经包含除中文字体之外所有要求的项目。%
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\myemph{%
|
|
|
|
|
|
为了获得最好的支持,
|
|
|
|
|
|
我们建议用户使用最新、完全版的 \hologo{TeX} 系统和各宏包。%
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-28 15:20:27 +08:00
|
|
|
|
中文字体需要用户自行获得。\myemph{%
|
2015-12-16 20:12:37 +08:00
|
|
|
|
注:一些中文字体的字库不全,只有 GB2312 字符集内字符的字体信息。
|
2015-12-16 18:54:17 +08:00
|
|
|
|
这种情况通常会造成编译生成的 pdf 文件中缺少部分字符,
|
|
|
|
|
|
其中一种典型症状是“〇”字显示不出来。
|
|
|
|
|
|
如果要使用中易公司的字体,
|
2015-12-16 20:12:37 +08:00
|
|
|
|
则建议使用 Windows Vista 及其以后版本提供的宋体、黑体、楷体和仿宋体,
|
2015-12-16 18:54:17 +08:00
|
|
|
|
以及 Microsoft Office 2003 及其以后版本提供的隶书和幼圆体,
|
|
|
|
|
|
这些字体是 GB18030 字符集的,不存在上述问题。%
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
\section{模版文件}\label{sec:doc-dir}
|
|
|
|
|
|
|
|
|
|
|
|
在正确安装 pkuthss 文档模版之后,在终端/命令提示符中执行
|
2018-07-02 17:10:00 +08:00
|
|
|
|
\begin{Verbatim}
|
2012-10-10 22:08:00 +08:00
|
|
|
|
texdoc pkuthss
|
2011-06-26 02:08:21 +08:00
|
|
|
|
\end{Verbatim}
|
2015-12-16 18:54:17 +08:00
|
|
|
|
所打开的 pdf 文件所在的同一目录中包含两个子目录和相应的两个 pdf 文件,
|
|
|
|
|
|
其中 \verb|readme/| 为说明文档(即本文档)的源代码,%
|
|
|
|
|
|
\verb|example/| 为文档模版的源代码,%
|
2019-11-16 01:49:23 +08:00
|
|
|
|
\verb|pkuthss.pdf| 和 \verb|example.pdf|
|
2015-12-16 18:54:17 +08:00
|
|
|
|
分别为说明文档和文档模版的 pdf 文件。
|
|
|
|
|
|
|
|
|
|
|
|
\verb|example/| 目录下的源代码使用的是 UTF-8 编码,
|
|
|
|
|
|
在现在 \hologo{TeX} 用户常用的编辑器中均已经有了良好的支持。
|
|
|
|
|
|
用户可以将 \verb|example/| 中的所有内容复制到合适的目录,
|
|
|
|
|
|
并在此目录中根据模版修改出自己的论文。
|
|
|
|
|
|
|
|
|
|
|
|
\myemph{%
|
2015-12-16 20:12:37 +08:00
|
|
|
|
注意:在 1.4 rc4 之后版本的 pkuthss 文档模版中,
|
|
|
|
|
|
除了 \texttt{Make.bat} 之外,所有文件均是 LF(\texttt{\string\n})换行。
|
2015-12-16 18:54:17 +08:00
|
|
|
|
在 Windows 下用“记事本”打开这些文件时,
|
|
|
|
|
|
所有的换行会变成某个奇怪的字符,而所有文字会挤在一行上。
|
|
|
|
|
|
这是“记事本”的固有问题,
|
2015-12-16 20:12:37 +08:00
|
|
|
|
因此 pkuthss 文档模版的作者建议用户使用支持 LF 换行的文本编辑器编辑文件。%
|
2015-12-16 18:54:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-15 21:47:34 +08:00
|
|
|
|
模版中的关键文件有:
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\begin{itemize}
|
2019-11-15 00:36:27 +08:00
|
|
|
|
\item \verb|ctexopts.cfg|、\verb|ctex-fontset-pkuthss.def|:
|
|
|
|
|
|
比较常用的字体配置,适用于 2.0 及以后版本的
|
|
|
|
|
|
ctex\cupercite{ctex} 宏包。
|
2019-11-15 21:47:34 +08:00
|
|
|
|
\item \verb|latexmkrc|:
|
|
|
|
|
|
被 latexmk 工具读取的配置文件,用于使编译工作自动化。
|
|
|
|
|
|
\item \verb|Make.bat|:%
|
|
|
|
|
|
方便 Windows 用户使用的批处理文件,会调用 latexmk。
|
|
|
|
|
|
\item \verb|spine.tex|:书脊的源文件,具体用法请参考其中代码。
|
|
|
|
|
|
\item \verb|thesis.tex|:示例模版的主文件。
|
2015-12-16 18:54:17 +08:00
|
|
|
|
|
|
|
|
|
|
\item \verb|chap/|:目录,包含各章节内容:
|
2011-06-26 02:08:20 +08:00
|
|
|
|
\begin{itemize}
|
2019-11-15 21:47:34 +08:00
|
|
|
|
\item \verb|copy.tex|:版权声明部分。
|
|
|
|
|
|
\item \verb|origin.tex|:
|
2019-08-01 23:45:25 +08:00
|
|
|
|
原创性声明和使用授权说明部分\cupercite{pku-originauth}。
|
2011-06-26 02:08:15 +08:00
|
|
|
|
\end{itemize}
|
2014-04-29 14:55:43 +08:00
|
|
|
|
\myemph{%
|
2019-11-15 21:47:34 +08:00
|
|
|
|
注:pkuthss 文档模版可排版学校要求的二维码,
|
|
|
|
|
|
请参考 \texttt{copy.tex} 和 \texttt{origin.tex} 中的相关注释。%
|
2014-04-29 14:55:43 +08:00
|
|
|
|
}
|
2015-12-16 18:54:17 +08:00
|
|
|
|
\end{itemize}
|
|
|
|
|
|
|
|
|
|
|
|
\section{编译方式}\label{sec:compile}
|
|
|
|
|
|
|
|
|
|
|
|
pkuthss 文档模版支持三种编译方式,即
|
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
|
\item \hologo{LaTeX} -- dvipdfmx 方式:\\
|
|
|
|
|
|
依次执行 \verb|latex|,\verb|biber|,%
|
|
|
|
|
|
\verb|latex|,\verb|latex| 和 \verb|dvipdfmx|。
|
|
|
|
|
|
\item \hologo{pdfLaTeX} 方式:\\
|
|
|
|
|
|
依次执行 \verb|pdflatex|,\verb|biber|,%
|
|
|
|
|
|
\verb|pdflatex| 和 \verb|pdflatex|。
|
|
|
|
|
|
\item \hologo{XeLaTeX} 方式:\\
|
|
|
|
|
|
依次执行 \verb|xelatex|,\verb|biber|,%
|
|
|
|
|
|
\verb|xelatex| 和 \verb|xelatex|。
|
|
|
|
|
|
\end{itemize}
|
|
|
|
|
|
\myemph{%
|
2019-11-15 21:47:34 +08:00
|
|
|
|
注意:在特定情形下,\texttt{latex}/\texttt{pdflatex}/\texttt{xelatex}
|
|
|
|
|
|
步骤可能须要执行多于 2 次,而下文推荐的 latexmk 工具会自动处理这类情形。
|
|
|
|
|
|
此外,\hologo{XeLaTeX} 对非 UTF-8 编码的支持不好,
|
2015-12-16 18:54:17 +08:00
|
|
|
|
因此 \hologo{XeLaTeX} 方式的编译不支持 GBK 编码。%
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-11-15 21:47:34 +08:00
|
|
|
|
pkuthss 文档模版附带的 \verb|latexmkrc| 中已经对这三种编译方式进行了完整的
|
|
|
|
|
|
配置。用户只须要在 \verb|latexmkrc| 中通过设定变量 \verb|default_files|
|
|
|
|
|
|
的值指定被编译的主文件名,并通过设定变量 \verb|pdf_mode| 的值指定采用
|
|
|
|
|
|
哪种编译方式,即可通过在主文件所在目录调用 latexmk 工具来实现自动编译:
|
|
|
|
|
|
类 UNIX 环境下大致如下
|
2018-07-02 17:10:00 +08:00
|
|
|
|
\begin{Verbatim}
|
2014-07-04 00:13:46 +08:00
|
|
|
|
cd /path/to/directory/with/thesis.tex
|
2019-11-15 21:47:34 +08:00
|
|
|
|
latexmk
|
2013-12-27 11:20:17 +08:00
|
|
|
|
\end{Verbatim}
|
2019-11-15 21:47:34 +08:00
|
|
|
|
而在 Windows 环境下大致如下
|
2018-07-02 17:10:00 +08:00
|
|
|
|
\begin{Verbatim}
|
2014-07-04 00:13:46 +08:00
|
|
|
|
cd \path\to\directory\with\thesis.tex
|
2019-11-15 21:47:34 +08:00
|
|
|
|
latexmk
|
2013-12-27 11:20:17 +08:00
|
|
|
|
\end{Verbatim}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2019-11-15 21:47:34 +08:00
|
|
|
|
Windows 用户也可以使用批处理文件 \verb|Make.bat|:
|
|
|
|
|
|
在主文件所在目录双击此文件,它便会调用 latexmk 进行编译。\myemph{%
|
2015-12-16 18:54:17 +08:00
|
|
|
|
注意:%
|
|
|
|
|
|
Windows 批处理对于 LF(\texttt{\string\n})换行的批处理文件支持有问题。
|
|
|
|
|
|
在命令提示符(cmd)下执行这些批处理文件时没有问题,
|
|
|
|
|
|
但双击文件图标执行时可能就会出错。
|
|
|
|
|
|
\hologo{TeX} Live 中安装的 \texttt{Make.bat} 和
|
|
|
|
|
|
CTAN 上提供的压缩包里的 \texttt{Make.bat}
|
2019-11-15 21:47:34 +08:00
|
|
|
|
在正常情况下应该是 CRLF(\texttt{\string\r\string\n})换行的。%
|
2015-12-16 18:54:17 +08:00
|
|
|
|
}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2016-02-27 21:16:58 +08:00
|
|
|
|
% vim:ts=4:sw=4
|