Neural Sketch
Environments

nsk@Figure

The core diagram environment for Neural Sketch.

Overview

The <nskFigure> component is the foundational environment for creating diagrams using Neural Sketch. It encapsulates all drawing commands, ensures consistent styling, and resets internal state, making it easy to produce clean, publication-ready figures.

Usage

\begin{nskFigure}[<options>]
  % Diagram commands here
\end{nskFigure}

Props

PropTypeDefault
center?booleanfalse

Basic Example

Here's how you use <nskFigure> to create a simple diagram:

\begin{nskFigure}[center=true]
  \nskBlock[text-center={A Block}]
  \nskBlock[last-pos={right=1cm}, text-center={Another Block}]
\end{nskFigure}

Centering Diagrams

You can center the entire diagram horizontally by setting the center prop to true. This is especially useful when embedding diagrams in papers or presentations.

\begin{nskFigure}[center=true]
  \nskBlock[text-center={Centered Block}]
\end{nskFigure}

Custom TikZ Options

You can pass additional options directly to TikZ using the unknown pass through to <nskFigure>:

\begin{nskFigure}[scale=0.8, transform shape]
  \nskBlock[text-center={Scaled Block}]
\end{nskFigure}

Best Practices

  • Always use <nskFigure>: It guarantees proper internal setup and teardown, maintaining consistency and preventing unexpected interactions between diagrams.
  • Use meaningful options: Apply global transformations (e.g., scale, rotate) sparingly to maintain clarity.
  • \nskBlock>: The primary shape-drawing primitive.
  • \nskContainer>: Visually groups related elements within diagrams.

On this page