我做过使用Latex和将文本转换为pdf的实验。Latex是用PyLatex模块实现的,但在打印Unicode时有问题。我发现唯一的解决办法就是使用Python模块"TEX“。但还是有一些我无法解决的问题。执行我的程序以获取Linux终端显示错误:
sergen-pc:~$ python /home/sergen/PythonExp/latex.py
Traceback (most recent call last):
File "/home/sergen/PythonExp/latex.py", line 27, in <module>
tex.convert('/home/sergen/PythonExp/full.tex', 'tex', 'pdf', max_runs=3)
File "/usr/local/lib/python2.7/dist-packages/tex.py", line 149, in convert
raise ValueError(log)
ValueError: This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdftex 2016.5.1) 20 OCT 2016 20:03
entering extended mode
%&-line parsing enabled.
**/tmp/tex-temp-UzNg43/texput.tex
(/tmp/tex-temp-UzNg43/texput.tex)
! Emergency stop.
<*> /tmp/tex-temp-UzNg43/texput.tex
! ==> Fatal error occurred, no output PDF file produced!我不明白是什么原因,还是在'tmp‘文件夹中tex拒绝读/写,是否在tex模块的内部?如果你知道另一个Python模块可以将文件转换为PDF,我很乐意尝试一下。
发布于 2016-10-23 05:11:07
解决了。在使用模块时,我指出了要转换的文件的路径,有必要提取其内容,并给出模块。
https://stackoverflow.com/questions/40164074
复制相似问题