无knitrout和verbatim环境的块输出

无knitrout和verbatim环境的块输出,r,latex,knitr,sweave,R,Latex,Knitr,Sweave,在.tex文件中没有任何环境的情况下,如何仅获取\includegraphics{…}?我不知道您首先为什么要使用Knitr。看起来您只是想在latex文档中包含PDF。为此,我将使用以下命令: \begin{knitrout} \definecolor{shadecolor}{rgb}{1, 1, 1}\color{fgcolor}\begin{kframe} \begin{verbatim} \includegraphics[width=\maxwidth]{figure/Kompetenz

在.tex文件中没有任何环境的情况下,如何仅获取\includegraphics{…}?

我不知道您首先为什么要使用Knitr。看起来您只是想在latex文档中包含PDF。为此,我将使用以下命令:

\begin{knitrout}
\definecolor{shadecolor}{rgb}{1, 1, 1}\color{fgcolor}\begin{kframe}
\begin{verbatim}
\includegraphics[width=\maxwidth]{figure/Kompetenz1.pdf}
\end{verbatim}
\end{kframe}
\end{knitrout}


在您的Rnw文件中。这里不需要刀子块。

来自@baptiste的答案是正确的

我之所以使用Knitr块是为了循环一些值。下面是我的示例代码:

\includegraphics[width=\maxwidth]{figure/Kompetenz1.pdf}
=
对于(i in 1:nrow(komptenzen)){
目录(粘贴(“\\includegraphics[width=\\maxwidth]figure/Kompetenz.pdf}”,i,“\\newline”,sep=”“)
}
@
谢谢你的帮助

\includepdf[pages=-]{figure/Kompetenz1.pdf}
\includegraphics[width=\maxwidth]{figure/Kompetenz1.pdf}
<<Ueberblick, echo = FALSE, results = 'asis'>>=
for(i in 1:nrow(Kompetenzen)){ 
    cat(paste("\\includegraphics[width=\\maxwidth]figure/Kompetenz.pdf}",i," \\newline ",sep=""))
}

@