Include LaTex in PHP

evilMinion Source

I want to display some mathematical formulas in a graphical manner on my webpage written in PHP.I want to use LaTex which allows you to render mathematical formulas into webpages as images.I need to know a way to include such latex in my PHP code,especially if it is a package.A well detailed procedure of how to do it is appreciated,because most of the answers I saw on for a questions regarding this matter were short and confusing and didn't help me at all(no offense). (I tried installing them with Composer,but was no avail.)

This is such kind of a package which is hosted on GitHub,if you want to get an idea. Credits to the creators. https://github.com/Gregwar/Tex2png

Sorry but the instructions given in that ReadMe file are not clear enough for me.

As it told me I tried doing it with the content in the 'demo' directory(the sum.php file and then the cache.php file).

Here is the output I got when i tried to access the sum.php file. (http://localhost/png/demo/sum.php)

screenshot of the output

Here's the output in text format :

Generating sum.png... Warning: file_put_contents(/tmp/302e68febefe7aaed9eeb8abf09070d10e02e93e.tex): failed to open stream: No such file or directory in C:\localhost\vendor\gregwar\tex2png\Gregwar\Tex2png\Tex2png.php on line 176

Here's the output I get when I try to access the cache.php file (http://localhost/png/demo/cache.php)

screenshot of the output

Here's the output in text format :

Generating cache file... cache/3/0/2/e/6/302e68febefe7aaed9eeb8abf09070d10e02e93e.png

phpgithubcomposer-phplatex

Answers

comments powered by Disqus