【发布时间】:2020-08-11 04:35:45
【问题描述】:
我正在尝试学习 Sphinx 文档创建工具。我能够生成 html 文档。现在,为了创建 (html) 文档的离线版本,我一直在尝试从我的项目中生成 pdf 文件。
为了实现这个目标,到目前为止,我已经尝试了以下方法(使用网络上可用的资源,包括 Sphinx 文档):
在 conf.py 中添加了以下内容:
# conf.py options for Latex
latex_engine = 'pdflatex'
latex_elements = {
'papersize': 'a4paper',
'pointsize': '10pt',
}
随后在终端使用命令make latexpdf,于是在终端收到如下信息:
/Users/.../.../.../.../.../urls.py:docstring of lead.urls:5: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/.../urls.py:docstring of lead.urls:7: WARNING: Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
processing lead.tex... index modules/...
resolving references...
done
writing... done
copying TeX support files... copying TeX support files...
done
build succeeded, () warnings.
The LaTeX files are in _build/latex.
Run 'make' in that directory to run these through (pdf)latex
(use `make latexpdf' here to do that automatically).
latexmk -pdf -dvi- -ps- 'lead.tex'
make[1]: latexmk: No such file or directory
make[1]: *** [lead.pdf] Error 1
make: *** [latexpdf] Error 2
创建了一个新文件夹latex,其中包含许多文件,其中一个名为<project_name>.tex(上面的错误日志中为lead.tex)和一个批处理文件make.bat。
但是,运行命令make 只会产生以下错误:
latexmk -pdf -dvi- -ps- 'lead.tex'
make: latexmk: No such file or directory
make: *** [lead.pdf] Error 1
根据latexmk 上的一些线索(网上提供的材料),尝试从Tex site 安装BasicTex 包。
但是,可用的软件包仅适用于 macOS 10.13 及更高版本。我在10.12.6。
所以我被困住了。有人可以告诉我我的困境有什么解决办法吗?
【问题讨论】:
标签: macos python-sphinx pdflatex