ab*Cos[t] gives output of ab Cos[t].........however....
a_Subscript_b*Cos[t] gives output of Cos[t] a_Subscript_b......which
is an example of what I dont want...i have never seen anyone write
Cos[t] A....rather then A Cos[t]......
Some other examples are:
a_Subscript_b*?[t] (where ? is the letter 't' or higher in the
alphabet)....outputs..... a_Subscript_b ?[t].......whereas
For ? lower then 't'....the output is ?[t] a_Subscript_b.....which is
again not what I want as the Traditional Form output.....
Any explanations for these results or just a Mathematica quirk?..
jerry blimbaum NSWC panama city, fl
Times[Cos[x], Subscript[a, n]]
Because Times is Orderless, its arguments are sorted into canonical
order, and Subscript obviously comes after Cos.
Somebody will tell us how to overcome that, but I don't think it will
be worth the trouble.
Bobby
http://forums.wolfram.com/mathgroup/archive/2003/Apr/msg00716.html
After evaluating
MakeExpression[SubscriptBox["a", i_], f_] :=
MakeExpression[RowBox[{"a", "[", i, "]"}]]
MakeBoxes[a[i_], f_] :=
SubscriptBox[MakeBoxes[a, f], MakeBoxes[i, f]]
you can type a[n] or Subscript[a,n] (either way), and the output will
format with subscripts, but the value will always be a[n].
As a bonus, the output of
a[2]Cos[x]
or
a_2 Cos[x]
is now in the order you wanted, because "a" sorts before "Cos". Of
course, if you do the same thing with a variable name that sorts after
Cos -- you can guess what will happen.
Bobby
-----Original Message-----
From: Blimbaum Jerry DLPC <Blimb...@ncsc.navy.mil>
Subject: RE: TraditionalForm output and subscript variable
For me though , I find subscripts extremely important....i just hate my
documents, or really any documents or notebooks, with a0 rather then
a_Subcript_0....I admire Mathematica so much except for this feature...i
would really like to also see the Mathematica texts written with
subscripts...to me it's so much more readable and makes Mathematica
almost
indistinguishable from paper and pencil math.....so much for wishes
though....
Something else that I learned from your email was my failure to use
FullForm
to see what's behind it....i'll know better for the future....
thanks...jerry
-----Original Message-----
From: Bobby Treat [mailto:drmajorbob+M...@mailblocks.com]
Subject: RE: TraditionalForm output and subscript variable
TraditionalForm doesn't follow ALL the traditions, obviously, and it
probably has enough to do as it is. I suspect it might be fairly
straightforward to modify MakeForm (?) to get what you want. I hope a
more knowledgeable expert will tell us how.
I usually avoid subscripts because subscripted expressions don't act
like variables, they don't paste well into e-mail, etc.
Bobby
-----Original Message-----
From: Blimbaum Jerry DLPC <Blimb...@ncsc.navy.mil>
Subject: RE: TraditionalForm output and subscript variable
Bobby...
The reason I presented this, though, is because I expected
'TraditionalForm'
output...and this example goes counter to TF....or , at least, it seems
that
way to me...I expected something to be 'added' to Times or any other
command
that gets me TF output...
jerry
>I use TraditionalForm for output........but i notice certain outputs
>concerning subscript variables that puzzle me.....and also arent' what
>i want.....example... (where Subscript variable gotten from using the
>Palette)...
>ab*Cos[t] gives output of ab Cos[t].........however....
>a_Subscript_b*Cos[t] gives output of Cos[t]
>a_Subscript_b......which is an example of what I dont want...i
>Some other examples are:
>a_Subscript_b*?[t] (where ? is the letter 't' or higher in the
>alphabet)....outputs..... a_Subscript_b ?[t].......whereas
>For ? lower then 't'....the output is ?[t] a_Subscript_b.....which
>is again not what I want as the Traditional Form output.....
>Any explanations for these results or just a Mathematica quirk?..
For operators like Times with the attribute Orderless, I believe Mathematica orders the output display alphabetically. In your first example a_Subscribt_b*Cost[t], a_Subscript_b has Head = Subscript and Cos[t] has Head = Cos. C comes before S so Mathematica orders the output display as Cos[t]*a_Subscript_b.
For your second example, ?[t] has Head = ?. So, when ? is a letter that comes before S you get the subscripted variable at the end and when ? is a letter that comes after s you get the subscripted variable at the beginning.
As for why expressions might be displayed this way, I would expect comparisions of two expressions to be greatly simplified and faster if the expressions are stored in a standard way. Obviously, the simplest way to display a stored expression would be to output its elements in the order stored.
if you use the Sybomize[] comman of the Notation package, it
will generate from Subscript[a,b] a symbol
a\[Backslash][RoundSpaceIndicator]b
and it generate a Format (MakeBoxes[])
for the new symbol, that output
SubscriptBox[a,b]
and a
MakeExpression[Subscript[a,b],fmt_]:=a\[Backslash][RoundSpaceIndicator]b
so that you never see the strange symbol
a\[Backslash][RoundSpaceIndicator]b
but if you forgot to load tha package or to symbolize Subscript[a,b]
the definitions are missing and than you see the internal symbol name.
Regards
Jens