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):
Replace <module_list>
with one or more module names, separated by commas, or use *
to load all available modules.
Examples
- Load a single module:
- Load multiple modules:
- Load all modules:
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:
Module | Description |
---|---|
bridges | Manages arrow routing, bridging arcs, and line crossings. |
coords | Provides precise anchor points and named coordinates. |
groups | Logical grouping with transforms like rotation or scaling. |
containers | Bounding boxes and visual groupings for diagram elements. |
annotations | Automatic, numbered annotations and referencing. |
decorations | Path markers, visual embellishments, and custom decorations. |
render | Conditional rendering with dynamic content. |
measure | Tools for precise dimensioning and measurements. |
Module Loading Logic
Internally, the loader operates using a clear, standardized naming scheme:
When invoking \nskUseModule
, Neural Sketch dynamically searches the current directory or your 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: