Feb 05, 2019 Prerequisite: Getting started with Jupyter Notebook. Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. What makes data analysis in Python more efficient and productive is Jupyter notebook or formerly known as the IPython notebook. Jupyter notebook converters. Markdown conversion: based on this article from fast.ai I can recommend the usage of their nbdev tool. Pip install nbdev. Html for WordPress.com (WordPress.com requires the CSS to be inline (inside the HTML elements) conversion: I’m using the excellent python script nb2wp from here. You require the nb2wp.py script.
You can write content in regular Markdown files (e.g., files ending in .md
).Jupyter Book supports any Markdown syntax that is supported by Jupyter notebooks.Jupyter Notebook Markdown is an extension of a flavour of Markdown calledCommonMark Markdown.It has many elements for standard text processing, though it lacks a lot of features used forpublishing and documentation.
Note
If you’d like a more in-depth overview and guide to CommonMark Markdown, seethe CommonMark Markdown tutorial.
This page describes some basic features of the Jupyter Notebook Markdown, and how toinclude them with your book.
Embedding media¶
I am able to convert part of the text in span to latex and jupyter renders the latex in red. – Shishir Pandey Aug 11 '15 at 15:59 @ShishirPandey: What I was referring to with 'conversion of the notebook to latex' is that you can normally convert a notebook to LaTex (a typesetting language) using ipython nbconvert -to latex mynotebook.ipynb. Apr 14, 2020 Create a table of contents. To start, lets create two markdown cells (see image below) How to create a table of contents in a jupyter notebook? Then, to create a table of contents, a solution is to create a markdown link to an anchor.
Adding images¶
You can reference external media like images from your Markdown file. If you userelative paths, then they will continue to work when the Markdown files are copied over,so long as they point to a file that’s inside of the repository.
Here’s an image relative to the book content root
It was generated with this code:
See also
Images and figures for more information.
Adding movies¶
You can even embed references to movies on the web! For example, here’s a little GIF for you!
This will be included in your book when it is built.
Mathematics¶
For HTML outputs, Jupyter Book uses the excellent MathJax library,along with the default Jupyter Notebook configuration, for rendering mathematics from LaTeX-style syntax.
For example, here’s a mathematical expression rendered with MathJax:
Block-level mathematics¶
You can include block-level mathematics by wrapping your formulas in $$
characters.For example, the following block:
Results in this output:
You can also include math blocks by using LaTeX-style syntax using begin{align*}
.For example, the following block:
Results in:
Important
This requires the amsmath
MyST extension to be enabled.
Extended Markdown with MyST Markdown¶
Jupyter Notebook Markdown Font Size
In addition to CommonMark Markdown, Jupyter Book also supports a more fully-featured version of Markdown called MyST Markdown.This is a superset of CommonMark that includes syntactic pieces that are useful for publishing computational narratives.For more information about MyST Markdown, see MyST Markdown overview.