
Laravel News · 7 min readBackend & APIs
Phactorial: Render LaTeX Math to SVG and PNG in PHP
Phactorial lets PHP applications render LaTeX or MathML formulas directly to SVG, PNG, OMML or plain text without external Node processes. The guide shows installation, API usage, Laravel integration, and caching strategies, enabling math in emails, documents, and web pages.
- Install via Composer and call MathRender::fromTex()->svg() for inline or display formulas
- Use the CommonMark extension to add markdown math support in Laravel views and emails
- Cache rendered output by hashing the source to avoid repeated rendering overhead