乳胶:文本不能放置在图像下方 [英] Latex: Text cannot be placed below image

查看:96
本文介绍了乳胶:文本不能放置在图像下方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在图片和一些文字方面遇到了问题.我有以下代码:

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...

基本上,我想要这个:

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坚持将除新部分之外的所有内容都放置在图像上方,即使该部分位于代码的图像下方.这可能是因为图像漂浮在顶部-但是我该怎么办?第一页上没有足够的空间来显示图像,因为我无法使用[h]作为浮动对齐方式.

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.

我可以通过创建一个空的新部分(例如\section*{})来破解"它,但这会创建一些看起来很奇怪的空格.有什么建议吗?

I can "hack it", by creating an empty new section, like \section*{}, but this creates some white-space, which looks weird. Any suggestions?

推荐答案

如果真的 需要在该位置放置图形,请使用float软件包:

If you really need to have the figure in that place, use the float package:

在序言中:

\usepackage{float}

然后,在文本中:

Some text...

\begin{figure}[H]
  \centering
  \includegraphics[scale=0.75]{picture.jpg}
  \caption{The caption}   
  \label{fig:picture}
\end{figure}

Some more text...

尽管如此,更可取的是让LaTeX放置浮标.

Even though, is more preferable to let LaTeX place the floats.

做同一件事的另一种方法是使用caption包.

Another way to do the same thing is by using the caption package.

在序言中:

\usepackage{caption}

然后,在文本中:

Some text...

\begin{center}
  \includegraphics[scale=0.75]{picture.jpg}\\
  \caption{figure}[LOF entry]{The caption}   
  \label{fig:picture}
\end{center}

Some more text...

这篇关于乳胶:文本不能放置在图像下方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