如何在Ipython(py 2.7)笔记本中更改markdown单元格的字体大小和颜色

Bow*_*Liu 7 python ipython-notebook

我想在Ipython笔记本上写一篇论文,所以我想稍微装饰一下.通常我用"#"来改变大小.但是,我注意到当缩进超过4时#停止工作

###Python Paper
       ####Python Oaoer
Run Code Online (Sandbox Code Playgroud)

我也尝试过:.text_cell_render {font-family:Times New Roman,serif; 但是它显示无效的语法错误.

我尝试的另一种方法是在我的笔记本电脑中找到ipython.那也是南方.任何人都可以详细说明一下.

我是Python的新手,请原谅我的无知和请求喂勺.提前致谢

aqu*_*lin 18

如果您想更改笔记本的外观,请参阅此文档: iPython样式表

建议不要在单元格中使用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>
""")
Run Code Online (Sandbox Code Playgroud)