PHPackages                             metalinspired/tex2png - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. metalinspired/tex2png

ActiveLibrary[Image &amp; Media](/categories/media)

metalinspired/tex2png
=====================

LaTeX formula to PNG

1.0.0(2y ago)07.4k↓32.9%MITPHPPHP &gt;=8.1

Since Feb 12Pushed 2y agoCompare

[ Source](https://github.com/metalinspired/tex2png)[ Packagist](https://packagist.org/packages/metalinspired/tex2png)[ Docs](https://github.com/metalinspired/tex2png)[ RSS](/packages/metalinspired-tex2png/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

This is a fork of [Gregwar/Tex2png](https://github.com/Gregwar/Tex2png) updated to PHP 8.1

Tex2png
=======

[](#tex2png)

This class provides a way to create easily LaTeX formulas.

With it, you can convert raw formulas like:

`\sum_{i = 0}^{i = n} \frac{i}{2}`

To nice images like:

[![Sum formula](demo/sum.png)](demo/sum.png)

Requirement
-----------

[](#requirement)

To use this library you'll need :

- **latex** : to compile formulas (with math support)
- **dvipng** : to convert dvis to png
- **shell\_exec** : you need to be able to call the php `shell_exec()` function

You'll also need a temporary folder and, of courses, enough permissions to write to the target directory

Installation
------------

[](#installation)

```
composer require metalinspired/tex2png
```

Usage
-----

[](#usage)

```
