一、给Jupyter换主题
1. 更新jupyter-core
这里首先要更新jupyter-core到最新的4.4.0版本,同时要注意直接用pip更新会报错
Cannot uninstall 'jupyter-core'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
这里需要使用--ignore-installed: pip install jupyter-core --ignore-installed jupyter-core
2. 下载jupyter-themes
pip install jupyterthemes
3.打开主题列表
打开jupyter-notebook,加载主题列表
!jt -l
Available Themes:
chesterish
grade3
gruvboxd
gruvboxl
monokai
oceans16
onedork
solarizedd
solarizedl
4. 选择主题
# selecting a particular theme
!jt -t <name of the theme> -T -N
# reverting to original Theme
!jt -r
5. 重新加载一次Jupyter
!jt -t oceans16 -T -N
其实还是原始的好看QAQ
二、安装nbextensions
1. 安装jupyter_contrib_nbextensions
jupyter_contrib_nbextensions
2. 启用jupyter_contrib_nbextensions
jupyter contrib nbextension
3. 重新加载jupyter,并选用以下插件
Hinterland: 自动补齐
Snippets: 直接插入代码段
Autopep8: 美化代码格式
三、 幻灯片格式
1. 幻灯片
jupyter nbconvert *.ipynb --to slides --post serve
在端口段会显示ppt
2. RISE
下载RISE
conda install -c damianavila82 rise
运行加载RISE
jupyter-nbextension install rise --py --sys-prefix
#enable the nbextension:
jupyter-nbextension enable rise --py --sys-prefix
四、嵌入pdf和网页
1. 嵌入pdf
from IPython.display import IFrame
IFrame('https://arxiv.org/pdf/1406.2661.pdf', width=800, height=450)
2.嵌入网页
from IPython.display import IFrame
IFrame('https://en.wikipedia.org/wiki/HTTPS', width=800, height=450)