[英]Error embedding image in jupyter and exporting it to PDF with nbconvert
I have a Jupyter notebook and I am exporting it with nbconvert to PDF.我有一个 Jupyter 笔记本,我用 nbconvert 将它导出到 PDF。 When I do it, if I incorporate images, it gives me an error.当我这样做时,如果我合并图像,它会给我一个错误。
I do it with edit -> insert image, and save the image in the same folder as my jupyter document.我使用编辑-> 插入图像来完成,并将图像保存在与我的 jupyter 文档相同的文件夹中。 The cell is Markdown.单元格为 Markdown。
I show my code to see the error:我显示我的代码以查看错误:
![Captura%20de%20pantalla%20%2825%29.png](attachment:Captura%20de%20pantalla%20%2825%29.png)
When exporting it with nbconvert with the statement使用 nbconvert 导出时,使用语句
jupyter nbconvert --to PDF --no-input REDACCION.ipynb
It gives me the following error:它给了我以下错误:
(base) C:\Users\USUARIO\Desktop\DOC BECA COLABORACIÓN\CURSO AEROPYTHON-JUPITER>jupyter nbconvert --to PDF --no-input REDACCION.ipynb
[NbConvertApp] Converting notebook REDACCION.ipynb to PDF
Traceback (most recent call last):
File "C:\Users\USUARIO\anaconda3\Scripts\jupyter-nbconvert-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\USUARIO\anaconda3\lib\site-packages\jupyter_core\application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\traitlets\config\application.py", line 845, in launch_instance
app.start()
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 350, in start
self.convert_notebooks()
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 524, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 489, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 418, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 181, in from_filename
return self.from_file(f, resources=resources, **kw)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 199, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 183, in from_notebook_node
self.run_latex(tex_file)
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 153, in run_latex
return self.run_command(self.latex_command, filename,
File "C:\Users\USUARIO\anaconda3\lib\site-packages\nbconvert\exporters\pdf.py", line 141, in run_command
raise raise_on_failure(
nbconvert.exporters.pdf.LatexFailed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
notebook.tex:446: Unable to load picture or PDF file '
notebook.tex:469: You can't use `
notebook.tex:470: Missing $ inserted
notebook.tex:471: You can't use `
notebook.tex:473: Missing $ inserted
dvipdfmx:fatal: Image inclusion failed for "attachment:Captura%20de%20pantalla%20%2825%29.png".
No output PDF file written.
Sorry, but xelatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\USUARIO\AppData\Local\MiKTeX\miktex\log\xelatex.log
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.