Python Jupyter - 更改默认字体

Sco*_*tEU 11 python ipython jupyter

我想更改Jupyter中显示的默认字体(到Gill sans),但我知道在哪里编辑它会遇到问题.

我查看了.ipython文件夹,我没有静态文件夹,我查看了.jupyter文件夹,它是空的.

有人知道吗?

Jam*_*per 12

您可以通过向文件添加值来修改Jupyter笔记本的样式;

.jupyter\custom\custom.css

如果customdir不是.jupyter只是制作它并添加custom.css它.

在新的空白custom.css文件中,您可以添加类似这样的内容来更改代码镜像的字体;

.CodeMirror pre, .CodeMirror-dialog, .CodeMirror-dialog .CodeMirror-search-field, .terminal-app .terminal {
    font-family: YOUR-FAV-FONT;
    font-size: 12pt;
}
Run Code Online (Sandbox Code Playgroud)

这是一个pimped out custom.css的例子.这是我在github上的一个黑暗笔记本回购.随意克隆/分叉并做任何事情.


小智 5

您可以从命令行更改字体大小、背景主题、单元格宽度等。查看以下 GitHub 页面。 https://github.com/dunovank/jupyter-themes