Jupyter Notebook用久了就离不开了,然而自带的主题真的不忍直视。为了视力着想,为了本身看起来舒服,因而折腾了一番。。在github上发现了一个jupyter-themes工具,能够经过pip安装,很是方便使用。git
首先是主题下载,命令行以下所示:github
pip install --no-dependencies jupyterthemes==0.18.2
安装好了,有的电脑可能会提示缺乏 lesscpy,继续 pip 安装vim
pip install lesscpy
而后是对主题选择、字体大小进行设置,我总结了一个我最喜欢的less
jt --lineh 140 -f consolamono -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 14 -T -N
命令行的格式的解释以下表所示工具
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 | -- |
Reset Default Theme | -r | -- |
Force Default Fonts | -dfonts | -- |
附上最终效果字体
接着让 jupyter notebook 实现自动代码补全,首先安装 nbextensionsspa
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
而后安装 nbextensions_configurator命令行
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
若是提示缺乏依赖,就使用pip安装对应依赖便可。code
最后重启jupyter,在弹出的主页面里,能看到增长了一个Nbextensions标签页,在这个页面里,勾选Hinterland即启用了代码自动补全,如图所示:blog
这时打开一个笔记,来感觉一下吧。