安装#
Jupyter Notebook 用久了就离不开了,然而自带的主题真的不忍直视。为了视力着想,为了自己看起来舒服,于是折腾了一番。。在 github 上发现了一个 jupyter-themes 工具,可以通过 pip 安装,非常方便使用。
首先是主题下载,为了速度快点,使用豆瓣源,命令行如下所示:
pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com --no-dependencies jupyterthemes==0.18.2
安装好了,有的电脑可能会提示缺少 lesscpy,继续 pip 安装
pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com lesscpy
然后是对主题选择、字体大小进行设置,我总结了一个我最喜欢的
jt --lineh 140 -f consolamono -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 14 -T -N
命令行的格式的解释如下表所示:
cl optionsargdefault
Usage help
-h
--
List Themes
-l
--
Theme Name to Install
-t
--
Code Font
-f
--
Code Font-Size
-fs
11