Neural Sketch
Commands

nsk@UseModule

Selectively load Neural Sketch modules with `\nskUseModule`

Overview

The \nskUseModule command in Neural Sketch provides precise control over module activation, allowing you to selectively enable only the modules necessary for your diagrams. By loading only essential components, you ensure your diagrams remain concise, clear, and compilation-efficient.


Usage

Invoke \nskUseModule within your document preamble (or at least before diagram construction):

\nskUseModule{<module_list>}

Replace <module_list> with one or more module names, separated by commas, or use * to load all available modules.

Examples

  • Load a single module:
\nskUseModule{containers}
  • Load multiple modules:
\nskUseModule{containers, bridges, coords}
  • Load all modules:
\nskUseModule{*}

Avoid calling \nskUseModule multiple times with different sets of modules, as this may lead to conflicts or unexpected behavior.


Why Selective Loading?

Neural Sketch emphasizes modularity for the following key reasons:

  • Performance Optimization: Loading only required modules minimizes compilation overhead, significantly speeding up large or complex diagrams.
  • Clarity and Maintainability: Clearly document diagram dependencies, providing instant visibility of active functionalities.
  • Scalability: Easily adapt your environment from simple sketches to sophisticated, multi-layered diagrams without changing core package settings.

Available Modules

Below are the current Neural Sketch modules and their functionalities:

ModuleDescription
bridgesManages arrow routing, bridging arcs, and line crossings.
coordsProvides precise anchor points and named coordinates.
groupsLogical grouping with transforms like rotation or scaling.
containersBounding boxes and visual groupings for diagram elements.
annotationsAutomatic, numbered annotations and referencing.
decorationsPath markers, visual embellishments, and custom decorations.
renderConditional rendering with dynamic content.
measureTools for precise dimensioning and measurements.

Module Loading Logic

Internally, the loader operates using a clear, standardized naming scheme:

neural-sketch-<module>.sty

When invoking \nskUseModule, Neural Sketch dynamically searches the current directory or your LaTeX\LaTeX system's standard path to locate the respective unpacked .dtx files.

If the requested module cannot be found, compilation will halt, and an informative error message will guide you to resolve the issue.


Minimal Working Example

Here's a complete example demonstrating basic module loading:

minimal.tex
\documentclass{standalone}
 
\usepackage{neural-sketch}
\nskUseModule{bridges,coords}
 
\begin{document}
\end{document}

On this page