Skip to content

Commit 46b7d3a

Browse files
committed
[chapter01][translated] re-translated the first chapter
2 parents bc84235 + d4a3eba commit 46b7d3a

File tree

2 files changed

+60
-58
lines changed

2 files changed

+60
-58
lines changed

chapter01.tex

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -467,17 +467,19 @@ \section{执行处理器}
467467
%In addition to building lists, this part of the \TeX\ processor
468468
%also performs mode-independent processing, such as
469469
%assignments.
470-
执行处理器用于构建水平、竖直和数学列表
471-
与这些列表相应,执行处理器在水平、竖直和数学模式中运行
472-
这三种模式每种都有`内部的'和`外部的'两个类型
473-
执行处理器在构建列表的过程中,还需要进行一些与模式无关的操作
470+
执行处理器构建水平列表、竖直列表和数学列表
471+
与之相应,执行处理器有三种工作模式:水平模式、竖直模式、数学模式
472+
这三种模式又分别有「内部」和「外部」两种类型
473+
除了构建列表,执行处理器还需要处理一些与模式无关的操作
474474
例如赋值。
475475

476476
%Coming out of the expansion processor is a stream of
477477
%unexpandable tokens to be processed by
478478
%the execution processor.
479479
%\relax From the point of view of the execution processor, this
480480
%stream contains two types of tokens:
481+
执行处理器的输入是展开处理器输出的不可展开记号组成的流。
482+
在执行处理器看来,这条记号流中有两种类型的记号:
481483
%\begin{itemize}
482484
%\item Tokens signalling an assignment (this includes
483485
% macro definitions), and
@@ -488,13 +490,12 @@ \section{执行处理器}
488490
% characters, boxes, and glue. The way they are handled
489491
% depends on the current mode.
490492
%\end{itemize}
491-
执行处理器的输入来自展开处理器的输出,是一个不可展开的记号流。
492-
从执行处理器的角度来看,这条记号流所包含的记号有两种类型:
493493
\begin{itemize}
494-
\item 用于赋值的记号(包括宏定义)以及像 \cs{show}、\cs{aftergroup}
495-
这样执行与模式无关操作的记号。
496-
\item 用于构建列表的记号:字符、盒子和粘连。
497-
对这些记号的处理方式依赖执行处理器当前处于的模式。
494+
\item 触发赋值操作(包括宏定义)的记号,
495+
以及触发与模式无关的其他操作的记号(例如 \cs{show} 和 \cs{aftergroup})。
496+
\item 构建列表的记号:
497+
字符、盒子、粘连。
498+
执行处理器对它们的处理方式根据所处模式的不同而改变。
498499
\end{itemize}
499500

500501
%Some objects can be used in any mode; for instance boxes
@@ -507,11 +508,11 @@ \section{执行处理器}
507508
%if the execution processor
508509
%is in vertical mode when it encounters a character, it will
509510
%switch to horizontal mode.
510-
有些记号可以用于任何模式,例如盒子既可以出现在水平模式、竖直模式,
511-
也可以出现在数学模式中,但是这些对象的作用与效果需要依赖于具体的模式
512-
其他记号是模式专用的,例如字符记号(确切的说是分类码为 11 和 12 的字符记号)%
513-
只能用于水平模式,这意味着:当执行处理器在竖直模式中遇到字符记号时,
514-
便会转入水平模式中工作
511+
有些记号在所有模式下都可用;比如盒子可用于水平、竖直、数学三种模式。
512+
当然,这些记号的作用与效果,根据所处的模式不同而不同
513+
也有记号只在特定模式下可用。
514+
例如说,字符记号(确切说是分类码为 11 和 12 的字符记号)则与水平模式密切相关:
515+
当执行处理器在竖直模式中遇到字符记号时,会切换到水平模式继续工作
515516

516517
%Not all character tokens signal characters to be typeset:
517518
%the execution processor can also encounter math shift
@@ -520,11 +521,11 @@ \section{执行处理器}
520521
%Math shift characters let \TeX\ enter or exit
521522
%math mode, and braces let it enter or exit a~new level of
522523
%grouping.
523-
并非所有的字符记号都是可排印的,例如在 \TeX\ 的默认状态中,
524-
执行处理器会将 \n{\char`\$} 作为数学模式的切换符,
525-
并将\n{\char`\{} 和\n{\char`\}} 作为编组的起止符
526-
数学模式切换符用于告知执行处理器进入和退出数学模式,
527-
而花括号让执行处理器进入和退出一个编组
524+
并非所有字符记号都是可排版的。
525+
执行处理器可能遇到数学模式切换标志(默认是 \n{\char`\$})、
526+
分组起止符(默认是 \n{\char`\{} 和 \n{\char`\}}
527+
当执行处理器遇到数学模式切换标志时,它会进入或退出数学模式;
528+
而分组起止符则让执行处理器进入或退出新的一层分组
528529

