Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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.

Using 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.

Using 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.

edited title
Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

How to define a function of z[bar], etcnon-symbol

Source Link
jlperla
  • 977
  • 6
  • 18

How to define a function of z[bar], etc

Using 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.