包括两张图,第一张代替第二张

包括两张图,第一张代替第二张

我想将两个不同的图形集成到我的文档中。第一个图形的工作方式如下:

some text...
\begin{figure}[h!]
 \includegraphics[natwidth=538,natheight=540, scale=0.5]{../gfx/pic1}
 \caption{someCaption \cite{pic1}}
\end{figure}
some text...

当我尝试稍后在文档中添加另一张图片时,如下所示:

some text...
\begin{figure}[h!]
 \includegraphics[natwidth=621,natheight=167, scale=0.5]{../gfx/pic2}
 \caption{someCaption2 \cite{pic2}}
\end{figure}
some text...

然后第一张图片被显示两次(第一次出现在正确位置,第二次出现在第二张图片应该出现的位置),而第二张图片根本没有显示。这可能是什么原因造成的?(这是我的第一份文档LaTeX

编辑

它应该看起来像

some text some text some text some text 
PIC A
some text some text some text some text
PIC B
some text some text some text some text 

但看起来

some text some text some text some text 
PIC A
some text some text some text some text 
PIC A
some text some text some text some text   

答案1

尝试两种设置中的一种——当然,这在某种程度上取决于图像大小。

\documentclass{revtex4}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{blindtext}

\begin{document}
\blindtext

\section{A section}
\begin{figure}[h!]
 \includegraphics[natwidth=538,natheight=540, scale=0.5]{beeduck}
 \caption{someCaption} \label{pic1}%
\end{figure}

\blindtext


\blindtext
\begin{figure}[h!]
 \includegraphics[natwidth=538,natheight=540, scale=0.5]{rapsfeld}
 \caption{someCaption2} \label{pic2}%
\end{figure}

% Non floating images. 
\section{Another section}
\blindtext
\begin{center}
\includegraphics[natwidth=538,natheight=540, scale=0.5]{beeduck}
\captionof{figure}{someCaption3} \label{pic3}%
\end{center}

\blindtext
\begin{center}
\includegraphics[natwidth=538,natheight=540, scale=0.5]{rapsfeld}
\captionof{figure}{someCaption4} \label{pic4}%
\end{center}



\end{document}

相关内容