Neural Sketch

Grids

Apply customizable, autowrapping grids to any shape or overlay on existing blocks

Grids help you visually organize diagram elements by applying a consistent background pattern.

Quick Start

Every grid is defined by two steps: horizontal and vertical. Even if they match, you must provide both:

\nskBlock[
  grid={<step-x>, <step-y>},
]

grid={...} always requires <step-x> and <step-y> to be defined, even if they have the same value

You can also use a different step-size per-axis:

\nskBlock[
  grid={2mm, 4mm}, 
]

Customizing Line Thickness

Adjust the thickness of the grid lines globally or per axis:

\nskBlock[
  grid={2mm, 4mm},
  grid-line-size={.2mm},
]

Shape‑Aware Grids

Grids adapt to any primitive shape—rectangle, circle, diamond, you name it. Just add type:

\nskBlock[
  type=<shape>, 
  grid={2mm, 4mm},
]

For the full list of shapes, see the Basic Styles guide.

Standalone and Overlaid Grids

Standalone Grids

Treat a grid as its own element for independent styling:

Overlaying a Grid

Often you want to create a grid to overlay on another block. In these situations you can use the store-style key on the target \nskBlock[...]

  1. Capture the original block style with store-style:
\nskBlock[ % <-- target shape
  id=ablock,
  store-style=true, % or just / store-style
]
  1. Overlay your grid onto ablock: use grid-on= to point to the target block's id:
\nskBlock[ % <-- target shape
  grid={2mm, 2mm},
  grid-on=ablock,
]

Sometimes you find yourself wanting only the grid lines, without the outer border. You can easily disable it:

\nskBlock[
  grid={2mm, 2mm},
  grid-outer-border=false,
]

Reference Table

PropTypeDefault
griddimension list
grid-line-size?dimension | [dimension, dimension]0.4pt
store-style?booleanfalse
grid-on?token list
grid-outer-border?booleantrue

On this page