$PrePrint

$PrePrint

is a global variable whose value, if set, is applied to every expression before it is printed.

Details

  • $PrePrint is applied after Out[n] is assigned, but before the output result is printed.

Examples

open allclose all

Basic Examples  (2)

By default, $PrePrint is not defined, meaning output is shown as it comes from evaluation:

Show exact quantities by their numerical value:

The function is designed to preserve arbitrary precision numbers if they are in the output:

Restore $PrePrint to the default:

Note that changing $PrePrint did not change the values saved in Out:

Scope  (1)

Show matrices using plots:

Restore $PrePrint to the default:

Introduced in 1988
 (1.0)