要点 1a:(在内部)所有“出现在页面上但正在被操作”的 TeX 片段都是 \box 0....\box 65535。(或者 \box0 ....,在正常情况下,空格只是帮助人类阅读,但在某些情况下它实际上可能会导致错误)。
数字容易混淆,所以我们可以使用 \newbox\something 用标签(\something)替换数字,如果我们想永久保留它的话。\box 0 到 \box9 被保留为未命名的临时盒子。其他各种盒子也被保留用于特殊功能。
单纯的 \box 0 会输出盒子的内容并清空定义。\copy 0 会输出盒子并保留定义。要定义内容,语法是 \setbox[number/label][some box],其中 [some box] 是 \hbox{contents}、\vbox{contents} 或 \box 或 \copy。
要点 2:我猜测 box0 作为通用临时盒子是安全的,然后我犹豫了一下并进行了检查。
要点 3 和 1b: 因为您使用 z_f_caller_bottom 作为注释调用者(note caller)样式,正文中的调用者和注释区域中的调用者(或被调用者)会被区别对待。
假设给定注释的相关被调用者(callee)是 ¤。在这种情况下通常发生的情况是,代码将 \box0 定义为(实际上是)\hbox{\+z_f_caller_bottom ¤\+z_f_caller_bottom*}(尽管它并没有实际生成那个确切的代码),然后它像处理任何被调用者一样处理该盒子:
- 它测量该盒子的宽度,如果它是非零但窄于
\NoteCallerWidth,它会填充到该尺寸(以便对齐更整齐)。
- 如果该结果是非零宽度,则添加
\NoteCallerSpace。
我给你的代码被解释为在盒子内部应用字符样式,因此它实际上变成了:
\setbox0{\+z_f_caller_bottom
\setbox0\bgroup
¤
\egroup\llap{box0 \kern 3pt}
\+z_f_caller_bottom*}
除了(a)如果你输入它,考虑到类别码(catcodes)、空格和其他危险且令人困惑的东西,它几乎肯定会出错,以及(b)钩子(hooks)实际上是在 z_f_caller 的开始和结束代码中间处理的。
Bullet point 1a: (Internally) all ‘snippets that go on a page but are being played with’ in TeX are \box 0....\box 65535. (or \box0 ...., in normal conditions the space just helps humans read it, but in some conditions it might actually cause an error).
Numbers get confusing, so we can use \newbox\something replace the number with a label (\something) if we want to permanently reserve it. \box 0 up to \box9 are reserved as unnamed temporary boxes. Various other boxes are also reserved for special functions.
Just a straight \box 0 will output the contents of the box and empty the definition. \copy 0 will output the box and keep the definition. To define the contents, then the syntax is \setbox[number/label][some box] where [some box] is \hbox{contents} \vbox{contents} or a \box or \copy
Bullet point 2: I made a guess that box0 was safe as a general purpose temporary box, and then had a moment of uncertainty and checked it.
Bullet points 3 and 1b: Because you’re using z_f_caller_bottom for the note caller style, the caller in the text and the caller (or callee) in the notes area are treated differently.
Let’s assume that the relevant callee for a given note is ¤. What normally happens in this case is that code defines \box0 to be (effectively) \hbox{\+z_f_caller_bottom ¤\+z_f_caller_bottom*} (although it doesn’t actually generate that exact code), It then processes that box like it would for any callee:
- it measures how wide that box is and if it’s non-zero but narrower than
\NoteCallerWidth it pads to be that size (so things line up more nicely).
- If the result of that is of non-zero width, then it adds the
\NoteCallerSpace
The code I gave you gets interpreted as the character styles are being applied inside the box, so it effectively ends up as:
\setbox0{\+z_f_caller_bottom
\setbox0\bgroup
¤
\egroup\llap{box0 \kern 3pt}
\+z_f_caller_bottom*}
Except that (a) if you typed that it’d almost certainly break, given catcodes, spaces and other dangerous and confusing things and (b) the hooks are actually processed in the middle of the start and end code for z_f_caller
机器翻译自 English