Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Subscript on plus expression
Replies: 16   Last Post: Dec 3, 2012 3:18 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roland Franzius

Posts: 455
Registered: 12/7/04
Re: Superscript on plus expression
Posted: Nov 28, 2012 3:15 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Am 27.11.2012 09:39, schrieb Dave Snead:
> Hi,
>
> How can I get Mathematica to parenthesize the sum in
> Superscript[Plus[a,b],k] ?


Seems to be impossible to intercept output of Superscript by Format.
Defining

Format[superscript[a_Plus,b_]]:= Superscript[MatrixForm[{a}],b]

is working.

One may catch Superscript[Plus ,..] by postprocessing output:

$Post=
If[ MatchQ[#,Superscript[_Plus,_],
(MapAt[MatrixForm[{#}]&), #, 1],
#]&

Superscript is a special text case because the input parser reads it as
power, which is a pain for index gynm. On the other hand even in text
cells it is not possible to avoid brackets in mixed tensor index
super/subscripts.

Probably, the best way is to write a tensor index Format routine with
a List of {index-x-position,index-y-position, indexvalue} for each
index, a task not a too difficult with MakeBoxes.

--

Roland Franzius




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.