Neural Sketch
Commands/preloaded

nsk@ID

Retrieve block identifiers by sequence position.

Overview

The \nskID command returns a block identifier from Neural Sketch’s internal history sequence. By default, it selects relative indices (from the end) but, when prefixed with a bang (!), it supports absolute indexing (from the start).

Syntax

\nskID{<n>}
\nskID!{<n>}
  • ! (boolean, default=false): When present before the index, \nskID uses absolute indexing (from the first block).
  • n (number, optional): The position index. In relative mode (no !), returns the nth-last block ID; in absolute mode (!), returns the nth-first block ID. If omitted ({}), returns the last ID in relative mode or the first ID in absolute mode.

Usage

Retrieve the most recently created block ID:

\nskBlock[id=A]
\nskBlock[id=B]
 
Last ID: \nskID{1}  % returns "B"

Retrieve the second-last block ID (relative indexing):

Second-last ID: \nskID{2}  % returns "A"

Retrieve the first block ID (absolute indexing):

First ID: \nskID!{1}  % returns "A"

If the index argument is omitted or blank, \nskID returns the last ID in relative mode, or the first ID in absolute mode.

Reference Table

PropTypeDefault
!?booleanfalse
n?number{}

On this page