Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to (sub)expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the transformation rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to (sub)expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the transformation rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to (sub)expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the transformation rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

added 20 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to expressions(sub)expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the transformation rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to (sub)expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the transformation rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

added 25 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules are based on patterns that typically apply to expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the rules of MakeBoxes.

In this example the formatting rules for Times isare still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules are based on patterns that typically apply to expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the rules of MakeBoxes.

In this example the formatting rules for Times is still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Consider this:

Inactivate[3*5 - 2 - 3] // FullForm
Inactive[Plus][Inactive[Times][3, 5], -2, -3]

RunnyKine is correct regarding the cause but he did not really explain the mechanism involved. Formatting rules typically apply to expressions with certain heads. This has nothing to do with evaluation per se, but rather the patterns in the rules of MakeBoxes.

In this example the formatting rules for Times are still applied despite HoldComplete:

HoldComplete[Times[x, y]] // TraditionalForm

HoldComplete[x y]

Another example and further explanation can be seen in my answer to:

Simply put Inactive[Times] does not match the patterns used by MakeBoxes for pretty formatting. However we can easily add our own rules. If you wish to have expressions produced by Inactivate formatted as the normal form of the expression (without evaluation) you may use:

MakeBoxes[p : Inactive[h_][args___], form_] := 
  MakeBoxes[Interpretation[HoldForm @ h[args], p], form]

Now the expression is formatted using the normal rules for Times and Plus:

enter image description here

Without the definition this is printed without the nice formatting:

enter image description here

Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k
Loading