Center equation consisting of LaTeX and Julia in Pluto markdown

Hi all,

I am trying to center align an equation in Pluto. Here is a MWE:

md"
 $\theta =$ $(string(round.(rand(3), digits = 3))) 
"

The equation is left justified. I tried bringing in html to center it, but to no avail. Is there a solution?

Thanks!

One solution is using CommonMark and html:

using CommonMark
cm"""
<div align="center">

``\theta =`` $(string(round.(rand(3), digits = 3)))

</div>
"""

Thank you! It looks like what I was missing was CommonMark.

1 Like

By the way, I experienced strange behavior while editing code within the cm""" """ block. My cursor jumped around to different places and some of my changes disappeared upon pressing ctrl + enter. My workaround was to add the cm""" """ after all of my code was entered. If there is a place to report this behavior, I would be willing to open an issue.