summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-26 21:46:53 +0000
committerKarl Berry <karl@freefriends.org>2017-03-26 21:46:53 +0000
commitf281d730a5b02f4c9ddd75caf59c2bdb2b2f4b43 (patch)
treea4e0b7b2e6832983c3ad2d5a561e317f4d2fbd4a
parentd7b92e080a4ea517469567218b11a23684bf868d (diff)
lshort-chinese (26mar17)
git-svn-id: svn://tug.org/texlive/trunk@43606 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md35
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/README.md44
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/lshort-zh-cn.pdfbin1377340 -> 1410412 bytes
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/INSTRUCTIONS.md2
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile5
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex12
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.B.error.help.tex85
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex2
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.01.basics.tex49
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.02.text.tex31
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.03.elements.tex174
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.04.math.tex133
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.05.style.tex116
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.06.spec.tex257
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.07.graphic.tex133
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/chap.08.custom.tex154
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex27
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex4
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-layout.tex5
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-style.sty85
-rw-r--r--Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn.tex7
-rwxr-xr-xMaster/texmf-dist/doc/latex/lshort-chinese/src/make.bat49
22 files changed, 873 insertions, 536 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
new file mode 100644
index 00000000000..3dd2eee1d99
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/README-zh.md
@@ -0,0 +1,35 @@
+# 中文版 lshort,5.10 版
+
+## 许可证
+
+本文档以 **GNU 自由文档许可证(1.3 版)** 发布。详见文档中题为“GNU Free Documentation License”的章节,或者源代码文件 `fdl.tex`。
+
+## 编译之前的准备
+
+将发行版内的 `ctex` 宏包、`xeCJK` 宏包更新到最新(包括它们依赖的所有宏包),并确认 `lshort-zh-cn-style.sty` 调用的其它宏包都已正确安装并更新到最新。
+
+本文档使用 `fandol` 字体包。`fontspec` 宏包会对此字体报 script-not-exist 的警告,可以无视。
+
+## 编译方式
+
+### 手动编译
+
+在 src 目录下按照以下顺序编译:
+```
+xelatex lshort-zh-cn
+makeindex -s lshort-zh-cn.ist lshort-zh-cn
+xelatex lshort-zh-cn
+xelatex lshort-zh-cn
+```
+
+如果编译正确生成 PDF,之后将 PDF 移动到根目录。
+
+### 使用脚本和 Makefile 编译
+
+Linux 下提供了 GNU make 可用的 Makefile,使用 GNU make 的顺序为:
+```
+make
+make install
+```
+
+Windows 下在 src 目录提供批处理脚本 `make.bat`,双击执行编译。
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/README.md b/Master/texmf-dist/doc/latex/lshort-chinese/README.md
index 3d2b57a5933..d7c15b3b55c 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, v5.05
+# The Not So Short Introduction To LaTeX (Chinese Edition), v5.10
## License
@@ -9,7 +9,7 @@ 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.
+This document uses `fandol` font package. You may receive a warning like 'script-not-exist' made by `fontspec` package. Just leave it alone.
## Typesetting
@@ -20,6 +20,7 @@ In 'src' directory, typeset the source code in the following order:
xelatex lshort-zh-cn
makeindex -s lshort-zh-cn.ist lshort-zh-cn
xelatex lshort-zh-cn
+xelatex lshort-zh-cn
```
If typesetting succeeds and the target PDF document is made correctly, then move it to the root directory.
@@ -32,41 +33,4 @@ 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.
-
----
-
-# 中文版 lshort,5.05 版
-
-## 许可证
-
-本文档以**GNU 自由文档许可证(1.3 版)**发布。详见文档中题为“GNU Free Documentation License”的章节,或者源代码文件“fdl.tex”。
-
-## 编译之前的准备
-
-将发行版内的 `ctex` 宏包、`xeCJK` 宏包更新到最新(包括它们依赖的所有宏包),并确认 `lshort-zh-cn-style.sty` 调用的其它宏包都已正确安装并更新到最新。
-
-本文档使用 Fandol 字体包。fontspec 宏包会对此字体报 script-not-exist 的警告,可以无视。
-
-## 编译方式
-
-### 手动编译
-
-在 src 目录下按照以下顺序编译:
-```
-xelatex lshort-zh-cn
-makeindex -s lshort-zh-cn.ist lshort-zh-cn
-xelatex lshort-zh-cn
-```
-
-如果编译正确生成 PDF,之后将 PDF 移动到根目录。
-
-### 使用脚本和 Makefile 编译
-
-Linux 下提供了 GNU make 可用的 Makefile,使用 GNU make 的顺序为:
-```
-make
-make install
-```
-
-Windows 下在 src 目录提供批处理脚本 `make.bat`,双击执行编译。
+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
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 069ba487e11..9cea2511743 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/INSTRUCTIONS.md b/Master/texmf-dist/doc/latex/lshort-chinese/src/INSTRUCTIONS.md
index 09f30c5029e..fa493e575a2 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/INSTRUCTIONS.md
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/INSTRUCTIONS.md
@@ -89,7 +89,7 @@ cmdname 和 envname 可写多个命令和环境名,以逗号分隔(唯一例
```
用 `\rule` 命令画的一个宽度示意符号。
-**command 环境** 用表格生成的一个加框的命令展示环境。多行命令在每行末尾(最后一行除外)加 \\。
+**command 环境** 用表格生成的一个加框的命令展示环境,用 `\\` 换行。
**intro 环境** 每章开头的一个摘要环境。
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile b/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
index dd65a174672..4a7b464e671 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/Makefile
@@ -1,10 +1,10 @@
LSHORT = lshort-zh-cn
PDF = $(LSHORT).pdf
REQUIRE = $(LSHORT).tex $(LSHORT)-style.sty $(LSHORT)-layout.tex $(LSHORT).ist
-TEMP = $(LSHORT).{aux,log,idx,ind,ilg,out,toc,los} $(LSHORT)-example.aux
+TEMP = $(LSHORT).{aux,log,idx,ind,ilg,out,toc,los,synctex.gz} $(LSHORT)-example.aux
TEX = xelatex
-MODE = -interaction=nonstopmode
+MODE = -interaction=nonstopmode -synctex=1
MAKEIDX = makeindex
RM = rm -f
@@ -16,6 +16,7 @@ $(PDF): $(REQUIRE)
$(TEX) $(MODE) $(LSHORT)
$(MAKEIDX) -s $(LSHORT).ist $(LSHORT)
$(TEX) $(MODE) $(LSHORT)
+ $(TEX) $(MODE) $(LSHORT)
install: all
$(INSTALL) $(LSHORT).pdf ..
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/chap/app.A.install.tex
index 8e9a82e1016..ae7d3b11416 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/app.A.install.tex
@@ -11,13 +11,13 @@
\section{\protect\TeX\ 发行版简介}\label{sec:dists}
一个\textbf{\TeX\ 发行版}是 \TeX\ 排版引擎、支持排版的文件(基本格式、\LaTeX\ 宏包、字体等)以及一些辅助工具的集合。
-各式各样的 \TeX\ 发行版经过十多年的发展,大浪淘沙,最终形成两个成熟的分支:
+各式各样的 \TeX\ 发行版经过十多年的发展,大浪淘沙,现今的两个主流发行版为:
\begin{itemize}
\item \textbf{\TeX\ Live}\par
- \TeX\ Live 由类 Unix 系统上的 te\TeX\ 发展并取而代之,最终成为跨平台的 \TeX\ 发行版。
+ \TeX\ Live 由类 UNIX 系统上的 te\TeX\ 发展并取而代之,最终成为跨平台的 \TeX\ 发行版。
\TeX\ Live 自 2011 年起以年份作为发行版的版本号,保持了一年一更的频率。
- Mac\TeX\ 是 OS X 系统下的一个定制化的 \TeX\ Live 版本,与 \TeX\ Live 同步更新。
+ Mac\TeX\ 是 macOS(OS X)系统下的一个定制化的 \TeX\ Live 版本,与 \TeX\ Live 同步更新。
\item \textbf{Mik\TeX}\par
Mik\TeX\ 是主要用于 Windows 平台的一个稳定发展的 \TeX\ 发行版。
@@ -77,12 +77,12 @@ tlmgr update --list % 列出所有可更新的宏包
tlmgr repository set http://.../CTAN/systems/texlive/tlnet
% 指定更新源(CTAN)地址
tlmgr info <package-name> % 查看宏包信息
- % 加 --list 选项可列出宏包的所有文件
+ % 加 --list 参数可列出宏包的所有文件
\end{verbatim}
\begin{verbatim}
% MikTeX 命令行工具 mpm 的使用示例
-% 建议始终加 --admin 选项使用
+% 建议始终加 --admin 参数使用
mpm --admin --install <package-name> % 安装某个宏包
mpm --admin --uninstall <package-name> % 卸载某个宏包
mpm --admin --update % 更新所有宏包
@@ -95,7 +95,7 @@ mpm --admin --print-package-info <package-name>
\TeX\ Live 默认安装所有宏包,而 Mik\TeX\ 的安装程序只包含了若干用于 \LaTeX\ 的基本宏包。从 \TeX\ Live 的光盘镜像和 Mik\-\TeX\ 的安装包体积可见一斑。
默认情况下,编译过程中如果遇到宏包未安装而报错的情况下,Mik\TeX\ 会弹出一个对话框,让用户可以选择临时安装宏包,安装成功后继续编译。
-\subsection{手动安装宏包}\label{sec:pkg-manual-install}
+\subsection{手动安装宏包}\label{subsec:pkg-manual-install}
\textbf{\textcolor{red}{如非万不得已,尽量不要手动安装宏包}}。绝大多数宏包都已打包到 \TeX\ Live 和 Mik\TeX\ 两大发行版的安装源,
可用宏包管理器安装。如果你知道某个宏包的名称,但不确定是否在发行版中已打包,可在 CTAN 中搜索。
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/chap/app.B.error.help.tex
index 679db7fa376..612642ae1e0 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/chap/app.B.error.help.tex
@@ -25,15 +25,15 @@ l.3 Test \LaTEx
{} and it's friends.
\end{verbatim}
-这种错误信息分两部分,前一部分(一行或多行)提示了错误的原因,后一部分指出了错误发生的行号,
-以及通过错落的文字告知发生错误的命令所在位置。如上错误显示 \cmd{LaTEx} 位置发生了错误,错误提示是“未定义的控制序列”,
-意思是 \cmd{LaTEx} 是 \TeX\ 程序无法识别的一个命令,很显然是我们把 \cmd{LaTeX} 的大小写写错了。
+这种错误信息分两部分,前一部分提示了错误的信息,后一部分指出了错误发生的行号,
+以及通过错落的文字告知发生错误的命令所在位置。如上错误显示 \cmd{LaTEx} 位置发生了错误,错误信息是“未定义的控制序列”,
+意思是 \cmd{LaTEx} 是 \TeX\ 编译器无法识别的一个命令,很显然是我们把 \cmd{LaTeX} 的大小写写错了。
\subsubsection{处理方式}
出现错误时,编译过程将暂停,等待用户输入命令。用户可以直接敲回车跳过当前的错误,继续编译,相当于丢掉了写错的命令,
-将``Test and it's friends.''编译出来。但这个例子过于简单,有些复杂的代码中,有可能会由于一个小问题导致一连串的错误。
-此时可以选择按 \textbf{S/R/Q} 选择跳过接下来的所有错误,或者按 \textbf{X} 直接退出编译。
+将``Test and it's friends.''排版出来。但这个例子过于简单,有些复杂的代码中,有可能会由于一个小问题导致一连串的错误。
+此时可以选择按 \textbf{S/R/Q} 选择跳过接下来的所有错误,或者按 \textbf{X} 直接退出编译,将源代码中的错误修改后重新编译。
\subsubsection{常见的 \LaTeX\ 错误信息}
@@ -47,6 +47,10 @@ l.3 Test \LaTEx
使用了未定义的命令。拼写错误是原因之一,如把 \cmd{LaTeX} 写作 \cmd{Latex} 这样。
也有可能是没有调用某个宏包,但用了该宏包定义的命令。
+\item \LaTeXerror{! LaTeX error: Environment \ldots\ undefined.}
+
+使用了未定义的环境。
+
\item \LaTeXerror{! Missing \$ inserted.}
缺少数学环境的符号 \texttt\$。多由于将数学符号用在公式之外而导致。
@@ -54,24 +58,26 @@ l.3 Test \LaTEx
\item \LaTeXerror{Runaway argument? \\
! Paragraph ended before \ldots\ was complete.}
-\item \LaTeXerror{! File ended while scanning use of \ldots}.
+\item \LaTeXerror{! File ended while scanning definition/use of \ldots}
+
+这两个错误主要是由于漏写了包裹命令参数的花括号,导致识别参数时出现错误。许多编辑器的括号配对功能有助于检查和消除这类错误。
-两个错误都是主要由于漏写了包裹命令参数的花括号,导致识别参数时出现错误。
+这类错误还有可能是由于前一次编译中断导致 \texttt{.aux} 等辅助文件不完整,再次编译读入不完整的文件产生错误。解决办法是删除辅助文件并重新编译。
\item \LaTeXerror{! Extra alignment tab has been changed to \cmd{cr}.}
\item \LaTeXerror{! Misplaced \cmd{noalign}.}
-两个错误都与表格有关。
+两个错误信息都与表格有关。
\begin{itemize}
- \item 前者的字面意义是“一行中使用的列分隔符 \texttt\& 太多”,有的时候可能确实是 \texttt\& 的个数和列格式不匹配,
- 但多数情况是漏了行尾的 \crcmd。
- \item 后者常出现于漏掉了行尾的 \crcmd\ 而接着使用 \cmd{hline} 画横线的时候。
+ \item 前者的字面意义是“一行中使用的列分隔符 \texttt\& 太多”,有时可能确实是 \texttt\& 的个数和列格式不匹配,
+ 但多数情况是漏掉了行尾的 \crcmd\ 命令。
+ \item 后者常出现于漏掉了行尾的 \crcmd\ 命令而接着使用 \cmd{hline} 命令画横线的时候。
\end{itemize}
-\item \LaTeXerror{! LaTeX Error: Lonely \cmd{item}--perhaps a missing list environment.}
+\item \LaTeXerror{! LaTeX Error: Lonely \cmd{item}-{}-perhaps a missing list environment.}
-\item \LaTeXerror{! LaTeX Error: Something's wrong--perhaps a missing \cmd{item}.}
+\item \LaTeXerror{! LaTeX Error: Something's wrong-{}-perhaps a missing \cmd{item}.}
两个错误信息都与列表环境和 \cmd{item} 命令有关。前者意味着在没有使用列表环境的情况下用了 \cmd{item};
后者则相反,是在列表环境中漏了 \cmd{item}。
@@ -82,50 +88,49 @@ l.3 Test \LaTEx
两个错误都意味着缺少文件。
\begin{itemize}
- \item 如果使用 \cmd{input} 或者 \cmd{include} 命令添加文件,文件不存在,文件名或路径不正确,将会出现上述错误;
+ \item 如果使用 \cmd{input} 或者 \cmd{include} 命令添加文件,出现上述错误的原因当然是文件不存在或者文件名不对;
\item 如果错误提示里的文件名带 \texttt{.cls} 或者 \texttt{.sty} 扩展名,那么很显然,是因为\textbf{没有安装所需的宏包或文档类}。
\end{itemize}
\item \LaTeXerror{! LaTeX Error: Missing \cmd{begin}\marg*{document}.}
-字面上是缺少 \cmd{begin}\marg*{docu\-ment},实际上往往是由于在 \cmd{begin}\marg*{docu\-ment} 之前(导言区)输入了文字。
+字面上是缺少 \cmd{begin}\marg*{docu\-ment},实际上往往是由于在 \cmd{begin}\marg*{docu\-ment} 之前(导言区)输入了文字或某些命令。
\item \LaTeXerror{! LaTeX Error: Cam be used only in preamble.}
-与上一条相反,由于将必须用于导言区的命令放到了 \cmd{begin}\marg*{docu\-ment} 之后使用而产生。
+与上一条相反,由于将必须用于导言区的命令在 \cmd{begin}\marg*{docu\-ment} 之后使用而产生。
-\item \LaTeXerror{! LaTeX Error: \cmd{begin}\marg*{\ldots} on input line \ldots ended by \cmd{end}\marg*{\ldots}.}
+\item \LaTeXerror{! LaTeX Error: \cmd{begin}\marg*{\ldots} on input line \ldots\ ended by \cmd{end}\marg*{\ldots}.}
-环境首尾不匹配。比如 \cmd{begin}\marg*{enumerate} 用了 \cmd{end}\marg*{itemize} 结尾。往往是由于漏写了 \cmd{begin}
+环境首尾不匹配。比如 \cmd{begin}\marg*{enumerate} 用了 \cmd{end}\marg*{itemize} 结尾。或者也可能是由于漏写了 \cmd{begin}
或者 \cmd{end} 命令。
\item \LaTeXerror{! LaTeX Error: Option clash for package `\ldots'.}
以\textbf{不同选项}重复调用宏包造成冲突。有可能是因为其它宏包内部事先调用了这个宏包,用户再次带选项调用而导致冲突。
-可尝试去掉重复调用的宏包避免冲突。如果宏包允许的话,尽量使用其定义的命令改变设置,避免将设置作为宏包选项。
+解决问题的办法是去掉重复调用的宏包。如果宏包允许的话,尽量使用其定义的命令改变设置,减少宏包选项的使用。
-\item \LaTeXerror{! LaTeX Error: Command \ldots already defined, \\
- or name \cmd{end}\ldots illegal \ldots}
+\item \LaTeXerror{! LaTeX Error: Command \ldots\ already defined, \\
+ or name \cmd{end}\ldots\ illegal \ldots}
-使用 \cmd{newcommand} 或 \cmd{newenvironment} 定义已有的命令/环境时产生的错误。如果自己确实使用了前述命令,可考虑改成
-\cmd{re\-new\-command} 或 \cmd{re\-new\-environment};如果是宏包定义的命令产生了这个错误,则属于隐性的宏包冲突。
+使用 \cmd{newcommand} 或 \cmd{newenvironment} 定义已有的命令/环境时产生的错误。如果自己确实作了定义,可考虑用
+\cmd{re\-new\-command} 或 \cmd{re\-new\-environment} 定义;如果是宏包定义的命令产生了这个错误,则属于隐性的宏包冲突。
-相比之前的 ``Option Clash'',隐性宏包冲突是更难以解决的问题,对各种宏包不熟悉的用户,尤其是使用模板的用户而言,往往难以下手。
-用户可尝试查找冲突的命令所在宏包的帮助手册。详尽的手册里通常会告知用户这个宏包应当用在某个宏包的前面/后面。
+相比之前的 ``Option Clash''{},隐性宏包冲突是更难以解决的问题,对各种宏包不熟悉的用户,尤其是使用模板的用户而言,往往难以下手。
+用户可尝试查找引起冲突的宏包的帮助手册。详尽的手册里通常会告知用户这个宏包应当在某个宏包的前面/后面调用,或者不能与某个宏包一起调用。
如果是模板调用了大量宏包导致冲突,可联系模板的作者解决。
\item \LaTeXerror{! LaTeX Error: Unknown option `\ldots' for package `\ldots'.}
-调用宏包时使用了不能被其识别的选项。此时应该查找宏包的帮助文档来解决问题。
+调用宏包时指定了不能被其识别的选项。此时应该查找宏包的帮助文档来解决问题。
\item \LaTeXerror{! Package `\ldots' error: \ldots}
-宏包或文档类自定义的错误,由于不正确地使用宏包里的命令而导致。
-此时应该查找宏包的帮助文档来解决问题。
+宏包或文档类自定义的错误,由于不正确地使用宏包里的命令而导致。此时应该查找宏包的帮助文档来解决问题。
\end{itemize}
-\section{查看帮助文档}\label{sec:texdoc}
+\section{查找帮助文档}\label{sec:texdoc}
\index{texdoc@\texttt{texdoc} 工具}
无论是 \TeX\ Live 还是 Mik\TeX\ ,提供了一个命令行模式的程序 \texttt{texdoc}。
@@ -172,9 +177,9 @@ texdoc fancyhdr
\item[mathtools] 数学公式扩展宏包,提供了公式编号定制和更多的符号、矩阵等。
\item[amsfonts] \AmS\ 扩展符号的基础字体支持。
\item[amssymb] 在 \pkg{amsfonts} 基础上将 \AmS\ 扩展符号定义成命令。
- \item[bm] 提供将符号加粗的命令 \cmd{bm}。
+ \item[bm] 提供将数学符号加粗的命令 \cmd{bm}。
\item[siunitx] 以国际单位规范排版物理量的单位。
- \item[mhchem] 排版化学公式。
+ \item[mhchem] 排版化学式和方程式。
\item[tipa] 排版国际音标。
\end{pkglist}
@@ -183,6 +188,7 @@ texdoc fancyhdr
\begin{pkglist}
\item[ulem] 提供排版可断行下划线的命令 \cmd{uline} 以及其它装饰文字的命令。
\item[endnote] 排版尾注。
+ \item[marginnote] 改善的边注排版功能。
\item[multicol] 提供将内容自由分栏的 \env{multicols} 环境。
\item[multitoc] 生成多栏排版的目录。
\item[minitoc] 为章节生成独立的小目录。
@@ -190,20 +196,24 @@ texdoc fancyhdr
\item[verbatim] 对原始的 \env{verbatim} 环境的改善。提供了命令 \cmd{verbatim\-input} 调用源文件。
\item[fancyvrb] 提供了代码排版环境 \env{Verbatim} 以及对版式的自定义。
\item[listings] 提供了排版关键字高亮的代码环境 \env{lst\-listing} 以及对版式的自定义。类似宏包有 \pkg{minted}。
- \item[algorithm2e] 排版算法。
+ \item[algorithmic] 一个简单的实现算法排版的宏包。如果要生成浮动体的话,需要搭配 \pkg{algorithm} 宏包使用。
+ \item[algorithm2e] 较为复杂的、可定制的算法排版宏包。类似宏包有 \pkg{algorithmicx} 等。
\item[ntheorem] 定制定理环境。类似宏包包括 \pkg{theorem}、\pkg{thmtools}、\pkg{amsthm} 等。
+ \item[mdframed] 排版可自动断页的带边框文字段落,提供边框样式的定制功能。
+ \item[tcolorbox] 以 \TikZ\ 为基础提供排版样式丰富的彩色盒子的功能。
\end{pkglist}
\subsection{图表和浮动体}\label{subsec:pkg-tab-fig}
\begin{pkglist}
- \item[booktabs] 制作三线表。
+ \item[booktabs] 排版三线表。
\item[array] 对表格列格式的扩展。
\item[tabularx] 提供 \env{tabularx} 环境排版定宽表格,支持自动计算宽度的 X 列格式。
+ \item[arydshln] 支持排版虚线表格线。
\item[colortbl] 支持修改表格的行、列、单元格的颜色。
\item[multirow] 支持合并多行单元格。
\item[makecell] 支持在单元格里排版多行内容(嵌套一个单列的小表格)。
- \item[diagbox] 制作斜线表头。
+ \item[diagbox] 排版斜线表头。
\item[longtable] 提供排版跨页长表格的 \env{longtable} 环境。
\item[ltxtable] 跨页长表格可使用 \env{tabularx} 的 X 列格式。
\item[tabu] 提供排版复杂格式表格的 \env{tabu} 环境。与 \pkg{longtable} 一同调用时,提供排版复杂格式跨页长表格的 \env{longtabu} 环境。
@@ -212,8 +222,9 @@ texdoc fancyhdr
\item[epstopdf] \texttt{pdflatex} 命令下支持 EPS 格式的矢量图。
\item[wrapfig] 支持简单的文字在图片周围的绕排。
\item[subfig] 提供子图表和子标题的排版。类似宏包有 \pkg{subfigure} 和 \pkg{subcaption} 等。
- \item[caption] 控制图表标题的格式。
- \item[float] 为浮动体提供不浮动的 H 模式;提供自定义的浮动体结构。
+ \item[caption] 控制浮动体标题的格式。
+ \item[bicaption] 生成双语浮动体标题。
+ \item[float] 为浮动体提供不浮动的 H 模式;提供自定义浮动体结构的功能。
\end{pkglist}
\subsection{修改版式}\label{subsec:pkg-layout}
@@ -227,7 +238,9 @@ texdoc fancyhdr
\item[tocbibind] 支持将目录、参考文献、索引本身写入目录项。
\item[footmisc] 修改脚注 \cmd{footnote} 的格式。
\item[indentfirst] 令章节标题后的第一段首行缩进。
+ \item[enumerate] 提供简单的自定义标签格式的 \env{enumerate} 环境。
\item[enumitem] 修改列表环境 \env{enumerate} 和 \env{itemize} 等的格式。
+ \item[lettrine] 生成段落首字母大写的效果。
\end{pkglist}
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex
index a0dcd5d0613..53d3b5c5ba1 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/biblio.tex
@@ -22,7 +22,7 @@
\newblock \emph{\LaTeX\ 入门}.
\newblock 电子工业出版社, 北京, 2013, ISBN~978-7-121-20208-7.
-\item[\S] {\bfseries \TeX\ 经典书籍,介绍底层的命令和排版方式,有志深入学习 \LaTeX\ 或参与宏包开发者必读。有一些书籍已经开放网络资源:}
+\item[\S] {\bfseries \TeX\ 经典书籍,介绍底层的命令和排版方式,有志深入学习 \LaTeX\ 者或参与宏包开发者必读。有一些书籍已经开放网络资源:}
\bibitem{texbook} Donald~E. Knuth.
\newblock \emph{The \TeX book}, Volume~A of \textit{Computers and Typesetting}, 2nd edition.
\newblock Addison-Wesley, Reading, Massachusetts, 1984, ISBN~0-201-13448-9.
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/chap.01.basics.tex
index d0364ffc0ed..60b7ed229ef 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/chap.01.basics.tex
@@ -30,9 +30,9 @@
当下 \LaTeX\ 主要的维护者为 Frank Mittelbach。
\LaTeX\ 读作 ``Lah-tech'' 或者 ``Lay-tech'' ,近似于汉字“拉泰赫”或“雷泰赫”。\LaTeX\ 在 ASCII 字符环境写作 \texttt{LaTeX}。
-当前的 \LaTeX\ 版本为 \LaTeXe\ ,意思是超出了第二版,接近但没达到第三版,在 ASCII 字符环境写作 \texttt{LaTeX2e}。
+当前的 \LaTeX\ 版本为 \LaTeXe ,意思是超出了第二版,接近但没达到第三版,在 ASCII 字符环境写作 \texttt{LaTeX2e}。
-\subsection{\LaTeX 的优缺点}\label{subec:advs}
+\subsection{\LaTeX\ 的优缺点}\label{subec:advs}
\LaTeX\ 总会拿来和一些“所见即所得”(What You See Is What You Get)的文字处理和排版工具比较优缺点。
笔者认为这种比较并不值得提倡,毕竟所有工具都有自己值得使用的原因。
@@ -44,7 +44,7 @@
\item 方便而强大的数学公式排版能力,无出其右。
- \item 绝大多数时候,用户只需掌握一些简单易懂的命令来组织文档结构,无需(或很少)操心文档的版面设计。
+ \item 绝大多数时候,用户只需专注于一些组织文档结构的基础命令,无需(或很少)操心文档的版面设计。
\item 很容易生成复杂的专业排版元素,如脚注、交叉引用、参考文献、目录等。
@@ -54,13 +54,13 @@
\item \LaTeX\ 促使用户写出结构良好的文档——而这也是 \LaTeX\ 存在的初衷。
\item \LaTeX\ 依赖的 \TeX\ 排版引擎和其它软件是跨平台、免费、开源的。
- 无论用户使用的是 Windows,OS X,GNU/Linux 还是 FreeBSD 等系统,都能轻松获得并使用这一强大的排版工具。
+ 无论用户使用的是 Windows,macOS(OS X),GNU/Linux 还是 FreeBSD 等操作系统,都能轻松获得和使用这一强大的排版工具。
\end{itemize}
\LaTeX\ 的缺点也是显而易见的:
\begin{itemize}
\item 入门门槛高。本手册的副标题叫做 “\pageref{lshort-minutes}~分钟了解 \LaTeXe ”,
- 实际上 \pageref{lshort-minutes} 是本手册正文部分的页数。如果你以平均一页一分钟的速度看完了本手册,
+ 实际上 \pageref{lshort-minutes} 是本手册正文部分(包括附录)的页数。如果你以平均一页一分钟的速度看完了本手册,
你只是粗窥门径而已,离学会它还很远。
\item 排查错误困难。\LaTeX\ 作为一个依靠编写代码工作的排版工具,其使用的宏语言比 C++ 或 Python 等程序设计语言在错误排查方面困难得多。
@@ -83,7 +83,7 @@ TeXworks / TeXstudio / WinEdt 等提供了一些语法高亮、命令补全等
\subsection{\LaTeX\ 命令和环境}\label{subsec:cmds}
\index{LaTeX macro@\LaTeX\ 命令}
-\LaTeX\ 命令以反斜线 \texttt\textbackslash 开头,为以下两种形式之一:
+\LaTeX\ 命令以反斜线 \texttt{\textbackslash} 开头,为以下两种形式之一:
\begin{itemize}
\item 反斜线和后面的一串字母,如 \cmd{LaTeX}。它们以任意非字母符号(空格、数字、标点等)作为分隔符。
\item 反斜线和后面的一个非字母符号,如 \cmd{\$}。它们无需分隔符。
@@ -107,9 +107,6 @@ or \TeX{} users?
有些命令带一个或多个可选参数,以方括号 \texttt[ 和 \texttt] 包裹。
还有些命令在命令名称后可以带一个星号 \texttt*,带星号和不带星号的命令效果有一定差异。
-\pinyinindex{fenzu}{分组}
-\LaTeX\ 的花括号本身也起到\textbf{分组}的作用,可以将字体、格式等的更改限制在大括号范围之内。
-
\index{LaTeX environment@\LaTeX\ 环境}
\cmdindex{begin,end}
\LaTeX\ 还引入了\textbf{环境}的用法,用以令一些效果在局部生效,或是生成特定的文档元素。
@@ -123,6 +120,10 @@ or \TeX{} users?
其中 \Arg{environment name} 为环境名,\cmd{begin} 和 \cmd{end} 中填写的环境名应当一致。
\cmd{begin} 在 \Arg{environment name} 后可以带一个或多个参数,甚至可选参数。环境允许嵌套使用。
+\pinyinindex{fenzu}{分组}
+除了 \LaTeX\ 环境之外,花括号本身也起到\textbf{分组}的作用,起到类似环境的令效果在局部生效的作用,
+例如 \ref{subsec:fontshape} 和 \ref{subsec:fontsize} 小节中介绍的修改字体和字号的命令用法。
+
\subsection{\LaTeX\ 源代码结构}\label{subsec:struct}
\cmdindex{documentclass}
@@ -150,7 +151,7 @@ or \TeX{} users?
在 \cmd{documentclass} 和 \cmd{begin}\marg*{document} 之间的位置称为\textbf{导言区},除了使用 \cmd{use\-package}
调用宏包之外,一些对文档的全局设置命令也在这里使用。当然也可以什么都不写,一个宏包都不调用。一切视自己需求。
-\section{用命令行操作 \LaTeX}
+\section{用命令行操作 \LaTeX}\label{sec:run}
相信你看到这里已经急不可耐地想要写一个 \LaTeX\ 源代码试一试了。我们这就给一个最小的例子,见源代码 \ref{code:hello-world}。
@@ -164,10 +165,10 @@ or \TeX{} users?
\caption{\LaTeX\ 的一个最简单的源代码示例。}\label{code:hello-world}
\end{sourcecode}
-有相当多的编辑器会提供一个按钮完成编译,不过笔者仍然觉得有必要了解一下其背后的工作原理。\LaTeX\ 调用的程序都是基于命令行的,
-所以建议打开 Windows 命令提示符或者 Linux / OS X 的终端,按照本手册的范例尝试一下调用命令行程序编译。
+有相当多的编辑器会提供“编译”按钮,不过笔者仍然觉得有必要了解一下其背后的工作原理。\LaTeX\ 调用的程序都是基于命令行的,
+所以建议打开 Windows 命令提示符或者 Linux / macOS(OS X)的终端,按照本手册的范例尝试一下调用命令行程序编译。
-\subsection{引擎、格式和命令}
+\subsection{引擎、格式和命令}\label{subsec:concepts}
\pinyinindex{paibanyinqing}{排版引擎}
\index{pdfTeX@\hologo{pdfTeX}}
@@ -178,7 +179,7 @@ or \TeX{} users?
\item[格式] 是定义了一组命令的代码集。\LaTeX\ 就是最广泛应用的一个格式,高德纳本人还编写了一个简单的 plain \TeX\ 格式,
没有定义诸如 \cmd{document\-class} 和 \cmd{section} 等等命令。
\item[命令] 是引擎和格式二者的结合体。如下文要用到的 \texttt{pdflatex} 命令是结合 \hologo{pdfTeX}
- 引擎和 \LaTeX\ 格式的一个命令,用于编译类似源代码 \ref{code:hello-world} 的代码并输出 PDF。
+ 引擎和 \LaTeX\ 格式的一个命令,用于编译类似源代码 \ref{code:hello-world} 的代码并生成文档。
\end{description}
\texttt{latex} 命令和 \LaTeX\ 格式往往容易混淆,在同他人讨论关于 \LaTeX\ 的时候需要明确。
@@ -199,7 +200,7 @@ or \TeX{} users?
\end{center}
\footnotetext{现今的发行版中 \texttt{latex} 命令也用 \hologo{pdfTeX} 引擎结合 \LaTeX\ 格式,输出扩展名为 DVI 的文档。}
-\subsection{\texttt{latex}命令}
+\subsection{\texttt{latex} 命令}\label{subsec:latex-exe}
假使你的计算机上已经安装了 \LaTeX\ 依赖的程序和工具(安装方法在附录 \ref{app:install} 有简单介绍)。
我们将源代码 \ref{code:hello-world} 拷贝到一个文本文件中,保存为 \texttt{helloworld.tex}。然后在命令行输入:
@@ -208,8 +209,8 @@ latex helloworld.tex
\end{verbatim}
(也可以输入不带扩展名的 \texttt{latex helloworld})。
-此时命令行界面会闪过许多信息。如果一切正常,再行检查目录,会发现生成了 \texttt{hello\-world.dvi} 以及其它文件。
-这个扩展名为 DVI 的文件就是编译输出的文档。
+此时命令行会闪过许多信息。如果一切正常,在目录中将生成 \texttt{hello\-world.dvi} 以及其它文件。
+这个扩展名为 \texttt{dvi} 的文件就是编译生成的文档。
Linux 系统下,可以在命令行调用 \texttt{xdvi} 程序打开这个文档:
\begin{verbatim}
@@ -219,14 +220,14 @@ xdvi helloworld.dvi
Windows 系统下大多预装了 yap 软件(Mik\TeX) 或 dviout 软件(\TeX\ Live),可以双击 \texttt{hello\-world.dvi} 打开它。
\index{dvipdfmx@\texttt{dvipdfmx} 命令}
-要进一步生成现今流行的 PDF 文档格式,我们还需要用额外的命令将 DVI 转为 PDF:
+要进一步生成现今流行的 PDF 文档格式,我们还需要用额外的程序将 \texttt{dvi} 转为 \texttt{pdf}:
\begin{verbatim}
dvipdfmx helloworld.dvi
\end{verbatim}
然后就可以用查看 PDF 的软件 (Adobe Reader / Foxit Reader 等)打开生成的 \texttt{hello\-world.pdf} 查看了。
-\subsection{\texttt{pdflatex} 和 \texttt{xelatex} 命令}
+\subsection{\texttt{pdflatex} 和 \texttt{xelatex} 命令}\label{subsec:pdflatex-exe}
\index{pdflatex@\texttt{pdflatex} 命令}
这两个命令相比于 \texttt{latex} 命令更为方便,我们可以直接生成 PDF:
@@ -275,7 +276,7 @@ xelatex helloworld.tex
\begin{description}
\item [\texttt{proc}] 基于 \cls{article} 文档类的一个简单的学术文档模板。
\item [\texttt{slides}] 幻灯格式的文档类,使用无衬线字体。
- \item [\texttt{minimal}] 一个极其精简的文档类,只设定了纸张大小和字号,
+ \item [\texttt{minimal}] 一个极其精简的文档类,只设定了纸张大小和基本字号,
用作代码测试的最小工作示例(Minimal Working Example)。
\end{description}
\hrule
@@ -283,13 +284,13 @@ xelatex helloworld.tex
\pinyinindex{xuanxiang}{选项(宏包/文档类)}
可选参数 \Arg{options} 为文档类指定选项,以全局地影响文档布局的参数,如字号、纸张大小、单双面等等。
-\LaTeX\ 的三个标准文档类可指定的选项见表 \ref{tbl:ltx-options}。
-
比如调用 \cls{article} 文档类排版文章,指定纸张为 A4 大小,基本字号为 11pt,双面排版:
\begin{verbatim}
\documentclass[11pt,twoside,a4paper]{article}
\end{verbatim}
+\LaTeX\ 的三个标准文档类可指定的选项见表 \ref{tbl:ltx-options}。
+
\begin{table}[htp]
\caption{\LaTeX\ 的三个标准文档类可指定的选项}\label{tbl:ltx-options}
\hrule
@@ -334,13 +335,13 @@ xelatex helloworld.tex
\footnote{使用多个宏包时指定选项,相当于给每个宏包指定同样的选项。如果有某个宏包不能识别某个选项,则会出错。}:
\begin{verbatim}
% 一次性载入三个排版表格常用的宏包
-\usepackage{tabularx,longtable,multirow}
+\usepackage{tabularx,makecell,multirow}
\end{verbatim}
附录 \ref{sec:pkg-list} 汇总了常用的一些宏包。我们在手册接下来的章节中,也会穿插介绍一些最常用的宏包的使用方法。
在使用宏包和文档类之前,一定要首先确认它们是否安装在你的计算机中,否则 \cmd{use\-package} 等命令会报错误。
-详见附录 \ref{sec:pkg-manager} 。
+详见附录 \ref{sec:pkg-manager}。
每个宏包(包括前面所说的文档类)都定义了许多命令和环境,或者修改了 \LaTeX\ 已有的命令和环境。
为了明白它们的用法,需要查阅宏包和文档类的帮助手册。使用方法是在 Windows 命令提示符或者 Linux 终端下输入命令:
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/chap.02.text.tex
index 62c0c99bd6d..fdc916e0241 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/chap.02.text.tex
@@ -32,13 +32,13 @@ ASCII (美国通用信息交换码)使用 0x00-0x7F 对文字编码,也就
\pkgindex{inputenc}
现在的 \TeX\ 程序支持 8-bit,能够识别源代码里编码处于 0x80-0xFF 范围的字符。
西欧(拉丁字母)、俄语系(西里尔字母)等语言的编码方案刚好能够利用 0x80-0xFF 这个范围,处理起来较为方便。
-\texttt{latex} 命令及 \texttt{pdflatex} 命令下,这些编码的处理由 \pkg{inputenc} 宏包支持。比如将源代码保存为 Latin-1 编码,并在导言区使用:
+\texttt{latex} 命令及 \texttt{pdflatex} 命令下,这些编码的处理由 \pkg{inputenc} 宏包支持。
+比如将源代码保存为 Latin-1 编码,并在导言区调用宏包:
\begin{verbatim}
\usepackage[latin1]{inputenc}
\end{verbatim}
接下来,M\"obius 就直接可以通过(用适当输入法)输入 \texttt{M\"obius} 得到了。
-其它一些语言也可以使用 \pkg{inputenc} 宏包配合 \pkg{babel} 宏包排版。
\index{bianma@编码!GBK}
GBK 等编码是多字节编码,ASCII 字符为一个字节,汉字等非 ASCII 字符为两个字节,这就需要借助一些宏包进行较为复杂的判断和处理。
@@ -65,14 +65,14 @@ Unicode 是一个多国字符的集合,覆盖了几乎全球范围内的语言
\subsection{\pkg{xeCJK} 宏包}\label{subsec:xeCJK}
-用 \LaTeX\ 排版中文的一大门槛是中文字体。\TeX\ 使用的字体格式仅支持不超过 256 个字符,要想排版中文,比如旧式的 \pkg{CJK} 宏包,
-往往需要复杂的预处理,将中文字体拆分成数百个小字体,非常麻烦%
+用 \LaTeX\ 排版中文的一大难题是中文字体的处理。\TeX\ 使用的字体格式仅支持不超过 256 个字符,
+旧式的中文排版方案如 \pkg{CJK} 宏包往往需要复杂的预处理,将中文字体拆分成数百个小字体,非常麻烦%
\footnote{现在的 \texttt{pdflatex} 以及 \texttt{latex} + \texttt{dvipdfmx} 命令通过字体映射的方式支持直接使用中文字体,不需要经过预处理,
但仍然是不方便新手操作的。}。
\index{xelatex@\texttt{xelatex} 命令}
\pkgindex{xeCJK}
-\texttt{xelatex} 命令支持直接使用系统安装的 TrueType (\texttt{.ttf}) / OpenType(\texttt{.otf}) 等格式的字体,加上对 UTF-8 编码的原生支持,
+\texttt{xelatex} 命令支持直接使用系统安装的 TrueType (\texttt{.ttf}) / OpenType (\texttt{.otf}) 等格式的字体,加上对 UTF-8 编码的原生支持,
免去了预处理字体的麻烦。在此基础上的 \pkg{xeCJK} 宏包更进一步完善了排版中文的一些细节,比如中英文之间插入空隙、
中文行尾的回车不引入空格、标点符号不出现在行首,等等。
@@ -128,8 +128,8 @@ starts a new line.
\subsection{注释}\label{subsec:comments}
\index{%@\texttt\% (\textit{注释})}
-\LaTeX\ 用 \texttt\% 字符作为注释。在这个字符之后直到行末,所有的字符都被忽略,连同回车引入的空格。
-我们需要注意以下示例中“回车引入的空格被忽略”的效果:
+\LaTeX\ 用 \texttt\% 字符作为注释。在这个字符之后直到行末,所有的字符都被忽略,
+行末的回车也不引入空格。见如下示例:
\begin{example}
This is an % short comment
% ---
@@ -161,7 +161,7 @@ ak a word.
\subsection{连字}\label{subsec:ligatures}
-西文排版中经常会出现连字(Ligatures),常见的有 ff / fi / fl / ffi / ffl。
+西文排版中经常会出现连字(Ligatures),常见的有 ff / fi / fl / ffi / ffl{}。
\begin{example}
It's difficult to find \ldots .\\
It's dif{}f{}icult to f{}ind \ldots .
@@ -241,11 +241,11 @@ Stra\ss e
\begin{tabular}{*4{cl}}
\hline
\TACC{\`}{o} & \TACC{\'}{o} & \TACC{\^}{o} & \TACC{\~}{o} \\
- \TACC{\=}{o} & \TACC{\.}{o} & \TACC{\"}{o} & \TTACC{\c}{c}\\
+ \TACC{\=}{o} & \TACC{\.}{o} & \TACC{\"}{o} & \TTACC{\r}{o}\\
\TTACC{\u}{o} & \TTACC{\v}{o} & \TTACC{\H}{o} & \TTACC{\c}{o} \\
\TTACC{\d}{o} & \TTACC{\b}{o} & \WTACC{\t}{oo} \\[6pt]
\TSYM{\oe} & \TSYM{\OE} & \TSYM{\ae} & \TSYM{\AE} \\
- \TSYM{\aa} & \TSYM{\AA} \\[6pt]
+ \TSYM{\aa} & \TSYM{\AA} & \TSYM{\ss} \\[6pt]
\TSYM{\o} & \TSYM{\O} & \TSYM{\l} & \TSYM{\L} \\
\TSYM{\i} & \TSYM{\j} & !` & \verb|!`| & ?` & \verb|?`| \\
\hline
@@ -318,17 +318,18 @@ words}, are shown here.
\section{断行和断页}\label{sec:break}
-\LaTeX\ 将一个段落的文档在合适的位置进行断行,尽可能做到每行的宽度一致,并且单词间距匀称。
-文字段落和公式、图表等内容顺序排布,并在合适的位置断页,分割成匀称的页面。
+\LaTeX\ 将文字段落在合适的位置进行断行,尽可能做到每行的宽度一致,并且单词间距匀称。
+文字段落和公式、图表等内容从上到下顺序排布,并在合适的位置断页,分割成匀称的页面。
在绝大多数时候,我们无需自己操心断行和断页。但偶尔会遇到需要手工调整的地方。
\subsection{单词间距和断行}\label{subsec:interword}
通常情况下,断行的位置尽可能选取在两个单词之间,也就是你输入到源文件中的“空格”。
-没有断开的单词间位置则插入一小段间距,间距是根据行宽和文字自动调整的,文字密一些的地方,单词间距就略窄,反之略宽。
+一般情况下,这个“空格”生成一个间距,它会根据行宽和文字自动调整,文字密一些的地方,单词间距就略窄,反之略宽。
\index{~@\texttt\textasciitilde\ (\textit{不断行空格})}
-我们可以使用字符 \texttt\textasciitilde 在合适的位置插入一个空格,并且这个空格不能被断开,通常用在英文人名、图表名称等场景:
+我们可以使用字符 \texttt\textasciitilde 在合适的位置插入一个不会断行的空格(高德纳称之为 tie,“带子”),
+通常用在英文人名、图表名称等场景:
\begin{example}
Fig.~2a \\
Donale~E. Knuth
@@ -371,7 +372,7 @@ Donale~E. Knuth
\subsection{断词}\label{subsec:hyphen}
如果 \LaTeX\ 遇到了很长的英文单词,仅在单词之间的位置断行无法生成宽度匀称的行时,就要考虑从单词中间断开。
-对于绝大部分单词,\LaTeX\ 能够找到合适的断词位置,在断开的行尾加上连字符 -。
+对于绝大部分单词,\LaTeX\ 能够找到合适的断词位置,在断开的行尾加上连字符 \char\hyphenchar\font 。
\index{-@\cmd{-} (\textit{断词})}
如果一些单词没能自动断词,我们可以在单词内手动使用 \cmd{-} 命令指定断词的位置:
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/chap.03.elements.tex
index 6e37adb5b73..3c7f21d48b5 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/chap.03.elements.tex
@@ -9,31 +9,29 @@
\subsection{章节标题}\label{subsec:secs}
-\cmdindex{section,subsection,subsubsection,paragraph,subparagraph}
+\cmdindex{chapter,section,subsection,subsubsection,paragraph,subparagraph}
+\clsindex{article,book,report}
+
一篇结构化的、条理清晰文档一定是层次分明的,通过不同的命令分割为章、节、小节。\LaTeX\ 的三个标准文档类 \cls{article}、\cls{report} 和 \cls{book}%
-\footnote{千万注意是\textbf{标准文档类},其它文档类可能没有定义或只定义了一部分,如 \cls{beamer} 或 \cls{moderncv} 等。}%
+\footnote{千万注意是\textbf{标准文档类},其它文档类,如果不是从标准文档类衍生而来,
+很可能没有定义或只定义了一部分命令,如 \cls{beamer} 或 \cls{moderncv} 等。}%
提供了一系列命令,用以划分章节、生成章节标题并自动编号:
\begin{command}
-\cmd{section}\marg{title} \quad
+\cmd{chapter}\marg{title} \quad
+\cmd{section}\marg{title} \\
\cmd{subsection}\marg{title} \quad
\cmd{subsubsection}\marg{title} \\
\cmd{paragraph}\marg{title} \quad
\cmd{subparagraph}\marg{title}
\end{command}
+其中 \cmd{chapter} \textbf{只在 \cls{book} 和 \cls{report} 文档类有定义}。
\cmdindex{part}
-\cmd{part} 命令用以将整个文档分割为大的分块,但不影响 \cmd{section} 等的编号:
+\cmd{part} 命令用以将整个文档分割为大的分块,但不影响 \cmd{chapter} 或 \cmd{section} 等的编号:
\begin{command}
\cmd{part}\marg{title}
\end{command}
-\cmdindex{chapter}
-\clsindex{book,report}
-\cls{book} 和 \cls{report} 提供了章一级的结构:
-\begin{command}
-\cmd{chapter}\marg{title}
-\end{command}
-
上述命令除了生成带编号的标题之外,还向目录中添加条目,并影响页眉页脚的内容(详见 \ref{sec:pagestyle} 节)。每个命令有两种变体:
\begin{itemize}
\item 带可选参数的变体:\cmd{section}\oarg{short title}\marg{title}\par
@@ -42,8 +40,15 @@
标题不带编号,也不生成目录项和页眉页脚。
\end{itemize}
+较低层次如 \cmd{paragraph} 和 \cmd{subparagraph} 即使不用带星号的变体,生成的标题默认也不带编号,事实上,除 \cmd{part} 外:
+\begin{itemize}
+ \item \cls{article} 文档类带编号的层级为 \cmd{section} / \cmd{subsection} / \cmd{sub\-sub\-section} 三级;
+ \item \cls{report}/\cls{book} 文档类带编号的层级为 \cmd{chapter} / \cmd{section} / \cmd{sub\-section} 三级。
+\end{itemize}
+对此的详细解释和调整方法见 \ref{subsec:latex-counts} 小节。
+
\pkgindex{titlesec}
-\LaTeX\ 并未提供为 \cmd{section} 等章节命令定制格式的功能,这一功能由 \pkg{titlesec} 宏包提供。详情请参考宏包的帮助手册。
+\LaTeX\ 及标准文档类并未提供为 \cmd{section} 等章节命令定制格式的功能,这一功能由 \pkg{titlesec} 宏包提供。详情请参考宏包的帮助手册。
\subsection{目录}\label{sec:toc}
@@ -53,21 +58,24 @@
\cmd{tableofcontents}
\end{command}
-正确生成目录项,一般需要多次编译源代码。
+这个命令会生成单独的一个章节,标题默认为 ``Contents''{},可通过 \ref{sec:latex-settings} 节给出的方法定制标题。
+
+正确生成目录项,一般需要编译两次源代码。
\cmdindex{addcontentsline}
-有时我们使用了 \cmd{chapter*} 或 \cmd{section*} 这样不生成目录项的命令,而又想手动生成该章节的目录,可以在标题命令后面使用:
+有时我们使用了 \cmd{chapter*} 或 \cmd{section*} 这样不生成目录项的章节标题命令,
+而又想手动生成该章节的目录项,可以在标题命令后面使用:
\begin{command}
\cmd{addcontentsline}\marg*{toc}\marg{level}\marg{title}
\end{command}
-其中 \Arg{level} 为章节层次 \texttt{chapter} 或 \texttt{section} 等,\Arg{title} 为需要生成目录项的章节标题。
+其中 \Arg{level} 为章节层次 \texttt{chapter} 或 \texttt{section} 等,\Arg{title} 为出现于目录项的章节标题。
\subsection{文档结构的划分}\label{sec:matters}
\cmdindex{appendix}
所有标准文档类都提供了一个 \cmd{appendix} 命令将正文和附录分开%
-\footnote{有的地方可能写作 \cmd{begin} \marg*{appendix} \ldots \cmd{end} \marg*{appendix} 这样,
+\footnote{有的参考文档可能使用 \cmd{begin} \marg*{appendix} \ldots \cmd{end} \marg*{appendix} 这样的写法,
虽然有效,但并不规范,只要使用 \cmd{appendix} 命令就够了。},
使用 \cmd{appendix} 后,最高一级章节改为使用拉丁字母编号,从 A 开始。
@@ -75,9 +83,9 @@
\cmdindex{frontmatter,mainmatter,backmatter}
\cls{book} 文档类还提供了前言、正文、后记结构的划分命令:
\begin{description}
- \item[\cmd{frontmatter}] 前言部分,页码为小写罗马字母格式;其后的章节不编号(但生成页眉页脚和目录项)。
- \item[\cmd{mainmatter}] 正文部分,页码改回数字格式,并从 1 开始计数;其后的章节正常编号。
- \item[\cmd{backmatter}] 后记部分,页码继续正常计数,格式不变;其后的章节不编号,类似 \cmd{frontmatter} 命令。
+ \item[\cmd{frontmatter}] 前言部分,页码为小写罗马字母格式;其后的 \cmd{chapter} 不编号。
+ \item[\cmd{mainmatter}] 正文部分,页码为阿拉伯数字格式,从 1 开始计数;其后的章节编号正常。
+ \item[\cmd{backmatter}] 后记部分,页码格式不变,继续正常计数;其后的 \cmd{chapter} 不编号。
\end{description}
\cmdindex{include}
@@ -126,13 +134,15 @@
\cmd{author}\marg{author} \quad
\cmd{date}\marg{date}
\end{command}
-其中前两个命令是必须的,\cmd{date} 命令可选。\LaTeX\ 还提供了一个 \cmd{today} 命令自动生成当前日期,
-可用在 \cmd{date} 的参数里,或者别的地方。
+其中前两个命令是必须的(不用 \cmd{title} 会报错;不用 \cmd{author} 会警告),\cmd{date} 命令可选。
+\LaTeX\ 还提供了一个 \cmd{today} 命令自动生成当前日期,\cmd{date} 默认使用 \cmd{today}。
-\cmdindex{thanks}
-在 \cmd{title}、\cmd{author} 等命令内可以使用 \cmd{thanks} 命令生成标题页的脚注,如:
+\cmdindex{thanks,and}
+在 \cmd{title}、\cmd{author} 等命令内可以使用 \cmd{thanks} 命令生成标题页的脚注,用 \cmd{and} 隔开多个人名,如:
\begin{verbatim}
-\author{Mary\thanks{E-mail:*****@***.com}}
+\author{Mary\thanks{E-mail:*****@***.com}
+ \and Ted\thanks{Corresponding author}
+ \and Louis}
\end{verbatim}
\cmdindex{maketitle}
@@ -142,7 +152,22 @@
\cmd{maketitle}
\end{command}
生成一个简单的标题页了。\cls{article} 文档类的标题默认不单独成页,而 \cls{report} 和 \cls{book} 默认单独成页。
-可在 \cmd{document\-class} 命令中指定 \texttt{titlepage / notitlepage} 选项修改。
+可在 \cmd{document\-class} 命令调用文档类时指定 \texttt{titlepage / notitlepage} 选项以修改默认的行为。
+
+\envindex{titlepage}
+\LaTeX\ 标准类还提供了一个简单的 \env{titlepage} 环境,生成不带页眉页脚的一页。用户可以在这个环境中使用各种排版元素自由发挥,
+生成自定义的标题页以替代 \cmd{maketitle} 命令。甚至可以利用 \env{titlepage} 环境重新定义 \cmd{maketitle}:
+\begin{verbatim}
+\renewcommand{\maketitle}{\begin{titlepage}
+... % 用户自定义命令
+\end{titlepage}}
+\end{verbatim}
+
+事实上,为标准文档类指定了 \texttt{titlepage} 选项以后,使用 \cmd{maketitle} 命令生成的标题页就是一个 \env{titlepage} 环境。
+
+以上是 \LaTeX\ 标准文档类的标题页相关命令用法。在各种文档模板中经常有自定义的标题页,
+有可能需要除了 \cmd{title} 和 \cmd{author} 以外的命令给定信息,用法也可能与标准文档类的不一致
+(甚至有些模板可能没有定义 \env{titlepage} 等环境)。使用文档模板前\textbf{一定要仔细阅读文档模板的帮助手册}。
\section{交叉引用}\label{sec:crossref}
@@ -196,10 +221,9 @@ page~\pageref{sec:this}.''
“天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。”\footnote{出自《千字文》。}
\cmdindex{footnotemark,footnotetext}
-有些情况下(比如在表格环境、盒子内)使用 \cmd{footnote} 并不能正确生成脚注。我们可以分两步进行,
-先使用 \cmd{foot\-note\-mark} 为脚注计数,再在合适的位置用 \cmd{foot\-note\-text} 生成脚注。
+有些情况下(比如在表格环境、各种盒子内)使用 \cmd{footnote} 并不能正确生成脚注。我们可以分两步进行,
+先使用 \cmd{foot\-note\-mark} 为脚注计数,再在合适的位置用 \cmd{foot\-note\-text} 生成脚注。比如:
-比如:
\begin{verbatim}
\begin{tabular}{l}
\hline
@@ -274,16 +298,17 @@ page~\pageref{sec:this}.''
\end{description}
\end{example}
-默认的列表间距比较宽,\LaTeX\ 本身也未提供方便的定制功能,而要用到 \pkg{enumitem} 宏包。有兴趣的读者可参考其帮助手册。
+默认的列表间距比较宽,\LaTeX\ 本身也未提供方便的定制功能,而要用到 \pkg{enumitem} 宏包定制各种列表间距。
+\pkg{enumitem} 宏包还提供了对列表标签、引用等的定制。有兴趣的读者可参考其帮助手册。
\subsection{对齐环境}\label{subsec:flush}
\envindex{center,flushleft,flushright}
\env{center}、\env{flush\-left} 和 \env{flush\-right} 环境分别用于生成居中、左对齐和右对齐的文本环境。
\begin{command}
-\cmd{begin}\marg*{center}
-\ldots
-\cmd{end}\marg*{center}
+\cmd{begin}\marg*{center} \ldots\ \cmd{end}\marg*{center} \\
+\cmd{begin}\marg*{flushleft} \ldots\ \cmd{end}\marg*{flushleft} \\
+\cmd{begin}\marg*{flushright} \ldots\ \cmd{end}\marg*{flushright}
\end{command}
\begin{example}
@@ -320,7 +345,7 @@ Left-aligned text paragraph.
Right-aligned text paragraph.
\end{example}
-三个命令和对应的环境经常被误用,有直接用所谓 \cmd{flushleft} 命令或者 \env{raggedright} 环境的,都是不合理的用法(即使它们可能有效)。
+三个命令和对应的环境经常被误用,有直接用所谓 \cmd{flushleft} 命令或者 \env{raggedright} 环境的,都是不甚严格的用法(即使它们可能有效)。
有一点可以将两者区分开来:\env{center} 等环境会在上下文产生一个额外间距,而 \cmd{centering} 等命令不产生,只是改变对齐方式。
比如在浮动体环境 \env{table} 或 \env{figure} 内实现居中对齐,用 \cmd{centering} 命令即可,没必要再用 \env{center} 环境。
@@ -362,9 +387,9 @@ a perfect mirror.
\subsection{摘要环境}\label{subsec:abstract}
\envindex{abstract}
-摘要环境 \env{abstract} 只在 \cls{article} 和 \cls{report} 文档类可用,一般用于紧跟 \cmd{maketitle} 命令之后介绍文档的摘要。
-如果文档类给定了 \texttt{titlepage} 选项,则单独成页;反之相当于一个小标题加一个 \env{quotation} 环境%
-(双栏下相当于 \cmd{section*} 定义的一节)。
+摘要环境 \env{abstract} 默认只在标准文档类中的 \cls{article} 和 \cls{report} 文档类可用,
+一般用于紧跟 \cmd{maketitle} 命令之后介绍文档的摘要。如果文档类指定了 \texttt{titlepage} 选项,则单独成页;
+反之,单栏排版时相当于一个居中的小标题加一个 \env{quotation} 环境,双栏排版时相当于 \cmd{section*} 定义的一节。
\subsection{代码环境}\label{subsec:verbatim}
@@ -396,7 +421,7 @@ for (int i=0; i<4; ++i)
\cmd{verb}\Arg{delim}\Arg{code}\Arg{delim}
\end{command}
-\Arg{delim} 标明代码的分界位置,不能是字母、空格或星号,前后必须一致,可任意选择使得不与代码本身冲突,习惯上使用 \texttt| 符号。
+\Arg{delim} 标明代码的分界位置,前后必须一致,除字母、空格或星号外,可任意选择使得不与代码本身冲突,习惯上使用 \texttt| 符号。
同 \env{verbatim} 环境,\cmd{verb} 后也可以带一个星号,以显示空格:
\begin{example}
@@ -471,6 +496,8 @@ for (int i=0; i<4; ++i)
\end{tabular}
\end{example}
+表格中每行的单元格数目不能多于列格式里 \texttt{l/c/r/p} 的总数(可以少于这个总数),否则出错。
+
\texttt{@} 格式可在单元格前后插入任意的文本,但同时它也消除了单元格前后额外添加的间距。
\texttt{@} 格式可以适当使用以充当“竖线”。特别地,\texttt{@}\marg*{} 可直接用来消除单元格前后的间距:
\begin{example}
@@ -500,7 +527,7 @@ for (int i=0; i<4; ++i)
\end{tabular}
\end{example}
-辅助格式甚至支持插入 \cmd{centering} 等命令改变 \texttt{p} 列格式的对齐方式,一般还要加额外的命令\cmd{array\-back\-slash} 以免出错%
+辅助格式甚至支持插入 \cmd{centering} 等命令改变 \texttt{p} 列格式的对齐方式,一般还要加额外的命令 \cmd{array\-back\-slash} 以免出错%
\footnote{\cmd{centering} 等对齐命令会破坏表格环境里 \crcmd\ 换行命令的定义,
\cmd{array\-back\-slash} 用来恢复之。如果不加 \cmd{array\-back\-slash} 命令,
也可以用 \cmd{tabular\-newline} 命令代替原来的 \crcmd\ 实现表格换行。}:
@@ -516,7 +543,7 @@ for (int i=0; i<4; ++i)
\subsection{列宽}\label{subsec:colwidth}
在控制列宽方面,\LaTeX\ 表格有着明显的不足:\texttt{l/c/r} 格式的列宽是由文字内容的自然宽度决定的,
-而 \texttt{p} 格式给定了列宽却不好控制对齐(需要 \pkg{array} 宏包辅助),
+而 \texttt{p} 格式给定了列宽却不好控制对齐(可用 \pkg{array} 宏包的辅助格式),
更何况列与列之间通常还有间距,所以直接生成给定总宽度的表格并不容易。
\envindex{tabular*}
@@ -558,13 +585,15 @@ for (int i=0; i<4; ++i)
\end{example}
\pkgindex{booktabs}
-\cmdindex[booktabs]{toprule,midrule,bottomrule}
+\cmdindex[booktabs]{toprule,midrule,bottomrule,cmidrule}
在科技论文排版中广泛应用的表格形式是三线表,形式干净简明。
三线表由 \pkg{booktabs} 宏包支持,它提供了 \cmd{toprule}、\cmd{midrule} 和 \cmd{bottomrule} 命令用以排版三线表的三条线,
-除此之外,最好不要用其它横线以及竖线:
+以及和 \cmd{cline} 对应的 \cmd{cmidrule}。除此之外,最好不要用其它横线以及竖线:
\begin{example}
\begin{tabular}{cccc}
\toprule
+ & \multicolumn{3}{c}{Numbers} \\
+ \cmidrule{2-4}
& 1 & 2 & 3 \\
\midrule
Alphabet & A & B & C \\
@@ -619,13 +648,13 @@ for (int i=0; i<4; ++i)
在以下的例子中,注意要用 \cmd{multi\-column} 命令配合 \texttt{@\{\}} 格式把单元格的额外边距去掉,使得嵌套的表格线能和外层的表格线正确相连:
\begin{example}
-\begin{tabular}{|c|l|c|}
+\begin{tabular}{|c|c|c|}
\hline
- a & bbb & c \\ \hline
- a & \multicolumn{1}{@{}l@{}|}
+ a & b & c \\ \hline
+ a & \multicolumn{1}{@{}c@{}|}
{\begin{tabular}{c|c}
- a & b \\ \hline
- aa & bb \\
+ e & f \\ \hline
+ e & f \\
\end{tabular}}
& c \\ \hline
a & b & c \\ \hline
@@ -633,7 +662,7 @@ for (int i=0; i<4; ++i)
\end{example}
\pkgindex{makecell}
-如果不要求画横线,并且只需要在垂直方向“拆分单元格”的话,\pkg{makecell} 宏包提供的 \cmd{make\-cell} 命令是一个简单的解决方案:
+如果不需要为“拆分的单元格”画线,并且只在垂直方向“拆分”的话,\pkg{makecell} 宏包提供的 \cmd{make\-cell} 命令是一个简单的解决方案:
\begin{example}
\begin{tabular}{|c|c|}
@@ -649,7 +678,7 @@ for (int i=0; i<4; ++i)
\cmdindex{arraystretch}
\LaTeX\ 生成的表格看起来通常比较紧凑。修改参数 \cmd{array\-stretch} 可以得到行距更加宽松的表格
-(相关命令参考 \ref{sec:newcommands} 节):
+(相关命令参考 \ref{subsec:newcmd} 小节):
\begin{example}
\renewcommand\arraystretch{1.8}
\begin{tabular}{|c|}
@@ -682,10 +711,10 @@ for (int i=0; i<4; ++i)
\LaTeX\ 本身不支持插图功能,需要由 \pkg{graphicx} 宏包辅助支持。
-使用 \texttt{latex + dvipdfmx} 编译命令时,调用 \pkg{graphicx} 宏包时要给定 \texttt{dvipdfmx} 选项%
+使用 \texttt{latex + dvipdfmx} 编译命令时,调用 \pkg{graphicx} 宏包时要指定 \texttt{dvipdfmx} 选项%
\footnote{早期常使用 \texttt{latex + dvips} 组合命令,后者将 \texttt{.dvi} 文件转为 \texttt{.ps} 文件(PostScript),
可进一步通过 \texttt{ps2pdf} 工具生成 PDF。\texttt{dvips} 和 \texttt{dvipdfmx} 在图形、颜色、超链接等功能的实现上有差别,而 \LaTeX\ 无法识别
-用户是用 \texttt{dvips} 还是 \texttt{dvipdfmx},所以要给定选项(缺省为 \texttt{dvips})。
+用户是用 \texttt{dvips} 还是 \texttt{dvipdfmx},所以要指定选项(缺省为 \texttt{dvips})。
\ref{sec:hyperlinks} 节中的 \pkg{hyperref} 宏包同理。};而使用 \texttt{pdflatex} 或 \texttt{xelatex} 命令编译时不需要。
读者可能听说过“\LaTeX\ 只能插入 \texttt{.eps} 格式的图片,需要把 \texttt{.jpg} 转成 \texttt{.eps} 格式”的观点。
@@ -730,11 +759,11 @@ for (int i=0; i<4; ++i)
\graphicspath{{figures/}{logo/}}
\end{verbatim}
-\cmd{includegraphics} 命令的可选参数 \Arg{options} 支持 \Arg{key}=\Arg{value} 形式赋值,常用的选项如下:
+\cmd{includegraphics} 命令的可选参数 \Arg{options} 支持 \Arg{key}=\Arg{value} 形式赋值,常用的参数如下:
\begin{center}
\begin{tabular}{lp{18em}}
\hline
- 选项 & 含义 \\
+ 参数 & 含义 \\
\hline
width=\Arg{width} & 将图片缩放到宽度为 \Arg{width} \\
height=\Arg{height} & 将图片缩放到高度为 \Arg{height} \\
@@ -749,7 +778,7 @@ for (int i=0; i<4; ++i)
盒子是 \LaTeX\ 排版的基础单元,虽然解释上去有些抽象:每一行是一个盒子,
里面的文字从左到右依次排列;每一页也是一个盒子,各行文字从上到下依次排布……颇有一些活字印刷术的味道。
-不管如何,\LaTeX\ 提供了一些实用的命令让我们生成一些有用的盒子。
+不管如何,\LaTeX\ 提供了一些命令让我们生成一些有特定用途的盒子。
\subsection{水平盒子}\label{subsec:mbox}
@@ -760,7 +789,7 @@ for (int i=0; i<4; ++i)
\cmd{makebox}\oarg{width}\oarg{align}\marg*{\ldots}
\end{command}
-\cmd{mbox} 生成一个基本的水平盒子,内容只有一行(除非嵌套下文的垂直盒子),不允许分段。
+\cmd{mbox} 生成一个基本的水平盒子,内容只有一行(除非嵌套下文介绍的垂直盒子,或者其它内容),不允许分段。
外表看上去,\cmd{mbox} 的内容与正常的文本无二,不过断行时文字不会从盒子里断开。
\cmd{makebox} 更进一步,可以加上可选参数用于控制盒子的宽度 \Arg{width},以及内容的对齐方式 \Arg{align},
@@ -811,7 +840,7 @@ for (int i=0; i<4; ++i)
其中 \Arg{align} 为盒子和周围文字的对齐情况(类似 \env{tabular} 环境);
\Arg{height} 和 \Arg{inner-align} 设置盒子的高度和内容的对齐方式,类似水平盒子 \cmd{makebox} 的设置,
-不过 \Arg{inner-align} 接受的选项是顶部 \texttt{t}、底部 \texttt{b}、居中 \texttt{c} 和分散对齐 \texttt{s}。
+不过 \Arg{inner-align} 接受的参数是顶部 \texttt{t}、底部 \texttt{b}、居中 \texttt{c} 和分散对齐 \texttt{s}。
\begin{example}
三字经:\parbox[t]{3em}%
@@ -852,12 +881,12 @@ A \rule[-.4pt]{3em}{.4pt} line.
\section{浮动体}\label{sec:float}
-内容丰富的文章或者书籍往往包含丰富的图片和表格等内容。这些内容的尺寸往往太大,导致分页困难。
+内容丰富的文章或者书籍往往包含许多图片和表格等内容。这些内容的尺寸往往太大,导致分页困难。
\LaTeX\ 为此引入了浮动体的机制,令大块的内容可以脱离上下文,放置在合适的位置。
\envindex{figure,table}
\LaTeX\ 预定义了两类浮动体环境 \env{figure} 和 \env{table}。习惯上 \env{figure} 里放图片,\env{table} 里放表格,
-但并没有严格限制,可以在任何一个浮动体里放置表格、文字、列表等等任意内容。
+但并没有严格限制,可以在任何一个浮动体里放置文字、公式、表格、图片等等任意内容。
以 \env{table} 环境的用法举例,\env{figure} 同理:
\begin{command}
@@ -866,8 +895,8 @@ A \rule[-.4pt]{3em}{.4pt} line.
\cmd{end}\marg*{table}
\end{command}
-\Arg{placement} 参数提供了一些符号用来表示浮动体允许排版的位置,如 \texttt{[hbp]} 允许浮动体排版在当前位置、底部或者单独成页。
-\env{table} 和 \env{figure} 浮动体的默认设置为 \texttt{[tbp]}。
+\Arg{placement} 参数提供了一些符号用来表示浮动体允许排版的位置,如 \texttt{hbp} 允许浮动体排版在当前位置、底部或者单独成页。
+\env{table} 和 \env{figure} 浮动体的默认设置为 \texttt{tbp}。
\begin{center}
\begin{tabular}{>{\ttfamily}lp{14em}}
\hline
@@ -880,7 +909,7 @@ A \rule[-.4pt]{3em}{.4pt} line.
\end{tabular}
\end{center}
\begin{quote}\footnotesize
-注 1:排版位置的选取与参数里符号的顺序无关,\LaTeX\ 总是以 \texttt{h-t-b-p} 的优先级顺序选取位置。
+注 1:排版位置的选取与参数里符号的顺序无关,\LaTeX\ 总是以 \texttt{h-t-b-p} 的优先级顺序决定浮动体位置。
也就是说 \texttt{[!htp]} 和 \texttt{[ph!t]} 没有区别。\par
注 2:限制包括浮动体个数(除单独成页外,默认每页不超过 3 个浮动体,其中顶部不超过 2 个,底部不超过 1 个)
以及浮动体空间占页面的百分比(默认顶部不超过 70\%,底部不超过 30\%)。
@@ -891,14 +920,15 @@ A \rule[-.4pt]{3em}{.4pt} line.
它们的用法与 \env{table} 和 \env{figure} 一样,不同之处为双栏的 \Arg{placement} 参数只能用 \texttt{tp} 两个位置。
\cmdindex{clearpage}
-浮动体的位置选取受到先后顺序的限制。如果某个浮动体由于参数限制、空间限制等原因在当前页无法放置,就要推迟到后一页,
-并使得之后的同类浮动体一并推迟。\cmd{clearpage} 命令会在另起一页之前,先将所有推迟放置的浮动体排版成页。
+浮动体的位置选取受到先后顺序的限制。如果某个浮动体由于参数限制、空间限制等原因在当前页无法放置,就要推迟到之后处理,
+并使得之后的同类浮动体一并推迟。\cmd{clearpage} 命令会在另起一页之前,先将所有推迟处理的浮动体排版成页,
+此时 \texttt{htbp} 等位置限制被完全忽略。
\pkgindex{float}
-\pkg{float} 宏包为浮动体提供了 \texttt{H} 选项,不与 \texttt{htbp} 及 \texttt{!} 混用。使用 \texttt{H} 选项时,
-会取消浮动机制,将浮动体视为一般的盒子插入当前位置。这在一些特殊情况下(如使用 \pkg{multicol} 宏包生成分栏)的时候很有用,
-但尺寸过大的浮动体可能影响到分页。
+\pkg{float} 宏包为浮动体提供了 \texttt{H} 位置参数,不与 \texttt{htbp} 及 \texttt{!} 混用。使用 \texttt{H} 位置参数时,
+会取消浮动机制,将浮动体视为一般的盒子插入当前位置。这在一些特殊情况下很有用(如使用 \pkg{multicol} 宏包排版分栏内容的时候),
+但尺寸过大的浮动体可能使得分页比较困难。
\subsection{浮动体的标题}\label{subsec:caption}
@@ -909,8 +939,12 @@ A \rule[-.4pt]{3em}{.4pt} line.
\end{command}
\cmd{caption} 的用法非常类似于 \cmd{section} 等命令,可以用带星号的命令 \cmd{caption*} 生成不带编号的标题,
也可以使用带可选参数的形式 \cmd{caption}\oarg*{\ldots}\marg*{\ldots},使得在目录里使用短标题。
+\cmd{caption} 命令之后还可以紧跟 \cmd{label} 命令标记交叉引用。
-\cmd{caption} 之后还可以紧跟 \cmd{label} 命令标记交叉引用。
+\pkgindex{caption}
+\cmd{caption} 生成的标题形如 ``Figure 1: \ldots''{}(\env{figure} 环境)或 ``Table 1: \ldots''{}(\env{table} 环境)。
+可通过修改 \cmd{figurename} 和 \cmd{tablename} 的内容来修改标题的前缀(详见第 \ref{sec:latex-settings} 节)。
+标题样式的定制功能由 \pkg{caption} 宏包提供,详见该宏包的帮助手册,在此不作赘述。
\cmdindex{listoftables,listoffigures}
\env{table} 和 \env{figure} 两种浮动体分别有各自的生成目录的命令:
@@ -949,13 +983,13 @@ A \rule[-.4pt]{3em}{.4pt} line.
\begin{verbatim}
\begin{figure}[htbp]
\centering
- \begin{minipage}
+ \begin{minipage}{...}
\centering
\includegraphics[width=...]{...}
\caption{...}
\end{minipage}
\qquad
- \begin{minipage}
+ \begin{minipage}{...}
\centering
\includegraphics[width=...]{...}
\caption{...}
@@ -986,14 +1020,14 @@ A \rule[-.4pt]{3em}{.4pt} line.
\begin{figure}[htbp]
\centering
\subfloat[...]{\label{sub-fig-1}% 为子图加交叉引用
- \begin{minipage}
+ \begin{minipage}{...}
\centering
\includegraphics[width=...]{...}
\end{minipage}
}
\qquad
\subfloat[...]{%
- \begin{minipage}
+ \begin{minipage}{...}
\centering
\includegraphics[width=...]{...}
\end{minipage}
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/chap.04.math.tex
index 30de4c04e93..84ea8472137 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/chap.04.math.tex
@@ -1,4 +1,4 @@
-\chapter{排版数学公式}
+\chapter{排版数学公式}\label{chap:math}
\addtocontents{los}{\protect\addvspace{10pt}}
\begin{intro}
@@ -22,7 +22,7 @@
数学公式有两种排版方式:其一是与文字混排,称为\textbf{行内公式};其二是单独列为一行排版,称为\textbf{行间公式}。
\pinyinindex{hangneigongshi}{行内公式}
-\index{$@\texttt\$ (\textit{数学模式})}
+\index{^^d@\texttt\$ (\textit{数学模式})}
行内公式由一对 \texttt\$ 符号包裹:
\begin{example}
Add $a$ squared and $b$ squared
@@ -114,12 +114,12 @@ In display:
\begin{enumerate}
\item 数学模式中输入的空格全部被忽略。数学符号的间隙默认完全由符号的性质(关系符号、运算符等)决定。
需要人为引入空隙时,使用 \cmd{quad} 和 \cmd{qquad} 等命令。详见 \ref{sec:math-space} 节。
- \item \textbf{不允许有空行(分段)。}每个公式(每组多行公式)自成一个段落。
+ \item \textbf{不允许有空行(分段)},公式也无法自动换行或者用 \crcmd\ 换行。排版多行公式需要用到 \ref{sec:multi-eqns} 节介绍的各种环境。
\item 所有的字母被当作数学公式中的变量处理,字母间距与文本模式不一致,也无法生成单词之间的空格。
如果想在数学公式中输入正体的文本,简单情况下可用 \ref{subsec:math-alpha} 小节中提供的 \cmd{mathrm} 命令。
- \pkg{amsmath} 提供了更加方便的 \amscmd{text} 命令%
+ 或者用 \pkg{amsmath} 提供的 \amscmd{text} 命令%
\footnote{\amscmd{text} 命令仅适合在公式中穿插少量文字。如果你的情况正好相反,需要在许多文字中穿插使用公式,
- 则应该像正常的行内公式那样,而不是滥用 \amscmd{text} 命令。}。
+ 则应该像正常的行内公式那样用,而不是滥用 \amscmd{text} 命令。}。
\end{enumerate}
\begin{example}
$x^{2} \geq 0 \qquad
@@ -133,15 +133,16 @@ x\in\mathbb{R}$
\pkgindex{amssymb}
本节我们将接触到形形色色的数学符号,它们是 \LaTeX\ 卓越的数学公式排版能力的基础。\LaTeX\ 默认提供了常用的数学符号,
-\pkg{amssymb} 宏包提供了一些次常用的符号。大多数常用的数学符号都能在本章末尾的 \ref{sec:math-tables} 节列出的表格里查到。
+\pkg{amssymb} 宏包提供了一些次常用的符号。大多数常用的数学符号都能在本章末尾的 \ref{sec:math-tables} 节列出的各个表格里查到。
+更多符号可查阅参考文献\cite{symbols}。
-\subsection{一般符号}
+\subsection{一般符号}\label{subsec:math-general}
\pinyinindex{xilazimu}{希腊字母 (数学符号)}
\msymindex{infty}
希腊字母符号的名称就是其英文名称,如 \msym{alpha}、\msym{beta} 等等。
大写的希腊字母为首字母大写的命令,如 \msym{Gamma}、\msym{Delta} 等等。
-无穷大符号为 \msym{infty} 。详情请参考本章末尾的表 \ref{tbl:math-greek} 和 \ref{tbl:math-misc} 等。
+无穷大符号为 \msym{infty}。更多符号命令可参考表 \ref{tbl:math-greek} 和 \ref{tbl:math-misc} 等。
\msymindex{dots,ldots,cdots}
省略号有 \msym{dots} 和 \msym{cdots} 两种形式。它们有各自合适的用途:
@@ -151,7 +152,7 @@ $a_1 + a_2 + \cdots + a_n$
\end{example}
\cmd{ldots} 和 \cmd{dots} 是完全等效的,它们既能用在公式中,也用来在文本里作为省略号(详见 \ref{subsec:punct} 小节)。
-除此之外,在矩阵中会用到竖排的 \msym{vdots} 和斜排的 \msym{ddots}。
+除此之外,在矩阵中可能会用到竖排的 \msym{vdots} 和斜排的 \msym{ddots}。
\subsection{指数、上下标和导数}\label{subsec:math-scripts}
@@ -289,7 +290,7 @@ $a\bmod b \\
\[\argh 3 = \nut_{x=1} 4x\]
\end{example}
-\subsection{巨算符}
+\subsection{巨算符}\label{subsec:math-bigop}
\msymindex{int,oint,sum,prod}
积分号 \msym{int}、求和号 \msym{sum} 等符号称为\textbf{巨算符}。巨算符在行内公式和行间公式的大小和形状有区别。
@@ -339,7 +340,7 @@ P(i,j) = Q(n)
\]
\end{example}
-\subsection{数学重音和上下括号}
+\subsection{数学重音和上下括号}\label{subsec:math-accents}
\maccindex{dot,ddot,vec,hat}
数学符号可以像文字一样加重音,比如对时间求导的符号 $\dot{r}$ (\cmd{dot}\marg*{r})、 $\ddot{r}$ (\cmd{ddot}\marg*{r})
@@ -372,7 +373,7 @@ $\underbrace{\overbrace{a+b+c}^6
_\text{meaning of life} = 42$
\end{example}
-\subsection{箭头}
+\subsection{箭头}\label{subsec:math-arrows}
\cmdindex[amsmath]{xleftarrow,xrightarrow}
除了作为上下标之外,箭头还用于表示过程。\pkg{amsmath} 的 \amscmd{xleft\-arrow} 和 \amscmd{xright\-arrow} 命令可以为箭头增加上下标:
@@ -381,7 +382,7 @@ _\text{meaning of life} = 42$
\[ c\xrightarrow[x<y]{a*b*c}d \]
\end{example}
-\subsection{括号和定界符}
+\subsection{括号和定界符}\label{subsec:math-delims}
\LaTeX\ 提供了多种括号和定界符表示公式块的边界。除小括号\texttt{( )}、中括号\texttt{[ ]}之外,其余都是 \LaTeX\ 命令,
包括大括号 \cmd{\{} \cmd{\}}。表 \ref{tbl:math-delims} 和 \ref{tbl:math-large-delims} 给出了更多的括号/定界符命令。
@@ -408,21 +409,22 @@ ${a,b,c} \neq \{a,b,c\}$
(\cmd{bigl} 和 \cmd{bigr} 不必成对出现)。
\begin{example}
$\Bigl((x+1)(x-1)\Bigr)^{2}$\\
-$\bigl( \Bigl( \biggl( \Biggl(
-\quad
-\bigr\} \Bigr\} \biggr\} \Biggr\}
-\quad
-\big\| \Big\| \bigg\| \Bigg\|
-\quad
+$\bigl( \Bigl( \biggl( \Biggl( \quad
+\bigr\} \Bigr\} \biggr\} \Biggr\} \quad
+\big\| \Big\| \bigg\| \Bigg\| \quad
\big\Downarrow \Big\Downarrow
\bigg\Downarrow \Bigg\Downarrow$
\end{example}
+使用 \cmd{big} 和 \cmd{bigg} 等命令的另外一个好处是:用 \cmd{left} 和 \cmd{right} 分界符包裹的公式块是不允许断行的
+(下文提到的 \env{array} 或者 \amsenv{aligned} 等环境视为一个公式块),所以也不允许在多行公式里跨行使用,
+而 \cmd{big} 和 \cmd{bigg} 等命令不受限制。
+
\section{多行公式}\label{sec:multi-eqns}
-\subsection{长公式折行}\label{sec:multline}
+\subsection{长公式折行}\label{subsec:multline}
-通常来讲应当避免写出需要折行的长公式。如果一定要折行的话,优先在等号之前折行,其次在加号、减号之前,再次在乘号、除号之前。
+通常来讲应当避免写出超过一行而需要折行的长公式。如果一定要折行的话,优先在等号之前折行,其次在加号、减号之前,再次在乘号、除号之前。
其它位置应当避免折行。
\envindex[amsmath]{multline}
@@ -525,16 +527,15 @@ l + m &= n
\envindex{array}
\index{&@\texttt\& (\textit{单元格/对齐})}
为了排版二维数组,\LaTeX\ 提供了 \env{array} 环境,用法与 \env{tabular} 环境极为类似,也需要定义列格式,并用 \crcmd\ 换行。
-数组可作为一个子公式,在外套用 \cmd{left}、\cmd{right} 等定界符:
+数组可作为一个公式块,在外套用 \cmd{left}、\cmd{right} 等定界符:
\begin{example}
-\[
-\mathbf{X} = \left(
-\begin{array}{ccc}
-x_1 & x_2 & \ldots \\
-x_3 & x_4 & \ldots \\
-\vdots & \vdots & \ddots
-\end{array} \right)
-\]
+\[ \mathbf{X} = \left(
+\begin{array}{cccc}
+x_{11} & x_{12} & \ldots & x_{1n}\\
+x_{21} & x_{22} & \ldots & x_{2n}\\
+\vdots & \vdots & \ddots & \vdots\\
+x_{n1} & x_{n2} & \ldots & x_{nn}\\
+\end{array} \right) \]
\end{example}
值得注意的是,上一节末尾介绍的 \amsenv{aligned} 等环境也可以用定界符包裹。
@@ -543,45 +544,57 @@ x_3 & x_4 & \ldots \\
\mathindex{right}
我们还可以利用空的定界符排版出这样的效果:
\begin{example}
-\[
-|x| = \left\{
+\[ |x| = \left\{
\begin{array}{rl}
-x & \text{if } x < 0,\\
0 & \text{if } x = 0,\\
x & \text{if } x > 0.
-\end{array} \right.
-\]
+\end{array} \right. \]
\end{example}
\envindex[amsmath]{cases}
不过上述例子可以用 \pkg{amsmath} 提供的 \amsenv{cases} 环境更轻松地完成:
\begin{example}
-\[
-|x| =
+\[ |x| =
\begin{cases}
-x & \text{if } x < 0,\\
0 & \text{if } x = 0,\\
x & \text{if } x > 0.
-\end{cases}
-\]
+\end{cases} \]
\end{example}
\envindex[amsmath]{matrix,pmatrix,bmatrix,Bmatrix,vmatrix,Vmatrix}
我们当然也可以用 \env{array} 环境排版各种矩阵。\pkg{amsmath} 宏包还直接提供了多种排版矩阵的环境,包括不带定界符的 \amsenv{matrix},
以及带各种定界符的矩阵 \amsenv{pmatrix}($\bigl($)、\amsenv{bmatrix}($\bigl[$)、\amsenv{Bmatrix}($\bigl\{$)、
-\amsenv{vmatrix}($\bigl\vert$)、\amsenv{Vmatrix}($\bigl\Vert$)。
-使用这些环境时,无需给定列格式:
+\amsenv{vmatrix}($\bigl\vert$)、\amsenv{Vmatrix}($\bigl\Vert$)。使用这些环境时,无需给定列格式%
+\footnote{事实上这些矩阵内部也是用 \env{array} 环境生成的,列格式默认为 \texttt{*\{\Arg{n}\}\{c\}},\Arg{n} 默认为 10;
+\amsenv{cases} 内部是一个列格式为 \texttt{@\{\}l@\{\cmd{quad}\}l@\{\}} 的 \env{array} 环境。}:
\begin{example}
\[
\begin{matrix}
-1 & 2 \\
-3 & 4
+1 & 2 \\ 3 & 4
\end{matrix} \qquad
\begin{bmatrix}
-p_{11} & p_{12} & \ldots & p_{1n} \\
-p_{21} & p_{22} & \ldots & p_{2n} \\
-\vdots & \vdots & \ddots & \vdots \\
-p_{m1} & p_{m2} & \ldots & p_{mn}
+x_{11} & x_{12} & \ldots & x_{1n}\\
+x_{21} & x_{22} & \ldots & x_{2n}\\
+\vdots & \vdots & \ddots & \vdots\\
+x_{n1} & x_{n2} & \ldots & x_{nn}\\
+\end{bmatrix}
+\]
+\end{example}
+
+在矩阵中的元素里排版分式时,一来要用到 \amscmd{dfrac} 等命令,二来行与行之间有可能紧贴着,这时要用到
+\ref{subsec:tabular-colht} 小节的方法来调节间距:
+\begin{example}
+\[
+\mathbf{H}=
+\begin{bmatrix}
+\dfrac{\partial^2 f}{\partial x^2} &
+\dfrac{\partial^2 f}
+ {\partial x \partial y} \\[8pt]
+\dfrac{\partial^2 f}
+ {\partial x \partial y} &
+\dfrac{\partial^2 f}{\partial y^2}
\end{bmatrix}
\]
\end{example}
@@ -595,8 +608,9 @@ p_{m1} & p_{m2} & \ldots & p_{mn}
我们已经认识了两个生成间距的命令 \cmd{quad} 和 \cmd{qquad}。在公式中我们还可能用到的间距包括 \cmd{,}、\cmd{:}、\cmd{;}
以及负间距 \cmd{!},其中 \cmd{quad} 、 \cmd{qquad} 和 \cmd{,} 在文本和数学环境中可用,后三个命令只用于数学环境。
文本中的 \cmd{\textvisiblespace} 也能使用在数学公式中。
-\begin{center}
+
\newdimen\testdimen \testdimen=\fontdimen6\textfont2 \divide\testdimen18\relax
+\begin{center}
\begin{tabularx}{0.9\textwidth}{*{3}{>{\raggedright\arraybackslash}X}|*{3}{>{\raggedright\arraybackslash}X}}
\hline
无额外间距 & & $a a$ &
@@ -634,7 +648,7 @@ f(x)g(y) \diff x \diff y \\
\end{gather*}
\end{example}
-\section{数学符号的字体控制}
+\section{数学符号的字体控制}\label{sec:math-fonts}
\subsection{数学字母字体}\label{subsec:math-alpha}
@@ -675,7 +689,7 @@ $\mathbb{ABCDE}$ & \cmd{mathbb}\marg*{\ldots} & \pkg{amssymb}
\end{tabular}
\end{table}
-\subsection{数学符号的尺寸}
+\subsection{数学符号的尺寸}\label{subsec:math-styles}
\mathindex{displaystyle,textstyle,scriptstyle,scriptscriptstyle}
数学符号按照符号排版的位置规定尺寸,从大到小包括行间公式尺寸、行内公式尺寸、上下标尺寸、次级上下标尺寸。
@@ -705,7 +719,7 @@ P = \frac
\]
\end{example}
-\subsection{加粗的数学符号}
+\subsection{加粗的数学符号}\label{subsec:math-bold}
在 \LaTeX\ 中为符号切换数学字体并不十分自由,只能通过 \cmd{mathbf} 等有限的命令切换字体。比如想得到粗斜体的符号,就没有现成的命令%
\footnote{国内可能还有使用粗斜体表示向量符号的习惯,但这并不是正确的习惯。};再比如 \cmd{mathbf} 只能改变拉丁字母,希腊字母就没有用。
@@ -800,8 +814,8 @@ described in theorem \ref{thm:light}.
以上例子定义的 \env{jury} 环境与 \env{law} 环境共用编号,\env{mar} 环境不编号:
\begin{example}
-\begin{law} \label{law:box}
-Don’t hide in the witness box
+\begin{law}\label{law:box}
+Don't hide in the witness box.
\end{law}
\begin{jury}[The Twelve]
It could be you! So beware and
@@ -869,4 +883,19 @@ E=mc^2.\qedhere
在 \amsenv{align} 等环境中使用 \cmd{qedhere} 命令会使 \qedsymbol\ 盖掉公式的编号;使用 \env{equation} 嵌套 \amsenv{aligned} 等环境时,
\cmd{qedhere} 命令会将 \qedsymbol\ 直接放在公式后。这些位置都不太正常。
+证毕符号 \qedsymbol\ 本身被定义在命令 \cmd{qedsymbol} 中,如果有使用实心符号作为证毕符号的需求,需要自行用 \cmd{re\-new\-comm\-and}
+命令修改(用法见 \ref{subsec:newcmd} 小节)\footnote{注意,这个改法\textbf{只对 \pkg{amsthm} 宏包适用}。
+其它宏包如 \pkg{ntheorem} 等须参考帮助手册里提供的修改方法。}。
+我们可以利用在 \ref{subsec:rules} 小节介绍的标尺盒子来生成一个适当大小的“实心矩形”:
+\begin{example}
+\renewcommand{\qedsymbol}%
+ {\rule{1ex}{1.5ex}}
+\begin{proof}
+For simplicity, we use
+\[
+E=mc^2 \qedhere
+\]
+\end{proof}
+\end{example}
+
\endinput \ No newline at end of file
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/chap.05.style.tex
index 0b6543d629a..bacb3f98778 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/chap.05.style.tex
@@ -151,40 +151,54 @@ He likes {\LARGE large and
\usepackage[T1]{fontenc}
\end{verbatim}
+\pkg{fontenc} 宏包是用来配合传统的 \LaTeX\ 字体的,如表 \ref{tbl:font-pkgs} 中的大部分宏包。如果使用下文的 \pkg{fontspec}
+宏包调用 \texttt{ttf} 或 \texttt{otf} 格式字体,就不要再使用 \pkg{fontenc} 宏包。
+
\begin{table}[!p]
\centering
\caption{常见的 \LaTeX\ 字体宏包。}\label{tbl:font-pkgs}
-\begin{minipage}{\linewidth}
-\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}cp{0.65\linewidth}@{}}
+\begin{tabularx}{\linewidth}{cX}
+ \hline
+ \multicolumn{2}{c}{文本/数学字体搭配的宏包} \\
\hline
\pkg{lmodern} & Latin Modern 字体,对 Computer Modern 字体的扩展 \\
+ \pkg{cmbright} & 仿 Computer Modern 风格的无衬线字体 \\
+ \pkg{euler} & Euler 风格数学字体,也出自于高德纳之手 \\
+ \pkg{ccfonts} & Concrete 风格字体 \\
\pkg{txfonts} & Times 风格的字体宏包 \\
- \pkg{pxfonts} & Palation 风格的字体宏包 \\
+ \pkg{pxfonts} & Palatino 风格的字体宏包 \\
\pkg{stix} & Times 风格的字体宏包 \\
\pkg{newtxtext},\pkg{newtxmath} & \pkg{txfonts} 的改进版本,分别设置文本和数学字体 \\
\pkg{newpxtext},\pkg{newpxmath} & \pkg{pxfonts} 的改进版本,分别设置文本和数学字体 \\
- \pkg{mathptmx} & \pkg{psnfss} 组件之一,Times 风格,较为陈旧,不推荐使用 \\
- \pkg{mathpazo} & \pkg{psnfss} 组件之一,Palatino 风格,较为陈旧,不推荐使用 \\
- \pkg{ccfonts} & Concrete 风格字体 \\
- \pkg{euler} & Euler 风格数学字体,也出自于高德纳之手 \\
- \pkg{fourier} & fourier 风格数学字体 \\
- \pkg{arev} & Arev 风格的无衬线字体 \\
- \pkg{cmbright} & 仿 Computer Modern 风格的无衬线字体 \\
- \pkg{libertine} & Linux Libertine 衬线字体 \\
- \pkg{droid} & Droid Serif/Droid Sans 等 \\
- \pkg{inconsolata} & Inconsolata 一款不错的开源等宽字体 \\
+ \pkg{mathptmx} & \pkg{psnfss} 字体宏集之一,Times 风格,较为陈旧,不推荐使用 \\
+ \pkg{mathpazo} & \pkg{psnfss} 字体宏集之一,Palatino 风格,较为陈旧,不推荐使用 \\
+ \pkg{fourier} & fourier 风格数学字体,配合 Utopia 正文字体 \\
+ \pkg{fouriernc} & fourier 风格数学字体,配合 New Century Schoolbook 正文字体 \\
+ \pkg{arev} & Arev 无衬线字体宏包,Vera Sans 风格 \\
+ \pkg{mathdesign} & 配合 Charter/Garamond/Utopia 正文字体的数学字体宏包(Garamond 字体可能需要单独安装) \\
+ \hline
+ \multicolumn{2}{c}{文本字体宏包} \\
+ \multicolumn{2}{l}{\small 以下字体包括传统的 \LaTeX\ 字体格式以及 TrueType / OpenType 格式。} \\
+ \hline
+ \pkg{dejavu} & DejaVu 开源字体 \\
+ \pkg{droid} & Droid 开源字体 \\
+ \pkg{inconsolata} & Inconsolata 开源等宽字体 \\
+ \pkg{libertine} & Linux Libertine / Linux Biolium 开源字体 \\
+ \pkg{roboto} & Roboto 开源无衬线字体 \\
\pkg{sourcesanspro} & Source Sans Pro 开源无衬线字体 \\
\pkg{sourcecodepro} & Source Code Pro 开源等宽字体 \\
+ \hline
+ \multicolumn{2}{c}{符号宏包} \\
+ \hline
\pkg{mathabx} & 数学符号宏包之一 \\
\pkg{MnSymbol} & 数学符号宏包之一 \\
\pkg{fdsymbol} & 数学符号宏包之一 \\
- \pkg{mathdesign} & 配合 Charter/Garamond/Utopia 正文字体的数学字体宏包(Garamond 字体可能需要单独安装) \\
+ \pkg{pifont} & Zapf Dingbats 符号字体宏包 \\
\hline
-\end{tabular*}
-\end{minipage}
+\end{tabularx}
\end{table}
-\subsection{\texttt{xelatex} 命令下使用 \pkg{fontspec} 宏包更改字体}\label{subsec:fontspec}
+\subsection{使用 \pkg{fontspec} 宏包更改字体 (\texttt{xelatex})}\label{subsec:fontspec}
\index{xelatex@\texttt{xelatex} 命令}
\texttt{xelatex} 编译命令能够支持直接调用系统安装的 \texttt{.ttf} 或 \texttt{.otf} 格式字体%
@@ -193,7 +207,7 @@ He likes {\LARGE large and
\pkgindex{fontspec}
\cmdindex[fontspec]{setmainfont,setsansfont,setmonofont}
\texttt{xelatex} 命令下支持用户调用字体的宏包是 \pkg{fontspec}。宏包提供了几个设置全局字体的命令,设置 \cmd{rmfamily} 等对应命令的默认字体%
-\footnote{新版本 \pkg{fontspec} 的命令支持把必选参数 \Arg{font name} 放在可选参数 \Arg{font features} 的前面。}:
+\footnote{新版本 \pkg{fontspec} 的命令支持(并且推荐)把必选参数 \Arg{font name} 放在可选参数 \Arg{font features} 的前面。}:
\begin{command}
\cmd{setmainfont}\oarg{font features}\marg{font name} \\
\cmd{setsansfont}\oarg{font features}\marg{font name} \\
@@ -253,7 +267,7 @@ He likes {\LARGE large and
表示基础长度为 \texttt{12pt},可以伸展到 \texttt{14pt} ,也可以收缩到 \texttt{9pt}。
也可只定义 \texttt{plus} 或者 \texttt{minus} 的部分,如 \texttt{0pt plus 5pt}。
-长度的数值还可以用长度变量的倍数来表达,如 \texttt{2.5}\cmd{parindent} 等。
+长度的数值还可以用长度变量本身或其倍数来表达,如 \texttt{2.5}\cmd{parindent} 等。
\cmdindex{newlength,setlength,addtolength}
\LaTeX\ 预定义了大量的长度变量用于控制版面格式。如页面宽度和高度、首行缩进、段落间距等。
@@ -278,15 +292,15 @@ He likes {\LARGE large and
\cmd{linespread}\marg{factor}
\end{command}
-此处的行距,指的是基本行距(相当于 \cmd{fontsize} 命令的第二个参数)而不是字号大小。所以设置 1.5 倍行距的命令 \cmd{line\-spread}\marg*{1.5}
-意味着最终行距为 1.8 倍的字号大小。
+这里的 \Arg{factor} 是在基础行距上而不是字号上乘以一个因子。大部分时候,默认的基础行距是 1.2 倍字号大小(参考 \cmd{fontsize} 命令),
+因此设置 1.5 倍行距的命令 \cmd{line\-spread}\marg*{1.5} 意味着最终行距为 1.8 倍的字号大小。
\cmdindex{selectfont}
如果不是在导言区全局修改,而想要局部地改变某个段落的行距,需要用 \cmd{select\-font} 命令使 \cmd{line\-spread} 命令的改动立即生效:
\begin{example}
{\linespread{2.0}\selectfont
-The baseline skip is set to twice
-the normal baseline skip.
+The baseline skip is set to be
+twice the normal baseline skip.
Pay attention to the \verb|\par|
command at the end. \par}
@@ -319,26 +333,16 @@ But remember I am a liar.}\par
\cmd{setlength}\marg*{\cmd{parindent}}\marg*{2em}
\end{command}
-它们和设置字号的命令一样,在分段时生效。
+它们和设置行距的命令一样,在分段时生效。
\cmdindex{indent,noindent}
\LaTeX\ 默认在段落开始时缩进,长度为你用上述命令设置的 \cmd{parindent}。如果你在某一段不想使用缩进,可使用某一段开头使用
-\begin{command}
-\cmd{noindent}
-\end{command}
-命令。相反地,
-\begin{command}
-\cmd{indent}
-\end{command}
-命令强制开启一段首行缩进的段落。多个 \cmd{indent} 命令的效果可以累加。
+\cmd{noindent} 命令。相反地,\cmd{indent} 命令强制开启一段首行缩进的段落。多个 \cmd{indent} 命令可以累加缩进量。
\pkgindex{indentfirst}
-\LaTeX\ 还默认\textbf{在 \cmd{chapter}、\cmd{section} 等章节命令之后的第一段不缩进}%
-\footnote{\pkg{ctex} 宏包默认按照中文习惯保持第一段的首行缩进。}。
-如果不习惯这种设定,可以调用 \pkg{indent\-first} 宏包:
-\begin{verbatim}
-\usepackage{indentfirst}
-\end{verbatim}
+\LaTeX\ 还默认\textbf{在 \cmd{chapter}、\cmd{section} 等章节标题命令之后的第一段不缩进}%
+\footnote{\pkg{ctex} 宏包和文档类默认按照中文习惯保持标题后第一段的首行缩进。}。
+如果不习惯这种设定,可以调用 \pkg{indent\-first} 宏包,令第一段的首行缩进照常。
\cmdindex{parskip}
段落间的垂直间距为 \cmd{parskip},如设置段落间距在 \texttt{0.8ex} 到 \texttt{1.5ex} 变动:
@@ -349,7 +353,7 @@ But remember I am a liar.}\par
\subsection{水平间距}\label{subsec:hspace}
\cmdindex{hspace}
-\LaTeX 默认为单词之间增添了水平间距。如果想要手动插入额外的间距,需要用到如下命令:
+\LaTeX 默认为将单词之间的“空格”转化为水平间距。如果需要在文中手动插入额外的水平间距,可使用如下命令:
\begin{command}
\cmd{hspace}\marg{length}
\end{command}
@@ -359,14 +363,15 @@ of 1.5 cm.
\end{example}
\cmdindex{hspace*}
-\cmd{hspace} 命令生成的间距如果位于一行的开头或末尾,则有可能因为断行而被“吞掉”。可使用 \cmd{hspace*} 命令代替 \cmd{hspace} 命令
+\cmd{hspace} 命令生成的水平间距如果位于一行的开头或末尾,则有可能因为断行而被“吞掉”。可使用 \cmd{hspace*} 命令代替 \cmd{hspace} 命令
得到不会因断行而消失的水平间距。
\cmdindex{stretch,fill}
-命令 \cmd{stretch}\marg{n} 生成一个特殊弹性长度,参数 \Arg{n} 为权重。它的基础长度为零,但可以无限延伸,直到占满可用的空间。
+命令 \cmd{stretch}\marg{n} 生成一个特殊弹性长度,参数 \Arg{n} 为权重。它的基础长度为 0pt,但可以无限延伸,直到占满可用的空间。
如果同一行内出现多个 \cmd{stretch}\marg{n},这一行的所有可用空间将按每个 \cmd{stretch} 命令给定的权重 \Arg{n} 进行分配。
-命令 \cmd{fill} 相当于 \cmd{stretch}\marg*{1}。
+命令 \cmd{fill} 相当于 \cmd{stretch}\marg*{1}%
+\footnote{注意不要用 \texttt{1.5}\cmd{fill} 这样的用法,它生成的长度只有基础长度 0pt 而没有延伸部分。}。
\begin{example}
x\hspace{\stretch{1}}
@@ -375,8 +380,8 @@ x\hspace{\fill}x
\end{example}
\cmdindex{quad,qquad}
-在正文中用 \cmd{hspace} 命令生成水平间距时,往往使用 \texttt{em} 作为单位,它会随字号大小而变。
-我们常用 \cmd{quad} 和 \cmd{qquad} 命令方便地生成水平间距,相当于 \cmd{hspace}\marg*{1em} 和 \cmd{hspace}\marg*{2em}:
+在正文中用 \cmd{hspace} 命令生成水平间距时,往往使用 \texttt{em} 作为单位,生成的间距随字号大小而变。
+我们在数学公式中见过 \cmd{quad} 和 \cmd{qquad} 命令,它们也可以用于文本中,分别相当于 \cmd{hspace}\marg*{1em} 和 \cmd{hspace}\marg*{2em}:
\begin{example}
{\Large big\hspace{1em}y}\\
@@ -421,13 +426,14 @@ between lines in a paragraph.
\section{页面和分栏}\label{sec:page-columns}
-我们不妨回顾一下第一章介绍的文档类属性。\LaTeX\ 允许你通过文档类选项控制纸张的大小(见表 \ref{tbl:ltx-options}),
+我们不妨回顾一下第一章介绍的文档类属性。\LaTeX\ 允许你通过为文档类指定选项来控制纸张的大小(见表 \ref{tbl:ltx-options}),
包括 \texttt{a4paper}、\texttt{letterpaper}等等,并配合字号设置了适合的页边距。
\cmdindex{textheight,textwidth}
控制页边距的参数由图 \ref{fig:layouts} 里给出的各种长度变量控制。
可以用 \cmd{setlength} 命令修改这些长度变量,以达到调节页面尺寸和边距的作用;
-反之也可以利用这些长度变量来决定排版内容的尺寸,如设置图片或表格的宽度为 0.8\cmd{textwidth}。
+反之也可以利用这些长度变量来决定排版内容的尺寸,如在 \env{tabularx} 环境或 \cmd{include\-graphics} 命令的参数里,
+设置图片或表格的宽度为 0.8\cmd{textwidth}:
\begin{figure}[!p]
\centering
@@ -528,6 +534,10 @@ between lines in a paragraph.
切换单/双栏排版时总是会另起一页(\cmd{clearpage})。
在双栏模式下使用 \cmd{newpage} 会换栏而不是换页;\cmd{clearpage} 则能够换页。
+\cmdindex{columnwidth,columnsep,columnseprule}
+双栏排版时每一栏的宽度为 \cmd{columnwidth},它由 \cmd{textwidth} 减去 \cmd{columnsep} 的差除以 2 得到。
+两栏之间还有一道竖线,宽度为 \cmd{columnseprule},默认为零,也就是看不到竖线。
+
\pkgindex{multicol}
\envindex[multicol]{multicols}
一个比较好用的分栏解决方案是 \pkg{multicol},它提供了简单的 \env{multicols} 环境
@@ -543,7 +553,7 @@ between lines in a paragraph.
\pkgindex{float}
\pkg{multicol} 宏包能够在一页之中切换单栏/多栏,也能处理跨页的分栏,且各栏的高度分布平衡。但代价是%
\textbf{在 \env{multicols} 环境中无法正常使用 \env{table} 和 \env{figure} 等浮动体环境},它会直接让浮动体丢失。
-\env{multicols} 环境中只能用跨栏的 \env{table*} 和 \env{figure*} ,或者用 \pkg{float} 宏包提供的 \texttt{H} 选项固定浮动体的位置。
+\env{multicols} 环境中只能用跨栏的 \env{table*} 和 \env{figure*} 环境,或者用 \pkg{float} 宏包提供的 \texttt{H} 参数固定浮动体的位置。
\section{页眉页脚}\label{sec:pagestyle}
@@ -569,9 +579,9 @@ between lines in a paragraph.
\begin{tabularx}{0.8\textwidth}{lX}
\hline
\texttt{empty} & 页眉页脚为空 \\
- \texttt{plain} & 页眉为空,页脚为页码。(article 和 report 文档类默认;book 文档类的每章第一页也为 plain 格式) \\
+ \texttt{plain} & 页眉为空,页脚为页码。(\cls{article} 和 \cls{report} 文档类默认;\cls{book} 文档类的每章第一页也为 plain 格式) \\
\hline
- \texttt{headings} & 页眉为章节标题和页码,页脚为空。(book 文档类默认) \\
+ \texttt{headings} & 页眉为章节标题和页码,页脚为空。(\cls{book} 文档类默认) \\
\texttt{myheadings} & 页眉为页码及 \cmd{markboth} 和 \cmd{markright} 命令手动指定的内容,页脚为空。\\
\hline
\end{tabularx}
@@ -581,9 +591,9 @@ between lines in a paragraph.
其中 \texttt{headings} 的情况较为复杂:
\begin{description}
\item[\cls{article} 文档类,\texttt{twoside} 选项:] 偶数页为页码和节标题,奇数页为小节标题和页码;
- \item[\cls{article} 文档类,\texttt{oneside} 选项:] 同 \texttt{twoside} 选项的奇数页页眉;
+ \item[\cls{article} 文档类,\texttt{oneside} 选项:] 页眉为节标题和页码;
\item[\cls{book/report} 文档类,\texttt{twoside} 选项:] 偶数页为页码和章标题,奇数页为节标题和页码;
- \item[\cls{book/report} 文档类,\texttt{oneside} 选项:] 同 \texttt{twoside} 选项的奇数页页眉。
+ \item[\cls{book/report} 文档类,\texttt{oneside} 选项:] 页眉为章标题和页码。
\end{description}
\subsection{手动更改页眉页脚的内容}\label{subsec:marks}
@@ -600,7 +610,7 @@ between lines in a paragraph.
事实上 \cmd{chapter}、\cmd{section} 等命令内部也使用 \cmd{mark\-both} 或者 \cmd{mark\-right} 写页眉。
\LaTeX\ 默认将页眉的内容都转为大写字母。如果你不喜欢这样,可以尝试以下代码
-(相关命令的用法参照 \ref{sec:newcommands} 节)%
+(相关命令的用法参照 \ref{subsec:newcmd} 节)%
\footnote{但是这不能改变页眉的斜体样式(\cmd{slshape}),斜体是定义在 \texttt{headings} 样式里的。
如果不喜欢斜体,可在 \cmd{mark\-both} 等命令的参数里先使用 \cmd{normal\-font} ,再使用想要的字体样式命令,
或直接尝试使用 \pkg{fancyhdr} 宏包。}:
@@ -612,7 +622,7 @@ between lines in a paragraph.
\end{verbatim}
其中 \cmd{thechapter}、\cmd{thesection} 等命令为章节计数器的数值(详见 \ref{sec:counters} 节)。以上代码适用于 \cls{report/book} 文档类。
-对于 \cls{article} 文档类,与两个页眉相关的命令分别为 \cmd{sec\-tion\-mark} 和 \cmd{sub\-sec\-tion\-mark} 。
+对于 \cls{article} 文档类,与两个页眉相关的命令分别为 \cmd{sec\-tion\-mark} 和 \cmd{sub\-sec\-tion\-mark}。
\subsection{\pkg{fancyhdr} 宏包}\label{subsec:fancyhdr}
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/chap.06.spec.tex
index f4c5418e2f4..cfaf0b19ace 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/chap.06.spec.tex
@@ -1,4 +1,4 @@
-\chapter{特色工具和功能}
+\chapter{特色工具和功能}\label{chap:spec}
\addtocontents{los}{\protect\addvspace{10pt}}
\begin{intro}
@@ -6,9 +6,9 @@
之后的使用颜色、超链接等则令我们生成美观易用的电子文档。
\end{intro}
-\section{参考文献和 \hologo{BibTeX} 工具}
+\section{参考文献和 \hologo{BibTeX} 工具}\label{sec:bib}
-\subsection{基本的参考文献和引用}
+\subsection{基本的参考文献和引用}\label{subsec:bib-basics}
\pinyinindex{cankaowenxian}{参考文献}
\LaTeX\ 提供的参考文献和引用方式比较原始,需要用户自行书写参考文献列表。不同学术论文对参考文献列表的格式要求不一样,
@@ -20,20 +20,25 @@
\cmd{cite}\marg{citation}
\end{command}
-\cmd{cite} 带一个可选参数,为引用的编号后加上额外的内容,如 \cmd{cite}\oarg*{page 22}\marg{pa} 可能得到形如 [13, page 22] 这样的引用。
+\Arg{citation} 为引用的参考文献的标签,类似 \cmd{ref} 里的参数;\cmd{cite} 带一个可选参数,为引用的编号后加上额外的内容,
+如 \cmd{cite}\oarg*{page 22}\marg{pa} 可能得到形如 [13, page 22] 这样的引用。
\envindex{thebibliography}
+\cmdindex{bibitem}
参考文献由 \env{thebibliography} 环境包裹。每条参考文献由 \cmd{bibitem} 开头,其后是参考文献本身的内容:
\begin{command}
\cmd{bibitem}\oarg{item number}\marg{citation}
\end{command}
-其中 \Arg{citation} 是 \cmd{cite} 用以引用的一个标签,类似交叉引用里的 \cmd{label}。
+其中 \Arg{citation} 是 \cmd{cite} 使用的文献标签,
\Arg{item number} 自定义参考文献的序号,如果省略,则按自然排序给定序号。
-\env{thebibliography} 环境带一个参数,用以设定 \cmd{cite} 命令生成的引用编号的最大宽度,
+\env{thebibliography} 环境带一个参数,用以设定 \cmd{bibitem} 命令生成的参考文献编号的宽度,
如 99 意味着不超过两位数字。通常设定为与参考文献的数目一致。
-\env{the\-biblio\-graphy} 环境自动生成不带编号的一章(\cls{report} / \cls{book} 文档类)或一节(\cls{article} 文档类)。
+
+\env{thebibliography} 环境自动生成不带编号的一节(\cls{article} 文档类)或一章(\cls{report} / \cls{book} 文档类)。
+在 \cls{article} 文档类的节标题默认为 ``Reference''{},而在 \cls{report / book} 文档类
+的章标题默认为 ``Bibliography''{}。用户可通过 \ref{sec:latex-settings} 节给出的方法定制参考文献的标题。
以下为一个使用 \env{the\-biblio\-graphy} 排版参考文献的例子:
@@ -50,11 +55,11 @@ Partl~\cite{pa} has proposed that \ldots
\end{document}
\end{verbatim}
-\subsection{\hologo{BibTeX} 数据库}
+\subsection{\hologo{BibTeX} 数据库}\label{subsec:bibtex-data}
\index{bibtexdb@\protect\hologo{BibTeX} 数据库}
-\hologo{BibTeX} 是最为流行的参考文献数据组织格式之一。它的出现让我们摆脱手写参考文献条目的麻烦。我们还可以通过参考文献格式的支持,
-让同一份 \hologo{BibTeX} 数据库生成不同格式的参考文献列表。我们首先简单介绍 \hologo{BibTeX} 数据库,之后介绍如何将数据库利用在 \LaTeX\ 中。
+\hologo{BibTeX} 是最为流行的参考文献数据组织格式之一。它的出现让我们摆脱手写参考文献条目的麻烦。我们还可以通过参考文献样式的支持,
+让同一份 \hologo{BibTeX} 数据库生成不同样式的参考文献列表。
\hologo{BibTeX} 数据库以 \texttt{.bib} 作为扩展名,其内容是若干个文献条目,每个条目的格式为:
\begin{command}
@@ -65,70 +70,108 @@ Partl~\cite{pa} has proposed that \ldots
\texttt\}
\end{command}
-其中 \Arg{type} 为参考文献的类型,如 \texttt{article} 为学术论文,\texttt{book} 为书籍,\texttt{in\-collection} 为论文集中的某一篇,等等。
-\Arg{citation} 为 \cmd{cite} 命令所用的参考文献的标签。在 \Arg{citation} 之后为条目里的各个数据项,以 \Arg{key} = \marg{value} 的形式组织。
+其中 \Arg{type} 为文献的类别,如 \texttt{article} 为学术论文,\texttt{book} 为书籍,\texttt{in\-collection} 为论文集中的某一篇,等等。
+\Arg{citation} 为 \cmd{cite} 命令使用的文献标签。在 \Arg{citation} 之后为条目里的各个数据项,以 \Arg{key} = \marg{value} 的形式组织。
-我们在此简单列举学术论文里使用较多的 \hologo{BibTeX} 文献条目格式。所有条目格式参考 \CTAN|biblio/bibtex/base/btxdoc.pdf|。
+我们在此简单列举学术论文里使用较多的 \hologo{BibTeX} 文献条目类别:
\begin{description}
- \item[\texttt{article}] 学术论文,必需数据项有 author, title, journal, year; 可选数据项包括 volumn, issue, number, pages, doi 等;
+ \item[\texttt{article}] 学术论文,必需数据项有 author, title, journal, year; 可选数据项包括 volumn, number, pages, doi 等;
\item[\texttt{book}] 书籍,必需数据项有 author/editor, title, publisher, year; 可选数据项包括 volumn/number, series, address 等;
\item[\texttt{incollection}] 论文集中的一篇,必需数据项有 author, title, booktitle, publisher, year; 可选数据项包括 editor, volumn/number, chapter, pages, address 等;
\item[\texttt{inbook}] 书中的一章,必需数据项有 author/editor, title, chapter/pages, publisher, year; 可选数据项包括 volumn/number, series, address 等。
\end{description}
+例如 \texttt{article} 类别的参考文献数据条目写法如下:
+\begin{verbatim}
+@article{Alice13,
+ title = {Demostration of bibliography items},
+ author = {A. Alice and B. Bob and C. Charlie and D. Danny},
+ year = {2013},
+ journal = {Journal of \TeX perts},
+ volume = {36},
+ number = {7},
+ pages = {114-120}}
+\end{verbatim}
+所有类别的文献条目格式请参考 \CTAN|biblio/bibtex/base/btxdoc.pdf|。
+
多数时候,我们无需自己手写 \hologo{BibTeX} 文献条目。从 Google Scholar 或者期刊/数据库的网站上都能够导出 \hologo{BibTeX} 文献条目,
老牌的文献管理软件 EndNote 也支持生成 \hologo{BibTeX} 格式的数据库。开源软件 JabRef 甚至支持 \hologo{BibTeX} 文献条目的导入、导出和管理。
-\subsection{使用 \hologo{BibTeX} 排版参考文献}\label{subsec:bibtex-use}
-
-\index{bibtex@\protect\hologo{BibTeX} 工具}
-现在我们来看如何利用 \hologo{BibTeX} 数据库生成参考文献和引用。
-
-第一步:我们当然需要一份 \hologo{BibTeX} 数据库,假设起名为 \texttt{books.bib} ,和我们的 \LaTeX\ 源代码\textbf{一般位于同一个目录下}。
+\subsection{\hologo{BibTeX} 样式}\label{subsec:bibtex-style}
-\begin{sourcecode}[htp]
-\begin{Verbatim}
-@book{Lamport1994,
- title = {{\LaTeX}: A Document Preparation System},
- author = {Lamport, L.},
- publisher = {Addison-Wesley},
- address = {Reading, Massachusetts},
- year = {1994},
- edition = {2nd}
-}
-@book{Mittelbach2004,
- title = {The {\LaTeX} Companion},
- author = {Mittelbach, F. and Goossens, M. and
- Braams, J. and Carlisle, D. and Rowley, C.},
- publisher = {Addison-Wesley},
- address = {Reading, Massachusetts},
- year = {2004},
- edition = {2nd}
-}
-\end{Verbatim}
-\caption{\hologo{BibTeX} 数据库示例 \texttt{books.bib}。}
-\end{sourcecode}
+参考文献的写法在不同文献里千差万别,包括作者、标题、年份等各项的顺序和字体样式、文献在列表中的排序规则等。
+\hologo{BibTeX} 用样式(style)来管理参考文献的写法。\hologo{BibTeX} 提供了几个预定义的样式,如 plain, unsrt, alpha 等。
+如果使用期刊模板的话,可能会提供自用的样式。
+样式文件以 \texttt{.bst} 为扩展名。
\cmdindex{bibliographystyle}
-第二步:在源代码中添加必要的命令。假设源代码的名称为 \texttt{demo.tex}。首先需要的是在\textbf{导言区}设定参考文献的格式:
+使用样式文件的方法是在源代码内(一般在导言区)使用 \cmd{biblio\-graphy\-style} 命令:
\begin{command}
\cmd{bibliographystyle}\marg{bst-name}
\end{command}
+这里 \Arg{bst-name} 为 \texttt{.bst} 样式文件的名称,\textbf{不要带 \texttt{.bst} 扩展名}。
+
+我们以 \ref{subsec:bibtex-data} 小节给出的数据条目为例,使用 \cmd{biblio\-graphy\-style} 命令选择不同的参考文献样式,
+效果大致如表 \ref{tbl:bibtex-style} 所示。
+
+\begin{table}[htp]
+\caption{\hologo{BibTeX} 样式的排版效果。}\label{tbl:bibtex-style}
+\hrule
+\begin{trivlist}\item\relax
+\textbf{plain}\\{}
+[1] A.~Alice, B.~Bob, C.~Charlie, and D.~Danny.
+\newblock Demostration of bibliography items.
+\newblock {\em Journal of \TeX perts}, 36(7):114--120, 2013.
+
+\medskip
+\textbf{alpha}\\{}
+[ABCD13] A.~Alice, B.~Bob, C.~Charlie, and D.~Danny.
+\newblock Demostration of bibliography items.
+\newblock {\em Journal of \TeX perts}, 36(7):114--120, 2013.
+
+\medskip
+\textbf{amsplain}(\AmS\ 文档类 \textsf{amsart} 等配套的样式)\\{}
+[1] A.~Alice, B.~Bob, C.~Charlie, and D.~Danny, \emph{Demostration of bibliography
+ items}, Journal of \TeX perts \textbf{36} (2013), no.~7, 114--120.
+
+\medskip
+\textbf{elsarticle-num}(Elsevier 提供的 \textsf{elsarticle} 文档类配套的样式)\\{}
+[1] A.~Alice, B.~Bob, C.~Charlie, D.~Danny, Demostration of bibliography items,
+ Journal of \TeX perts 36~(7) (2013) 114--120.
+
+\medskip
+\textbf{IEEEtran}(\textsf{IEEEtran} 模板文档类配套的样式)\\{}
+[1] A.~Alice, B.~Bob, C.~Charlie, and D.~Danny, ``Demostration of bibliography
+ items,'' \emph{Journal of \TeX perts}, vol.~36, no.~7, pp. 114--120, 2013.
+\end{trivlist}
+\hrule
+\end{table}
+
+\subsection{使用 \hologo{BibTeX} 排版参考文献}\label{subsec:bibtex-use}
-其中 \Arg{bst-name} 为格式文件的名称。\hologo{BibTeX} 提供了几个预定义的格式,如 plain, unsrt, alpha 等。
-一些学术论文的模板会提供自有的格式文件,以 \texttt{.bst} 作为扩展名,同样和 \LaTeX\ 源代码\textbf{放在同一个目录下}。
+\index{bibtex@\protect\hologo{BibTeX} 工具}
+现在我们来看如何利用 \hologo{BibTeX} 数据库生成参考文献和引用。
-\cmdindex{cite,nocite}
-其次就是在正文中引用参考文献了。\hologo{BibTeX} 程序在生成参考文献列表的时候,通常只列出你用 \cmd{cite} 命令引用的那些。
-如果需要列出没有被引用的文献,则需要 \cmd{nocite}\marg{citation} 命令;而 \cmd{nocite}\marg*{*} 则让所有未引用的参考文献都列出。
+第一步:我们当然需要一份 \hologo{BibTeX} 数据库,假设数据库文件名为 \texttt{books.bib},
+和 \LaTeX\ 源代码\textbf{一般位于同一个目录下}。
-\cmdindex{bibliography}
+第二步:在源代码中添加必要的命令。假设源代码名为 \texttt{demo.tex}(见 \ref{code:bibtex-demo})。
+\begin{enumerate}
+\item \cmdindex{bibliographystyle}
+首先需要使用命令 \cmd{bibliographystyle} 设定参考文献的格式。
+
+\item \cmdindex{cite,nocite}
+其次,在正文中引用参考文献。\hologo{BibTeX} 程序在生成参考文献列表的时候,通常只列出用了 \cmd{cite} 命令引用的那些。
+如果需要列出未被引用的文献,则需要 \cmd{nocite}\marg{citation} 命令;而 \cmd{nocite}\marg*{*} 则让所有未被引用的文献都列出。
+
+\item \cmdindex{bibliography}
再次,在你需要列出参考文献的位置,使用 \cmd{biblio\-graphy} 命令代替 \env{the\-biblio\-graphy} 环境:
\begin{command}
\cmd{bibliography}\marg{bib-name}
\end{command}
其中 \Arg{bib-name} 是 \hologo{BibTeX} 数据库的文件名,\textbf{不要带 \texttt{.bib} 扩展名}。
+\end{enumerate}
\begin{sourcecode}[htp]
\begin{Verbatim}
@@ -136,13 +179,13 @@ Partl~\cite{pa} has proposed that \ldots
\bibliographystyle{plain}
\begin{document}
\section{Some words}
-Some excellent books, for example, \cite{Lamport1994}
-and \cite{Mittelbach2004} \ldots
+Some excellent books, for example, \cite{citation1}
+and \cite{citation2} \ldots
\bibliography{books}
\end{document}
\end{Verbatim}
-\caption{利用 \texttt{books.bib} 生成参考文献的源代码 \texttt{demo.tex}。}
+\caption{利用 \texttt{books.bib} 生成参考文献的源代码 \texttt{demo.tex}。}\label{code:bibtex-demo}
\end{sourcecode}
注意:\cmd{bibliographystyle} 和 \cmd{bibliography} 命令缺一不可,没有这两个命令,使用 \hologo{BibTeX} 生成参考文献列表的时候会报错。
@@ -150,26 +193,26 @@ and \cite{Mittelbach2004} \ldots
第三步:写好了以上两个文件之后,我们就可以开始编译了。
\begin{enumerate}
\item 首先使用 \texttt{pdflatex} 或 \texttt{xelatex} 等命令编译 \LaTeX\ 源代码 \texttt{demo.tex};
- \item 接下来用 \texttt{bibtex} 命令处理 \texttt{demo.aux} 文件记录的参考文献格式、引用条目等信息。
+ \item 接下来用 \texttt{bibtex} 命令处理 \texttt{demo.aux} 辅助文件记录的参考文献格式、引用条目等信息。
\texttt{bibtex} 命令处理完毕后会生成 \texttt{demo.bbl} 文件,内容就是一个 \env{thebibliography} 环境;
\item 再使用 \texttt{pdflatex} 或 \texttt{xelatex} 等命令把源代码 \texttt{demo.tex} 编译\textbf{两遍},读入参考文献并正确生成引用。
\end{enumerate}
整个过程使用的命令如下(可以略去扩展名):
\begin{verbatim}
-pdflatex demo
+xelatex demo
bibtex demo
-pdflatex demo
-pdflatex demo
+xelatex demo
+xelatex demo
\end{verbatim}
使用 \texttt{latex + dvipdfmx} 命令编译时,则 \texttt{dvipdfmx} 命令放在最后,相当于先后使用
\texttt{latex}, \texttt{bibtex}, \texttt{latex}, \texttt{latex}, \texttt{dvipdfmx}。
-\subsection{\pkg{natbib} 宏包}
+\subsection{\pkg{natbib} 宏包}\label{subsec:natbib}
\pkgindex{natbib}
-时下许多学术期刊比较喜欢使用人名——年份的引用方式,形如(\emph{Alice et~al.}, 2005)。
+时下许多学术期刊比较喜欢使用人名——年份的引用方式,形如(\emph{Alice et~al.}, 2013)。
\pkg{natbib} 宏包提供了对这种“自然”引用方式的处理。
\cmdindex[natbib]{citep,citet}
@@ -179,7 +222,7 @@ pdflatex demo
\cmd{citet}\marg{citation}
\end{command}
-它们分别生成形如(\emph{Alice et~al.}, 2005) 和 \emph{Alice et~al.}(2005) 的人名——年份引用。
+它们分别生成形如(\emph{Alice et~al.}, 2013) 和 \emph{Alice et~al.} (2013) 的人名——年份引用。
\pkg{natbib} 宏包同样也支持数字引用,并且支持将引用的序号压缩,例如:
\begin{verbatim}
@@ -187,7 +230,7 @@ pdflatex demo
\end{verbatim}
调用 \pkg{natbib} 宏包时指定以上选项后,连续引用多篇文献时,会生成形如 (3-7) 的引用而不是 (3, 4, 5, 6, 7)。
-\pkg{natbib} 宏包还有更多选项和用法,比如默认的引用是用小括号包裹的,可以为宏包添加 \texttt{square} 选项改为中括号;
+\pkg{natbib} 宏包还有更多选项和用法,比如默认的引用是用小括号包裹的,可指定 \texttt{square} 选项改为中括号;
再比如 \cmd{citep} 命令也支持可选参数,为引用前后都添加额外内容。这里不再赘述,请参考 \pkg{natbib} 宏包的帮助文档。
\section{索引和 makeindex 工具}\label{sec:index}
@@ -216,7 +259,7 @@ pdflatex demo
第三步,编译过程:
\begin{enumerate}
- \item 首先用 \texttt{pdflatex} 等命令编译源代码 \texttt{demo.tex}。编译过程中产生索引记录文件 \texttt{demo.idx};
+ \item 首先用 \texttt{xelatex} 等命令编译源代码 \texttt{demo.tex}。编译过程中产生索引记录文件 \texttt{demo.idx};
\item 用 makeindex 程序处理 \texttt{demo.idx},生成用于排版的索引列表文件 \texttt{demo.ind};
\item 再次编译源代码 \texttt{demo.tex},正确生成索引列表。
\end{enumerate}
@@ -266,7 +309,7 @@ pdflatex demo
\end{tabular}
\end{table}
-读者可以钻研一下下面给出的一个较为复杂的,结合多级索引、索引格式、页码格式等的示例。但在自己使用时,
+读者可以钻研一下以下给出的一个较为复杂的,结合多级索引、索引格式、页码格式等的用法示例。但在自己使用时,
最好还是遵循“简单的就是最好的”原则,尽量使用表 \ref{tbl:index-entry} 中的写法。
\begin{verbatim}
Test index.
@@ -282,7 +325,7 @@ Test index.
\pinyinindex{yanse}{颜色}
\LaTeX\ 原生不支持颜色,它依赖 \pkg{color} 宏包或者 \pkg{xcolor} 宏包,给 PDF 输出生成颜色的特殊指令。
-\subsection{颜色的表达方式}
+\subsection{颜色的表达方式}\label{subsec:color-code}
\pkgindex{color}
\cmdindex[color/xcolor]{color}
@@ -352,10 +395,11 @@ Test index.
\cmd{definecolor}\marg{color-name}\marg{color-mode}\marg{code}
\end{command}
-如果调用 \pkg{color} 或 \pkg{xcolor} 宏包时指定 \texttt{dvipsnames} 选项,就有额外的 68 种颜色名称可用。
+如果调用 \pkg{color} 或 \pkg{xcolor} 宏包时指定 \texttt{dvipsnames} 选项,就有额外的 68 种颜色名称可用%
+\footnote{\pkg{color} 宏包实际要指定 \texttt{dvipsnames} 和 \texttt{usenames} 选项。}。
\pkg{xcolor} 宏包还支持通过指定其它选项载入更多颜色名称。限于篇幅不展开介绍,详情请参考 \pkg{xcolor} 宏包的手册。
-\subsection{带颜色的文本和盒子}
+\subsection{带颜色的文本和盒子}\label{subsec:colorbox}
原始的 \cmd{color} 命令类似于字体命令 \cmd{bfseries},它使之后排版的内容全部变成指定的颜色,
所以直接使用时通常要加花括号分组。\pkg{color} / \pkg{xcolor} 宏包都定义了一些方便用户使用的带颜色元素。
@@ -413,12 +457,50 @@ PDF 文档格式是现今最流行的电子文档格式,而电子文档最实
而 \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}
\end{command}
+\begin{table}[htp]
+\centering
+\caption{\pkg{hyperref} 宏包提供的参数设置。}\label{tbl:hyperref-settings}
+\begin{tabular}{lcp{19.5em}}
+ \hline
+ 参数 & 默认值 & \multicolumn{1}{c}{含义} \\
+ \hline
+ \texttt{colorlinks=}\Arg{true\textnormal|false}
+ & \textit{false} & 设置为 \textit{true} 为链接文字带颜色,反之加上带颜色的边框 \\
+ \texttt{hidelinks} & & 取消链接的颜色和边框 \\
+ \texttt{pdfborder=}\marg*{\Arg{n} \Arg{n} \Arg{n}}
+ & 0 0 1 & 超链接边框设置,设为 0 0 0 可取消边框 \\
+ \hline
+ \texttt{bookmarks=}\Arg{true\textnormal|false}
+ & \textit{true} & 是否生成书签 \\
+ \texttt{bookmarksopen=}\Arg{true\textnormal|false}
+ & \textit{false} & 是否展开书签 \\
+ \texttt{bookmarksnumbered=}\Arg{true\textnormal|false}
+ & \textit{false} & 书签是否带章节编号 \\
+ \texttt{CJKbookmarks=}\Arg{true\textnormal|false}
+ & \textit{false} & 使用 \pkg{CJK} 宏包/ GBK 编码排版中文时必须设定的参数,
+ 在第一次编译后需要将生成的 \texttt{.out} 文件用工具处理编码 \\
+ \texttt{unicode} & & 使用 \pkg{CJKutf8} 宏包/ UTF-8 编码排版中文时必须设定的参数 \\
+ \hline
+ \texttt{pdftitle=}\Arg{string}
+ & 空 & 标题 \\
+ \texttt{pdfauthor=}\Arg{string}
+ & 空 & 作者 \\
+ \texttt{pdfsubject=}\Arg{string}
+ & 空 & 主题 \\
+ \texttt{pdfkeywords=}\Arg{string}
+ & 空 & 关键词 \\
+ \texttt{pdfstartview=}\Arg{Fit\textnormal|FitH\textnormal|FitV}
+ & \textit{Fit} & 设置 PDF 页面以适合页面/适合宽度/适合高度等方式显示,默认为适合页面 \\
+ \hline
+\end{tabular}
+\end{table}
+
\subsection{超链接}\label{subsec:url-href}
\cmdindex[hyperref]{url,nolinkurl}
@@ -451,8 +533,8 @@ PDF 文档格式是现今最流行的电子文档格式,而电子文档最实
\cmd{hyperref}\oarg{label}\marg{text}
\end{command}
-默认的超链接在文字外边加上一个带颜色的方框(在打印 PDF 时边框不会打印),可指定 \texttt{color\-links} 选项修改为将文字本身加上颜色,
-或指定 \texttt{pdf\-border} 选项的参数;\texttt{hide\-links} 选项则令超链接既不变色也不加框。
+默认的超链接在文字外边加上一个带颜色的边框(在打印 PDF 时边框不会打印),可指定 \texttt{color\-links} 参数修改为将文字本身加上颜色,
+或修改 \texttt{pdf\-border} 参数调整边框宽度以“去掉”边框;\texttt{hide\-links} 参数则令超链接既不变色也不加边框。
\begin{verbatim}
\hypersetup{hidelinks}
% or:
@@ -491,44 +573,7 @@ PDF 文档格式是现今最流行的电子文档格式,而电子文档最实
\subsection{PDF 文档属性}\label{subsec:pdf-settings}
-\pkg{hyperref} 宏包还提供了一些选项用于改变 PDF 文档的属性,部分见表 \ref{tbl:hyperref-settings}。
+\pkg{hyperref} 宏包还提供了一些参数用于改变 PDF 文档的属性,部分见表 \ref{tbl:hyperref-settings}。
-\begin{table}[htp]
-\centering
-\caption{\pkg{hyperref} 宏包提供的设置。}\label{tbl:hyperref-settings}
-\begin{tabular}{lcp{19.5em}}
- \hline
- 选项 & 默认值 & \multicolumn{1}{c}{含义} \\
- \hline
- \texttt{colorlinks=}\Arg{true\textnormal|false}
- & \textit{false} & 设置为 \textit{true} 为链接文字带颜色,反之加上带颜色的边框 \\
- \texttt{hidelinks} & & 取消链接的颜色和边框 \\
- \texttt{pdfborder=}\marg*{\Arg{n} \Arg{n} \Arg{n}}
- & 0 0 1 & 超链接边框设置,设为 0 0 0 可取消边框 \\
- \hline
- \texttt{bookmarks=}\Arg{true\textnormal|false}
- & \textit{true} & 是否生成书签 \\
- \texttt{bookmarksopen=}\Arg{true\textnormal|false}
- & \textit{false} & 是否展开书签 \\
- \texttt{bookmarksnumbered=}\Arg{true\textnormal|false}
- & \textit{false} & 书签是否带章节编号 \\
- \texttt{CJKbookmarks=}\Arg{true\textnormal|false}
- & \textit{false} & 使用 \pkg{CJK} 宏包/ GBK 编码排版中文时必须指定的选项,
- 在第一次编译后需要将生成的 \texttt{.out} 文件用工具处理编码 \\
- \texttt{unicode} & & 使用 \pkg{CJKutf8} 宏包/ UTF-8 编码排版中文时必须指定的选项 \\
- \hline
- \texttt{pdftitle=}\Arg{string}
- & 空 & 标题 \\
- \texttt{pdfauthor=}\Arg{string}
- & 空 & 作者 \\
- \texttt{pdfsubject=}\Arg{string}
- & 空 & 主题 \\
- \texttt{pdfkeywords=}\Arg{string}
- & 空 & 关键词 \\
- \texttt{pdfstartview=}\Arg{Fit\textnormal|FitH\textnormal|FitV}
- & \textit{Fit} & 设置 PDF 页面以适合页面/适合宽度/适合高度等方式显示,默认为适合页面 \\
- \hline
-\end{tabular}
-\end{table}
\endinput \ No newline at end of file
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/chap.07.graphic.tex
index cc711ac878f..9692245611e 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/chap.07.graphic.tex
@@ -1,4 +1,4 @@
-\chapter{绘图功能}
+\chapter{绘图功能}\label{chap:graphics}
\addtocontents{los}{\protect\addvspace{10pt}}
\begin{intro}
@@ -12,18 +12,18 @@
\section{绘图语言简介}\label{sec:pict-lang}
\LaTeX\ 提供了原始的 \env{picture} 环境,能够绘制一些基本的图形如点、线、矩形、圆、B\'ezier 曲线等等,
-不过受制于 \LaTeX\ 本身,它的绘图功能极为有限,效果也往往不够美观。
+不过受制于 \LaTeX\ 本身,它的绘图功能极为有限,效果也不够美观。
现在流行的绘图代码有以下几种:
\begin{itemize}
\item PSTricks \par
- 基于 PostSciprt 绘图方式的宏包,具有优秀的绘图能力。它对老式的 \texttt{latex + dvips} 编译命令支持最好,
+ 以 PostSciprt 语言的功能为基础的绘图宏包,具有优秀的绘图能力。它对老式的 \texttt{latex + dvips} 编译命令支持最好,
而现在的几种编译命令下使用起来都不够方便。
\item \TikZ\ \& \pkg{pgf} \par
- 德国的 Till Tantau 在开发著名的 \LaTeX 幻灯片文档类 \cls{beamer} 时一并开发了绘图宏包 \pkg{pgf},
- 以令绘图语言能够在不同的编译方式下使用,如 \texttt{pdflatex} 和 \texttt{xelatex} 等。
- \TikZ\ 是在 \pkg{pgf} 基础上的一个封装,提供了方便的绘图语言,绘图能力不输 PSTricks。
+ 德国的 Till Tantau 在开发著名的 \LaTeX\ 幻灯片文档类 \cls{beamer} 时一并开发了绘图宏包 \pkg{pgf},
+ 目的是令其能够在 \texttt{pdflatex} 或 \texttt{xelatex} 等不同的编译命令下都能使用。
+ \TikZ\ 是在 \pkg{pgf} 基础上封装的一个宏包,采用了类似 \hologo{METAPOST} 的语法,提供了方便的绘图命令,绘图能力不输 PSTricks。
\item \hologo{METAPOST} \& Asymptote \par
\hologo{METAPOST} 脱胎于高德纳为 \TeX\ 配套开发的字体生成程序 \hologo{METAFONT},
@@ -36,7 +36,7 @@
其复杂程度已远远超出入门手册的范围(\TikZ\ 的帮助文档有上千页之厚)。
对此感兴趣的读者需要自行查阅帮助手册,或者到互联网上参考现成的范例。
-\section{\TikZ}\label{sec:tikz}
+\section{\TikZ\ 绘图语言}\label{sec:tikz}
\index{TikZ@\TikZ}
\pkgindex{tikz}
@@ -46,15 +46,16 @@
\footnote{\texttt{latex + dvipdfmx} 编译方式要在 \pkg{tikz} 宏包之前调用 \pkg{graphicx} 宏包并指定 \texttt{dvipdfmx} 选项。}:
\begin{command}
\cmd{tikz}\oarg*{\ldots} \Arg{tikz code}\texttt{;} \\[1ex]
+\cmd{tikz}\oarg*{\ldots} \marg*{\Arg{tikz code 1}\texttt{;} \Arg{tikz code 2}\texttt{;} \ldots} \\[1ex]
\cmd{begin}\marg*{tikzpicture}\oarg*{\ldots} \\
\Arg{tikz code 1}\texttt{;} \\
-\Arg{tikz code 2}\texttt{;} \\
+\Arg{tikz code 2}\texttt{;}\ldots \\
\ldots \\
\cmd{end}\marg*{tikzpicture}
\end{command}
前一种用法为 \cmd{tikz} 带单条绘图命令,以分号结束,一般用于在文字之间插入简单的图形;
-后一种用法较为常见,使用多条绘图命令,可以在 \env{figure} 等浮动体中使用。
+后两种用法较为常见,使用多条绘图命令,可以在 \env{figure} 等浮动体中使用。
\subsection{\TikZ\ 坐标和路径}\label{subsec:tikz-path}
@@ -78,6 +79,18 @@
\end{tikzpicture}
\end{example}
+坐标的表示形式还包括“垂足”形式:
+\begin{example}
+\begin{tikzpicture}
+\coordinate (S) at (2,2);
+\draw[gray] (-1,2) -- (S);
+\draw[gray] (2,-1) -- (S);
+\draw[red] (0,0) -- (0,0 -| S);
+\draw[blue] (0,0) -- (0,0 |- S);
+\end{tikzpicture}
+\end{example}
+
+
\TikZ\ 最基本的路径为两点之间连线,如 \texttt{(\Arg{$x_1$},\Arg{$y_1$}) -{}- (\Arg{$x_2$},\Arg{$y_2$})},可以连用表示多个连线(折线)。
连续使用连线时,可以使用 \texttt{cycle} 令路径回到起点,生成闭合的路径。
\begin{example}
@@ -101,13 +114,39 @@
\end{example}
\begin{itemize}
- \item 直角、圆弧:
+ \item 直角、圆弧、椭圆弧:
\end{itemize}
\begin{example}
\begin{tikzpicture}
\draw (0,0) |- (1,1);
\draw (1,0) -| (2,1);
\draw (4,0) arc (0:135:1);
+\draw (6,0) arc (0:135:1 and 0.5);
+\end{tikzpicture}
+\end{example}
+
+\begin{itemize}
+ \item 正弦、余弦曲线(四分之一个周期):
+\end{itemize}
+\begin{example}
+\begin{tikzpicture}
+\draw (0,0) sin (1.57,1);
+\draw (0,1) sin (1.57,0);
+\draw (2,1) cos (3.57,0);
+\draw (2,0) cos (3.57,1);
+\end{tikzpicture}
+\end{example}
+
+\begin{itemize}
+ \item 抛物线,用 \texttt{bend} 控制顶点:
+\end{itemize}
+\begin{example}
+\begin{tikzpicture}
+\draw (0,0) parabola (1,2);
+\draw (2,0) parabola
+ bend (2.25,-0.25) (3,2);
+\draw (4,0) parabola
+ bend (4.75,2.25) (5,2);
\end{tikzpicture}
\end{example}
@@ -127,7 +166,7 @@
\end{example}
\begin{itemize}
- \item 网格、函数图像,网格可用 \texttt{step} 选项控制网格大小,函数图像用 \texttt{domain} 选项控制定义域:
+ \item 网格、函数图像,网格可用 \texttt{step} 参数控制网格大小,函数图像用 \texttt{domain} 参数控制定义域:
\end{itemize}
\begin{example}
\begin{tikzpicture}
@@ -154,7 +193,18 @@
绘图参数可作为可选参数用在 \env{tikzpiture} 环境或 \cmd{tikz} 命令时,参数会影响到所有具体的绘图命令;
用在单个绘图命令 \cmd{draw}、\cmd{filldraw} 等时,只对这个命令起效。
-\TikZ 有数不清的绘图参数,这些参数令 \TikZ\ 能够绘制丰富多彩的图像,同时也令 \TikZ\ 易学难精。
+\envindex[tikz]{scope}
+\TikZ\ 还提供了 \env{scope} 环境,令一些绘图参数在局部起效:
+\begin{example}
+\begin{tikzpicture}
+\draw (0,0) rectangle (2.5, 2.5);
+\begin{scope}[fill=gray,scale=0.5]
+\filldraw (0,0) rectangle (2.5, 2.5);
+\end{scope}
+\end{tikzpicture}
+\end{example}
+
+\TikZ\ 有数不清的绘图参数,这些参数令 \TikZ\ 能够绘制丰富多彩的图像,同时也令 \TikZ\ 难以精通。
本手册仅总结常用的一些绘图参数,见表 \ref{tbl:tikz-options}。
\begin{table}[htp]
@@ -166,7 +216,7 @@
为线条(\cmd{draw})或填充(\cmd{fill})指定颜色,\Arg{color} 使用颜色名或是 \pkg{xcolor} 的混合颜色语法。
往往可以不写 \texttt{color=} 直接写颜色名称。
\item \texttt{fill=\Arg{color} / draw=\Arg{color}} \par
- 分别给 \cmd{filldraw} 指定填充和描边的颜色。也可分别给 \cmd{fill} 和 \cmd{draw} 命令使用。
+ 分别给 \cmd{filldraw} 指定填充和描边的颜色。也可给 \cmd{fill} 和 \cmd{draw} 命令使用。
不带参数直接使用 \texttt{fill} 和 \texttt{draw},相当于用默认颜色。
\end{itemize}
\hrule
@@ -180,7 +230,7 @@
\item \texttt{help lines} \par
指定线条为辅助线,相当于 \texttt{line width=0.2pt,gray}。
\item \texttt{solid / dashed / dotted / dash dot / dash dot dot / \dots} \par
- 指定线条类型(实现、虚线等)。
+ 指定线条类型(实线、虚线等)。
\item \texttt{rounded corners} \par
将路径转向处绘制成圆角。可写成 \texttt{rounded corners=\Arg{radius}} 使用给定的半径。
\end{itemize}
@@ -210,6 +260,8 @@
\begin{command}
\cmd{node}\oarg{options} \texttt{(\Arg{name})} \texttt{at (\Arg{coordinate})} \marg{text}\texttt{;}
\end{command}
+\texttt{(\Arg{name})} 为结点命名,类似 \cmd{coordinate};\texttt{at (\Arg{coordinate})} 指定结点的位置。
+这两者和前面的 \Arg{options} 都可以省略,只有 \Arg{text} 是必填的。
\begin{example}
\begin{tikzpicture}
\node (A) at (0,0) {A};
@@ -228,7 +280,8 @@
\begin{itemize}
\item \texttt{anchor=\Arg{position}} \par
指定结点的某个角落 \Arg{position} 位于给定的位置 \Arg{coordinate}。
- \item \texttt{center/ above / below / left / right / above left / \ldots} \par
+ 参数 \Arg{position} 用 \texttt{center}、\texttt{north}、\texttt{north west} 等形式表示。
+ \item \texttt{centered / above / below / left / right / above left / \ldots} \par
指定结点相对于 \Arg{coordinate} 的位置,\texttt{anchor=\Arg{position}} 的等效写法。\texttt{above} 相当于 \texttt{anchor=south},以此类推。
带参数的形式 \texttt{above=\Arg{length}} 指定节点相对于 \Arg{coordinate} 的距离。
\item \texttt{shape=\Arg{shape}} \par
@@ -246,7 +299,7 @@
\hrule
\end{table}
-\cmd{node} 命令不仅为文字结点的位置命名(类似 \cmd{coordinate} 命令),在 \cmd{draw} 等命令中还可以使用某个结点的相对位置,
+\cmd{node} 命令不仅为文字结点的位置命名,在 \cmd{draw} 等命令中还可以使用某个结点的相对位置,
以“东南西北”的方式命名:
\begin{example}
@@ -271,8 +324,8 @@
\end{tikzpicture}
\end{example}
-除了 \cmd{node} 命令之外,\cmd{coordinate} 也可以通过参数为某个位置添加文字。
-我们最后举一个较为复杂的例子,综合前面介绍过的各种路径、形状、文字结点和参数设置。
+除了 \cmd{node} 命令之外,\cmd{coordinate} 也可以通过参数为某个位置添加文字(label)。
+在此举一个较为复杂的例子,综合前面介绍过的各种路径、形状、文字结点和参数设置。
\begin{sourcecode}[htp]
\begin{Verbatim}
@@ -281,8 +334,8 @@
\draw[-stealth,line width=0.2pt] (0,-0.5) -- (0,2.5);
\coordinate (a) at (0.5,1.9);
\coordinate (b) at (4,1.2);
-\coordinate[label=below:$a$] (a0) at (0.5,0);
-\coordinate[label=below:$b$] (b0) at (4,0);
+\coordinate[label=below:$a$] (a0) at (a |- 0,0);
+\coordinate[label=below:$b$] (b0) at (b |- 0,0);
\filldraw[fill=gray!20,draw,thick]
(a0) -- (a) .. controls (1,2.8) and (2.7,0.4) .. (b) -- (b0) -- cycle;
\node[above right,outer sep=0.2cm, rounded corners,
@@ -296,8 +349,8 @@
\draw[-stealth,line width=0.2pt] (0,-0.5) -- (0,2.5);
\coordinate (a) at (0.5,1.9);
\coordinate (b) at (4,1.2);
-\coordinate[label=below:$a$] (a0) at (0.5,0);
-\coordinate[label=below:$b$] (b0) at (4,0);
+\coordinate[label=below:$a$] (a0) at (a |- 0,0);
+\coordinate[label=below:$b$] (b0) at (b |- 0,0);
\filldraw[fill=gray!20,draw,thick]
(a0) -- (a) .. controls (1,2.8) and (2.7,0.4) .. (b) -- (b0) -- cycle;
\node[above right,outer sep=0.2cm, rounded corners,
@@ -306,4 +359,38 @@
\end{tikzpicture}
\end{center}
\caption{\TikZ\ 绘图示例源代码和效果。}\label{code:tikz-example}
-\end{sourcecode} \ No newline at end of file
+\end{sourcecode}
+
+\subsection{在 \TikZ\ 中使用循环}
+
+\cmdindex[tikz]{foreach}
+\TikZ\ 通过 \pkg{pgffor} 功能宏包实现了简单的循环功能,语法为:
+\begin{command}
+\cmd{foreach} \cmd{a} \texttt{in} \marg{list} \marg{commands}
+\end{command}
+上述语法定义了 \cmd{a} 为变量,在 \marg{commands} 中使用 \cmd{a} 完成循环。
+
+\Arg{list} 可以直接将所有值写出来,如 1,2,3,4;也可以写成省略形式,如 1,2,\ldots,10。
+\begin{example}
+\begin{tikzpicture}
+\draw (0,0)--(5,0);
+\foreach \i in {0.0,0.1,...,5.0}
+ {\draw[very thin]
+ (\i,0)--(\i,0.15);}
+\foreach \I in {0,1,2,3,4,5}
+ {\draw (\I,0)--(\I,0.25)
+ node[above] {\I};}
+\end{tikzpicture}
+\end{example}
+
+\cmd{foreach} 还可使用变量对参与循环:
+\begin{example}
+\begin{tikzpicture}
+\foreach \n/\t in
+ {0/\alpha,1/\beta,2/\gamma}
+ {\node[circle,fill=lightgray,draw]
+ at (\n,0) {$\t$};}
+\end{tikzpicture}
+\end{example}
+
+\endinput \ No newline at end of file
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/chap.08.custom.tex
index 1990ebf61c4..bfcdb787a44 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/chap.08.custom.tex
@@ -1,4 +1,4 @@
-\chapter{自定义 \LaTeX\ 命令和功能}
+\chapter{自定义 \LaTeX\ 命令和功能}\label{chap:custom}
\addtocontents{los}{\protect\addvspace{10pt}}
\begin{intro}
@@ -10,7 +10,7 @@
不过作为入门手册,这些知识仍是不全面的。如果你不满足于此,需要参考更多资料,比如 \cite{companion,clsguide}。
\end{intro}
-\section{自定义命令和环境}\label{sec:newcommands}
+\section{自定义命令和环境}\label{sec:defs}
你也许已经意识到了,在本手册中介绍的所有命令都被包含在一个带颜色的矩形背景框中。
笔者并没有直接使用基础的 \LaTeX\ 命令来实现这个效果,而是创建了一个\textbf{宏包},
@@ -25,10 +25,10 @@
这个例子中使用了一个新的环境 \env{command}。这个环境负责给命令代码加上一个带颜色的矩形背景框。
同时还使用了一个命令:\cmd{cmd}, 这个命令负责输出命令的名字,包括前面的反斜杠。
-一旦笔者想要修改命令代码的央视,比如更换颜色、加边框等等,可以通过改变 \env{command} 环境的定义来很容易地创建新的外观,
+一旦笔者想要修改命令代码的样式,比如更换颜色、加边框等等,可以通过改变 \env{command} 环境的定义来很容易地创建新的外观,
而不是挨个修改每个命令示例。
-\subsection{定义新命令}
+\subsection{定义新命令}\label{subsec:newcmd}
\cmdindex{newcommand}
使用如下命令可以定义你自己的命令:
@@ -73,7 +73,7 @@ This is ``\tnss'' \ldots{}
在某些情况之下,你可能会希望使用 \cmd{pro\-vide\-comm\-and} 命令。在命令不存在时,它相当于 \cmd{new\-comm\-and}
;在命令已经存在时,仍沿用存在的定义。
-\subsection{定义环境}
+\subsection{定义环境}\label{subsec:newenv}
\cmdindex{newenvironment}
与 \cmd{new\-comm\-and} 命令类似,有一个命令用于定义新的环境。这个命令是 \cmd{new\-environ\-ment},它的语法如下所示:
@@ -103,9 +103,9 @@ My humble subjects \ldots
不会不小心新建重名的环境。如果你确实希望改变一个现有的环境,你可以使用命令
\cmd{re\-new\-environ\-ment},它使用和命令 \cmd{new\-environ\-ment} 相同的语法。
-\section{编写自己的宏包和文档类}
+\section{编写自己的宏包和文档类}\label{sec:packages}
-\subsection{编写简单的宏包}
+\subsection{编写简单的宏包}\label{subsec:provide-pkg}
\cmdindex{usepackage}
如果你定义了很多新的环境和命令,你的文档的导言区将变得相当长,在这种情况下,好的方式是
@@ -132,11 +132,11 @@ My humble subjects \ldots
\cmd{ProvidesPackage}\marg{package name}
\end{command}
这个命令应该放在你的宏包的最前面,并且一定要注意:\textbf{\Arg{package name} 需要和宏包的文件名一致。}
-\cmd{Provides\-Package} 让 \LaTeX\ 记录宏包的名称,从而在你尝试再次调用同一个宏包的时候忽略后面的引入%
+\cmd{Provides\-Package} 让 \LaTeX\ 记录宏包的名称,从而在你尝试再次调用同一个宏包的时候忽略后面的调用%
\footnote{但如果你以\emph{不同的选项}多次引入宏包,则有可能会引起错误,见附录 \ref{sec:errors}。}。
源代码 \ref{code:package} 给出了一个小的宏包示例,其中包含了我们之前定义的一些命令。
-\subsection{在宏包中调用其它宏包}
+\subsection{在宏包中调用其它宏包}\label{subsec:require-pkg}
\cmdindex{RequirePackage}
如果你想进一步把各种宏包的功能汇总到一个文件里,而不是在文档的导言区罗列一大堆宏包的话,
@@ -146,7 +146,7 @@ My humble subjects \ldots
\cmd{RequirePackage}\oarg{options}\marg{package name}
\end{command}
-\subsection{编写自己的文档类}
+\subsection{编写自己的文档类}\label{subsec:provide-cls}
\cmdindex{ProvidesClass}
当你更进一步,需要编写自己的文档类,如论文模板等,问题就稍稍麻烦了一些。首先,自己的文档类以 \texttt{.cls} 作扩展名,开头使用
@@ -178,7 +178,7 @@ My humble subjects \ldots
\cmd{newcounter}\marg{counter name}\oarg{parent counter name}
\end{command}
-\Arg{counter name} 为计数器的名称,可选参数 \Arg{parent counter name} 定义为 \Arg{counter name} 的上级计数器。
+\Arg{counter name} 为计数器的名称。计数器可以有上下级的关系,可选参数 \Arg{parent counter name} 定义为 \Arg{counter name} 的上级计数器。
\cmdindex{setcounter,addtocounter,stepcounter}
以下命令修改计数器的数值,\cmd{set\-counter} 将数值设为 \Arg{number};\cmd{add\-to\-counter} 将数值加上 \Arg{number};
@@ -201,19 +201,21 @@ My humble subjects \ldots
命令 \cmd{Alph} 控制计数器 \Arg{counter} 的值以大写字母形式显示。下表列出所有可用于修改计数器格式的命令。
注意:这些命令\textbf{只能用于计数器,不能直接用于数字},如 \cmd{roman}\marg*{1} 这样的命令会出错。
\begin{center}
-\begin{tabular}{cl}
+\begin{tabular}{lp{12em}l}
\hline
- \cmd{arabic} & 阿拉伯数字(默认) \\
- \cmd{alph} & 小写字母 \\
- \cmd{Alph} & 大写字母 \\
- \cmd{roman} & 小写罗马数字 \\
- \cmd{Roman} & 大写字母 \\
- \cmd{fnsymbol} & 一系列符号,用于标题页生成的脚注中 \\
+ \textbf{命令} & \textbf{样式} & \textbf{备注} \\
+ \hline
+ \cmd{arabic} & 阿拉伯数字(默认) & \\
+ \cmd{alph} & 小写字母 & 限 0-26 \\
+ \cmd{Alph} & 大写字母 & 限 0-26 \\
+ \cmd{roman} & 小写罗马数字 & 限正数 \\
+ \cmd{Roman} & 大写罗马数字 & 限正数 \\
+ \cmd{fnsymbol} & 一系列符号,用于 \cmd{thanks} 命令生成的脚注 & 限 0-9 \\
\hline
\end{tabular}
\end{center}
-计数器的值还可以利用其它字符,甚至其它计数器的值与之组合。如标准文档类里对 \cmd{sub\-section} 相关的计数器的输出格式的定义相当于:
+计数器的输出格式还可以利用其它字符,甚至其它计数器的输出格式与之组合。如标准文档类里对 \cmd{sub\-section} 相关的计数器的输出格式的定义相当于:
\begin{verbatim}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\end{verbatim}
@@ -222,44 +224,120 @@ My humble subjects \ldots
\begin{itemize}
\item 我们当然早就意识到了,所有章节命令 \cmd{chapter}、\cmd{section} 等分别对应计数器 chapter、section 等等,而且有上下级的关系。
-而计数器 part 是独立的。
+ 而计数器 part 是独立的。
\item 有序列表 \env{enumerate} 的各级计数器为 enumi, enumii, enumiii, enumiv,也是有上下级的关系。
\item 图表浮动体的计数器就是 table 和 figure;公式的计数器为 equation。
- 这些计数器在 \cls{article} 文档类中是独立的,而在 \cls{book} 和 \cls{report} 中以 chapter 为上级计数器。
+ 这些计数器在 \cls{article} 文档类中是独立的,而在 \cls{book} 和 \cls{report} 中以 chapter 为上级计数器。
\item 页码、脚注的计数器分别是 page 和 footnote。
\end{itemize}
+我们可以利用前面介绍过的命令,修改计数器的样式以达到想要的效果,比如把页码修改成大写罗马字母,左右加横线,或是给脚注加上方括号:
+\begin{verbatim}
+\renewcommand\thepage{--~\Roman{page}~--}
+\renewcommand\thefootnote{[\arabic{footnote}]}
+\end{verbatim}
+
\cmdindex{pagenumbering}
-我们可以利用前面介绍过的命令,修改计数器的样式以达到想要的效果,比如把页码修改成大写罗马字母,或是给脚注加上方括号。
-修改页码的样式有个更方便的命令 \cmd{page\-number\-ing}:
+如果只是简单将计数器输出格式应用到页码上的话,有个更方便的命令 \cmd{page\-number\-ing}:
\begin{verbatim}
\pagenumbering{Roman}
-\renewcommand\thefootnote{[\arabic{footnote}]}
\end{verbatim}
+不过它在修改 page 计数器输出格式的同时,还将计数器的值改为 1,令修改后的页码总是从 1 开始。\cls{book} 文档类的
+\cmd{frontmatter} 和 \cmd{mainmatter} 等都用了 \cmd{pagenumbering} 命令。
最后介绍两个有用的计数器:
+\subsubsection{secnumdepth}
+
+\index{secnumdepth@secnumdepth (\textit{计数器})}
+\LaTeX\ 标准文档类对章节划分了层级:
\begin{itemize}
- \item secnumdepth \index{secnumdepth@secnumdepth (\textit{计数器})}
+ \item 在 \cls{article} 文档类里 part 为 0,section 为 1,依此类推;
+ \item 在 \cls{report}/\cls{book} 文档类里 part 为 -1,chapter 为 0,section 为 1,等等。
+\end{itemize}
+
+secnumdepth 计数器控制章节编号的深度,如果章节的层级大于 secnumdepth,那么章节的标题、在目录和页眉页脚的标题都不编号
+(照常生成目录和页眉页脚),章节计数器也不计数。
+
+可以用 \cmd{setcounter} 命令设置 secnumdepth 为较大的数使得层级比较深的章节也编号,
+如设置为 4 令 \cmd{paragraph} 也编号;或者设置一个较小的数以取消编号,如设置为 -1 令 \cmd{chapter} 不编号。
+后者是生成不编号的章节的一个妙招,免去了手动使用 \cmd{add\-contents\-line} 和 \cmd{mark\-both} 的麻烦。
- \LaTeX\ 内部对章节规定了层级:
- \begin{itemize}
- \item 在 \cls{article} 文档类里 part 为 0,section 为 1,依此类推;
- \item 在 \cls{report}/\cls{book} 文档类里 part 为 -1,chapter 为 0,section 为 1,等等。
- \end{itemize}
+secnumdepth 计数器在 \cls{article} 文档类里默认为 3 (subsubsection 一级);在 \cls{report} 和 \cls{book} 文档类里默认为 2 (subsection 一级)。
- secnumdepth 计数器控制章节编号的深度,如果章节的层级大于 secnumdepth,那么章节的标题、在目录和页眉页脚的标题都不编号
- (照常生成目录和页眉页脚),章节计数器也不计数。
+\subsubsection{tocdepth}
- 可以用 \cmd{setcounter} 命令设置 secnumdepth 为较大的数使得层级比较深的章节也编号,
- 如设置为 4 令 \cmd{paragraph} 也编号;或者设置一个较小的数以取消编号,如设置为 -1 令 \cmd{chapter} 不编号。
- 后者是生成不编号的章节的一个妙招,免去了手动使用 \cmd{add\-contents\-line} 和 \cmd{mark\-both} 的麻烦。
+\index{tocdepth@tocdepth (\textit{计数器})}
+tocdepth 计数器控制目录的深度,如果章节的层级大于 tocdepth,那么章节将不会自动写入目录项。默认值同 secnumdepth。
- secnumdepth 计数器在 \cls{article} 文档类里默认为 3 (subsubsection 一级);在 \cls{report} 和 \cls{book} 文档类里默认为 2 (subsection 一级)。
+\section{\LaTeX\ 可定制的一些命令和参数}\label{sec:latex-settings}
- \item tocdepth \index{tocdepth@tocdepth (\textit{计数器})}
+\LaTeX\ 事实上有相当一些可以定制的命令和参数,不过对于修改样式或者开发宏包来说,这些定制项还远远不够。
- tocdepth 计数器控制目录的深度,如果章节的层级大于 tocdepth,那么章节将不会自动写入目录项。默认值同 secnumdepth。
+对于用户来讲,容易定制的是这一些项目:
+
+\begin{itemize}
+ \item 标题名称/前后缀等。表 \ref{tbl:latex-settings-names} 列出了标准文档类里可定制的项目,
+ 表中所有的 \LaTeX\ 命令都可以用 \cmd{re\-new\-comm\-and} 来修改。
+ \item 长度。前文在叙述各种排版元素时已经涉及到一些,现归纳于表 \ref{tbl:latex-settings-lengths}。
+ 表中所有的长度命令可用 \cmd{setlength} 来修改。
+ 大多数控制页面尺寸的长度参数在图 \ref{fig:layouts} 给出,此处不再赘述。
\end{itemize}
+\begin{table}[htbp]
+\centering
+\caption{\LaTeX\ 可定制的标题名称/前后缀。}\label{tbl:latex-settings-names}
+\small
+\begin{tabularx}{\textwidth}{llX}
+ \hline
+ \textsf{命令} & \textsf{默认值} & \textsf{含义} \\
+ \hline
+ \cmd{partname} & Part & \cmd{part} 命令生成的标题前缀 \\
+ \cmd{chaptername} & Chapter & \cmd{chapter} 命令生成的标题前缀 \\
+ \cmd{appendixname} & Appendix & 使用 \cmd{appendix} 命令生成的附录部分的章标题前缀 \\
+ \cmd{abstractname} & Abstract & 摘要环境 \env{abstract} 的标题名称 \\[1ex]
+ \cmd{contentsname} & Contents & \cmd{tableofcontents} 命令生成的目录标题 \\
+ \cmd{listfigurename} & List of Figures & \cmd{listoffigures} 命令生成的插图目录标题 \\
+ \cmd{listtablename} & List of Tables & \cmd{listoftables} 命令生成的表格目录标题 \\[1ex]
+ \cmd{tablename} & Table & \env{table} 浮动体中 \cmd{caption} 命令生成的标题前缀 \\
+ \cmd{figurename} & Figure & \env{figure} 浮动体中 \cmd{caption} 命令生成的标题前缀 \\[1ex]
+ \cmd{refname} & References & \env{thebibliography} 环境或 \cmd{biblio\-graphy}
+ 命令生成的参考文献标题(\cls{article} 文档类) \\
+ \cmd{bibname} & Bibliography & \env{thebibliography} 环境或 \cmd{biblio\-graphy}
+ 命令生成的参考文献标题(\cls{book / report} 文档类)\\
+ \cmd{indexname} & Index & \cmd{printindex} 命令生成的索引标题 \\
+ \hline
+\end{tabularx}
+\begin{quotation}\footnotesize%
+注:形如“第 X 章”和“第 X 部分”的中文章节标题不能直接由修改本表的命令得到,需要使用 \pkg{titlesec} 等宏包定制。
+如果使用 \pkg{ctex} 宏包或文档类,那么标题默认被修改成“第 X 章”和“第 X 部分”的形式,本表中的其它标题也修改为中文标题。详见 \pkg{ctex} 宏包的帮助手册。
+\end{quotation}
+\end{table}
+
+\begin{table}[htbp]
+\centering
+\caption{\LaTeX\ 可定制的长度参数。}\label{tbl:latex-settings-lengths}
+\small
+\begin{tabularx}{\textwidth}{ll@{pt\hskip2\tabcolsep}X}
+ \hline
+ \textsf{命令} & \multicolumn{1}{l@{\hskip2\tabcolsep}}{\textsf{默认值}} & \textsf{含义} \\
+ \hline
+ \cmd{fboxrule} & 0.4 & \cmd{fbox} 或 \cmd{framebox} 等带框盒子的线宽 \\
+ \cmd{fboxsep} & 3 & \cmd{fbox} 或 \cmd{framebox} 等带框盒子的内边距 \\[1ex]
+ \cmd{arraycolsep} & 5 & \env{array} 环境的表格项前后的间距 \\
+ \cmd{tabcolsep} & 6 & \env{tabular} 环境的表格项前后的间距 \\
+ \cmd{arrayrulewidth} & 0.4 & 表格线宽 \\
+ \cmd{doublerulesep} & 2 & 连续两根表格线之间的间距 \\[1ex]
+ \cmd{abovecaptionskip} & 10 & \cmd{caption} 命令位于图表下方时,与上方图表的间距 \\
+ \cmd{belowcaptionskip} & 0 & \cmd{caption} 命令位于图表上方时,与下方图表的间距 \\[1ex]
+ \cmd{columnsep} & 10 & 双栏排版下两栏的间距 \\
+ \cmd{columnseprule} & 0 & 双栏排版下两栏之间竖线的宽度 \\
+ \hline
+\end{tabularx}
+\begin{quotation}\footnotesize%
+注:\cmd{arraycolsep} 和 \cmd{tabcolsep} 是每个表格项本身前后的间距(表格线前后无间距;\texttt{@} 列格式会消除与前后表格项的间距)。
+两个表格项之间的间距相当于 2\cmd{arraycolsep} 或 2\cmd{tabcolsep}。
+\end{quotation}
+\end{table}
+
\endinput \ No newline at end of file
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/chap/sec.symbol.table.tex
index 46528589fd8..edd0b7d8c3c 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/sec.symbol.table.tex
@@ -15,15 +15,10 @@
\def\SC #1{#1 & \texttt{\string#1}}
-
-\newsavebox{\symbbox}
\newenvironment{symbols}[1]%
- {\def\arraystretch{1.1}
- \begin{lrbox}{\symbbox}
+ {\small\def\arraystretch{1.1}
\begin{tabular}{@{}#1@{}}}%
- {\end{tabular}\end{lrbox}\makebox[\linewidth]{\usebox{\symbbox}}}
-
-\newcount\savesecdepth
+ {\end{tabular}}
\clearpage
\section{符号表}\label{sec:math-tables}
@@ -39,6 +34,7 @@
\symindex{dag,ddag,P,S,copyright,pounds}
\begin{table}[htp]
+\centering
\caption{文本/数学模式通用符号}\label{tbl:general-syms}
\begin{quote}\footnotesize%
这些符号可用于文本和数学模式。
@@ -53,6 +49,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{希腊字母。} \label{tbl:math-greek}
\begin{quote}\footnotesize%
\cmd{Alpha},\cmd{Beta} 等希腊字母符号不存在,因为它们和拉丁字母 A,B 等一模一样;
@@ -79,6 +76,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{二元关系符。} \label{tbl:math-rel}
\begin{quote}\footnotesize%
所有的二元关系符都可以加 \cmd{not} 前缀得到相反意义的关系符,例如 \cmd{not}\texttt{=} 就得到不等号(同 \cmd{ne})。
@@ -104,6 +102,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{二元运算符。}\label{tbl:math-op}
\begin{symbols}{*3{cl}}
\hline
@@ -125,6 +124,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{巨算符。}\label{tbl:math-bigop}
\def\arraystretch{1.8}
\begin{symbols}{*3{ccl}}
@@ -141,6 +141,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{数学重音符号。}\label{tbl:math-accents}
\begin{quote}\footnotesize%
最后一个 \cmd{wideparen} 依赖 \pkg{yhmath} 宏包。
@@ -158,6 +159,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{箭头。} \label{tbl:math-arrows}
\begin{symbols}{*2{cl}}
\hline
@@ -183,6 +185,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{作为重音的箭头符号。} \label{tbl:math-arrow-accents}
\begin{symbols}{*2{cl}}
\hline
@@ -194,6 +197,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{定界符。}\label{tbl:math-delims}
\begin{symbols}{*3{cl}}
\hline
@@ -210,6 +214,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{用于行间公式的大定界符。}\label{tbl:math-large-delims}
\def\arraystretch{1.8}
\begin{symbols}{*3{cl}}
@@ -222,6 +227,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{其他符号。}\label{tbl:math-misc}
\begin{symbols}{*4{cl}}
\hline
@@ -244,6 +250,7 @@
本小节所有符号依赖 \pkg{amssymb} 宏包。
\begin{table}[htp]
+\centering
\caption{\AmS\ 希腊字母和希伯来字母。} \label{tbl:ams-greek-hebrew}
\begin{symbols}{*5{cl}}
\hline
@@ -253,6 +260,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 二元关系符。} \label{tbl:ams-rel}
\begin{symbols}{*3{cl}}
\hline
@@ -283,6 +291,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 二元运算符。} \label{tbl:ams-op}
\begin{symbols}{*3{cl}}
\hline
@@ -299,6 +308,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 箭头。}\label{tbl:ams-arrows}
\begin{symbols}{*2{cl}}
\hline
@@ -322,6 +332,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 反义二元关系符和箭头。}\label{tbl:ams-negative}
\begin{symbols}{*3{cl}}
\hline
@@ -350,6 +361,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 定界符}\label{tbl:ams-delims}
\begin{symbols}{*4{cl}}
\hline
@@ -360,6 +372,7 @@
\end{table}
\begin{table}[htp]
+\centering
\caption{\AmS\ 其它符号。}\label{tbl:ams-misc}
\begin{symbols}{*3{cl}}
\hline
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex
index 68223ab13c7..7a03456356b 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/chap/titlepage.tex
@@ -15,9 +15,9 @@
\linespread{1.67}\selectfont\raggedleft
{\bfseries 原版作者:} Tobias Oetiker\\
Hubert Partl, Irene Hyna and Elisabeth Schlegl \\
- {\bfseries 原版版本:} Version~5.05, July 18, 2015\\[4ex]
+ {\bfseries 原版版本:} Version~\lshortversionoriginal, July 18, 2015\\[4ex]
{\bfseries 中文翻译:} China\TeX\ 论坛\\
- {\bfseries 中文版本:} 版本~5.05,\zhdigits*{\the\year}年\zhnumber{\the\month}月
+ {\bfseries 中文版本:} 版本~\lshortversioncn,\zhdigits*{\the\year}年\zhnumber{\the\month}月
\end{minipage}%
}
diff --git a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-layout.tex b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-layout.tex
index 7bf60e338c5..35734b7260e 100644
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-layout.tex
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/lshort-zh-cn-layout.tex
@@ -1,12 +1,11 @@
+\newif\ifoddsidelayout
+
\expandafter\ifx\csname ver@layout.sty\endcsname\relax
\typeout{Package `layout' not loaded. Command \string\layoutpicture{} will have no effect.}
\def\layoutpicture{\@ifstar\@empty\@empty}
-% \let\oddsidelayouttrue\relax \let\oddsidelayoutfalse\relax
\expandafter\endinput
\fi
-\newif\ifoddsidelayout
-
\newcommand\lay@layoutpic{%
\if@twoside
\ifoddsidelayout
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 6eca77209f6..c0129b950fa 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
@@ -18,17 +18,18 @@
%
% ctex 宏包 2.2(2015/06/24) 或以上版本
% ctex 宏包的字号设定会让许多固定字号的字体宏包报太多 warning,应当抑制
+% 中文正文字体使用 Fandol
%
\RequirePackage[fontset=fandol,zihao=false,scheme=chinese,heading=true]{ctex}[2015/06/24]
%
% 字体和符号宏包
%
-\RequirePackage{lmodern} % 正文字体使用 Latin Modern
+\RequirePackage{lmodern} % 西文正文字体使用 Latin Modern
\RequirePackage{amssymb,latexsym,textcomp,mathrsfs,euscript,yhmath} % 与默认字体不冲突的一些符号包
\RequirePackage[LGR,T1]{fontenc}
-% layout 宏包生成能放入浮动体的命令,手动指定奇偶页的 layout
+% 调整 layout 宏包的命令使之能够放入浮动体,手动指定奇偶页的 layout
\input lshort-zh-cn-layout
\oddsidelayouttrue
% layout 文字汉化
@@ -77,33 +78,48 @@
% 索引依赖 multicols 环境排版
%
\renewenvironment{thebibliography}[1]
- {\chapter{\bibname}%
- \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
- \list{\@biblabel{\@arabic\c@enumiv}}%
- {\settowidth\labelwidth{\@biblabel{#1}}%
- \leftmargin\labelwidth
- \advance\leftmargin\labelsep
- \@openbib@code
- \usecounter{enumiv}%
- \let\p@enumiv\@empty
- \renewcommand\theenumiv{\@arabic\c@enumiv}}%
- \sloppy
- \clubpenalty4000
- \@clubpenalty \clubpenalty
- \widowpenalty4000%
- \sfcode`\.\@m}
- {\def\@noitemerr
- {\@latex@warning{Empty `thebibliography' environment}}%
- \endlist}
+ {\chapter{\bibname%
+ \protect\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}
\renewenvironment{theindex}%
- {\chapter{\indexname}%
- \@mkboth{\MakeUppercase{\indexname}}{\MakeUppercase{\indexname}}
+ {\chapter{\indexname%
+ \protect\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}}
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem
+ \small
\begin{multicols}{2}}
{\end{multicols}}
%
+% 将主目录和源代码目录合并排版
+% 不依赖 float 宏包的 \listof,因此要补充定义 \l@sourcecode
+%
+\renewcommand\tableofcontents%
+ {\chapter{\contentsname%
+ \protect\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
+ \begin{multicols}{2}
+ \@starttoc{toc}%
+ \end{multicols}
+ \@makeschapterhead{\sourcecodename}%
+ \@starttoc{los}%
+}
+
+%
% 令 \cleardoublepage 的偶数页页眉页脚为空
%
\renewcommand{\cleardoublepage}
@@ -127,8 +143,10 @@
%
% PDF 书签中对符号的特殊处理
%
-\pdfstringdefDisableCommands{\def\AmS{AMS}}%
-\pdfstringdefDisableCommands{\def\TikZ{TikZ}}%
+\pdfstringdefDisableCommands{%
+ \def\AmS{AMS}%
+ \def\TikZ{TikZ}%
+}
%
% 示意长度
@@ -162,14 +180,20 @@
\def\ltxcmdindex#1{\@for\@ltxcmd:=#1\do{\index{\@ltxcmd @\cmd{\@ltxcmd}}}}
\def\ltxenvindex#1{\@for\@ltxenv:=#1\do{\index{\@ltxenv @\env{\@ltxenv} 环境}}}
\def\pkgcmdindex[#1]#2{\@for\@pkgcmd:=#2\do{\index{\@pkgcmd @\cmd{\@pkgcmd} (\pkg{#1})}}}
-\def\pkgenvindex[#1]#2{\@for\@pkgcmd:=#2\do{\index{\@pkgcmd @\env{\@pkgcmd} 环境 (\pkg{#1})}}}
+\def\pkgenvindex[#1]#2{\@for\@pkgenv:=#2\do{\index{\@pkgenv @\env{\@pkgenv} 环境 (\pkg{#1})}}}
+
+%
% 文本和数学符号索引
+%
\def\symindex#1{\@for\t@xtsym:=#1\do{\index{\t@xtsym @\cmd{\t@xtsym} (\textit{符号} \expandafter\protect\csname \t@xtsym\endcsname)}}}
\def\mathindex#1{\@for\m@thcmd:=#1\do{\index{\m@thcmd @\cmd{\m@thcmd} (\textit{数学命令})}}}
\def\msymindex#1{\@for\m@thsym:=#1\do{\index{\m@thsym @\cmd{\m@thsym} (\textit{数学符号}$\expandafter\protect\csname \m@thsym\endcsname$)}}}
\def\maccindex#1{\@for\m@thacc:=#1\do{\index{\m@thacc @\cmd{\m@thacc} (\textit{数学重音}$\expandafter\protect\csname \m@thacc\endcsname{a}$)}}}
\def\waccindex#1{\@for\wideacc:=#1\do{\index{\wideacc @\cmd{\wideacc} (\textit{数学重音}$\expandafter\protect\csname \wideacc\endcsname{AB}$)}}}
+
+%
% 拼音索引
+%
\def\pinyinindex#1#2{\index{#1@#2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -190,14 +214,11 @@
\def\arraystretch{1.2}%
\hskip\parindent%
\begin{tabular}{>{\columncolor{blue!5}}l}
- }%
- {\\
- \end{tabular}
- \endtrivlist}
+ }{\end{tabular}\endtrivlist}
%
% 示例环境 example
-% 环境中的代码被 verbatim 环境处理到一个临时文件中
+% 环境中的代码写入临时文件 lshort-zh-cn-example.aux
% 再从临时文件中读取,分别生成代码盒子和示例盒子
%
\newwrite\example@out
@@ -242,7 +263,7 @@
\fvset{fontsize=\small,frame=lines}
\newfloat{sourcecode}{tbp}{los}[chapter]
\floatname{sourcecode}{源代码}
-\def\listofsources{\listof{sourcecode}{源代码示例列表}}
-
+\def\sourcecodename{源代码示例列表}
+\def\l@sourcecode{\@dottedtocline{1}{1.5em}{2.3em}}
\endinput \ No newline at end of file
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 7d616811338..f6bc3f8f7ef 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
@@ -1,6 +1,9 @@
\documentclass[a4paper]{book}
\usepackage{lshort-zh-cn-style}
+\def\lshortversionoriginal{5.05}
+\def\lshortversioncn{5.10}
+
\hypersetup{%
pdftitle={The Not So Short Introduction to LaTeX2e(Chinese Simplified)},%
pdfkeywords={LaTeX, LaTeX2e},
@@ -12,6 +15,8 @@
% 第四章用到的自定义算符
\DeclareMathOperator{\argh}{argh}
\DeclareMathOperator*{\nut}{Nut}
+% 第四章的 \proofname 用原先的英文定义
+\def\proofname{Proof}
\makeindex
@@ -24,7 +29,7 @@
\input{chap/preface.contrib}
\input{chap/preface.overview}
\tableofcontents
-\listofsources
+%\listofsources
\mainmatter
\input{chap/chap.01.basics}
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 686897658a2..fe563c7e171 100755
--- a/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat
+++ b/Master/texmf-dist/doc/latex/lshort-chinese/src/make.bat
@@ -1,24 +1,25 @@
-@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
-
-if "%1"=="clean" goto clean
-
-set TEX=xelatex
-set MODE=-interaction=nonstopmode
-set MAKEINDEX=makeindex
-
-%TEX% %MODE% %LSHORT%
-%MAKEINDEX% -s %LSHORT%.ist %LSHORT%
-%TEX% %MODE% %LSHORT%
-
-if exist %PDF% (
-move %PDF% ..
-start "" "..\%PDF%"
-)
-exit
-
-:clean
-del %TEMP%
-exit
+@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
+
+if "%1"=="clean" goto clean
+
+set TEX=xelatex
+set MODE=-interaction=nonstopmode -synctex=1
+set MAKEINDEX=makeindex
+
+%TEX% %MODE% %LSHORT%
+%MAKEINDEX% -s %LSHORT%.ist %LSHORT%
+%TEX% %MODE% %LSHORT%
+%TEX% %MODE% %LSHORT%
+
+if exist %PDF% (
+move %PDF% ..
+start "" "..\%PDF%"
+)
+exit
+
+:clean
+del %TEMP%
+exit