Skip to main content

read_through_redefined_setlength

Function read_through_redefined_setlength 

Source
pub fn read_through_redefined_setlength(
    kind: RegisterType,
) -> Result<Option<RegisterValue>>
Expand description

A SetlengthDimension/SetlengthGlue argument is the operand latex.ltx hands to \setlength (see gullet::BracedLengthFn), so a package that redefines \setlength as a macro changes how it reads. bxcalcux.sty’s \bxcx@decl@patch\setlength parses custom units (\newcalcunit{tm}{0.05em} makes \hspace{6tm} 3pt; bxcalc manual), and pgf’s pictures swap in \pgf@setlength (pgfcorescopes.code.tex:238-242, 311-317). Then the length is assigned as latex.ltx assigns it, \setlength<register>{<argument>} digested (\@hspace, latex.ltx:9425; a dimen register for a Dimension, as \@tempdima is, so a scan stops before plus), and the register read back. Whatever the assignment left in the input is typeset there, before the command’s own output, as TeX typesets it for the boxes and \hspace; for \\[..] TeX typesets it after the break (inside \vadjust, latex.ltx:9260). None when \setlength is a primitive (the kernel’s or calc’s binding) or is undefined (plain TeX: the registers are LaTeX-only). OXIDIZED_DESIGN #325.

Precondition: called directly inside read_braced’s reader, whose mouth holds exactly the rest of the argument: the whole mouth is taken as the operand. The reentrancy flag covers the whole digestion, the tail’s included.