我一直无法让图像在 PDF 中显示在我的代码中。我的代码示例如下所示。
We then plotted $\delta_1$ vs. R and got approximately a straight line.
\begin{center}
\begin{figure}
\label{Part B}
\includegraphics[scale=0.5]{LogDecGraph}
\caption{$\delta_1$ vs. R}
\end{figure}
\end{center}
From Figure 4, we can see that the zero intercept is 0.79773 $\pm$ 0.04161 which is our circuit's effective additional resistance. As stated before, a large source of error was the weak precision of Data Reader because it rounded the amplitudes to one decimal place.
我希望图像 (LogDecGraph) 出现在两个段落之间,但它没有出现,而是出现在下一页并占据了整个页面。任何建议都值得赞赏。我看过类似的主题,但似乎都没有解决我的问题。
答案1
如果您确实不希望图形及其相关标题浮动(在 LaTeX 意义上),请不要使用浮动环境(例如figure
)。相反,(i) 加载caption
包,(ii) 省略语句\begin{figure}
和\end{figure}
,以及 (iii) 写入\captionof{figure}{...}
(而不是\caption{...}
)。
总结一下:
% in preamble:
\usepackage{caption} % for \captionof macro
% in body of text:
...
\begin{center}
\includegraphics[scale=0.5]{LogDecGraph}
\captionof{figure}{$\delta_1$ vs.\ R} \label{Part B} % "\label" must come after "\captionof"
\end{center}
...
答案2
在 \begin{figure} 之后立即尝试输入 [!htb]