dev-master
9999999-dev https://github.com/ftes/phpmathpublisherphpMathPublisher fork. Rewritten in php5.3. Added PSR-4 support
GPLv2 GPL-3.0-or-later
The Requires
- php >=5.3.3
by Andreas Gohr
by Fredrik Teschke
math mathematics phpmathpublisher
Wallogit.com
2017 © Pedro Peláez
phpMathPublisher fork. Rewritten in php5.3. Added PSR-4 support
phpMathPublisher fork, hosted on github to allow seamless integration in composer-based php apps. Packagist package is auto-updated via service hook., (*1)
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 andsize is the text size to be used when generating these imagesPhpMathPublisher object
mathImage($text): Creates the formula image (if the image is not in the cache) and returns the <img src=...></img> html codemathImagePath($text): Creates the formula image (if the image is not in the cache) and returns the absolute path on the file system to the imagemathImageBinary($text): Creates the formula image and returns the binary PNG contents (warning: does not use the file cache, thus inefficient)mathFilter($text): Replaces all <m> tags in $text with <img> tags by using mathImage()
renderImage($text, $file): Creates an image for the given formula at the given place(new PhpMathPublisher('../dir/to/img/', 'img/', 12))->mathFilter('A math formula : <m>f(x)=sqrt{x}</m>') will return:, (*2)
'A math formula : <img src=\"img/math_988.5_903b2b36fc716cfb87ff76a65911a6f0.png\" style=\"vertical-align:-11.5px; display: inline-block ;\" alt=\"f(x)=sqrt{x}\" title=\"f(x)=sqrt{x}\">'
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., (*3)
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), (*4)
phpMathPublisher fork. Rewritten in php5.3. Added PSR-4 support
GPLv2 GPL-3.0-or-later
math mathematics phpmathpublisher