Latex 中包含多个图像时出错

发布于 2024-09-07 03:40:18 字数 868 浏览 5 评论 0 原文

编译以下代码时,

{\centering {\includegraphics[scale=.5]{splash.eps}} \caption{Splash Screen} \par}
\end{figure} 
Splash screen is an integral part and shows a tutorial of application.    
\begin{figure}[ht] 
{\centering {\includegraphics[scale=.5]{splashmore.eps}} \caption{Splash Screen 1} \par}
\end{figure} 

编译时会正确添加第一个图像(即splash.eps)。在尝试添加第二个时,编译出现以下错误。

! LaTeX Error: Cannot determine size of graphic in ./eps/splashmore.eps (no Bou
ndingBox).

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.16 ...\includegraphics[scale=.5]{splashmore.eps}
                                                  } \caption{Splash Screen 1...

可能是什么问题?

编辑:问题出在图像上。我用 Gimp 打开它并将其保存为 .eps 文件,后来使用它没有任何问题。

While compiling the following code

{\centering {\includegraphics[scale=.5]{splash.eps}} \caption{Splash Screen} \par}
\end{figure} 
Splash screen is an integral part and shows a tutorial of application.    
\begin{figure}[ht] 
{\centering {\includegraphics[scale=.5]{splashmore.eps}} \caption{Splash Screen 1} \par}
\end{figure} 

The first image (i.e splash.eps) gets added properly when compiled. While trying to add the second one, compilation gives the following error.

! LaTeX Error: Cannot determine size of graphic in ./eps/splashmore.eps (no Bou
ndingBox).

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.16 ...\includegraphics[scale=.5]{splashmore.eps}
                                                  } \caption{Splash Screen 1...

What could be the problem?

Edit: The problem was with the image. I opened it with Gimp and saved it as .eps file and latter on used it with no troubles.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

亢潮 2024-09-14 03:40:18

问题可能是 splashmore.eps 没有边界框(如错误消息所述)。您可以

  • 手动添加边界框信息(请参阅此处了解以下内容的说明边界框是什么以及如何做到这一点)或
  • 使用工具:在矢量图形编辑器中打开文件并将其(再次)另存为 eps 可能会有所帮助,否则您可以使用 epstool

The problem could be that splashmore.eps has no Bounding Box (like the error message says). You could either

  • add the bounding box information manually (see here for a description of what a bounding box is and how to do that) or
  • use a tool: Opening your file in a vector graphics editor and saving it (again) as eps could help, otherwise you could use epstool.
甜扑 2024-09-14 03:40:18

我想您可以尝试添加 width=5cm 作为 includegraphics 的参数。不知道这是否令人满意。

I guess you could try to add width=5cm as argument to includegraphics. Don't know if that is satisfactory though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文