Add output to IPython directive when in verbatim mode.

Addresses #5776.