Measure
Precisely measure distances and align blocks effortlessly with Neural Sketch.
Precision is powerful — but it shouldn’t be painful.
\nskMeasure
gives you a declarative way to measure distances between points and immediately reuse the result, making alignment and sizing in your diagrams consistent and effortless.
Overview
The \nskMeasure
command provides a powerful yet intuitive mechanism to accurately measure distances and align diagram components within your Neural Sketch diagrams. Whether you need blocks of precisely matching sizes, exact spacing between elements, or consistent alignment, this command simplifies your workflow.
Basic Usage
To measure distances between two points or anchor coordinates, use the \nskMeasure
macro as follows:
Once you've performed the measurement, you can immediately reuse the resulting length via the built-in macro \nskDistance
.
Example: Matching Block Widths
Here's how you can measure the width between two blocks and then set a new block to precisely match that measured width:
This ensures c
matches precisely the combined width of a
and b
, providing visual consistency and exact alignment across your diagram elements.
Measurement unlocks reuse. Instead of guessing sizes or manually syncing blocks, you can anchor your layout to relationships that already exist in your drawing.
Multiple measurement
You can store a measurement into a custom-named macro using the into=
parameter:
You can now reference the measurement using \<macro-name>
wherever you need that value.
This is particularly useful when comparing or combining multiple distances:
Available Options
Option | Type | Description | Default |
---|---|---|---|
axis | Enum (horizontal , vertical ) | Axis along which the measurement is taken. | horizontal |
from | Anchor | Starting anchor coordinate for measurement. | required |
to | Anchor | Ending anchor coordinate for measurement. | required |
into | Macro name | Custom macro name to store the result. | \nskDistance |
Practical Use Cases
- Consistent Spacing: Maintain equal spacing between elements across your figures.
- Dynamic Sizing: Create adaptive blocks or containers that adjust sizes based on other elements.
- Perfect Alignment: Ensure elements line up precisely, essential for professional-quality diagrams.
- Path-based repetition: Combine with
\nskMarkPath
to step through measured space. - Multi-scale diagrams: Compare, annotate, or overlay relative distances.
Tip
Use clear names and label your measurements with annotations if they represent a meaningful constraint. Treat spacing like a design material.
Composability
Any value measured with \nskMeasure
— whether \nskDistance
or a custom
macro — is just a dimension. Use it for width, padding, spacing, path control, or anything else.
Reference
Prop | Type | Default |
---|---|---|
axis? | choice | horizontal |
from? | token list | {} |
to? | token list | {} |
into? | string | \nskDistance |