为什么文本有时会在图片之前显示,而它应该在图片之后显示

为什么文本有时会在图片之前显示,而它应该在图片之后显示

为什么在某些情况下,文本以下是一些文字呈现在图片.jpg在最终文件中可以吗?

\begin{figure}[h]
\centering
\includegraphics[width=...]{picture.jpg}
\caption{The best caption in the world.}
\end{figure}

Here is some text.

\protect\footnotemark我在内部执行 时也遇到过类似的问题\caption{...},当\footnotetext{...}本应出现在后面的 出现在图像之前时。

答案1

此处的解决方案可能只是不让它们通过\begin{figure} ... \end{figure}环境“浮动”。但也可以使用包\FloatBarrier中的命令placeins

\documentclass{article}
\usepackage{lipsum, mwe}% just for this example
\usepackage{capt-of}

% uncomment the \FloatBarrier to see it in action
\usepackage{placeins}
% Note you could load it as
%\usepackage[section]{placeins}
% this would include a \FloatBarrier in each use of \section

\begin{document}

\lipsum[1]

\begin{center}
\includegraphics{example-image}
\captionof{figure}{Example Caption}
\end{center}

\lipsum[1]

\begin{figure}[h]
\centering
\includegraphics{example-image}
\caption{The best caption in the world.}
\end{figure}

%\FloatBarrier
Here is some text.

\begin{figure}[h]
\centering
\includegraphics{example-image}
\caption{The best caption in the world.}
\end{figure}

%\FloatBarrier
Here is some text.

\begin{figure}[h]
\centering
\includegraphics{example-image}
\caption{The best caption in the world.}
\end{figure}

%\FloatBarrier
Here is some text.

\begin{figure}[h]
\centering
\includegraphics{example-image}
\caption{The best caption in the world.}
\end{figure}

%\FloatBarrier
Here is some text.

\end{document}

相关内容