Are you tired of looking at a white Jupyter Notebook? Let’s spice up our notebooks with Jupyter Themes by Kyle Dunovan.
Installation
Conda:
conda install -c condaforge jupyterthemes
Pip:
pip install jupyterthemes
Customizing Themes
Just type jt -t
followed by the name of the theme you choose. I like dark themes, so +1 for onedork
.
jt -t onedork
Here’s how one of the package author’s favorite theme settings looks like in action1:
jt -t onedork -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T
Other Themes
If a dark screen is not your jam, then there’s plenty of other colourful themes to choose from. If the novelty becomes tiresome and you wish to return back to the vanilla Jupyter theme, just quit the notebook server, and type the snippet below into your terminal, quit, and restart the Jupyter Notebook server again.
jt -r
Minor Mishaps
The only minor convenience is the possibility that the code cells might look slightly misaligned depending on what theme you pick and what browser you use on your operating system. On my web browser, I always get a weird style and spacing error that I need to fix by manually editing the css
file. I’m not sure if it’s worth automating because I’d say 4 out of 10 theme settings I pick will require some minor adjustments to the notebook css
files. This Stack Overflow post addressess where the css
file for Jupyter Notebooks is located on your computer and how to edit the alignent of notebook cells.
- Yes, that’s an actual screenshot of my schoolwork… [return]