Skip to main content

InternalDimensionFn

Type Alias InternalDimensionFn 

Source
pub type InternalDimensionFn = Rc<dyn Fn(&Token) -> Result<Option<RegisterValue>>>;
Expand description

A package-installed resolver for control sequences that yield an internal dimension by reading their own argument — e.g. calc.sty’s \widthof{box}. Given the already-read CS token, it either consumes that CS’s argument(s) from the gullet and returns the measured value (Ok(Some(_))), or leaves the stream untouched and declines (Ok(None)), in which case the caller un-reads the token. Keeps core calc-agnostic: the base dimension reader consults this seam before giving up with “Missing number”, so \makebox[\widthof{X}] / \rule{\widthof{X}}{…} resolve like real LaTeX without \widthof having to be a register (which would change its bare digestion). See calc_sty.rs / OXIDIZED_DESIGN #115.

Aliased Type§

pub struct InternalDimensionFn { /* private fields */ }