summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-04 22:46:13 +0000
committerKarl Berry <karl@freefriends.org>2019-05-04 22:46:13 +0000
commitd1d125c560bc7daf71c625137a13fd7ee222fe03 (patch)
tree6fa63d3ece0e65ad6f472ec4185637df009451c8
parent023d4ff6964824097103d0907046685d02bd332c (diff)
lshort-chinese (17apr19)
git-svn-id: svn://tug.org/texlive/trunk@50986 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md8
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/README.md10
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdfbin1433225 -> 1049683 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile11
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/app.A.install.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex)52
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/app.B.error.help.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.B.error.help.tex)0
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/biblio.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex)2
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.01.basics.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.01.basics.tex)279
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.02.text.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.02.text.tex)39
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.03.elements.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.03.elements.tex)22
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.04.math.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.04.math.tex)12
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.05.style.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.05.style.tex)78
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.06.spec.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.06.spec.tex)170
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.07.graphic.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.07.graphic.tex)2
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap.08.custom.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.08.custom.tex)8
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/fdl.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/fdl.tex)0
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/latexmkrc12
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty58
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex36
-rwxr-xr-xMaster/texmf-dist/doc/latex/lshort-chinese/src/make.bat7
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/preface.contrib.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.contrib.tex)0
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/preface.overview.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.overview.tex)0
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/sec.symbol.table.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex)0
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/titlepage.tex (renamed from Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex)2
24 files changed, 470 insertions, 338 deletions
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md b/Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md
index 4f5b53ca017..cb8b69d0410 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md
@@ -1,4 +1,4 @@
-# 中文版 lshort,6.0 版
+# 中文版 lshort,6.01 版
## 许可证
@@ -8,8 +8,6 @@
将发行版内的 `ctex` 宏包、`xeCJK` 宏包更新到最新(包括它们依赖的所有宏包),并确认 `lshort-zh-cn-style.sty` 调用的其它宏包都已正确安装并更新到最新。
-本文档使用 `fandol` 字体包。`fontspec` 宏包会对此字体报 script-not-exist 的警告,可以无视。
-
## 编译方式
### 手动编译
@@ -33,3 +31,7 @@ make install
```
Windows 下在 src 目录提供批处理脚本 `make.bat`,双击执行编译。
+
+### 使用 latexmk 编译
+
+在 src 目录下提供了供 `latexmk` 构建工具使用的配置文件 `latexmkrc`。在 src 目录下执行 `latexmk` 命令进行编译,完成后将 PDF 文件移动到根目录。 \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/README.md b/Master/texmf-dist/doc/latex/lshort-chinese/README.md
index d9514a146b1..ecfe6062ca2 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/README.md
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/README.md
@@ -1,4 +1,4 @@
-# The Not So Short Introduction To LaTeX (Chinese Edition), v6.0
+# The Not So Short Introduction To LaTeX (Chinese Edition), v6.01
## License
@@ -9,8 +9,6 @@ For detailed information, see the section entitled 'GNU Free Documentation Licen
Update `ctex` and `xeCJK` (and all the packages they rely on) in your TeX distritusion. And make sure you've installed
all the other packages used in `lshort-zh-cn-style.sty` and updated them to the newest version.
-This document uses `fandol` font package. You may receive a warning like 'script-not-exist' made by `fontspec` package. Just leave it alone.
-
## Typesetting
### Manually typesetting
@@ -33,4 +31,8 @@ make
make install
```
-For Windows users, we also provide a batch file `make.bat` in the 'src' directory, which you can double-click to do the typesetting. \ No newline at end of file
+For Windows users, we also provide a batch file `make.bat` in the 'src' directory, which you can double-click to do the typesetting.
+
+### Using latexmk
+
+We also provide `latexmkrc` configuration file for building with `latexmk` tool. Run the command `latexmk` in `src` directory for typesetting, then move the PDF document to the root directory. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdf b/Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdf
index be8ad286006..b8c28394a77 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdf
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile b/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
index b827501474f..0ee48b69f46 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
@@ -3,7 +3,7 @@ PDF = $(LSHORT).pdf
REQUIRE = $(LSHORT).tex $(LSHORT)-style.sty $(LSHORT)-layout.tex $(LSHORT).ist
TEMP = $(LSHORT).{aux,log,idx,ind,ilg,out,toc,los,synctex.gz} $(LSHORT)-example.aux
-TEX = xelatex
+TEX = latexmk -xelatex
MODE = -interaction=nonstopmode -synctex=1
MAKEIDX = makeindex
@@ -12,19 +12,16 @@ INSTALL = cp
all: $(PDF)
-$(PDF): $(REQUIRE)
- $(TEX) $(MODE) $(LSHORT)
- $(MAKEIDX) -s $(LSHORT).ist $(LSHORT)
- $(TEX) $(MODE) $(LSHORT)
+$(PDF): $(REQUIRE) FORCE_MAKE
$(TEX) $(MODE) $(LSHORT)
install: all
$(INSTALL) $(LSHORT).pdf ..
clean:
- $(RM) $(TEMP) $(LSHORT).pdf
+ $(TEX) -C $(LSHORT).tex
distclean: clean
$(RM) ../$(LSHORT).pdf
-.PHONY: all install clean distclean \ No newline at end of file
+.PHONY: all install clean distclean FORCE_MAKE
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/app.A.install.tex
index 0912161a719..27a4ca2ca55 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/app.A.install.tex
@@ -25,13 +25,13 @@
\end{itemize}
\TeX\ Live 和 Mik\TeX\ 都集成了一个简单的 \LaTeX\ 源代码编辑器 \TeX works(Mac\TeX\ 则集成了类似的 \TeX shop)。
-用户在安装完毕,可直接使用 \TeX works 编写和编译 \LaTeX\ 源代码。
+用户在安装完毕后,可直接使用 \TeX works 编写和编译 \LaTeX\ 源代码。
\subsection{安装发行版}\label{subsec:install-dists}
\subsubsection{\TeX\ Live}
-\TeX\ Live 在 \url{http://www.tug.org/texlive/} 上提供 ISO 光盘镜像%
+\TeX\ Live 的光盘镜像发布于 \url{http://www.tug.org/texlive/}%
\footnote{Linux 发行版的软件源也提供 \TeX\ Live 的安装,不过不够完整,更新也不是很及时。建议直接从镜像安装。}。
下载镜像到本地,挂载到虚拟光驱,或者用压缩工具解压后,在其根目录有几个用于安装的脚本:
\begin{itemize}
@@ -48,8 +48,9 @@
\item \texttt{install-tl -gui=peritk} 启动图形界面安装程序(定制安装)。
\end{itemize}
\end{itemize}
+另外也可以下载在线安装程序 \texttt{install-tl.zip},包含以上所有安装脚本。安装过程中会从 CTAN 软件源下载所有组件。
-Linux 下 \TeX\ Live 安装完毕后,还需要在 root 权限下进行以下操作,使得 \texttt{xelatex} 命令能正确通过 \pkg{fontspec}
+Linux 下 \TeX\ Live 安装完毕后,一般还需要在 root 权限下进行以下操作,使得 \hologo{XeLaTeX} 能正确通过 \pkg{fontspec}
等宏包使用字体\footnote{\url{http://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf},%
可用 \texttt{texdoc texlive-zh-cn} 在本地打开。}:
\begin{enumerate}
@@ -65,34 +66,42 @@ Linux 下 \TeX\ Live 安装完毕后,还需要在 root 权限下进行以下
\TeX\ Live 提供了图形界面的宏包管理器 \TeX\ Live Manager 用于安装和更新宏包,而 Mik\-\TeX\ 也提供了管理器
Mik\-\TeX\ Package Manager。用户可直接打开程序,进行宏包的安装和更新
-(Mik\TeX\ Package Manager 有普通权限和管理员权限的版本,建议总是打开管理员权限的程序)。
+(Mik\-\TeX\ Package Manager 有普通权限和管理员权限的版本,建议总是使用管理员权限的版本)。
-两者也可以通过各自的命令行工具安装更新宏包:
+两者也可以通过各自的命令行工具安装和更新宏包:
\begin{verbatim}
% TeX Live 命令行工具 tlmgr 的使用示例
-tlmgr install <package-name> % 安装某个宏包
-tlmgr remove <package-name> % 卸载某个宏包
-tlmgr update --all --self % 更新所有宏包(包括 tlmgr 本身)
-tlmgr update --list % 列出所有可更新的宏包
-tlmgr repository set http://.../CTAN/systems/texlive/tlnet
- % 指定更新源(CTAN)地址
-tlmgr info <package-name> % 查看宏包信息
- % 加 --list 参数可列出宏包的所有文件
+% 安装/卸载宏包
+tlmgr install <package-name>
+tlmgr remove <package-name>
+% 更新所有宏包(包括 tlmgr 本身)
+tlmgr update --all --self
+% 列出所有可更新的宏包
+tlmgr update --list
+% 指定更新源地址
+% <CTAN mirrors> 形如 https://mirrors.tuna.tsinghua.edu.cn/CTAN
+tlmgr repository set <CTAN mirrors>/systems/texlive/tlnet
+% 查看宏包信息,加 --list 参数可列出宏包的所有文件
+tlmgr info <package-name>
\end{verbatim}
\begin{verbatim}
% MikTeX 命令行工具 mpm 的使用示例
% 建议始终加 --admin 参数使用
-mpm --admin --install <package-name> % 安装某个宏包
-mpm --admin --uninstall <package-name> % 卸载某个宏包
-mpm --admin --update % 更新所有宏包
-mpm --admin --set-repository=http://.../CTAN/systems/win32/miktex/tm/packages
- % 指定更新源(CTAN)地址
+% 安装/卸载宏包
+mpm --admin --install <package-name>
+mpm --admin --uninstall <package-name>
+% 更新所有宏包
+mpm --admin --update
+% 列出所有可更新的宏包
+mpm --admin --find-updates
+% 指定更新源地址
+mpm --admin --set-repository=<CTAN mirrors>/systems/win32/miktex/tm/packages
+% 查看宏包信息
mpm --admin --print-package-info <package-name>
- % 查看宏包信息
\end{verbatim}
-\TeX\ Live 默认安装所有宏包,而 Mik\TeX\ 的安装程序只包含了若干用于 \LaTeX\ 的基本宏包。从 \TeX\ Live 的光盘镜像和 Mik\-\TeX\ 的安装包体积可见一斑。
+\TeX\ Live 默认安装所有宏包,而 Mik\TeX\ 的安装程序只包含了 \LaTeX\ 的一些基本宏包。从 \TeX\ Live 的光盘镜像和 Mik\-\TeX\ 的安装包体积可见一斑。
默认情况下,编译过程中如果遇到宏包未安装而报错的情况下,Mik\TeX\ 会弹出一个对话框,让用户可以选择临时安装宏包,安装成功后继续编译。
\subsection{手动安装宏包}\label{subsec:pkg-manual-install}
@@ -103,11 +112,12 @@ mpm --admin --print-package-info <package-name>
如果确实有手动安装宏包的需要,本小节的内容将有所帮助。在手动安装之前,有必要了解一下 \TeX\ 目录结构(\TeX\ Directory Structure, TDS)。
它是 \TeX\ 发行版中宏包、字体、帮助文档等文件的组织结构。TDS 有时也称为 TEXMF 树,取 \TeX$+$\hologo{METAFONT} 之意。
-以 \TeX\ Live 为例,系统的 TEXMF 树根目录为 \nolinkurl{C:\\texlive\\2015\\texmf-dist},其下有很多子目录,仅举几例:
+以 \TeX\ Live 为例,假设系统的 TEXMF 树根目录为 \nolinkurl{C:\\texlive\\2015\\texmf-dist},其下有很多子目录,仅举几例:
\begin{description}
\item[\texttt{tex/latex}] \LaTeX\ 宏包。
\item[\texttt{doc/latex}] \LaTeX\ 宏包的帮助文档。
\item[\texttt{source/latex}] \LaTeX\ 宏包的源代码。
+ \item[\texttt{bibtex}] \hologo{BibTeX} 工具相关文件,许多宏包配套的 \hologo{BibTeX} 格式文件位于子目录 \texttt{bst} 中。
\item[\texttt{fonts/tfm}] \TeX\ 使用的字体文件,TFM 格式。
\item[\texttt{fonts/type1}] PostScript 字体文件(Type1),PFB 格式。
\item[\texttt{fonts/opentype}] OpenType 格式的字体文件。
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.B.error.help.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/app.B.error.help.tex
index d96c53ed030..d96c53ed030 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.B.error.help.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/app.B.error.help.tex
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/biblio.tex
index dd27fdd8aec..124b5d19023 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/biblio.tex
@@ -58,7 +58,7 @@
\bibitem{uk-tex-faq} The UK TeX users group (TUG).
\newblock \emph{The UK TeX FAQ}.
- \newblock HTML version on \url{http://www.tex.ac.uk/faq/}. \\
+ \newblock HTML version on \url{https://texfaq.org/}. \\
\CTAN|help/uk-tex-faq/newfaq.pdf| (\texttt{texdoc faq})
\bibitem{l2tabu} J\"{u}rgen Fenn.
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.01.basics.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.01.basics.tex
index eeea09ecd51..5a1bf17a8b4 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.01.basics.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.01.basics.tex
@@ -1,8 +1,8 @@
-\chapter{\LaTeX\ 须知}\label{chap:basics}
+\chapter{\LaTeX\ 的基本概念}\label{chap:basics}
\addtocontents{los}{\protect\addvspace{10pt}}
\begin{intro}
-欢迎加入 \LaTeX\ 使用者的队伍!本章开头用简短的篇幅介绍了 \LaTeX\ 的来源,
+欢迎使用 \LaTeX{}!本章开头用简短的篇幅介绍了 \LaTeX\ 的来源,
然后介绍了 \LaTeX\ 源代码的写法,如何编译 \LaTeX\ 源代码生成文档,以及理解接下来的章节所必须的一些知识。
\end{intro}
@@ -10,51 +10,48 @@
\subsection{\protect\TeX}\label{subsec:tex}
-\index{Knuth@Knuth, Donald E. (\textit{高德纳})}
+\index{Knuth@Knuth, Donald E. (\textit{高德纳})}
\index{TeX@\TeX}
-\TeX\ 是高德纳 (Donald E.Knuth)开发的、以排版文字和数学公式为目的的一个计算机软件 \cite{texbook}。
-高德纳从 1977 年开始开发 \TeX\ ,以发掘当时开始用于出版工业的数字印刷设备的潜力。
-正在编写著作《计算机程序设计艺术》的高德纳,意图扭转排版质量每况愈下的状况,以免影响他的出书。
+\TeX\ 是高德纳 (Donald E.~Knuth) 开发的、以排版文字和数学公式为目的的软件\cite{texbook}。
+1977 年,正在编写著作《计算机程序设计艺术》的高德纳,意图扭转排版质量每况愈下的状况,以免影响他的出书,
+于是开始开发 \TeX{},以发掘当时开始用于出版工业的数字印刷设备的潜力。
\TeX\ 排版引擎发布于 1982 年,在 1989 年又加以改进以更好地支持 8-bit 字符和多语言排版。
-\TeX\ 以其卓越的稳定性、跨平台、几乎没有 Bug 而著称。\TeX\ 的版本号不断趋近于 $\pi$,当前为 3.141592653。
+\TeX\ 以其卓越的稳定性、跨平台、几乎没有 bug 而著称。\TeX\ 的版本号不断趋近于 $\pi$,当前为 3.141592653。
\TeX\ 读作 ``Tech'' ,其中 ``ch'' 的发音类似于 ``h'' ,与汉字“泰赫”的发音相近。\TeX\ 的拼写来自希腊词语
-{\fontencoding{LGR}\selectfont teqnik'h} (technique,技术) 的开头几个字母。在 ASCII 字符环境,\TeX\ 写作 \texttt{TeX}。
+τεχνική (technique,技术) 的开头几个字母。在 ASCII 字符环境,\TeX\ 写作 \texttt{TeX}。
\subsection{\LaTeX}\label{subsec:latex}
\index{LaTeX@\LaTeX}
\index{LaTeX2e@\LaTeXe}
-\LaTeX\ 为 \TeX\ 基础上的一套格式,令作者能够使用预定义的专业格式以较高质量排版和印刷他们的作品。
-\LaTeX\ 的最初开发者为 Leslie Lamport 博士\cite{manual}。\LaTeX\ 使用 \TeX\ 程序作为自己的排版引擎。
-当前 \LaTeX\ 由 \LaTeX 3 工作组\footnote{\url{https://www.latex-project.org}}维护。
+\LaTeX\ 是一种格式(format)。为免误会,初次接触这一概念的读者可以粗略地将 \LaTeX\ 理解成是对 \TeX\ 的一层封装。
+\LaTeX\ 使用 \TeX\ 程序作为自己的排版引擎。
+\LaTeX\ 最初的设计目标是分离内容与格式,以便作者能够无需关注版式设计,只需专注与内容创作就能得到高质量排版的作品。
+最初的开发者是 Leslie Lamport 博士\cite{manual},当前 \LaTeX\ 由 \LaTeX 3 工作组%
+\footnote{\url{https://www.latex-project.org}}维护。
\LaTeX\ 读作 ``Lah-tech'' 或者 ``Lay-tech'' ,与汉字“拉泰赫”或“雷泰赫”的发音相近。\LaTeX\ 在 ASCII 字符环境写作 \texttt{LaTeX}。
-当前的 \LaTeX\ 版本为 \LaTeXe ,意思是超出了第二版,接近但没达到第三版,在 ASCII 字符环境写作 \texttt{LaTeX2e}。
+当前的 \LaTeX\ 版本为 \LaTeXe ,意思是超出了第二版,但还远未没达到第三版,在 ASCII 字符环境写作 \texttt{LaTeX2e}。
\subsection{\LaTeX\ 的优缺点}\label{subec:advs}
-\LaTeX\ 总会拿来和一些“所见即所得”(What You See Is What You Get)的文字处理和排版工具比较优缺点。
-笔者认为这种比较并不值得提倡,毕竟所有工具都有自己值得使用的原因。
-
-当然笔者还是会总结一些 \LaTeX\ 的优点:
+经常有人喜欢对比 \LaTeX\ 和以 Microsoft Office Word 为代表的“所见即所得”%
+(What You See Is What You Get)字处理工具。
+这种对比是没有意义的,因为 \TeX\ 是一个排版引擎,\LaTeX\ 是其封装,而 Word 是字处理工具。
+二者的设计目标不一致,也各自有自己的适用范围。
+不过,这里仍旧总结 \LaTeX\ 的一些优点:
\begin{itemize}
- \item 专业的排版输出,产生的文档看上去就像“印刷品”一样。
-
- \item 方便而强大的数学公式排版能力,无出其右。
-
+ \item 具有专业的排版输出能力,产生的文档看上去就像“印刷品”一样。
+ \item 具有方便而强大的数学公式排版能力,无出其右者。
\item 绝大多数时候,用户只需专注于一些组织文档结构的基础命令,无需(或很少)操心文档的版面设计。
-
\item 很容易生成复杂的专业排版元素,如脚注、交叉引用、参考文献、目录等。
-
- \item 强大的扩展性。世界各地的人开发了数以千计的 \LaTeX\ 宏包用于补充和扩展 \LaTeX\ 的功能。
+ \item 强大的可扩展性。世界各地的人开发了数以千计的 \LaTeX\ 宏包用于补充和扩展 \LaTeX\ 的功能。
本手册附录中的 \ref{sec:pkg-list} 小节可见一瞥。更多的宏包参考 \textit{The \LaTeX\ companion}\cite{companion}。
-
- \item \LaTeX\ 促使用户写出结构良好的文档——而这也是 \LaTeX\ 存在的初衷。
-
- \item \LaTeX\ 依赖的 \TeX\ 排版引擎和其它软件是跨平台、免费、开源的。
- 无论用户使用的是 Windows,macOS(OS X),GNU/Linux 还是 FreeBSD 等操作系统,都能轻松获得和使用这一强大的排版工具。
+ \item 能够促使用户写出结构良好的文档——而这也是 \LaTeX\ 存在的初衷。
+ \item \LaTeX\ 和 \TeX\ 及相关软件是跨平台、免费、开源的。
+ 无论用户使用的是 Windows,macOS(OS X),GNU/Linux 还是 FreeBSD 等操作系统,都能轻松获得和使用这一强大的排版工具,并且获得稳定的输出。
\end{itemize}
\LaTeX\ 的缺点也是显而易见的:
@@ -62,19 +59,16 @@
\item 入门门槛高。本手册的副标题叫做 “\pageref{lshort-minutes}~分钟了解 \LaTeXe ”,
实际上 \pageref{lshort-minutes} 是本手册正文部分(包括附录)的页数。如果你以平均一页一分钟的速度看完了本手册,
你只是粗窥门径而已,离学会它还很远。
-
- \item 排查错误困难。\LaTeX\ 作为一个依靠编写代码工作的排版工具,其使用的宏语言比 C++ 或 Python 等程序设计语言在错误排查方面困难得多。
+ \item 不容易排查错误。\LaTeX\ 作为一个依靠编写代码工作的排版工具,其使用的宏语言比 C++ 或 Python 等程序设计语言在错误排查方面困难得多。
它虽然能够提示错误,但不提供调试的机制,有时错误提示还很难理解。
-
- \item 样式定制困难。\LaTeX\ 提供了一个基本上良好的样式,为了让用户不去关注样式而专注于文档结构。
+ \item 不容易定制样式。\LaTeX\ 提供了一个基本上良好的样式,为了让用户不去关注样式而专注于文档结构。
但如果想要改进 \LaTeX\ 生成的文档样式则是十分困难。
-
- \item 相比“所见即所得”的模式有一些不便,为了查看生成的文档,用户总要不停地编译。
+ \item 相比“所见即所得”的模式有一些不便,为了查看生成文档的效果,用户总要不停地编译。
\end{itemize}
\section{第一次使用 \LaTeX}\label{sec:run}
-我们在此给出一个最小的 \LaTeX\ 源代码示例,见源代码 \ref{code:hello-world}。
+源代码~\ref{code:hello-world}~是一份最短的 \LaTeX\ 源代码示例。
\begin{sourcecode}[htp]
\begin{Verbatim}
@@ -86,67 +80,20 @@
\caption{\LaTeX\ 的一个最简单的源代码示例。}\label{code:hello-world}
\end{sourcecode}
-假设将源代码 \ref{code:hello-world} 保存成 \texttt{helloworld.txt}。如果使用 \TeX works 或 \TeX studio 等编辑器,
-点击编辑器提供的“编译”按钮即可。在此建议将编译命令设为 “XeLaTeX”。编译成功后生成文档 \texttt{helloworld.pdf}。
+这里首先介绍如何编译使用这份源代码,在后续小节中再介绍源代码的细节。
-另外也可以使用命令行的方式调用程序进行编译(笔者建议尝试命令行方式,以了解背后的工作原理)。
-打开 Windows 命令提示符或者 Linux / macOS(OS X)的终端,在源代码所在的目录下输入命令:
+你可以将这份源代码保存为~\texttt{helloworld.tex},而后编译。具体来说:
+\begin{itemize}
+ \item 如果使用 \TeX works! 或 \TeX studio 等编辑器,你可以使用编辑器提供的“编译”按钮
+ 或者“排版”按钮。建议将编译命令设置为 “XeLaTeX”。
+ \item 如果使用命令行方式进行编译,则需打开 Windows 命令提示符或者 Linux / macOS(OS X)的终端,在源代码所在的目录下输入命令:
\begin{verbatim}
xelatex helloworld
\end{verbatim}
-此时命令行会闪过许多信息,如果编译成功,可以看到会生成 \texttt{helloworld.pdf} 以及一些其它文件。
-
-\subsection{引擎、格式和编译命令}\label{subsec:concepts}
-
-\pinyinindex{paibanyinqing}{排版引擎}
-\index{pdfTeX@\hologo{pdfTeX}}
-\index{XeTeX@\hologo{XeTeX}}
-在此有必要澄清几个概念:
-\begin{description}
- \item[引擎] 全称为排版引擎,是编译源代码并生成文档的程序,如 \hologo{pdfTeX}、\hologo{XeTeX} 等。有时也称为编译器。
- \item[格式] 是定义了一组命令的代码集。\LaTeX\ 就是最广泛应用的一个格式,高德纳本人还编写了一个简单的 plain \TeX\ 格式,
- 没有定义诸如 \cmd{document\-class} 和 \cmd{section} 等等命令。
- \item[编译命令] 是实际调用的、结合了引擎和格式的命令。如 \texttt{xelatex} 命令是结合 \hologo{XeTeX}
- 引擎和 \LaTeX\ 格式的一个编译命令。
-\end{description}
-常见的引擎、格式和编译命令的关系总结于表 \ref{tbl:engine-format-command}。
-
-\begin{table}[htp]
- \centering
- \caption{\TeX\ 引擎、格式和编译命令。}
- \label{tbl:engine-format-command}
- \begin{tabular}{cccc}
- \hline
- & \textbf{文档格式} & \textbf{plain \TeX\ 格式} & \textbf{\LaTeX\ 格式} \\
- \hline
- \TeX\ 引擎 & DVI & \texttt{tex} & N/A \\
- \hologo{pdfTeX} 引擎 & DVI & \texttt{etex} & \texttt{latex} \\
- & PDF & \texttt{pdftex} & \texttt{pdflatex} \\
- \hologo{XeTeX} 引擎 & PDF & \texttt{xetex} & \texttt{xelatex} \\
- \hologo{LuaTeX} 引擎 & PDF & \texttt{luatex} & \texttt{lualatex} \\
- \hline
- \end{tabular}
-\end{table}
-
-\texttt{latex} 编译命令和 \LaTeX\ 格式往往容易混淆,在讨论关于 \LaTeX\ 的时候需要明确。
-为避免混淆,本手册中的 \LaTeX\ 一律指的是\textbf{格式},\textbf{编译命令}则用等宽字体 \texttt{latex} 表示。
+\end{itemize}
-在此介绍一下几个编译命令的基本特点:
-\begin{description}
- \item[\texttt{latex}]
- 虽然名为 \texttt{latex} 命令,底层调用的引擎其实是 \hologo{pdfTeX}。
- 该命令生成 \texttt{dvi}(Device Independent)格式的文档,
- 用 \texttt{dvipdfmx} 命令可以将其转为 \texttt{pdf}。
- \item[\texttt{pdflatex}]
- 底层调用的引擎也是 \hologo{pdfTeX},可以直接生成 \texttt{pdf} 格式的文档。
- \item[\texttt{xelatex}]
- 底层调用的引擎是 \hologo{XeTeX},支持 UTF-8 编码和 TrueType / OpenType 字体。
- 当前较为方便的中文排版解决方案基于 \texttt{xelatex},详见 \ref{sec:chinese} 节。
- \item[\texttt{lualatex}]
- 底层调用的引擎是 \hologo{LuaTeX},这个引擎在 \hologo{pdfTeX} 引擎基础上发展而来,
- 除了支持 UTF-8 编码和 TrueType / OpenType 字体外,还支持通过 Lua 语言扩展 \TeX\ 的功能。
- \texttt{lualatex} 编译命令下的中文排版支持需要借助 \pkg{luatex-ja} 宏包。
-\end{description}
+如果编译成功,可以在~\texttt{helloworld.tex}~所在的目录,
+看到生成的 \texttt{helloworld.pdf} 以及一些其它文件。
\section{\LaTeX\ 命令和代码结构}\label{sec:src}
@@ -156,66 +103,68 @@ xelatex helloworld
\subsection{\LaTeX\ 命令和环境}\label{subsec:cmds}
\index{LaTeX macro@\LaTeX\ 命令}
-\LaTeX\ 命令以反斜线 \texttt{\textbackslash} 开头,为以下两种形式之一:
+\LaTeX\ 中命令\footnote{也叫作控制序列(control sequence)。}以反斜线 \texttt{\textbackslash} 开头,为以下两种形式之一:
\begin{itemize}
\item 反斜线和后面的一串字母,如 \cmd{LaTeX}。它们以任意非字母符号(空格、数字、标点等)为界限。
\item 反斜线和后面的单个非字母符号,如 \cmd{\$}。
\end{itemize}
要注意 \LaTeX\ 命令是\textbf{对大小写敏感}的,比如输入 \cmd{LaTeX} 命令可以生成错落有致的 \LaTeX\ 字母组合,
-但输入 \cmd{Latex} 或者 \cmd{LaTex} 什么都得不到,还会报错。
+但输入 \cmd{Latex} 或者 \cmd{LaTex} 什么都得不到,还会报错;它们与 \cmd{LaTeX} 是不同的命令。
-字母形式的 \LaTeX\ 命令忽略其后的所有空格。如果要人为引入空格,需要在命令后面加一对括号阻止其忽略空格%
+字母形式的 \LaTeX\ 命令忽略其后的所有连续空格。
+如果要人为引入空格,需要在命令后面加一对花括号阻止其忽略空格%
\footnote{另外也可以在命令后面紧跟一个 \cmd{\textvisiblespace} 命令(反斜线加空格),代表插入一个间距。
比如 \cmd{TeX}\cmd{\textvisiblespace}\texttt{user} 的输出效果就是 \TeX\ user。}:
\begin{example}
-Shall we call ourselves
-\TeX users
+Shall we call ourselves
+\TeX users
or \TeX{} users?
\end{example}
\pinyinindex{canshu}{参数}
-许多 \LaTeX\ 命令需要一个或多个参数,每个参数用花括号 \texttt\{ 和 \texttt\} 包裹。
-有些命令可以带一个或多个可选参数,以方括号 \texttt[ 和 \texttt] 包裹。
-还有些命令在命令名称后可以带一个星号 \texttt*,带星号和不带星号的命令效果有一定差异,
-可以把星号看作一种特殊的可选参数。
+一些 \LaTeX\ 命令可以接收一些参数,参数的内容会影响命令的效果。
+\LaTeX\ 的参数分为可选参数和必选参数。
+可选参数以方括号 \texttt[ 和 \texttt] 包裹;必选参数一般以花括号 \texttt\{ 和 \texttt\} 包裹%
+\footnote{以单个字符作为命令的参数时,可以不加括号。例如,在数学环境下,
+\cmd{frac}\texttt{12} 和 \cmd{frac}\texttt{\{1\}\{2\}} 的效果是一样的。}。
+还有些命令可以带一个星号 \texttt*,带星号和不带星号的命令效果有一定差异。
+初次接触这些概念时,可以粗略地把星号看作一种特殊的可选参数。
\index{LaTeX environment@\LaTeX\ 环境}
\cmdindex{begin,end}
-\LaTeX\ 还引入了\textbf{环境}的用法,用以令一些效果在局部生效,或是生成特殊的文档元素。
+\LaTeX\ 中还包括\textbf{环境},用以令一些效果在局部生效,或是生成特殊的文档元素。
\LaTeX\ 环境的用法为一对命令 \cmd{begin} 和 \cmd{end}:
\begin{command}
-\cmd{begin}\marg{environment name}\marg{arguments} \\
+\cmd{begin}\marg{environment name}\oarg{optional arguments}\marg{mandatory arguments} \\
\ldots \\
-\cmd{end}\marg{environment name}
+\cmd{end}\marg{environment name}
\end{command}
其中 \Arg{environment name} 为环境名,\cmd{begin} 和 \cmd{end} 中填写的环境名应当一致。
-\Arg{arguments} 为环境所需的参数,可能包括可选参数。环境允许嵌套使用。
+类似命令,\marg{mandatory arguments} 和 \oarg{optional arguments} 为环境所需的必选和可选参数。
+\LaTeX\ 环境可能需要一个或多个必选/可选参数,也可能完全不需要参数。
+部分环境允许嵌套使用。
\pinyinindex{fenzu}{分组}
-除了 \LaTeX\ 环境之外,花括号本身也起到\textbf{分组}的作用,使命令的效果限制在分组内。
-例如 \ref{subsec:fontshape} 和 \ref{subsec:fontsize} 小节中介绍的修改字体和字号的命令用法。
+有些命令(如 \cmd{bfseries})会对其后所有内容产生作用。若要限制其作用范围,则需要使用\textbf{分组}。\LaTeX\ 使用一对花括号 \texttt\{ 和 \texttt\} 作为分组,在分组中使用的命令被限制在分组内,不会影响到分组外的内容%
+\footnote{个别命令在分组内仍然会产生全局作用,例如第 \ref{sec:counters} 节介绍的 \cmd{setcounter} 等命令。}。
+上文提到的 \LaTeX\ 环境隐含了一个分组,在环境中的命令被包裹在分组内。
+\ref{subsec:fontshape} 和 \ref{subsec:fontsize} 小节中介绍的修改字体和字号的命令用法,即属此类。
\subsection{\LaTeX\ 源代码结构}\label{subsec:struct}
\cmdindex{documentclass}
\pinyinindex{wendanglei}{文档类}
-\LaTeX\ 源代码以一个 \cmd{document\-class} 命令作为开头,它规定了文档使用的\textbf{文档类}:
+\LaTeX\ 源代码以一个 \cmd{document\-class} 命令作为开头,它指定了文档使用的\textbf{文档类}:
\begin{verbatim}
\documentclass{...}
\end{verbatim}
-
-\cmdindex{usepackage}
-\pinyinindex{hongbao}{宏包}
-之后用 \cmd{usepackage} 命令调用\textbf{宏包}:
-\begin{verbatim}
-\usepackage{...}
-\end{verbatim}
+\cmd{document\-class} 命令有一个可选参数。可选参数会传递给相应的文档类,作为文档类的参数(见 \ref{subsec:classes})。
\envindex{document}
-再接着,用 \env{document} 环境来标记正文内容范围:
+\env{document} 环境当中的内容是文档正文。
\begin{verbatim}
\begin{document}
\section{...}
@@ -224,8 +173,8 @@ or \TeX{} users?
\end{verbatim}
\pinyinindex{daoyanqu}{导言区}
-在 \cmd{documentclass} 和 \cmd{begin}\marg*{document} 之间的位置称为\textbf{导言区},除了使用 \cmd{use\-package}
-调用宏包之外,一些对文档的全局设置命令也在这里使用。
+在 \cmd{documentclass} 和 \cmd{begin}\marg*{document} 之间的位置称为\textbf{导言区}。
+在导言区中一般会使用 \cmd{use\-package} 调用宏包,以及会进行对文档的全局设置。
\section{\LaTeX\ 宏包和文档类}\label{sec:latex-pkgs}
@@ -273,30 +222,21 @@ or \TeX{} users?
\LaTeX\ 的三个标准文档类可指定的选项包括:
\begin{description}
-\item[\texttt{10pt, 11pt, 12pt}] \quad 指定文档的基本字号。缺省为 \texttt{10pt}。
-
-\item[\texttt{a4paper, letterpaper, \ldots}] \quad 指定纸张大小,缺省为美式信纸 \texttt{letterpaper} ($8.5\times11$英寸)。
+\item[\texttt{10pt, 11pt, 12pt}] \quad 指定文档的基本字号。默认为 \texttt{10pt}。
+\item[\texttt{a4paper, letterpaper, \ldots}] \quad 指定纸张大小,默认为美式信纸 \texttt{letterpaper} ($8.5\times11$英寸)。
可指定选项还包括 \texttt{a5paper},\texttt{b5paper},\texttt{executivepaper} 和 \texttt{legalpaper}。
-
\item[\texttt{twoside, oneside}] \quad 指定单面/双面排版。双面排版时,奇偶页的页眉页脚、页边距不同。
-\cls{article} 和 \cls{report} 缺省为 \texttt{oneside},\cls{book} 缺省为 \texttt{twoside}。
-
-\item[\texttt{onecolumn, twocolumn}] \quad 指定单栏/双栏排版。缺省为 \texttt{onecolumn}。
-
+\cls{article} 和 \cls{report} 默认为 \texttt{oneside},\cls{book} 默认为 \texttt{twoside}。
+\item[\texttt{onecolumn, twocolumn}] \quad 指定单栏/双栏排版。默认为 \texttt{onecolumn}。
\item[\texttt{openright, openany}] \quad 指定新的一章 \cmd{chapter} 是在奇数页(右侧)开始,还是直接紧跟着上一页开始。
-\cls{report} 缺省为 \texttt{openany},\cls{book} 缺省为 \texttt{openright}。对 \cls{article} 无效。
-
-\item[\texttt{landscape}] \quad 指定横向排版。缺省为纵向。
-
+\cls{report} 默认为 \texttt{openany},\cls{book} 默认为 \texttt{openright}。对 \cls{article} 无效。
+\item[\texttt{landscape}] \quad 指定横向排版。默认为纵向。
\item[\texttt{titlepage, notitlepage}] 指定标题命令 \cmd{maketitle} 是否生成单独的标题页。
-\cls{article} 缺省为 \texttt{notitlepage},\cls{report} 和 \cls{book} 缺省为 \texttt{titlepage}。
-
-\item[\texttt{fleqn}] \quad 令行间公式左对齐。缺省为居中对齐。
-
-\item[\texttt{leqno}] \quad 将公式编号放在左边。缺省为右边。
-
+\cls{article} 默认为 \texttt{notitlepage},\cls{report} 和 \cls{book} 默认为 \texttt{titlepage}。
+\item[\texttt{fleqn}] \quad 令行间公式左对齐。默认为居中对齐。
+\item[\texttt{leqno}] \quad 将公式编号放在左边。默认为右边。
\item[\texttt{draft, final}] \quad 指定草稿/终稿模式。
-草稿模式下,断行不良的地方会在行尾添加一个黑色方块。缺省为 \texttt{final}。
+草稿模式下,断行不良的地方会在行尾添加一个黑色方块。默认为 \texttt{final}。
\end{description}
\subsection{宏包}\label{subsec:packages}
@@ -310,11 +250,11 @@ or \TeX{} users?
\cmd{usepackage}\oarg{options}\marg{package-name}
\end{command}
-\cmd{usepackage}可以一次性调用多个宏包,在 \Arg{package-name} 中用逗号隔开。这种用法一般不要指定选项%
+\cmd{usepackage}~可以一次性调用多个宏包,在 \Arg{package-name} 中用逗号隔开。这种用法一般不要指定选项%
\footnote{使用多个宏包时指定选项,相当于给每个宏包指定同样的选项。如果有某个宏包不能识别指定的选项,则会出错。}:
\begin{verbatim}
% 一次性调用三个排版表格常用的宏包
-\usepackage{tabularx,makecell,multirow}
+\usepackage{tabularx, makecell, multirow}
\end{verbatim}
附录 \ref{sec:pkg-list} 汇总了常用的一些宏包。我们在手册接下来的章节中,也会穿插介绍一些最常用的宏包的使用方法。
@@ -322,8 +262,8 @@ or \TeX{} users?
在使用宏包和文档类之前,一定要首先确认它们是否安装在你的计算机中,否则 \cmd{use\-package} 等命令会报错误。
详见附录 \ref{sec:pkg-manager}。
-每个宏包(包括前面所说的文档类)都定义了许多命令和环境,或者修改了 \LaTeX\ 已有的命令和环境。
-为了明白它们的用法,需要查阅宏包和文档类的帮助文档。使用方法是在 Windows 命令提示符或者 Linux 终端下输入命令:
+宏包(包括前面所说的文档类)可能定义了许多命令和环境,或者修改了 \LaTeX\ 已有的命令和环境。
+它们的用法说明记在相应宏包和文档类的帮助文档。在 Windows 命令提示符或者 Linux 终端下输入命令可查阅相应文档:
\begin{command}
\texttt{texdoc} \Arg{pkg-name}
\end{command}
@@ -343,7 +283,7 @@ or \TeX{} users?
\item[\texttt{.bst}] \hologo{BibTeX} 用到的参考文献格式模板。详见 \ref{subsec:bibtex-use} 小节。
\end{description}
-\LaTeX\ 在编译过程中除了生成 \texttt{.dvi} 或 \texttt{.pdf} 格式的文档外,还生成相当多的辅助文件和日志。
+\LaTeX\ 在编译过程中除了生成 \texttt{.dvi} 或 \texttt{.pdf} 格式的文档外\footnote{\hologo{XeLaTeX} 还可能生成 \texttt{.xdv} 文件。},还可能会生成相当多的辅助文件和日志。
一些功能如交叉引用、参考文献、目录、索引等,需要先通过编译生成辅助文件,
然后再次编译时读入辅助文件得到正确的结果,所以复杂的 \LaTeX\ 源代码可能要编译多次:
\begin{description}
@@ -362,7 +302,8 @@ or \TeX{} users?
\section{文件的组织方式}\label{sec:latex-multi-files}
-当编写较大规模的 \LaTeX\ 源代码,如书籍、毕业论文等,有理由将源代码分成若干个文件,比如每章内容为一个文件,
+当编写长篇文档时,例如当编写书籍、毕业论文时,单个源文件会使修改、校对变得十分困难。
+将源文件分割成若干个文件,例如将每章内容单独写在一个文件中,会大大简化修改和校对的工作。
可参考源代码 \ref{code:book-struct} 的写法。
\cmdindex{include}
@@ -403,4 +344,56 @@ or \TeX{} users?
如果想生成文档,则用 \texttt\% 注释掉 \cmd{syntaxonly} 命令即可。
-\endinput \ No newline at end of file
+\section{\LaTeX\ 和 \TeX\ 相关的术语和概念}\label{sec:concepts}
+
+\pinyinindex{paibanyinqing}{排版引擎}
+\index{pdfTeX@\hologo{pdfTeX}}
+\index{XeTeX@\hologo{XeTeX}}
+在本章的最后有必要澄清几个概念:
+\begin{description}
+ \item[引擎] 全称为排版引擎,是编译源代码并生成文档的程序,如 \hologo{pdfTeX}、\hologo{XeTeX} 等。有时也称为编译器。
+ \item[格式] 是定义了一组命令的代码集。\LaTeX\ 就是最广泛应用的一个格式,高德纳本人还编写了一个简单的 plain \TeX\ 格式,
+ 没有定义诸如 \cmd{document\-class} 和 \cmd{section} 等等命令。
+ \item[编译命令] 是实际调用的、结合了引擎和格式的命令。如 \texttt{xelatex} 命令是结合 \hologo{XeTeX}
+ 引擎和 \LaTeX\ 格式的一个编译命令。
+\end{description}
+常见的引擎、格式和编译命令的关系总结于表 \ref{tbl:engine-format-command}。
+
+\begin{table}[htp]
+ \centering
+ \caption{\TeX\ 引擎、格式及其对应的编译命令。}
+ \label{tbl:engine-format-command}
+ \begin{tabular}{cccc}
+ \hline
+ & \textbf{文档格式} & \textbf{plain \TeX\ 格式} & \textbf{\LaTeX\ 格式} \\
+ \hline
+ \TeX\ 引擎 & DVI & \texttt{tex} & N/A \\
+ \hologo{pdfTeX} 引擎 & DVI & \texttt{etex} & \texttt{latex} \\
+ & PDF & \texttt{pdftex} & \texttt{pdflatex} \\
+ \hologo{XeTeX} 引擎 & PDF & \texttt{xetex} & \texttt{xelatex} \\
+ \hologo{LuaTeX} 引擎 & PDF & \texttt{luatex} & \texttt{lualatex} \\
+ \hline
+ \end{tabular}
+\end{table}
+
+\texttt{latex} 编译命令和 \LaTeX\ 格式往往容易混淆,在讨论关于 \LaTeX\ 的时候需要明确。
+为避免混淆,本手册中的 \LaTeX\ 一律指的是\textbf{格式},\textbf{编译命令}则用等宽字体 \texttt{latex} 表示。
+
+在此介绍一下几个编译命令的基本特点:
+\begin{description}
+ \item[\texttt{latex}]
+ 虽然名为 \texttt{latex} 命令,底层调用的引擎其实是 \hologo{pdfTeX}。
+ 该命令生成 \texttt{dvi}(Device Independent)格式的文档,
+ 用 \texttt{dvipdfmx} 命令可以将其转为 \texttt{pdf}。
+ \item[\texttt{pdflatex}]
+ 底层调用的引擎也是 \hologo{pdfTeX},可以直接生成 \texttt{pdf} 格式的文档。
+ \item[\texttt{xelatex}]
+ 底层调用的引擎是 \hologo{XeTeX},支持 UTF-8 编码和 TrueType / OpenType 字体。
+ 当前较为方便的中文排版解决方案基于 \texttt{xelatex},详见 \ref{sec:chinese} 节。
+ \item[\texttt{lualatex}]
+ 底层调用的引擎是 \hologo{LuaTeX},这个引擎在 \hologo{pdfTeX} 引擎基础上发展而来,
+ 除了支持 UTF-8 编码和 TrueType / OpenType 字体外,还支持通过 Lua 语言扩展 \TeX\ 的功能。
+ \texttt{lualatex} 编译命令下的中文排版支持需要借助 \pkg{luatex-ja} 宏包。
+\end{description}
+
+\endinput
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.02.text.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.02.text.tex
index 69fc3421bd1..55b43be44ca 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.02.text.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.02.text.tex
@@ -118,7 +118,7 @@ Several spaces equal one.
An empty line starts a new
paragraph.\par
-A \verb|\par| command also
+A \verb|\par| command also
starts a new line.
\end{example}
@@ -147,11 +147,11 @@ ak a word.
如果想要输入以上符号,需要使用以下带反斜线的形式输入:
\begin{example}
-\# \$ \% \& \{ \} \_
+\# \$ \% \& \{ \} \_
\^{} \~{} \textbackslash
\end{example}
-事实上这些带反斜线的形式就是 \LaTeX\ 命令。\cmd{\textasciicircum} 和 \cmd{\textasciitilde}
+事实上这些带反斜线的形式就是 \LaTeX\ 命令。\cmd{\textasciicircum} 和 \cmd{\textasciitilde}
两个命令是需要带参数的,如果不加一对花括号(空参数),就将后面的字符作为参数,形成重音效果(详见 \ref{subsec:accents} 节)。
\crcmd\ 被直接定义成了手动换行的命令,输入反斜杠就只好用 \cmd{text\-back\-slash}。
@@ -165,8 +165,8 @@ It's dif{}f{}icult to f{}ind \ldots .
\subsection{标点符号}\label{subsec:punct}
-中文的标点符号(都是全角的非 ASCII 字符)一般来讲不用特别操心,只要使用中文输入法输入即可。
-而在英文标点的输入上,有许多需要留意的地方。
+中文的标点符号(绝大多数为非 ASCII 字符)使用中文输入法输入即可,一般不需要过多留意。
+而在英文标点符号上,有许多需要留意的地方。
\subsubsection{引号}
@@ -185,8 +185,8 @@ It's dif{}f{}icult to f{}ind \ldots .
\index{biaodianfuhao@标点符号!-@\protect\verb+-+ (\textit{连字号} -)}
\index{biaodianfuhao@标点符号!--@\protect\verb+--+ (\textit{短破折号} --)}
\index{biaodianfuhao@标点符号!---@\protect\verb+---+ (\textit{长破折号} ---)}
-\LaTeX\ 中有三种长度的“横线”可用:连字号、短破折号(en-dash)和长破折号(em-dash)。
-它们分别有不同的用途:连字号 - 用来组成复合词;短破折号 -- 将数字连接表示范围;长破折号 --- 作为破折号使用。
+\LaTeX\ 中有三种长度的“横线”可用:连字号(hyphen)、短破折号(en-dash)和长破折号(em-dash)。
+它们分别有不同的用途:连字号 - 用来组成复合词;短破折号 -- 用来连接数字表示范围;长破折号 --- 用来连接单词,与中文语境中的破折号用法类似。
\begin{example}
daughter-in-law, X-rated\\
pages 13--67\\
@@ -206,13 +206,7 @@ one, two, three, \ldots one hundred.
\subsubsection{波浪号}
我们在 \ref{subsec:special-chars} 小节中了解了 \cmd{\textasciitilde} 命令,它可以用来输入波浪号,
-但位置靠顶端,可能不甚理想(\cmd{\textasciitilde} 命令主要用作重音,参考下一小节)。有的人可能喜欢用数学公式里的 \cmd{sim} 符号来代替:
-\begin{example}
-1\~{}3 \qquad 1$\sim$2
-\end{example}
-
-更合理的波浪号请参考 \ref{subsec:font-encs} 小节讨论的内容。
-使用中文的全角波浪号也不失为一个办法(西文中使用波浪号的情形较少见)。
+但位置靠顶端(\cmd{\textasciitilde} 命令主要用作重音,参考下一小节)。西文中较少将波浪号作为标点符号使用,通常使用中文的全角波浪号(~)。
\subsection{特殊西文符号与重音}\label{subsec:accents}
@@ -299,15 +293,15 @@ An \underline{underlined} text.
\cmd{underline} 命令生成下划线的样式比较机械,不同的单词可能生成高低各异的下划线,并且无法换行。
\pkg{ulem} 宏包解决了这一问题,它提供的 \cmd{uline} 命令能够轻松生成自动换行的下划线:
\begin{example}
-An example of \uline{some
+An example of \uline{some
long and underlined words.}
\end{example}
\cmdindex{emph}
-\cmd{emph} 命令用来将文字变为斜体以示强调。如果在本身已经用 \cmd{emph} 命令强调的文字内部嵌套使用 \cmd{emph},
-内部则使用正常字体的文字:
+\cmd{emph} 命令用来将文字变为斜体以示强调。如果在本身已经用 \cmd{emph} 命令强调的文字内部嵌套使用 \cmd{emph} 命令,
+内部则使用直立体文字:
\begin{example}
-Some \emph{emphasized words,
+Some \emph{emphasized words,
including \emph{double-emphasized}
words}, are shown here.
\end{example}
@@ -322,8 +316,9 @@ words}, are shown here.
\subsection{单词间距和断行}\label{subsec:interword}
-通常情况下,断行的位置尽可能选取在两个单词之间,也就是你输入到源文件中的“空格”。
-一般情况下,这个“空格”生成一个间距,它会根据行宽和文字自动调整,文字密一些的地方,单词间距就略窄,反之略宽。
+在西文排版实践中,断行的位置尽可能选取在两个单词之间,也就是用户在源文件中输入的“空格”%
+\footnote{中文排版实现汉字间断行,则需要宏包(如 \pkg{xeCJK} 等)或排版引擎(如 upLaTeX)的支持。}。
+这个“空格”通常生成一个间距,它会根据行宽和上下文自动调整,文字密一些的地方,单词间距就略窄,反之略宽。
\index{~@\texttt\textasciitilde\ (\textit{不断行空格})}
我们可以使用字符 \texttt\textasciitilde 在合适的位置插入一个不会断行的空格(高德纳称之为 tie,“带子”),
@@ -342,7 +337,7 @@ Donale~E. Knuth
\cmd{newline}
\end{command}
-它们有两点区别:一是 \crcmd\ 可以带可选参数 \Arg{length},用于在换行的地方增加垂直间距(见 \ref{subsec:vspace} 小节),
+它们有两点区别:一是 \crcmd\ 可以带可选参数 \Arg{length},用于在换行处向下增加垂直间距(见 \ref{subsec:vspace} 小节),
而 \cmd{newline} 不带可选参数;二是 \crcmd\ 也在表格、公式等地方用于分行,而 \cmd{newline} 只用于文本段落中。
\cmdindex{newpage,clearpage}
@@ -382,4 +377,4 @@ i\-frag\-i\-lis\-tic\-ex\-pi\-%
al\-i\-do\-cious.
\end{example}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.03.elements.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.03.elements.tex
index ba3347fa1ae..95f4d86556b 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.03.elements.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.03.elements.tex
@@ -9,7 +9,7 @@
\subsection{章节标题}\label{subsec:secs}
-\cmdindex{chapter,section,subsection,subsubsection,paragraph,subparagraph}
+\cmdindex{part,chapter,section,subsection,subsubsection,paragraph,subparagraph}
\clsindex{article,book,report}
一篇结构化的、条理清晰文档一定是层次分明的,通过不同的命令分割为章、节、小节。三个标准文档类 \cls{article}、\cls{report} 和 \cls{book}%
@@ -25,12 +25,7 @@
\cmd{subparagraph}\marg{title}
\end{command}
其中 \cmd{chapter} \textbf{只在 \cls{book} 和 \cls{report} 文档类有定义}。这些命令生成章节标题,并能够自动编号。
-
-\cmdindex{part}
-\cmd{part} 命令用以将整个文档分割为大的分块,但不影响 \cmd{chapter} 或 \cmd{section} 等的编号:
-\begin{command}
-\cmd{part}\marg{title}
-\end{command}
+除此之外 \LaTeX\ 还提供了 \cmd{part} 命令,用来将整个文档分割为大的分块,但不影响 \cmd{chapter} 或 \cmd{section} 等的编号。
上述命令除了生成带编号的标题之外,还向目录中添加条目,并影响页眉页脚的内容(详见 \ref{sec:pagestyle} 节)。每个命令有两种变体:
\begin{itemize}
@@ -53,12 +48,14 @@
\subsection{目录}\label{sec:toc}
\cmdindex{tableofcontents}
+\pkgindex{tocbibind,tocloft,titletoc}
在 \LaTeX\ 中生成目录非常容易,只需在合适的地方使用命令:
\begin{command}
\cmd{tableofcontents}
\end{command}
-这个命令会生成单独的一个章节,标题默认为 ``Contents''{},可通过 \ref{sec:latex-settings} 节给出的方法定制标题。
+这个命令会生成单独的一章(\cls{book} / \cls{report})或一节(\cls{article}),标题默认为 ``Contents''{},可通过 \ref{sec:latex-settings} 节给出的方法定制标题。
+\cmd{tableof\-contents} 生成的章节默认不写入目录(\cmd{section*} 或 \cmd{chapter*}),可使用 \pkg{tocbibind} 等宏包修改设置。
正确生成目录项,一般需要编译两次源代码。
@@ -71,6 +68,8 @@
其中 \Arg{level} 为章节层次 \texttt{chapter} 或 \texttt{section} 等,\Arg{title} 为出现于目录项的章节标题。
+\pkg{titletoc}、\pkg{tocloft} 等宏包提供了具体定制目录项格式的功能,详情请参考宏包的帮助文档。
+
\subsection{文档结构的划分}\label{sec:matters}
\cmdindex{appendix}
@@ -138,10 +137,7 @@
\cmdindex{maketitle}
\pinyinindex{biaotiye}{标题页}
-在信息给定后,就可以使用 \cmd{maketitle} 命令生成一个简单的标题页了:
-\begin{command}
-\cmd{maketitle}
-\end{command}
+在信息给定后,就可以使用 \cmd{maketitle} 命令生成一个简单的标题页了。
源代码 \ref{code:titlepage} 给出了一个标题页的示例和大致效果。
\cls{article} 文档类的标题默认不单独成页,而 \cls{report} 和 \cls{book} 默认单独成页。
可在 \cmd{document\-class} 命令调用文档类时指定 \texttt{titlepage / notitlepage} 选项以修改默认的行为。
@@ -1039,6 +1035,8 @@ A \rule[-.4pt]{3em}{.4pt} line.
\cmd{listoffigures}
\end{command}
+它们类似 \cmd{tableofcontents} 生成单独的章节。
+
\subsection{并排和子图表}\label{subsec:subfig}
我们时常有在一个浮动体里面放置多张图的用法。最简单的用法就是直接并排放置,
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.04.math.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.04.math.tex
index 85f80d3984c..2c0f6fcf35b 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.04.math.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.04.math.tex
@@ -186,7 +186,7 @@ $1\dfrac{1}{2}$~hours
\end{example}
\mathindex{sqrt}
-一般的根式使用 \cmd{sqrt}\marg*{...};表示$n$次方根时写成 \cmd{sqrt}\oarg*{\textit{n}}\marg*{...}。
+一般的根式使用 \cmd{sqrt}\marg*{...};表示 $n$ 次方根时写成 \cmd{sqrt}\oarg*{\textit{n}}\marg*{...}。
\begin{example}
$\sqrt{x} \Leftrightarrow x^{1/2}
\quad \sqrt[3]{2}
@@ -196,7 +196,7 @@ $\sqrt{x} \Leftrightarrow x^{1/2}
\cmdindex[amsmath]{binom}
特殊的分式形式,如二项式结构,由 \pkg{amsmath} 宏包的 \amscmd{binom} 命令生成:
\begin{example}
-Pascal’s rule is
+Pascal's rule is
\[
\binom{n}{k} =\binom{n-1}{k}
+ \binom{n-1}{k-1}
@@ -359,8 +359,8 @@ $\vec{AB} \qquad
\waccindex{overbrace,underbrace}
\cmd{overbrace} 和 \cmd{underbrace} 命令用来生成上/下括号,各自可带一个上/下标公式。
\begin{example}
-$\underbrace{\overbrace{a+b+c}^6
-\cdot \overbrace{d+e+f}^7}
+$\underbrace{\overbrace{(a+b+c)}^6
+\cdot \overbrace{(d+e+f)}^7}
_\text{meaning of life} = 42$
\end{example}
@@ -771,10 +771,10 @@ $\mu, M \qquad
\begin{example}
\newtheorem{mythm}{My Theorem}[section]
\begin{mythm}\label{thm:light}
-The light speed in vaccum
+The light speed in vacuum
is $299,792,458\,\mathrm{m/s}$.
\end{mythm}
-\begin{mythm}[Energy–momentum relation]
+\begin{mythm}[Energy-momentum relation]
The relationship of energy,
momentum and mass is
\[E^2 = m_0^2 c^4 + p^2 c^2\]
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.05.style.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.05.style.tex
index 2d7b06a634d..20a39c10e36 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.05.style.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.05.style.tex
@@ -130,17 +130,14 @@ He likes {\LARGE large and
\subsection{字体编码}\label{subsec:font-encs}
-字体编码对于 \LaTeX\ 用户来讲是一个比较晦涩的概念。它指定了一个字体里面包含了哪些符号、用哪些 \LaTeX\ 命令表示符号等细节。
-需要明确一点:字体编码并不与我们在 \ref{subsec:ascii} 等小节叙述的 ASCII 编码等一一对应。
+字体编码对于 \LaTeX\ 用户来讲是一个比较晦涩的概念。它规定了一个字体里包含的符号,并将若干符号用 \LaTeX\ 命令定义。
+注意字体编码并不与我们在 \ref{subsec:ascii} 等小节叙述的 ASCII 编码等一一对应。
常见的正文字体编码有 \texttt{OT1} 和 \texttt{T1} 等。\LaTeX\ 默认使用兼容 plain \TeX\ 的 \texttt{OT1} 编码,使用起来有诸多限制:
-高德纳在设计 Computer Modern 字体时认为一些符号,如大于号、小于号等,原则上都应该在公式里出现,所以在正文字体(\cmd{rmfamily} 或 \cmd{sffamily})里,
-这些符号所在的位置被其它符号所占据(在默认的 OT1 字体编码下 \texttt< 和 \texttt> 排版\ !` 和\ ?` 两个倒立的标点符号,
-正常的大于号和小于号可用命令 \cmd{textgreater} 和 \cmd{textless} 输入;等宽字体(\cmd{ttfamily})里是正常的大于号和小于号)。
-
+高德纳在设计 Computer Modern 字体时认为一些符号,如大于号、小于号等,原则上都应该在公式里出现,所以在正文字体里这些符号所在的位置被其它符号所占据
+(\texttt{OT1} 字体编码、\cmd{rmfamily} 和 \cmd{sffamly} 字体族下, \texttt< 和 \texttt> 排版\ !` 和\ ?` 两个倒立的标点符号,
+正常的大于号和小于号可用命令 \cmd{textgreater} 和 \cmd{textless} 输入;\cmd{ttfamily} 字体族下是正常的大于号和小于号)。
扩展的 \texttt{T1} 字体编码则更加靠近 ASCII 文本编码,不会出现上述的大于号、小于号的问题。
-\texttt{T1} 字体编码配合一些字体宏包如 \pkg{txfonts}、\pkg{lmodern} 等,还能够令用户使用 \cmd{textasciitilde} 命令
-输入位置居中的波浪号,比如表示近似的用法 \textasciitilde 24,相比数学符号 \texttt\$\cmd{sim}\texttt\$ 来得合理一些。
\pkgindex{fontenc}
切换字体编码要用到 \pkg{fontenc} 宏包:
@@ -178,7 +175,7 @@ He likes {\LARGE large and
\multicolumn{2}{c}{\textbf{文本字体宏包}} \\
\multicolumn{2}{l}{\footnotesize 以下字体包括传统的 \LaTeX\ 字体格式以及 TrueType / OpenType 格式。} \\
\hline
- \pkg{cm-unicode} & Computer Modern 风格的 Unicode 字体,支持多种西方语言 \\
+ \pkg{cm-unicode} & Computer Modern 风格的 Unicode 字体,支持多种西方语言 \\
\pkg{dejavu} & DejaVu 开源字体 \\
\pkg{droid} & Droid 开源字体 \\
\pkg{inconsolata} & Inconsolata 开源等宽字体 \\
@@ -200,8 +197,8 @@ He likes {\LARGE large and
\subsection{使用 \pkg{fontspec} 宏包更改字体 (\texttt{xelatex})}\label{subsec:fontspec}
\index{xelatex@\texttt{xelatex} 命令}
-\texttt{xelatex} 编译命令能够支持直接调用系统安装的 \texttt{.ttf} 或 \texttt{.otf} 格式字体%
-\footnote{Linux 下的 \TeX\ Live 为了支持系统安装的字体,需要额外的配置。详见附录 \ref{app:install}。}。相比于上一小节,我们有了更多修改字体的余地。
+\texttt{xelatex} 编译命令能够支持直接调用系统和 \TeX\ 发行版中的 \texttt{.ttf} 或 \texttt{.otf} 格式字体%
+\footnote{Linux 下的 \TeX\ Live 为了令 \hologo{XeTeX} 使用 OpenType 字体,需要额外的配置。详见附录 \ref{app:install}。}。相比于上一小节,我们有了更多修改字体的余地。
\pkgindex{fontspec}
\cmdindex[fontspec]{setmainfont,setsansfont,setmonofont}
@@ -264,7 +261,7 @@ He likes {\LARGE large and
\end{tabular}
\end{table}
-在一些情况下还会用到可伸缩的“弹性长度”,如 \texttt{12pt plus 2pt minus 3pt}
+在一些情况下还会用到可伸缩的“弹性长度”,如 \texttt{12pt plus 2pt minus 3pt}
表示基础长度为 \texttt{12pt},可以伸展到 \texttt{14pt} ,也可以收缩到 \texttt{9pt}。
也可只定义 \texttt{plus} 或者 \texttt{minus} 的部分,如 \texttt{0pt plus 5pt}。
@@ -301,7 +298,7 @@ He likes {\LARGE large and
\begin{example}
{\linespread{2.0}\selectfont
The baseline skip is set to be
-twice the normal baseline skip.
+twice the normal baseline skip.
Pay attention to the \verb|\par|
command at the end. \par}
@@ -399,26 +396,28 @@ nor\qquad mal\\
在页面中,段落、章节标题、行间公式、列表、浮动体等元素之间的间距是 \LaTeX\ 预设的。比如 \cmd{parskip} ,默认设置为 \texttt{0pt plus 1pt}。
-\cmdindex{vspace}
-如果我们想要人为地增加段落之间的垂直间距,可以在两个段落之间的位置使用如下命令:
-\begin{command}
-\cmd{vspace}\marg{length}
-\end{command}
+\cmdindex{vspace,vspace*}
+如果我们想要人为地增加段落之间的垂直间距,可以在两个段落之间的位置使用 \cmd{vspace} 命令:
+\begin{example}
+A paragraph.
-\cmdindex{vspace*}
-\cmd{vspace} 的间距在一页的顶端或底端可能被“吞掉”,类似 \cmd{hspace} 在一行的开头和末尾那样。
+\vspace{2ex}
+Another paragraph.
+\end{example}
+
+\cmd{vspace} 命令生成的垂直间距在一页的顶端或底端可能被“吞掉”,类似 \cmd{hspace} 在一行的开头和末尾那样。
对应地,\cmd{vspace*} 命令产生不会因断页而消失的垂直间距。\cmd{vspace} 也可用 \cmd{stretch} 设置无限延伸的垂直长度。
\index{\@\crcmd\ (\textit{换行})}
在段落内的两行之间增加垂直间距,一般通过给断行命令 \crcmd\ 加可选参数,如 \crcmd\texttt{[6pt]} 或 \crcmd\texttt{*[6pt]}。
\cmd{vspace} 也可以在段落内使用,区别在于 \cmd{vspace} 只引入垂直间距而不断行:
\begin{example}
-Use command \verb|\vspace{12pt}|
+Use command \verb|\vspace{12pt}|
to add \vspace{12pt} some spaces
between lines in a paragraph.
Or you can use \verb|\\[12pt]|
-to \\[12pt] add vertical space,
+to \\[12pt] add vertical space,
but it also breaks the paragraph.
\end{example}
@@ -450,13 +449,13 @@ but it also breaks the paragraph.
页边距等比较直观的参数则必须间接设置。我们根据图 \ref{fig:layouts} 将各个方向的页边距计算公式给出(以奇数页为例):
\begin{align*}
-\text{\Arg{left-margin}} &= \text{\ttfamily 1in}
+\text{\Arg{left-margin}} &= \text{\ttfamily 1in}
+ \text{\cmd{hoffset}}
+ \text{\cmd{oddsidemargin}} \\
-\text{\Arg{right-margin}} &= \text{\cmd{paperwidth}}
+\text{\Arg{right-margin}} &= \text{\cmd{paperwidth}}
- \text{\Arg{left-margin}}
- \text{\cmd{textwidth}} \\
-\text{\Arg{top-margin}} &= \text{\ttfamily 1in}
+\text{\Arg{top-margin}} &= \text{\ttfamily 1in}
+ \text{\cmd{voffset}}
+ \text{\cmd{topmargin}}
+ \text{\cmd{headheight}}
@@ -515,20 +514,19 @@ but it also breaks the paragraph.
\LaTeX\ 默认将页面内容在垂直方向分散对齐。对于有大量图表的文档,许多时候想要做到排版匀称的页面很困难,
垂直分散对齐会造成某些页面的垂直间距过宽,还可能报大量的 \texttt{Underfull} \cmd{vbox} 消息。
+\LaTeX\ 还提供了另一种策略:将页面内容向顶部对齐,给底部留出高度不一的空白。
\cmdindex{raggedbottom, flushbottom}
-\LaTeX\ 还提供了另一种策略:将页面内容向顶部对齐,给底部留出高度不一的空白。在导言区或者适合的位置使用
-\cmd{raggedbottom} 开启顶部对齐的效果:
+以下命令分别令页面在垂直方向向顶部对齐 / 分散对齐:
\begin{command}
-\cmd{raggedbottom}
+\cmd{raggedbottom} \\
+\cmd{flushbottom}
\end{command}
-相反地,\cmd{flushbottom} 命令用于设置成默认的分散对齐。
-
\subsection{分栏}\label{subsec:columns}
\cmdindex{onecolumn,twocolumn}
-\LaTeX\ 支持简单的单栏或双栏排版。标准文档类的全局选项 \texttt{onecolumn}、\texttt{twocolumn}
+\LaTeX\ 支持简单的单栏或双栏排版。标准文档类的全局选项 \texttt{onecolumn}、\texttt{twocolumn}
可控制全文分单栏或双栏排版。\LaTeX\ 也提供了切换单/双栏排版的命令:
\begin{command}
\cmd{onecolumn} \\
@@ -604,6 +602,17 @@ but it also breaks the paragraph.
\item[\cls{book/report} 文档类,\texttt{oneside} 选项] 页眉为章标题和页码。
\end{description}
+\cmdindex{pagenumbering}
+\cmd{pagenumbering} 命令令我们能够改变页眉页脚中的页码样式:
+\begin{command}
+\cmd{pagenumbering}\marg{style}
+\end{command}
+
+\cmdindex{frontmatter,mainmatter}
+\Arg{style} 为页码样式,默认为 \texttt{arabic}(阿拉伯数字),还可修改为 \texttt{roman}(小写罗马数字)、
+\texttt{Roman}(大写罗马数字)等。注意使用 \cmd{pagenumbering} 命令后会将页码重置为 1。\cls{book} 文档类的 \cmd{front\-matter} 和 \cmd{main\-matter} 内部就使用了 \cmd{page\-numbering} 命令切换页码样式。
+对页码格式的详细说明见 \ref{sec:counters} 节。
+
\subsection{手动更改页眉页脚的内容}\label{subsec:marks}
\cmdindex{markright,markboth}
@@ -638,7 +647,7 @@ but it also breaks the paragraph.
\pkg{fancyhdr} 宏包改善了页眉页脚样式的定义方式,允许我们将内容自由安置在页眉和页脚的左、中、右三个位置,还为页眉和页脚各加了一条横线。
\cmdindex[fancyhdr]{fancyhead,fancyfoot,fancyhf}
-\pkg{fancyhdr} 自定义了样式名称 fancy。使用 \pkg{fancyhdr} 宏包定义页眉页脚之前,通常先用 \cmd{page\-style}\marg*{fancy} 调用这个样式。
+\pkg{fancyhdr} 自定义了样式名称 \texttt{fancy}。使用 \pkg{fancyhdr} 宏包定义页眉页脚之前,通常先用 \cmd{page\-style}\marg*{fancy} 调用这个样式。
在 \pkg{fancyhdr} 中定义页眉页脚的命令为:
\begin{command}
\cmd{fancyhf}\oarg{position}\marg*{\ldots}\\
@@ -667,12 +676,13 @@ but it also breaks the paragraph.
\end{Verbatim}
\caption{\pkg{fancyhdr} 宏包的使用方法示例。}\label{code:fancyhdr}
\end{sourcecode}
-
+
\cmdindex[fancyhdr]{fancypagestyle}
\pkg{fancyhdr} 还支持用 \cmd{fancy\-page\-style} 为自定义的页眉页脚样式命名,或者重新定义已有的样式如 \texttt{plain} 等:
\begin{verbatim}
% 自定义 myfancy 样式
\fancypagestyle{myfancy}{%
+ \fancyhf{}
\fancyhead{...}
\fancyfoot{...}
}
@@ -683,4 +693,4 @@ but it also breaks the paragraph.
更多用法请参考 \pkg{fancyhdr} 宏包的帮助文档。
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.06.spec.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.06.spec.tex
index 9913bb993ff..06b06f73358 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.06.spec.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.06.spec.tex
@@ -47,7 +47,7 @@
Partl~\cite{germenTeX} has proposed that \ldots
\begin{thebibliography}{99}
-\bibitem{germenTeX} H.~Partl: \emph{German \TeX},
+\bibitem{germenTeX} H.~Partl: \emph{German \TeX},
TUGboat Volume~9, Issue~1 (1988)
\end{thebibliography}
\end{document}
@@ -69,14 +69,14 @@ Partl~\cite{germenTeX} has proposed that \ldots
\end{command}
其中 \Arg{type} 为文献的类别,如 \texttt{article} 为学术论文,\texttt{book} 为书籍,\texttt{in\-collection} 为论文集中的某一篇,等等。
-\Arg{citation} 为 \cmd{cite} 命令使用的文献标签。在 \Arg{citation} 之后为条目里的各个数据项,以 \Arg{key} = \marg{value} 的形式组织。
+\Arg{citation} 为 \cmd{cite} 命令使用的文献标签。在 \Arg{citation} 之后为条目里的各个字段,以 \Arg{key} = \marg{value} 的形式组织。
我们在此简单列举学术论文里使用较多的 \hologo{BibTeX} 文献条目类别:
\begin{description}
- \item[\texttt{article}] 学术论文,必需数据项有 author, title, journal, year; 可选数据项包括 volume, number, pages, doi 等;
- \item[\texttt{book}] 书籍,必需数据项有 author/editor, title, publisher, year; 可选数据项包括 volume/number, series, address 等;
- \item[\texttt{incollection}] 论文集中的一篇,必需数据项有 author, title, booktitle, publisher, year; 可选数据项包括 editor, volume/number, chapter, pages, address 等;
- \item[\texttt{inbook}] 书中的一章,必需数据项有 author/editor, title, chapter/pages, publisher, year; 可选数据项包括 volume/number, series, address 等。
+ \item[\texttt{article}] 学术论文,必需字段有 author, title, journal, year; 可选字段包括 volume, number, pages, doi 等;
+ \item[\texttt{book}] 书籍,必需字段有 author/editor, title, publisher, year; 可选字段包括 volume/number, series, address 等;
+ \item[\texttt{incollection}] 论文集中的一篇,必需字段有 author, title, booktitle, publisher, year; 可选字段包括 editor, volume/number, chapter, pages, address 等;
+ \item[\texttt{inbook}] 书中的一章,必需字段有 author/editor, title, chapter/pages, publisher, year; 可选字段包括 volume/number, series, address 等。
\end{description}
例如 \texttt{article} 类别的参考文献数据条目写法如下:
@@ -85,7 +85,7 @@ Partl~\cite{germenTeX} has proposed that \ldots
title = {Demostration of bibliography items},
author = {Alice Axford and Bob Birkin and Charlie Copper and Danny Dannford},
year = {2013},
- month = {March},
+ month = {Mar},
journal = {Journal of \TeX perts},
volume = {36},
number = {7},
@@ -120,19 +120,19 @@ Partl~\cite{germenTeX} has proposed that \ldots
\textbf{plain}\\{}
[1] Alice Axford, Bob Birkin, Charlie Copper, and Danny Dannford.
\newblock Demostration of bibliography items.
-\newblock {\em Journal of \TeX perts}, 36(7):114--120, March 2013.
+\newblock {\em Journal of \TeX perts}, 36(7):114--120, Mar 2013.
\medskip
\textbf{alpha}\\{}
[ABCD13] Alice Axford, Bob Birkin, Charlie Copper, and Danny Dannford.
\newblock Demostration of bibliography items.
-\newblock {\em Journal of \TeX perts}, 36(7):114--120, March 2013.
+\newblock {\em Journal of \TeX perts}, 36(7):114--120, Mar 2013.
\medskip
\textbf{abbrv}\\{}
[1] A.~Axford, B.~Birkin, C.~Copper, and D.~Dannford.
\newblock Demostration of bibliography items.
-\newblock {\em Journal of \TeX perts}, 36(7):114--120, March 2013.
+\newblock {\em Journal of \TeX perts}, 36(7):114--120, Mar 2013.
\medskip
\textbf{amsplain}(\AmS\ 文档类 \textsf{amsart} 等配套的样式)\\{}
@@ -148,7 +148,7 @@ Partl~\cite{germenTeX} has proposed that \ldots
\textbf{IEEEtran}(\textsf{IEEEtran} 模板文档类配套的样式)\\{}
[1] A.~Axford, B.~Birkin, C.~Copper, and D.~Dannford, ``Demostration of
bibliography items,'' \emph{Journal of \TeX perts}, vol.~36, no.~7, pp.
- 114--120, March 2013.
+ 114--120, Mar 2013.
\end{trivlist}
\hrule
\end{table}
@@ -185,7 +185,7 @@ Partl~\cite{germenTeX} has proposed that \ldots
\bibliographystyle{plain}
\begin{document}
\section{Some words}
-Some excellent books, for example, \cite{citation1}
+Some excellent books, for example, \cite{citation1}
and \cite{citation2} \ldots
\bibliography{books}
@@ -241,6 +241,98 @@ xelatex demo
\pkg{natbib} 宏包还有更多选项和用法,比如默认的引用是用小括号包裹的,可指定 \texttt{square} 选项改为中括号;
再比如 \cmd{citep} 命令也支持可选参数,为引用前后都添加额外内容。这里不再赘述,请参考 \pkg{natbib} 宏包的帮助文档。
+
+\subsection{\pkg{biblatex} 宏包}\label{subsec:biblatex}
+
+\pkgindex{biblatex}
+本节的末尾简单介绍一下基于 \pkg{biblatex} 宏包排版参考文献的方式。
+\pkg{biblatex} 宏包是一套基于 \LaTeX\ 宏命令的参考文献解决方案,提供了便捷的格式控制和强大的排序、分类、筛选、多文献表等功能。
+\pkg{biblatex} 宏包也因其对 UTF-8 和中文参考文献的良好支持,被国内较多 \LaTeX\ 模板采用。
+
+基于 \pkg{biblatex} 宏包的方式与基于 \hologo{BibTeX} 的传统方式有一定区别,下面从文档结构和命令、编译方式、样式选择等方面逐一介绍:
+
+\subsubsection{文档结构和 \pkg{biblatex} 相关命令}
+
+\cmdindex[biblatex]{addbibresource,printbibliography}
+\begin{enumerate}
+ \item 首先是在导言区调用 \pkg{biblatex} 宏包。宏包支持以 \Arg{key}=\Arg{value} 形式指定选项,包括参考文献样式 style、参考文献著录排序的规则 sorting 等。
+ \item 接着在导言区使用 \cmd{addbibresource} 命令为 \pkg{biblatex} 引入参考文献数据库。与基于 \hologo{BibTeX} 的传统方式不同的是,这里需要写完整的文件名。
+ \item 在正文中使用 \cmd{cite} 命令引用参考文献。除此之外还可以使用丰富的命令达到不同的引用效果,如 \cmd{citeauthor} 和 \cmd{citeyear} 分别单独引用作者和年份,\cmd{textcite} 和 \cmd{parencite} 分别类似 \pkg{natbib} 宏包提供的 \cmd{citet} 和 \cmd{citep} 命令,以及脚注式引用 \cmd{footcite} 等。
+ \item 最后在需要排版参考文献的位置使用命令 \cmd{printbibliography}。
+\end{enumerate}
+
+\begin{sourcecode}[htp]
+\begin{Verbatim}
+% File: egbibdata.bib
+@book{caimin2006,
+ title = {UML基础和Rose建模教程},
+ address = {北京},
+ author = {蔡敏 and 徐慧慧 and 黄柄强},
+ publisher = {人民邮电出版社},
+ year = {2006},
+ month = {1}
+}
+
+% File: demo.tex
+\documentclass{ctexart}
+% 使用符合 GB/T 7714-2015 规范的参考文献样式
+\usepackage[style=gb7714-2015]{biblatex}
+% 注意加 .bib 扩展名
+\addbibresource{egbibdata.bib}
+
+\begin{document}
+
+见文献\cite{caimin2006}。
+
+\printbibliography
+\end{document}
+\end{Verbatim}
+\caption{应用 \pkg{biblatex} 的示例 egbibdata.bib 和 demo.tex。}
+\end{sourcecode}
+
+\subsubsection{编译方式}
+
+\index{biber}
+与基于 \hologo{BibTeX} 的传统方式不同的是,\pkg{biblatex} 宏包使用 \texttt{biber} 程序处理参考文献。因此上述文档的编译步骤为:
+
+\begin{verbatim}
+xelatex demo
+biber demo
+xelatex demo
+xelatex demo
+\end{verbatim}
+
+\subsubsection{\pkg{biblatex} 样式和其它选项}
+
+\pkg{biblatex} 使用的参考文献样式分为著录样式(bibliography style)和引用样式(citation style),分别以 \texttt{.bbx} 和 \texttt{.cbx} 为扩展名。参考文献的样式在调用宏包时使用 \texttt{style} 选项指定,或者使用 \texttt{bibstyle} 或 \texttt{citestyle} 分别指定:
+\begin{verbatim}
+% 同时调用 gb7714-2015.bbx 和 gb7714-2015.cbx
+\usepackage[style=gb7714-2015]{biblatex}
+% 著录样式调用 gb7714-2015.bbx,引用样式调用 biblatex 宏包自带的 authoryear
+\usepackage[bibstyle=gb7714-2015,citestyle=authoryear]{biblatex}
+\end{verbatim}
+
+以下总结一些常用的参考文献样式,除 \pkg{biblatex} 宏包自带的样式外,许多样式以单独的宏包在发行版内发布。
+
+\begin{description}
+ \item[\texttt{authoryear}]
+ \pkg{biblatex} 自带样式,类似 \pkg{natbib} 默认的引用样式效果。
+ \item[\texttt{authortitle}]
+ \pkg{biblatex} 自带样式,采用作者-题名(shorttitle 字段)的引用样式。
+ \item[\texttt{verbose}]
+ \pkg{biblatex} 自带样式,引用样式中包含作者、题名、书名、页码等字段的信息。
+ \item[\texttt{alphabetic}]
+ \pkg{biblatex} 自带样式,著录样式与 \hologo{BibTeX} 的 \texttt{alpha} 样式类似。
+ \item[\texttt{trad-alpha}]
+ \pkg{biblatex-trad} 样式包,移植自 \hologo{BibTeX} 默认的 \texttt{alpha} 样式。另外还包括 \texttt{trad-abbrv}、\texttt{trad-plain} 和 \texttt{trad-unsrt}。
+ \item[\texttt{gb7714-2015}]
+ 符合中文文献著录标准 GB/T 7714-2015 的样式,著录按顺序编码排版。另外还包括按作者-年份顺序排版著录的样式 \texttt{gb7714-2015ay}。
+ \item[\texttt{caspervector}]
+ 以中文文献著录标准 GB/T 7714-2015 为基础的一个样式。
+ \item[\texttt{ieee}]
+ 兼容 \pkg{IEEEtran} 风格的样式,著录按顺序编码排版。另外还包括按作者-年份顺序排版著录的样式 \texttt{ieee-alphabetic}。
+\end{description}
+
\section{索引和 makeindex 工具}\label{sec:index}
\pinyinindex{suoyin}{索引}
@@ -280,7 +372,7 @@ xelatex demo
\cmd{index}\marg{index entry}
\end{command}
-其中 \Arg{index entry} 为索引项,写法由表 \ref{tbl:index-entry} 汇总。其中 \texttt!、\texttt @ 和 \texttt|
+其中 \Arg{index entry} 为索引项,写法由表 \ref{tbl:index-entry} 汇总。其中 \texttt!、\texttt @ 和 \texttt|
为特殊符号,如果要向索引项直接输出这些符号,需要加前缀 \texttt";而 \texttt" 需要输入两个引号 \texttt{""} 才能输出到索引项。
\begin{table}[htp]
@@ -291,12 +383,12 @@ xelatex demo
\textbf{举例} &\textbf{索引项} &\textbf{备注}\\
\hline
\multicolumn{3}{l}{普通索引} \\[.8ex]
- \verb+hello+ & hello, 1 & 普通索引 \\
+ \verb+hello+ & hello, 1 & 普通索引 \\
\hline
\multicolumn{3}{l}{分级索引,以 \texttt! 分隔,最多支持三级} \\[.8ex]
- \verb+hello+ & hello, 1 & 一级索引 \\
- \verb+hello!Peter+ &\quad Peter, 3 & 二级索引 \\
- \verb+hello!Peter!Jack+ &\qquad Jack, 3 & 三级索引 \\
+ \verb+hello+ & hello, 1 & 一级索引 \\
+ \verb+hello!Peter+ &\quad Peter, 3 & 二级索引 \\
+ \verb+hello!Peter!Jack+ &\qquad Jack, 3 & 三级索引 \\
\hline
\multicolumn{3}{l}{格式化索引,形式为 \Arg{alpha}\texttt @\Arg{format}} \\
\multicolumn{3}{l}{\Arg{alpha}为纯字母,用来排序} \\
@@ -347,17 +439,17 @@ Test index.
\pkg{color} 宏包支持 \texttt{rgb}、\texttt{cmyk} 和 \texttt{gray} 模型,\pkg{xcolor} 支持更多的模型如 \texttt{hsb} 等。
\begin{example}
\large\sffamily
-{\color[gray]{0.6}
+{\color[gray]{0.6}
60\% 灰色} \\
-{\color[rgb]{0,1,1}
- 青色}
+{\color[rgb]{0,1,1}
+ 青色}
\end{example}
其二是直接使用名称代表颜色,前提是已经定义了颜色名称(没定义的话会报错):
\begin{example}
\large\sffamily
{\color{red} 红色} \\
-{\color{blue} 蓝色}
+{\color{blue} 蓝色}
\end{example}
\pkgindex{xcolor}
@@ -450,22 +542,22 @@ Test index.
\section{使用超链接}\label{sec:hyperlinks}
\pinyinindex{chaolianjie}{超链接}
-PDF 文档格式是现今最流行的电子文档格式,而电子文档最实用的需求之一就是链接功能。
+PDF 文档格式是现今最流行的电子文档格式,而电子文档最实用的需求之一就是超链接功能。
\LaTeX\ 中实现这一功能的是 \pkg{hyperref} 宏包。
\subsection{\pkg{hyperref} 宏包}\label{subsec:hyperref}
\pkgindex{hyperref}
-\pkg{hyperref} 宏包涉及到的链接遍布 \LaTeX\ 的每一个角落——目录、引用、脚注、索引、参考文献等等都被封装成链接。
-但这也使得它与其它宏包的冲突机会大大增加,虽然宏包已经尽力解决各方面的兼容性,但仍不能面面俱到。
-为减少冲突的可能性,习惯上将 \pkg{hyperref} 宏包\textbf{放在其它宏包之后调用}。
+\pkg{hyperref} 宏包涉及到的链接遍布 \LaTeX\ 的每一个角落——目录、引用、脚注、索引、参考文献等等都被封装成超链接。
+但这也使得它与其它宏包发生冲突的可能性大大增加,虽然宏包已经尽力解决各方面的兼容性,但仍不能面面俱到。
+为减少可能的冲突,习惯上将 \pkg{hyperref} 宏包\textbf{放在其它宏包之后调用}。
\pinyinindex{xuanxiang}{选项(宏包/文档类)}
与 \pkg{graphicx} 宏包类似,\texttt{latex} + \texttt{dvipdfmx} 命令下调用 \pkg{hyperref} 宏包时,需要指定选项 \texttt{dvipdfmx};
而 \texttt{pdflatex} 或 \texttt{xelatex} 命令下不需要。
\cmdindex[hyperref]{hypersetup}
-\pkg{hyperref} 宏包提供了命令 \cmd{hypersetup} 配置各种参数,或者也可以作为宏包选项,在调用宏包时指定:
+\pkg{hyperref} 宏包提供了命令 \cmd{hypersetup} 配置各种参数。参数也可以作为宏包选项,在调用宏包时指定:
\begin{command}
\cmd{hypersetup}\marg*{\Arg{option1},\Arg{option2}=\marg*{value},\ldots} \\
\cmd{usepackage}\oarg*{\Arg{option1},\Arg{option2}=\marg*{value},\ldots}\marg*{hyperref}
@@ -478,35 +570,39 @@ PDF 文档格式是现今最流行的电子文档格式,而电子文档最实
\hline
\textbf{参数} & \textbf{默认值} & \textbf{含义} \\
\hline
- \texttt{colorlinks=}\Arg{true\textnormal|false}
+ \texttt{colorlinks=}\Arg{true\textnormal|false}
& \textit{false} & 设置为 \textit{true} 为链接文字带颜色,反之加上带颜色的边框 \\
\texttt{hidelinks} & & 取消链接的颜色和边框 \\
- \texttt{pdfborder=}\marg*{\Arg{n} \Arg{n} \Arg{n}}
+ \texttt{pdfborder=}\marg*{\Arg{n} \Arg{n} \Arg{n}}
& 0 0 1 & 超链接边框设置,设为 0 0 0 可取消边框 \\
\hline
- \texttt{bookmarks=}\Arg{true\textnormal|false}
+ \texttt{bookmarks=}\Arg{true\textnormal|false} \textsuperscript{\dag}
& \textit{true} & 是否生成书签 \\
- \texttt{bookmarksopen=}\Arg{true\textnormal|false}
+ \texttt{bookmarksopen=}\Arg{true\textnormal|false}
& \textit{false} & 是否展开书签 \\
- \texttt{bookmarksnumbered=}\Arg{true\textnormal|false}
+ \texttt{bookmarksnumbered=}\Arg{true\textnormal|false}
& \textit{false} & 书签是否带章节编号 \\
- \texttt{CJKbookmarks=}\Arg{true\textnormal|false}
+ \texttt{CJKbookmarks=}\Arg{true\textnormal|false}
& \textit{false} & 使用 \pkg{CJK} 宏包/ GBK 编码排版中文时必须设定的参数,
需要将生成的 \texttt{.out} 文件用工具处理编码,或调用 \pkg{xCJK2uni} 宏包 \\
\texttt{unicode} & & 使用 \pkg{CJKutf8} 宏包/ UTF-8 编码排版中文时必须设定的参数 \\
\hline
- \texttt{pdftitle=}\Arg{string}
+ \texttt{pdftitle=}\Arg{string}
& 空 & 标题 \\
- \texttt{pdfauthor=}\Arg{string}
+ \texttt{pdfauthor=}\Arg{string}
& 空 & 作者 \\
- \texttt{pdfsubject=}\Arg{string}
+ \texttt{pdfsubject=}\Arg{string}
& 空 & 主题 \\
- \texttt{pdfkeywords=}\Arg{string}
+ \texttt{pdfkeywords=}\Arg{string}
& 空 & 关键词 \\
\texttt{pdfstartview=}\Arg{Fit\textnormal|FitH\textnormal|FitV}
& \textit{Fit} & 设置 PDF 页面以适合页面/适合宽度/适合高度等方式显示,默认为适合页面 \\
\hline
\end{tabular}
+\begin{quotation}
+\small
+\textsuperscript{\dag} 该选项只能在调用宏包时指定。
+\end{quotation}
\end{table}
\subsection{超链接}\label{subsec:url-href}
@@ -522,7 +618,7 @@ PDF 文档格式是现今最流行的电子文档格式,而电子文档最实
\textbf{可直接输入如 \texttt\%、\texttt\& 这样的特殊符号}。
\cmdindex[hyperref]{href}
-我们也可以像网页一样,把一段文字赋予其“超链接”的作用:
+我们也可以像 HTML 中的超链接一样,把一段文字作为超链接:
\begin{command}
\cmd{href}\marg{url}\marg{text}
\end{command}
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.07.graphic.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.07.graphic.tex
index 13a07dc1e4d..7be4a2ed8bc 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.07.graphic.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.07.graphic.tex
@@ -248,7 +248,7 @@
\begin{itemize}
\item \texttt{\Arg{arrow}-\Arg{arrow}} 指定线条首尾的箭头形式。
- 较为复杂的箭头形式需要使用 \cmd{use\-tikz\-library}\marg*{arrows.meta}。
+ 复杂的箭头形式需要使用 \cmd{use\-tikz\-library} \marg*{arrows.meta}。
\end{itemize}
\begin{example}
\begin{tikzpicture}[thick]
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.08.custom.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.08.custom.tex
index bf0954a7073..656f9f0ac6b 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.08.custom.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap.08.custom.tex
@@ -248,12 +248,8 @@ My humble subjects \ldots
\end{verbatim}
\cmdindex{pagenumbering}
-如果只是简单将计数器输出格式应用到页码上的话,有个更方便的命令 \cmd{page\-number\-ing}:
-\begin{verbatim}
-\pagenumbering{Roman}
-\end{verbatim}
-不过它在修改 page 计数器输出格式的同时,还将计数器的值改为 1,令修改后的页码总是从 1 开始。\cls{book} 文档类的
-\cmd{frontmatter} 和 \cmd{mainmatter} 等都用了 \cmd{pagenumbering} 命令。
+我们在 \ref{subsec:basic-pagesyle} 小节中见过命令 \cmd{pagenum\-bering}。
+它的内部机制是修改 page 计数器的格式 \cmd{thepage},并将计数器的值重置为 1。
最后介绍两个有用的计数器:
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/fdl.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/fdl.tex
index 820a486b1fb..820a486b1fb 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/fdl.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/fdl.tex
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/latexmkrc b/Master/texmf-dist/doc/latex/lshort-chinese/src/latexmkrc
new file mode 100644
index 00000000000..2182ecc4c72
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/latexmkrc
@@ -0,0 +1,12 @@
+$pdf_mode = 5;
+
+$xelatex = "xelatex -file-line-error -halt-on-error -interaction=nonstopmode -synctex=1 %O %S";
+$xdvipdfmx = "xdvipdfmx -E -o %D %O %S";
+
+@default_excluded_files = ("lshort-zh-cn-layout.tex");
+
+$go_mode = 1;
+
+$clean_ext = "los synctex.gz xdv";
+
+$makeindex = "makeindex -s lshort-zh-cn.ist %O -o %D %S";
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty
index 6afb903eeda..6f8ae9e3069 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty
@@ -6,7 +6,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 基本工具宏包
-%
+%
\RequirePackage{amsmath,amsthm}
\RequirePackage{hologo,ulem,verbatim,fancyvrb,layout,multicol}
\RequirePackage{colortbl,tabularx,multirow,makecell,booktabs}
@@ -21,14 +21,33 @@
% 中文正文字体使用 Fandol
%
\PassOptionsToPackage{no-math}{fontspec}
-\RequirePackage[fontset=fandol,zihao=false,scheme=chinese,heading=true]{ctex}[2015/06/24]
+\RequirePackage[zihao=false,scheme=chinese,heading=true]{ctex}[2015/06/24]
%
% 字体和符号宏包
-%
-\RequirePackage{lmodern} % 西文正文字体使用 Latin Modern
+%
+\setmainfont{cmun}[
+ Extension = .otf,
+ UprightFont = *rm,
+ ItalicFont = *ti,
+ BoldFont = *bx,
+ BoldItalicFont = *bi,
+]
+\setsansfont{cmun}[
+ Extension = .otf,
+ UprightFont = *ss,
+ ItalicFont = *si,
+ BoldFont = *sx,
+ BoldItalicFont = *so,
+]
+\setmonofont{cmun}[
+ Extension = .otf,
+ UprightFont = *btl,% light version
+ ItalicFont = *bto,% light version
+ BoldFont = *tb,
+ BoldItalicFont = *tx,
+]
\RequirePackage{amssymb,latexsym,textcomp,mathrsfs,euscript,yhmath} % 与默认字体不冲突的一些符号包
-\RequirePackage[LGR,T1]{fontenc}
% 调整 layout 宏包的命令使之能够放入浮动体,手动指定奇偶页的 layout
\input lshort-zh-cn-layout
@@ -55,7 +74,7 @@
%
% 不依赖 fancyhdr 的页眉页脚设定
-%
+%
\addtolength{\headheight}{1.6pt}
\newdimen\headwidth \headwidth\textwidth
\newdimen\headrulewidth \headrulewidth=0.4pt
@@ -77,10 +96,10 @@
%
% 不依赖 tocbibind 的参考文献/索引修改
% 索引依赖 multicols 环境排版
-%
+%
\renewenvironment{thebibliography}[1]
- {\chapter{\bibname%
- \protect\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
+ {\chapter{\bibname}%
+ \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
@@ -98,8 +117,8 @@
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\renewenvironment{theindex}%
- {\chapter{\indexname%
- \protect\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}}
+ {\chapter{\indexname}%
+ \@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}%
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem
\small
@@ -109,10 +128,10 @@
%
% 将主目录和源代码目录合并排版
% 不依赖 float 宏包的 \listof,因此要补充定义 \l@sourcecode
-%
+%
\renewcommand\tableofcontents%
- {\chapter{\contentsname%
- \protect\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
+ {\chapter{\contentsname}%
+ \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
\begin{multicols}{2}
\@starttoc{toc}%
\end{multicols}
@@ -122,7 +141,7 @@
%
% 令 \cleardoublepage 的偶数页页眉页脚为空
-%
+%
\renewcommand{\cleardoublepage}
{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
@@ -143,7 +162,7 @@
\DeclareRobustCommand*\TikZ{Ti\textit{k\/}Z}
%
% PDF 书签中对符号的特殊处理
-%
+%
\pdfstringdefDisableCommands{%
\def\AmS{AMS}%
\def\TikZ{TikZ}%
@@ -158,6 +177,7 @@
% 命令和环境的写法
%
\DeclareRobustCommand*\cmd[1]{\texttt{\char`\\#1}}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
\def\crcmd{\cmd{\char`\\}}
\DeclareRobustCommand*\env[1]{\texttt{#1}}
\DeclareRobustCommand*\pkg[1]{\textsf{#1}}
@@ -217,11 +237,11 @@
\begin{tabular}{>{\columncolor{blue!5}}l}
}{\end{tabular}\endtrivlist}
-%
+%
% 示例环境 example
% 环境中的代码写入临时文件 lshort-zh-cn-example.aux
% 再从临时文件中读取,分别生成代码盒子和示例盒子
-%
+%
\newwrite\example@out
\newlength\savefboxrule
\newlength\savefboxsep
@@ -267,4 +287,4 @@
\def\sourcecodename{源代码示例列表}
\def\l@sourcecode{\@dottedtocline{1}{1.5em}{2.3em}}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex
index 62ba41df20b..fca438c9b08 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex
@@ -3,10 +3,10 @@
\def\lshortversionoriginal{6.2}
\def\lshortdateoriginal{Februrary 28, 2018}
-\def\lshortversioncn{6.0}
+\def\lshortversioncn{6.01}
\hypersetup{%
- pdftitle={The Not So Short Introduction to LaTeX2e(Chinese Simplified)},%
+ pdftitle={The Short Introduction to LaTeX2e (Chinese Simplified)},%
pdfkeywords={LaTeX, LaTeX2e},
pdfcreator={XeLaTeX with `ctex' package}
}
@@ -24,32 +24,32 @@
\begin{document}
\pagenumbering{Alph}
-\input{chap/titlepage}
+\input{titlepage}
\frontmatter
-\input{chap/preface.contrib}
-\input{chap/preface.overview}
+\input{preface.contrib}
+\input{preface.overview}
\tableofcontents
\mainmatter
-\input{chap/chap.01.basics}
-\input{chap/chap.02.text}
-\input{chap/chap.03.elements}
-\input{chap/chap.04.math}
-\input{chap/sec.symbol.table}
-\input{chap/chap.05.style}
-\input{chap/chap.06.spec}
-\input{chap/chap.07.graphic}
-\input{chap/chap.08.custom}
+\input{chap.01.basics}
+\input{chap.02.text}
+\input{chap.03.elements}
+\input{chap.04.math}
+\input{sec.symbol.table}
+\input{chap.05.style}
+\input{chap.06.spec}
+\input{chap.07.graphic}
+\input{chap.08.custom}
\appendix
-\input{chap/app.A.install}
-\input{chap/app.B.error.help}
+\input{app.A.install}
+\input{app.B.error.help}
\refstepcounter{minutes}\label{lshort-minutes}
\backmatter
-\input{chap/biblio}
-\input{chap/fdl}
+\input{biblio}
+\input{fdl}
\printindex
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat b/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat
index f7a9f29f0a0..e58af4ae36e 100755
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat
@@ -1,17 +1,18 @@
@echo off
set LSHORT=lshort-zh-cn
set PDF=%LSHORT%.pdf
-set TEMP=%LSHORT%.aux %LSHORT%.log %LSHORT%.idx %LSHORT%.ind %LSHORT%.ilg %LSHORT%.out %LSHORT%.toc %LSHORT%.los %LSHORT%-example.aux %LSHORT%.synctex.gz
+set TEMP=%LSHORT%.xdv %LSHORT%.aux %LSHORT%.log %LSHORT%.idx %LSHORT%.ind %LSHORT%.ilg %LSHORT%.out %LSHORT%.toc %LSHORT%.los %LSHORT%-example.aux %LSHORT%.synctex.gz
if "%1"=="clean" goto clean
set TEX=xelatex
+set NOPDFMODE=-interaction=nonstopmode -synctex=1 --no-pdf
set MODE=-interaction=nonstopmode -synctex=1
set MAKEINDEX=makeindex
-%TEX% %MODE% %LSHORT%
+%TEX% %NOPDFMODE% %LSHORT%
%MAKEINDEX% -s %LSHORT%.ist %LSHORT%
-%TEX% %MODE% %LSHORT%
+%TEX% %NOPDFMODE% %LSHORT%
%TEX% %MODE% %LSHORT%
if exist %PDF% (
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.contrib.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/preface.contrib.tex
index 61b6186cdf3..61b6186cdf3 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.contrib.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/preface.contrib.tex
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.overview.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/preface.overview.tex
index 3bf947d2ae9..3bf947d2ae9 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/preface.overview.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/preface.overview.tex
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/sec.symbol.table.tex
index cbd06ec9cef..cbd06ec9cef 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/sec.symbol.table.tex
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/titlepage.tex
index 5e889ce0742..e6d3bb0be45 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/titlepage.tex
@@ -12,7 +12,7 @@
\vspace{\stretch{1}}
\noindent\rlap{%
\begin{minipage}{\textwidth}
- \linespread{1.67}\selectfont\raggedleft
+ \linespread{2}\selectfont\raggedleft
{\bfseries 英文作者:} Tobias Oetiker\\
Hubert Partl, Irene Hyna and Elisabeth Schlegl \\
{\bfseries 英文版本:} Version~\lshortversionoriginal, \lshortdateoriginal\\[4ex]