You can use extensions or display
helpers in IPython to make whatever syntax highlighting you\'d like on output cells.
For some special cell magics, like
For recent IPython version, the selected answer no longer works. The 'config_default' property was renamed options_default (Ipython 6.0.0). The following works:
import IPython
js = "IPython.CodeCell.options_default.highlight_modes['magic_fortran'] = {'reg':[/^%%fortran/]};"
IPython.core.display.display_javascript(js, raw=True)