layout - latex :文字不能放在图像下方

标签 layout latex figure text-alignment

我的图片和一些文字有问题。我有这个代码:

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] 作为 float 对齐。

我可以通过创建一个空的新部分来“破解它”,例如 \section*{} ,但这会产生一些空白,看起来很奇怪。有什么建议么?

最佳答案

如果你真的需要在那个地方有图,请使用 float包裹:

在序言中:

\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 放置浮点数更可取。

做同样事情的另一种方法是使用 caption包裹。

在序言中:
\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...

关于layout - latex :文字不能放在图像下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2827952/

相关文章:

matlab - Matlab 绘图中注释文本框中的 Overbar(使用 Latex 作为解释器)

layout - 如何在 LaTeX 中对 float 进行一致编号?

matplotlib - Figure 对象没有属性 set_title

html - 如何获得此布局(使用 CSS flexbox)?

layout - extjs 字段布局问题

Android:聚焦时改变风格

java - 如何像在 Netbeans IDE 中一样在 Emacs 中自动格式化代码

r - 使用 knitr 和 kableExtra 的脚注中的公式或符号

Matplotlib 的 Figure 和 Axes 解释

html - 向左浮动不是将 div 放在前一个 div 的左侧(第二个与第一个重叠)