python - pdflatex 在大量数字后挂起
问题描述
我有一个脚本可以生成许多数字并将它们放在报告的附录中,例如
Appendix
********
.. figure:: images/generated/image_1.png
.. figure:: images/generated/image_2.png
.. figure:: images/generated/image_3.png
... etc
看起来在大量(〜50)图像之后,我的pdflatex
命令将挂起,并指向我.tex
文件中的其中一个图形
...
\begin(figure)[htbp]
\centering
\noindent\sphinxincludegraphics{{image_49}.png}
\end{figure}
\begin(figure)[htbp]
\centering
\noindent\sphinxincludegraphics{{image_50}.png} <--- here
\end{figure}
\begin(figure)[htbp]
\centering
\noindent\sphinxincludegraphics{{image_51}.png}
\end{figure}
...
当pdflatex
失败时,我真的无法从控制台输出中弄清楚要做什么,我得到了一些似乎是好消息的行
<image_48.png, id=451, 411.939pt x 327.3831pt>
File: image_48.png Graphic file (type png)
<use image_48.png>
Package pdftex.def Info: image_48.png used on input line 1251.
(pdftex.def) Requested size: 411.93797pt x 327.3823pt.
<image_49.png, id=452, 411.939pt x 327.3831pt>
File: image_49.png Graphic file (type png)
<use image_49.png>
Package pdftex.def Info: image_49.png used on input line 1257.
(pdftex.def) Requested size: 411.93797pt x 327.3823pt.
然后在最后一个成功的图像(〜50)之后它开始输出
! Output loop---100 consecutive dead cycles.
\end@float ...loatpenalty <-\@Mii \penalty -\@Miv
\@tempdima \prevdepth \vbo...
l.1258 \end{figure}
I've concluded that your \output is awry; it never does a
\shipout, so I'm shipping \box255 out myself. Next time
increase \maxdeadcycles if you want me to be more patient!
[9
! Undefined control sequence.
\reserved@a ->\@nil
l.1258 \end{figure}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
如果我所做的只是减少数字的数量,它将毫无问题地运行并生成 pdf。一个部分可以拥有的图像数量是否有硬性限制?是否有其他地方我可以在构建日志中查看以缩小发生这种情况的原因?
解决方案
这似乎是几件事的结合。
第一个症状本质上是由太多未处理的浮点数引起的错误。解决此问题的方法是将以下内容添加babel
到latex_elements
\usepackage[maxfloats=256]{morefloats}
第二个症状是抱怨,Output loop---100 consecutive dead cycles.
所以修复只是增加周期数
\maxdeadcycles=1000
经过这两次调整,pdflatex
命令现在可以成功完成,即使是大量的数字。
推荐阅读
- angular - 从打字稿中的异步函数返回值
- javascript - 使用按钮 sweetalert2 php mysql ajax 删除行表
- typescript - 如何在 gRPC Web 中使用 async/await 模式?
- oauth-2.0 - 是否可以将 Micronaut OAuth2 回调 uri 设置为绝对 URL?
- python - 将环境迁移到新的 python 版本
- docker - 使用文件系统映射的 docker 卷(Windows)
- excel - Excel VBA 处理和粘贴许多形状现在在 Windows 10 中出错,但在 2016 年没有
- python - asyncio - 使用特定接口打开连接
- node.js - InvalidParameterValue:域在 aws lambda 中的 Request.extractError 处包含控件或空格
- c# - .Net Core 控制台应用程序日志记录功能 - 为什么我的 Console.WriteLine 出现在开始和结束日志记录之外?