529530
%One control sequence handled by the execution processor
530531
%deserves special mention: \cs{relax}.
@@ -546,24 +547,21 @@ \section{执行处理器}
546547
%process that is forming the number stops at \cs{relax} and
547548
%the number {\tt 1} is assigned; in the second case
548549
%\cs{empty} expands to nothing, so {\tt 12} is assigned.
549-
控制序列 \cs{relax} 需要在此关注一下,
550-
它是横跨展开处理器与执行处理器两界的特殊公民,
551-
在展开处理器中它是不可展开的,在执行处理器中它什么也不执行,
552-
但是它并非一无是处,可以比较下面的两个示例的效果,
553-
从中发现 \cs{relax} 的用途。\par 示例 1:
550+
控制序列 \cs{relax} 有些特别:
551+
该控制序列是不可展开的,同时执行时啥也不做。
552+
为说明 \cs{relax} 的作用,可与 \cs{empty} 进行比较。
553+
\cs{empty} 的定义如下:
554+
\begin{verbatim}
555+
\def\empty{}
556+
\end{verbatim}
557+
使用 \cs{relax} 时,因其不可展开,故而下例中计数寄存器被赋值为 \texttt{1}:
554558
\begin{verbatim}
555559
\count0=1\relax 2
556560
\end{verbatim}
557-
\par 示例 2
561+
使用 \cs{empty} 时,因 \cs{empty} 的展开结果为空,故而下例中计数寄存器被赋值为 \texttt{12}
558562
\begin{verbatim}
559-
\def\empty{}
560563
\count0=1\empty 2
561564
\end{verbatim}
562-
这两个示例都是在为计数寄存器赋值,但是示例 1 赋的值为 {\tt 1},
563-
而示例 2 赋的值为 {\tt 12}。这是因为在示例 1 中,\cs{relax}
564-
在执行处理器获得数值 {\tt 1} 的时候阻断了它进一步获取数值 {\tt 2},
565-
而在示例 2 中 \cs{empty} 的展开结果为空,执行处理器轻而易举地继 {\tt 1}
566-
之后就拿到了{\tt 2},所以形成{\tt 12}。
567565

568566
%\section{The visual processor}
569567
\section{可视化处理器}
@@ -573,9 +571,9 @@ \section{可视化处理器}
573571
%alignment, page breaking, math typesetting, and \n{dvi} file
574572
%generation. Various parameters control the operation
575573
%of these parts of \TeX.
576-
\TeX\ 的可视化处理器包含了用户不可直接控制的一些算法,
577-
用于处理断行、阵列、分页、数学排版以及 \n{dvi} 文件生成等
578-
用户可以通过一些参数间接控制 \TeX\ 的这部分操作
574+
\TeX 的可视化处理器使用了若干用户不可直接控制的算法:
575+
断行、切齐、分页、数学排版以及 \n{dvi} 文件生成算法
576+
尽管用户不可直接控制这些算法,但可通过一些参数,间接控制它们
579577

580578
%Some of these algorithms return their results in a form that
581579
%can be handled by the execution processor. For instance,
@@ -586,11 +584,14 @@ \section{可视化处理器}
586584
%routines can dissect it. On the other hand, a math formula
587585
%can not be broken into pieces, and, naturally,
588586
%shipping a box to the \n{dvi} file is irreversible.
589-
可视化处理器中有一部分算法返回的是可被执行处理器处理的结果。
590-
例如,已完成断行的段落是一组带有行间粘连和惩罚的水平盒子,
591-
并被添加到主竖直列中。再者,分页算法会将其处理结果存储在
592-
\cs{box255} 中,以使输出例程能够产生页面。另一方面,
593-
数学公式不可以被分解,而输送至 \n{dvi} 文件的盒子也是不可逆的。
587+
这些算法当中,部分算法的输出结果可被执行处理器继续处理。
588+
例如说,分段成行得到一系列行组成的列表;
589+
这些行会被加入主竖直列表当中;
590+
而每一行又是由若干水平盒子及其中的行间粘连和惩罚组成的。
591+
又例如说,分页算法将其结果保存在 \cs{box255} 当中;
592+
而后交由输出例程继续处理\liamfnote{最简单的是 \cs{output}\marg{\cs{shipout}\cs{box255}}。}。
593+
其余算法的输出结果则不然,例如数学公式不可以分解,
594+
又例如输出至 \n{dvi} 文件的盒子也是不可逆的。
594595

