Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Jupyter - Change default font

I want to change the default font (to Gill sans) that displays in Jupyter, but am having problems knowing where I go to edit it.

I have looked in the .ipython folder and I have no Static folder, and I have looked in the .jupyter folder and it is empty.

Does anyone know?

like image 958
ScoutEU Avatar asked Aug 07 '17 10:08

ScoutEU


People also ask

How do you change the font in Python Jupyter?

If you want to change the text cell font and font size you can type the following in a cell and hit shift+enter.


2 Answers

You can modify the styles of Jupyter notebook by adding values to the file in;

.jupyter\custom\custom.css

If the custom dir isn't in .jupyter just make it and add custom.css in it.

In your new blank custom.css file you can add something like this to change the font for the code mirror;

.CodeMirror pre, .CodeMirror-dialog, .CodeMirror-dialog .CodeMirror-search-field, .terminal-app .terminal {
    font-family: YOUR-FAV-FONT;
    font-size: 12pt;
}

Here is a example of a pimped out custom.css. It's from my one-dark-notebook repo on github. feel free to clone/fork it and do whatever.

like image 170
James Draper Avatar answered Sep 23 '22 21:09

James Draper


You can change font size, background themes, cell widths etc.. from the command line. Check out the following GitHub page. https://github.com/dunovank/jupyter-themes

like image 32
user3687197 Avatar answered Sep 22 '22 21:09

user3687197