nbconvert failed: PDF creating failed, captured latex output:
LaTex's package manager tlmgr
tlmgr是TeX Live中包含的包和配置管理器的名称。它完全独立于操作系统可能提供的任何包管理器。您可以运行 tlmgr --help 查看命令
yum -y install texlive-xetex texlive-fonts-recommended texlive-plain-generic
nbconvert failed: PDF creating failed, captured latex output: Failed to run "['xelatex', 'notebook.tex', '-quiet']" command: This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013) restricted \write18 enabled. entering extended mode (./notebook.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo aded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo)) ! LaTeX Error: File `tcolorbox.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.4 \usepackage {parskip} % Stop auto-indenting (to mimic markdown behavi... No pages of output. Transcript written on notebook.log.
解决方案:
1、如果文件路径有带中文,将中文去掉
2、找到安装路径下的pdf.py 文件打开
即…\site-packages\nbconvert\exporters\pdf.py
将’build_directory’: ‘.’ 改为 ‘build_directory’: ‘’,如下所示:
#writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': '.'})
writer = Instance("nbconvert.writers.FilesWriter", args=(), kw={'build_directory': ''})
================================
# locate pdf.py | grep exporters | grep my
/home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/nbconvert/exporters/pdf.py
# conda activate mydlenv
# conda list | grep nb
nbclassic 0.5.1 pypi_0 pypi
nbclient 0.7.2 pypi_0 pypi
nbconvert 7.2.9 pypi_0 pypi
nbformat 5.7.3 pypi_0 pypi
# conda activate tf115
# conda list |grep nb
=====================================
nbconvert failed: PDF creating failed, captured latex output: Failed to run "['xelatex', 'notebook.tex', '-quiet']" command: This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013) restricted \write18 enabled. entering extended mode (./notebook.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo aded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo)) ! LaTeX Error: File `tcolorbox.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.4 \usepackage {parskip} % Stop auto-indenting (to mimic markdown behavi... No pages of output. Transcript written on notebook.log.
=====================================
tlmgr update --all --self
bash: tlmgr: 未找到命令...
在centos 7 直接使用 root 安装 texlive
yum -y install texlive texlive-latex texlive-xetex
yum -y install texlive-collection-latex
yum -y install texlive-collection-latexrecommended
yum -y install texlive-xetex-def
yum -y install texlive-collection-xetex
Only if needed:
yum -y install texlive-collection-latexextra
---------------------------------------------------------------------
tlmgr update --all --self
tlmgr install tcolorbox
tlmgr install pgf
tlmgr install xcolor
tlmgr install environ
tlmgr install trimspaces
tlmgr install mathpazo
tlmgr install parskip
tlmgr install adjustbox
tlmgr install collectbox
tlmgr install eurosym
tlmgr install ecs
tlmgr install ucs
tlmgr install enumitem
tlmgr install ulem
tlmgr install mathrsfs
tlmgr install jknapltx rsfs
————————————————
原文链接:https://blog.csdn.net/weixin_43214141/article/details/105832847