Neural Sketch
Commands/preloaded

nsk@EdgeFade

Apply subtle fading effects along diagram edges to emphasize boundaries.

Overview

The \nskEdgeFade command applies a gradient fade effect along a specified edge of the current diagram's bounding box, creating a smooth transition and subtle emphasis on diagram boundaries. It automatically measures the diagram's dimensions and renders a \nskBlock with the appropriate fade direction, size, and offset.

nskEdgeFade internally leverages \nskMeasure to compute the length of the target edge and then draws a transparent block with fading style.

Usage

\nskEdgeFade[<options>]

Options

OptionTypeDefaultDescription
edgechoicedownSide to apply the fade. Options: down, up, left, right.
sizedimension10mmThickness of the fade effect.
offsetdimension1mmDistance from the diagram's bounding box to position the fade.

Examples

Default Fade

Fades the bottom edge of the diagram:

\begin{nskFigure}
  \nskBlock[id=A, text-center={Main}]
  \nskEdgeFade[]
\end{nskFigure}

Custom Fade

Apply a 5mm fade on the left edge, offset by 2mm:

\begin{nskFigure}
  \nskBlock[id=A, text-center={Main}]
  \nskEdgeFade[edge=left, size=5mm, offset=2mm]
\end{nskFigure}

Internal Mechanics

  1. Parses options via the nsk/efadings key definitions.
  2. Determines the position of the fade block relative to the current bounding box based on edge and offset.
  3. Measures the length of the targeted edge using \nskMeasure.
  4. Invokes an internal helper to render a \nskBlock with the computed width/height and fade style.

Reference Table

PropTypeDefault
edge?choicedown
size?dimension10mm
offset?dimension1mm

On this page