Neural Sketch

Quick Start

Build your first diagram with Neural Sketch in minutes.

Introduction

Neural Sketch
Pronounced/ˈnʊr.əl skɛtʃ/

Opinionated. Minimal. Precise.
But fully customizable—when it needs to be.

Neural Sketch (neural-sketch) is a modern, opinionated, yet highly customizable LaTeX\LaTeX package for crafting consistent, publication-ready diagrams with minimal effort.

A design grammar for structured technical ideas

It combines an intuitive, boilerplate-free syntax with a powerful key–value configuration system, allowing you to quickly produce top-tier diagrams—while retaining complete control over fine-grained customization when needed.

Built on l3build and powered by modern LaTeX3\LaTeX3 paradigms such as expl3 and l3keys, it delivers a fast, robust, and extensible framework for communicating ideas with precision.


This is not just a package. It's a design system.
Built on expl3 and l3keys. Tested with l3build.
Tailored for AI/ML researchers.


Bundles and Modules

Neural Sketch is modular. But modularity alone isn't enough.

To reduce friction, we provide bundles:

small, coherent sets of modules designed to work together.

Each module addresses a specific concern—layout, grouping, color, annotation, positioning, or routing.

You can load them all. Or only what you need.

The goal is not to overwhelm. The goal is to help you begin—with a toolkit that grows as your diagrams do.

Why selectively load modules?

Not every diagram needs every feature. Selective loading keeps things minimal—faster compiles, fewer surprises. Learn more in Why Module Loading.

Geometric Primitives

nsk@block

Provides fundamental building blocks—rectangles, circles, diamonds, trapeziums, and more—forming the foundation of structured diagrams.

Module Loader

nsk@loader

Enables selective loading of Neural Sketch modules, allowing you to optimize your workflow by including only the features you need.

Styles

nsk@styles

Defines global styling presets for blocks, containers, and connectors using a consistent key–value interface.

Colors

nsk@colors

Provides a curated color palette optimized for publication-ready diagrams, with full customization support.

Groups

nsk@groups

Enables logical grouping of shapes, supporting transforms like scaling, rotation, and translation.

Containers

nsk@containers

Creates bounding regions around diagram elements, supporting padding, borders, and nested layouts.

Coordinates

nsk@coords

Defines named anchor points, enabling precise positioning and alignment of diagram elements through absolute or relative references.

Geometric Primitives

nsk@block

Provides fundamental building blocks—rectangles, circles, diamonds, trapeziums, and more—forming the foundation of structured diagrams.

Module Loader

nsk@loader

Enables selective loading of Neural Sketch modules, allowing you to optimize your workflow by including only the features you need.

Styles

nsk@styles

Defines global styling presets for blocks, containers, and connectors using a consistent key–value interface.

Colors

nsk@colors

Provides a curated color palette optimized for publication-ready diagrams, with full customization support.

Groups

nsk@groups

Enables logical grouping of shapes, supporting transforms like scaling, rotation, and translation.

Containers

nsk@containers

Creates bounding regions around diagram elements, supporting padding, borders, and nested layouts.

Coordinates

nsk@coords

Defines named anchor points, enabling precise positioning and alignment of diagram elements through absolute or relative references.

Geometric Primitives

nsk@block

Provides fundamental building blocks—rectangles, circles, diamonds, trapeziums, and more—forming the foundation of structured diagrams.

Module Loader

nsk@loader

Enables selective loading of Neural Sketch modules, allowing you to optimize your workflow by including only the features you need.

Styles

nsk@styles

Defines global styling presets for blocks, containers, and connectors using a consistent key–value interface.

Colors

nsk@colors

Provides a curated color palette optimized for publication-ready diagrams, with full customization support.

Groups

nsk@groups

Enables logical grouping of shapes, supporting transforms like scaling, rotation, and translation.

Containers

nsk@containers

Creates bounding regions around diagram elements, supporting padding, borders, and nested layouts.

Coordinates

nsk@coords

Defines named anchor points, enabling precise positioning and alignment of diagram elements through absolute or relative references.

Geometric Primitives

nsk@block

Provides fundamental building blocks—rectangles, circles, diamonds, trapeziums, and more—forming the foundation of structured diagrams.

Module Loader

nsk@loader

