Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2012

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

Search the Archive

Re: Superscript on plus expression

  • To: mathgroup at
  • Subject: [mg128809] Re: Superscript on plus expression
  • From: Roland Franzius <roland.franzius at>
  • Date: Wed, 28 Nov 2012 03:14:34 -0500 (EST)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <> <19898081.6403.1353229345311.JavaMail.root@m06> <000301cdc668$e3ec8740$abc595c0$> <k91u8h$5l1$>

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

  • Prev by Date: Re: vlookup like function sugestion
  • Next by Date: FinancialBond / Cashflow
  • Previous by thread: Superscript on plus expression
  • Next by thread: Re: Superscript on plus expression