如何更改 Ipython (py 2.7) notebook 中 markdown 单元格的字体大小和颜色
How to change the font size and color of markdown cell in Ipython (py 2.7) notebook
我想在Ipython笔记本上写一篇论文,所以我想稍微装饰一下。通常我用“#”来改变大小。但是,我注意到当缩进超过 4
时 # 停止工作
###Python Paper
####Python Oaoer
我也试过:
.text_cell_render {
字体系列:Times New Roman,serif;
}
但是它显示无效的语法错误。
我尝试的另一种方法是在我的笔记本电脑中找到 ipython。那也去了南方。谁能详细说一下。
我对Python还比较陌生,请原谅我的无知和灌食。提前致谢
如果您想更改笔记本的外观,请参考此文档:
iPython style sheets
不建议在单元格中使用 CSS,但可以这样做:
from IPython.core.display import HTML
HTML("""
<style>
div.cell { /* Tunes the space between cells */
margin-top:1em;
margin-bottom:1em;
}
div.text_cell_render h1 { /* Main titles bigger, centered */
font-size: 2.2em;
line-height:1.4em;
text-align:center;
}
div.text_cell_render h2 { /* Parts names nearer from text */
margin-bottom: -0.4em;
}
div.text_cell_render { /* Customize text cells */
font-family: 'Times New Roman';
font-size:1.5em;
line-height:1.4em;
padding-left:3em;
padding-right:3em;
}
</style>
""")
我想在Ipython笔记本上写一篇论文,所以我想稍微装饰一下。通常我用“#”来改变大小。但是,我注意到当缩进超过 4
时 # 停止工作###Python Paper
####Python Oaoer
我也试过: .text_cell_render { 字体系列:Times New Roman,serif; } 但是它显示无效的语法错误。
我尝试的另一种方法是在我的笔记本电脑中找到 ipython。那也去了南方。谁能详细说一下。
我对Python还比较陌生,请原谅我的无知和灌食。提前致谢
如果您想更改笔记本的外观,请参考此文档: iPython style sheets
不建议在单元格中使用CSS,但可以这样做:
from IPython.core.display import HTML
HTML("""
<style>
div.cell { /* Tunes the space between cells */
margin-top:1em;
margin-bottom:1em;
}
div.text_cell_render h1 { /* Main titles bigger, centered */
font-size: 2.2em;
line-height:1.4em;
text-align:center;
}
div.text_cell_render h2 { /* Parts names nearer from text */
margin-bottom: -0.4em;
}
div.text_cell_render { /* Customize text cells */
font-family: 'Times New Roman';
font-size:1.5em;
line-height:1.4em;
padding-left:3em;
padding-right:3em;
}
</style>
""")