pdflatex在大量数字后挂起

2024-04-19 11:58:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个脚本,可以生成一些数字并将它们放入报告的附录中,例如

appendix
********

.. figure:: images/generated/image_1.png
.. figure:: images/generated/image_2.png
.. figure:: images/generated/image_3.png
... etc

看起来在大量(~50)个图像之后,我的pdflatex命令将挂起,并指向我的.tex文件中的一个图形

^{pr2}$

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。对一个部分可以拥有的图像数量是否有严格的限制?有没有其他地方我可以在构建日志中查看,以缩小发生这种情况的原因?在


Tags: the图像imageptpngdeftypeline
2条回答

这似乎是几件事的结合。在

第一个症状本质上是由too many unprocessed floats引起的错误。修复方法是将以下内容添加到latex_elementsbabel元素中

\usepackage[maxfloats=256]{morefloats}

第二个症状是抱怨Output loop -100 consecutive dead cycles.,所以解决办法只是增加循环次数

^{pr2}$

在这两个调整之后,pdflatex命令现在将成功完成,即使有大量的数字。在

我遇到了这个问题,上面的建议不起作用。不过,我还是能够让它运行得很好,通过插入可能与您的目标不一致的小节。脚本生成如下代码,然后输入到另一个代码片段中预览生成的图像, (我从c++生成svg图,转换成png,并预览基本上是原始数据以供选择,然后将其放入实际文档中,而不仅仅是图像集合)

\subsection{svghappy2.tyrosine.png}
\begin{figure}[htbp]
\testplot{svghappy2_tyrosine.png}
\caption{svghappy2.tyrosine.png}
\end{figure}

\subsection{svghappy2.valine.png}
\begin{figure}[htbp]
\testplot{svghappy2_valine.png}
\caption{svghappy2.valine.png}
\end{figure}

相关问题 更多 >