通过 LateX 将 Jupyter Notebook 下载为 PDF 时出错
[在 Windows 11、Python 3.9.7 上工作]
我刚刚安装了 MikTex Console
,设置显示按键 xelatex
和 xelatex-dev
存在(参见下图底部):
现在,在 Jupyter Notebook 的 markdown 单元 中,我引入一个图像(存储在我的个人桌面上):
![1%20cbGPF1go7MMWvHif7-2hAw.png](attachment:1%20cbGPF1go7MMWvHif7-2hAw.png)
当我运行单元时,我在笔记本中获得完美的图像:
所以,一切似乎都表现良好,但是,当我只想将笔记本另存为 PDF via LateX
时,如下图所示:
然后我收到 500:内部服务器错误
,说:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
有人知道这个“xelatex notebook.tex -quiet
”命令是什么吗?它与 LateX 有何关系? MikTex Console
的设置中是否缺少某些内容?你知道我该如何解决这种错误吗?
[Working on Windows 11, Python 3.9.7]
I just installed the MikTex Console
, and the settings show that keys xelatex
and xelatex-dev
are present (see bottom of image below):
Now, in a markdown cell of a Jupyter Notebook
, I introduce an image (stored on my personal Desktop):
![1%20cbGPF1go7MMWvHif7-2hAw.png](attachment:1%20cbGPF1go7MMWvHif7-2hAw.png)
When I run the cell, I get the perfect image in the Notebook:
So, everything seems to behave well, BUT, when I just want to save the Notebook as PDF via LateX
,as indicated in the image below:
then I get a 500 : Internal Server Error
, saying:
nbconvert failed: PDF creating failed, captured latex output:
Failed to run "xelatex notebook.tex -quiet" command:
Does somebody know what is this "xelatex notebook.tex -quiet
" command ? How is it related to LateX? Is it something missing in the settings of the MikTex Console
? Do you know how could I fix this kind of error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提供的错误非常简洁,
command:
之后应该有一些东西,比如Responding to your questions 不管怎样,
xelatex notebook.tex -quiet
是命令运行当你点击“通过 LaTeX 另存为 PDF”时,XeLaTeX 本身就是 LaTeX 的增强(它本身增强了 TeX)。XeLaTeX 的主要目标是提供比 LaTeX 更好的编码和字体支持。 请参阅此处。
关于如何修复错误,我建议“另存为 LaTeX (.tex)”并尝试直接在控制台中运行
xelatex notebook.tex
。它应该向您显示正在发生的确切错误。 jupyter GitHub 上的 此问题 让我猜测这要么是依赖问题,要么是语法不受支持问题。如果需要,您可以使用更具体的日志评论/更新您的问题
the provided error is quite succinct, there should have been things after the
command:
, something likeResponding to your questions anyway, the
xelatex notebook.tex -quiet
is the command run when you click "save as PDF via LaTeX", XeLaTeX itself is an enhancment of LaTeX (which itself enhanced TeX).The main objective of XeLaTeX is to provide better encoding and font support than LaTeX does. see here.
On how to fix the error, I would recommand to make a "save as LaTeX (.tex)" and try running
xelatex notebook.tex
directly in a console. It should show you the exact error that is happening. This issue on jupyter GitHub makes me guess it is either a dependency problem or a unsupported syntax problem.If needed you can comment/update your question with more specific logs