Mark Path
Annotating paths with precision and clarity using Neural Sketch.
Sometimes, just connecting things isn’t enough. You might want to draw something that lives on the path itself.
The \nskMarkPath
command lets you place custom visuals or annotations directly along a path — with precision. Think of it as a way to narrate your connections: weights, distances, transitions, or any visual punctuation you need.
Overview
\nskMarkPath
enables precise placement of annotations along paths defined by other commands, such as \nskConnect
. It provides a robust yet intuitive interface for marking intermediate points along any drawn path, ideal for labeling distances, weights, points of interest, or other notable markers in your diagrams.
Basic Usage
The core syntax of \nskMarkPath
is:
You provide:
- A set of
<options>
: like where to place marks (at=0.25
), whether to skip the ends, or how far apart the marks should go. - A
<path id or definition>
: either a reference likeacn
, or an explicit coordinate-based path. <content>
: your annotation — nodes, lines, arrows, whatever you want rendered at each point.
Marking Specific Points
Use fractional values to mark exact spots along a path (at
):
The position at
accepts a fractional value (e.g., 0.25
means 25% of the way along the path).
Fractional Value | Position on Path |
---|---|
.0 | Start of path |
.5 | Middle of path |
1.0 | End of path |
Complete Example
Illustrating markers placed at multiple intervals along connections:
Composability Tip
Pair \nskMarkPath
with \nskMark
to capture exact coordinates along a path.
From there, you can attach labels, arrows, or new geometry using
\nskConnect
, \nskAnnotate
, or any other primitive.
Marking Blocks
Sometimes you want to connect to arbitrary location of a block that are not just the standard north
, south
, east
, or west
anchors.
By default, every primitive automatically registers a soft path using its id
.
This soft path lets you precisely target points along the block’s boundary using \nskMarkPath[...]
.
Suppose you have:
You can then reference a specific point along the x
block’s edge:
where <n>
selects the point along the block’s boundary path.
This allows you to draw connections or place elements with fine-grained precision, far beyond simple edge anchors.
Advanced Path Routing
Freeform Paths
Sometimes you want more control. \nskMarkPath
lets you annotate any path — even a custom one you draw inline:
You can directly specify custom paths using coordinates — and inject any drawing logic you need (any -supported, TikZ
or pgf
). This gives maximum flexibility for complex routing scenarios:
\nskMarkPath
also seamlessly integrates with complex paths involving bends and custom routes:
Tip
Combine \nskMarkPath
with anchors and markers to create informative visual
annotations. Markers can include labels, connectors, and custom drawn
indicators, greatly enhancing clarity in complex diagrams.
Step-based Marking
Use evenly spaced markers along an arbitrary path by specifying an interval step (step
):
How It Works
step
: Defines the interval at which markers are placed along the path.skip-first
,skip-last
: Allows skipping markers at endpoints for cleaner aesthetics.
No hardcoding
You don’t need to calculate the path length manually.
Use \nskMeasure
to measure any distance, then reuse it in \nskMarkPath
:
Need more control?
You can combine \nskMeasure
with complex paths and programmatic spacing.
Learn more in Measure.
Key Takeaway
\nskMarkPath
empowers you to annotate paths precisely, clearly communicating
detailed information without sacrificing visual appeal.
Reference Table
Prop | Type | Default |
---|---|---|
at? | token list | {} |
color? | token list | c__nsk_principal |
end? | number | 1 |
path-width? | dimension | 0pt |
skip-first? | boolean | false |
skip-last? | boolean | false |
start? | number | 0 |
step? | dimension | 10mm |