-
Notifications
You must be signed in to change notification settings - Fork 17
/
chapter26.tex
231 lines (201 loc) · 9.8 KB
/
chapter26.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
% -*- coding: utf-8 -*-
% Translated by inkydragon@github
% Date of translated: 2018-05-10
\documentclass{book}
\input{preamble}
\setcounter{chapter}{25}
\begin{document}
%\chapter{Page Shape}\label{page:shape}
\chapter{页面形状}\label{page:shape}
%This chapter treats some of the parameters that
%determine the size of the page and how it appears on paper.
本章讨论一些决定页面大小及其在纸面上显示的参数。
%\label{cschap:topskip}\label{cschap:hoffset}\label{cschap:voffset}\label{cschap:vsize2}\label{cschap:maxdepth}\label{cschap:splitmaxdepth2}
%\begin{inventory}
%\item [\cs{topskip}]
% Minimum distance between the top of the page box
% and the baseline of the first box on the page.
% Plain \TeX\ default:~\n{10pt}
\label{cschap:topskip}\label{cschap:hoffset}\label{cschap:voffset}\label{cschap:vsize2}\label{cschap:maxdepth}\label{cschap:splitmaxdepth2}
\begin{inventory}
\item [\cs{topskip}]
页面盒子的顶部到本页第一个盒子基线的最小距离。
Plain \TeX\ 默认值:~\n{10pt}
%\item [\cs{hoffset \cs{voffset}}]
%\mdqon
% Distance by which the page is shifted right/""down
%\mdqoff
% with respect to the reference point.
\item [\cs{hoffset \cs{voffset}}]
\mdqon
页面相对参考点向左/""向下移动的距离。
\mdqoff
%\item [\cs{vsize}]
% Height of the page box.
% Plain \TeX\ default:~\n{8.9in}
\item [\cs{vsize}]
页面盒子的高度。
Plain \TeX\ 默认值:~\n{8.9in}
%\item [\cs{maxdepth}]
% Maximum depth of the page box.
% Plain \TeX\ default:~\n{4pt}
\item [\cs{maxdepth}]
页面盒子的最大深度。
Plain \TeX\ 默认值:~\n{4pt}
%\item [\cs{splitmaxdepth}]
% Maximum depth of a box split off by a \cs{vsplit} operation.
% Plain \TeX\ default: \cs{maxdimen}
\item [\cs{splitmaxdepth}]
一个盒子能被一个 \cs{vsplit} 操作分割的最大深度。
Plain \TeX\ 默认值: \cs{maxdimen}
%\end{inventory}
\end{inventory}
%%\point The reference point for global positioning
%\section{The reference point for global positioning}
%\point The reference point for global positioning
\section{全局定位基准点}
%The \indexterm{page positioning} on the paper is governed by
%a \TeX\ convention, to which output device drivers
%must adhere, that the top left point of the page is
%one inch from the page edges. Unfortunately this
%may lead to lots of trouble, for instance if a printer
%(or the page description language it uses)
%takes, say, the {\em lower\/} left corner as the
%reference point, and is factory set to US paper sizes,
%but is used with European standard A4 paper.
纸张上的页面定位(\indexterm{page positioning})由 \TeX\ 的惯例决定:即页面的左上角距离页边1英寸,这也是输出设备必须如实反映的。
不幸的是,这可能会导致许多麻烦,考虑以下情形:一台打印机,或打印机使用的页面描述语言把\emph{左下角}当作基准点,并且打印机出厂默认设为美国纸张大小,但打印机用了欧洲的标准A4纸。
%The page is shifted on the paper if one assigns non-zero
%values to \csidx{hoffset} or \csidx{voffset}: positive values
%shift to the right and down respectively.
如果指定 \csidx{hoffset} 或 \csidx{voffset} 为一个非零的值,页面会在纸面上移动:正值代表向右下移动,水平和竖直方向的移动是独立的。
%%\point \cs{topskip}
%\section{\protect\cs{topskip}}
%\point \cs{topskip}
\section{\protect\cs{topskip}}
%The \csidx{topskip} ensures to a certain point
%that the first baseline of a page
%will be at the same location from page to page,
%even if font sizes
%are switched between pages or if the first line has
%no ascenders.
\csidx{topskip} 确保了一点:每一页的第一条基线都处于同一位置,即使页面之间的字号不相同或者第一行不含有升部\footnote{译注(woclass):升部指的是某字母比字母x还要高的部分}的字母。
%Before the first box on each page some glue is inserted.
%This glue has the same stretch and shrink as \cs{topskip}, but
%the natural size is the natural size of \cs{topskip}
%minus the height of the first box, or zero if this
%would be negative.
每页第一个盒子之前都嵌入了铅空。
铅空可以和 \cs{topskip} 一起伸缩,通常它的大小是 \cs{topskip} 减去第一个盒子的高度,当结果为负数时,其值为零。
%Plain \TeX\ sets \cs{topskip} to {\tt 10pt}.
%Thus the top lines of pages will have their baselines
%at the same place if
%the top portion of the characters is ten point or less.
%For the Computer Modern fonts this condition is satisfied
%if the font size is less than (about) 13~points;
%for larger fonts
%the baseline of the top line will drop.
Plain \TeX\ 将 \cs{topskip} 设为 {\tt 10pt}。因此,如果最上面一行的字母的顶部小于等于10点,每一页顶行的基线就处于相同的位置。
对于现代计算机字体来说,字号小于大约13点就能满足这个条件;对于大号字体来说,顶行的基线会下沉。
%The height of the page box for a page containing only
%text (and assuming a zero \cs{parskip})
%will be the \cs{topskip} plus a number of times
%the \cs{baselineskip}. Thus one can define a macro
%to compute the \cs{vsize} from the number of lines
%on a page:
%\howto Specify page height in lines\par
%\begin{verbatim}
%\def\HeightInLines#1{\count@=#1\relax
% \advance\count@ by -1\relax
% \vsize=\baselineskip
% \multiply\vsize by \count@
% \advance\vsize by \topskip}
%\end{verbatim}
%Calculating the \cs{vsize} this way will prevent
%underfull boxes for text-only pages.
假设 \cs{parskip} 为零,对于一个只含有文字的页面来说,页面盒子的高度等于 \cs{topskip} 加上 \cs{baselineskip} 的倍数。
因此我们可以定义一个宏,通过页面的行数来计算 \cs{vsize}:
\howto Specify page height in lines\par
\begin{verbatim}
\def\HeightInLines#1{\count@=#1\relax
\advance\count@ by -1\relax
\vsize=\baselineskip
\multiply\vsize by \count@
\advance\vsize by \topskip}
\end{verbatim}
对于纯文本页面,像这样计算 \cs{vsize} 可以避免未充满的盒子。
%In cases where the page does not start with a line of text
%(for instance a rule), the topskip may give unwanted effects.
%To prevent these, start the page with
%\begin{verbatim}
%\hbox{}\kern-\topskip
%\end{verbatim}
%followed by what you wanted on top.
当页面的首行不是文字时(例如有奇怪的规定要求这样做),topskip可能造成非预期的影响。为了避免这个问题,我们可以以
\begin{verbatim}
\hbox{}\kern-\topskip
\end{verbatim}
作为一页的开头,后面再写你想在页面顶部出现的东西。
%Analogous to the \cs{topskip}, there is a \cs{splittopskip}
%for pages generated by a \cs{vsplit} operation; see
%the next chapter.
类似 \cs{topskip},还有一个 \cs{splittopskip},它适用于由 \cs{vsplit} 操作产生的页面,详见下一章。
%%\point Page height and depth
%\section{Page height and depth}
%\point Page height and depth
\section{页面高度与深度}
%\index{page!height|(}
%\index{page!depth|(}
\index{page!height|(}
\index{page!depth|(}
%\TeX\ tries to build pages as a \cs{vbox} of height \csidx{vsize};
%\alt
%see also \cs{pagegoal} in the next chapter.
\TeX\ 会尝试将页面构建为一个高 \csidx{vsize}的 \cs{vbox} ;参见下下一章的 \cs{pagegoal}。
%If the last item on a page has an excessive depth,
%that page would be noticeably longer than other pages.
%To prevent this phenomenon \TeX\ uses \csidx{maxdepth} as
%the maximum depth of the page box. If adding an item to the
%page would make the depth exceed this quantity, then the
%reference point of the page is moved down to make the depth
%exactly \cs{maxdepth}.
如果某页的最后一项深度过长,这一页会明显比其他页更长。
为了避免这种现象 \TeX\ 使用 \csidx{maxdepth} 限制页面盒子的最大深度。
如果继续添加一项会导致页面深度超限,这时参考点会下移,直至页面深度恰好等于 \cs{maxdepth}。
%The `raggedbottom' effect is obtained in plain \TeX\
%\cstoidx raggedbottom\par
%by giving the \cs{topskip} some finite stretchability:
%\hbox{\n{10pt plus 60pt}}.
%Thus the natural height of box~255 can vary when it reaches
%the output routine.
%Pages are then shipped out (more or less) as
%\begin{verbatim}
%\dimen0=\dp255 \unvbox255
%\ifraggedbottom \kern-\dimen0 \vfil \fi
%\end{verbatim}
%The \cs{vfil} causes the topskip to be set at natural
%width, so the effect is one of a fixed top line and a
%variable bottom line of the page.
通过赋给 \cs{topskip} 无限的弹性:\hbox{\n{10pt plus 60pt}},我们可以在plain \TeX\ 中观察到“辣鸡页底”的效应。
因此当 box~255 到达输出程序时,它的自然高度通常有变化。
随后,页面以差不多如下形式送出:
\begin{verbatim}
\dimen0=\dp255 \unvbox255
\ifraggedbottom \kern-\dimen0 \vfil \fi
\end{verbatim}
\cs{vfil} 使 \cs{topskip} 设置为自然宽度,这样做会产生以下两种效果之一:页面有固定顶部线或可变底部线。
%Before \cs{box255} is unboxed in the plain \TeX\ output routine,
%\cs{boxmaxdepth} is set to \cs{maxdepth}
%so that this box will made under the same assumptions
%that the page builder used when putting together \cs{box255}.
在 \cs{box255} 于 plain \TeX\ 的输出程序中被解包之前,\cs{boxmaxdepth} 被设成 \cs{maxdepth},这样创建这个盒子时,页面生成器使用的假设会和把 \cs{box255} 放在一起时相同。
%The depth of box split off by a \cs{vsplit} operation
%is controlled by the \cs{splitmaxdepth} parameter.
\cs{vsplit} 操作分割盒子的深度由 \cs{splitmaxdepth} 参数控制。
%\index{page!height|)}
%\index{page!depth|)}
\index{page!height|)}
\index{page!depth|)}
%\endofchapter
\endofchapter
\end{document}