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