RE: RE: Why do parentheses spuriously appear when I type in a formula?
- To: mathgroup at smc.vnet.net
- Subject: [mg34604] RE: [mg34553] RE: [mg34410] Why do parentheses spuriously appear when I type in a formula?
- From: "DrBob" <majort at cox-internet.com>
- Date: Wed, 29 May 2002 02:46:26 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
Thanks, David. To me though, the most interesting thing about your notebook is what you didn't explain at all... the InputAliases option. Do you have to set that in the Options Inspector, or can you use a line of notebook code? It will take me awhile to internalize all the things I'm learning from the group recently. It's a mind-boggling set of ideas to digest. Tensor calculus itself is beginning to seem a necessary topic for study, and that's odd, after these MANY years successfully avoiding that, despite studying a wide range of things. Even if I don't need to get into tensors much, it's certainly useful to be able to display them this way. Bobby -----Original Message----- From: David Park [mailto:djmp at earthlink.net] To: mathgroup at smc.vnet.net Subject: [mg34604] RE: [mg34553] RE: [mg34410] Why do parentheses spuriously appear when I type in a formula? Hatmut and Bobby, Why fight this parentheses war? It appears to be an inaccessible internal part of Mathematica processing. Even if it is solved, is it a great way to enter tensors? The idea of using a lot of Ctrl's to maneuver around the box structure is not appealing if I have a number of tensors to enter. I have attached a notebook that shows an alternative method for entering tensors. Carl Woll helped me develop this. (It intially also had a parentheses problem, this time on output.) Those in MathGroup who are interested can contact me for the notebook. I represent a tensor on input and output as a label followed by a two row, GridBox. The GridBox is really just a matrix and it provides nice up and down placement of the indices. I define overall parameters that control the font sizes and spacings of the output format. The user can set alter parameters. I define an alias for the input form that is entered by esc tform esc. This brings up placeholders for the label and first up/down slot of the tensor. Additional slots are easily provided with a Ctrl-comma, as is down with any matrix. Instead of having to maneuver up and down, you can just use Tab to go between the slots. The MakeExpression routine then converts to an internal Tensor[label,indices] format. (I'm leaving the exact internal tensor format vague in this communication - because that is also a subject of debate.) Tensor labels are declared and in the input/output box expressions the label is bound to the GridBox with an InvisibleApplication. Application binds fairly tightly and that eliminates the parentheses between tensors on output. If you are really entering a lot of tensors in a notebook it is probably even easier to define shortcuts, say, g[i_,j_]:= Tensor[g, i and j as down indices] and if you have a palette with the Tensor format on it, that cuts down more on the typing. What is easiest in everyday use should be the criterion for methods of tensor entry. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: DrBob [mailto:majort at cox-internet.com] To: mathgroup at smc.vnet.net > > >>There is a clear visual difference between the two. Just compare > > >>Superscript[Subscript[T,b],a] > > >>Subscript[T,Superscript[b,a]] > > >>after deleting the parentheses that show up in the first case. > > I can't compare them, because I can't delete those parentheses! (I > tried.) > > Here are the five primary choices... > > {Superscript[Subscript[T, b], a], > Subscript[T, Superscript[b, a]], > Subscript[Superscript[T, a], b], > Subscript[T^a, b], > Subscript[T, b]^a} > > Pick the one you like. Of these, the first apparently can't be entered > with simple keystrokes. The second and fifth can easily be entered with > keystrokes. > > The third and fourth can be entered with keystrokes IF you delete the > parentheses that appear automatically (but they're back if you > evaluate). > > Bobby Treat > >