readme: improve verbatims.

This commit is contained in:
Casper Ti. Vector 2018-07-02 17:10:00 +08:00
parent 6c0c499784
commit 42c219c946
6 changed files with 35 additions and 33 deletions

View File

@ -75,7 +75,7 @@ Windows 用户可以从以下地址下载 Windows 下的 GNU make 工具:\\
\section{模版文件}\label{sec:doc-dir}
在正确安装 pkuthss 文档模版之后,在终端/命令提示符中执行
\begin{Verbatim}[frame = single]
\begin{Verbatim}
texdoc pkuthss
\end{Verbatim}
所打开的 pdf 文件所在的同一目录中包含两个子目录和相应的两个 pdf 文件,
@ -158,12 +158,12 @@ pkuthss 文档模版附带的 Makefile 中已经对这三种编译方式进行
并通过设定变量 \verb|LATEX| 的值指定采用哪种编译方式,
即可通过在主文件所在目录调用 Make 工具来实现自动编译:
如果是在类 UNIX 环境下,则用户应该调用的命令名为 \verb|make|
\begin{Verbatim}[frame = single]
\begin{Verbatim}
cd /path/to/directory/with/thesis.tex
make
\end{Verbatim}
而如果是在 Windows 环境下,则用户应该调用的命令名可能为 \verb|mingw32-make|
\begin{Verbatim}[frame = single]
\begin{Verbatim}
cd \path\to\directory\with\thesis.tex
mingw32-make
\end{Verbatim}
@ -173,7 +173,7 @@ mingw32-make
通过在主文件所在目录调用 \verb|make|\footnote{%
Windows 将批处理文件作为可执行文件,调用时可以不显式地指出扩展名。%
}
\begin{Verbatim}[frame = single]
\begin{Verbatim}
cd \path\to\directory\with\thesis.tex
make
\end{Verbatim}

View File

