summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pkuthss/readme/chap/pkuthss-chap1.tex
blob: 3eaa29114bedee21f3804fc36825aa9b77226a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
% Documentation for pkuthss.
%
% Copyright (c) 2008-2009 solvethis
% Copyright (c) 2010-2018 Casper Ti. Vector
%
% 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
%   https://www.latex-project.org/lppl.txt
% 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
%   chap/pkuthss-copy.tex
%   chap/pkuthss-abs.tex
%   chap/pkuthss-intro.tex
%   chap/pkuthss-chap1.tex
%   chap/pkuthss-chap2.tex
%   chap/pkuthss-chap3.tex
%   chap/pkuthss-concl.tex
%   chap/pkuthss-encl1.tex
%   chap/pkuthss-ack.tex

\chapter{使用介绍}
\section{系统要求}\label{sec:req}

正确编译需要以下几部分:
\begin{itemize}
	\item 一个基本的 \hologo{TeX} 发行版。
	\item CJK 或 XeCJK(供 \hologo{XeLaTeX} 使用)宏包。
	\item ctex\supercite{ctex} 宏包(提供了 ctexbook 文档类)。
	\item 中文字体。
	\item 如果要使用 biblatex 进行文献列表和引用的排版的话,
		还需要 biblatex\supercite{biblatex} 宏包;
	\item 如果要对中文文献进行按汉语拼音的排序的话,
		还需要 biber\supercite{biber} 程序。
	\item 如果使用默认的文献列表和引用样式的话,还需要作者编写的 biblatex 样式
		(biblatex-caspervector\supercite{biblatex-caspervector}),
		此样式要求使用 biber 程序。
	\item 如果须要使用 Makefile 来实现自动编译,还需要 Make 工具;
		但如果使用由批处理实现的伪“Makefile”就不用了。
\end{itemize}

