2

It is possible to syntax highlight inline code in Jupyter? Maybe similar as asked here.

Currently, the following markdown

   Inline code `np.array`.
   vs.
   Code block:
   ```python
   np.array
   ```

yields

enter image description here

Reblochon Masque
  • 35,405
  • 10
  • 55
  • 80

1 Answers1

1

I don't think it is possible; the jupyter markdown defines the triple quote followed by a language name as the "syntax highlighting markup".

It is not exactly what you want, but there are two ways to color text in a md cell:

Using Latex:

${\text{inline code :}}\color{red}{\text{ np.array}}{\text{ but no cigar}}$

Using HTML:

inline code: <span style="color:red">np.array</span> but no cigar.

which respectively render like this:

enter image description here

Reblochon Masque
  • 35,405
  • 10
  • 55
  • 80