更改iPython notebook markdown单元格中的字体 [英] Changing the font in iPython notebook markdown cells

查看:377
本文介绍了更改iPython notebook markdown单元格中的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想改变默认字体在Ipython(1.0.0)的笔记本markdown单元格为别的,并尝试这样做使用风格标记在markdown单元格,而不是通过创建一个custom.css的路径。我不知道CSS,我的需求非常小。经过一番研究,我发现了以下代码片段:

I just wanted to change the default font in Ipython (1.0.0) notebook markdown cells to something else, and tried doing this using style tags in a markdown cell instead of going through the path of creating a custom.css. I do not know CSS, and my needs are very minimal. After some research, I found the following code snippet:

<style>
div.text_cell_render {
font-family: "Times New Roman", serif;
...
}
</style>

我将上述CSS代码应用于markdown单元格,但是其他markdown文本单元格中的字体不变。我必须先打开一些东西吗?下面是它的样子:

I applied the above CSS code to a markdown cell, however the font in the other markdown text cells did not change. Do I have to turn something on first? Below is how it looks like:

推荐答案

在Ubuntu上可以使用:

On Ubuntu this works:

<style>
.text_cell_render {
font-family: Times New Roman, serif;
}
</style>

您的示例中的 ... 其他可能的选项,如列出例如 http://www.w3schools.com/css/css_text.asp

The ... in your example indicate other possible options like listed e.g. in http://www.w3schools.com/css/css_text.asp

但是,这个CSS适用于所有渲染的单元格文本,即。降价和标题。如果你想格式化只是markdown文本使用 .text_cell_render p {。单个标题可以用 h1 h2 ,etc代替 p

However, this CSS applies to all rendered cell text, ie. markdown and heading. If you want to format just the markdown text use .text_cell_render p {. The individual headings can be addressed with h1, h2, etc instead of p.

这篇关于更改iPython notebook markdown单元格中的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