How to write inline math variables, equations in Markdown inside Pluto?

I am trying to write some mathematical variables and equations inline in Markdown in Pluto. I am trying to write \dfrac{a}{b} = c and x inside other sentences. And not a/b = c and x. This is how I did it here, and how I do inside \LaTeX documents and Jupyter Notebooks:

I am trying to write $\dfrac{a}{b} = c$ and $x$ *inside* other sentences.

Single $ pair enables rendering math equations inside sentences where double $$ pair enables rendering of equation in a new paragraph in a centered manner.

But, I am unable to do that in Pluto.

Here’s my code:

md"""
* $N$ is the number of atoms in a particular sample
* $dt$ is time difference
* $dN$ is number of atoms decayed in time $dt$
* $\lambda$ is proportionality constant, the value of which depends on the particular radioactive atom
"""

And here how it renders:

This is outright unusable and ugly. I want my mathematical variables to render inside other sentences and bullet lists, and not in a different paragraph. How do I do that?

I know now.

Double backticks `` is the way.

I changed my cell to:

md"""
* ``N`` is the number of atoms in a particular sample
* ``dt`` is time difference
* ``dN`` is number of atoms decayed in time $dt$
* ``\lambda`` is proportionality constant, the value of which depends on the particular radioactive atom
"""

Now it renders as expected:

So, instead of a single dollar $ pair, I need to use double backticks pair ``.

3 Likes

You can also add an extra space between a bullet and the first $, but otoh, I’ve found that double backticks are more robust in general, especially when used in expressions with string interpolations.

1 Like