首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >latex.exc.LatexBuildError:无`latex.build_pdf()`

latex.exc.LatexBuildError:无`latex.build_pdf()`
EN

Stack Overflow用户
提问于 2018-07-06 13:16:15
回答 1查看 231关注 0票数 1

我尝试在安装了texlive-*的Arch上运行以下Python代码:

代码语言:javascript
复制
from latex import build_pdf

# Read the template from the file...
min_latex = (r"\documentclass{article}"
             r"\begin{document}"
             r"Hello, world!"
             r"\end{document}")

# Compile it...
pdf = build_pdf(min_latex)

# Save the generated .pdf to a new file...
path_to_save = 'new_file.pdf'
pdf.save_to(path_to_save)

它返回一个异常:latex.exc.LatexBuildError: None

我既不能构建任何胶乳文件,也不能构建字符串,也不能使用任何构造器。我尝试过手动使用LatexMkBuilder() (从AUR安装了latex-mk之后)和PdfLatexBuilder .build_pdf(),但是没有结果。

然而,它在(大约一个月前)之前起了作用。看看到底发生了什么。有什么建议吗?

更新1:它开始在subprocess.check_call() of build_pdf()中下降。

更新2:在latex中,创建临时文件似乎是个问题,这导致了FileNotFoundError for subprocess.check_call()

EN

回答 1

Stack Overflow用户

发布于 2022-08-31 13:52:28

在PowerShell中运行我的脚本时,我也遇到了同样的错误(但由于某种原因,在git-bash中没有)。我发现将构建器从latexmk更改为pdflatex很有帮助;也就是说,在本例中,让:

代码语言:javascript
复制
pdf = build_pdf(min_latex, builder='pdflatex')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51211279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档