\myemph{最新}的\myemph{完全版} \hologo{TeX} Live 系统(\myemph{%
	注:某些 Linux 发行版软件仓库中的 \hologo{TeX} Live 有问题,
	建议使用独立安装版的 \hologo{TeX} Live%
	\unemph{\footnote{\url{https://www.tug.org/texlive/}.}}。%
})都已经包含除中文字体和 Make 之外所有要求的项目。%
\myemph{%
	为了获得最好的支持,
	我们建议用户使用最新、完全版的 \hologo{TeX} 系统和各宏包。%
}

中文字体须要用户自行获得。\myemph{%
	注:一些中文字体的字库不全,只有 GB2312 字符集内字符的字体信息。
	这种情况通常会造成编译生成的 pdf 文件中缺少部分字符,
	其中一种典型症状是“〇”字显示不出来。
	如果要使用中易公司的字体,
	则建议使用 Windows Vista 及其以后版本提供的宋体、黑体、楷体和仿宋体,
	以及 Microsoft Office 2003 及其以后版本提供的隶书和幼圆体,
	这些字体是 GB18030 字符集的,不存在上述问题。%
}

Linux 用户可以从软件源获得 GNU 的 make;
其它类 UNIX 系统应该也会提供 make 工具,请参阅相应的文档以获得帮助。%
Windows 用户可以从以下地址下载 Windows 下的 GNU make 工具:\\
\hspace*{\parindent}%
\url{http://gnuwin32.sourceforge.net/packages/make.htm}

\section{模版文件}\label{sec:doc-dir}

在正确安装 pkuthss 文档模版之后,在终端/命令提示符中执行
\begin{Verbatim}[frame = single]
texdoc pkuthss
\end{Verbatim}
所打开的 pdf 文件所在的同一目录中包含两个子目录和相应的两个 pdf 文件,
其中 \verb|readme/| 为说明文档(即本文档)的源代码,%
\verb|example/| 为文档模版的源代码,%
\verb|readme.pdf| 和 \verb|example.pdf|
分别为说明文档和文档模版的 pdf 文件。

\verb|example/| 目录下的源代码使用的是 UTF-8 编码,
在现在 \hologo{TeX} 用户常用的编辑器中均已经有了良好的支持。
用户可以将 \verb|example/| 中的所有内容复制到合适的目录,
并在此目录中根据模版修改出自己的论文。

\myemph{%
	注意:在 1.4 rc4 之后版本的 pkuthss 文档模版中,
	除了 \texttt{Make.bat} 之外,所有文件均是 LF(\texttt{\string\n})换行。
	在 Windows 下用“记事本”打开这些文件时,
	所有的换行会变成某个奇怪的字符,而所有文字会挤在一行上。
	这是“记事本”的固有问题,
	因此 pkuthss 文档模版的作者建议用户使用支持 LF 换行的文本编辑器编辑文件。%
}

模版中的重要文件有:
\begin{itemize}
	\item \verb|Makefile|:
		被 Make 工具调用的 Makefile,用于使编译工作自动化。
	\item \verb|Make.bat|:%
		Windows 下的伪“Makefile”,用 Windows 批处理实现。

	\item \verb|chap/|:目录,包含各章节内容:
	\begin{itemize}
		\item \verb|copyright.tex|:版权声明部分。
		\item \verb|originauth.tex|:
			原创性声明和使用授权说明部分\supercite{pku-originauth}。
	\end{itemize}
	\myemph{%
		注:pkuthss 文档模版支持排版学校要求的二维码,
		请参考 \texttt{copyright.tex} 和
		\texttt{originauth.tex} 中的相关注释。%
	}

	\item \verb|misc/|:
		目录,目前包含比较常用的字体配置:
	\begin{itemize}
		\item \verb|ctexopts.cfg|、\verb|ctex-fontset-pkuthss.def|:
			适用于 2.0 及以后版本的 ctex\supercite{ctex} 宏包。
		\item \verb|ctex-xecjk-windows.def|:
			适用于 2.0 以前版本的 ctex 宏包。
	\end{itemize}
	使用时,
	请将和用户系统中 ctex 宏包版本相匹配的\myemph{所有}配置文件
	复制到模版的主目录中。
\end{itemize}

\section{编译方式}\label{sec:compile}

首次编译前,请将 \verb|misc/| 目录中和用户系统中
ctex 宏包版本相匹配的配置文件复制到模版的主目录中,
详见第 \ref{sec:doc-dir} 节。

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{%
	注意:\hologo{XeLaTeX} 对非 UTF-8 编码的支持不好,
	因此 \hologo{XeLaTeX} 方式的编译不支持 GBK 编码。%
}

pkuthss 文档模版附带的 Makefile 中已经对这三种编译方式进行了完整的配置。
用户只须要在 Makefile 中通过设定变量 \verb|JOB| 的值指定被编译的主文件名,
并通过设定变量 \verb|LATEX| 的值指定采用哪种编译方式,
即可通过在主文件所在目录调用 Make 工具来实现自动编译:
如果是在类 UNIX 环境下,则用户应该调用的命令名为 \verb|make|:
\begin{Verbatim}[frame = single]
cd /path/to/directory/with/thesis.tex
make
\end{Verbatim}
而如果是在 Windows 环境下,则用户应该调用的命令名可能为 \verb|mingw32-make|:
\begin{Verbatim}[frame = single]
cd \path\to\directory\with\thesis.tex
mingw32-make
\end{Verbatim}

用户如果不想配置 Windows 下的 GNU Make,
则也可以使用由 Windows 批处理实现的伪“Makefile”,
通过在主文件所在目录调用 \verb|make|\footnote{%
	Windows 将批处理文件作为可执行文件,调用时可以不显式地指出扩展名。%
}:
\begin{Verbatim}[frame = single]
cd \path\to\directory\with\thesis.tex
make
\end{Verbatim}
\myemph{%
	注意:%
	Windows 批处理对于 LF(\texttt{\string\n})换行的批处理文件支持有问题。
	在命令提示符(cmd)下执行这些批处理文件时没有问题,
	但双击文件图标执行时可能就会出错。
	\hologo{TeX} Live 中安装的 \texttt{Make.bat} 和
	CTAN 上提供的压缩包里的 \texttt{Make.bat}
	有可能是 LF(\texttt{\string\n})换行的。%
}

% vim:ts=4:sw=4