Commands/preloaded
nsk@Wrap
Configure wrapping behavior for the next block relative to an existing element.
Overview
The \nskWrap command sets up a wrap marker and flag so that the next block you draw will be positioned relative to a specified reference node, with consistent spacing and alignment. By default it wraps on the left side; prefixing with ! wraps on the right.
nskWrap leverages an internal \nskMark node to anchor and then
automatically adjusts the placement of the following \nskBlock call.
Syntax
Basic Usage
Wrap a block below and to the left of a reference block:
Advanced Example
Wrap a block above and to the right of a reference, with custom offsets:
Available Options
Reference & Direction
under(token list): Identifier of the node to wrap below. Setsdirection=belowandanchor=north.over(token list): Identifier of the node to wrap above. Setsdirection=aboveandanchor=south.target(token list): Alias for the node when you prefer to setdirectionmanually.
Side Control
- Without
!(default): Wraps on the left side (leftflag). - With leading
!: Wraps on the right side (rightflag).
Fine-Tuning
shift-x(dimension, default=0cm): Horizontal adjustment of the wrap marker and block.shift-y(dimension, default=0cm): Vertical adjustment of the wrap marker and block.
Internal Mechanics
When you invoke \nskWrap, it:
- Inserts a hidden marker via
\nskMarkat the computed position relative to your reference node. - Sets an internal boolean flag (
g_nsk_wrap_left_boolorg_nsk_wrap_right_bool). - Causes the next
\nskBlockto pick up that flag and adjust its anchor and placement accordingly.
Practical Tips
- Use
underfor vertical stacking andoverfor top-aligned wrapping. - Prefix with
!to switch sides without changing any other options. - Combine
shift-x/shift-yto fine-tune positions when default spacing isn’t quite right.
Reference Table
| Prop | Type | Default |
|---|---|---|
| under? | token list | {} |
| over? | token list | {} |
| target? | token list | {} |
| shift-x? | dimension | 0cm |
| shift-y? | dimension | 0cm |
