DEV Community

uetchy
uetchy

Posted on

18 5 1

Math API: LaTeX Math as SVG image

I've always wanted to put LaTeX Math equations on a web page where MathJax is not allowed to run inside it.

Spending some time, I made Math API, that renders LaTeX Math markup into an SVG image.

So you can place your equation on almost everywhere on which you could put <img> or Markdown (![]()), such as GitHub, Jupyter Notebook or dev.to (here!).

![](https://math.now.sh?from=\\LaTeX)
Enter fullscreen mode Exit fullscreen mode


![](https://math.now.sh?from=\\log\\prod^N_{i}x_{i}=\\sum^N_i\\log{x_i})
Enter fullscreen mode Exit fullscreen mode

Inline image

It is possible to generate an inline equation by changing the query from from to inline.

<img src="https://math.now.sh?inline=\\LaTeX" />
Enter fullscreen mode Exit fullscreen mode

Online Editor

Also, there is the online editor available at https://math.now.sh.

Conclusion

The source code is available on GitHub.
Give it a try and leave a comment/idea for a new feature.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (2)

Collapse
 
webdva profile image
webdva

I might use this for some of my future Dev.to posts.

Thanks for making this.

Collapse
 
aeroreyna profile image
Adolfo Reyna

Thank you so much, I'm using this to add math equation to my figures for my scientific papers.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay