# How to differentiate between superscript indices and powers in the output?

I have ambiguous notation in my output.

I have output that has two types of superscripts, indices and powers. The indices range from {none,0,1,2,3} and typical powers are 2 or 4.

When there is an superscript index with a power it is clear to see and or if the power is 4 or higher. However, ambiguity lies in deciphering between powers of 2 or 3 and superscript indices of 2 and 3.

I was wondering if there is a way to force the out put of powers to be in parentheses or a different color?

I am using the package FeynCalc to work through some gnarly Dirac matrix traces.

Here is a picture of the output that I am struggling with.

Update

I thought that switching the output form to standard fixed the issue... however it did not. Here is the same output as above but in standard form.

I tried looking for questions that answer this... So if this has been asked before, I apologize.

• I assume this will be unacceptable: Superscript[x, Style[2, Red]]^3 which will make your superscript red and leave the rest of your text black. I don't know how or even if that will play well with the FeynCalc package. And I don't know if it might be possible to use substitutions after-the-fact to wrap your superscripts in Style[ ,Red]. You might try such a pattern substitution on your exponents instead of your superscripts after the fact and see if you can get something that is acceptable. – Bill Dec 9 '16 at 4:57
• What exactly is the issue with the standard form output? On your screenshot I see that all components in powers are of the form (p^i)^n, so there is no ambiguity what is the component and what is the exponent. – vsht Dec 11 '16 at 0:12
• @ vsht Through dimensional analysis I was able to infer which was what and who was who. The parentheses do not always denote powers. For instance the third term is the magnitude of the four momentum k not the second spatial component of the four momentum. Soooo maybe I guess the way to look at this....which is maybe what you were getting at is... there is either: (p^i)^n or p^n. – Kyle Swanson Dec 11 '16 at 0:47

FeynCalc actually makes very little usage of ExplicitLorentzIndex. Such indices are not summed over but there are also no simplifications attached to them.

Anyhow, I've just added an option called TypesettingExplicitLorentzIndex to the development version. This way you can define the formatting of ExplicitLorentzIndex according to your preferences.

So if you reinstall FeynCalc via

Import["https://raw.githubusercontent.com/FeynCalc/feyncalc/master/install.m"]
InstallFeynCalc[InstallFeynCalcDevelopmentVersion -> True]


you can do things like

exp = 4 M^2 u FV[k, 0]^2 - 4 M^2 u FV[k, 3]^2 - 4 M SP[k, k] -
2 M u FV[k, 0] FV[k, 3]^2 + 4 M u FV[k, 0] FV[k, 2] - u^2 FV[k, 2]^2

TypesettingExplicitLorentzIndex = Function[x, Style[x, Red]]

exp

TypesettingExplicitLorentzIndex = Function[x, Style[x, Bold]]

exp


which should be what you want.