首先需要安装一个插件:
pip install jupyterthemes
这里会出现让你升级pip的操作,记住:要在cmd管理员模式下运行命令
安装完毕后,在cmd输入:
jt -h
可以显示帮助:
> jt -h
usage: jt [-h] [-l] [-t THEME] [-f MONOFONT] [-fs MONOSIZE] [-nf NBFONT]
[-nfs NBFONTSIZE] [-tf TCFONT] [-tfs TCFONTSIZE] [-dfs DFFONTSIZE]
[-ofs OUTFONTSIZE] [-mathfs MATHFONTSIZE] [-m MARGINS]
[-cursw CURSORWIDTH] [-cursc CURSORCOLOR] [-cellw CELLWIDTH]
[-lineh LINEHEIGHT] [-altp] [-altmd] [-altout] [-P] [-T] [-N] [-kl]
[-vim] [-r] [-dfonts]
optional arguments:
-h, --help show this help message and exit
-l, --list list available themes
-t THEME, --theme THEME
theme name to install
-f MONOFONT, --monofont MONOFONT
monospace code font
-fs MONOSIZE, --monosize MONOSIZE
code font-size
-nf NBFONT, --nbfont NBFONT
notebook font
-nfs NBFONTSIZE, --nbfontsize NBFONTSIZE
notebook fontsize
-tf TCFONT, --tcfont TCFONT
txtcell font
-tfs TCFONTSIZE, --tcfontsize TCFONTSIZE
txtcell fontsize
-dfs DFFONTSIZE, --dffontsize DFFONTSIZE
pandas dataframe fontsize
-ofs OUTFONTSIZE, --outfontsize OUTFONTSIZE
output area fontsize
-mathfs MATHFONTSIZE, --mathfontsize MATHFONTSIZE
mathjax fontsize (in %)
-m MARGINS, --margins MARGINS
fix margins of main intro page
-cursw CURSORWIDTH, --cursorwidth CURSORWIDTH
set cursorwidth (px)
-cursc CURSORCOLOR, --cursorcolor CURSORCOLOR
cursor color (r, b, g, p)
-cellw CELLWIDTH, --cellwidth CELLWIDTH
set cell width (px or %)
-lineh LINEHEIGHT, --lineheight LINEHEIGHT
code/text line-height (%)
-altp, --altprompt alt input prompt style
-altmd, --altmarkdown
alt markdown cell style
-altout, --altoutput set output bg color to notebook bg
-P, --hideprompt hide cell input prompt
-T, --toolbar make toolbar visible
-N, --nbname nb name/logo visible
-kl, --kernellogo kernel logo visible
-vim, --vimext toggle styles for vim
-r, --reset reset to default theme
-dfonts, --defaultfonts
force fonts to browser default
如:
>jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
列出所有的可选主题
我的设置是:
jt -t onedork -N -T -f hack -fs 12 -cellw 98%
主题onedock,显示文件名,显示toolbar,字体hack,字号12,代码行宽度屏幕占比98%