欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Jupyter Notebook修改字体

程序员文章站 2022-05-30 16:47:45
...

编辑custom.css文件即可修改字体和美化Notebook,windows下路径为\venv\Lib\site-packages\notebook\static\custom\custom.css,修改后内容如下:

/*
Placeholder for custom user CSS

mainly to be overridden in profile/static/custom/custom.css

This will always be an empty file
*/
.CodeMirror pre {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei"; font-size: 10pt;}
* {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei";}
div.output_area pre {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei"; font-size: 10pt;}
div.input_prompt {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei"; font-size: 10pt;}
div.out_prompt_overlay {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei"; font-size: 10pt;}
div.prompt {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei"; font-size: 10pt;}
span.cm-comment {font-family:  Consolas, "Microsoft YaHei Mono", "Microsoft YaHei" !important; font-style:normal !important; color:#FFAE3C !important;}
code {font-family: Consolas, "Microsoft YaHei Mono", "Microsoft YaHei";}
.rendered_html code {
    border: 0;
    padding: 2px 4px;
    color:#c7254e;
    background-color: #f2f2f2;
    font-size: 100%;
}
.container { width:98% !important; }

修改后效果:
Jupyter Notebook修改字体
修改字体后效果

版权声明:本文为「txfly」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://www.jianshu.com/p/9d39b8ebf478