使用Anaconda Sphinx创建PDF
我正在尝试使用sphinx创建文档。我没有sudo权限,但在我的环境中安装了anaconda。我可以成功地构建HTML,但是当我构建PDF时,我收到了错误并且没有PDF 台阶使用Anaconda Sphinx创建PDF,anaconda,latex,python-sphinx,conda,Anaconda,Latex,Python Sphinx,Conda,我正在尝试使用sphinx创建文档。我没有sudo权限,但在我的环境中安装了anaconda。我可以成功地构建HTML,但是当我构建PDF时,我收到了错误并且没有PDF 台阶 conda create——名字叫杰夫·斯芬克斯 康达·杰夫·斯芬克斯 康达安装斯芬克斯特克斯活芯 还有更多,但默认安装的版本是: sphinx: 1.8.2-py37_0 sphinxcontrib: 1.0-py37_1
conda create——名字叫杰夫·斯芬克斯
康达·杰夫·斯芬克斯
康达安装斯芬克斯特克斯活芯
还有更多,但默认安装的版本是:
sphinx: 1.8.2-py37_0
sphinxcontrib: 1.0-py37_1
sphinxcontrib-websupport: 1.1.0-py37_1
texlive-core: 20180414-hc8d0b01_0
我可以使用makehtml
拥有HTML是我的一半任务。我们还需要一些捆绑格式,可以发送给无法访问HTML的用户(因为文档中有设置网络的说明)。。。Acrobat和MS Word是唯一可用的阅读器
当我试图运行make latexpdf
时,我收到一个错误:
------------
Running 'pdflatex -recorder "UserGuide.tex"'
------------
warning: kpathsea: configuration file texmf.cnf not found in these directories:
... many directories ...
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
在我的环境中安装并运行texlive core
时,是否需要进行其他配置
自助尝试
我在环境中搜索了texmf.cnf
,发现它存在,但不在任何配置的路径上。为了避免这个问题,我尝试创建一个符号链接来重新映射文件夹:
cd ~/.conda/envs/jeff-sphinx/share
ln -s ./texlive/texmf-dist texmf-dist
在此之后运行导致有关的错误消息
------------
Running 'pdflatex -recorder "UserGuide.tex"'
------------
warning: ~/.conda/envs/jeff-sphinx/share/texmf-dist/web2c/texmf.cnf:540: (kpathsea) No cnf value on line: $SELFAUTOLOC ...more paths ...
在这一点上,我假设这是一个无效的路径,并退出
我还尝试更改安装的sphinx
和texlive
版本。通常,这会导致更糟糕的结果(例如缺少pdflatex
)。这可能是因为我的组合无效
更多细节
满输出
根据评论中的一些反馈,我将包含一个输出。我有经过消毒的路径
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).
make[1]: Entering directory `/home/jeff/Documents/projects/docs/doc/_build/latex'
latexmk -pdf -dvi- -ps- 'UserGuide.tex'
Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': File changes, etc:
Non-existent destination files:
'UserGuide.pdf'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -recorder "UserGuide.tex"'
------------
warning: kpathsea: configuration file texmf.cnf not found in these directories: <many directories>.
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex)
kpathsea: Running mktexfmt pdflatex.fmt
warning: kpathsea: configuration file texmf.cnf not found in these directories: <many directories>.
/home/jeff/.conda/envs/jeff-sphinx/bin/mktexfmt: kpsewhich -var-value=TEXMFROOT failed, aborting early.
BEGIN failed--compilation aborted at /home/jeff/.conda/envs/jeff-sphinx/bin/mktexfmt line 25.
I can't find the format file `pdflatex.fmt'!
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
pdflatex: (Pdf)LaTeX failed to generate the expected log file 'UserGuide.log'
Latexmk: Did not finish processing file 'UserGuide.tex':
(Pdf)LaTeX failed to generate the expected log file 'UserGuide.log'
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
make[1]: *** [UserGuide.pdf] Error 12
make[1]: Leaving directory `/home/jeff/Documents/projects/docs/doc/_build/latex'
make: *** [latexpdf] Error 2
康达的
texlive core
似乎提供了pdflatex
。我不清楚如何使用它
但是,可与康达狮身人面像结合使用:
conda install -c conda-forge tectonic
然后在文档目录中,假设采用典型设置:
make latex
cd build/latex/
tectonic *.tex
这对我来说很有用(不过有一个非常简单的文档)。一些诊断问题:LaTeX是如何安装的?
哪个pdflatex
的结果是什么?你能用pdflatex编译一个简单的LaTeX文件吗?你应该删除自定义符号链接,这可能不会有帮助,也会使诊断更加困难。这些都不是错误消息,它们是警告,甚至不是特别严重的警告。您是否获得PDF作为输出?这里的实际问题是什么?好的,这里是错误:我找不到格式文件'pdflatex.fmt'代码>看起来康达安装的LaTeX坏了。能否在系统级别安装它并删除已安装的一个conda?请参阅此问题:
make latex
cd build/latex/
tectonic *.tex