MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Why do parentheses spuriously appear when I type in a formula?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34458] RE: [mg34410] Why do parentheses spuriously appear when I type in a formula?
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Wed, 22 May 2002 02:46:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

> -----Original Message-----
> From: Carl K. Woll [mailto:carlw at u.washington.edu]
To: mathgroup at smc.vnet.net
> Sent: Saturday, May 18, 2002 9:52 AM
> Subject: [mg34458] [mg34410] Why do parentheses spuriously appear when 
> I type in a
> formula?
> 
> 
> Hi all,
> 
> For some strange reason, I want to type into Mathematica an 
> expression that
> should look like T^a_b, that is, the b subscript of T raised 
> to the a power.
> My exact key strokes are T Ctrl-^ a Ctrl-space Ctrl-_ b. 
> However, when I
> enter this expression into mathematica, it adds (spuriously 
> in my mind) some
> parentheses, so that I get (T^a)_b. I would like to know what 
> causes these
> parentheses to be added, and if there is anything I can do to 
> prevent them
> from appearing. What I have to do now is go back into the 
> expression and
> edit out the parentheses.
> 
> Carl Woll
> Physics Dept
> U of Washington
> 
> 
> 

Dear Carl,

of course as to the why, I could at most speculate. I wouldn't do that,
instead just add an observation:

If we input  "T Ctrl-^ a Ctrl-space Ctrl-_ b" as you described, we get

Cell[BoxData[
    SubscriptBox[
      RowBox[{"(", 
        SuperscriptBox["T", "a"], ")"}], "b"]], "Input"]

What you desired however is this:

Cell[BoxData[
    SubscriptBox[
      SuperscriptBox["T", "a"], "b"]], "Input"]

If I try one-dimensional input, to reach that I must add a bracket \( ... \)

In[13]:= \(\(T\^a\)\_b\)
Out[13]= SubscriptBox[SuperscriptBox[T,a],b]

otherwise I'd get something different and unwanted

In[2]:= \(T\^a\_b\)
Out[2]= SuperscriptBox[T,SubscriptBox[a,b]]

Parenthesis as from your undesired behaviour are reproduced with

In[3]:= \((T\^a)\_b\)
Out[3]= SubscriptBox[RowBox[{(,SuperscriptBox[T,a],)}],b]

(without the backslashes!) In contrast the complementary T can be reached by
"T ctrl-_ a ctrl-blank ctrl-^ b"

Cell[BoxData[
    SuperscriptBox[
      SubscriptBox["T", "a"], "b"]], "Input"]

or simply as

In[5]:= \(T\_a\^b\)
Out[5]= SuperscriptBox[SubscriptBox[T,a],b]

Related forms are produced as they should:

In[23]:= \(T\_\(a\^b\)\)
Out[23]= SubscriptBox[T,SuperscriptBox[a,b]]

In[25]:= \(T\^\(a\_b\)\)
Out[25]= SuperscriptBox[T,SubscriptBox[a,b]]


If you want to input fluently, perhaps it helps to first enter the
subscription:
"T ctl-_ b arrowleft arrowleft ctrl-^ a end"

Perhaps you can use the form

In[29]:= \(T\^a\%b\)//DisplayForm
Out[29]//DisplayForm=
 \!\(\* TagBox[\(T\_b\%a\), DisplayForm]\)

which inputs straight foreword as "T ctrl-^ a ctrl-% b"

Cell[BoxData[
    SubsuperscriptBox["T", "b", "a"]], "Input"]

--
Hartmut



  • Prev by Date: MathML Conference: Registration Deadline Extension
  • Next by Date: Speeding up hierarchical sorting
  • Previous by thread: Why do parentheses spuriously appear when I type in a formula?
  • Next by thread: RE: RE: Why do parentheses spuriously appear when I type in a formula?