Markdown files¶
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 called
CommonMark Markdown.
It has many elements for standard text processing, though it lacks a lot of features used for
publishing and documentation.
Note
If you’d like a more in-depth overview and guide to CommonMark markdown, see the CommonMark markdown tutorial.
This page describes some basic features of Jupyter Notebook markdown, and how to include them with your book.
Embedding media¶
Adding images¶
You can reference external media like images from your markdown file. If you use relative 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:
![C-3PO_droid](../images/C-3PO_droid.png)
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:
See also
Math and Equations for more information
Block-level math¶
You can include block-level math by wrapping your math in $$
characters.
For example, the following block:
$$
wow = its^{math}
$$
Results in this output:
You can also include math blocks by using latex-style syntax using \begin{align*}
.
For example, the following block:
\begin{align*}
yep = its_more^math
\end{align*}
Results in:
Important
This requires the MyST extended syntax enabled in your _config.yml
:
parse:
myst_extended_syntax: true
Extended markdown with MyST Markdown¶
In addition to CommonMark markdown, Jupyter Book also supports a more fully-featured version of markdown called MyST Markdown. This is a slight addition to CommonMark that includes syntactic pieces that are useful for publishing computational narratives. For more information about MyST Markdown, see MyST Markdown Overview.