•$Post

In the next cell we make $Post display matrices in MatrixForm and all other results are not affected. The symbols returned by evaluating $OutputForms get special treatment in that they affect the printed output, but not the results assigned to (%n). By default $outputForms includes MatrixForm, TableForm, ScientificForm and other built-in formatting functions.  You can assign the functions in the list stored with $OutputForms to $Post or $PrePrint and get the same result.

     Clear[$Pre, $Post, $PrePrint] ;
     $Post = (# /. mtrx_ ? MatrixQ :> MatrixForm[mtrx]) & ;

After making the assignment above the output of the following is automatically displayed in MatrixForm.

     mtrx = {{1, 2, 0}, {0, 2, 3}, {1, 2, -1}}
     {Head[%], Head[mtrx]}
     ( 1    2    0  )
     
        0    2    3
     
        1    2    -1
     {List, List}
     Unprotect[$OutputForms] ;
     $OutputForms = Complement[$OutputForms, {MatrixForm}] ;
     mtrx = {{1, 2, 0}, {0, 2, 3}, {1, 2, -1}}
     {Head[%], Head[mtrx]}
     ( 1    2    0  )
     
        0    2    3
     
        1    2    -1
     {MatrixForm, List}
     $OutputForms = Union[$OutputForms, {MatrixForm}] ;
     Clear[$Pre, $Post, $PrePrint] ;
     $Post = (# /. x_ ? NumericQ :> x + 1) & ;

After making the previous assignment to $Post, the resulting output shows (1+π) instead of simply π.  There is clearly no pratical use for this sort of thing.  I am only doing this to illustrate the difference between $Post and $PrePrint and how $OutputForms gets involved.

     x = π
     1 + π

The result stored with (%n) from the evaluation above is also (1+π) since $Post is used before the results assigned to %n. This is demonstrated in the next cell where the previous output is accessed using (%%).

     Clear[$Post, $PrePrint] ;
     %%
     1 + π