Jupyter notebook定制字体

一、生成配置文件

运行Anaconda Powershell Prompt终端,输入下面一行代码:

bash 复制代码
jupyter notebook --generate-config

将生成文件"C:\Users\XXX\.jupyter\jupyter_notebook_config.py",XXX为计算机账户名字。

二、修改配置文件

python 复制代码
c.NotebookApp.contents_manager_class = 'notebook.services.contents.largefilemanager.LargeFileManager'
# 确保你的CSS文件路径正确,并且文件名与你的相符
c.ContentsManager.files_to_run_on_start = ['custom/custom.css']  

三、使用样式文件

C盘用户文件夹下.jupyter文件,里面有custom文件夹,其下有一个custom.css文件。如果没有custom文件夹或者custom.css文件,可以自己建。下面在custom.css文件中添加如下代码:

css 复制代码
.CodeMirror pre {
    font-family: Consolas !important;   
    font-size: 13pt !important;
}

div.output_area pre {
    font-family: Consolas;   
    font-size: 12pt;       
}

span.cm-comment {
    font-family: SimHei !important;  
	font-size: 12pt !important;
    /*font-style: normal !important;*/
}
相关推荐
alvin_20053 小时前
python之OpenGL应用(二)Hello Triangle
python·opengl
铁蛋AI编程实战3 小时前
通义千问 3.5 Turbo GGUF 量化版本地部署教程:4G 显存即可运行,数据永不泄露
java·人工智能·python
生活很暖很治愈3 小时前
Linux——孤儿进程&进程调度&大O(1)调度
linux·服务器·ubuntu
jiang_changsheng3 小时前
RTX 2080 Ti魔改22GB显卡的最优解ComfyUI教程
python·comfyui
HalvmånEver3 小时前
Linux:线程同步
linux·运维·服务器·线程·同步
Zach_yuan3 小时前
自定义协议:实现网络计算器
linux·服务器·开发语言·网络
wdfk_prog3 小时前
[Linux]学习笔记系列 -- [drivers][I2C]I2C
linux·笔记·学习
VekiSon4 小时前
Linux内核驱动——杂项设备驱动与内核模块编译
linux·c语言·arm开发·嵌入式硬件
0思必得04 小时前
[Web自动化] Selenium处理滚动条
前端·爬虫·python·selenium·自动化
Y1rong4 小时前
linux之网络
linux