# Display negative exponents always as fraction

I want Mathematica to display negative exponents always as fractions. I already tried:

Needs["Notation"]
(* Notation[1/a_^b_ <==> a_^-b_] *)
Notation[
ParsedBoxWrapper[RowBox[{"1", "/", RowBox[{"a_", "^", "b_"}]}]]
⟺
ParsedBoxWrapper[RowBox[{"a_", "^", RowBox[{"-", "b_"}]}]]]


While I do have

x^-z

1/x^z


the following doesn't work:

x^-(2z)

x^-2z


Some hints ? Thank you very much !

• Thank you @Sektor for reformatting !
– Mark
Commented May 11, 2014 at 11:41
• You are welcome ! If you are still experiencing troubles in the future, please, refer to the help centre for code formatting practices :) Commented May 11, 2014 at 11:54

I found a working solution for my case. It still uses the Notation Package and makes use of PatternWrappers:

Here is the Code:

Needs["Notation"]
(*Notation[1/Simplify[a_^(-b_ c_)] <==> a_^TemplateBox[b_?Negative] c_]*)
(*Notation[(a_^d_)/Simplify[a_^(-b_ c_)] <==> a_^TemplateBox[b_?Negative] c_+d_]*)
ClearNotations[]
Notation[ParsedBoxWrapper[
FractionBox["1",
SuperscriptBox["",
TemplateBox[{
RowBox[{"Simplify", "[",
SuperscriptBox["a_",
RowBox[{
RowBox[{"-", "b_"}], " ", "c_"}]], "]"}]},
"NotationPatternTag"]]]] \[DoubleLongLeftArrow] ParsedBoxWrapper[
SuperscriptBox["a_",
RowBox[{
TemplateBox[{
RowBox[{"b_", "?", "Negative"}]}, "NotationPatternTag"], " ", "c_"}]]]]
Notation[ParsedBoxWrapper[
FractionBox[
SuperscriptBox["a_", "d_"],
TemplateBox[{
RowBox[{"Simplify", "[",
SuperscriptBox["a_",
RowBox[{
RowBox[{"-", "b_"}], " ", "c_"}]], "]"}]},
"NotationPatternTag"]]] \[DoubleLongLeftArrow] ParsedBoxWrapper[

SuperscriptBox["a_",
RowBox[{
RowBox[{
TemplateBox[{
RowBox[{"b_", "?", "Negative"}]}, "NotationPatternTag"], " ", "c_"}],
"+", "d_"}]]]]