Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/tex-render-guide
Render LaTeX math expressions to images in PNG, JPEG, and SVG
Passed 22 of 23 test cases with the skill, and 19 of 23 without it.
3 fixed19 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
I generated an SVG equation using MathJax, but an old publishing tool requires high-resolution 300 DPI PNG files. How can I convert this SVG to PNG via CLI using Inkscape?
| Checked | Without skill | With skill |
|---|---|---|
| The response uses inkscape with --export-type=png and --export-dpi=300. | Missed | Passed |
The instructions your model reads when the skill loads.
Researchers frequently need to render LaTeX mathematical expressions as standalone images—for inclusion in presentations, posters, web pages, documentation, social media posts, or any context where native LaTeX rendering is unavailable. Converting a LaTeX equation into a crisp PNG, JPEG, or SVG image requires selecting the right toolchain and configuring it for the appropriate output quality and format.
This skill covers multiple approaches to LaTeX-to-image rendering, from command-line tools to web APIs and JavaScript libraries. It provides guidance on choosing the right approach for your use case, achieving publication-quality output, and handling common challenges like transparent backgrounds, high DPI scaling, and color customization.
Whether you need a one-off equation image for a slide deck or a batch pipeline that renders hundreds of equations for a web application, this guide provides the tools and techniques to get it done.
This is the highest-quality approach, producing output identical to what you would see in a compiled LaTeX document.
Create a minimal LaTeX document containing only your equation:
# Create a temporary LaTeX file
cat > equation.tex << 'EOF'
\documentclass[border=2pt]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
\begin{document}
$\displaystyle \int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}$
\end{document}
EOF
# Render to PDF, then convert to PNG
pdflatex equation.tex
# Convert PDF to high-resolution PNG (300 DPI)
convert -density 300 equation.pdf -quality 100 equation.png
# Alternative: use dvipng for direct DVI-to-PNG
latex equation.tex
dvipng -D 300 -T tight -bg Transparent equation.dvi -o equation.png
test cases passed, vs 19 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.