# How to display a fraction in a Markdown cell?

I’d like to obtain this in a Markdown cell: I have found this for a markdown cell but it doesn’t work:

## Set up a proportion:
/frac{n1}{d1} = /frac{n2}{d2}


thank you!

Try:

Set up a proportion:

$$\frac{n1}{d1} = \frac{n2}{d2}$$


Notice the backslash instead of the forwardslash for \frac, and the  markers for a LaTeX block.

3 Likes

So cool ! thanks @matthew.brett ! Anyway I can have it justified to the left instead of centered?

thanks!

Did you try in-line? For me, this results in what you asked about in your original post:

## Set up a proportion:
$\Large\frac{n1}{d1} = \frac{n2}{d2}$


There’s a good summary of in-line vs. Math Block here. That’s for Jupyter Book but the basics are the same for in-line math vs. match blocks in regards to the symbols.

hey @fomightez, thanks for chiming in!
I’m getting this:

If you look at the image in your own post, you’ll observe you are running that in a code cell instead of a markdown cell? (Hint: Markdown cells don’t have ‘Input’ symbols with numbers next to them after hitting shift+Enter.)
Yes! my bad! went too fast on that one… thanks a lot @fomightez much appreciated 