@ -139,13 +139,13 @@
例如,如果须要使用 UTF-8 编码撰写论文,
则应在载入 pkuthss 文档类时加上 \verb|UTF8| 选项:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\documentclass[UTF8, ...]{pkuthss} % “...”代表其它的选项。
\end{Verbatim}
又例如,文档默认情况下是双面模式,每章都从右页(奇数页)开始。
如果希望改成一章可以从任意页开始,可以这样设置:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\documentclass[openany, ...]{pkuthss} % 每章从任意页开始。
\end{Verbatim}
@ -153,7 +153,7 @@
\subsection{设定文档信息的命令}
这一类命令的语法为
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\commandname{具体信息} % commandname 为具体命令的名称。
\end{Verbatim}
@ -176,7 +176,7 @@
\end{itemize}
例如如果要设定专业为“化学”“Chemistry”则可以使用以下命令
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\cmajor{化学}
\emajor{Chemistry}
\end{Verbatim}
@ -184,7 +184,7 @@
\subsection{自身存储文档信息的命令}
这一类命令的语法为
\begin{Verbatim}[frame = single]
\begin{Verbatim}
% commandname 为具体的命令名。
\renewcommand{\commandname}{具体信息}
\end{Verbatim}
@ -202,7 +202,7 @@
例如,
如果要设定论文的类别为“本科生毕业论文”“Undergraduate Thesis”
则可以使用以下命令:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\renewcommand{\cthesisname}{本科生毕业论文}
\renewcommand{\ethesisname}{Undergraduate Thesis}
\end{Verbatim}
@ -210,7 +210,7 @@
\subsection{以“key = value”格式设置文档信息}
用户可以通过 \verb|\pkuthssinfo| 命令集中设定文档信息,其语法为:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
% key1、key2、value1、value2 等为具体文档信息的项目名和内容。
\pkuthssinfo{key1 = value1, key2 = value2, ...}
\end{Verbatim}
@ -224,7 +224,7 @@
}
例如,前面提到的文档信息的设置可以集中地写成:
\begin{Verbatim}[frame = single, tabsize = 4]
\begin{Verbatim}
\pkuthssinfo{
..., % “...”代表其它的设定。
cthesisname = {本科生毕业论文},
@ -268,7 +268,7 @@ hyperref\supercite{hyperref}、graphicx\supercite{graphicx}
例如,用户如果想将目录的标题改为“目{\quad\quad}录”,
则可以使用 ctexbook 文档类提供的 \verb|\ctexset| 命令:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\ctexset[contentsname = {目{\quad\quad}录}]
\end{Verbatim}
@ -278,7 +278,7 @@ pkuthss 文档模版使用作者编写的 biblatex\supercite{biblatex} 样式%
用户可以使用它以及 biblatex 本身所提供的功能。
例如,用户可以分别使用 \verb|\cite|、\verb|\parencite| 和 \verb|\supercite|
生成未格式化的、带方括号的和上标且带方括号的引用标记:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\cite{ctex}\parencite{ctex}\supercite{ctex}
\end{Verbatim}
在本文中将产生“\cite{ctex}\parencite{ctex}\supercite{ctex}”。
@ -311,7 +311,7 @@ pkuthss 文档模版的实现是简洁、清晰、灵活的。
通过修改 pkuthss 文档类的源文件进行自定义。
在目前常用的 \hologo{TeX} 系统中,
假设 pkuthss 的说明文档所在目录具有下述形式的路径:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
# 说明文档所在目录($TEXMFDIST 的形式见下面几行):
$TEXMFDIST/doc/latex/pkuthss/
# 若用户使用 Windows 下的 TeX Live 系统,则 $TEXMFDIST 一般类似于:
@ -320,7 +320,7 @@ C:\texlive\2015\texmf-dist
/usr/local/texlive/2015/texmf-dist
\end{Verbatim}
则其源文件所在目录应该位于以下目录:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
$TEXMFDIST/tex/latex/pkuthss/
\end{Verbatim}
@ -340,16 +340,16 @@ $TEXMFDIST/tex/latex/pkuthss/
此时,用户可以修改 \verb|pkuthss.cls| 里 \verb|\maketitle| 定义中
\verb|\thss@int@fillinblank| 宏的参数来改变
带下划线的空白的行数和行宽,其语法为:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\thss@int@fillinblank{行数}{行宽}{内容}
\end{Verbatim}
例如,如果“研究方向”一栏需要两行的空白,
可以将 \verb|pkuthss.cls| 里的
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\thss@int@fillinblank{1}{\thss@tmp@len}{\kaishu\@direction}
\end{Verbatim}
改为
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\thss@int@fillinblank{2}{\thss@tmp@len}{\kaishu\@direction}
\end{Verbatim}
当然,为了美观,可以将多于一行的部分移到封面中作者信息部分的最下方。

View File

@ -58,7 +58,7 @@ biblatex\supercite{biblatex} 宏包会自行设定 \verb|\bibname|
故会覆盖通过 \verb|\ctexset| 设定的参考文献列表标题。
使用 biblatex 的用户可以使用 \verb|\printbibliography| 的
\verb|title| 选项来手动设定参考文献列表的标题,例如:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\printbibliography[title = {文献}, ...] % “...”为其它选项。
\end{Verbatim}
@ -70,7 +70,7 @@ hyperref\supercite{hyperref} 宏包和一些宏包可能发生冲突。
使用 \hologo{XeLaTeX} 的用户可能在已经安装字体的情况下遇到形如(其中
\verb|xxxxxxxx| 为具体字体名)
\begin{Verbatim}[frame = single, fontsize = {\small}]
\begin{Verbatim}[fontsize = {\small}]
! fontspec error: "font-not-found"
! The font "xxxxxxxx" cannot be found.
! See the fontspec documentation for further information.
@ -82,13 +82,13 @@ hyperref\supercite{hyperref} 宏包和一些宏包可能发生冲突。
并改动 \verb|ctex.cfg| 等配置文件之后没有在调用
pkuthss 文档类时加入 \verb|nofonts| 选项,
又使用 \verb|xelatex| 编译造成的,使用
\begin{Verbatim}[frame = single]
\begin{Verbatim}
\documentclass[nofonts, ...]{pkuthss} % “...”代表其它的选项。
\end{Verbatim}
即可解决此问题。
biber 运行时有一定概率出现形如(目录名可能稍有不同)
\begin{Verbatim}[frame = single, fontsize = {\small}]
\begin{Verbatim}[fontsize = {\small}]
data source .../par-xxxxxxxx/cache-xxxxxxxx/
inc/lib/Biber/LaTeX/recode_data.xml not found in .
\end{Verbatim}
@ -99,7 +99,7 @@ data source .../par-xxxxxxxx/cache-xxxxxxxx/
再重新运行 biber 通常便可解决问题。
caption\supercite{caption} 宏包对于其不认识的宏包均会提示
\begin{Verbatim}[frame = single, fontsize = {\small}]
\begin{Verbatim}[fontsize = {\small}]
Package caption Warning: Unsupported document class (or package) detected,
(caption) usage of the caption package is not recommended.
See the caption package documentation for explanation.

View File

@ -30,14 +30,10 @@
\raggedbottom
\section{1.3 版以后的更新记录}
\VerbatimInput[
tabsize = 4, fontsize = {\small}, baselinestretch = 1
]{ChangeLog.txt}
\VerbatimInput{ChangeLog.txt}
\section{1.3 及其以前版本的更新记录}
\VerbatimInput[
tabsize = 4, fontsize = {\small}, baselinestretch = 1.1
]{ChangeLog-upto-1.3.txt}
\VerbatimInput[baselinestretch = 1.1]{ChangeLog-upto-1.3.txt}
\flushbottom

View File

@ -43,7 +43,7 @@ pkuthss 文档模版由三部分构成:
说明文档即本文档,
在安装(见第 \ref{sec:req} 节)之后应该可以用 \hologo{TeX} 系统提供的
\verb|texdoc| 命令调出:
\begin{Verbatim}[frame = single]
\begin{Verbatim}
texdoc pkuthss
\end{Verbatim}
\item \textbf{论文模版}

View File

@ -31,7 +31,7 @@
backend = biber, style = caspervector, utf8,
sorting = ecnyt, giveninits = true, sortgiveninits = true
]{biblatex}
\usepackage{fancyvrb, hologo}
\usepackage{iftex, fancyvrb, hologo}
\setlength{\hfuzz}{3pt}
\ctexset{linestretch = 2\ccwd}
@ -39,9 +39,15 @@
\setlength{\bibitemsep}{3bp}
\hypersetup{colorlinks = true, allcolors = blue}
\newcommand{\docversion}{v1.8.0}
\newcommand{\myemph}[1]{\emph{\textcolor{red}{#1}}}
\newcommand{\unemph}[1]{\textup{\textcolor{black}{#1}}}
\newcommand{\docversion}{v1.8.0}
\RecustomVerbatimEnvironment{Verbatim}{Verbatim}%
{frame = single, tabsize = 4, formatcom = {\ifXeTeX\xeCJKVerbAddon\fi}}
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}{
fontsize = {\small}, baselinestretch = 1,
tabsize = 4, formatcom = {\ifXeTeX\xeCJKVerbAddon\fi}
}
\pkuthssinfo{
cthesisname = {本科生毕业论文}, ethesisname = {Undergraduate Thesis},