2012-05-18 12:44:56 +08:00
|
|
|
|
% vim:ts=4:sw=4
|
|
|
|
|
|
%
|
2014-04-11 21:26:52 +08:00
|
|
|
|
% Documentation for pkuthss.
|
|
|
|
|
|
%
|
2011-06-26 02:08:21 +08:00
|
|
|
|
% Copyright (c) 2008-2009 solvethis
|
2015-04-27 17:12:38 +08:00
|
|
|
|
% Copyright (c) 2010-2015 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
|
|
|
|
|
|
% http://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
|
2015-06-19 14:43:04 +08:00
|
|
|
|
% chap/pkuthss-copyright.tex
|
|
|
|
|
|
% chap/pkuthss-abstract.tex
|
|
|
|
|
|
% chap/pkuthss-introduction.tex
|
|
|
|
|
|
% chap/pkuthss-chap1.tex
|
|
|
|
|
|
% chap/pkuthss-chap2.tex
|
|
|
|
|
|
% chap/pkuthss-chap3.tex
|
|
|
|
|
|
% chap/pkuthss-conclusion.tex
|
|
|
|
|
|
% chap/pkuthss-encl1.tex
|
|
|
|
|
|
% chap/pkuthss-acknowledge.tex
|
2011-06-26 02:08:21 +08:00
|
|
|
|
|
2011-06-26 02:08:15 +08:00
|
|
|
|
\chapter{使用介绍}
|
2012-05-28 17:50:46 +08:00
|
|
|
|
\section{系统要求}\label{sec:req}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
|
|
|
|
|
正确编译需要以下几部分:
|
2011-06-26 02:08:20 +08:00
|
|
|
|
\begin{itemize}
|
2014-05-10 20:19:34 +08:00
|
|
|
|
\item 一个基本的 \hologo{TeX} 发行版。
|
|
|
|
|
|
\item CJK 或 XeCJK(供 \hologo{XeLaTeX} 使用)宏包。
|
2015-06-18 19:30:01 +08:00
|
|
|
|
\item ctex\supercite{ctex,ctex-faq} 宏包(提供了 ctexbook 文档类)。
|
2012-05-31 16:41:44 +08:00
|
|
|
|
\item 中文字体。
|
|
|
|
|
|
\item 如果要使用 biblatex 进行文献列表和引用的排版的话,
|
2015-06-18 19:30:01 +08:00
|
|
|
|
还需要 biblatex\supercite{biblatex} 宏包;
|
2012-05-31 16:41:44 +08:00
|
|
|
|
\item 如果需要对中文文献进行按汉语拼音的排序的话,
|
2015-06-18 19:30:01 +08:00
|
|
|
|
还需要 biber\supercite{biber} 程序。
|
2015-04-27 14:26:07 +08:00
|
|
|
|
\item 如果使用默认的文献列表和引用样式的话,
|
2012-10-10 22:08:00 +08:00
|
|
|
|
还需要作者编写的 biblatex 样式
|
2015-06-18 19:30:01 +08:00
|
|
|
|
(biblatex-caspervector\supercite{biblatex-caspervector})。
|
2011-06-26 02:08:20 +08:00
|
|
|
|
\item 如果需要使用 Makefile 来实现自动编译,还需要 Make 工具;
|
2011-06-26 02:08:15 +08:00
|
|
|
|
但如果使用由批处理实现的伪“Makefile”就不用了。
|
|
|
|
|
|
\end{itemize}
|
|
|
|
|
|
|
2014-05-24 02:53:41 +08:00
|
|
|
|
\myemph{最新}的\myemph{完全版} \hologo{TeX} Live 系统(\myemph{%
|
2012-05-31 15:42:28 +08:00
|
|
|
|
注:
|
2014-05-24 02:53:41 +08:00
|
|
|
|
某些 Linux 发行版软件仓库中的 \hologo{TeX} Live 有问题,
|
|
|
|
|
|
建议使用独立安装版的 \hologo{TeX} Live%
|
2015-04-26 14:00:07 +08:00
|
|
|
|
\unemph{\footnote{\url{http://www.tug.org/texlive/}.}}。%
|
2014-04-29 14:56:52 +08:00
|
|
|
|
})都已经包含除中文字体和 Make 之外所有要求的项目。%
|
2012-05-31 16:41:44 +08:00
|
|
|
|
\myemph{%
|
|
|
|
|
|
为了获得最好的支持,
|
2015-06-10 02:40:48 +08:00
|
|
|
|
我们建议用户使用最新、完全版的 \hologo{TeX} 系统和各宏包。%
|
2013-04-07 23:20:13 +08:00
|
|
|
|
}
|
2012-05-31 16:41:44 +08:00
|
|
|
|
|
|
|
|
|
|
中文字体需要用户自行获得。\myemph{%
|
|
|
|
|
|
注:
|
|
|
|
|
|
一些中文字体的字库不全,
|
|
|
|
|
|
只有 GB2312 字符集内字符的字体信息。
|
|
|
|
|
|
这种情况通常会造成编译生成的 pdf 文件中缺少部分字符,
|
2015-06-10 01:31:59 +08:00
|
|
|
|
其中一种典型症状是“〇”字显示不出来。
|
2012-05-31 16:41:44 +08:00
|
|
|
|
如果要使用中易公司的字体,
|
2015-12-16 18:34:43 +08:00
|
|
|
|
则建议使用 Windows Vista 及其以后版本提供的
|
2012-05-31 16:41:44 +08:00
|
|
|
|
宋体、黑体、楷体和仿宋体,
|
|
|
|
|
|
以及 Microsoft Office 2003 及其以后版本提供的隶书和幼圆体,
|
|
|
|
|
|
这些字体是 GB18030 字符集的,不存在上述问题。%
|
|
|
|
|
|
}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2011-06-26 02:08:20 +08:00
|
|
|
|
Linux 用户可以从软件源获得 GNU 的 make;
|
|
|
|
|
|
其它类 UNIX 系统应该也会提供 make 工具,请参阅相应的文档以获得帮助。%
|
2011-06-26 02:08:25 +08:00
|
|
|
|
Windows 用户可以从以下地址下载 Windows 下的 GNU make 工具:\\
|
|
|
|
|
|
\hspace*{\parindent}%
|
|
|
|
|
|
\url{http://gnuwin32.sourceforge.net/packages/make.htm}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2012-10-11 10:46:14 +08:00
|
|
|
|
\section{模版文件}\label{sec:doc-dir}
|
2012-10-10 22:08:00 +08:00
|
|
|
|
|
2012-10-11 10:46:14 +08:00
|
|
|
|
在正确安装 pkuthss 文档模版之后,在终端/命令提示符中执行
|
2012-04-13 22:10:22 +08:00
|
|
|
|
\begin{Verbatim}[frame = single]
|
2012-10-10 22:08:00 +08:00
|
|
|
|
texdoc pkuthss
|
2011-06-26 02:08:21 +08:00
|
|
|
|
\end{Verbatim}
|
2015-05-30 21:39:59 +08:00
|
|
|
|
所打开的 pdf 文件所在的同一目录中包含两个子目录和相应的两个 pdf 文件,
|
|
|
|
|
|
其中 \verb|readme/| 为说明文档(即本文档)的源代码,%
|
|
|
|
|
|
\verb|example/| 为文档模版的源代码,%
|
2014-04-16 20:39:46 +08:00
|
|
|
|
\verb|readme.pdf| 和 \verb|example.pdf|
|
2015-05-30 21:39:59 +08:00
|
|
|
|
分别为说明文档和文档模版的 pdf 文件。
|
2014-04-11 23:54:36 +08:00
|
|
|
|
|
2015-05-30 21:39:59 +08:00
|
|
|
|
\verb|example/| 目录下的源代码使用的是 UTF-8 编码,
|
|
|
|
|
|
在现在 \hologo{TeX} 用户常用的编辑器中均已经有了良好的支持。
|
|
|
|
|
|
用户可以将 \verb|example/| 中的所有内容复制到合适的目录,
|
2012-10-11 10:46:14 +08:00
|
|
|
|
并在此目录中根据模版修改出自己的论文。
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2013-12-27 11:20:17 +08:00
|
|
|
|
\myemph{%
|
|
|
|
|
|
注意:
|
|
|
|
|
|
在 1.4 rc4 之后版本的 pkuthss 文档模版中,除了 \texttt{Make.bat} 之外,
|
|
|
|
|
|
所有文件均是 LF(\texttt{\string\n})换行。
|
|
|
|
|
|
在 Windows 下用“记事本”打开这些文件时,
|
|
|
|
|
|
所有的换行会变成某个奇怪的字符,而所有文字会挤在一行上。
|
|
|
|
|
|
这是“记事本”的固有问题,
|
|
|
|
|
|
因此 pkuthss 文档模版的作者建议用户
|
|
|
|
|
|
使用支持 LF 换行的文本编辑器编辑文件。%
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-04-11 22:13:12 +08:00
|
|
|
|
模版中的重要文件有:
|
2012-10-10 22:08:00 +08:00
|
|
|
|
\begin{itemize}
|
|
|
|
|
|
\item \verb|Makefile|:
|
|
|
|
|
|
被 Make 工具调用的 Makefile,用于使编译工作自动化。
|
|
|
|
|
|
\item \verb|Make.bat|:%
|
|
|
|
|
|
Windows 下的伪“Makefile”,用 Windows 批处理实现。
|
2013-06-06 00:20:38 +08:00
|
|
|
|
|
2012-10-10 22:08:00 +08:00
|
|
|
|
\item \verb|chap/|:目录,包含各章节内容:
|
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
|
\item \verb|copyright.tex|:
|
2014-04-11 22:13:12 +08:00
|
|
|
|
版权声明部分。
|
2012-10-10 22:08:00 +08:00
|
|
|
|
\item \verb|originauth.tex|:
|
|
|
|
|
|
原创性声明和使用授权说明部分\supercite{pku-originauth}。
|
|
|
|
|
|
\end{itemize}
|
2013-06-06 00:20:38 +08:00
|
|
|
|
\myemph{%
|
|
|
|
|
|
注:%
|
2013-12-26 22:26:11 +08:00
|
|
|
|
pkuthss 文档模版支持排版学校要求的二维码,
|
2013-06-06 00:20:38 +08:00
|
|
|
|
请参考 \texttt{copyright.tex} 和
|
|
|
|
|
|
\texttt{originauth.tex} 中的相关注释。%
|
|
|
|
|
|
}
|
2015-06-10 14:34:53 +08:00
|
|
|
|
|
|
|
|
|
|
\item \verb|misc/|:
|
|
|
|
|
|
目录,目前包含比较常用的字体配置:
|
|
|
|
|
|
\begin{itemize}
|
|
|
|
|
|
\item \verb|ctexopts.cfg|、\verb|ctex-fontset-pkuthss.def|:
|
2015-06-18 19:30:01 +08:00
|
|
|
|
适用于 2.0 及以后版本的 ctex\supercite{ctex} 宏包。
|
2015-06-10 14:34:53 +08:00
|
|
|
|
\item \verb|ctex-xecjk-windows.def|:
|
|
|
|
|
|
适用于 2.0 以前版本的 ctex 宏包。
|
|
|
|
|
|
\end{itemize}
|
|
|
|
|
|
使用时,
|
|
|
|
|
|
请将和用户系统中 ctex 宏包版本相匹配的\myemph{所有}配置文件
|
2015-12-16 18:36:23 +08:00
|
|
|
|
复制到模版的主目录中。
|
2012-10-10 22:08:00 +08:00
|
|
|
|
\end{itemize}
|
2011-06-26 02:08:23 +08:00
|
|
|
|
|
2012-05-28 17:50:46 +08:00
|
|
|
|
\section{编译方式}\label{sec:compile}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2015-06-10 14:34:53 +08:00
|
|
|
|
首次编译前,
|
|
|
|
|
|
请将 \verb|misc/| 目录中和
|
2015-12-16 18:36:23 +08:00
|
|
|
|
用户系统中 ctex 宏包版本相匹配的配置文件复制到模版的主目录中,
|
2015-06-10 14:34:53 +08:00
|
|
|
|
详见第 \ref{sec:doc-dir} 节。
|
|
|
|
|
|
|
2012-03-11 13:36:51 +08:00
|
|
|
|
pkuthss 文档模版支持三种编译方式,即
|
2011-06-26 02:08:20 +08:00
|
|
|
|
\begin{itemize}
|
2014-05-10 20:19:34 +08:00
|
|
|
|
\item \hologo{LaTeX} -- dvipdfmx 方式:\\
|
2015-05-09 21:27:22 +08:00
|
|
|
|
依次执行 \verb|latex|,\verb|biber|,%
|
2014-04-29 14:55:43 +08:00
|
|
|
|
\verb|latex|,\verb|latex| 和 \verb|dvipdfmx|。
|
2014-05-10 20:19:34 +08:00
|
|
|
|
\item \hologo{pdfLaTeX} 方式:\\
|
2015-05-09 21:27:22 +08:00
|
|
|
|
依次执行 \verb|pdflatex|,\verb|biber|,%
|
2011-06-26 02:08:21 +08:00
|
|
|
|
\verb|pdflatex| 和 \verb|pdflatex|。
|
2014-05-10 20:19:34 +08:00
|
|
|
|
\item \hologo{XeLaTeX} 方式:\\
|
2015-05-09 21:27:22 +08:00
|
|
|
|
依次执行 \verb|xelatex|,\verb|biber|,%
|
2014-04-29 14:55:43 +08:00
|
|
|
|
\verb|xelatex| 和 \verb|xelatex|。
|
2011-06-26 02:08:15 +08:00
|
|
|
|
\end{itemize}
|
2014-04-29 14:55:43 +08:00
|
|
|
|
\myemph{%
|
2015-05-09 21:27:22 +08:00
|
|
|
|
注意:\hologo{XeLaTeX} 对非 UTF-8 编码的支持不好,
|
|
|
|
|
|
因此 \hologo{XeLaTeX} 方式的编译不支持 GBK 编码。%
|
2014-04-29 14:55:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2012-03-11 13:36:51 +08:00
|
|
|
|
pkuthss 文档模版附带的 Makefile 中已经对这三种编译方式进行了完整的配置。
|
2015-12-16 18:34:43 +08:00
|
|
|
|
用户只需要在 Makefile 中通过设定变量 \verb|JOBNAME| 的值
|
2011-06-26 02:08:15 +08:00
|
|
|
|
指定被编译的主文件名,
|
2011-06-26 02:08:20 +08:00
|
|
|
|
并通过设定变量 \verb|LATEX| 的值指定采用哪种编译方式,
|
|
|
|
|
|
即可通过在主文件所在目录调用 Make 工具来实现自动编译:
|
2013-12-27 11:20:17 +08:00
|
|
|
|
如果是在类 UNIX 环境下,则用户应该调用的命令名为 \verb|make|:
|
|
|
|
|
|
\begin{Verbatim}[frame = single]
|
2014-07-04 00:13:46 +08:00
|
|
|
|
cd /path/to/directory/with/thesis.tex
|
2013-12-27 11:20:17 +08:00
|
|
|
|
make
|
|
|
|
|
|
\end{Verbatim}
|
2011-06-26 02:08:20 +08:00
|
|
|
|
而如果是在 Windows 环境下,
|
2013-12-27 11:20:17 +08:00
|
|
|
|
则用户应该调用的命令名可能为 \verb|mingw32-make|:
|
|
|
|
|
|
\begin{Verbatim}[frame = single]
|
2014-07-04 00:13:46 +08:00
|
|
|
|
cd \path\to\directory\with\thesis.tex
|
2013-12-27 11:20:17 +08:00
|
|
|
|
mingw32-make
|
|
|
|
|
|
\end{Verbatim}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|
2011-06-26 02:08:20 +08:00
|
|
|
|
用户如果不想配置 Windows 下的 GNU Make,
|
|
|
|
|
|
则也可以使用由 Windows 批处理实现的伪“Makefile”,
|
2011-06-26 02:08:21 +08:00
|
|
|
|
通过在主文件所在目录调用 \verb|make|\footnote{%
|
2011-06-26 02:08:20 +08:00
|
|
|
|
Windows 将批处理文件作为可执行文件,
|
2011-06-26 02:08:21 +08:00
|
|
|
|
调用时可以不显式地指出扩展名。%
|
2013-12-27 11:20:17 +08:00
|
|
|
|
}:
|
|
|
|
|
|
\begin{Verbatim}[frame = single]
|
2014-07-04 00:13:46 +08:00
|
|
|
|
cd \path\to\directory\with\thesis.tex
|
2013-12-27 11:20:17 +08:00
|
|
|
|
make
|
|
|
|
|
|
\end{Verbatim}
|
|
|
|
|
|
\myemph{%
|
|
|
|
|
|
注意:%
|
|
|
|
|
|
Windows 批处理对于 LF(\texttt{\string\n})换行的批处理文件支持有问题。
|
|
|
|
|
|
在命令提示符(cmd)下执行这些批处理文件时没有问题,
|
2015-04-28 23:15:14 +08:00
|
|
|
|
但双击文件图标执行时可能就会出错。
|
|
|
|
|
|
\hologo{TeX} Live 中安装的 \texttt{Make.bat} 和
|
2013-12-27 11:20:17 +08:00
|
|
|
|
CTAN 上提供的压缩包里的 \texttt{Make.bat}
|
2015-04-28 23:15:14 +08:00
|
|
|
|
有可能是 LF(\texttt{\string\n})换行的。%
|
2013-12-27 11:20:17 +08:00
|
|
|
|
}
|
2011-06-26 02:08:15 +08:00
|
|
|
|
|