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
If you want to change the text cell font and font size you can type the following in a cell and hit shift+enter.
Just double click on the markdown cell. Edit what you want to and Run. It will reflect the changes. Save your notebook.
To change the font size, you don't need to know a lot of html for this. Open the html output with notepad ++. Control F search for "font-size". You should see a section with font sizes for the headers (h1, h2, h3,...).
For example, to make a word bold, surround it with the HTML code for bold ( <b>text</b> instead of the Markdown code. You can attach image files directly to a notebook in Markdown cells by dragging and dropping it into the cell.
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>
""")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With