# Markdown cells not rendering directives

**URL:** <https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616>\
**Category:** Notebook\
**Created:** [September 4, 2022, 12:51am UTC](https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616 "2022-09-04T00:51:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilgamesh](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gilgamesh](https://discourse.jupyter.org/u/gilgamesh)\
**Post date:** [September 4, 2022, 12:51am UTC](https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616/1 "2022-09-04T00:51:17Z")

</div>

Hello!

I am trying to render some {math} and {note} directives in my notebook but I can’t get them to render. The markdown is the following:

````auto
Single Dollar sign directive

$ \hat{Y} = \hat{\beta}_{0} + \sum \limits _{j=1} ^{p} X_{j}\hat{\beta}_{j} $

-------------------------------

Double dollar sign:

$$
    w_{t+1} = (21 + r_{t+1}) s(w_t) + y_{t+1}
$$

--------------------------------

Math directive

```{math}

w_{t+1} = (12 + r_{t+1}) s(w_t) + y_{t+1}

```

-------------------------------

Inline math directive:

{math}`x_{hey}=it+is^{math}`

Since Pythagoras, we know that {math}`a^2 + b^2 = c^2`

-------------------------------

Latex math

\begin{equation}
  \int_0^\infty \frac{x^3}{e^x-1}\,dx = \frac{\pi^4}{15}
\end{equation}

-------------------------------

Note directive

```note
this is supposed to be a note
```

````

I would expect the note and math formulas to render, but instead here is what I get:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/3/368ab549b965bf5e6d2396b79d342fd4d162790c.png)

Any ideas why only the Latex and dollar math are rendering, and the rest isn’t? I am not sure how to debug this as I am pretty new to Jupyter. (Note: this happens in both Jupyter Notebook as well as Jupyter Lab).

Troubleshoot info:

||jupyter-client 7.3.4|  
||jupyter-core 4.11.1|  
||jupyter-server 1.18.1|  
||jupyterlab 3.4.5|  
||jupyterlab-mathjax3 4.3.0|  
||jupyterlab-pygments 0.2.2|  
||jupyterlab-server 2.15.0|

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [September 4, 2022, 1:45pm UTC](https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616/2 "2022-09-04T13:45:25Z")

</div>

> [@gilgamesh](#):
>
> ````auto
> ```{math}
> 
> ````

I think that this is not a valid Markdown syntax. Plain JupyterLab uses marked.js which is compatible with [CommonMark](https://spec.commonmark.org/0.30/), [GitHub Flavored Markdown](https://github.github.com/gfm/) and the original [markdown.pl](https://daringfireball.net/projects/markdown/syntax).

Adding syntax highlighting in CommonMark and GitHub Flavored Markdown is performed via text after backticks _without_ the braces, see examples: [CommonMark 142](https://spec.commonmark.org/0.30/#example-142) and [GFM 112](https://github.github.com/gfm/#example-112), but I am not aware of standard syntax other than `$` and `$$` which would typeset LaTeX in markdown. If you have a reference for such, please do provide!

What you are trying to do appears to be RMarkdown flavour. Unfortunately, contrary to universally accepted flavours, I could not find a formal specification for RMarkdown; it would make it easier to re-use if there was one making it a proper open standard. There are however already three options if you would like to use that format:

- use [GitHub - mwouts/jupytext: Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts](https://github.com/mwouts/jupytext) which supports RMarkdown documents and can convert them to proper Jupyter notebooks
- create (or help create) an extension to marked.js and a JupyterLab plugin
- create (or help create) and extension to an alternative extensible markdown parser called [`markdown-it`](https://github.com/markdown-it/markdown-it) which also supports CommonMark and for which there already is an extension architecture for JupyterLab by @agoose77 [GitHub - agoose77/jupyterlab-markup: JupyterLab extension to enable markdown-it rendering, with support for markdown-it plugins](https://github.com/agoose77/jupyterlab-markup) (you can go to binder demo → Settings → Markdown Extension Settings)

> Personal opinion: I really wish that RStudio went for closer collaboration with existing standards (including Jupyter) rather than reinventing a wheel, but here we are.

---

<div class="post-metadata">

**Author:** ![agoose77](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/agoose77/32/3455_2.png) [@agoose77](https://discourse.jupyter.org/u/agoose77)\
**Post date:** [September 4, 2022, 2:00pm UTC](https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616/3 "2022-09-04T14:00:48Z")

</div>

> [@krassowski](#):
>
> What you are trying to do appears to be RMarkdown flavour. Unfortunately, contrary to universally accepted flavours, I could not find a formal specification for RMarkdown;

This also looks a lot like [MyST](https://myst-parser.readthedocs.io/), although I’ve never seen a bare `:::note` directive (vs `:::{note}`). For MyST, as @krassowski notes, we do have a JupyterLab renderer: [jupyterlab-myst · PyPI](https://pypi.org/project/jupyterlab-myst/0.1.7a5/)

You could try this latest pre-release (`pip install --pre jupyterlab-myst`) and see if it works for your use case.

---

<div class="post-metadata">

**Author:** ![gilgamesh](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gilgamesh](https://discourse.jupyter.org/u/gilgamesh)\
**Post date:** [September 4, 2022, 2:18pm UTC](https://discourse.jupyter.org/t/markdown-cells-not-rendering-directives/15616/4 "2022-09-04T14:18:51Z")

</div>

Thanks for the replies. Seems like my confusion came from me reading the documentation of [Jupyter Book](https://jupyterbook.org/en/stable/content/math.html?highlight=math#math-and-equations) thinking it was Jupyter Notebook. I wonder if there should be some warning on that documentation to disambiguate the two.

I tried the [jupyterlab-myst · PyPI](https://pypi.org/project/jupyterlab-myst/0.1.7a5/) and it worked! So I think I will go with that one.

Thanks again!
