How to change color in ipython / jupyter cell labels?

I am only looking for formatting a specific row inside a cell. I change the format of this cell to "Markdown", but I'm not sure how to change the text color of a single word.

I do not want to change the appearance of the entire laptop (via a CSS file).

+66
markdown ipython ipython-notebook jupyter-notebook
Nov 02 '13 at 20:11
source share
4 answers

You can just use raw html tags like

foo <font color='red'>bar</font> foo 

Remember that this will not overshoot the notebook envelope in latex.

As there are some complaints about the rejection of the proposed solution. They are completely true, and Scott already answered this question later, i.e. CSS based. However, this answer shows some general approach to using html tags inside IPython to erase the contents of the markdown cell compared to the available clean markdown capabilities.

+88
Nov 02 '13 at 21:05
source share

As in Jacob's answer, you can use HTML tags. Just note that the color font attribute ( <font color=...> ) is deprecated in HTML5 . The following syntax will match HTML5:

 This <span style="color:red">word</span> is not black. 

The same caution that Jacob is probably still applying:

Remember that this will not cause the laptop to transition to latex.

+48
Mar 11 '14 at 18:12
source share

For example, if you want to make the text color green, simply enter:

 <font color='green'>text</font> 
+10
Apr 27 '15 at 2:59
source share

An alternative way to do this is to enter the LaTeX environment on the laptop and change the color from there (this is great if you are better at LaTeX than HTML). Example:

 $\color{red}{\text{ciao}}$ 

will display ciao in red.

0
Dec 12 '18 at 22:24
source share



All Articles