nsk@MeasureR
Internal measurement engine powering `\nskMeasure` in Neural Sketch
Overview
The \nskMeasureR command is the low-level implementation behind the user-facing \nskMeasure macro. It handles parsing of measurement keys, computes the distance between two anchor points along a specified axis, updates the internal \nskDistance length, and optionally assigns the result to another macro.
- When invoked without any options,
\nskMeasureRexpands to the previously stored distance (\nskDistance). - When invoked with an option list, it computes a new measurement and stores it.
Most users should use \nskMeasure; \nskMeasureR is provided for advanced or internal use cases.
Usage
- No argument: expands to
\nskDistance. - With arguments: processes the keys and performs the measurement.
Available Options
-
axis(choice, default=horizontal): Axis along which to measure distance.- Choices:
horizontal,vertical
- Choices:
-
from(token list, required): Starting anchor point for the measurement, in the formnode.anchor. -
to(token list, required): Ending anchor point for the measurement, in the formnode.anchor. -
into(token list, optional): Name of a macro to which the computed distance will also be assigned. If omitted, only\nskDistanceis updated.
Internal Behavior
- Uses the
nsk/measurekey family to parse provided options. - Splits the
fromandtovalues into node names and anchor components. - Invokes
\pgfpointdiffon the two anchor coordinates. - Measures the absolute
x-component (horizontal) ory-component (vertical) into\nskDistance. - If an
intokey is specified, assigns the same length to the named macro.
Reference Table
| Prop | Type | Default |
|---|---|---|
| axis? | choice | horizontal |
| from | token list | {} |
| to | token list | {} |
| into? | token list | {} |
