在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):Gregwar/Tex2png开源软件地址(OpenSource Url):https://github.com/Gregwar/Tex2png开源编程语言(OpenSource Language):PHP 100.0%开源软件介绍(OpenSource Introduction):Tex2pngThis class provides a way to create easily LaTeX formulas. With it, you can convert raw formulas like:
To nice images like: RequirementTo use this library you'll need :
You'll also need a temporary folder and, of courses, enough permissions to write to the target directory UsageJust include the <?php
// This will create a formula and save it to sum.png
Tex2png::create('\sum_{i = 0}^{i = n} \frac{i}{2}')
->saveTo('sum.png')
->generate(); You can have a look at the example in Using the cacheTex2png library includes a caching system allowing you to generate images only one time.
To do so, just don't tell <?php
Tex2png::create('\sum_{i = 0}^{i = n} \frac{i}{2}')
->generate();
// The filename will be choosen using an hash of the formula and
// the image density. (file name will look like cache/tex/3/0/2/e/6/8febefe7aaed9eeb8abf09070d10e02e93e.png) If the file already exists, it will not generate anything, else, it will generate it. This results in a tiny but powerful caching system avoiding to regenerate a formula PNG twice. Note that you can change the cache directory calling the This is based on the Gregwar/Cache library. Changing the densityThe second constructor/create() parameter is the image density : <?php
Tex2png::create('\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 : LicenseThis class is under MIT license, for more information, please refer to the |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论