Ubuntu下Jupyter Notebook的主题样式用习惯了,Windows下的页面风格以及字体实在是太过简陋用不习惯。下面我们看看如何修改Jupyter Notebook的主题样式。
我们要使用的是github上的一个开源的jupyter主题定制工具:jupyter-themes,链接为:https://github.com/dunovank/jupyter-themes,安装方便,使用简单,下面一起来学习一下。
安装 jupyterthemes 库
pip install jupyterthemes
加载样式列表
jt -l
可选样式比较多:
pml@Tower:~$ jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
加载主题
jt -t <主题名字>
jt -t grade3
返回默认主题
jt -r
注意:每更换一次主题要重启jupyter notebook才会显示。
设置代码字体和字号
使用-f选项设置字体
jt -t grade3 -f roboto -fs 11 -T -N # 设置主题为grade3,字体为roboto,字体大小为11
下面来查看一下修改后的效果图: