Neural Sketch
Commands/preloaded

nsk@E

Inline expression evaluation in Neural Sketch using the `\e` macro.

Overview

The \e command provides a concise way to expand and evaluate arithmetic expressions directly within your LaTeX\LaTeX code. It supports both integer and floating‑point operations, returning a decimal representation of the result.

Use \e whenever you need to compute numeric values on the fly, for example to calculate offsets, spacing, or loop‑based calculations in diagrams.

Syntax

\e<expression>
  • expression: An arithmetic expression enclosed in angle brackets, using standard operators (+, -, *, /) and parentheses.

Examples

Basic Arithmetic

% Compute 3.5 + 2.25
\edef\result{\e<3.5+2.25>}  % \result expands to "5.75"

In TikZ Options

\node[xshift=\e<1.2*2>cm] {Shifted by 2.4cm};

In Neural Sketch Loops

From the rqt.tex example:

% Compute dynamic bend distances:
\nskMarkPath[at=\e<-0.25-(.1*\o)>]{add}{...}

Reference Table

PropTypeDefault
expressionmath expression{}

On this page