Commands/render
nsk@Case
Define case branches within an `nskSwitch` environment for conditional content rendering in Neural Sketch.
Overview
The \nskCase command defines a branch within an nskSwitch environment. It compares a specified value against the switch operand and, if they match (and no prior case has matched), executes the provided code block.
Usage
Place \nskCase inside an nskSwitch environment:
Matching Behavior
- String mode: Default
type=string; compares operand and case value as literal strings. - Integer mode:
type=int; evaluates operand and case value as integers before comparison. - Floating-point mode:
type=float; evaluates operand and case value as floating-point numbers. - Boolean mode:
type=bool; compares operand and case value as literaltrue/false.
Only the first matching \nskCase is executed. Subsequent cases are skipped once a match is found.
Reference Table
| Prop | Type | Default |
|---|---|---|
| value | string | |
| code | LaTeX code | |
