8

I am trying to write a paper in Ipython notebook, therefore I want to decorate it a little bit. Usually I do it with the "#" to change the size. However, I noticed that the # stops working when the indent is more than 4

###Python Paper
       ####Python Oaoer

I also tried: .text_cell_render { font-family: Times New Roman, serif; } However it shows invalid syntax error.

Another method I tried was to locate the ipython in my laptop. That went south too. Could anybody elaborate a little.

I am fairly new to Python, forgive my ignorance and request for spoon-feeding. Thanks in advance

1 Answer 1

20

If you want to change the appearance of your notebook, please refer to this document: iPython style sheets

CSS in a cell is not recommended but is possible like so:

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>
""")
1
  • Thank you so much, you helped me a lot. This is very detailed and helpful, gracias
    – Bowen Liu
    Dec 16, 2015 at 19:00

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.