The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 586
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.

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

is working.

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

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

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.