Using Displaying index as subscript on output: e.g. C[i] -> C_i with Notation[...] or Interpretation[..]?Displaying index as subscript on output: e.g. C[i] -> C_i with Notation[...] or Interpretation[..]? I have often ended up wanting to define functions of annotated variables to better match my whiteboard mathematics. Naively, I would want to do things like:
f[z[bar]_] := z[bar]^2;
relativez[z_, z[bar]_] := z / z[bar];
However, this doesn't work. Obviously, I can do things like
f[zbar_] := zbar^2;
f[z[bar]]
But I would prefer to have it map to my math better if a simple variation of this pattern works.