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.

MyST Markdown Basics

In JupyterLab

Curvenote
ExecutableBooks
Open In Colab

MyST is an ecosystem of open-source, community-driven tools designed to revolutionize scientific communication. MyST supports blogs, online books, scientific papers, reports and journals articles.

Editing Markdown Cells

Working with markdown cells is exactly the same as normal in Jupyter, try taking a look at the source of this cell.

🛠 Double click to edit this cell, then type Shift-Enter to re-render the cell

To change the style of the callout, try changing it to a {note}

🛠 Edit the callout in this cell to {note} instead of a {tip}

You can also add directive options, with a :class: dropdown as the first line of the directive. Adding the dropdown class will turn this callout into a dropdown that is initially hidden, which is great for hiding solutions in JupyterLab for students, for example!

Figures & Cross References

MyST has support for figures, images and rich cross-references to preview the figures when you hover over a reference.

🛠 Double click the next cell to see the MyST {figure} syntax

Relaxing at the beach 🏖

Figure 1:Relaxing at the beach 🏖

You can reference a figure with a markdown link to the name of the figure, for example, [](#beach).

🛠 Hover the cross-references to the figures

In Figure 1 we can (hopefully) see someone enjoying the beach, and in Figure 2 we can see fruit! These figures are also automatically numbered, and will update based on their position in the document.

🛠 Drag the markdown cell with fruit up to make it Figure 1

Both the caption number and all references to those cells will update instantly! ⚡️

A random picture of fruit 🍎🍊

Figure 2:A random picture of fruit 🍎🍊

Equations

All of the standard markdown syntax for equations will also work with the MyST renderer. The easiest way to create math is to use the dollar-syntax, for example, for inline math:
$Ax=b_i$ will become Ax=biAx=b_i

You can also now label and reference your equations, this is using a LaTeX\LaTeX style \label{} in the dollar-math block[1]:

🛠 Double click this cell to see the label syntax

u×v=u2u3v2v3i+u3u1v3v1j+u1u2v1v2k\mathbf{u} \times \mathbf{v}=\left|\begin{array}{ll}u_{2} & u_{3} \\ v_{2} & v_{3}\end{array}\right| \mathbf{i}+\left|\begin{array}{ll}u_{3} & u_{1} \\ v_{3} & v_{1}\end{array}\right| \mathbf{j}+\left|\begin{array}{ll}u_{1} & u_{2} \\ v_{1} & v_{2}\end{array}\right| \mathbf{k}

Similar to figures, you can link to the equation using a markdown link and they will be auto-labeled.

🛠 Hover the cross-references to the equation

In (1) you can see a cross-product or Equation 2 is Maxwell’s equations

Similar to the figures, these equations are auto numbered.

🛠 Drag the markdown cell with Maxwell’s equations up to make it Equation 1

×e+bt=0×hj=s_e\begin{aligned} \nabla \times \vec{e}+\frac{\partial \vec{b}}{\partial t}&=0 \\ \nabla \times \vec{h}-\vec{j}&=\vec{s}\_{e} \end{aligned}

External References

MyST Markdown creates structured documents that are linked to other sources, which allows us to preview directly in the editing experience.


You can link to any Wikipedia article and it will show a tooltip inline, for example, we linked to Maxwell’s equations above!

🛠 Using the short-hand wiki: link, add a link to a Wikipedia article

Geophysics


You can also link to GitHub issues, pull requests and even code. Just paste the link in and MyST will provide a linked preview.

For example, when we migrated to support JupyterLab 4.0, we did some work in #142. Some of the pipeline for MyST uses unifiedjs, and can be seen here as a series of plugins.

🛠 Follow the link to the code, copy a new permalink to a different line and paste it below!

Task Lists

Jupyter already can render tasks, but you can’t edit them when you are working through something -- but you can in MyST!

🛠 Try editing a task below and see the markdown change

Next Up

There are a few other nifty things that you can do with MyST Markdown below. You can also see all of the live demos in the documentation at https://mystmd.org/guide. That is it for this quickstart tutorial, next up we will take a look at actually using a bit of Jupyter with inline execuation and widgets!

🪐 Inline Execution

You can use the {eval} role to evaluate variables directly inside of your markdown cells, including widgets, sparklines and other variables.

Diagrams

We have included a few other things in this notebook so that you can explore, for example mermaid diagrams!

Proofs

You can add an reference proofs (Criterion 1). See the docs.

Solutions and Exercises

See the docs

Tabs, Grids, and Cards

See the docs

Tab 1
Tab 2

Tab one can sync (see below)!

These tabs are set to sync:

Tab 1 - Sync!
Tab 2

Tab one can sync!

Text content ✏️

Structure books with text files and Jupyter Notebooks with minimal configuration.

MyST Markdown ✨

Write MyST Markdown to create enriched documents with publication-quality features.

Executable content 🔁

Execute notebook cells, store results, and insert outputs across pages.

MyST Markdown 🚀

Write content in JupyterLab!

Footnotes
  1. You can also use math as a “directive” -- see the MyST docs on math.