繁体   English   中英

如何在Ipython(py 2.7)笔记本中更改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 {font-family:Times New Roman,serif; 但是它显示无效的语法错误。

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

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

如果您想更改笔记本的外观,请参阅此文档: 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>
""")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM