I would like to input "rendered" subscripts in Wolfram Cloud, without having to verbosely type Subscript[a, b]
. The local notebook shortcut is ctrl
+ -
,
but as per this question, such shortcuts are not yet available. One can copy the rendered output of evaluating Subscript[a,b]
into another input line, so it is possible that the input form contains rendered subscripts, albeit as non-editable tokens.
I am wondering whether it's possible to define a set of input transformation rules to parse and modify input as it is typed. For example, so that custom syntax like a((b))
would be immediately replaced with the output render of Subscript[a,b]
. I note that I could do this after cell evaluationg using CellEpilog
, as per this question, but I wish to perform the substitution 'on-the-fly' while the input is typed.
Is this at all possible? I can naturally choose a 'to be replaced' syntax in lieu of a((b))
which doesn't prematurely evaluate.
Format[a[b]] := Subscript[a, b]
orFormat[x[n_Integer]] := Subscript[x, n]
then input as indexed variables in subsequent code. $\endgroup$C
, andFormat[C[q_]] := Subscript[C, q]
throws an error (Tag C is Protected
) $\endgroup$Subscript[a, b][arg]
$\endgroup$a[b]
won't evaluate. $\endgroup$