Toolbar not visible after setting jupyter notebook theme
Asked Answered
B

8

31

The toolbar and notebook name does not show when I call and load the themes from the notebook.

I can load the themes from notebook using a code but I am not sure how to use the switches like -T and -N for call to toolbar and notebook name.

I have used the following in a code cell:

from jupyterthemes import get_themes
import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme
set_nb_theme('solarizedd')

The theme changes but the toolbar and notebook name does not appear. Even using the Toggle Header and Toggle Name from view in menu bar has no effect.

Biogeography answered 8/5, 2019 at 15:46 Comment(0)
B
59

TLDR : Run this :

!jt -t solarizedd -T -N -kl

Explanation:

I just installed the jupyter themes and went thru the same issue. My regular and nbextension toolbar disappeared and could not make it come back unless I reverted to default !jt -r.

after some research i fugure it out....so your cell should write

from jupyterthemes import get_themes import jupyterthemes as jt from jupyterthemes.stylefx import set_nb_theme set_nb_theme('solarizedd', -T, -N,-kl)

  • Toolbar Visible -T
  • Name & Logo Visible -N
  • Kernel Logo Visible -kl
  • their defaults are set to none

see the documentation documentation of jupyter theme

or something more permanent and fewer lines of code, using the command "!" in the actual cell

!jt -t solarizedd -T -N -kl
Bushbuck answered 28/8, 2019 at 3:21 Comment(3)
set_nb_theme('solarizedd', -T, -N,-kl) won't work (NameError: name 'T' is not defined and using"-T" etc. will also fail)... !jt though works like a charm!:) +1!Eran
Indeed; TypeError: set_nb_theme() takes 1 positional argument but 4 were given.Andino
The first code block (with set_nb_theme) in this answer doesn't work, but !jt -t solarizedd -T -N -kl does work. Also note !jt -l will list all available themes, and screenshots of available themes are available here: github.com/dunovank/jupyter-themes/tree/master/screens.Elin
D
8
jt -t oceans16 -T -N

this would surely help.

Ducharme answered 18/4, 2020 at 12:6 Comment(1)
How does this answer OP's question? Please explain.Bryannabryansk
H
5

I was able to solve this by editing the custom.css file located at ~/.jupyter/custom/custom.css. I changed the mailtoolbar setting from ’none’ to ‘block’. i.e. find this line:

    div#maintoolbar {
        display: none !important;
    }

...and change it to:

    div#maintoolbar {
        display: block !important;
    }

Hope that works for you too! Don't imagine looking for reasons it failed to start with, however, there is a theory one cannot update while it is running.

Heartbreaker answered 22/12, 2020 at 18:53 Comment(0)
H
3

If you do not want to use the code within the notebook itself, you can run it inside the anaconda prompt which is exactly what I did.

Firstly install it using pip:

pip install --upgrade jupyterthemes

and then run the following line as mentioned by other authors (notice that you cannot use the exclamation mark):

jt -t solarizedd -T -N -kl

This will apply to all of your notebooks. I find this much cleaner as you don't have to import the library, etc. in each notebook that you use. To apply a different theme replace solarizedd with other provided (e.g. onedork)

Hurleigh answered 21/2, 2022 at 18:14 Comment(0)
M
1

Have you tried to update to the latest version? I have tried many suggestions. All did not work until I updated the theme package to the latest version

pip install --upgrade jupyterthemes

I found the solution here

Myocardiograph answered 27/4, 2020 at 5:27 Comment(0)
C
1
!pip install jupyterthemes
import jupyterthemes as jt

!jt -r

this will throw the output like this
Reset css and font defaults in: /Users/malaudeen/.jupyter/custom & /Users/malaudeen/Library/Jupyter/nbextensions

Finally
refresh your browser.

Corkhill answered 20/6, 2021 at 7:35 Comment(0)
I
1

@jacoM is OP, but I have reasons to believe that the

from jupyterthemes import get_themes

import jupyterthemes as jt from jupyterthemes.stylefx import set_nb_theme

and the

!jt -t solarizedd -T -N -kl

works better when combined!

Intolerance answered 11/9, 2021 at 12:13 Comment(0)
T
1

Follow these steps

pip install jupyterthemes #installing jupyter themes

!jt -l #show list of themes

!jt -t chesterish -T -N -kl #this will set chesterish as the theme, -T will enable the toggle bar, -N will hide code cell numbers and -kl will show a small kernel logo

Truncate answered 5/3, 2023 at 7:59 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.