Skip to content

Instantly share code, notes, and snippets.

@wjkoh
Last active June 30, 2025 03:58
Show Gist options
  • Save wjkoh/4878b0f9d1bf66b5bd8b0bfed4bbf5a2 to your computer and use it in GitHub Desktop.
Save wjkoh/4878b0f9d1bf66b5bd8b0bfed4bbf5a2 to your computer and use it in GitHub Desktop.
TreeBlood: Pure Go LaTeX to MathML Renderer for LLM Output

TreeBlood: Pure Go LaTeX to MathML Renderer for LLM Output

Hi everyone,

I'm excited to announce TreeBlood, the world's first pure-Go LaTeX to MathML renderer! If you're working with LLMs like ChatGPT or Gemini and need to display mathematical formulas generated in their responses, TreeBlood offers a fast, server-side solution.

Authored by Wyatt Sheffield, TreeBlood efficiently converts any LaTeX expressions into web-browser-ready MathML. For example, if you have an equation like $\int_0^1 x^{-x} dx = \sum_{n=1}^\infty n^{-n}$, TreeBlood will transform it into the following:

∫ 0 1 x − x d x = ∑ n = 1 ∞ n − n \int_0^1 x^{-x} dx = \sum_{n=1}^\infty n^{-n}

You can integrate TreeBlood in two ways: by using the package directly or via the Goldmark extension.

We'd love to hear your thoughts on this LaTeX-to-MathML renderer! Feel free to share your feedback or ask any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment