1.安装主题包
pip install jupyterthemes
# 因为anaconda中没有该包,所以不能用conda
2.查看主题
安装完以后,在命令行输入
jt -l
可以查看有哪些主题
然后选择一个主题如:
jt -t oceans16
3.恢复主题
jt -r
4.设置主题参数
jupyterthemes的参数设置说明
cl options | arg | default |
---|---|---|
Usage help | -h | – |
List Themes | -l | – |
Theme Name to Install | -t | – |
Code Font | -f | – |
Code Font-Size | -fs | 11 |
Notebook Font | -nf | – |
Notebook Font Size | -nfs | 13 |
Text/MD Cell Font | -tf | – |
Text/MD Cell Fontsize | -tfs | 13 |
Pandas DF Fontsize | -dfs | 9 |
Output Area Fontsize | -ofs | 8.5 |
Mathjax Fontsize (%) | -mathfs | 100 |
Intro Page Margins | -m | auto |
Cell Width | -cellw | 980 |
Line Height | -lineh | 170 |
Cursor Width | -cursw | 2 |
Cursor Color | -cursc | – |
Alt Prompt Layout | -altp | – |
Alt Markdown BG Color | -altmd | – |
Alt Output BG Color | -altout | – |
Style Vim NBExt* | -vim | – |
Toolbar Visible | -T | – |
Name & Logo Visible | -N | – |
Kernel Logo Visible | -kl | – |
Reset Default Theme | -r | – |
Force Default Fonts | -dfonts | – |
提供一个更优化的配置:
jt -t oceans16 -f consolamono -nf robotosans -tf robotosans -N -T -cellw 60% -dfs 9 -ofs 9