Quick Start
Getting Started with Neural Sketch
Introduction
Neural Sketch (neural-sketch
) is a modern, opinionated, yet highly customizable package for crafting consistent, publication-ready diagrams with minimal effort.
It seamlessly combines an intuitive, minimal-boilerplate interface with a powerful key–value configuration system, allowing you to effortlessly create top-tier, conference-worthy diagrams while maintaining full control over fine-grained customization when needed. Built on l3build
, it leverages modern paradigms—such as expl3
and l3keys
—to deliver a fast, robust, and extensible package.
The package comes with a set of built-in modules, each designed to simplify specific aspects of diagram creation:
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.
Arrow Routing & Bridging
nsk@bridges
Automates line crossings and arrow routing, creating bridging arcs for clearer diagram layouts.
Annotations
nsk@annotations
Provides auto-incremented annotations with in-text referencing for labeled diagrams.
Decorations
nsk@decorations
Allows customized path decorations, enabling text markers, path modifiers, and visual embellishments.
Conditional Rendering
nsk@render
Enables conditional content rendering, supporting dynamic logic for multi-state diagrams.
Dark Mode
nsk@pargs
Enables seamless dark mode adaptation, preserving color harmony while applying automatic two-point color interpolation for web-based publications.
Want to learn more?
Read our in-depth What is Neural Sketch Introduction.
Key Benefits
-
Professional Defaults Save time with well-chosen color schemes, node shapes, and line thicknesses that match the aesthetic standards of AI/ML conferences and journals.
-
Minimal Boilerplate Define shapes and positions using concise commands. Automatic ID generation and positional referencing keep your diagram code small.
-
Depth of Control Adjust border radii, container padding, bridging arcs, and style keys without rummaging through countless TikZ settings.
-
Consistent Visual Theme Maintain a unified look across multiple figures and documents. Update one style key to refresh appearances everywhere.
Installation & Setup
Follow these simple steps to begin using Neural Sketch in your document.
Begin by loading the Neural Sketch package in your document preamble.
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:
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.
Example Diagram
Let’s craft a simple figure featuring grouped blocks neatly encapsulated within a labeled container:
Explanation of Example: - nskFigure
: Encloses all diagram components and resets internal state to ensure consistency. - nskContainer
: Wraps shapes to visually group them, automatically providing a bounding box and label. - nskBlock
: Fundamental building blocks, placed using concise positioning syntax like last-pos.
What's Next?
Neural Sketch empowers you to effortlessly create professional, publication-quality diagrams. To master NeuralSketch and elevate your diagrams, explore these resources:
-
What is Neural Sketch? Dive into NeuralSketch’s philosophy, core principles, and why it’s tailored for top-tier research publications.
-
Notation & Conventions Familiarize yourself with the standardized notation, recommended conventions, and best practices for efficient diagramming.
-
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! 🎨