Jupyter Notebook主题及内部样式修改
更换Jupyter Notebook主题样式
安装主题包
打开命令行工具,输入代码
pip install jupyterthemes
或在Jupyter Notebook中空白call中输入
!pip install jupyterthemes
安装完成后即可修改主题
查看主题列表
打开命令行工具,输入代码
jt -l
或在Jupyter Notebook中空白call中输入
!jt -l
即可主题列表
''' Available Themes: chesterish grade3 gruvboxd gruvboxl monokai oceans16 onedork solarizedd solarizedl '''
设置和更换主题
jt -t [主题名]
常见主题效果
One dork

Oceans16

Chesterish

Grade3

进阶命令
主题包内置一些参数可以调整主题的内部样式(如字体类型、字体大小等),可根据个人审美和阅读习惯进行设置
参数代码如下
| 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 -r
我的主题样式设置
jt -t oceans16 -f fira -fs 13 -cellw 90% -ofs 11 -dfs 11 -T


浙公网安备 33010602011771号