Latex:文本不能放置在图像下方
我在处理图像和一些文本时遇到问题。我有这个代码:
Some text...\\
\begin{figure}[ht]
\centering
\includegraphics[scale=0.75]{picture.jpg}
\caption{The caption}
\label{fig:picture}
\end{figure}
Some more text...
基本上,我想要这个:
Some text. (Above image in the code)
[end of page / new page]
image
Some more text. (Below the image in the code)
[start of new section]
但是,上面的代码给我的是这样的:
Some text. (Above image in the code)
Some more text. (Below the image in the code)
[end of page / new page]
image
[start of new section]
Latex 坚持将除新部分之外的所有内容都放在图像上方,即使它位于代码中的图像下方。这可能是因为图像浮在顶部 - 但我的选择是什么?第一页上没有足够的空间来显示图像,因此我无法使用 [h] 作为浮动对齐。
我可以通过创建一个空的新部分(例如 \section*{}
)来“破解它”,但这会产生一些空白,看起来很奇怪。有什么建议吗?
I'm having a problem with an image and some text. I have this code:
Some text...\\
\begin{figure}[ht]
\centering
\includegraphics[scale=0.75]{picture.jpg}
\caption{The caption}
\label{fig:picture}
\end{figure}
Some more text...
Basically, I want this:
Some text. (Above image in the code)
[end of page / new page]
image
Some more text. (Below the image in the code)
[start of new section]
But, what the above code gives me is this:
Some text. (Above image in the code)
Some more text. (Below the image in the code)
[end of page / new page]
image
[start of new section]
Latex insists on putting everything but a new section above the image even though its below the image in the code. Its probably because the image floats on top - but whats my alternative? There's not enough space on the first page to display the image there, to I cannot use [h] as the float-alignment.
I can "hack it", by creating an empty new section, like \section*{}
, but this creates some white-space, which looks weird. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你确实需要在那个地方有图形,请使用
float
包:在序言中:
然后,在文本中:
尽管如此,最好让LaTeX放置浮标。
完成相同操作的另一种方法是使用
caption
包。在序言中:
然后,在正文中:
If you really need to have the figure in that place, use the
float
package:In the preamble:
then, in the text:
Even though, is more preferable to let LaTeX place the floats.
Another way to do the same thing is by using the
caption
package.In the preamble:
then, in the text:
使用 titleof 代替标题:
\usepackage{标题}
Use captionof instead of caption:
\usepackage{caption}