Nicholas
Nicholas

Reputation: 3737

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?

Upvotes: 15

Views: 36015

Answers (3)

James Draper
James Draper

Reputation: 5310

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.

Upvotes: 18

user3687197
user3687197

Reputation: 181

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

Upvotes: 5

msalperen
msalperen

Reputation: 135

You can set defalut font at: /.jupyter/jupyter_qtconsole_config.py or from the command line. Check out this document (page 23) for a command line example https://media.readthedocs.org/pdf/qtconsole/latest/qtconsole.pdf

Upvotes: 3

Related Questions