要點 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 作為註釋呼叫標記樣式,文本 中的呼叫標記和 註釋 區域中的呼叫標記(或被呼叫標記)被不同地處理。
假設給定註釋的相關被呼叫標記是 ¤。在這種情況下通常發生的是,代碼將 \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)掛鉤實際上是在 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