方法1
1.打开cmd,首先进入到Jupyter的安装目录,我的是在D:\Python\Anaconda\Scrips中。
-
d:
-
cd Python\Anaconda\Scrips
2.进入到上面路径后输入命令
jupyter notebook --generate-config
3.执行命令后,会在如下所示路径的文件夹中找到新建立的Jupyter_notebook_config.py文件,打开搜索找到下面这行
#c.NotebookApp.notebook_dir =' '
删掉开头的“#”,在‘ ’中输入你要启动的目录路径。
4.之后找到Jupyter的快捷方式,右键打开属性,将快捷方式中“目标”中的%USERPROFILE%去掉。
方法2
直接修改快捷方式 目标 为安装位置的jupyter-notebook.exe文件,起始位置设置为你想要的起始目录即可
设置主题
首先安装jupyterthemes,在命令提示符中输入
pip install --user jupyter-themes
安装完成后输入下面这个例子
jt -t monokai -f dejavu -fs 12 -T
这个例子表示使用monokai主题,dejavu字体,字体大小为12,-T表示显示工具栏。这些都可以根据自己的爱好进行替换,后面还提供了其他可用的主题及字体,上面例子的效果如下
输入jt -l可查看可以用的主题
可以使用字体包括
Monospace Fonts (code cells)
-f arg | Monospace Font |
---|---|
anka | Anka/Coder |
anonymous | Anonymous Pro |
aurulent | Aurulent Sans Mono |
bitstream | Bitstream Vera Sans Mono |
bpmono | BPmono |
code | Code New Roman |
consolamono | Consolamono |
cousine | Cousine |
dejavu | DejaVu Sans Mono |
droidmono | Droid Sans Mono |
fira | Fira Mono |
firacode | Fira Code |
generic | Generic Mono |
hack | Hack |
hasklig | Hasklig |
inconsolata | Inconsolata-g |
inputmono | Input Mono |
iosevka | Iosevka |
liberation | Liberation Mono |
meslo | Meslo |
office | Office Code Pro |
oxygen | Oxygen Mono |
roboto | Roboto Mono |
saxmono | saxMono |
source | Source Code Pro |
sourcemed | Source Code Pro Medium |
ptmono | PT Mono |
ubuntu | Ubuntu Mono |
Sans-Serif Fonts
-nf/-tf arg | Sans-Serif Font |
---|---|
opensans | Open Sans |
droidsans | Droid Sans |
exosans | Exo_2 |
latosans | Lato |
ptsans | PT Sans |
robotosans | Roboto |
sourcesans | Source Sans Pro |
Serif Fonts
-nf/-tf arg | Serif Font |
---|---|
loraserif | Lora |
ptserif | PT Serif |
georgiaserif | Georgia |
cardoserif | Cardo |
crimsonserif | Crimson Text |
ebserif | EB Garamond |
merriserif | Merriweather |
neutonserif | Neuton |
goudyserif | Sorts Mill Goudy |
常用命令
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 | -- |