metalinspired/tex2png
最新稳定版本:1.0.0
Composer 安装命令:
composer require metalinspired/tex2png
包简介
LaTeX formula to PNG
README 文档
README
This is a fork of Gregwar/Tex2png updated to PHP 8.1
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:
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
composer require metalinspired/tex2png
Usage
<?php // This will create a formula and save it to sum.png (new Tex2png('\sum_{i = 0}^{i = n} \frac{i}{2}')) ->saveTo('sum.png') ->generate();
Changing the density
The second constructor parameter is the image density :
<?php (new Tex2png('\sum_{i = 0}^{i = n} \frac{i}{2}', 300)) ->generate();
Default density is 155, you can choose to generate really big images, this is an example of the formula with a density of 1000 :
License
This class is under MIT license, for more information, please refer to the LICENSE file
统计信息
- 总下载量: 6.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-05