595596
%\section{Examples}
596597
\section{示例}
@@ -624,15 +625,15 @@ \subsection{被忽略的空格}
624625
\def\a{\penalty200}
625626
\a 0
626627
\end{verbatim}
627-
展开的结果{\italic 并非}是(这将放置值为 \n{200} 的惩罚项,并排印数字 \n0)
628+
展开的结果\emph{不是}(设置惩罚项为 \n{200},并排版数字 \n0)
628629
\begin{verbatim}
629630
\penalty200 0
630631
\end{verbatim}
631632
而是
632633
\begin{verbatim}
633634
\penalty2000
634635
\end{verbatim}
635-
这是由于 \cs{a} 后的空格会被输入处理器忽略,从而展开处理器所得到的控制序列是
636+
这是由于输入处理器会忽略 \cs{a} 后的空格,因此展开处理器的输入流中的内容是:
636637
\begin{verbatim}
637638
\a0
638639
\end{verbatim}
@@ -645,8 +646,9 @@ \subsection{内部量值及其表示}
645646
%quantities have an external representation,
646647
%which is a string of characters, such as
647648
%\n{4711} or~\n{91.44cm}.
648-
\TeX\ 拥有多种内部量值,诸如整数和尺寸。这些内部量值的外部表示方法只有一种,
649-
那就是字符串表示,例如 \n{4711} 或者 \n{91.44cm}。
649+
\TeX 使用了多重内部量,比如说整数和尺寸。
650+
这些内部量的外部表示是同一的:字符组成的字符串。
651+
例如 \n{4711} 和 \n{91.44cm}。
650652

651653
%Conversions between the internal value and the external
652654
%representation take place on two different levels,
@@ -662,16 +664,12 @@ \subsection{内部量值及其表示}
662664
%\end{verbatim}
663665
%and all of these statements are handled by the execution
664666
%processor.
665-
内部量值与外部表示之间的转换分别发生在两个不同的层面,具体依赖于转换的方向
666-
对于字符串转换为内部量值,例如
667+
内部量与外部表示之间的转换发生在执行处理器或展开处理器中
668+
具体来说,外部表示向内部量的转换发生在执行处理器中
667669
\begin{verbatim}
668670
\pageno=12 \baselineskip=13pt
669-
\end{verbatim}
670-
或者
671-
\begin{verbatim}
672671
\vskip 5.71pt
673672
\end{verbatim}
674-
像这样的语句会在执行处理器中被处理。
675673

676674
%On the other hand, the conversion of the internal
677675
%values into a representation as a string of
@@ -681,12 +679,11 @@ \subsection{内部量值及其表示}
681679
%\the\baselineskip
682680
%\end{verbatim}
683681
%are all processed by expansion.
684-
另一方面,内部量值到外部表示的转换是由展开处理器完成的。例如
682+
内部量向外部表示的转换发生在展开处理器中
685683
\begin{verbatim}
686684
\number\pageno \romannumeral\year
687685
\the\baselineskip
688686
\end{verbatim}
689-
这些语句会被展开处理器处理为内部量值的字符串记号。
690687

691688
%As a final example, suppose \verb>\count2=45>, and
692689
%consider the statement
@@ -704,18 +701,18 @@ \subsection{内部量值及其表示}
704701
%\count0=1453
705702
%\end{verbatim}
706703
%and execute this.
707-
最后一个例子,假设 \verb>\count2=45>,看下面的语句:
704+
最后再举一例。
705+
假设 \verb|\count2=45|,
706+
则下列代码
708707
\begin{verbatim}
709708
\count0=1\number\count2 3
710709
\end{verbatim}
711-
展开处理器可将 \verb>\number\count2> 展开为字符串 \n{45},
712-
\n2 之后的空格并不会结束正在赋予的数值:
713-
它只用于定界 \cs{count} 寄存器的数字。
714-
从而下一层级的执行处理器看到的是:
710+
首先将 \verb>\number\count2>\textvisiblespace 被展开为字符串 \n{45},
711+
注意 \verb|\count2| 后的空格被用于界定计数器编号而已被展开。
712+
因此,下一级处理时,执行处理器看到并执行的是:
715713
\begin{verbatim}
716714
\count0=1453
717715
\end{verbatim}
718-
于是它便奉命行事。
719716

720717
%%\endinput
721718
%\endinput

preamble.tex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
\linespread{1.25}
1515
\setlength{\parindent}{2em}
16+
\setlength{\parskip}{0.5ex}
1617

1718
\usepackage{xcolor}
1819
\definecolor{myblue}{rgb}{0,0.2,0.6}
@@ -100,6 +101,8 @@
100101
\let\csc\cs
101102
\def\lb{{\tt\char`\{}}\def\rb{{\tt\char`\}}}
102103
\def\gr#1{\texorpdfstring{$\langle$#1$\rangle$}{<#1>}} %\def\gr#1{$\langle$#1$\rangle$}
104+
\def\marg#1{{\tt \{}#1{\tt \}}}
105+
\def\oarg#1{{\tt [}#1{\tt }}
103106
\def\key#1{{\tt#1}}
104107
\def\alt{}\def\altt{}%this way in manstijl
105108
\def\ldash{\unskip\ ——\nobreak\ \ignorespaces}
@@ -200,3 +203,5 @@
200203

201204
%\input figs
202205
\def\endofchapter{\vfill\noindent}
206+
207+
\newcommand{\liamfnote}[1]{\footnote{译注(Liam0205):#1}}

0 commit comments

Comments
 (0)