Enables selective loading of Neural Sketch modules, allowing you to optimize your workflow by including only the features you need.

Styles

nsk@styles

Defines global styling presets for blocks, containers, and connectors using a consistent key–value interface.

Colors

nsk@colors

Provides a curated color palette optimized for publication-ready diagrams, with full customization support.

Groups

nsk@groups

Enables logical grouping of shapes, supporting transforms like scaling, rotation, and translation.

Containers

nsk@containers

Creates bounding regions around diagram elements, supporting padding, borders, and nested layouts.

Coordinates

nsk@coords

Defines named anchor points, enabling precise positioning and alignment of diagram elements through absolute or relative references.

Arrow Routing & Bridging

nsk@bridges

Automates line crossings and arrow routing using bridging arcs, enhancing visual clarity in dense diagrams.

Annotations

nsk@annotations

Provides auto-incremented and tag-based annotations, with built-in connector support and configurable label styles.

Decorations

nsk@decorations

Enables custom path decorations using TikZ markings, including text markers, ticks, and symbols along paths or curves.

Conditional Rendering

nsk@render

Supports conditional diagram logic with a switch–case–default interface, enabling dynamic or context-aware rendering.

Measurement Tools

nsk@measure

Provides utilities to measure distances between nodes along specific axes, useful for layout calibration or dynamic spacing.

Zoom Areas

nsk@zoom

Enables spy-based zoom regions that magnify portions of a diagram, with optional callouts and customizable magnification and style.

Dark Mode Support

nsk@pkgopts

Enables seamless adaptation of all visual elements to dark mode, preserving legibility and aesthetic consistency across light and dark themes.

Arrow Routing & Bridging

nsk@bridges

Automates line crossings and arrow routing using bridging arcs, enhancing visual clarity in dense diagrams.

Annotations

nsk@annotations

Provides auto-incremented and tag-based annotations, with built-in connector support and configurable label styles.

Decorations

nsk@decorations

Enables custom path decorations using TikZ markings, including text markers, ticks, and symbols along paths or curves.

Conditional Rendering

nsk@render

Supports conditional diagram logic with a switch–case–default interface, enabling dynamic or context-aware rendering.

Measurement Tools

nsk@measure

Provides utilities to measure distances between nodes along specific axes, useful for layout calibration or dynamic spacing.

Zoom Areas

nsk@zoom

Enables spy-based zoom regions that magnify portions of a diagram, with optional callouts and customizable magnification and style.

Dark Mode Support

nsk@pkgopts

Enables seamless adaptation of all visual elements to dark mode, preserving legibility and aesthetic consistency across light and dark themes.

Arrow Routing & Bridging

nsk@bridges

Automates line crossings and arrow routing using bridging arcs, enhancing visual clarity in dense diagrams.

Annotations

nsk@annotations

Provides auto-incremented and tag-based annotations, with built-in connector support and configurable label styles.

Decorations

nsk@decorations

Enables custom path decorations using TikZ markings, including text markers, ticks, and symbols along paths or curves.

Conditional Rendering

nsk@render

Supports conditional diagram logic with a switch–case–default interface, enabling dynamic or context-aware rendering.

Measurement Tools

nsk@measure

Provides utilities to measure distances between nodes along specific axes, useful for layout calibration or dynamic spacing.

Zoom Areas

nsk@zoom

Enables spy-based zoom regions that magnify portions of a diagram, with optional callouts and customizable magnification and style.

Dark Mode Support

nsk@pkgopts

Enables seamless adaptation of all visual elements to dark mode, preserving legibility and aesthetic consistency across light and dark themes.

Arrow Routing & Bridging

nsk@bridges

Automates line crossings and arrow routing using bridging arcs, enhancing visual clarity in dense diagrams.

Annotations

nsk@annotations

Provides auto-incremented and tag-based annotations, with built-in connector support and configurable label styles.

Decorations

nsk@decorations

Enables custom path decorations using TikZ markings, including text markers, ticks, and symbols along paths or curves.

Conditional Rendering

nsk@render

Supports conditional diagram logic with a switch–case–default interface, enabling dynamic or context-aware rendering.

Measurement Tools

nsk@measure

Provides utilities to measure distances between nodes along specific axes, useful for layout calibration or dynamic spacing.

