Debian Codegraph @

texmf-dist/doc/latex/pkuthss/readme/chap/pkuthss-chap1.tex

raw
1 % Documentation for pkuthss.
2 %
3 % Copyright (c) 2008-2009 solvethis
4 % Copyright (c) 2010-2019 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{使用介绍}
31 \section{系统要求}\label{sec:req}
32
33 正确编译需要以下几部分:
34 \begin{itemize}
35 \item 一个基本的 \hologo{TeX} 发行版。
36 \item CJK 或 XeCJK(供 \hologo{XeLaTeX} 使用)宏包。
37 \item ctex\cupercite{ctex} 宏包(提供了 ctexbook 文档类)。
38 \item 中文字体。
39 \item 如果要使用 biblatex 进行文献列表和引用的排版的话,
40 还需要 biblatex\cupercite{biblatex} 宏包;
41 \item 如果要对中文文献进行按汉语拼音的排序的话,
42 还需要 biber\cupercite{biber} 程序。
43 \item 如果使用默认的文献列表和引用样式的话,还需要作者编写的 biblatex 样式
44 (biblatex-caspervector\cupercite{biblatex-caspervector}),
45 此样式要求使用 biber 程序。
46 \item 如果须要使用 latexmk 来实现自动编译,还需要 latexmk 工具。
47 \end{itemize}
48
49 \myemph{最新}的\myemph{完全版} \hologo{TeX} Live 系统(\myemph{%
50 注:某些 Linux 发行版软件仓库中的 \hologo{TeX} Live 有问题,
51 建议使用独立安装版的 \hologo{TeX} Live%
52 \unemph{\footnote{\url{https://www.tug.org/texlive/}.}}。%
53 })都已经包含除中文字体之外所有要求的项目。%
54 \myemph{%
55 为了获得最好的支持,
56 我们建议用户使用最新、完全版的 \hologo{TeX} 系统和各宏包。%
57 }
58
59 中文字体需要用户自行获得。\myemph{%
60 注:一些中文字体的字库不全,只有 GB2312 字符集内字符的字体信息。
61 这种情况通常会造成编译生成的 pdf 文件中缺少部分字符,
62 其中一种典型症状是“〇”字显示不出来。
63 如果要使用中易公司的字体,
64 则建议使用 Windows Vista 及其以后版本提供的宋体、黑体、楷体和仿宋体,
65 以及 Microsoft Office 2003 及其以后版本提供的隶书和幼圆体,
66 这些字体是 GB18030 字符集的,不存在上述问题。%
67 }
68
69 \section{模版文件}\label{sec:doc-dir}
70
71 在正确安装 pkuthss 文档模版之后,在终端/命令提示符中执行
72 \begin{Verbatim}
73 texdoc pkuthss
74 \end{Verbatim}
75 打开的 pdf 文件所在目录中包含两个子目录和相应的两个 pdf 文件,
76 其中 \verb|readme/| 为说明文档(即本文档)的源代码,%
77 \verb|example/| 为文档模版的源代码,%
78 \verb|pkuthss.pdf| 和 \verb|example.pdf|
79 分别为说明文档和文档模版的 pdf 文件。
80
81 \verb|example/| 目录下的源代码使用的是 UTF-8 编码,
82 在现在 \hologo{TeX} 用户常用的编辑器中均已经有了良好的支持。
83 用户可以将 \verb|example/| 中的所有内容复制到合适的目录,
84 并在此目录中根据模版修改出自己的论文。
85
86 \myemph{%
87 注意:在 1.4 rc4 之后版本的 pkuthss 文档模版中,
88 除了 \texttt{Make.bat} 之外,所有文件均是 LF(\texttt{\string\n})换行。
89 在 Windows 下用“记事本”打开这些文件时,
90 所有的换行会变成某个奇怪的字符,而所有文字会挤在一行上。
91 这是“记事本”的固有问题,
92 因此 pkuthss 文档模版的作者建议用户使用支持 LF 换行的文本编辑器编辑文件。%
93 }
94
95 模版中的关键文件有:
96 \begin{itemize}
97 \item \verb|ctexopts.cfg|、\verb|ctex-fontset-pkuthss.def|:
98 比较常用的字体配置,适用于 2.0 及以后版本的
99 ctex\cupercite{ctex} 宏包。
100 \item \verb|latexmkrc|:
101 被 latexmk 工具读取的配置文件,用于使编译工作自动化。
102 \item \verb|Make.bat|:%
103 方便 Windows 用户使用的批处理文件,会调用 latexmk。
104 \item \verb|spine.tex|:书脊的源文件,具体用法请参考其中代码。
105 \item \verb|thesis.tex|:示例模版的主文件。
106
107 \item \verb|chap/|:目录,包含各章节内容:
108 \begin{itemize}
109 \item \verb|copy.tex|:版权声明部分。
110 \item \verb|origin.tex|:
111 原创性声明和使用授权说明部分\cupercite{pku-originauth}。
112 \end{itemize}
113 \myemph{%
114 注:pkuthss 文档模版可排版学校要求的二维码,
115 请参考 \texttt{copy.tex} 和 \texttt{origin.tex} 中的相关注释。%
116 }
117 \end{itemize}
118
119 \section{编译方式}\label{sec:compile}
120
121 pkuthss 文档模版支持三种编译方式,即
122 \begin{itemize}
123 \item \hologo{LaTeX} -- dvipdfmx 方式:\\
124 依次执行 \verb|latex|,\verb|biber|,%
125 \verb|latex|,\verb|latex| 和 \verb|dvipdfmx|。
126 \item \hologo{pdfLaTeX} 方式:\\
127 依次执行 \verb|pdflatex|,\verb|biber|,%
128 \verb|pdflatex| 和 \verb|pdflatex|。
129 \item \hologo{XeLaTeX} 方式:\\
130 依次执行 \verb|xelatex|,\verb|biber|,%
131 \verb|xelatex| 和 \verb|xelatex|。
132 \end{itemize}
133 \myemph{%
134 注意:在特定情形下,\texttt{latex}/\texttt{pdflatex}/\texttt{xelatex}
135 步骤可能须要执行多于 2 次,而下文推荐的 latexmk 工具会自动处理这类情形。
136 此外,\hologo{XeLaTeX} 对非 UTF-8 编码的支持不好,
137 因此 \hologo{XeLaTeX} 方式的编译不支持 GBK 编码。%
138 }
139
140 pkuthss 文档模版附带的 \verb|latexmkrc| 中已经对这三种编译方式进行了完整的
141 配置。用户只须要在 \verb|latexmkrc| 中通过设定变量 \verb|default_files|
142 的值指定被编译的主文件名,并通过设定变量 \verb|pdf_mode| 的值指定采用
143 哪种编译方式,即可通过在主文件所在目录调用 latexmk 工具来实现自动编译:
144 类 UNIX 环境下大致如下
145 \begin{Verbatim}
146 cd /path/to/directory/with/thesis.tex
147 latexmk
148 \end{Verbatim}
149 而在 Windows 环境下大致如下
150 \begin{Verbatim}
151 cd \path\to\directory\with\thesis.tex
152 latexmk
153 \end{Verbatim}
154
155 Windows 用户也可以使用批处理文件 \verb|Make.bat|:
156 在主文件所在目录双击此文件,它便会调用 latexmk 进行编译。\myemph{%
157 注意:%
158 Windows 批处理对于 LF(\texttt{\string\n})换行的批处理文件支持有问题。
159 在命令提示符(cmd)下执行这些批处理文件时没有问题,
160 但双击文件图标执行时可能就会出错。
161 \hologo{TeX} Live 中安装的 \texttt{Make.bat} 和
162 CTAN 上提供的压缩包里的 \texttt{Make.bat}
163 在正常情况下应该是 CRLF(\texttt{\string\r\string\n})换行的。%
164 }
165
166 % vim:ts=4:sw=4