我是用乳胶写的。我是新手,需要一些帮助。
我需要添加数字。我可以用下面的代码来做到这一点
\begin{figure}[h]
\includegraphics[width = 15cm]{figures/mlpStrSingle}
\caption{MLP neural network for one single output node}
\label{fig:mlp}
\end{figure}
Run Code Online (Sandbox Code Playgroud)
如果我使用它,该图将转到下一页。我需要在文本之后立即使用它。那么下一个文本应该开始。我怎样才能做到这一点?
提前致谢。
有几种可能性:
最好的方法是接受乳胶为图像找到的位置,而不是对抗它。乳胶非常适合确定漂浮物的最佳位置。如果图像飘走了,这通常意味着它确实应该放置在其他地方,例如,如果您放置它的位置没有足够的空间。您的图像也非常宽 - 15 厘米比大多数标准类的可用文本宽度更宽,因此很难找到适合它的位置。
第二个最好的:尝试 float 包中的选项是否[H]可以强制您想要的位置。这可能很可能会导致布局不理想。
如果您根本不希望图像浮动,请不要使用浮动。
\documentclass{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{caption}
\usepackage{lipsum}
\begin{document}
\section{Embrace the decision of latex}
\lipsum[2]
\begin{figure}[htbp]
\includegraphics[width=3cm]{example-image-duck}
\caption{MLP neural network for one single output node}
\label{fig:mlp}
\end{figure}
\lipsum[2]
\section{Insist on the position}
\lipsum[2]
\begin{figure}[H]
\includegraphics[width=3cm,page=2]{example-image-duck}
\caption{MLP neural network for one single output node}
\label{fig:mlpa}
\end{figure}
\lipsum[2]
\section{Don't use a float}
\lipsum[2]
%\begin{figure}[htbp]
\includegraphics[width=3cm,page=3]{example-image-duck}
\captionof{figure}{MLP neural network for one single output node}
% \label{fig:mlp}
%\end{figure}
\lipsum[2]
\end{document}
Run Code Online (Sandbox Code Playgroud)