如何在Latex中添加jpg图像

qwe*_*rty 91 latex latex-environment

我想在段落后面插入一个.jpg图像(位于我当前文件夹中,.tex文件所在的位置).我怎么能在乳胶中做到这一点?我应该包括什么/我应该使用什么命令?

Jon*_*FTW 176

您需要使用图形库.把它放在你的序言中:

\usepackage{graphicx}
Run Code Online (Sandbox Code Playgroud)

然后,您可以添加如下图像:

\begin{figure}[ht!]
\centering
\includegraphics[width=90mm]{fixed_dome1.jpg}
\caption{A simple caption \label{overflow}}
\end{figure}
Run Code Online (Sandbox Code Playgroud)

这是我在文档中使用的基本模板.应根据您的需要调整位置和大小.有关在\figure和中使用哪些参数的更多信息,请参阅下面的指南\includegraphics.然后,您可以使用图中给出的标签参考文本中的图像:

And here we see figure \ref{overflow}.
Run Code Online (Sandbox Code Playgroud)

请阅读此指南以获取更详细的说明:http: //en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions


小智 9

如果添加jpg,png,pdf图片,则应使用pdflatex进行编译.