# Stop Mathematica from turning negative powers into reciprocals of positive powers

Is there a way to stop Mathematica from turning every negative power $z^{-n}$ into $1/z^n$ in TraditionalForm? I'd like to get this:

but 1/(1 - p z^-1) // TraditionalForm gives me this:

• Have you tried 1/(1 - p z^HoldForm[-1]) ? – LouisB Jun 1 '17 at 20:51
• That never occurred to me. Thanks! – Rodney Price Jun 1 '17 at 21:32

It should be noted that these forms are interchangeable in Mathematica, by which I mean that there is both interconversion and that display does not match the internal form.

Power[x, -1] is displayed as 1/x, and 1/x is read as Times[1, Power[x, -1]].

a/b

% // FullForm

a/b

Times[a, Power[b, -1]]


So you cannot automatically have 1/(1 - p z^-1) displayed as without rules to distinguish the main reciprocal from the lower one.

You can prevent formatting by making -1 a non-number using Defer or HoldForm as LouisB recommended in a comment:

1/(1 - p z^Defer[-1]) // TraditionalForm


I am not sure if this kind of manual intervention is what you are seeking.

For the particular case this formatting rule on MakeBoxes gets the job done but it may affect, or fail to affect, the display of other expressions in a way you do not want.

MakeBoxes[a_*x_^-1, TraditionalForm] :=

1/(1 - p z^-1) // TraditionalForm

• If I change the pattern to a_*z^-n_ the MakeBoxes function does just what I need. Thank you. – Rodney Price Jun 1 '17 at 21:39