如何将图像插入.rnw文档

时间:2022-08-22 21:25:47

I work in R and deliver PDF file with Sweave, sweave(.rnw document). I need to put into my text a JPEG image. I didn't find any function on the web and have no ideas about how I could do that.

我在R工作并提供带有Sweave,sweave(.rnw文档)的PDF文件。我需要在文本中加入JPEG图像。我没有在网上找到任何功能,也没有关于如何做到这一点的想法。

1 个解决方案

#1


6  

You include it just like you include an image in any other LaTeX document:

您可以像在任何其他LaTeX文档中包含图像一样包含它:

http://amath.colorado.edu/documentation/LaTeX/reference/figures.html#pdf

http://amath.colorado.edu/documentation/LaTeX/reference/figures.html#pdf

\includegraphics{myimage.jpg}

Put it in a LaTeX block not an R code block. As the link points out, you'll need to compile with pdflatex.

将它放在LaTeX块中而不是R代码块中。正如链接指出的那样,您需要使用pdflatex进行编译。

#1


6  

You include it just like you include an image in any other LaTeX document:

您可以像在任何其他LaTeX文档中包含图像一样包含它:

http://amath.colorado.edu/documentation/LaTeX/reference/figures.html#pdf

http://amath.colorado.edu/documentation/LaTeX/reference/figures.html#pdf

\includegraphics{myimage.jpg}

Put it in a LaTeX block not an R code block. As the link points out, you'll need to compile with pdflatex.

将它放在LaTeX块中而不是R代码块中。正如链接指出的那样,您需要使用pdflatex进行编译。