Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
Fix some typo.
  • Loading branch information
louisstuart96 committed Jun 23, 2016
1 parent 2b40d94 commit 4c0c717
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 40 deletions.
28 changes: 17 additions & 11 deletions src/chap/chap.03.elements.tex
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ \section{标题页}\label{sec:titlepage}
\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}
Expand All @@ -146,6 +148,10 @@ \section{标题页}\label{sec:titlepage}
生成一个简单的标题页了。\cls{article} 文档类的标题默认不单独成页,而 \cls{report} 和 \cls{book} 默认单独成页。
可在 \cmd{document\-class} 命令中指定 \texttt{titlepage / notitlepage} 选项修改。

以上是 \LaTeX\ 标准文档类的标题页实现。在各种文档模板中,标题页的实现方式会根据自身的需要进行修改,
有可能需要除了 \cmd{title} 和 \cmd{author} 以外的命令给定信息,用法也可能与标准文档类的不一致。
使用文档模板前\textbf{一定要仔细阅读文档模板的帮助手册}。

\section{交叉引用}\label{sec:crossref}

\cmdindex{label}
Expand Down Expand Up @@ -283,9 +289,9 @@ \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}
Expand Down Expand Up @@ -364,9 +370,9 @@ \subsection{引用环境}\label{subsec:quote}
\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}

Expand Down
21 changes: 11 additions & 10 deletions src/chap/chap.04.math.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ \section{公式排版基础}\label{sec:math-basics}
数学公式有两种排版方式:其一是与文字混排,称为\textbf{行内公式};其二是单独列为一行排版,称为\textbf{行间公式}。

\pinyinindex{hangneigongshi}{行内公式}
\index{$@\texttt\$ (\textit{数学模式})}
\index{^^d@\texttt\$ (\textit{数学模式})}
行内公式由一对 \texttt\$ 符号包裹:
\begin{example}
Add $a$ squared and $b$ squared
Expand Down Expand Up @@ -409,21 +409,21 @@ \subsection{括号和定界符}
\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}

通常来讲应当避免写出需要折行的长公式。如果一定要折行的话,优先在等号之前折行,其次在加号、减号之前,再次在乘号、除号之前。
通常来讲应当避免写出超过一行而需要折行的长公式。如果一定要折行的话,优先在等号之前折行,其次在加号、减号之前,再次在乘号、除号之前。
其它位置应当避免折行。

\envindex[amsmath]{multline}
Expand Down Expand Up @@ -526,7 +526,7 @@ \section{数组和矩阵}\label{sec:arrays}
\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}{cccc}
Expand Down Expand Up @@ -607,8 +607,9 @@ \section{公式中的间距}\label{sec:math-space}
我们已经认识了两个生成间距的命令 \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$ &
Expand Down
5 changes: 3 additions & 2 deletions src/chap/chap.07.graphic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ \subsection{\TikZ\ 绘图命令和参数}\label{subsec:tikz-draw}
\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}
Expand Down Expand Up @@ -228,7 +228,8 @@ \subsection{\TikZ\ 文字结点}\label{subsec:tikz-node}
\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}、\text{north}、text{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
Expand Down
42 changes: 25 additions & 17 deletions src/chap/chap.08.custom.tex
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ \subsection{编写简单的宏包}
\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} 给出了一个小的宏包示例,其中包含了我们之前定义的一些命令。

Expand Down Expand Up @@ -178,7 +178,7 @@ \subsection{定义和修改计数器}\label{subsec:count-defs}
\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};
Expand All @@ -201,14 +201,16 @@ \subsection{计数器的输出格式}\label{subsec:count-value}
命令 \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}
Expand All @@ -229,13 +231,19 @@ \subsection{\LaTeX\ 中的计数器}\label{subsec:latex-counts}
\item 页码、脚注的计数器分别是 page 和 footnote。
\end{itemize}

我们可以利用前面介绍过的命令,修改计数器的样式以达到想要的效果,比如把页码修改成大写罗马字母,或是给脚注加上方括号:
\begin{verbatim}
\renewcommand\thepage{\Roman{page}}
\renewcommand\thefootnote{[\arabic{footnote}]}
\end{verbatim}

\cmdindex{pagenumbering}
我们可以利用前面介绍过的命令,修改计数器的样式以达到想要的效果,比如把页码修改成大写罗马字母,或是给脚注加上方括号。
修改页码的样式有个更方便的命令 \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} 命令。

最后介绍两个有用的计数器:

Expand Down Expand Up @@ -291,7 +299,7 @@ \section{\LaTeX\ 可定制的一些命令和参数}\label{sec:latex-settings}
\cmd{contentsname} & Contents & \cmd{tableofcontents} 命令生成的目录标题 \\
\cmd{listfigurename} & List of Figures & \cmd{listoffigures} 命令生成的插图目录标题 \\
\cmd{listtablename} & List of Table & \cmd{listoftables} 命令生成的表格目录标题 \\[1ex]
\cmd{refname} & Reference & \env{thebibliography} 环境或 \cmd{biblio\-graphy}
\cmd{refname} & References & \env{thebibliography} 环境或 \cmd{biblio\-graphy}
命令生成的参考文献标题(\cls{article} 文档类) \\
\cmd{bibname} & Bibliography & \env{thebibliography} 环境或 \cmd{biblio\-graphy}
命令生成的参考文献标题(\cls{book / report} 文档类)\\
Expand All @@ -300,7 +308,7 @@ \section{\LaTeX\ 可定制的一些命令和参数}\label{sec:latex-settings}
\end{tabularx}
\begin{quotation}\footnotesize%
注:形如“第 X 章”和“第 X 部分”的中文章节标题不能直接由修改本表的命令得到,需要使用 \pkg{titlesec} 等宏包定制。
如果使用 \pkg{ctex} 宏包或文档类,那么标题默认被修改成中文的形式,并且支持简单的定制。
如果使用 \pkg{ctex} 宏包或文档类,那么标题默认被修改成“第 X 章”和“第 X 部分”的形式,并且支持简单的定制。详见 \pkg{ctex} 宏包的帮助手册
\end{quotation}
\end{table}

Expand All @@ -310,10 +318,10 @@ \section{\LaTeX\ 可定制的一些命令和参数}\label{sec:latex-settings}
\small
\begin{tabularx}{\textwidth}{ll@{pt\hskip2\tabcolsep}X}
\hline
\textsf{命令} & \multicolumn{1}{l}{\textsf{默认值}} & \textsf{含义} \\
\textsf{命令} & \multicolumn{1}{l@{\hskip2\tabcolsep}}{\textsf{默认值}} & \textsf{含义} \\
\hline
\cmd{fboxrule} & 0.4 & 带框盒子的线宽 \\
\cmd{fboxsep} & 3 & 带框盒子的内边距 \\[1ex]
\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 & 表格线宽 \\
Expand All @@ -325,7 +333,7 @@ \section{\LaTeX\ 可定制的一些命令和参数}\label{sec:latex-settings}
\hline
\end{tabularx}
\begin{quotation}\footnotesize%
注:\cmd{arraycolsep} 和 \cmd{tabcolsep} 是每个表格项本身前后的间距(表格线前后无边距\texttt{@} 列格式会消除与前后表格项的间距)。
注:\cmd{arraycolsep} 和 \cmd{tabcolsep} 是每个表格项本身前后的间距(表格线前后无间距\texttt{@} 列格式会消除与前后表格项的间距)。
两个表格项之间的间距相当于 2\cmd{arraycolsep} 或 2\cmd{tabcolsep}。
\end{quotation}
\end{table}
Expand Down

0 comments on commit 4c0c717

Please sign in to comment.