diff options
Diffstat (limited to 'Master/texmf-dist/doc/plain/impatient-cn/modes.tex')
-rw-r--r-- | Master/texmf-dist/doc/plain/impatient-cn/modes.tex | 2595 |
1 files changed, 2595 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/plain/impatient-cn/modes.tex b/Master/texmf-dist/doc/plain/impatient-cn/modes.tex new file mode 100644 index 00000000000..98be8c68950 --- /dev/null +++ b/Master/texmf-dist/doc/plain/impatient-cn/modes.tex @@ -0,0 +1,2595 @@ +% -*- coding: utf-8 -*- +% This is part of the book TeX for the Impatient. +% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry. +% See file fdl.tex for copying conditions. + +\input macros +%\chapter {Commands for \linebreak horizontal and \linebreak vertical modes} +\chapter {水平和竖直模式命令} + +\chapterdef{hvmodes} + +%This section covers commands that have corresponding or identical +%forms for both horizontal and vertical modes. +%These commands provide boxes, spaces, rules, leaders, +%and alignments. +%For an explanation of the conventions used in this section, +%see \headcit{Descriptions of the commands}{cmddesc}. +这一章介绍水平和竖直模式下具有对应或一致形式的命令。这些命令提供盒子、间隔、标线、指引线以及阵列。有关本章中使用的惯例的说明,参见\headcit{命令的描述}{cmddesc}。 + +\begindescriptions + +%========================================================================== +%\section {Producing space} +\section {产生间隔} + +%========================================================================== + +%\subsection {Fixed-width horizontal space} +\subsection {固定宽度水平间隔} + +%\begindesc +%\bix^^{space//producing} +%\bix^^{horizontal space} +%\cts thinspace {} +%\explain +%This command produces a positive \minref{kern} +%whose width is one-sixth of an em +%(\xref{dimdefs}) +%i.e., it causes \TeX\ to move its position right by that amount. +%It is useful +%when you have a nested quotation, for example, +%and you want to separate the levels of quotes. +%\TeX\ won't break a line at +%a |\thinspace|.\minrefs{line break} +\begindesc +\bix^^{间隔//产生间隔} +\bix^^{水平间隔} +\cts thinspace {} +\explain +该命令产生一个正的\minref{紧排},它的宽度是 1/6 em(\xref{dimdefs}),也就是说,它使得 \TeX\ 向右移动一个相应的距离。例如,当你需要嵌套引用,并希望将不同层次的引号分开时,它便非常有用。\TeX\ 不会在 |\thinspace| 处断行。\minrefs{line break} + +\example +``\thinspace`一个引用。'\thinspace''\par +24,\thinspace 29--31,\thinspace 45,\thinspace 102 +| +\produces +%``\thinspace`A quote.'\thinspace''\par +``\thinspace`一个引用。'\thinspace''\par +24,\thinspace 29--31,\thinspace 45,\thinspace 102 +\endexample +\enddesc + +\begindesc +\cts negthinspace {} +\explain +%This command +%produces a negative kern whose width is one-sixth of an em +%(\xref{dimdefs}), +%i.e., it causes \TeX\ to move its position left by that amount. +%It is useful for bringing together characters that are a little too +%far apart. +%\TeX\ won't break a line at a |\negthinspace|.\minrefs{line break} +该命令产生一个负的\minref{紧排},它的宽度是 1/6 em(\xref{dimdefs}),也就是说,它使得 \TeX\ 向左移动一个相应的距离。当需要将两个间隔稍远的字符靠近一些时便非常有用。\TeX\ 不会在 |\negthinspace| 处断行。\minrefs{line break} + +\example +The horror, the horror\negthinspace, the horror of it all!! +| +\produces +The horror, the horror\negthinspace, the horror of it all! +\endexample +\enddesc + +\begindesc +\cts enspace {} +\explain +%This command produces a \minref{kern} whose width is one ^{en} +%(half of an em, see \xrefpg{dimdefs}). +%\TeX\ won't break a line +%at an |\enspace| unless it's followed by glue. +%In a bulleted list, the bullets are usually separated from the following +%text by an |\enspace|. +该命令产生一个宽度为 1 ^{en} 的\minref{紧排}(1 em 的一半,参见 \xrefpg{dimdefs})。\TeX\ 不会在 |\enspace| 处断行,除非紧接其后的是粘连。在符号列表中,符号与其后的文字通常由 |\enspace| 来分隔。 + +\example +引理 1.\enspace 这里有一只白兔。 +| +\produces +%Lemma 1.\enspace There exists a white rabbit. +引理 1.\enspace 这里有一只白兔。 +\endexample +% the enspace here follows the \proclaim convention (Knuth p. 355). +\enddesc + +\begindesc +\easy\cts enskip {} +\cts quad {} +\cts qquad {} +\explain +^^{en} +%Each of these commands +%produces a glob of horizontal \minref{glue} +%that can neither stretch nor shrink. +%\TeX\ can break a line \minrefs{line break} at such glue. +%The width of these glues (which are relative to the current font) +%are as follows for |cmr10|, the default \plainTeX\ font: +这里的每个命令都产生一个既不能伸展也不能收缩的水平\minref{粘连}。\TeX\ 不能在这些粘连处断行。对于 \plainTeX\ 的默认字体 |cmr10| 来说,这些粘连的宽度(与当前字体有关)如下: +\medskip + +\def\distance#1{\hbox{\strut $\rightarrow$\vrule\hskip #1\vrule$\leftarrow$}} + +%{\def\l#1{\hfil$#1$\thinspace em} +%\tabskip 3pc \halign{#&#&\hfil#\hfil\cr +%{\it Command}&{\it Space}&{\it Illustration}\cr +%\noalign{\vskip 4pt} +%|\enskip|&\l{\frac 1/2}&\distance{.5em}\cr +%|\quad|&\l1&\distance{1em}\cr +%|\qquad|&\l2&\distance{2em}\cr +%}} +%\example +%en\enskip skip; quad\quad skip; qquad\qquad skip +%| +%\produces +%en\enskip skip; quad\quad skip; qquad\qquad skip +%\endexample +%\eix^^{horizontal space} +%\enddesc +{\def\l#1{\hfil$#1$\thinspace em} +\tabskip 3pc \halign{#&#&\hfil#\hfil\cr +{\it 命令}&{\it 间距}&{\it 图示}\cr +\noalign{\vskip 4pt} +|\enskip|&\l{\frac 1/2}&\distance{.5em}\cr +|\quad|&\l1&\distance{1em}\cr +|\qquad|&\l2&\distance{2em}\cr +}} +\example +en\enskip skip; quad\quad skip; qquad\qquad skip +| +\produces +en\enskip skip; quad\quad skip; qquad\qquad skip +\endexample +\eix^^{水平间隔} +\enddesc + +%========================================================================== +%\subsection {Fixed-length vertical space} +\subsection {固定长度竖直间隔} + +%\begindesc +%\bix^^{vertical space} +%\easy\cts smallskip {} +%\cts medskip {} +%\cts bigskip {} +%\explain +%These commands produce successively larger +%amounts of vertical space: +\begindesc +\bix^^{竖直间隔} +\easy\cts smallskip {} +\cts medskip {} +\cts bigskip {} +\explain +这些命令可以产生连续较大的竖直间隔: +\display{{\def\bar{\kern 2pt\hrule width 5pc} +\def\lbl#1{\hbox to 5pc{\hfil #1skip\hfil}} +\leavevmode +\vtop{\lbl{small}\bar\smallskip\bar}\quad +\vtop{\lbl{med}\bar\medskip\bar}\quad\vtop{\lbl{big}\bar\bigskip\bar}}} +\noindent +%|\smallskip| skips by $3$ points and can stretch or +%shrink by $1$ point. |\med!-skip| is equivalent to two |\smallskip|s +%and |\bigskip| is equivalent to two |\medskip|s. +|\smallskip| 产生 $3$ 点的竖直间隔,并可以伸展或收缩 1 点。 +|\med!-skip| 相当于两个 |\smallskip|,而 |\bigskip| 相当于两个 |\medskip|。 + +%These commands end a paragraph since they are inherently vertical. +%The skips that they produce +%are in addition to the normal interparagraph skip. +由于这些命令具有固有的竖直特性,因此它们的出现宣告一个段落的结束。由此产生的间距需要再加上正常的段落间距。 +\example +Hop \smallskip skip \medskip and \bigskip jump. +| +\produces +Hop \smallskip skip \medskip and \bigskip jump. +\endexample +\enddesc + +\begindesc +\cts smallskipamount {\param{glue}} +\cts medskipamount {\param{glue}} +\cts bigskipamount {\param{glue}} +\explain +%These parameters specify the amounts of glue produced by +%the |\small!-skip|, |\med!-skip|, and |\big!-skip| commands. +%By changing these parameters you change the effect of the commands. +%The default values (for \plainTeX) +%correspond to a quarter of a linespace, half a linespace, +%and a full linespace. +%We recommend that you maintain this ratio by changing +%these values whenever +%you change |\baselineskip| (\xref\baselineskip). +%^^|\baselineskip//and {\tt\\smallskipamount}, etc.| +%\eix^^{vertical space} +这些参数用于确定由 |\small!-skip|、|\med!-skip| 和 |\big!-skip| 命令产生的粘连的量。 +通过更改这些参数,你可以改变命令的效果。(对于 \plainTeX )它们相应的默认值是 1/4 、1/2 以及 1 行距。 +我们建议你保持这个比例,无论何时,你可以通过修改 |\baselineskip|(\xref\baselineskip )来修改参数值。 +^^|\baselineskip//和 {\tt\\smallskipamount} 等| +\eix^^{竖直间隔} + +\enddesc + +%========================================================================== +%\subsection {Variable-size space} +\subsection {可变尺寸间隔} + +%\begindesc +%\easy\cts hskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>} +%\cts vskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>} +%^^{vertical skip}^^{vertical glue} +%^^{horizontal skip}^^{horizontal glue} +%\bix^^{horizontal space} +%\bix^^{vertical space} +%\explain +%These commands produce horizontal and vertical glue respectively. +%In the simplest and most common case when only \<dimen$_1$> is present, +%|\hskip| skips to the right by \<dimen$_1$> +%and |\vskip| skips down the page by \<dimen$_1$>. +%More generally, these commands +%produce \minref{glue} whose natural size is +%\<dimen$_1$>, whose stretch is \<dimen$_2$>, and whose shrink is \<dimen$_3$>. +%Either the |plus| \<dimen$_2$>, the |minus |\<dimen$_3$>, +%or both can be omitted. +%If both are present, the |plus| must come before the |minus|. +%An omitted value +%is taken to be zero. Any of the \<dimen>s can be negative. +\begindesc +\easy\cts hskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>} +\cts vskip {\<dimen$_1$> {\bt plus} \<dimen$_2$> {\bt minus} \<dimen$_3$>} +^^{竖直间距}^^{竖直粘连} +^^{水平间距}^^{水平粘连} +\bix^^{水平间隔} +\bix^^{竖直间隔} +\explain +这些命令可以分别产生水平的和竖直的粘连。 +在最简单以及最常见的情况下,即当只有 \<dimen$_1$> 存在时, +|\hskip| 向右移动 \<dimen$_1$>,而 |\vskip| 向页面下方移动 \<dimen$_1$>。 +在一般情况下,这些命令产生一个\minref{粘连},其自然尺寸为 \<dimen$_1$>, +可伸长量为 \<dimen$_2$>,可收缩量为 \<dimen$_3$>。 +命令中的 |plus| \<dimen$_2$> 或 |minus |\<dimen$_3$>,或两者都可以省略。 +如果两者都需要,则 |plus| 必须出现在 |minus| 之前。 +被省略的变量取值为零。任何 \<dimen> 都可以取负值。 + +%You can use |\hskip| in math mode, but you can't use |mu| units +%\seeconcept{mathematical unit} +%for any of the dimensions. If you want |mu| units, use |\mskip| +%(\xref\mskip) instead. +在数学模式下,你可以使用 |\hskip|, +但不能使用 |mu|\seeconcept{数学单位}作为任何尺寸的单位。 +如果你希望使用 |mu| 作为单位,可以使用 |\mskip|(\xref\mskip )代替之。 + +\example +\hbox to 2in{one\hskip 0pt plus .5in two} +| +\produces +\hbox to 2in{one\hskip 0pt plus 2in two} + +\doruler{\8\8}2{in} +\nextexample +\hbox to 2in{Help me!! I can't fit +{\hskip 0pt minus 2in} inside this box!!} +| +\produces +\hbox to 2in{Help me! I can't fit +{\hskip 0pt minus 2in} inside this box!} + +\doruler{\8\8}2{in} +\nextexample +\vbox to 4pc{\offinterlineskip% 仅为显示 \vskip 的效果。 + \hbox{一}\vskip 0pc plus 1pc \hbox{二} + \vskip .5pc \hbox{三}} +| +\produces +\smallskip +\vbox to 4pc{\offinterlineskip% Just show effects of \vskip. +% \hbox{one}\vskip 0pc plus 1pc \hbox{two} +% \vskip .5pc \hbox{three}} + \hbox{一}\vskip 0pc plus 1pc \hbox{二} + \vskip .5pc \hbox{三}} +\endexample +\enddesc + +\begindesc +\cts hglue {\<glue>} +\cts vglue {\<glue>} +^^{竖直粘连} +^^{水平粘连} +\explain +%The |\hglue| command produces horizontal \minref{glue} that won't disappear at +%a line break; the |\vglue| command +%produces vertical \minref{glue} that won't disappear at a page break. +%In other respects these commands are just like |\hskip| and |\vskip|. +%You can use |\vglue| to produce blank space at the top of a page, +%e.g., above a title on the first page of a document, but +%^|\topglue| (next) is usually better for this purpose. +|\hglue| 命令生成水平的\minref{粘连},它不会在断行处消失;|\vglue| 命令生成竖直的\minref{粘连},它不会在分页处消失。除此以外,这些命令与 |\hskip| 和 |\vskip| 相似。你可以使用 |\vglue| 在文档第一页的标题上部等页面顶部产生空白间隔,但就此目的而言,随后的 ^|\topglue| 通常是更好的选择。 +\enddesc + +\begindesc +\cts topglue {\<glue>} +\explain +\margin{Command added; recent addition to \TeX} +%This command\footnote{|\topglue| was added to \TeX\ in version 3.0, +%later than the other enhancements introduced by ^{\newTeX} +%(\xref{newtex}). It is first described in the \emph{eighteenth\/} +%edition of \texbook.} causes the space from the top of the page to the +%top of the first box on the page to be \<glue> precisely. +%The top of the page is considered to be at the baseline of an +%imaginary line of text just above the top line of the page. +%More precisely, it's a distance |\topskip| above the origin as given by +%|\hoffset| and |\voffset|. +\margin{加入的命令;新近加入到 \TeX} +该命令 +\footnote{|\topglue| 是在 \TeX\ 3.0 中引入的, +比其它由^{\newTeX}(\xref{newtex})引入的增强特性稍晚。 +在 \texbook 的 \emph{18th\/} 版中第一次得到描述。} +可以精确地产生从页面顶部至该页上第一个盒子顶部的间隔。 +可以认为页面顶部位于页面第一行之上的一行无形文字的基线处。 +更加准确地,它在 |\hoffset| 和 |\voffset| 确定的原点之上,且间距等于 |\topskip|。 + +%This command is useful because \TeX\ ordinarily adjusts the glue +%produced by |\topskip| in a complex way. By using |\topglue| you can +%control the position of the first box on the page without worrying about +%those adjustments. +由于 \TeX\ 通常以非常复杂的方式调整由 |\topskip| 产生的粘连,所以这个命令是非常有用的。 +通过使用 |\topglue|,你能够控制页面上第一个盒子的位置,而不必担心那些复杂的调整。 + +\enddesc + +\begindesc +\cts kern {\<dimen>} +\explain +%The effect of this command depends on the mode that \TeX\ is in when +%it encounters it: +该命令产生的效果取决于 \TeX\ 遇到它时所处的模式: +\ulist + +%\li In a horizontal mode, \TeX\ moves its position to the right (for a positive +%kern) or to the left (for a negative kern). +\li 在水平模式下,\TeX\ 向右(正的紧排)或向左(负的紧排)移动。 + +%\li In a vertical mode, \TeX\ moves its position down the page (for a positive +%kern) or up the page (for a negative kern). +\li 在竖直模式下,\TeX\ 向页面下方(正的紧排)或页面上方(负的紧排)移动。 + +\endulist +\noindent +%Thus a positive kern produces empty space while a negative kern +%causes \TeX\ to back up over something that it's already produced. +%This notion of a kern ^^{kerns} +%is different from the notion of a kern in some computerized +%typesetting systems---in \TeX, positive kerns push two letters \emph{apart} +%instead of bringing them closer together. +因此,正的紧排产生空白的间隔,而负的紧排使得 \TeX\ 倒退到已经存在的东西上。 +在 \TeX 中,正的紧排将两个字母\emph{分开},而不是使它们更近一些。 +^{紧排}的这一设计与一些计算化排版系统是不同的。 + +%A kern is similar to +%\minref{glue}, except that (a)~a kern can neither stretch nor shrink, +%and (b)~\TeX\ will only break a line or a page at a kern if the kern +%is followed by glue and is not part of a math formula. +%If \TeX\ finds a kern at the +%end of a line or a page, it discards the kern. +%If you want to get the effect of a kern that never disappears, +%use ^|\hglue| or ^|\vglue|. +紧排与\minref{粘连}相似,不同的是 (a)~紧排不能被伸展或收缩; +(b)~如果紧排后紧接粘连,并且不是数学公式的一部分时,\TeX\ 不能在紧排处断行或分页。 +如果 \TeX\ 发现紧排位于一行或一页的结尾,该紧排将会被忽略。 +如果你希望得到不会消失的紧排的效果,使用 ^|\hglue| 或 ^|\vglue|。 + +%You can use |\kern| in math mode, but you can't use |mu| units +%\seeconcept{mathematical unit} +%for \<dimen>. If you want |mu| units, use |\mkern| +%(\xref\mkern) instead. +%^^{line breaks//kerns at} +%^^{page breaks//kerns at} +你可以在数学模式中使用 |\kern|,但你不能使用 |mu| 作为 \<dimen> 的单位\seeconcept{数学单位}。 +如果你希望使用 |mu| 作为单位,可以使用 |\mkern| (\xref\mkern )代替之。 +^^{断行//断行处的紧排} +^^{分页//分页处的紧排} + +\example +\centerline{$\Downarrow$}\kern 3pt % 竖直的紧排 +\centerline{$\Longrightarrow$\kern 6pt % 水平的紧排 + {\bf 留意我的警示!!}\kern 6pt % 另一水平的紧排 + $\Longleftarrow$} +\kern 3pt % 另一竖直的紧排 +\centerline{$\Uparrow$} +| +\produces +\centerline{$\Downarrow$}\kern 3pt % a vertical kern +\centerline{$\Longrightarrow$\kern 6pt % a horizontal kern +% {\bf Heed my warning!}\kern 6pt % another horizontal kern + {\bf 留意我的警示!}\kern 6pt % another horizontal kern + $\Longleftarrow$} +\kern 3pt % another vertical kern +\centerline{$\Uparrow$} +\endexample +\enddesc + +%\begindesc +%\makecolumns 4/2: +%\cts hfil {} +%\cts hfill {} +%\cts vfil {} +%\cts vfill {} +%\explain +%\bix^^{glue//infinitely stretchable} +%These commands produce infinitely stretchable horizontal +%and vertical glue that +%overwhelms any finite stretch that may be present. +%|\hfil| and |\hfill| produce horizontal glue, while +%|\vfil| and |\vfill| produce vertical glue. +\begindesc +\makecolumns 4/2: +\cts hfil {} +\cts hfill {} +\cts vfil {} +\cts vfill {} +\explain +\bix^^{粘连//可无限伸展的粘连} +这些命令产生可无限伸展的水平或竖直的粘连,它们将取代任何存在的有限伸展。|\hfil| 和 |\hfill| 产生水平的粘连,而 |\vfil| 和 |\vfill| 产生竖直的粘连。 + +%|\hfill| is infinitely larger than |\hfil|. +%If both |\hfill| and |\hfil| appear in the same \minref{box}, +%the |\hfill| will consume all the available extra space +%and the |\hfil| will be effectively ignored. +%|\hfill| can in turn be overwhelmed by |\hskip 0pt plus 1filll|. +%The glue produced by +%|\hfil| and |\hfill| never shrinks. +%|\hfill| 无限地大于 |\hfil|。如果 |\hfill| 和 |\hfil| 出现在一同一个\minref{盒子}里,|\hfill| 将占据所有可以获得的额外间隔,而 |\hfil| 的效应将被忽略。而 |\hfill| 可以被 |\hskip 0pt plus 1filll| 取代。由 |\hfil| 和 |\hfill| 产生的粘连不能被压缩。 + +%The behavior of |\vfil| and |\vfill| is analogous. +|\vfil| 和 |\vfill| 有着类似的行为。 + +\example +\hbox to 2in{左\hfil 中 \hfil 右} +| +\produces +%\hbox to 2in{Left\hfil Middle \hfil Right} +\hbox to 2in{左\hfil 中 \hfil 右} + +\doruler{\8\8}2{in} +\nextexample +\hbox to 2in{左\hfil 中 \hfill 右} +| +\produces +%\hbox to 2in{Left\hfil Middle \hfill Right} +\hbox to 2in{左\hfil 中 \hfill 右} + +\doruler{\8\8}2{in} +\nextexample +\leftline{% +\vbox to 4pc{% + \hbox{上}\vfil\hbox{中}\vfil \hbox{下}}\quad +\vbox to 4pc{% + \hbox{上}\vfil\hbox{中}\vfill\hbox{下}}} +| +\produces +\smallskip +\leftline{% +\vbox to 4pc{% + %\hbox{Top}\vfil\hbox{Middle}\vfil \hbox{Bottom}}\quad + \hbox{上}\vfil\hbox{中}\vfil \hbox{下}}\quad +\vbox to 4pc{% + %\hbox{Top}\vfil\hbox{Middle}\vfill\hbox{Bottom}}} + \hbox{上}\vfil\hbox{中}\vfill\hbox{下}}} +\endexample + +%\eix^^{glue//infinitely stretchable} +%\enddesc +\eix^^{粘连//可无限伸展的粘连} +\enddesc + +\begindesc +\cts hss {} +\cts vss {} +\explain +%These commands produce horizontal and vertical glue +%that is both infinitely stretchable and +%infinitely shrinkable. The glue can shrink +%to a negative distance, producing the effect of backspacing along a line +%(for |\hss|) or moving back up a page (for |\vss|). +这些命令产生水平和竖直的可无限伸展和收缩的粘连。 +粘连可以收缩至负的距离,产生的效果是% +(对于 |\hss| 而言)沿一行向左移动或(对于 |\vss| 而言)向页面顶部移动。 + +\example +\line{正文文本\hfil\hbox to 0pt{页边空白\hss}} +% `页边空白\hss' 收缩到宽度为零的水平盒子中。 +| +\produces +%\line{text\hfil\hbox to 0pt{margin\hss}} +\line{正文文本\hfil\hbox to 0pt{页边空白\hss}} +\nextexample +\vbox to 1pc{\hrule width 6pc % Top of box. + \hbox{1} \vskip 1pc\hbox to 2pc{\hfil 2} + % \vss 消除了由 \vskip 产生的额外间距。 + \vss \hbox to 3pc{\hfil 3} + \hrule width 6pc}% 盒子的底部 +| +\produces +\medskip +\vbox to 1pc{\hrule width 6pc % top of box + \hbox{1} \vskip 1pc\hbox to 2pc{\hfil 2} + \vss \hbox to 3pc{\hfil 3} + \hrule width 6pc}% bottom of box +\vskip 2.5pc +\endexample +\enddesc + +%\begindesc +%\cts hfilneg {} +%\cts vfilneg {} +%\explain +%^^{glue//negative} +%These commands cancel the effect of a preceding |\hfil| +%or |\vfil|. While |\hfil| and |\vfil| +%produce infinitely stretchable positive \minref{glue}, |\hfilneg| +%and |\vfilneg| produce infinitely stretchable negative glue. +%(Thus, $n$ |\hfilneg|s cancel $n$ ^|\hfil|s, and similarly for +%|\vfilneg|.) +%The main use of |\hfilneg| and |\vfilneg| +%is to counteract the effect of an |\hfil| or |\vfil| +%inserted by a \minref{macro}. +\begindesc +\cts hfilneg {} +\cts vfilneg {} +\explain +^^{粘连//负粘连} +这些命令可以消除其前接的 |\hfil| 或 |\vfil| 产生的效果。当 |\hfil| 和 |\vfil| 产生正的无限可伸展的粘连时,|\hfilneg| 和 |\vfilneg| 产生负的无限可伸展粘连。(因此,$n$ |\hfilneg| 消除 $n$ ^|\hfil| 产生的效果,对于 |\vfilneg| 也是相似的。)|\hfilneg| 和 |\vfilneg| 主要的用途是抵消由\minref{宏} 引入的 |\hfil| 或 |\vfil| 产生的效果。 + +%|\hfilneg| and |\vfilneg| have +%the curious property that if they are the only infinitely stretchable +%glue in a box, they produce exactly the same effect as |\hfil| +%and |\vfil|. +如果它们是一个盒子中仅有的可无限伸展的粘连,|\hfilneg| 和 |\vfilneg| 则具有奇异的特性,即它们产生与 |\hfil| 和 |\vfil| 完全一致的效果。 + +\example +\leftline{\hfil 位于右端\hfilneg} +% 消除了 \leftline 在其参数右侧产生的 \hfil。 +| +\produces +%\leftline{\hfil on the right \hfilneg} +\leftline{\hfil 位于右端 \hfilneg} +% Cancel the \hfil that \leftline produces to the right +% of its argument. +% +\nextexample +\def\a{\hbox to 1pc{\hfil 2}\vfil} +\vbox to 4pc{\hbox{1} \vfil \a + \vfilneg \hbox to 2pc{\hfil 3}} +| +\produces +\smallskip +\def\a{\hbox to 1pc{\hfil 2}\vfil} +\vbox to 4pc{\hbox{1} \vfil \a + \vfilneg \hbox to 2pc{\hfil 3}} +\endexample\enddesc + +%{\emergencystretch=2em +%\see |\hbadness| and |\vbadness| (\xref \vbadness), +%|\hfuzz| and |\vfuzz| (\xref \vfuzz), +%\conceptcit{leaders}.\par} +%\eix^^{space//producing} +%\eix^^{horizontal space} +%\eix^^{vertical space} +\see |\hbadness| 和 |\vbadness|(\xref \vbadness ), +|\hfuzz| 和 |\vfuzz|(\xref \vfuzz ),及\conceptcit{指引线}。 +\eix^^{间隔//产生间隔} +\eix^^{水平间隔} +\eix^^{竖直间隔} + +%========================================================================== +%\section {Manipulating boxes} +\section {操作盒子} + +%========================================================================== +%\subsection {Constructing hboxes and vboxes} +\subsection {构造 hbox 和 vbox} + +%\begindesc +%\bix^^{box commands} +%^^{hboxes//constructing with \b\tt\\hbox\e} +\begindesc +\bix^^{盒子命令} +^^{水平盒子//用 \b\tt\\hbox\e 构造} +% +\cts hbox {\rqbraces{\<horizontal mode material>}} +\aux\cts hbox {{\bt to} \<dimen> \rqbraces{\<horizontal mode material>}} +\aux\cts hbox {{\bt spread} \<dimen> \rqbraces{\<horizontal mode material>}} +\explain +%This command produces an hbox +%(horizontal \minref{box}) containing \<horizontal mode material>. +%The braces around \<horizontal mode material> define a group. +%\TeX\ doesn't break the \<horizontal mode material> into lines, +%since it's in restricted horizontal mode when it's assembling the box. +%\TeX\ won't change the size of the box once it's been produced. +该命令产生一个 hbox(水平\minref{盒子})以容纳 \<horizontal mode material>。 +\<horizontal mode material> 两侧的大括号定义一个编组。 +\TeX\ 不会对 \<horizontal mode material> 断行, +因为当其组装盒子时它处于受限水平模式下。一旦盒子生成后,\TeX\ 不会改变其大小。 + +%|\hbox| is often useful when you want to keep some text all on one line. +%If your use of |\hbox| prevents \TeX\ from breaking lines in an acceptable +%way, \TeX\ will complain about an overfull hbox. +当你希望将一些文字全部放在一行上时,|\hbox| 是有用的。 +如果你所用的 |\hbox| 使得 \TeX\ 不能以一种可以接受的方式断行时, +\TeX\ 会给出 hbox 过满的警告。 + +%The width of the hbox depends on the arguments to |\hbox|: +%\ulist\compact +%\li If you specify only \<horizontal mode material>, +%the hbox will have its natural \minref{width}. +%\li If you specify |to| \<dimen>, the width of the hbox will be \<dimen>. +%\li If you specify |spread| \<dimen>, the width of the hbox will be +%its natural width plus \<dimen>, i.e., the hbox will be spread out by +%\<dimen>. +%\endulist +hbox 的宽度取决于 |\hbox| 的参数: +\ulist\compact +\li 如果你只设定了 \<horizontal mode material>,hbox 将具有参数本身的\minref{宽度}。 +\li 如果你设定了 |to| \<dimen>,则 hbox 的宽度将是 \<dimen>。 +\li 如果你设定了 |spread| \<dimen>,则 hbox 的宽度将是参数本身的宽度再加上 \<dimen>,也就是说,hbox 将伸展 \<dimen>。 +\endulist + +%The ^|\hfil| command (\xref\hfil) is useful for filling out an +%hbox with empty space when the material in the box isn't as wide as +%the width of the box. +当盒子中内容的宽度没有盒子宽,需要使用空白间隔来填充 hbox 时,^|\hfil| 命令(\xref\hfil )是非常有用的。 +\example +\hbox{ugly suburban sprawl} +\hbox to 2in{ugly \hfil suburban \hfil sprawl} +\hbox spread 1in {ugly \hfil suburban \hfil sprawl} +% 在上面两行中,如果去掉 \hfil,将会得到 `underfull hbox' 警告。 +| +\produces +\hbox{ugly suburban sprawl} +\hbox to 2in{ugly \hfil suburban \hfil sprawl} +\hbox spread 1in {ugly \hfil suburban \hfil sprawl} +% Without \hfil in the two preceding lines, +% you'd get `underfull hbox'es. + +\doruler{\8\8\8}3{in} +\endexample +\enddesc + +%\begindesc +%\cts vtop {\<vertical mode material>} +%\aux\cts vtop {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}} +%\aux\cts vtop {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}} +%\cts vbox {\rqbraces{\<vertical mode material>}} +%\aux\cts vbox {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}} +%\aux\cts vbox {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}} +%\explain +%^^{hbox//constructing with \b\tt\\hbox\e} +%These commands +%produce a \minref{vbox} (vertical \minref{box}) +%containing \<vertical mode material>. +%The braces around \<vertical mode material> define a group. +%\TeX\ is in internal vertical mode when it's assembling the box. +%\TeX\ won't change the size of the box once it's been produced. +\begindesc +\cts vtop {\<vertical mode material>} +\aux\cts vtop {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}} +\aux\cts vtop {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}} +\cts vbox {\rqbraces{\<vertical mode material>}} +\aux\cts vbox {{\bt to} \<dimen> \rqbraces{\<vertical mode material>}} +\aux\cts vbox {{\bt spread} \<dimen> \rqbraces{\<vertical mode material>}} +\explain +^^{水平盒子//用 \b\tt\\hbox\e 构造} +这些命令产生一个 \minref{vbox}(竖直\minref{盒子})以容纳 \<vertical mode material>。 +\<vertical mode material> 两侧的大括号定义一个编组。 +当 \TeX\ 组装盒子时它处于内部竖直模式下。一旦盒子生成后,\TeX\ 不会改变其大小。 + +%The difference between |\vtop| and |\vbox| lies in where \TeX\ puts +%the reference point of the constructed vbox. +%Ordinarily, the reference point gotten from |\vtop| tends to be at or near +%the top of the constructed vbox, +%while +%the reference point gotten from |\vbox| tends to be at or near +%the bottom of the constructed vbox. +%Thus a row of vboxes all constructed with |\vtop| +%will tend to have their tops nearly in a line, +%while a row of vboxes all constructed with |\vbox| +%will tend to have their bottoms nearly in a line. +|\vtop| 和 |\vbox| 之间的不同点在于 \TeX\ 放置已构成的 vbox 的基准点的位置。 +通常情况下,由 |\vtop| 获得的基准点位于或接近于已构成的 vbox 的顶部; +而 |\vbox| 获得的基准点位于或接近于已构成的 vbox 的底部。 +因此,一行全部由 |\vtop| 构成的 vbox,其顶部将会近似在一条线上; +相应地,一行全部由 |\vbox| 构成的 vbox,其底部将会近似在一条线上。 + +%|\vtop| and |\vbox| are often useful +%when you want to keep some text together on a single page. +%(For this purpose, it usually doesn't matter which command you use.) +%If your use of these commands +%prevents \TeX\ from breaking pages in an acceptable +%way, \TeX\ will complain that it's found an overfull or underfull vbox while +%|\output| is active. +当你希望将一些文字放在单独的一页上时,|\vtop| 和 |\vbox| 是有用的。% +(为了这个目的,它通常不在乎你使用的命令。)% +如果你使用这些命令使得 \TeX\ 不能以一种可以接受的方式分页时, +\TeX\ 会在 |\output| 处于活动的情况下,给出 vbox 过满或不足的警告。 + +%The height of a vbox depends on +%the arguments to |\vtop| or |\vbox|. +%For |\vbox|, \TeX\ determines the height as follows: +%\ulist\compact +%\li If you specify only \<vertical mode material>, +%the vbox will have its natural height. +%\li If you specify |to| \<dimen>, +%the height of the vbox will be \<dimen>. +%\li If you specify |spread| \<dimen>, the height of the vbox will be +%its natural height plus \<dimen>, i.e., +%the height of the vbox will be stretched vertically by \<dimen>. +%\endulist +%\noindent +%For |\vtop|, +%\TeX\ constructs the box using its rules for |\vbox| and then +%apportions the vertical extent between the height and the depth as +%described below. +vbox 的高度取决于 |\vtop| 或 |\vbox| 的参数。对于 |\vbox|,\TeX\ 采用如下方法确定其高度: +\ulist\compact +\li 如果你只设定 \<vertical mode material>,vbox 将具有参数本身的高度。 +\li 如果你设定 |to| \<dimen>,vbox 的高度将是 \<dimen>。 +\li 如果你设定了 |spread| \<dimen>,则 vbox 的高度将是参数本身的高度再加上 \<dimen>, +也就是说,vbox 将在竖直方向上伸展 \<dimen>。 +\endulist +\noindent +对于 |\vtop|,\TeX\ 采用 |\vbox| 一样的规则来构造盒子, +然后以下面描述的方法在高度和深度之间分配竖直方向上的扩展。 + +%Ordinarily, the width of a constructed vbox is the width of the widest +%item inside it.\footnote +%{More precisely, it's the distance from the reference point to the rightmost +%edge of the constructed vbox. Therefore, +%if you move any of the items right using ^|\moveright| or +%^|\moveleft| (with a negative distance), +%the constructed vbox might be wider.} +%The rules for apportioning the vertical extent between the +%height and the depth are more complicated: +%\ulist +%\li For |\vtop|, +%the height is the height of its first item, if that item is a box or rule. +%Otherwise the height is zero. The depth is whatever vertical +%extent remains after the height is subtracted. +%\li For |\vbox|, +%the depth is the depth of its last item, if that item is a box or rule. +%Otherwise the depth is zero. The height is whatever vertical +%extent remains after the depth is subtracted.% +%\footnote{In fact, there's a further complication. +%Suppose that after the depth has been determined +%using the two rules just given, the depth turns out to be greater than +%^|\boxmaxdepth|. +%Then the depth is reduced to |\boxmaxdepth| and the height is adjusted +%accordingly.} +%\endulist +通常,构造的 vbox 的宽度是其内部最宽项目的宽度。 +\footnote{更准确地说,是从基准点至构造的 vbox 最右侧之间的距离。 +因此,如果你使用 ^|\moveright| 或(负数距离的)^|\moveleft| 向右移动任何项目, +那么构造的 vbox 则可能更宽。} +在高度与深度间分配竖直扩展的规则更加复杂: +\ulist +\li 对于 |\vtop|,如果第一个项目是一个盒子或标线,则其高度是其第一个项目的高度。 +否则,其高度是零。深度是减去高度后的竖直扩展。 +\li 对于 |\vbox|,如果最后一个项目是一个盒子或标线,则其深度是其最后一个项目的深度。 +否则浓度是零。高度是减去深度后的竖直扩展。 +\footnote{实际上,规则可以更加复杂。假定在深度确定后,使用给出的两条规则, +则深度将会大于 ^|\boxmaxdepth|。 随后,深度将被缩小至 |\boxmaxdepth|,高度也相应地被调整。} +\endulist + +%The |\vfil| command (\xref\vfil) is useful for filling out a vbox +%^^|\vfil//filling a vbox| +%with empty space when the material in the box isn't as tall as +%the vertical extent of the box. +当盒子中内容的高度没有盒子竖直伸展高, +需要使用空白间隔来填充 vbox ^^|\vfil//填充竖直盒子|时, +^|\vfil| 命令(\xref\vfil )是非常有用的。 +\example +\hbox{\hsize = 10pc \raggedright\parindent = 1em +\vtop{在这个例子中,我们将看到如何使用 vbox 产生双栏的效果。 +每个 vbox 都包含两个段落,除了设置为左对齐以外均依照 \TeX +通常的规则进行排版。\par +这实际上并不是获得真正双栏的最好的方法,因为两栏} +\hskip 2pc +\vtop{\noindent +并不对称,而且我们无法自动选择第一栏在何处断开, +甚至不能确定第一栏的最后一行。\par +然而,将行文放在 vbox 中是一个将文本放在页面上 +你希望的位置上的有用的技巧。 +}} +| +\produces +\hbox{\hsize = 10pc \raggedright\parindent = 1em +%\vtop{In this example, we see how to use vboxes to +%produce the effect of double columns. Each vbox +%contains two paragraphs, typeset according to \TeX's +%usual rules except that it's ragged right.\par +%This isn't really the best way to get true double +%columns because the columns} +%\hskip 2pc +%\vtop{\noindent +%aren't balanced and we haven't done anything to choose +%the column break automatically or even to fix up the +%last line of the first column.\par +%However, the technique of putting running text into a +%vbox is very useful for placing that text where you +%want it on the page.}} +\vtop{在这个例子中,我们将看到如何使用 vbox 产生双栏的效果。 +每个 vbox 都包含两个段落,除了设置为左对齐以外均依照 \TeX +通常的规则进行排版。\par +这实际上并不是获得真正双栏的最好的方法,因为两栏} +\hskip 2pc +\vtop{\noindent +并不对称,而且我们无法自动选择第一栏在何处断开, +甚至不能确定第一栏的最后一行。\par +然而,将行文放在 vbox 中是一个将文本放在页面上 +你希望的位置上的有用的技巧。 +}} +\nextexample +\hbox{\hsize = 1in \raggedright\parindent = 0pt +\vtop to .75in{\hrule 这个盒子的深度是 .75in。 \vfil\hrule} +\qquad +\vtop{\hrule 这个盒子具体其本身的深度。 \vfil\hrule} +\qquad +\vtop spread .2in{\hrule 这个盒子的深度比其自身的深度多 .2in。\vfil\hrule}} +| +\produces +\hbox{\hsize = 1in \raggedright\parindent=0pt +%\vtop to .75in{\hrule This box is .75in deep. \vfil\hrule} +\vtop to .75in{\hrule 这个盒子的深度是 .75in。 \vfil\hrule} +\qquad +%\vtop{\hrule This box is at its natural depth. \vfil\hrule} +\vtop{\hrule 这个盒子具体其本身的深度。 \vfil\hrule} +\qquad +%\vtop spread .2in{\hrule This box is .2in deeper than +% its natural depth.\vfil\hrule}} +\vtop spread .2in{\hrule 这个盒子的深度比其自身的深度多 .2in。\vfil\hrule}} +\nextexample +% 显示 \vbox 是如何底部对齐,而非顶部对齐的。 +\hbox{\hsize = 1in \raggedright +\vbox to .5in{\hrule 这个盒子的深度是 .5in。\vfil\hrule} +\qquad +\vbox to .75in{\hrule 这个盒子的深度是 .75in。\vfil\hrule}} +| +\produces +\hbox{\hsize = 1in \raggedright +%\vbox to .5in{\hrule This box is .5in deep.\vfil\hrule} +\vbox to .5in{\hrule 这个盒子的深度是 .5in。\vfil\hrule} +\qquad +%\vbox to .75in{\hrule This box is .75in deep.\vfil\hrule}} +\vbox to .75in{\hrule 这个盒子的深度是 .75in。\vfil\hrule}} +\vskip 16pt % to avoid running into the next command description +\endexample +\enddesc + +\begindesc +%\margin{Two commands interchanged here.} +\margin{可交换的两个命令} +\cts boxmaxdepth {\param{dimen}} +\explain +%This parameter contains a dimension $D$. +%\TeX\ will not construct a box whose depth exceeds $D$. +%If you produce a box whose depth $d$ would exceed $D$, +%\TeX\ will transfer the +%excess depth to the height of the box, effectively moving the +%\minref{reference point} of the box down by $d-D$. +%If you set |\boxmaxdepth| to zero, \TeX\ will line up a row of vboxes +%so that their bottom boundaries all lie on the same horizontal line. +%\PlainTeX\ sets |\boxmaxdepth| to |\maxdimen| \ctsref{\maxdimen}, +%so |\boxmaxdepth| won't affect your boxes unless you change it. +这个参数包含的是一个尺寸 $D$。如果盒子的深度超过 $D$,\TeX\ 将不会构造这个盒子。 +如果你生成一个盒子,其深度 $d$ 大于 $D$,\TeX\ 将超出的深度传递给盒子的高度, +即高效地将盒子的\minref{基准点}向下移动 $d-D$。如果你将 |\boxmaxdepth| 设为零, +\TeX\ 会将盒子向上排一列,以便它们的底线都位于同一个水平线上。 +\PlainTeX\ 将 |\boxmaxdepth| 设为 |\maxdimen|\ctsref{\maxdimen}, +因此,|\boxmaxdepth| 不会影响你的盒子,除非你有意改动它。 +\enddesc + +\begindesc +\cts underbar {\<argument>} +\explain +%This command puts \<argument> into an \minref{hbox} +%and underlines it without regard to anything that protrudes below the +%\minref{baseline} of the box. +这个命令将 \<argument> 放入到一个 \minref{hbox},并在其下划线,而不考虑任何突出到盒子的\minref{基线}以下的东西。 +\example +\underbar{为什么不学习 \TeX?} +| +\produces +%\underbar{为什么不学习 \TeX?} +\underbar{Why not learn \TeX?} +\endexample +\enddesc + +\begindesc +\cts everyhbox {\param{token list}} +\cts everyvbox {\param{token list}} +\explain +%These parameters contain token lists that \TeX\ expands at the start of +%every \minref{hbox} or \minref{vbox} that it constructs. +%Any items resulting from the expansion then become +%the beginning of the list of items for the box. +%By default these token lists are empty. +这些参数包含的是记号列表。\TeX\ 会在开始构造每个 \minref{hbox} 或 \minref{vbox} 时对其进行扩展。来自于扩展的任何项目随后成为盒子的项目列表的开始。这些记号列表默认是空的。 +\enddesc + +%========================================================================== +%\subsection {Setting and retrieving the contents of boxes} +\subsection {设置和获取盒子的内容} + +%\begindesc +%\bix^^{box registers} +%% +%\cts setbox {\<register>\thinspace{\bt =}\thinspace\<box>} +%\cts box {\<register>} +%\explain +%^^{assignments//of boxes} +%These commands respectively set and retrieve the contents +%of the box register +%whose number is \<register>. +%Note that you set a box register a little differently than +%you set the other kinds of registers: you use +%|\setbox|$\,n$~|=| rather than |\box|$\,n$~|=|. +\begindesc +\bix^^{盒子寄存器} +% +\cts setbox {\<register>\thinspace{\bt =}\thinspace\<box>} +\cts box {\<register>} +\explain +^^{赋值//给盒子赋值} +这些命令分别设置和获取编号为 \<register> 的盒子寄存器的内容。 +需要注意,设置盒子寄存器与设置其它寄存器有细微的差别: +你应该使用 |\setbox|$\,n$~|=|,而不是 |\box|$\,n$~|=|。 + +%\emph{Retrieving the contents of a box register +%with these commands has the side effect of emptying it, +%so that the box register become void.} If you don't want that to happen, +%you can use |\copy| (see below) to retrieve the contents. +%You should use |\box| in preference to |\copy| +%when you don't care about what's in a box register after you've used it, +%so as not to exhaust \TeX's memory by filling it with obsolete boxes. +\emph{使用这些命令获取盒子寄存器中的内容时,有清空其内容的副作用,所以盒子寄存器将失效。}如果你不希望这些发生,你可以使用 |\copy|(参见后面的内容)来获取内容。如果你不在乎你使用之后的盒子寄存器中的内容,你应该优先使用 |\box| 而不是 |\copy|,这样可以不致于用废弃的盒子来消耗 \TeX\ 的内存。 + +\example +\setbox0 = \hbox{蘑菇} +\setbox1 = \vbox{\copy0\box0\box0} +\box1 +| +\produces +%\setbox0 = \hbox{mushroom} +\setbox0 = \hbox{蘑菇} +\setbox1 = \vbox{\copy0\box0\box0} +\box1 +\endexample +\enddesc + +%\begindesc +%\cts copy {\<register>} +%\explain +%^^{boxes//copying}%\minrefs{box} +%\minrefs{盒子} +%This command +%produces a copy of box register \<register>. +%This command is useful when you want to retrieve the contents of a box +%register but don't want to destroy the contents. +%(Retrieving the register contents with ^|\box| makes the register void.) +\begindesc +\cts copy {\<register>} +\explain +^^{盒子//复制盒子}%\minrefs{box} +\minrefs{盒子} +这个命令可以产生盒子寄存器 \<register> 的一个拷贝。当你希望获取一个盒子的内容, +但又不希望破坏其中的内容时是有用的。(使用 ^|\box| 获取寄取器内容会使寄存器失效。) +\example +\setbox0 = \hbox{美好} +祝你拥有 \copy0 \box0 \box0 的一天! +| +\produces +%\setbox0 = \hbox{good } +%Have a \copy0 \box0 \box0 day! +\setbox0 = \hbox{美好} +祝你拥有 \copy0 \box0 \box0 的一天! +\endexample +\enddesc + +%\begindesc +%\cts unhbox {\<register>} +%\cts unvbox {\<register>} +%^^{boxes//extracting contents of} +%\explain +%These commands produce the list contained in box register \<register> and make +%that box register void. +%|\unhbox| applies to box registers containing +%hboxes and |\unvbox| applies to box registers containing vboxes. +%You should use these commands in preference to |\unhcopy| and |\unvcopy| +%(see below) +%when you don't care about what's in the box register after you've used it, +%so as not to exhaust \TeX's memory by filling it with obsolete boxes. +\begindesc +\cts unhbox {\<register>} +\cts unvbox {\<register>} +^^{盒子//提取盒子的内容} +\explain +这些命令可以给出盒子寄存器 \<register> 容纳的列表,并且使盒子寄存器失效。 +|\unhbox| 适用于包含 hbox 的盒子寄存器,而 |\unvbox| 适用于包含 vbox 的盒子寄存器。 +当你不在乎你使用之后的盒子寄存器中的内容,你应该优先使用这些命令而不是 |\unhcopy| 和 |\unvcopy|, +这样可以不致于用废弃的盒子来消耗 \TeX\ 的内存。 +\example +\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。} +\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。} +\unhbox0 \unhbox1 +% \box0 \box1 将并排设置两个 hbox +% (并且输出难看的过满行)。 +\box1 % 什么也不输出。 +| +\produces +%\setbox0=\hbox{The Mock Turtle sighed deeply, and +%drew the back of one flapper across his eyes. } +%\setbox1=\hbox{He tried to speak, but sobs choked +% his voice. } +\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。} +\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。} +\unhbox0 \unhbox1 +% \hbox0 \hbox1 would set two hboxes side by side +% (and produce a badly overfull line). +\box1 % Produces nothing. +\endexample +\enddesc + +%\begindesc +%\cts unhcopy {\<register>} +%\cts unvcopy {\<register>} +%^^{boxes//extracting contents of} +%^^{boxes//copying }%\minrefs{box} +%\minrefs{盒子} +%\explain +\begindesc +\cts unhcopy {\<register>} +\cts unvcopy {\<register>} +^^{盒子//提取盒子的内容} +^^{盒子//复制盒子}%\minrefs{box} +\minrefs{盒子} +\explain +%These commands produce the list contained in box register \<register> and +%leave the contents of the register undisturbed. +%|\unhcopy| applies to box registers containing hboxes +%and |\unvcopy| applies to box registers containing vboxes. +这些命令可以给出盒子寄存器 \<register> 容纳的列表,并且保持寄存器的内容不被改变。 +|\unhcopy| 适用于包含 hbox 的盒子寄存器,而 |\unvcopy| 适用于包含 vbox 的盒子寄存器。 +\example +\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。} +\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。} +\unhcopy0 \unhcopy1\par\noindent +% \box0 \box1 将并排设置两个 hbox +% (并且输出难看的过满行)。 +\box1 % 输出一个(不能被断行)hbox。 +| +\produces +%\setbox0=\hbox{The Mock Turtle sighed deeply, and +%drew the back of one flapper across his eyes. } +%\setbox1=\hbox{He tried to speak, but sobs choked his +% voice. } +\setbox0=\hbox{素甲鱼深深地叹息着,用一只手背抹着眼泪。} +\setbox1=\hbox{他想说话,可是有好一阵子泣不成声。} +\unhcopy0 \unhcopy1\par\noindent +% \hbox0 \hbox1 would set two hboxes side by side +% (and produce a badly overfull line). +\box1 % produces an hbox (which can't be broken) +\endexample +\enddesc + +%\see |\wd|, |\dp|, |\ht| (\xref\ht). +%\eix^^{box registers} +\see |\wd|, |\dp|, |\ht|(\xref\ht )。 +\eix^^{盒子寄存器} + +%========================================================================== +%\subsection {Shifting boxes} +\subsection {移动盒子} + +%\begindesc +%\cts moveleft {\<dimen> \<box>} +%\cts moveright {\<dimen> \<box>} +%\bix^^{boxes//shifting} +%%\minrefs{box} +%\minrefs{盒子} +%\explain +%These commands move \<box> left or right by \<dimen> (which can be +%negative). You can only apply |\moveleft| and |\moveright| to a box +%that's in a \minref{vertical list}. +\begindesc +\cts moveleft {\<dimen> \<box>} +\cts moveright {\<dimen> \<box>} +\bix^^{盒子//移动盒子} +%\minrefs{box} +\minrefs{盒子} +\explain +这些命令将 \<box> 向左或右移动 \<dimen>(这个数值可以是负的)。 +你只能对存在于\minref{竖直列表} 中的盒子使用 |\moveleft| 和 |\moveright|。 +\example +\vbox{\vbox{Phoebe}\vbox{walked}% +\moveleft 20pt\vbox{a}\moveright 20pt\vbox{crooked}% +\vbox{mile.}} +| +\produces +\hfuzz = \maxdimen +\vbox{\vbox{Phoebe}\vbox{walked}% +\moveleft 20pt\vbox{a}\moveright 20pt\vbox{crooked}% +\vbox{mile.}} +\endexample +\enddesc + +\begindesc +\cts lower {\<dimen> \<box>} +\cts raise {\<dimen> \<box>} +\explain +%These commands move \<box> up or down by \<dimen> +%(which can be negative). +%You can only apply |\raise| and |\lower| to a box +%that's in a \minref{horizontal list}. +这些命令将 \<box> 向上或下移动 \<dimen>(这个数值可以是负的)。你只能对存在于\minref{水平列表} 中的盒子使用 |\raise| 和 |\lower|。 +\example +关于你鼻子上的 \lower 6pt \hbox{肿块},你觉得 + \raise 6pt \hbox{沮丧}吗? +| +\produces +%Are you feeling \lower 6pt \hbox{depressed} about the +% \raise 6pt \hbox{bump} on your nose? +关于你鼻子上的 \lower 6pt \hbox{肿块},你觉得 + \raise 6pt \hbox{沮丧}吗? +\endexample + +\eix^^{盒子//移动盒子} +\enddesc + +%========================================================================== +%\subsection {Dimensions of box registers} +\subsection {盒子寄存器的尺寸} + +%\begindesc +%\bix^^{box registers} +%\bix^^{dimensions//of box registers} +%\cts ht {\<register>\param{dimen}} +%\cts dp {\<register>\param{dimen}} +%\cts wd {\<register>\param{dimen}} +%\explain +%These parameters refer to the ^{height}, ^{depth}, and ^{width} +%respectively of \minref{box} \minref{register} \<register>. +%You can use them to find out the dimensions of a box. +%You can also change the dimensions of a box, but it's a tricky business; +%if you want to be adventurous you can +%learn all about it from \knuth{pages~388--389}. +\begindesc +\bix^^{盒子寄存器} +\bix^^{尺寸//盒子寄存器的尺寸} +\cts ht {\<register>\param{dimen}} +\cts dp {\<register>\param{dimen}} +\cts wd {\<register>\param{dimen}} +\explain +这些参数分别表示\minref{盒子}\minref{寄存器} \<register> 的^{高度}、^{深度}和^{宽度}。 +你可以使用这些命令获得一个盒子的尺寸。你也可以改变一个盒子的尺寸,但这是一个需要技巧的事情; +如果你希望成为冒险者,你可以从 \knuth{pages~388--389} 中获得全部的技巧。 +\example +\setbox0 = \vtop{\hbox{一个}\hbox{米黄色的}\hbox{兔子}}% +那个盒子的宽度是 \the\wd0,高度是 \the\ht0, +深度是 \the\dp0。 +| +\produces +%\setbox0 = \vtop{\hbox{a}\hbox{beige}\hbox{bunny}}% +%The box has width \the\wd0, height \the\ht0, +%and depth \the\dp0. +\setbox0 = \vtop{\hbox{一个}\hbox{米黄色的}\hbox{兔子}}% +那个盒子的宽度是 \the\wd0,高度是 \the\ht0, +深度是 \the\dp0。 +%\endexample +%\eix^^{box registers} +%\eix^^{dimensions//of box registers} +%\enddesc +\endexample +\eix^^{盒子} +\eix^^{尺寸//盒子寄存器的尺寸} +\enddesc + +%========================================================================== +%\subsection {Struts, phantoms, and empty boxes} +\subsection {支架、幻影和空盒子} + +\begindesc +%\margin{This subsection is a merger of two previous subsections. +%The commands have also been reordered.} +\margin{这一小节是前两个小节的联合体。相应的命令也被重新排序。} +%\bix^^{struts} +%\cts strut {} +%\explain +%This command produces a box whose width is zero +%and whose height (|8.5pt|) and depth (|3.5pt|) +%are those of a more or less typical line of type in |cmr10|, +%the default \plainTeX\ font. +%Its main use is in forcing lines to have the same height +%when you've disabled \TeX's interline glue with +%|\offinter!-lineskip| ^^|\offinterlineskip| or a similar command, +%e.g., when you're constructing an alignment. +%If the natural height of a line is +%too short, you can bring it up to standard by including a |\strut| +%in the line. The strut will force the height and depth of the line +%to be larger, but it won't print anything or consume any horizontal +%space. +\bix^^{支架} +\cts strut {} +\explain +这个命令产生一个宽度为零的盒子, +盒子的高度 (|8.5pt|) 和深度 (|3.5pt|) 与用 \plainTeX\ 的默认字体 |cmr10| 排出的典型的一行文字是一致的。 +当你使用 |\offinter!-lineskip| ^^|\offinterlineskip| 或类似的命令关闭 \TeX\ 的行间粘连, +如你正在构建一个阵列时,该命令主要用于强迫一行具有相同的高度。 +如果一行的自然高度过矮,你可以在行中插入一个 |\strut| 使它回到标准的高度。 +支架将使得一行的高度和深度更大一些,但它不会打印出任何东西,或者消耗任何水平间隔。 + +%If you're setting type in a font that's bigger or smaller than |cmr10|, +%you should redefine |\strut| for that context. +如果你正在使用一个大于或小于 |cmr10| 的字体排版,你应该根据所处环境重新定义 |\strut|。 +\example +\noindent % 使我们处于水平模式下。 +\offinterlineskip % 我们得到固有的间隔。 +% 下面这些 vbox 中的句号在竖直方向不是等间距的。 +\vtop{\hbox{.}\hbox{.(}\hbox{.x} + \hbox{.\vrule height 4pt depth 0pt}}\qquad +% 因为支架的缘故, +%下面这些 vbox 中的句号在竖直方向上则是等间距的。 +\vtop{\hbox{.\strut}\hbox{.(\strut}\hbox{.x\strut} + \hbox{.\vrule height 4pt depth 0pt\strut}} +| + +\produces +\noindent % So we're in horizontal mode. +\offinterlineskip % So we get the inherent spacing. +% The periods in this vbox are not vertically equidistant. +\vtop{\hbox{.}\hbox{.(}\hbox{.x} + \hbox{.\vrule height 4pt depth 0pt}}\qquad +% The periods in this vbox are vertically equidistant +% because of the struts. +\vtop{\hbox{.\strut}\hbox{.(\strut}\hbox{.x\strut} + \hbox{.\vrule height 4pt depth 0pt\strut}} +\endexample +\enddesc + +\begindesc +\cts mathstrut {} +\explain +%This command produces a phantom formula whose width is zero +%and whose height and depth are the same as those of a left parenthesis. +%|\mathstrut| is in fact defined as `|\vphantom(|'. +%Its main use is for getting radicals, underbars, and overbars to line +%up with other radicals, underbars, and overbars in a formula. +%It is much like ^|\strut| (\xref \strut), +%except that it adjusts itself to the different \minref{style}s +%that can occur in math formulas. +这个命令产生一个宽度为零的幻影公式,它的高度与深度与左圆括号是一致的。 +|\mathstrut| 实际上的定义是 `|\vphantom(|'。 +它主要用于使得根号、下横线和上横线能与公式中其它的根号、下横线和上横线成行排列。 +除能根据出现在数学公式中的不同\minref{样式}自动调节以外,它与 ^|\strut| (\xref \strut)非常相似。 +\example +$$\displaylines{ +\overline{a_1a_2} \land \overline{b_1b_2} +\quad{\rm versus}\quad \overline{a_1a_2\mathstrut} + \land \overline{b_1b_2\mathstrut}\cr +\sqrt{\epsilon} + \sqrt{\xi} \quad{\rm versus}\quad +\sqrt{\epsilon\mathstrut} + \sqrt{\xi\mathstrut}\cr}$$ +| +\dproduces +\kern 4pt +$$\displaylines{ +\overline{a_1a_2} \land \overline{b_1b_2} +\quad{\rm versus}\quad \overline{a_1a_2\mathstrut} + \land \overline{b_1b_2\mathstrut}\cr +\sqrt{\epsilon} + \sqrt{\xi} \quad{\rm versus}\quad +\sqrt{\epsilon\mathstrut} + \sqrt{\xi\mathstrut}\cr}$$ +\endexample +\eix^^{支架} +\enddesc + +%\begindesc +%\cts phantom {\<argument>} +%\explain +%\bix^^{boxes//phantom} +%\bix^^{phantoms} +%This command produces an empty \minref{box} +%having the same size and placement +%that \<argument> would have were it typeset. +%One use of |\phantom| is for reserving space for a symbol that for some +%reason needs to be drawn in by hand. +\begindesc +\cts phantom {\<argument>} +\explain +\bix^^{盒子//幻影盒子} +\bix^^{幻影} +此命令产生一个空\minref{盒子},它的大小和位置与假定 \<argument> 被排版出来时的相同。 +因某种原因需要手工给一个符号留出空间时,|\phantom| 就可派上用场。 +\example +$1\phantom{9}2$ +| +\produces +$1\phantom{9}2$ +\endexample +\enddesc + +\begindesc +\cts hphantom {\<argument>} +\cts vphantom {\<argument>} +\explain +%These commands produce phantom boxes\minrefs{box}\ that +%don't print anything: +%\ulist\compact +%\li |\hphantom| produces a box with the same width as \<argument> +%but zero height and depth. +%\li |\vphantom| produces a box with the same height and depth as \<argu\-ment> +%but zero width. +%\endulist +%\noindent +%Their main purpose is to force a subformula to have a certain minimum +%horizontal or vertical dimension. +这些命令产生幻影盒子\minrefs{box},并不打印任何东西: +\ulist\compact +\li |\hphantom| 产生一个宽度与 \<argument> 一致的盒子,但高度与深度均为零。 +\li |\vphantom| 产生一个高度与深度与 \<argu\-ment> 一致的盒子,但宽度为零。 +\endulist +\noindent +它们的主要目的是迫使一个子公式具有特定的最小水平或竖直尺寸。 +\example +$$\left[\vphantom{u\over v}t\right] \star + \left[{u\over v}\right]\quad + \{\hphantom{xx}\}$$ +| +\dproduces +\kern 4pt +$$\left[\vphantom{u\over v}t\right] \star + \left[{u\over v}\right]\quad + \{\hphantom{xx}\}$$ +\endexample +\enddesc + +\begindesc +\cts smash {\<argument>} +\explain +%This command typesets \<argument>, +%but forces the height and depth of its containing \minref{box} to be zero. +%You can use |\smash| and |\vphantom| in combination to give a subformula +%any height and depth that you wish. +该命令排出 \<argument>,但迫使其包含的\minref{盒子}的高度和深度设为零。你可以联合使用 |\smash| 和 |\vphantom| 来获得任何你期望高度与深度的子公式。 +\example +$${\smash{r_m \brace r_n}\vphantom{r}} \Longrightarrow r$$ +| +\dproduces +\kern 4pt +$${\smash{r_m \brace r_n}\vphantom{r}} \Longrightarrow r$$ +\endexample +%\eix^^{boxes//phantom} +%\eix^^{phantoms} +%\enddesc +\eix^^{盒子//幻影盒子} +\eix^^{幻影} +\enddesc + +%\begindesc +%^^{boxes//empty} +%\cts null {} +%\explain +%This command produces an empty \minref{hbox}. +\begindesc +^^{盒子//空盒子} +\cts null {} +\explain +这个命令产生一个空的 \minref{hbox}。 +\example +\setbox0 = \null +空盒子 \null 的宽度是 \the\wd0,高度是 \the\ht0, +深度是 \the\dp0。 +| +\produces +\setbox0 = \null +%The null box \null has width \the\wd0, height \the\ht0, +%and depth \the\dp0. +空盒子 \null 的宽度是 \the\wd0,高度是 \the\ht0, +深度是 \the\dp0。 +\endexample +\enddesc + + +%========================================================================== +%\subsection {Parameters pertaining to malformed boxes} +\subsection {有关畸形盒子的参数} + +%\begindesc +%\bix^^{boxes//overfull} +%\bix^^{boxes//underfull} +%\cts overfullrule {\param{dimen}} +%\explain +%This parameter specifies the width of the rule +%that \TeX\ appends to an overfull \minref{hbox}. +%\PlainTeX\ sets it to |5pt|. +\begindesc +\bix^^{盒子//过满盒子} +\bix^^{盒子//未满盒子} +\cts overfullrule {\param{dimen}} +\explain +这个参数设定 \TeX\ 附加在过满\minref{水平盒子}后的标线的宽度。\PlainTeX\ 将其设为 |5pt|。 +\enddesc + +\begindesc +\cts hbadness {\param{number}} +\cts vbadness {\param{number}} +\explain +%These parameters specify the thresholds of horizontal and vertical +%\minref{badness} for reporting underfull or overfull boxes. +%|\hbadness| applies to hboxes and |\vbadness| applies to vboxes. +%If the badness of a constructed box exceeds the threshold, +%\TeX\ will report an error. If you raise the thresholds +%(the \plainTeX\ defaults are both $1000$), +%\TeX\ will be less likely to complain. +%Note that the settings of |\hbadness| and |\vbadness| have no effect on +%the appearance of your typeset document; they only affect the error +%messages that you get. +%See \knuth{page~302} for a precise description +%of how \TeX\ decides when to complain about an overfull or underfull +%box. +这些参数设定了报告盒子未满或过满警告时的水平和竖直的\minref{恶劣状态}的阈值。|\hbadness| 适用于 hbox,而 |\vbadness| 适用于 vbox。如果一个盒子的恶劣状态超过了阈值,\TeX\ 将报告一个错误。如果你提高阈值(\plainTeX 的默认值是 $1000$),\TeX\ 将不再经常给出警告。需要注意的是,设定 |\hbadness| 和 |\vbadness| 对你的文档排版结果没有影响,它们只影响你获得的错误信息。参见 \knuth{page~302},以获得 \TeX\ 如何确定在什么时候对过满或未满盒子进行警告的准确描述。 + +%\margin{The material on tolerance was inappropriate here and has been +%removed. A new example replaces it.} +\margin{在这里讨论容许量的内容是不合适的,被去掉了。因此,采用一个新的例子取代了它。} +\example +\hbadness = 10000 % 取消任何关于 hbadness 的警告。 +\hbox to 2in{a b}\par +\hbadness = 500 % 当 hbadness 超过 500 就给出警告。 +\hbox to 2in{a\hskip 0pt plus .5in b} +| +\logproduces +Underfull \hbox (badness 5091) detected at line 4 +\tenrm a b + +\hbox(6.94444+0.0)x144.54, glue set 3.70787 +.\tenrm a +.\glue 0.0 plus 36.135 +.\tenrm b +| +\endexample +\enddesc + +\begindesc +\cts badness {} +\explain +%This command yields the numerical value of the badness of the \minref{box} +%(either horizontal or vertical) that \TeX\ has most recently produced. +%If the box was overfull, |\badness| will be $1000000$; in all other cases +%it will be between $0$ and $10000$. +该命令给出 \TeX\ 刚刚产生的(水平的或竖直的)\minref{盒子}的恶劣状态的数值。 +如果盒子是过满的,|\badness| 将是 $1000000$;在所有其它情况下,它将在 $0$ 至 $10000$ 之间。 +\enddesc + +\begindesc +\cts hfuzz {\param{dimen}} +\cts vfuzz {\param{dimen}} +\explain +%These parameters specify the amount that +%a \minref{box} can exceed its natural size before \TeX\ considers it to be +%overfull. ^^{boxes//overfull} +%|\hfuzz| applies to hboxes and |\vfuzz| applies to vboxes. +%\PlainTeX\ sets both parameters to |0.1pt|. +这些参数设置在 \TeX\ 认为一个盒子过满之前,一个\minref{盒子} 能够超出其本身大小的量。 +^^{盒子//过满盒子}|\hfuzz| 适用于水平盒子,而 |\vfuzz| 适用于竖直盒子。\PlainTeX\ 将两个参数均设为 |0.1pt|。 +\example +\hfuzz = .5in +\hbox to 2in{This box is longer than two inches.} +% 没有错误的结果。 +| +\produces +\hfuzz = .5in +\hbox to 2in{This box is longer than two inches.} +% No error results +\doruler{\8\8\8}3{in} +\endexample + +%\eix^^{boxes//overfull} +%\eix^^{boxes//underfull} +%\eix^^{box commands} +%\enddesc +\eix^^{盒子//过满盒子} +\eix^^{盒子//未满盒子} +\eix^^{盒子命令} +\enddesc + +%\see |\tolerance| \ctsref{\tolerance}. +\see |\tolerance| \ctsref{\tolerance}。 + +%========================================================================== +%\section {Retrieving the last item from a list} +\section {从列表中获取最后的项目} + +%\begindesc +%^^{boxes//last box in a list} +%^^{kerns//last kern in a list} +%^^{penalties//last penalty in a list} +%^^{glue//last glue item in a list} +%\margin{This section has been moved in its entirety from the chapter +%(`Commands for general operations')} +\begindesc +^^{盒子//列表中最后一个盒子} +^^{紧排//列表中最后一个紧排} +^^{惩罚//列表中最后一个惩罚项} +^^{粘连//列表中最后一个粘连} +\margin{这一节整个儿地从(“常规操作命令”)一章中移过来的。} +\cts lastkern {} +\cts lastskip {} +\cts lastpenalty {} +\cts lastbox {} +\explain +%These control sequences yield the value of the last item on the current +%list. They aren't true commands because they can only appear as +%part of an argument. +%If the last item on the list isn't of the indicated type, +%they yield a zero value (or an empty box, in the case of |\lastbox|). +%For example, +%if the last item on the current list is a \minref{kern}, +%|\lastkern| yields the dimension of that kern; if it +%isn't a kern, it yields a dimension of $0$. +这些控制序列产生位于当前列表最后的项目值。它们不是真正的命令,因为它们只能以参数的一部分出现。如果列表中的最后的项目不是指示类型,它们将给出零值(或者空盒子,在 |\lastbox| 的情况下)。例如,如果在当前列表中最后一项是一个\minref{紧排},|\lastkern| 给出那个紧排的尺寸;如果它不是紧排,它给出一个尺寸 $0$。 + +%Using |\lastbox| has the additional effect of removing the last box from +%the list. +%If you want the original |\last!-box| to remain on the list, you +%have to add a copy of it to the list. +%|\last!-box| is not permitted in a math list or in the main +%vertical~list. +使用 |\lastbox| 具有从列表中移除最后一个盒子的附加效应。如果你希望原来的 |\last!-box| 仍保留在列表中,你不得不向列表中增加它的一个拷贝。|\last!-box| 不允许用于数学列表或主竖直列表。 + +%These control sequences are +%most useful after macro calls that might have inserted entities of +%the indicated kinds. +这些控制序列在可能插入指标类型的宏调用后是非常有用的。 + +\example +\def\a{two\kern 15pt} +one \a\a\hskip 2\lastkern three\par +% 在`三'之前产生三倍的紧排。 +\def\a{\hbox{二}} +一 \a +\setbox0 = \lastbox % 将`二'去掉。 +三 \box0. +| +\produces +\def\a{二\kern 15pt} +一 \a\a\hskip 2\lastkern 三\par +% get three times as much space before `three' +\def\a{\hbox{二}} +一 \a +\setbox0 = \lastbox % removes `two' +三 \box0. +\endexample +\enddesc + +\begindesc +\cts unkern {} +\cts unskip {} +\cts unpenalty {} +\explain +%If the last item on the current list is of type \minref{kern}, +%\minref{glue}, or \minref{penalty} respectively, these commands remove it +%from that list. If the item isn't of the right type, these commands have +%no effect. Like ^|\lastbox|, you can't apply them to lists in math mode or to +%the main vertical list. +%These commands +%are most useful after a macro call that is known to have inserted +%a specific item that you don't want there. +%\TeX\ doesn't provide an ^|\unbox| command because |\lastbox| produces +%nearly the same effect. +如果当前列表的最后一项分别是\minref{紧排}、\minref{粘连}或\minref{惩罚}的类型,这些命令可以将它们从列表中去除。如果项目不是正确的类型,这些命令将不起作用。与 ^|\lastbox| 类似,你不能将它们应用于处于数学模式或主竖直列表中。在已知道会插入你不希望存在的特定项目的宏调用后,这些命令是非常有用的。\TeX\ 不提供 ^|\unbox| 命令,因为 |\lastbox| 产生了近乎一致的效果。 +\enddesc + + +%========================================================================== +%\section {Rules and leaders} +\section {标线与指引线} + +%\begindesc +%\bix^^{rules} +%\bix^^{horizontal rules} +%\bix^^{vertical rules} +\begindesc +\bix^^{标线} +\bix^^{水平标线} +\bix^^{竖直标线} +% +\cts hrule {} +\aux\cts hrule {\bt height \<dimen> width \<dimen> depth \<dimen>} +\cts vrule {} +\aux\cts vrule {{\bt width \<dimen> height \<dimen> depth \<dimen>}} +\explain +%The |\hrule| command produces a horizontal rule; the |\vrule| command +%produces a vertical rule. You can specify any or all of the width, +%height, and depth of the rule---\TeX\ supplies default values for those +%that you omit. You can give the dimensions of the rule in any order; +%the forms listed above show just two of the possible combinations. You +%can even give a dimension of a given kind more than once---if you do, +%the last one is the one that counts. +|\hrule| 命令用于产生水平的标线;相应的 |\vrule| 命令用于产生竖直的标线。 +你可以指定标线的宽度、高度或深度的任意或全部。 +\TeX\ 会为你省略的那些提供默认值。你可以以任何顺序给定标线的尺寸; +上面给出的形式只是可能的组合中的两个。 +你甚至可以为一个给定类型的尺寸给出多个值---如果你这么做,起作用的是最后一个值。 + +%If you don't specify the width of a horizontal rule, the rule is +%extended horizontally to the boundaries of the innermost \minref{box} or +%\minref{alignment} that contains the rule. If you don't specify the +%height of a horizontal rule, it defaults to |0.4pt|; if you don't +%specify the depth of a horizontal rule, it defaults to |0pt|. +如果你没有设定水平标线的宽度, +则标线将水平地扩展到包含标线的\minref{盒子}或\minref{阵列}的最内侧的边界。 +如果你没有设定水平标线的高度,其默认值是 |0.4pt|; +如果你没有设定水平标线的深度,其默认值是 |0pt|。 + +%If you don't specify the width of a vertical rule, it defaults to +%|0.4pt|. If you don't specify the height or the depth of a vertical +%rule, the rule is extended to the boundary of the innermost \minref{box} +%or \minref{alignment} that contains the rule. +如果你没有设定竖直标线的宽度,其默认值是 |0.4pt|; +如果你没有设定竖直标线的高度或深度, +则标线将地扩展到包含标线的\minref{盒子}或\minref{阵列}的最内侧的边界。 + +%\TeX\ treats a horizontal rule as an inherently vertical item +%and a vertical rule as an inherently horizontal item. +%Thus a horizontal rule is legal only in a \minref{vertical mode}, +%while a vertical rule is legal only in a \minref{horizontal mode}. +%^^{horizontal mode//rules in} +%^^{vertical mode//rules in} +%If this seems surprising, visualize it---a horizontal rule runs +%from left to right and separates vertical items in a sequence, while +%a vertical rule runs up and down and +%separates horizontal items in a sequence. +\TeX\ 以内在的竖直项目处理水平标线,而以内在的水平项目处理竖直标线。 +因此,水平标线只有\minref{竖直模式}下是有效的,而竖直标线只在\minref{水平模式}下是有效的。 +^^{水平模式//水平模式中的标线} +^^{竖直模式//竖直模式中的标线} +如果觉得意外,可以直观化地观测。水平标线从左向右移动,并且将竖直的项目有序地分开, +而竖直标线从上到下,将水平项目有序地分开。 + +\example +\hrule\smallskip +\hrule width 2in \smallskip +\hrule width 3in height 2pt \smallskip +\hrule width 3in depth 2pt +| +\produces +\medskip +\hrule\smallskip +\hrule width 2in \smallskip +\hrule width 3in height 2pt \smallskip +\hrule width 3in depth 2pt +\nextexample +% 在这里,你能看到基线与 \hrule 的高度与深度之间有的关系。 +\leftline{ + \vbox{\hrule width .6in height 5pt depth 0pt} + \vbox{\hrule width .6in height 0pt depth 8pt} + \vbox{\hrule width .6in height 5pt depth 8pt} + \vbox{\hbox{基线}\kern 3pt \hrule width .6in} +} +| +\produces +\medskip +\leftline{ + \vbox{\hrule width .6in height 5pt depth 0pt} + \vbox{\hrule width .6in height 0pt depth 8pt} + \vbox{\hrule width .6in height 5pt depth 8pt} + \vbox{\hbox{基线}\kern 3pt \hrule width .6in} +} +\nextexample +\hbox{( {\vrule} {\vrule width 8pt} )} +\hbox {( {\vrule height 13pt depth 0pt} + {\vrule height 13pt depth 7pt} x)} +% 圆括号定义了两个连续的盒子的高度与深度; +% 而 `x' 位于基线之上。 +| +\produces +\medskip +\hbox{( {\vrule} {\vrule width 8pt} )} +\hbox {( {\vrule height 13pt depth 0pt} + {\vrule height 13pt depth 7pt} x)} +\endexample + +%\eix^^{rules} +%\eix^^{horizontal rules} +%\eix^^{vertical rules} +%\enddesc +\eix^^{标线} +\eix^^{水平标线} +\eix^^{竖直标线} +\enddesc + +%\begindesc +%\bix^^{leaders} +%\easy\cts leaders {\<box or rule> \<skip command>} +%\cts cleaders {\<box or rule> \<skip command>} +%\cts xleaders {\<box or rule> \<skip command>} +%\explain +%These commands produce \minref{leaders}, i.e., they fill a +%horizontal or vertical space with +%copies of a pattern \seeconcept{leaders}. +%The \<box> or \<rule> specifies a leader, +%i.e., a single copy of the pattern, +%while the \<skip command> specifies a +%window to be filled with a +%row or a column of the leaders. +%The pattern is repeated as many times as will fit into the window. +%If \<skip command> is a horizontal skip, the window +%contains a row of leaders and \TeX\ must be in a horizontal mode; +%if \<skip command> is a vertical skip, the window +%contains a column of leaders and \TeX\ must be in a vertical mode. +\begindesc +\bix^^{指引线} +\easy\cts leaders {\<box or rule> \<skip command>} +\cts cleaders {\<box or rule> \<skip command>} +\cts xleaders {\<box or rule> \<skip command>} +\explain +这些命令用于产生\minref{指引线}, +也就是用某一个模式\seeconcept{指引线}的复本填充水平或竖直的间隔。 +\<box> 或 \<rule> 确定一个指引体,即模式的单个复本, +而 \<skip command> 确定了用一行或一列的指引体填充的窗体。 +模式将重复多次,直到填充了整个窗体。如果 \<skip command> 是一个水平的间距, +窗体中包括的是行向的指引线,\TeX\ 必须处于水平模式下; +如果 \<skip command> 是一个竖直的间距, +窗体中包括的是列向的指引线,\TeX\ 必须处于竖直模式下。 + +%The commands differ in how they arrange the repeated pattern in the space +%and where they put any leftover space: +这些命令的差异是它们在空间内如何组织重复的模式以及在什么地方放置剩余的间距: + +%\ulist\compact +%\li For |\leaders|, \TeX\ aligns a row of leaders with the left end of +%the innermost \minref{box} $B$ that is to contain the result of the +%|\leaders| command. +%It aligns a column of leaders with the top of $B$. +%Those leaders that fall entirely within the window are retained. +%Any leftover space at the top and bottom of the window is left empty. +%\li For |\cleaders|, the leaders are centered within the window. +%\li For |\xleaders| the pattern is uniformly distributed throughout the window. +%If the leftover space is $l$ and the leader is repeated $n$ times, +%\TeX\ puts space of width or height $l/(n+1)$ between adjacent leaders and +%at the two ends (left and right or top and bottom) of the leaders. +%\endulist +\ulist\compact +\li 对于 |\leaders|,\TeX\ 将一行指引线与包含 |\leaders| 这一命令结果的最内侧的\minref{盒子} $B$ 的左侧对齐。它将一列指引线与 $B$ 的顶端对齐。整个落在窗体中的指引线将被保留。任何在窗体顶部或底部剩余的间隔将空着。 +\li 对于 |\cleaders|,指引线在窗体内是居中的。 +\li 对于 |\xleaders|,模式是均匀分布在窗体中的。如果剩余空间是 $l$,指引体被重复 $n$ 次,\TeX\ 将在相邻的指引线以及指引线的两个端点(左和右或者上和下)之间填充宽度或高度为 $l/(n+1)$ 的间隔。 +\endulist + +\example +\def\pattern{\hbox to 15pt{\hfil.\hfil}} +\line{Down the Rabbit-Hole {\leaders\pattern\hfil} 1} +\line{The Pool of Tears {\leaders\pattern\hfil} 9} +\line{A Caucus-Race and a Long Tale {\cleaders\pattern + \hfil} 19} +\line{Pig and Pepper {\xleaders\pattern\hfil} 27} +| +\produces +\def\pattern{\hbox to 15pt{\hfil.\hfil}}\par +\line{Down the Rabbit-Hole {\leaders\pattern\hfil} 1} +\line{The Pool of Tears {\leaders\pattern\hfil} 9} +\line{A Caucus-Race and a Long Tale {\cleaders\pattern + \hfil} 19} +\line{Pig and Pepper {\xleaders\pattern\hfil} 27} +\nextexample +\def\bulletfill{\vbox to 3ex{\vfil\hbox{$\bullet$}\vfil}}% +\def\mybox{\vbox to 1in} +\def\myrule{\hrule width 4pt}\hsize=2in +\hrule \line{% + \mybox{\myrule depth 8pt \leaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 15pt \leaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 18pt \cleaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 12pt \xleaders\bulletfill\vfill}% +}\hrule +| +\produces +\medskip +\def\bulletfill{\vbox to 3ex{\vfil\hbox{$\bullet$}\vfil}}% +\def\mybox{\vbox to 1in}\def\myrule{\hrule width 4pt}\hsize=2in +\hrule \line{% + \mybox{\myrule depth 8pt \leaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 15pt \leaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 18pt \cleaders\bulletfill\vfill} + \hfil + \mybox{\myrule depth 12pt \xleaders\bulletfill\vfill}% +}\hrule +\endexample\enddesc + +%\begindesc +%\cts dotfill {} +%\cts hrulefill {} +%\explain +%^^{fill} +%These commands respectively fill the enclosing horizontal space with +%a row of dots on the baseline and with +%a horizontal line on the baseline. +%It's usually a good idea to leave a space between +%|\dotfill| or |\hrulefill| +%and any text that precedes or follows it (see the example below). +\begindesc +\cts dotfill {} +\cts hrulefill {} +\explain +^^{填充} +这些命令分别采用一行位于基线上的点和水平线填充封闭的水平空间。 +通常,在 |\dotfill| 或 |\hrulefill| 与任何其之前或之后的文字之间留一个空格是一个好的主意(参见下面的例子)。 +\example +\hbox to 3in{开始 {\dotfill} 结束} +\hbox to 3in{瑞典语 {\hrulefill} 芬兰语} +| +\produces +\par\hbox to 3in{开始 {\dotfill} 结束} +\hbox to 3in{瑞典语 {\hrulefill} 芬兰语} +\endexample\enddesc + +%\begindesc +%\cts leftarrowfill {} +%\cts rightarrowfill {} +%\explain +%^^{fill} +%These commands fill the enclosing horizontal space with +%left-pointing or right-pointing ^{arrows}. +\begindesc +\cts leftarrowfill {} +\cts rightarrowfill {} +\explain +^^{填充} +这些命令用向左或向右的^{箭头}来填充封闭的水平空间。 +\example +\hbox to 3in{\vrule \rightarrowfill \ 3 in + \leftarrowfill\vrule} +| +\produces +\medskip +\hbox to 3in{\vrule \rightarrowfill \ 3 in + \leftarrowfill\vrule} +\endexample + +%\eix^^{leaders} +%\enddesc +\eix^^{指引线} +\enddesc + +%========================================================================== +%\section {Alignments} +\section {阵列} + +%========================================================================== +%\subsection {Tabbing alignments} +\subsection {制表阵列} + +%\begindesc +%\bix^^{tabbing alignments} +%\bix^^{alignments//commands for} +%% +%\ctspecial + {{\bt \<text>\thinspace\&\thinspace\<text>% +% \thinspace\& $\cdots$ \\cr}} +%\ctsxrdef{@plus} +%\cts tabalign {} +%\explain +\begindesc +\bix^^{制表阵列} +\bix^^{阵列//用于阵列的命令} +% +\ctspecial + {{\bt \<text>\thinspace\&\thinspace\<text>% + \thinspace\& $\cdots$ \\cr}} +\ctsxrdef{@plus} +\cts tabalign {} +\explain +%These commands begin a single line in a tabbed \minref{alignment}. +%The only difference between |\+| and |\tabalign| is that +%|\+| is an outer macro---you can't use it when \TeX\ is reading tokens at +%high speed \seeconcept{outer}. +在制表\minref{阵列}中,这些命令开始单独的一行。 +|\+| 与 |\tabalign| 之间唯一的不同在于 |\+| 是一个外部宏, +当 \TeX\ 高速读取记号时,你不能使用它\seeconcept{外部的}。 + +%If you place an `|&|' at a position +%to the right of all existing tabs in a tabbing alignment, +%the `|&|' establishes a new tab at that position. +在制表阵列中,如你将 `|&|' 放在所有已经存在的制表符的右侧,那么 `|&|' 将在那个位置上建立一个新的制表符。 +\example +\cleartabs % Nullify any previous \settabs. +\+ {\bf if }$a[i] < a[i+1]$ &{\bf then}&\cr +\+&&$a[i] := a[i+1]$;\cr +\+&&{\it found }$:=$ {\bf true};\cr +\+&{\bf else}\cr +\+&&{\it found }$:=$ {\bf false};\cr +\+&{\bf end if};\cr +| +\produces +\cleartabs % Nullify any previous \settabs. +\+ {\bf if }$a[i] < a[i+1]$ &{\bf then}&\cr +\+&&$a[i] := a[i+1]$;\cr +\+&&{\it found }$:=$ {\bf true};\cr +\+&{\bf else}\cr +\+&&{\it found }$:=$ {\bf false};\cr +\+&{\bf end if};\cr +\endexample +\enddesc + +\begindesc +\cts settabs {\<number> {\bt \\columns}} +\aux\cts settabs {{\bt \\+} \<sample line> {\bt \\cr}} +\explain +%The first form of +%this command defines a set of tab stops ^^{tabs} +%for a tabbing \minref{alignment}. +%It tells \TeX\ to set the tab stops so as to divide each line into +%\<number> equal parts. \TeX\ takes the length of a line to be +%|\hsize|, as usual. You can make the alignment narrower by decreasing +%|\hsize|. +这个命令的第一种形式为制表\minref{阵列}定义一系列制表符^^{制表符}的停止位置。 +它告诉 \TeX\ 设置制表符停止位置以便将每一行分成 \<number> 等份。 +\TeX\ 仍将行的长度设为 |\hsize|。你可以通过减小 |\hsize| 来使得阵列更加紧密。 +%\margin{paragraph ``The tab settings $\ldots$'' moved to below.} +\margin{``制表符设定 $\ldots$''一段被移到下面了。} +\example +{\hsize = 3in \settabs 3 \columns +\+$1$&一&第一\cr +\+$2$&二&第二\cr +\+$3$&三&第三\cr} +| +\produces +{\hsize = 3in \settabs 3 \columns +\+$1$&一&第一\cr +\+$2$&二&第二\cr +\+$3$&三&第三\cr} + +\noindent\doruler{\8\8\8}3{in} +\smallskip +\endexample + +%The second form of this command defines tab stops by setting the tab stops +%at the positions indicated by the `|&|'s in the sample line. +%The sample line itself does not appear in the output. When you +%use this form you'll usually want to put material into the sample line that is +%somewhat wider than the widest corresponding material in the alignment, +%in order to produce space between the columns. +%That's what we've done in the +%example below. The material following the last tab +%stop is irrelevant, since \TeX\ does not need to position +%anything at the place where the |\cr|~appears. +这个命令的第二利形式是利用样例行中的 `|&|' 指示的位置来定义制表符停止位置。样例行本身不会出现在最终输出中。当你使用这种形式,你通常希望将一些宽度大于需要排列的最宽的内容放在样例行中,以便在列之间产生间隔。正象我们在下面的例子中所做的那样。最后一个制表符后的内容是无关紧要的,因为 \TeX\ 在 |\cr| 出现的地方不需要任何位置指示。 + +%The tab settings established by |\settabs| remain in effect until +%you issue a new |\settabs| command or end a group containing +%the |\settabs| command. +%This is true for both forms of the command. +由 |\settabs| 建立起来的制表符设置一直有效,直到你使用一个新的 |\settabs| 命令或结束包含 |\settabs| 命令的编组。该命令的两种形式都是这样的。 + +\example +% The first line establishes the template. +\settabs \+$1$\qquad & three\quad & seventh\cr +\+$1$&一&第一\cr +\+$2$&二&第二\cr +\+$3$&三&第三\cr +| +\produces +\settabs \+$1$\qquad & three\quad & seventh\cr % the sample line +\+$1$&一&第一\cr +\+$2$&二&第二\cr +\+$3$&三&第三\cr +\smallskip +\endexample +\enddesc + +\begindesc + +\cts cleartabs {} +\explain +%This command clears all the tabs to the right of the current column. +%Its main use is in applications such as typesetting computer programs +%in which the tab positions change from line to line. +这个命令消除位于当前列右侧的所有制表符。它主要用于排版计算机程序等一些应用,在这类应用中,从一行至另一行,制表符的位置是变化的。 +\enddesc + +%\see |\cr|, |\endline|, |\crcr| (\xref \endline). +%\eix^^{tabbing alignments} +\see |\cr|、|\endline|、|\crcr|(\xref \endline )。 +\eix^^{制表阵列} + +%========================================================================== +%\subsection {General alignments} +\subsection {常规阵列} + +\begindesc +\cts halign {{\bt \rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}} + \xrdef{@and}\xrdef{@pound} +\aux\cts halign {{\bt to \<dimen>% + \rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}} +\aux\cts halign {{\bt spread \<dimen>% + \rqbraces{\<preamble> \\cr \<row> \\cr $\ldots$ \<row> \\cr}}} +\explain +%This command produces a horizontal \minref{alignment} consisting of a +%sequence of rows, where each row in turn contains a sequence of column +%entries. \TeX\ adjusts the widths of the column entries to accommodate +%the widest one in each column. +这一命令产生由一系列行组成的水平的\minref{阵列},每一行又包括了一系列的列。\TeX\ 调节列的宽度以容纳每一列中最宽的那一个条目。 + +%A horizontal alignment can only appear when \TeX\ is in a vertical +%\minref{mode}. We recommend that you first study alignments in general +%(\xref{alignment}) before you attempt to use this command. +只有当 \TeX\ 位于竖直\minref{模式}下水平阵列才能出现。 +我们建议你在使用该命令之前首先学习一下常见的阵列(\xref{阵列})。 + +%An alignment consists of a ^{preamble} +%followed by the text to be aligned. The preamble, +%which describes the layout of the rows that follow, consists of a +%sequence of column templates, separated by `|&|' and ended +%by |\cr|. +阵列由^{导言}和随后的需要排列的文字构成。导言描述随后行的版式, +由一系列列的模板构成,列之间由 `|&|' 分隔,用 |\cr| 作为结束标志。 +%\bix^^{template} +%\bix^^{entry (column or row)} +%Each row consists of a sequence of column +%entries, also separated by `|&|' and ended by |\cr|. Within +%a template, `|#|' indicates where \TeX\ should insert the +%corresponding text of a column entry. +%In contrast, |\settabs| uses a fixed implicit template of `|#|', +%i.e., it just inserts the text as is. +\bix^^{模板} +\bix^^{条目(在行或列中)} +每一行由一系列列的条目构成,也由 `|&|' 分隔,用 |\cr| 作为结束标志。 +在模板中,`|#|' 表示 \TeX\ 应该在一个列条目中插入相应文字的位置。 +与之相反,|\settabs| 使用 `|#|' 的固定隐式模板,即它只插入文字本身。 + +%\TeX\ typesets each column entry in restricted horizontal mode, +%i.e., as the contents of an \minref{hbox}, +%and implicitly encloses it in a group. +\TeX\ 在受限水平模式中对每一列条目进行排版,即像 \minref{hbox} 的内容一样,并且隐式地将它封闭在一个编组中。 + +%The |to| form of this command instructs \TeX\ +%to make the width of the alignment be \<dimen>, +%adjusting the space between columns as necessary. +%The |spread| form of this command instructs \TeX\ +%to make the alignment wider by \<dimen> than its natural width. +%These forms are like the corresponding forms of |\hbox| \ctsref\hbox. +这个命令的 |to| 形式指导 \TeX\ 构造一个宽度为 \<dimen> 的阵列,在需要的时候调节列的间距。 +这个命令的 |spread| 形式指导 \TeX\ 构造一个比其本身宽度再宽 \<dimen> 的阵列。 +这些形式与 |\hbox|\ctsref\hbox 相应的形式是类似的。 + +%See |\tabskip| \ctsref\tabskip{} for an example using the +%|to| form. +参见 |\tabskip| \ctsref\tabskip{}中使用 |to| 形式的例子。 + +\example +\tabskip = 1em \halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +| +\produces +\tabskip = 1em \halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +\endexample +\enddesc + +\begindesc +{\tighten +\cts valign {{\bt \rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$ + \<column>\\cr}}} +\aux\cts valign {{\bt to \<dimen>% + \rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$ \<column>\\cr}}} +\aux\cts valign {{\bt spread \<dimen>% + \rqbraces{\<preamble>\\cr \<column>\\cr $\ldots$ \<column>\\cr}}} +\par} +\explain +%This command produces a vertical \minref{alignment} +%consisting of +%a sequence of columns, where each column in turn contains a sequence +%of row entries. +%\TeX\ adjusts the heights of the row entries to accommodate the tallest one +%in each row. +这一命令产生由一系列列组成的竖直的\minref{阵列},每一列又包括了一系列的行。 +\TeX\ 调节行的高度以容纳每一列中最高的那一个条目。 + +%A vertical alignment +%can only appear when \TeX\ is in a horizontal \minref{mode}. +%Because vertical alignments are (a)~conceptually somewhat difficult and +%(b)~not often used, we recommend that you learn about +%alignments in general +%(\xref{alignment}) and the |\halign| command (see above) before +%you attempt to use the |\valign| command. +只有当 \TeX\ 位于水平\minref{模式}下竖直阵列才能出现。 +因为竖直阵列(a)在概念上有一些困难,并且(b)不经常使, +因此,我们建议在你试图使用 |\valign| 命令之前首先学习一下常见的阵列(\xref{阵列})% +以及 |\halign| 命令(参见上面的描述)。 + +%An alignment consists of a ^{preamble} +%followed by the text to be aligned. The preamble, +%which describes the layout of the columns that follow, +%consists of a +%sequence of row templates, separated by `|&|' and ended +%by |\cr|. +阵列由^{导言}和随后的需要排列的文字构成。导言描述随后列的版式, +由一系列行的模板构成,列之间由 `|&|' 分隔,用 |\cr| 作为结束标志。 +%\bix^^{template} +%Each column consists of a sequence of ^{row} +%entries, also separated by `|&|' and ended by |\cr|. Within +%a template, `|#|' indicates where \TeX\ should insert the +%corresponding text of a row entry. +\bix^^{模板} +每一列由一系列行的条目构成,也由 `|&|' 分隔,用 |\cr| 作为结束标志。 +在模板中,`|#|' 表示 \TeX\ 应该在一个行条目中插入相应文字的位置。 + +%\TeX\ typesets each row entry in internal vertical +%mode, i.e., as the contents of a \minref{vbox}, +%and implicitly encloses the entry in a group. +%It always gives the vbox zero depth. +%Any text or other horizontal mode material in a row entry then puts \TeX\ +%into ordinary horizontal mode. +%(This is just an application of the general rules for \TeX's behavior +%in internal vertical mode.) +%The usual paragraphing parameters apply in this case: +%the row entry has an initial +%indentation of |\parindent| (\xref\parindent) and +%its lines have the +%|\leftskip| and |\rightskip| (\xref\leftskip) \minref{glue} +%appended to~them. +\TeX\ 在内部竖直模式中对每一行条目进行排版,即像\minref{竖直盒子}的内容一样, +并且隐式地将它封闭在一个编组中。它总是将 vbox 的深度设为零。 +随后,列中的任何文字或其它水平模式内容将 \TeX\ 带回通常的水平模式。% +(这只是在内部竖直模式下 \TeX 行为常见准则的一个应用。)常见的段落参数适用于这种情形: +行条目具有 |\parindent|(\xref\parindent )的起始缩进, +而且它的每一行都附加了 |\leftskip| 和 |\rightskip|(\xref\leftskip )\minref{粘连}。 + +%Note in particular that a row entry containing text has +%a width of |\hsize| (\xref\hsize). Unless you reset +%|\hsize| to the row width that you want, you're likely to +%encounter overfull \minref{hbox}es, or find that +%the first column takes up the width of the entire page, or both. +尤其需要注意的是,列条目包含的文字具有 |\hsize|(\xref\hsize )的宽度。 +除非你重新设置 |\hsize| 到你希望得到的行宽,否则你总能遇到过满\minref{水平盒子}的情况, +或者发现第一列占据了整页的宽度,或者两种情况都会出现。 +\eix^^{条目(在行或列中)} + +%Normally, you need to include a \minref{strut} +%^^{struts//in vertical alignments} +%in each +%template so that the rows don't come out crooked as a result +%of the varying heights of the entries in the alignment. You +%can produce a strut with the |\strut| command. +正常情况下,你需要在每个模板中包括\minref{支架}^^{支架//在竖直阵列中}, +以便行不会由于阵列中条目高度的变化而变得弯曲。你可以使用 |\strut| 获得支架。 + +%The |to| form of this command instructs \TeX\ +%to make the vertical extent of the alignment be \<dimen>, +%adjusting the space between rows as necessary. +%The |spread| form of this command instructs \TeX\ +%to make the alignment taller by \<dimen> than its natural height. +%These forms are like the corresponding forms of |\vbox| \ctsref\vbox. +这个命令的 |to| 形式指导 \TeX\ 构造一个竖直伸展为 \<dimen> 的阵列,在需要的时候调节行的间距。 +这个命令的 |spread| 形式指导 \TeX\ 构造一个比其本身高度再高 \<dimen> 的阵列。 +这些形式与 |\vbox| \ctsref\vbox 相应的形式是类似的。 + +\example +{\hsize=1in \parindent=0pt +\valign{#\strut&#\strut&#\strut&#\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +| +\produces +{\hsize=1in \parindent=0pt \leftskip=0pt +\valign{#\strut&#\strut&#\strut&#\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +\nextexample +% 与上例相同的内容,但没有支架 +%(这个例子显示了支架存在的必要性)。 +{\hsize=1in \parindent=0pt +\valign{#&#&#&#\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +| +\produces +{\hsize=1in \parindent=0pt \leftskip=0pt +\valign{#&#&#&#\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +\endexample +\enddesc + +\begindesc +\cts ialign {} +\explain +%This command behaves just like ^|\halign|, +%except that it first sets the |\tabskip| glue to zero and +%sets |\everycr| empty. +除了首先将 |\tabskip| 粘连设为零,并将 |\everycr| 清空以外,这个命令的行为与 ^|\halign| 相似。 +\enddesc + +\begindesc +\cts cr {} +\explain +%This command ends the preamble of a horizontal or vertical +%alignment, a row of a horizontal or tabbing alignment, +%or a column of a vertical alignment. +%You can cause \TeX\ to take certain actions whenever it sees a |\cr| +%by setting the value of the ^|\everycr| parameter \ctsref\everycr. +这个命令用于结束水平或竖直阵列的导言、水平的或制表阵列的行,或竖直阵列的列。你可以通过设置 ^|\everycr|\ctsref\everycr 参数的值,引导 \TeX\ 采取特定的行动,无论什么时候它遇到 |\cr|。 +\enddesc + +\begindesc +\cts endline {} +\explain +%This command is a synonym for the ^|\cr| command. It is useful when +%you've redefined |\cr| but still need access to the original definition. +这个命令是 ^|\cr| 的另一种形式。在你重新定义了 |\cr|,但还需要利用其原始的定义是,这个命令是有用的。 +\enddesc + +\begindesc +\cts crcr {} +\explain +%This command behaves just like ^|\cr|, except that \TeX\ ignores it if +%it comes immediately after a |\cr| or a ^|\noalign|. +%Its main application is as a safety measure to avoid a misleading error +%message caused by a \minref{macro} that expects an argument ending in |\cr|. +%If you put |\crcr| after the `|#|$n$' that denotes such an argument +%in the macro's definition, the +%macro will work properly whether or not the argument ends with |\cr|. +如果该命令紧随 |\cr| 或 ^|\noalign| 之后出现,\TeX\ 会忽略它。除此之外,它的行为与 ^|\cr| 类似。它主要的应用是作为一种安全措施以避免由期望以 |\cr| 作为结束符的\minref{宏包}而引起的错误信息。如果你将 |\crcr| 放在用以表示宏定义中此类参数的后面,宏将正常工作,无论其参数是否以 |\cr| 作为结束标记。 +\enddesc + +\begindesc +\cts omit {} +\explain +%This command tells \TeX\ to ignore a template in a horizontal or vertical +%\minref{alignment} while processing a particular column or row entry +%respectively. +%|\omit| must appear as the first item in a column or row entry; in effect, +%it overrides the template from the preamble with the simple +%template `|#|'. +这个命令告诉 \TeX\ 在处理特定的列或行条目时,忽略水平的或竖直的\minref{阵列} 中的一个模板。|\omit| 必须以第一个项目出现在列或行条目中,它有效地使用简单的模板 `|#|' 覆盖来自导言中的模板。 + +\example +\tabskip = 2em\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + \omit \dotfill 法国\dotfill&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} + +| +\produces +\tabskip = 2em\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + \omit \dotfill 法国\dotfill&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +\nextexample +{\hsize=1.2in \parindent=0pt +\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&\omit\strut{\bf MARINARA!!}&mayonnaise&mustard\cr + rarebit&tartar\cr}} +| +\produces +{\hsize=1.2in \parindent=0pt \leftskip=0pt +\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&\omit\strut{\bf MARINARA!}&mayonnaise&mustard\cr + rarebit&tartar\cr}} +\endexample +\enddesc + +\begindesc +\cts span {} +\explain +%The meaning of this command depends on whether it appears in a preamble +%or in an alignment entry. +%\ulist +%\li Normally, \TeX\ does not expand tokens in the preamble +%when it reads them. +%Putting |\span| in front of a token in the preamble causes +%that token to be expanded immediately according to \TeX's usual rules +%of \minref{macro} expansion. +%\li Putting |\span| instead of `|&|' between two column or row entries +%causes those columns or rows to be combined. +%For a horizontal alignment, +%the width of the combined column is the sum of the +%widths of the component columns. +%For a vertical alignment, +%the height of the combined row is the sum of the +%heights of the component rows. +%The template of the combined column or combined row forms a single group, +%so font-setting commands preceding a |\span| affect everything up to +%the next `|&|'. +%\endulist +%\noindent +%|\span| is rarely useful by itself outside of a template, +%but it provides the basic mechanism +%for defining ^|\multispan|. +这个命令的意义取决于它出现在导言中,还是在阵列条目中。 +\ulist +\li 通常,\TeX\ 并不扩展它读入的导言中的记号。将 |\span| 放在导言中记号的前面,根据\minref{宏}扩展的 \TeX 常用规则,会导致这些记号立即得到扩展。 +\li 用 |\span| 取代 `|&|',放在两列或两行条目之前,会导致这些列或行合并到一起。对于水平阵列,合并的列的宽度是列成员宽度之和。对于竖直阵列,合并的行的高度是行成员高度之和。合并的行或合并的列的模板形成一个编组,因此,在 |\span| 前的字体设置命令影响下一个 `|&|' 前的一切。 +\endulist +\noindent +|\span| 很少单独用在模板之外,但它为定义 ^|\multispan| 提供了基本的机制。 +\enddesc + +\begindesc +\cts multispan {\<number>} +\explain +%This command tells \TeX\ that the following +%\<number> columns in a row of a horizontal alignment, +%or +%\<number> rows in a column of a vertical alignment, +%should be combined into a single column or row (as with +%|\span|) and that their templates should be omitted (as with |\omit|). +该命令告诉 \TeX ,随后水平阵列的行中的 \<number> 列或竖直阵列的列中的 \<number> 行应该合并成一个单独的列或行(就像 |\span| 那样),并且它们的模板应该被忽略(就像 |\omit| 那样)。 + +\example +\tabskip = 13pt\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷& + \multispan 2 \hfil\it(无信息)\hfil \cr + 日本&东京&日元&0.0829\cr} +| +\produces +\tabskip = 13pt\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷& + \multispan 2 \hfil\it(无信息)\hfil \cr + 日本&东京&日元&0.0829\cr} +\nextexample +{\hsize=1.2in \parindent=0pt +\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr + bernaise&curry&hoisin&hollandaise\cr + \multispan 3$$\left\{{{\rm ketchup}\atop{\rm marinara}} + \right\}$$&mustard\cr + rarebit&tartar\cr}} +| +\produces +{\hsize=1.2in \parindent=0pt \leftskip=0pt +\valign{(#)\strut&(#)\strut&(#)\strut&(#)\strut\cr + bernaise&curry&hoisin&hollandaise\cr + \multispan 3$$\left\{{{\rm ketchup}\atop{\rm marinara}} + \right\}$$&mustard\cr + rarebit&tartar\cr}} +\endexample + +%\eix^^{template} +%\enddesc +\eix^^{模板} +\enddesc + +\begindesc +\cts noalign {\rqbraces{\<vertical mode material>}} +\aux\cts noalign {\rqbraces{\<horizontal mode material>}} +\explain +%This command inserts +%\<vertical mode material> +%after the current row of a horizontal \minref{alignment} or +%\<horizontal mode material> after the current column of a vertical +%\minref{alignment}. +%The material can be text, glue, a rule, or anything else. +该命令在水平\minref{阵列}的当前行之后插入 \<vertical mode material>,或者在竖直\minref{阵列}的当前列之后插入 \<horizontal mode material>。插入的内容可以是文本、粘连、标线,或者其它任何东西。 + +%The most common use of |\noalign| +%is to put extra space after a row or column. +%If you want to put extra space after \emph{every\/} row of a horizontal +%alignment, use ^|\openup| (\xref\openup). +|\noalign| 最常见的用途是在一行或列后插入额外的间隔。如果你希望在水平阵列的\emph{每}行后都插入额外的间隔,可以使用 ^|\openup|(\xref\openup)。 + +\example +\halign{% + \hfil\it#\hfil\tabskip=2em&\hfil#\hfil&#& + \hfil\$#\tabskip=0em\cr + % 改变 \tabskip 将阻止下面的标线突出来。 + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + \noalign{\smallskip\hrule\smallskip} + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +| +\produces +\halign{% + \hfil\it#\hfil\tabskip=2em&\hfil#\hfil&#& + \hfil\$#\tabskip=0em\cr + % The \tabskip changes prevent the rule below + % from sticking out. + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + \noalign{\smallskip\hrule\smallskip} + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +\nextexample +{\hsize=1in \parindent=0pt +\valign{#\strut&#\strut&#\strut&#\strut\cr + \noalign{\vrule width 2pt\quad} + bernaise&curry&hoisin&hollandaise\cr + \noalign{\vrule width 2pt\quad} + ketchup&marinara&mayonnaise&mustard\cr + \noalign{\vrule width 2pt\quad} + rarebit&tartar\cr + \noalign{\vrule width 2pt\quad}}} +| +\produces +\medskip +{\hsize=1in \parindent=0pt +\valign{#\strut&#\strut&#\strut&#\strut\cr + \noalign{\vrule width 2pt\quad} + bernaise&curry&hoisin&hollandaise\cr + \noalign{\vrule width 2pt\quad} + ketchup&marinara&mayonnaise&mustard\cr + \noalign{\vrule width 2pt\quad} + rarebit&tartar\cr + \noalign{\vrule width 2pt\quad}}} +\endexample +\enddesc + +\begindesc +\cts tabskip {\param{glue}} +\explain +%This parameter specifies the amount of horizontal or vertical glue +%that \TeX\ puts between the +%columns of a horizontal alignment or between the +%rows of a vertical alignment. +%\TeX\ also puts the |\tabskip| glue +%to the left of the first column and to the right of the last column +%of a horizontal alignment, and +%above the first row +%and below the last row of a vertical alignment. +%You can change |\tabskip| within a template---% +%the change will affect the glue associated with all the following +%|&|'s as well as the glue after the last row or column. +该参数指定 \TeX 在水平阵列的列之间或竖直阵列的行之间放置水平或竖直粘连的量。\TeX\ 也在水平阵列的第一列的左侧和最后一行的右侧,以及竖直阵列的第一行的上端和最后一行的下端放置 |\tabskip| 粘连。你可以在模板中改变 |\tabskip|---这一改变将影响所有紧接其后的 |&| 的粘连以及最后一行或列之后的粘连。 +\example +\halign to 3.5in{% + \hfil\it#\tabskip = 2em plus 8pt + \hfil&\hfil#\hfil&#\tabskip = 1em + &\hfil\$#\tabskip = 0em\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +| +\produces +\halign to 3.5in{% + \hfil\it#\tabskip = 2em plus 8pt + \hfil&\hfil#\hfil&#\tabskip = 1em + &\hfil\$#\tabskip = 0em\cr + 美国&华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +\nextexample +{\hsize = 1in \parindent=0pt \tabskip=5pt +\valign{#\strut&#\strut\tabskip = 3pt + &#\strut&#\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +| +\produces +{\hsize = 1in \parindent=0pt \tabskip=5pt +\valign{#\strut&#\strut\tabskip = 3pt + &#\strut&#\strut\cr + bernaise&curry&hoisin&hollandaise\cr + ketchup&marinara&mayonnaise&mustard\cr + rarebit&tartar\cr}} +\endexample +\enddesc + +\begindesc +\cts hidewidth {} +\explain +%This command tells \TeX\ to ignore the width of the next column entry in a +%horizontal alignment. It's useful when you have an entry that is longer +%than most of the others in the same column, +%and you'd rather have that entry stick out of the column than +%make all the entries +%in the column wider. If the |\hidewidth| is at the left of the +%entry, the entry sticks out to the left; if the |\hidewidth| is at the +%right of the entry, the entry sticks out to the~right. +该命令告诉 \TeX\ 忽略水平阵列中下一个列条目的宽度。如果你有一个条目长于同一列中其它大多数,并且 ,你希望条目伸到列外,而不是使得该条目所在列变得更宽时,该命令是有用的。如果 |\hidewidth| 在条目的左侧,则条目向左伸展;如果 |\hidewidth| 在条目的右侧,则条目向右伸展。 +\example +\tabskip = 25pt\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&\hidewidth 华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +| +\produces +\tabskip = 25pt\halign{% + \hfil\it#\hfil&\hfil#\hfil&#&\hfil\$#\cr + 美国&\hidewidth 华盛顿&美元&1.00\cr + 法国&巴黎&法朗&0.174\cr + 以色列&耶路撒冷&新谢克尔&0.507\cr + 日本&东京&日元&0.0829\cr} +\endexample +\enddesc + +\begindesc +\cts everycr {\param{token list}} +\explain +%\TeX\ expands \<token list> whenever it executes +%a |\cr|---at the end of every preamble, +%at the end of every row of a horizontal alignment, +%and at the end of every column of a vertical alignment. +%The |\everycr| commands are expanded just after the |\cr|. +%Thus you can cause \TeX\ to +%execute certain commands at the end of a preamble, row, or column by +%assigning a list of those commands to |\everycr|. +无论什么时候,当 \TeX\ 遇到处于每个导言结尾处、水平阵列的每行结尾处以及竖直阵列的每列结尾处的|\cr| 时,它扩展 \<token list>。|\everycr| 只在 |\cr| 后扩展。因此,你可以通过向 |\everycr| 赋与导言、行、列相关列表,引导 \TeX\ 在导言、行或列的结尾处执行特定的命令。 + +%The |\everycr| tokens shouldn't include any commands other than |\no!-align|. +%That's because +%the |\everycr| tokens will reappear after the last +%|\cr| of the alignment. A command other than +%|\noalign| will then make \TeX\ think that it's starting a new +%row or column. +%\TeX\ will complain about a missing |\cr|, insert +%a |\cr|, insert the |\everycr| tokens again, and repeat these actions +%indefinitely. +|\everycr| 的记号不应该包括 |\no!-align| 以外的任何命令。这是因为,|\everycr| 记号会出现在阵列的最后一个 |\cr|。任何一个非 |\no!-align| 命令会导致 \TeX\ 认为它新开了一行或一列,因此,\TeX\ 会报怨丢失了 |\cr|,插入 |\cr|,再次插入 |\everycr| 记号,并且无限地重复这些动作。 + +\example +\everycr={\noalign{\smallskip\hrule\smallskip}} +\halign{#\tabskip = 11pt&\hfil#\hfil&\hfil#\hfil + \tabskip = 0pt\cr + $1$&一&第一\cr + $2$&二&第二\cr + $3$&三&第三\cr} +| +\produces +\medskip +\everycr={\noalign{\smallskip\hrule\smallskip}} +\halign{#\tabskip = 11pt&\hfil#\hfil&\hfil#\hfil + \tabskip = 0pt\cr + $1$&一&第一\cr + $2$&二&第二\cr + $3$&三&第三\cr} +\endexample + +%\eix^^{alignments//commands for} +%\enddesc +\eix^^{阵列//用于阵列的命令} +\enddesc + +\enddescriptions + +\ifoldeplain\else\ifcompletebook\else +\vskip4em{\sectionfonts\leftline{本章索引}} +\readindexfile{i} +\fi\fi + +\endchapter +\byebye |