PHP LaTeX到PDF的转换/编译 [英] PHP LaTeX to PDF Conversion/Compiling
问题描述
我进行了广泛的搜索,找到了一个基于PHP的工具,可以将LaTeX转换为PDF,但是没有成功.我了解LaTeX在服务器端运行,但是我仍然需要基于PHP的命令过程才能使用LaTeX生成所述PDF文件.
I have searched far and wide to find a PHP-based tool to convert LaTeX to PDF, but have had no success. I understand that LaTeX runs on the server side, however I still require a PHP-based command process in order to generate said PDF files using LaTeX.
编辑
此外,在服务器上安装二进制文件,库或工具是不行的.我可以使用的工具是PHP及其内置的功能.任何可以将LaTex转换为PDF的类或PHP工具都非常有用.
Additionally, installing binaries, libraries or tools on to the server is a no-no. The tool at my disposal is PHP and the functionalities it has built in. Any class or PHP tool that can convert LaTex to PDF is incredibly useful.
任何指导将不胜感激.
推荐答案
我刚刚安装了软件包texlive-binaries
,并使用Shell exec和pdflatex
命令从(La)TeX文件生成PDF:>
i just installed the package texlive-binaries
and used a shell exec with the pdflatex
command to generate the PDF from a (La)TeX file:
shell_exec("/usr/bin/pdflatex --interaction batchmode $filename");
我知道这不是您要的,但我不知道像已经存在的乳胶编译器一样完整的php lib.
i know this is not what you asked for but i don't know of a php lib as complete as the already existing latex compilers.
为什么仍然要重新发明轮子?
why reinvent the wheel anyways?
更新:如果有足够的空间,请安装textlive-full
而不是texlive-binaries
.这将安装所有可用的软件包,字体等,并避免您为文档呈现错误而感到头疼.
Update: When you have enough space, install textlive-full
instead of texlive-binaries
. This will install all the available packages, fonts, etc. and avoid you some headache why your document renders wrong.
这篇关于PHP LaTeX到PDF的转换/编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!