Ask Your Question
0

Dark Mode Jupyter Notebook

asked 2023-12-26 20:16:28 +0100

yeetcode gravatar image

updated 2023-12-26 20:17:18 +0100

Is it possible to somehow view the Jupyter notebook for Sagemath in Dark Mode? If yes, how?

edit retag flag offensive close merge delete

Comments

ISTR that this is a function of the browser you use to display Jupyter...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-12-27 09:53:15 +0100 )edit

The browser still reads CSS which it is told to read from somewhere. Finding that was particularly painful. Turns out, running !jt -r inside the notebook, which is just supposed to bring settings to default, also tells you the directories where modifications were made, and I think from that point onwards, the daring can even write their own CSS instead of using Jupyterthemes as shown below, and have fun.

yeetcode gravatar imageyeetcode ( 2024-02-04 11:51:37 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-12-29 11:30:32 +0100

Cyrille gravatar image

updated 2023-12-29 11:31:07 +0100

You can work along those lines from within a notebook

pip install jupyterthemes

If you typset

!jt -1

you will obtain the 9 proposed themes that is 1) chesterish, 2) grade3, 3) gruvboxd, 4) gruvboxl, 5) monokai, 6) oceans16, 7) oceans16, 7) onedork, 8) solarizedd 9) solarizedl

to load one or the other of those themes, the command are

from jupyterthemes import get_themes

import jupyterthemes as jt

from jupyterthemes.stylefx import set_nb_theme

set_nb_themes('the themes you want')

to go back to the standard themes

!jt -r

Hope I have not written a mistake.

edit flag offensive delete link more

Comments

Thanks! Your method of loading the themes didn't work (in particular my notebook couldn't find jupyterthemes), but the documentation on the webpage asks me to run

!jt -r <insert theme name>

within the notebook itself, and this seems to work.

yeetcode gravatar imageyeetcode ( 2024-02-02 18:26:32 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-12-26 20:16:28 +0100

Seen: 415 times

Last updated: Dec 29 '23