PHPackages                             ftes/phpmathpublisher - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ftes/phpmathpublisher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ftes/phpmathpublisher
=====================

phpMathPublisher fork. Rewritten in php5.3. Added PSR-4 support

088PHP

Since Feb 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ftes/phpmathpublisher)[ Packagist](https://packagist.org/packages/ftes/phpmathpublisher)[ RSS](/packages/ftes-phpmathpublisher/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

phpMathPublisher
================

[](#phpmathpublisher)

phpMathPublisher fork, hosted on github to allow seamless integration in composer-based php apps. Packagist package is auto-updated via [service hook](https://packagist.org/about#how-to-update-packages).

Authors
-------

[](#authors)

- **Original version** Pascal Brachet,
- **php5.3 rewrite** Peter Vasilevsky a.k.a. Tux-oid,
- **psr-4 restructuring** Andreas Gohr,

How to use
----------

[](#how-to-use)

1. Configure settings via the constructor `new PhpMathPublisher($imgpath, $webpath, $size)`, where

- `$imgpath` is the path where the png files should be stored,
- `$webpath` is the path under which the png files are accessable via the web server and
- `size` is the text size to be used when generating these images

2. Call one of the interface methods on your `PhpMathPublisher` object

- `mathImage($text)`: Creates the formula image (if the image is not in the cache) and returns the `` html code
- `mathImagePath($text)`: Creates the formula image (if the image is not in the cache) and returns the absolute path on the file system to the image
- `mathImageBinary($text)`: Creates the formula image and returns the binary PNG contents (warning: does not use the file cache, thus inefficient)
- `mathFilter($text)`: Replaces all `` tags in `$text` with `` tags by using `mathImage()`
- `renderImage($text, $file)`: Creates an image for the given formula at the given place

### Example

[](#example)

`(new PhpMathPublisher('../dir/to/img/', 'img/', 12))->mathFilter('A math formula : f(x)=sqrt{x}')` will return:

```
'A math formula : '

```

The image corresponding to a formula is created only once. Then the image is stocked into the image directories. The first time that mathfilter is called, the images corresponding to the formulas are created, but the next times mathfilter will only return the html code.

NOTE: if the free latex fonts furnished with this script don't work well (very tiny formulas - that's could happened with some GD configurations), you should try to use the bakoma versions of these fonts ([downloadable here](http://www.ctan.org/tex-archive/fonts/cm/ps-type1/bakoma/ttf/))

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2614732?v=4)[Fredrik Teschke](/maintainers/ftes)[@ftes](https://github.com/ftes)

---

Top Contributors

[![splitbrain](https://avatars.githubusercontent.com/u/86426?v=4)](https://github.com/splitbrain "splitbrain (17 commits)")[![ftes](https://avatars.githubusercontent.com/u/2614732?v=4)](https://github.com/ftes "ftes (13 commits)")

### Embed Badge

![Health badge](/badges/ftes-phpmathpublisher/health.svg)

```
[![Health](https://phpackages.com/badges/ftes-phpmathpublisher/health.svg)](https://phpackages.com/packages/ftes-phpmathpublisher)
```

###  Alternatives

[awcodes/filament-gravatar

Replace Filament's default avatar url provider with one for Gravatar.

32204.0k5](/packages/awcodes-filament-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
