Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Markdown based Notebook

Jupyter Book allows Markdown Based Notebooks, these are plain text instead of the json based format of the traditional notebooks (.ipynb). There are some things to keep in mind when using this format as explained below.

There is also a traditional Jupyter version of this chapter.

1Advantages and Disadvantages of Markdown Based Notebooks

1.1Advantages

1.2Disadvantages

2Standard Markdown

These features are supported by all renderers as they are part of the basic set of features of Markdown. Some examples were extracted from the official docs.

print("Here is a Python cell2")
Here is a Python cell2

2.1Text Formating

In a Markdown text one can use bold, italics or both. It is also posible to combine it with monospace.

2.2Quotes

It is also possible to quote

2.3Lists

To keep everything organize, one usually use lists either ordered

  1. Step 1

  2. Step 2

  3. Step 3

Or without any order

2.4Horizontal Rule

Useful to separate sections


From other non-related topic

You know that there many search engines online?

There are some which focus on privacy, others just work arround Google and there is also one that uses ecryption!

2.6Images

One image is worth a thousand words some say

Alternative text

But it is even better if you can click them

Alternative text

3Limited Support

These features are part of some flavours of Markdown but not all renderers can process them. It is recommended to visualize this document in the target platform to check exactly which features are supported

3.1Tables

Tables are really complicated in Markdown and should only be generated by a specialized tool. Don’t modify markdown tables manually

SyntaxDescription
HeaderTitle
ParagraphText

3.2Block of Code

For code blocks, Jupyter Book will add a Copy button in the top left corner to easily copy all the text in the block.

Some times one wants to share data

{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Or simply say hello

print("Hello World!")

3.3Footnotes

Here’s a sentence with a footnote. [1]

3.4Math

Some renderers can process inline math, x=2x=2 and other can also process whole line math

0x3ex1dx=π415\int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15}

If supported, alignment can be done with array

a11=b11a12=b12a21=b21a22=b22+c22\begin{array}{llll} a_{11}& =b_{11}& a_{12}& =b_{12}\\ a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22} \end{array}

3.5Not supported in Jupyter Book

These are features that some renderers support but are not supported by Jupyter Book

3.5.1Strikethrough

Some times you ~~make a mistake~~ have a great idea

However, a HTML approach can produce the desired result

Some times you make a mistake have a great idea

3.5.2Check List

However, a HTML approach can produce the desired result

[ ] Write the press release


[ ] Update the website


[ ] Contact the media


4MyST Specific

These are some features that are the moment are only compatible with Jupyter Book. That means that rendering the notebook in other services (Github, NBviewer, Nteract, Data Lore, etc.) might not work as shown below. If your only target platform is Jupyter Book, you can use any of the following.

4.1Colored Admonitions

4.2Hidden Toggles

Click the button to reveal!

Some hidden toggle content!

Outside Content

Inside Content

4.4Dropdowns with Admonitions

4.5Panels

Panel header 1

Panel body 1

Panel footer 1

Panel header 2

Panel body 2

Panel footer 2

4.6Tabs

Tab 1 title
Tab 2 title

My first tab

Sidebars are shown in parallel to the main text, but they span inwards from the margins.

4.8Margin Note

Margin notes are more discrete, useful for pointing minor details or add extra information.

They span from the margin outwards

4.9Labels

Would you like to write homework for your students? Check the dropdowns!

It is always important to provide enough data to support claims!

4.10Equations

4.10.1Without Label

x2+y2=1x^2 + y^2 = 1

4.10.2With Label

x2+y2=1x^2 + y^2 = 1

If the equation has a label, it can be then referenced (4)

4.11Citation

This project uses numbered citations (IEEE style), enabled by setting numbered_references: true under site.options in myst.yml. Citations can be customized — see the MyST citations guide for details.

MyST supports Pandoc-style citation syntax. With numbered_references enabled, parenthetical citations render as numbers while narrative citations keep the author name in the text.

4.11.1Parenthetical (numbered)

Use square brackets around the citation key: [@perez2011python].

This project uses the Python Language 1 to build Jupyter Book 2.

4.11.2Narrative

Use the citation key with an at-sign, without brackets: @perez2011python.

Perez et al. (2011) introduced Python as an ecosystem for scientific computing. Jupyter Book is documented in Community (2020).

MyST automatically adds a references section at the bottom of pages that contain citations. When using numbered references together with footnotes, keep in mind that both appear at the bottom of the page and may be numbered in the same sequence.

Footnotes
  1. This is the footnote.

References
  1. Perez, F., Granger, B. E., & Hunter, J. D. (2011). Python: an ecosystem for scientific computing. Computing in Science & Engineering, 13(2), 13–21. 10.1109/MCSE.2010.119
  2. Community, E. B. (2020). Jupyter Book (v0.10). Zenodo. 10.5281/zenodo.4539666