jupyter notebook字体设置

这篇博客介绍了如何修改Jupyter Notebook的默认字体大小和样式,使其更易读。通过编辑`codemirror.css`文件,将字体设置为Consolas或类似字体,字体大小调整为18pt,行高设为22pt,从而提升阅读体验。
摘要由CSDN通过智能技术生成

jupyter notebook默认字体太小,不好看,如下图:
在这里插入图片描述
可以按以下方法进行修改:

1、在以下链接中找文件codemirror.css并打开
C:\Users\zhang\anaconda3\pkgs\notebook-6.4.12-py39haa95532_0\Lib\site-packages\notebook\static\components\codemirror\lib
2、修改文件中241行括号内的参数
修改前图片如下:
在这里插入图片描述

修改后如下:
在这里插入图片描述
也可以直接用以下代码替换241行.CodeMirror pre.CodeMirror-line-like及{}内的代码。

.CodeMirror pre.CodeMirror-line-like {
  /* Reset some styles that the rest of the page might have set */
  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
  border-width: 0;
  background: transparent;
  font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
  font-size: 18pt;
  margin: 0;
  white-space: pre;
  word-wrap: normal;
  line-height: 22pt;
  color: inherit;
  z-index: 2;
  position: relative;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-variant-ligatures: contextual;
  font-variant-ligatures: contextual;
}

修改后效果:
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值