RE: TraditionalForm output and subscript variable
- To: mathgroup at smc.vnet.net
- Subject: [mg41521] RE: TraditionalForm output and subscript variable
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Sat, 24 May 2003 01:04:56 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Here's a relevant link: 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 <BlimbaumJE at ncsc.navy.mil> To: mathgroup at smc.vnet.net Subject: [mg41521] 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+MathGroup3528 at mailblocks.com] To: mathgroup at smc.vnet.net Subject: [mg41521] 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 <BlimbaumJE at ncsc.navy.mil> To: mathgroup at smc.vnet.net Subject: [mg41521] 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 -----Original Message----- From: Bobby Treat [mailto:drmajorbob+MathGroup3528 at mailblocks.com] To: mathgroup at smc.vnet.net Subject: [mg41521] Re: TraditionalForm output and subscript variable Subscript[a, n]*Cos[x]//FullForm 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 -----Original Message----- From: Blimbaum Jerry DLPC <BlimbaumJE at ncsc.navy.mil> To: mathgroup at smc.vnet.net Subject: [mg41521] TraditionalForm output and subscript variable 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 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