Zoom Areas

nsk@zoom

Enables spy-based zoom regions that magnify portions of a diagram, with optional callouts and customizable magnification and style.

Dark Mode Support

nsk@pkgopts

Enables seamless adaptation of all visual elements to dark mode, preserving legibility and aesthetic consistency across light and dark themes.

At present, Neural Sketch ships with a single bundle: the core.

It consists of 13 foundational modules—handling layout, grouping, styling, annotation, positioning, and routing.

This core forms the structural backbone for most diagrams. Future bundles will extend this foundation—tailored to specific domains, dynamic interactions, or alternative visual grammars.

Want to learn more?

Read our in-depth What is Neural Sketch? Introduction.


Key Benefits

Publication-Ready by Default

Colors, borders, spacing, line thicknesses—everything is tuned for the aesthetic standards of top AI/ML venues. No need to wrestle with TikZ styles.

Concise by Construction

You define what matters: blocks, positions, annotations.

Everything else—IDs, alignment, spacing—is handled for you. Less code. Fewer distractions. Faster iteration.

Precise When You Need It

Every visual parameter—padding, corners, connectors, stacks, patterns—is exposed via keys. Override only what you need, when you need it.

No patchwork. No guesswork. Just control.

Global Consistency, Local Overrides

Change a single style key—and update every figure across your document.

Consistency becomes effortless.

Built for Transferrability

Your diagrams shouldn't be locked to one medium.

Neural Sketch adapts gracefully—from LaTeXLaTeX papers to slides, posters, and web formats.

Supports dark mode, vector-safe rendering, and pixel-perfect styling for flexible reuse across platforms, devices, and display contexts.


Quick Start

Follow these simple steps to begin using Neural Sketch in your document.

Begin by loading the Neural Sketch package in your document preamble.

\usepackage{neural-sketch}

This step gives you immediate access to the core functionality and styles needed for creating your diagrams.

Neural Sketch is modular. Activate all modules at once with:

\nskUseModule{*}

You can later refine module loading for efficiency by choosing only necessary modules. (See Module Loading for details.)

Creating Your First Diagram

Now you're ready to create your first Neural Sketch diagram.

Let's begin with a simple composition—a pair of labeled blocks, neatly grouped inside a container and connected with a line.

Example Diagram

Let's craft a simple figure featuring grouped blocks neatly encapsulated within a labeled container:

\begin{nskFigure}[]
 
\nskContainer[]{
 
  \nskBlock[id=cat, text-center=Dog, border-type=dashed]
  \nskBlock[id=dog, text-center=Cat, fill=nskPink, last-pos=right]
 
  \nskConnect[from=cat, to=dog]
 
}
 
\end{nskFigure}
What's Happening Here?
  • \nskFigure The figure environment. It initializes the drawing space and resets internal counters, ensuring consistency across diagrams.

  • \nskContainer Think of it as a bounding box with structure and intent. It automatically wraps whatever is inside, adds padding, and can display a label—like a titled region.

  • \nskBlock The core primitive. Each block is styled by default and positioned using smart relative references like last-pos. You can control its appearance with keys like fill, border-type, or text-center.

  • \nskConnect Draws an arrow or connector between blocks. Here, it links the block with ID cat to the one labeled dog.

This is the heart of Neural Sketch: A declarative syntax that lets you focus on structure, not scaffolding.

Dark Mode Included

This diagram works automatically in dark mode—no extra code, no duplicated styles. Neural Sketch adjusts colors and contrast behind the scenes.

What's Next?

Neural Sketch empowers you to effortlessly create professional, publication-quality diagrams. To dive deeper, explore:

  • What is Neural Sketch? Dive into Neural Sketch's philosophy, core principles, and why it's tailored for top-tier research publications.

  • Notation & Conventions Learn the naming principles and visual grammar that unify diagrams.

  • Package Options Discover how to customize global styling—colors, borders, padding, and more—to align diagrams with your unique visual requirements.

  • Module Loading Learn how to optimize your workflow and reduce compilation overhead by selectively loading only the modules you need.

  • Color Palette Explore Neural Sketch's curated color scheme, and easily adapt or extend it to fit your personal or institutional style guidelines.


Happy Diagramming! 🎨

On this page