Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Define a new output format' topicStudent Support Forum > General > "Define a new output format"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Patrick
05/01/12 2:56pm

I'm not sure whether you actually want newForm to appear in the format definition. Do you mean that you want to be able to type:
f[3] // newForm
and get out 9? I think then you'll have to define the format like this:
Format[newForm[f[x_]]] := x^2
because the form attribute is only meant to specify built-in ones like TraditionalForm, InputForm etc.
You may instead mean:
Format[f[x_]] := x^2
which will replace in all forms.
Compare:
Format[f[x_, y_, z__]] := f[x, ...]
f[a, b]
f[a, b, c]
f[a, b, c] // TraditionalForm

URL: ,

Subject (listing for 'Define a new output format')
Author Date Posted
Define a new output format Martin 04/27/12 9:40pm
Re: Define a new output format Patrick 05/01/12 2:56pm
Re: Define a new output format yehuda ben-s... 05/01/12 2:58pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic