我面临与 PyLaTeX 相同的问题:pylatex.errors.CompilerError: No LaTex compiler was found但我还没有找到答案。我正在使用 Windows,并且安装了MixTex
和pylatex
软件包。
我首先尝试这个然后添加到其他代码但没有运行。
from pylatex import Document, Section, Subsection
from pylatex.utils import italic
import pdflatex
def document(doc):
geometry_options = {"tmargin": "1cm", "lmargin": "10cm"}
doc =Document(geometry_options=geometry_options)
with doc.create(Section('Results')):
doc.append('Something')
doc.generate_pdf('Results', clean_tex=False, compiler='pdfLaTeX')
tex = doc.dumps()
我想在这里得到一些帮助。错误是一样的:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "generalcode.py", in validation
doc.generate_pdf('Resultados', clean_tex=False, compiler='pdfLaTeX')
File "C:Python\Python38-32\lib\site-packages\pylatex\document.py", in generate_pdf
raise(CompilerError(
pylatex.errors.CompilerError: No LaTex compiler was found
Either specify a LaTex compiler or make sure you have latexmk or pdfLaTex installed.